--- lib/Search/TokyoDystopia.pm 2008/08/17 22:58:23 9 +++ lib/Search/TokyoDystopia.pm 2008/08/17 23:53:11 10 @@ -10,14 +10,86 @@ 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 +); + =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 = Search::TokyoDystopia::tcidberrmsg( $ecode ); + +=head2 tcidbnew + + my $idb = Search::TokyoDystopia::tcidbnew; + +=head2 tcidbdel + + Search::TokyoDystopia::tcidbdel( $idb ); + +=head2 tcidbecode + + my $ecode = Search::TokyoDystopia::tcidbecode( $idb ); + +=head2 tcidbtune + + my $success = Search::TokyoDystopia::tcidbtune( $idb, $ernum, $etnum, $iusiz, IDBTLARGE || IDBTDEFLATE ); =cut +use constant { + IDBTLARGE => 1 << 0, + IDBTDEFLATE => 1 << 1, + IDBTTCBS => 1 << 2, +}; + +=head2 tcidbsetcache + + my $success = Search::TokyoDystopia::tcidbsetcache( $idb, $icsiz, $lcnum ); + +=head2 tcidbsetfwmmax + + my $success = Search::TokyoDystopia::tcidbsetfwmmax( $idb, $fwnum ); + +=head2 tcidbopen + + Search::TokyoDystopia::tcidbopen( $idb, 'casket', IDBOTRUNC ), 1, 'tcidbopen' ); + +=cut + +use constant { + IDBOREADER => 1 << 0, + IDBOWRITER => 1 << 1, + IDBOCREAT => 1 << 2, + IDBOTRUNC => 1 << 3, + IDBONOLCK => 1 << 4, + IDBOLCKNB => 1 << 5, +}; + =head1 KNOWN BUGS Low-level functions often just die when called on invalid (or deleted) database