Search new_search( dbh *db, Z8 *method, Z8 *arg, int ascii, int limit, int corpussize, char * corpusfile) { Search s = malloc( sizeof(Search_) ); int plugin = 0; int j; if (limit < 1) { limit = DEFAULT_PRINT_LIMIT; } if (s == NULL) { return NULL; } s->db = db; s->depth = MAXBATCHES; s->depth_r = 0; s->batches = malloc( sizeof(Batch_) * MAXBATCHES); s->hit_def = new_hitdef( MAXBATCHES ); s->bn = 0; s->bincorpus = 1; s->corpus = NULL; s->map = NULL; s->debug = 0; s->print_limit = limit; s->batch_limit = DEFAULT_BATCH_LIMIT; s->n_printed = 0; s->soft_limit = 0; s->exitcode = 0; set_search_method(s, method, arg); if (ascii) { s->hit_def->output = HIT_OUT_ASCII; } if (corpussize && corpusfile) { set_corpus(s,corpusfile,corpussize); } return s; }
int main(int argc, char **argv) { int corpus_len; int inst = 0; int i; set_corpus(); display_corpus(); return 0; }