--- lib/Search/TokyoDystopia.pm 2008/08/17 22:17:40 1 +++ lib/Search/TokyoDystopia.pm 2008/08/18 17:27:11 16 @@ -10,13 +10,105 @@ our $debug = 0; XSLoader::load('Search::TokyoDystopia', $VERSION); +our @EXPORT = qw( +tcidberrmsg +tcidbnew +tcidbdel +tcidbnew +tcidbecode +tcidbtune +IDBTLARGE +IDBTDEFLATE +IDBTTCBS +tcidbsetcache +tcidbsetfwmmax +tcidbopen +IDBOREADER +IDBOWRITER +IDBOCREAT +IDBOTRUNC +IDBONOLCK +IDBOLCKNB +tcidbclose +tcidbput +tcidbout +); + =head1 NAME Search::TokyoDystopia - XS bindings for Tokyo Dystopia -=head1 METHODS +=head1 EXPORTS + +If you don't prevent it, it will export all kind of stuff into your namespace to cut down on typing. + +=head2 tcidberrmsg + + my $message = tcidberrmsg( $ecode ); + +=head2 tcidbnew + + my $idb = tcidbnew; + +=head2 tcidbdel + + tcidbdel( $idb ); + +=head2 tcidbecode + + my $ecode = tcidbecode( $idb ); + +=head2 tcidbtune + + my $success = tcidbtune( $idb, $ernum, $etnum, $iusiz, IDBTLARGE | IDBTDEFLATE ); + +=cut + +use constant { + IDBTLARGE => 1 << 0, + IDBTDEFLATE => 1 << 1, + IDBTTCBS => 1 << 2, +}; + +=head2 tcidbsetcache + + my $success = tcidbsetcache( $idb, $icsiz, $lcnum ); + +=head2 tcidbsetfwmmax + + my $success = tcidbsetfwmmax( $idb, $fwnum ); + +=head2 tcidbopen + + my $success = tcidbopen( $idb, 'casket', IDBOWRITER | IDBOCREAT ); =cut +use constant { + IDBOREADER => 1 << 0, + IDBOWRITER => 1 << 1, + IDBOCREAT => 1 << 2, + IDBOTRUNC => 1 << 3, + IDBONOLCK => 1 << 4, + IDBOLCKNB => 1 << 5, +}; + +=head2 tcidbclose + + my $success = tcidbclose( $idb ); + +=head2 tcidbput + + my $success = tcidbput( $idb, $id, $utf8_text ); + +=head2 tcidbout + + my $success = tcidbout( $idb, $id ); + +=head1 KNOWN BUGS + +Low-level functions often just die when called on invalid (or deleted) database + +=cut 1;