Permalink
Browse files

sync with tokyotyrant-1.4.30.tar.gz

  • Loading branch information...
1 parent 02992e5 commit 5cb3d3fc93b04b0738298727255ac1b9ba29920f Clément Nodet committed Jul 24, 2009
Showing with 463 additions and 49 deletions.
  1. +9 −1 ChangeLog
  2. +10 −10 configure
  3. +2 −2 configure.in
  4. +1 −1 doc/index.html
  5. +1 −1 doc/index.ja.html
  6. +3 −3 doc/spex-en.html
  7. +5 −5 doc/spex-ja.html
  8. +1 −1 example/Makefile
  9. +3 −2 example/tctsearch.c
  10. +2 −2 example/tctsearch.tmpl
  11. +102 −0 lab/htmltotsv
  12. +235 −0 lab/wgettsv
  13. +1 −1 man/tcfdb.3
  14. +2 −2 man/tctdb.3
  15. +44 −3 tcadb.c
  16. +1 −1 tcbdb.h
  17. +1 −1 tcfdb.h
  18. +1 −1 tchdb.h
  19. +21 −2 tctdb.c
  20. +9 −3 tctdb.h
  21. +3 −0 tcttest.c
  22. +4 −2 tcutil.c
  23. +2 −2 tcutil.h
  24. +0 −3 tokyocabinet.idl
View
@@ -1,6 +1,14 @@
+2009-07-13 Mikio Hirabayashi <mikio@users.sourceforge.net>
+
+ * tctdb.c (tctdbstrtometasearcytype): new function.
+
+ * tcadb.c (tcadbmisc): "metasearch" command was added.
+
+ - Release: 1.4.30
+
2009-07-03 Mikio Hirabayashi <mikio@users.sourceforge.net>
- * tctdb.c (tctdbidxgetbyftsunion): efficiency couting sort was improved.
+ * tctdb.c (tctdbidxgetbyftsunion): efficiency counting sort was improved.
- Release: 1.4.29
View
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for tokyocabinet 1.4.29.
+# Generated by GNU Autoconf 2.63 for tokyocabinet 1.4.30.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
@@ -594,8 +594,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='tokyocabinet'
PACKAGE_TARNAME='tokyocabinet'
-PACKAGE_VERSION='1.4.29'
-PACKAGE_STRING='tokyocabinet 1.4.29'
+PACKAGE_VERSION='1.4.30'
+PACKAGE_STRING='tokyocabinet 1.4.30'
PACKAGE_BUGREPORT=''
# Factoring default headers for most tests.
@@ -1283,7 +1283,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures tokyocabinet 1.4.29 to adapt to many kinds of systems.
+\`configure' configures tokyocabinet 1.4.30 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1344,7 +1344,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of tokyocabinet 1.4.29:";;
+ short | recursive ) echo "Configuration of tokyocabinet 1.4.30:";;
esac
cat <<\_ACEOF
@@ -1448,7 +1448,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-tokyocabinet configure 1.4.29
+tokyocabinet configure 1.4.30
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1462,7 +1462,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by tokyocabinet $as_me 1.4.29, which was
+It was created by tokyocabinet $as_me 1.4.30, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -1833,7 +1833,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# Package information
MYLIBVER=8
-MYLIBREV=20
+MYLIBREV=21
MYFORMATVER="1.0"
# Targets
@@ -6719,7 +6719,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by tokyocabinet $as_me 1.4.29, which was
+This file was extended by tokyocabinet $as_me 1.4.30, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -6769,7 +6769,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-tokyocabinet config.status 1.4.29
+tokyocabinet config.status 1.4.30
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
View
@@ -7,11 +7,11 @@
#================================================================
# Package name
-AC_INIT(tokyocabinet, 1.4.29)
+AC_INIT(tokyocabinet, 1.4.30)
# Package information
MYLIBVER=8
-MYLIBREV=20
+MYLIBREV=21
MYFORMATVER="1.0"
# Targets
View
@@ -126,7 +126,7 @@ <h2 id="packages">Packages</h2>
<p>The following are the source packages of Tokyo Cabinet. As for binary packages, see the site of each distributor.</p>
<ul>
-<li><a href="tokyocabinet-1.4.29.tar.gz">Latest Source Package (version 1.4.29)</a></li>
+<li><a href="tokyocabinet-1.4.30.tar.gz">Latest Source Package (version 1.4.30)</a></li>
<li><a href="pastpkg/">Past Versions</a></li>
</ul>
View
@@ -167,7 +167,7 @@ <h2 id="packages">ダウンロード</h2>
<p>以下のソースパッケージをダウンロードしてください。バイナリパッケージについては、各ディストリビュータのサイトをご覧ください。</p>
<ul>
-<li><a href="tokyocabinet-1.4.29.tar.gz">最新のソースパッケージ(バージョン1.4.29)</a></li>
+<li><a href="tokyocabinet-1.4.30.tar.gz">最新のソースパッケージ(バージョン1.4.30)</a></li>
<li><a href="pastpkg/">過去のバージョン</a></li>
</ul>
View
@@ -4547,7 +4547,7 @@ <h3 id="tcfdbapi_api">API</h3>
<dt><code>bool tcfdbsetmutex(TCFDB *<var>fdb</var>);</code></dt>
<dd>`<var>fdb</var>' specifies the fixed-length database object which is not opened.</dd>
<dd>If successful, the return value is true, else, it is false.</dd>
-<dd>Note that the mutual exclusion control is needed if the object is shared by plural threads and this function should should be called before the database is opened.</dd>
+<dd>Note that the mutual exclusion control is needed if the object is shared by plural threads and this function should be called before the database is opened.</dd>
</dl>
<p>The function `tcfdbtune' is used in order to set the tuning parameters of a fixed-length database object.</p>
@@ -5235,7 +5235,7 @@ <h3 id="tctdbapi_api">API</h3>
<dt><code>bool tctdbsetmutex(TCTDB *<var>tdb</var>);</code></dt>
<dd>`<var>tdb</var>' specifies the table database object which is not opened.</dd>
<dd>If successful, the return value is true, else, it is false.</dd>
-<dd>Note that the mutual exclusion control is needed if the object is shared by plural threads and this function should should be called before the database is opened.</dd>
+<dd>Note that the mutual exclusion control is needed if the object is shared by plural threads and this function should be called before the database is opened.</dd>
</dl>
<p>The function `tctdbtune' is used in order to set the tuning parameters of a table database object.</p>
@@ -5745,7 +5745,7 @@ <h3 id="tctdbapi_api">API</h3>
<dd>If successful, the return value is true, else, it is false.</dd>
</dl>
-<p>The function `tctdbqryhint' is used in order to get the hint of a query object.</p>
+<p>The function `tctdbqryhint' is used in order to get the hint string of a query object.</p>
<dl class="api">
<dt><code>const char *tctdbqryhint(TDBQRY *<var>qry</var>);</code></dt>
View
@@ -2951,7 +2951,7 @@ <h3 id="tchdbapi_api">API(英語ゴメン)</h3>
<dt><code>bool tchdbsetmutex(TCHDB *<var>hdb</var>);</code></dt>
<dd>`<var>hdb</var>' specifies the hash database object which is not opened.</dd>
<dd>If successful, the return value is true, else, it is false.</dd>
-<dd>Note that the mutual exclusion control is needed if the object is shared by plural threads and this function should should be called before the database is opened.</dd>
+<dd>Note that the mutual exclusion control is needed if the object is shared by plural threads and this function should be called before the database is opened.</dd>
</dl>
<p>The function `tchdbtune' is used in order to set the tuning parameters of a hash database object.</p>
@@ -3625,7 +3625,7 @@ <h3 id="tcbdbapi_api">API(英語ゴメソ)</h3>
<dt><code>bool tcbdbsetmutex(TCBDB *<var>bdb</var>);</code></dt>
<dd>`<var>bdb</var>' specifies the B+ tree database object which is not opened.</dd>
<dd>If successful, the return value is true, else, it is false.</dd>
-<dd>Note that the mutual exclusion control is needed if the object is shared by plural threads and this function should should be called before the database is opened.</dd>
+<dd>Note that the mutual exclusion control is needed if the object is shared by plural threads and this function should be called before the database is opened.</dd>
</dl>
<p>The function `tcbdbsetcmpfunc' is used in order to set the custom comparison function of a B+ tree database object.</p>
@@ -4549,7 +4549,7 @@ <h3 id="tcfdbapi_api">API(英語スマソ)</h3>
<dt><code>bool tcfdbsetmutex(TCFDB *<var>fdb</var>);</code></dt>
<dd>`<var>fdb</var>' specifies the fixed-length database object which is not opened.</dd>
<dd>If successful, the return value is true, else, it is false.</dd>
-<dd>Note that the mutual exclusion control is needed if the object is shared by plural threads and this function should should be called before the database is opened.</dd>
+<dd>Note that the mutual exclusion control is needed if the object is shared by plural threads and this function should be called before the database is opened.</dd>
</dl>
<p>The function `tcfdbtune' is used in order to set the tuning parameters of a fixed-length database object.</p>
@@ -5237,7 +5237,7 @@ <h3 id="tctdbapi_api">API(英語スマメ)</h3>
<dt><code>bool tctdbsetmutex(TCTDB *<var>tdb</var>);</code></dt>
<dd>`<var>tdb</var>' specifies the table database object which is not opened.</dd>
<dd>If successful, the return value is true, else, it is false.</dd>
-<dd>Note that the mutual exclusion control is needed if the object is shared by plural threads and this function should should be called before the database is opened.</dd>
+<dd>Note that the mutual exclusion control is needed if the object is shared by plural threads and this function should be called before the database is opened.</dd>
</dl>
<p>The function `tctdbtune' is used in order to set the tuning parameters of a table database object.</p>
@@ -5747,7 +5747,7 @@ <h3 id="tctdbapi_api">API(英語スマメ)</h3>
<dd>If successful, the return value is true, else, it is false.</dd>
</dl>
-<p>The function `tctdbqryhint' is used in order to get the hint of a query object.</p>
+<p>The function `tctdbqryhint' is used in order to get the hint string of a query object.</p>
<dl class="api">
<dt><code>const char *tctdbqryhint(TDBQRY *<var>qry</var>);</code></dt>
View
@@ -1,4 +1,4 @@
-# Makefile for sample programs of Hyper Estraier
+# Makefile for sample programs of Tokyo Cabinet
View
@@ -48,7 +48,7 @@ static void proc(TCTMPL *tmpl, TCMPOOL *mpool){
tctdbqrysetorder(qrys[i], "title", TDBQOSTRASC);
}
tctdbqryaddcond(qrys[0], "title", TDBQCFTSEX, expr);
- tctdbqryaddcond(qrys[1], "text", TDBQCFTSEX, expr);
+ tctdbqryaddcond(qrys[1], "body", TDBQCFTSEX, expr);
double stime = tctime();
TCLIST *res = tcmpoolpushlist(mpool, tctdbmetasearch(qrys, 2, TDBMSUNION));
int rnum = tclistnum(res);
@@ -71,7 +71,8 @@ static void proc(TCTMPL *tmpl, TCMPOOL *mpool){
tcxstrcat2(snip, " ...");
char *hlstr = tcregexreplace(tcxstrptr(snip), "\t([^\t]*)\t", "<strong>\\1</strong>");
tcmapput2(cols, "snippet", tcmpoolpushptr(mpool, hlstr));
- const char *url = tcmapget4(cols, "path", "/");
+ const char *url = tcmapget4(cols, "url", "/");
+ url = tcmpoolpushptr(mpool, tcregexreplace(url, "*^[a-z]+://", ""));
if(rbef) url = tcmpoolpushptr(mpool, tcregexreplace(url, rbef, raft ? raft : ""));
if(url) tcmapprintf(cols, "url", "%s", url);
tclistpushmap(docs, cols);
View
@@ -87,9 +87,9 @@ function startup(){
<div class="url">code.google.com/p/bayon/</div>
</div>
<div class="sidelink">
-<h3 class="title"><a href="http://code.google.com/p/skyfall/">Skyfall</a></h3>
+<h3 class="title"><a href="http://code.google.com/p/skyload/">Skyload</a></h3>
<div class="snippet">Load tests against Drizzle/MySQL servers.</div>
-<div class="url">code.google.com/p/skyfall/</div>
+<div class="url">code.google.com/p/skyload/</div>
</div>
</div>
[% FOREACH docs doc \%]
View
@@ -0,0 +1,102 @@
+#! /usr/bin/perl
+
+#================================================================
+# htmldoctotsv
+# Generate TSV data from HTML documents
+#================================================================
+
+use strict;
+use warnings;
+use Encode;
+use Cwd 'realpath';
+
+my $path = '.';
+my $mode_kv = 0;
+my $mode_hex = 0;
+
+for(my $i = 0; $i < scalar(@ARGV); $i++){
+ my $arg = $ARGV[$i];
+ if($arg =~ /^-/){
+ if($arg eq '-kv'){
+ $mode_kv = 1;
+ } elsif($arg eq '-x'){
+ $mode_hex = 1;
+ }
+ } else {
+ $path = $arg;
+ }
+}
+
+sub trimhtml {
+ my $text = shift;
+ $text =~ s/<[^>]*>/ /g;
+ $text =~ s/&lt;/</g;
+ $text =~ s/&gt;/>/g;
+ $text =~ s/&quot;/"/g;
+ $text =~ s/&nbsp;/ /g;
+ $text =~ s/&amp;/\&/g;
+ $text =~ s/\s+/ /g;
+ $text =~ s/^ *//;
+ $text =~ s/ *$//;
+ return $text;
+}
+
+$ENV{LANG} = "C";
+$ENV{LC_ALL} = "C";
+open(my $lfh, "find $path -type f -iregex '.*\.html?' -print | sort |") || die("could not open");
+my $id = 0;
+while(defined($path = <$lfh>)){
+ chomp($path);
+ $path = realpath($path);
+ next if(!defined($path));
+ my @stat = stat($path);
+ next if(scalar(@stat) < 10);
+ my $mtime = $stat[9];
+ open(my $ifh, "<$path") || next;
+ my $encname = "UTF-8";
+ my @lines;
+ while(defined(my $line = <$ifh>)){
+ push(@lines, $line);
+ if($line =~ /<meta.*content-type.*charset=/i){
+ $line =~ s/.*charset=?//i;
+ $line =~ s/[^-_a-zA-Z0-9].*//;
+ chomp($line);
+ $encname = $line if(length($line) > 0);
+ }
+ }
+ my $text = join('', @lines);
+ $text = encode("UTF-8", decode($encname, $text)) if($encname ne "UTF-8");
+ $text =~ s/<!--.*?-->//is;
+ my $title = "";
+ if($text =~ /<title[^>]*>[^<]*<\/title>/i){
+ $title = $text;
+ $title =~ s/.*<title[^>]*>([^<]*)<\/title>.*/$1/is;
+ $title = trimhtml($title);
+ }
+ $text =~ s/.*<body[^>]*>(.*)<\/body>.*/$1/is;
+ $text =~ s/<style[^>]*>.*?<\/style>//is;
+ $text =~ s/<script[^>]*>.*?<\/script>//is;
+ $text = trimhtml($text);
+ next if(length($title) < 1 && length($text) < 1);
+ $id++;
+ my $key = $mode_hex ? sprintf("%X", $id) : $id;
+ printf STDERR ("%d: saving: %s\n", $id, $path);
+ if($mode_kv){
+ $text = $title . " " . $text if(length($title) > 0);
+ printf("%s\t%s\n", $key, $text);
+ } else {
+ printf("%s", $key);
+ printf("\turl\t%s", $path);
+ printf("\tsize\t%s", length($text));
+ printf("\tmtime\t%s", $mtime);
+ printf("\ttitle\t%s", $title) if(length($title) > 0);
+ printf("\tbody\t%s", $text);
+ printf("\n");
+ }
+ close($ifh);
+}
+close($lfh);
+
+
+
+# END OF FILE
Oops, something went wrong.

0 comments on commit 5cb3d3f

Please sign in to comment.