/[Search-TokyoDystopia]/TokyoDystopia.xs
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /TokyoDystopia.xs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 17 by dpavlin, Mon Aug 18 17:45:56 2008 UTC revision 18 by dpavlin, Mon Aug 18 18:28:05 2008 UTC
# Line 141  PPCODE: Line 141  PPCODE:
141          }          }
142          XSRETURN(1);          XSRETURN(1);
143    
144    
145    void
146    tcidbsearch(idb, word, smode)
147            void *  idb
148            SV *    word
149            int     smode
150    PREINIT:
151            AV *av;
152            STRLEN wsize;
153            uint64_t *results;
154            const char *wbuf;
155            int i, rnum;
156    PPCODE:
157            wbuf = SvPV(word, wsize);
158            results = tcidbsearch(idb, wbuf, smode, &rnum);
159            if ( rnum > 0 ) {
160              av = newAV();
161              for(i = 0; i < rnum; i++){
162                av_push(av, newSViv( (int)results[i] ));
163              }
164              XPUSHs(sv_2mortal(newRV_noinc((SV *)av)));
165            } else {
166              XPUSHs((SV *)&PL_sv_undef);
167            }
168            XSRETURN(1);
169    

Legend:
Removed from v.17  
changed lines
  Added in v.18

  ViewVC Help
Powered by ViewVC 1.1.26