Changeset 115 for trunk/gsdl/src/colservr
- Timestamp:
- 1999-01-19T14:38:20+13:00 (25 years ago)
- Location:
- trunk/gsdl/src/colservr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/colservr/mgq.c
r112 r115 12 12 /* 13 13 $Log$ 14 Revision 1.3 1999/01/19 01:38:16 rjmcnab 15 Made the source more portable. 16 14 17 Revision 1.2 1999/01/12 01:51:02 rjmcnab 15 18 … … 128 131 } 129 132 130 static int ProcessDocs (query_data * qd, int num, int skip, int howmany, int verbatim,131 enum result_kinds kind, FILE * Output,133 static int ProcessDocs (query_data * qd, int skip, int howmany, 134 enum result_kinds kind, 132 135 int (*sender)(char *,int,int,float,void *), void *ptr) 133 136 { … … 150 153 { 151 154 u_char *UDoc = NULL; 152 unsigned long ULen ;155 unsigned long ULen=0; 153 156 154 157 if (need_text) … … 179 182 case result_docs: 180 183 if (sender != NULL) 181 output_failure = (*sender)( UDoc,ULen,docnum,GetDocWeight(qd),ptr);184 output_failure = (*sender)((char *)UDoc,ULen,docnum,GetDocWeight(qd),ptr); 182 185 break; 183 186 default: … … 202 205 int (*sender)(char *,int,int,float,void *), void *ptr) 203 206 { 204 int i ;207 int i = 0; 205 208 for (i = 0; i < qtl->num; i++) 206 209 if (sender != NULL) { 207 210 /* word = word2str(qtl->QTE[i].Term); 208 211 (* sender)(word, strlen(word), qtl->QTE[i].Count, (float)0.0, ptr); */ 209 (* sender)( qtl->QTE[i].Term+1, qtl->QTE[i].Term[0],212 (* sender)((char *)(qtl->QTE[i].Term+1), qtl->QTE[i].Term[0], 210 213 qtl->QTE[i].Count, (float)0.0, ptr); 211 214 } … … 222 225 /* word = word2str(qtl->TE[i].Word); 223 226 (* sender)(word, strlen(word), qtl->TE[i].Count, (float)0.0, ptr);*/ 224 (* sender)( qtl->TE[i].Word+1, qtl->TE[i].Word[0],227 (* sender)((char *)(qtl->TE[i].Word+1), qtl->TE[i].Word[0], 225 228 qtl->TE[i].Count, (float)0.0, ptr); 226 229 } … … 243 246 case result_docnums: 244 247 if (qd->num_of_ans > 0) 245 ProcessDocs (qd, qd->DL->num, skip, howmany, 246 BooleanEnv (GetEnv ("verbatim"), 1), 247 kind, NULL, sender, ptr); 248 ProcessDocs (qd, skip, howmany, kind, sender, ptr); 248 249 break; 249 250 case result_termfreqs: … … 267 268 /* init_dbcache should be called at the start of each */ 268 269 /* function which deals with the database cache */ 269 static void init_dbcache ( ) {270 static void init_dbcache (void) { 270 271 static int dbcacheinited = 0; 271 int i ;272 int i = 0; 272 273 273 274 if (dbcacheinited) return; … … 288 289 289 290 /* returns the next cache access number and increments it */ 290 static int get_next_accessnum ( ) {291 static int get_next_accessnum (void) { 291 292 return cache_nextaccessnum++; 292 293 } … … 295 296 /* was used the longest time ago */ 296 297 /* init_dbcache should be called before this function */ 297 static int get_free_dbcache ( ) {298 int i ;298 static int get_free_dbcache (void) { 299 int i = 0; 299 300 int minaccessnum = cache_nextaccessnum; /* the current max */ 300 301 int minpos = 0; … … 315 316 /* init_dbcache should be called before this function */ 316 317 static int search_doc_collect (char *collection) { 317 int i ;318 int i = 0; 318 319 319 320 for (i=0; i<MAXNUMDATABASEINFO; i++) { … … 334 335 /* init_dbcache should be called before this function */ 335 336 static int search_gensuffix (char *gensuffix) { 336 int i ;337 int i = 0; 337 338 338 339 for (i=0; i<MAXNUMDATABASEINFO; i++) { … … 423 424 int mgq_ask(char *line) 424 425 { 425 query_data *qd = NULL; 426 char QueryType; char OutputType; char *LinePtr; 426 query_data *qd = (query_data *)NULL; 427 char QueryType = QUERY_BOOLEAN; 428 char OutputType = QUERY_DOCNUMS; 429 char *LinePtr = (char *)NULL; 427 430 428 431 if (cur_cachenum == -1) return 0; … … 461 464 case QUERY_BOOLEAN: 462 465 { 463 char *maxdocs ;466 char *maxdocs = (char *)NULL; 464 467 BooleanQueryInfo bqi; 465 468 maxdocs = GetDefEnv ("maxdocs", "all"); … … 477 480 case QUERY_RANKED: 478 481 { 479 char *maxdocs ;480 char *maxterms ;481 char *maxaccum ;482 char *maxdocs = (char *)NULL; 483 char *maxterms = (char *)NULL; 484 char *maxaccum = (char *)NULL; 482 485 RankedQueryInfo rqi; 483 486 maxdocs = GetDefEnv ("maxdocs", "all"); … … 547 550 548 551 549 int is_dbcache_full ( ) {552 int is_dbcache_full (void) { 550 553 init_dbcache (); 551 554 if (cache_numloaded >= MAXNUMDATABASEINFO) return 1; … … 555 558 int load_database (char *collection, char *mgdir, 556 559 char *gensuffix, char *textsuffix) { 557 int i ;560 int i = 0; 558 561 query_data *qd = NULL; 559 562 /* FILE *deb = NULL; */ … … 608 611 /* specified collection current */ 609 612 int load_text_database (char *collection) { 610 int i ;613 int i = 0; 611 614 init_dbcache (); 612 615 … … 622 625 } 623 626 624 void close_all_databases ( ) {625 int i ;627 void close_all_databases (void) { 628 int i = 0; 626 629 init_dbcache (); 627 630 -
trunk/gsdl/src/colservr/mgq.h
r110 r115 31 31 32 32 33 int is_dbcache_full ( );33 int is_dbcache_full (void); 34 34 int load_database (char *collection, char *mgdir, char *gensuffix, char *textsuffix); 35 35 int load_text_database (char *collection); 36 void close_all_databases ( );36 void close_all_databases (void); 37 37 38 38
Note:
See TracChangeset
for help on using the changeset viewer.