--- lib/Search/TokyoDystopia.pm 2008/08/17 23:53:11 10 +++ lib/Search/TokyoDystopia.pm 2008/08/18 18:28:05 18 @@ -29,6 +29,18 @@ IDBOTRUNC IDBONOLCK IDBOLCKNB +tcidbclose +tcidbput +tcidbout +tcidbget +tcidbsearch +IDBSSUBSTR +IDBSPREFIX +IDBSSUFFIX +IDBSFULL +IDBSTOKEN +IDBSTOKPRE +IDBSTOKSUF ); =head1 NAME @@ -41,23 +53,23 @@ =head2 tcidberrmsg - my $message = Search::TokyoDystopia::tcidberrmsg( $ecode ); + my $message = tcidberrmsg( $ecode ); =head2 tcidbnew - my $idb = Search::TokyoDystopia::tcidbnew; + my $idb = tcidbnew; =head2 tcidbdel - Search::TokyoDystopia::tcidbdel( $idb ); + tcidbdel( $idb ); =head2 tcidbecode - my $ecode = Search::TokyoDystopia::tcidbecode( $idb ); + my $ecode = tcidbecode( $idb ); =head2 tcidbtune - my $success = Search::TokyoDystopia::tcidbtune( $idb, $ernum, $etnum, $iusiz, IDBTLARGE || IDBTDEFLATE ); + my $success = tcidbtune( $idb, $ernum, $etnum, $iusiz, IDBTLARGE | IDBTDEFLATE ); =cut @@ -69,15 +81,15 @@ =head2 tcidbsetcache - my $success = Search::TokyoDystopia::tcidbsetcache( $idb, $icsiz, $lcnum ); + my $success = tcidbsetcache( $idb, $icsiz, $lcnum ); =head2 tcidbsetfwmmax - my $success = Search::TokyoDystopia::tcidbsetfwmmax( $idb, $fwnum ); + my $success = tcidbsetfwmmax( $idb, $fwnum ); =head2 tcidbopen - Search::TokyoDystopia::tcidbopen( $idb, 'casket', IDBOTRUNC ), 1, 'tcidbopen' ); + my $success = tcidbopen( $idb, 'casket', IDBOWRITER | IDBOCREAT ); =cut @@ -90,6 +102,38 @@ IDBOLCKNB => 1 << 5, }; +=head2 tcidbclose + + my $success = tcidbclose( $idb ); + +=head2 tcidbput + + my $success = tcidbput( $idb, $id, $text ); + +=head2 tcidbout + + my $success = tcidbout( $idb, $id ); + +=head2 tcidbget + + my $text = tcidbget( $idb, $id ); + +=head2 tcidbsearch + + my @ids = tcidbsearch( $idb, $word, IDBSSUBSTR ) + +=cut + +use constant { + IDBSSUBSTR => 0, # substring matching + IDBSPREFIX => 1, # prefix matching + IDBSSUFFIX => 2, # suffix matching + IDBSFULL => 3, # full matching + IDBSTOKEN => 4, # token matching + IDBSTOKPRE => 5, # token prefix matching + IDBSTOKSUF => 6, # token suffix matching +}; + =head1 KNOWN BUGS Low-level functions often just die when called on invalid (or deleted) database