/[Search-TokyoDystopia]/lib/Search/TokyoDystopia.pm
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 /lib/Search/TokyoDystopia.pm

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

revision 28 by dpavlin, Mon Aug 18 19:18:53 2008 UTC revision 32 by dpavlin, Tue Sep 2 16:13:06 2008 UTC
# Line 6  use warnings; Line 6  use warnings;
6  require Exporter;  require Exporter;
7  require XSLoader;  require XSLoader;
8  use base qw(Exporter);  use base qw(Exporter);
9  our $VERSION = '0.00';  our $VERSION = '0.01';
10  our $debug = 0;  our $debug = 0;
11  XSLoader::load('Search::TokyoDystopia', $VERSION);  XSLoader::load('Search::TokyoDystopia', $VERSION);
12    
# Line 51  tcidbcopy Line 51  tcidbcopy
51  tcidbpath  tcidbpath
52  tcidbrnum  tcidbrnum
53  tcidbfsiz  tcidbfsiz
54    
55    tdversion
56    tcqdberrmsg
57    tcqdbnew
58    tcqdbdel
59    tcqdbnew
60    tcqdbecode
61    tcqdbtune
62    QDBTLARGE
63    QDBTDEFLATE
64    QDBTTCBS
65    tcqdbsetcache
66    tcqdbsetfwmmax
67    tcqdbopen
68    QDBOREADER
69    QDBOWRITER
70    QDBOCREAT
71    QDBOTRUNC
72    QDBONOLCK
73    QDBOLCKNB
74    tcqdbclose
75    tcqdbput
76    tcqdbout
77    tcqdbget
78    tcqdbsearch
79    tcqdbsearch2
80    QDBSSUBSTR
81    QDBSPREFIX
82    QDBSSUFFIX
83    QDBSFULL
84    QDBSTOKEN
85    QDBSTOKPRE
86    QDBSTOKSUF
87    tcqdbiterinit
88    tcqdbiternext
89    tcqdbsync
90    tcqdboptimize
91    tcqdbvanish
92    tcqdbcopy
93    tcqdbpath
94    tcqdbrnum
95    tcqdbfsiz
96    
97  );  );
98    
99  =head1 NAME  =head1 NAME
100    
101  Search::TokyoDystopia - XS bindings for Tokyo Dystopia  Search::TokyoDystopia - XS bindings for Tokyo Dystopia
102    
103  =head1 EXPORTS  =head1 Core API
104    
105  If you don't prevent it, it will export all kind of stuff into your namespace to cut down on typing.  If you don't prevent it, it will export all kind of stuff into your namespace to cut down on typing.
106    void
107    tcqdbget(qdb, id)
108            void *  qdb
109            int     id
110    PREINIT:
111            char *vbuf;
112    PPCODE:
113            vbuf = tcqdbget(qdb, id);
114            if(vbuf){
115              XPUSHs(sv_2mortal(newSVpvn(vbuf, strlen(vbuf))));
116              tcfree(vbuf);
117            } else {
118              XPUSHs((SV *)&PL_sv_undef);
119            }
120            XSRETURN(1);
121    
122    
123    
124  =head2 tcidberrmsg  =head2 tcidberrmsg
125    
# Line 186  use constant { Line 246  use constant {
246    
247  =cut  =cut
248    
249    =head1 Q-gram API
250    
251    =head2 tcqdberrmsg
252    
253      my $message = tcqdberrmsg( $ecode );
254    
255    =head2 tcqdbnew
256    
257      my $qdb = tcqdbnew;
258    
259    =head2 tcqdbdel
260    
261      tcqdbdel( $qdb );
262    
263    =head2 tcqdbecode
264    
265      my $ecode = tcqdbecode( $qdb );
266    
267    =head2 tcqdbtune
268    
269      my $success = tcqdbtune( $qdb, $etnum, QDBTLARGE | QDBTDEFLATE );
270    
271    =cut
272    
273    use constant {
274            QDBTLARGE => 1 << 0,
275            QDBTDEFLATE => 1 << 1,
276            QDBTTCBS => 1 << 2,
277    };
278    
279    =head2 tcqdbsetcache
280    
281      my $success = tcqdbsetcache( $qdb, $icsiz, $lcnum );
282    
283    =head2 tcqdbsetfwmmax
284    
285      my $success = tcqdbsetfwmmax( $qdb, $fwnum );
286    
287    =head2 tcqdbopen
288    
289      my $success = tcqdbopen( $qdb, 'casket', QDBOWRITER | QDBOCREAT );
290    
291    =cut
292    
293    use constant {
294            QDBOREADER => 1 << 0,
295            QDBOWRITER => 1 << 1,
296            QDBOCREAT => 1 << 2,
297            QDBOTRUNC => 1 << 3,
298            QDBONOLCK => 1 << 4,
299            QDBOLCKNB => 1 << 5,
300    };
301    
302    =head2 tcqdbclose
303    
304      my $success = tcqdbclose( $qdb );
305    
306    =head2 tcqdbput
307    
308      my $success = tcqdbput( $qdb, $id, $text );
309    
310    =head2 tcqdbout
311      
312      my $success = tcqdbout( $qdb, $id );
313    
314    =head2 tcqdbsearch
315    
316      my $ids = tcqdbsearch( $qdb, $word, QDBSSUBSTR );
317    
318    =cut
319    
320    use constant {
321            QDBSSUBSTR => 0,                # substring matching
322            QDBSPREFIX => 1,                # prefix matching
323            QDBSUFFIX => 2,         # suffix matching
324            QDBFULL => 3,           # full matching
325            QDBTOKEN => 4,          # token matching
326            QDBTOKPRE => 5,         # token prefix matching
327            QDBTOKSUF => 6,         # token suffix matching
328    };
329    
330    =head2 tcqdbsync
331    
332      my $success = tcqdbsync( $qdb );
333    
334    =head2 tcqdboptimize
335    
336      my $success = tcqdboptimize( $qdb );
337    
338    =head2 tcqdbvanish
339    
340      my $success = tcqdbvanish( $qdb );
341    
342    =head2 tcqdbcopy
343    
344      my $success = tcqdbcopy( $qdb, '/path/of/copy' );
345    
346    =head2 tcqdbpath
347    
348      my $path = tcqdbpath( $qdb );
349    
350    =head2 tcqdbtnum
351    
352      my $number_of_records = tcqdbtnum( $qdb );
353    
354    =head2 tcqdbfsiz
355    
356      my $file_size = tcqdbtsiz( $qdb );
357    
358    =cut
359    
360  =head1 KNOWN BUGS  =head1 KNOWN BUGS
361    
362  Low-level functions often just die when called on invalid (or deleted) database  Low-level functions often just die when called on invalid (or deleted) database

Legend:
Removed from v.28  
changed lines
  Added in v.32

  ViewVC Help
Powered by ViewVC 1.1.26