1 |
package Search::TokyoDystopia; |
2 |
|
3 |
use strict; |
4 |
use warnings; |
5 |
|
6 |
require Exporter; |
7 |
require XSLoader; |
8 |
use base qw(Exporter); |
9 |
our $VERSION = '0.00'; |
10 |
our $debug = 0; |
11 |
XSLoader::load('Search::TokyoDystopia', $VERSION); |
12 |
|
13 |
our @EXPORT = qw( |
14 |
tcidberrmsg |
15 |
tcidbnew |
16 |
tcidbdel |
17 |
tcidbnew |
18 |
tcidbecode |
19 |
tcidbtune |
20 |
IDBTLARGE |
21 |
IDBTDEFLATE |
22 |
IDBTTCBS |
23 |
tcidbsetcache |
24 |
tcidbsetfwmmax |
25 |
tcidbopen |
26 |
IDBOREADER |
27 |
IDBOWRITER |
28 |
IDBOCREAT |
29 |
IDBOTRUNC |
30 |
IDBONOLCK |
31 |
IDBOLCKNB |
32 |
tcidbclose |
33 |
tcidbput |
34 |
tcidbout |
35 |
); |
36 |
|
37 |
=head1 NAME |
38 |
|
39 |
Search::TokyoDystopia - XS bindings for Tokyo Dystopia |
40 |
|
41 |
=head1 EXPORTS |
42 |
|
43 |
If you don't prevent it, it will export all kind of stuff into your namespace to cut down on typing. |
44 |
|
45 |
=head2 tcidberrmsg |
46 |
|
47 |
my $message = tcidberrmsg( $ecode ); |
48 |
|
49 |
=head2 tcidbnew |
50 |
|
51 |
my $idb = tcidbnew; |
52 |
|
53 |
=head2 tcidbdel |
54 |
|
55 |
tcidbdel( $idb ); |
56 |
|
57 |
=head2 tcidbecode |
58 |
|
59 |
my $ecode = tcidbecode( $idb ); |
60 |
|
61 |
=head2 tcidbtune |
62 |
|
63 |
my $success = tcidbtune( $idb, $ernum, $etnum, $iusiz, IDBTLARGE | IDBTDEFLATE ); |
64 |
|
65 |
=cut |
66 |
|
67 |
use constant { |
68 |
IDBTLARGE => 1 << 0, |
69 |
IDBTDEFLATE => 1 << 1, |
70 |
IDBTTCBS => 1 << 2, |
71 |
}; |
72 |
|
73 |
=head2 tcidbsetcache |
74 |
|
75 |
my $success = tcidbsetcache( $idb, $icsiz, $lcnum ); |
76 |
|
77 |
=head2 tcidbsetfwmmax |
78 |
|
79 |
my $success = tcidbsetfwmmax( $idb, $fwnum ); |
80 |
|
81 |
=head2 tcidbopen |
82 |
|
83 |
my $success = tcidbopen( $idb, 'casket', IDBOWRITER | IDBOCREAT ); |
84 |
|
85 |
=cut |
86 |
|
87 |
use constant { |
88 |
IDBOREADER => 1 << 0, |
89 |
IDBOWRITER => 1 << 1, |
90 |
IDBOCREAT => 1 << 2, |
91 |
IDBOTRUNC => 1 << 3, |
92 |
IDBONOLCK => 1 << 4, |
93 |
IDBOLCKNB => 1 << 5, |
94 |
}; |
95 |
|
96 |
=head2 tcidbclose |
97 |
|
98 |
my $success = tcidbclose( $idb ); |
99 |
|
100 |
=head2 tcidbput |
101 |
|
102 |
my $success = tcidbput( $idb, $id, $utf8_text ); |
103 |
|
104 |
=head1 KNOWN BUGS |
105 |
|
106 |
Low-level functions often just die when called on invalid (or deleted) database |
107 |
|
108 |
=cut |
109 |
|
110 |
1; |