Changeset 244 for Search-Namazu/trunk/Search-Namazu/Namazu.xs
- Timestamp:
- 03/28/06 13:48:18 (6 years ago)
- Files:
-
- 1 modified
-
Search-Namazu/trunk/Search-Namazu/Namazu.xs (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Search-Namazu/trunk/Search-Namazu/Namazu.xs
r217 r244 59 59 static int status = 0; 60 60 61 AV * call_search_main_c(char *query )61 AV * call_search_main_c(char *query, int maxget) 62 62 { 63 63 AV *retar; … … 67 67 status = 0; 68 68 retar = newAV(); 69 av_extend(retar, hlist.num - 1); 69 70 hlist = nmz_search(query); 70 71 status = hlist.stat; 71 72 for (i = 0; i < hlist.num; i ++) { 73 if (i < maxget) { 72 74 SV *ohlist = perl_eval_pv("new Search::Namazu::Result", TRUE); 73 75 dSP; … … 92 94 perl_call_method("set", G_DISCARD); 93 95 SvREFCNT_inc(ohlist); 94 av_ push(retar, ohlist);96 av_store(retar, i, ohlist); 95 97 FREETMPS; 96 98 LEAVE; 99 } else { 100 av_store(retar, i, &PL_sv_undef); 101 } 97 102 } 98 103 nmz_free_hlist(hlist); … … 105 110 106 111 void 107 call_search_main(query )112 call_search_main(query, maxget) 108 113 SV *query 114 int maxget 109 115 110 116 PPCODE: … … 117 123 nmz_codeconv_query(qstr); 118 124 strcpy(cqstr, qstr); 119 retar = call_search_main_c(cqstr );125 retar = call_search_main_c(cqstr, maxget); 120 126 #if ! defined(PERL_VERSION) 121 127 { /* workaround for only one result */ … … 130 136 131 137 SV* 132 call_search_main_ref(query )138 call_search_main_ref(query, maxget) 133 139 SV *query 140 int maxget 134 141 135 142 CODE: … … 142 149 nmz_codeconv_query(qstr); 143 150 strcpy(cqstr, qstr); 144 retar = call_search_main_c(cqstr );151 retar = call_search_main_c(cqstr, maxget); 145 152 nmz_free_internal(); 146 153 RETVAL = newRV_inc((SV*) retar); … … 203 210 void 204 211 nmz_setmaxhit(max) 205 int max ;212 int max 206 213 207 214 CODE:
