/[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 15 by dpavlin, Mon Aug 18 17:26:01 2008 UTC revision 19 by dpavlin, Mon Aug 18 18:32:55 2008 UTC
# Line 124  CODE: Line 124  CODE:
124  OUTPUT:  OUTPUT:
125          RETVAL          RETVAL
126    
127    
128    void
129    tcidbget(idb, id)
130            void *  idb
131            int     id
132    PREINIT:
133            char *vbuf;
134    PPCODE:
135            vbuf = tcidbget(idb, id);
136            if(vbuf){
137              XPUSHs(sv_2mortal(newSVpvn(vbuf, strlen(vbuf))));
138              tcfree(vbuf);
139            } else {
140              XPUSHs((SV *)&PL_sv_undef);
141            }
142            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    
170    
171    int
172    tcidbiterinit(idb)
173            void *  idb
174    CODE:
175            RETVAL = tcidbiterinit(idb);
176    OUTPUT:
177            RETVAL
178    

Legend:
Removed from v.15  
changed lines
  Added in v.19

  ViewVC Help
Powered by ViewVC 1.1.26