summaryrefslogtreecommitdiff
path: root/qdbm/misc
diff options
context:
space:
mode:
Diffstat (limited to 'qdbm/misc')
-rw-r--r--qdbm/misc/COPYING.txt504
-rw-r--r--qdbm/misc/README-win32.txt101
-rw-r--r--qdbm/misc/VCmakefile-old169
-rw-r--r--qdbm/misc/benchmark.pdfbin52196 -> 0 bytes
-rw-r--r--qdbm/misc/icon16.pngbin339 -> 0 bytes
-rw-r--r--qdbm/misc/icon20.pngbin275 -> 0 bytes
-rw-r--r--qdbm/misc/index.html202
-rw-r--r--qdbm/misc/index.ja.html209
-rw-r--r--qdbm/misc/logo.pngbin11430 -> 0 bytes
-rwxr-xr-xqdbm/misc/makevcdef48
-rw-r--r--qdbm/misc/mymemo-ja.html34
-rw-r--r--qdbm/misc/tutorial-ja.html622
-rw-r--r--qdbm/misc/win32check.bat111
13 files changed, 0 insertions, 2000 deletions
diff --git a/qdbm/misc/COPYING.txt b/qdbm/misc/COPYING.txt
deleted file mode 100644
index b1e3f5a2..00000000
--- a/qdbm/misc/COPYING.txt
+++ /dev/null
@@ -1,504 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
diff --git a/qdbm/misc/README-win32.txt b/qdbm/misc/README-win32.txt
deleted file mode 100644
index d5a98e2d..00000000
--- a/qdbm/misc/README-win32.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-================================================================
- QDBM: Quick Database Manager
- Copyright (C) 2000-2007 Mikio Hirabayashi
-================================================================
-
-This is a package of Win32 binaries of QDBM. It contains C/Java
-APIs, their utility commands, and CGI scripts.
-
-See http://qdbm.sourceforge.net/ for more information.
-
-
-The following are documents of specifications.
-
- spex.html : fundamental specifications
- spex-ja.html : fundamental specifications in Japanese
- jspex.html : specifications of Java API
- jspex-ja.html : specifications of Java API in Japanese
- japidoc/ : documents of Java API
-
-
-The following are header files of C language.
-Include them at source codes of your applications.
-
- depot.h
- curia.h
- relic.h
- hovel.h
- cabin.h
- villa.h
- vista.h
- odeum.h
-
-
-The following are dynamic linking libraries for the API of C.
-Copy them to the system directory or a directory of your project.
-
- qdbm.dll : QDBM itself
- libqdbm.dll.a : import library for `qdbm.dll'
- mgwz.dll : ZLIB
- libiconv-2.dll : ICONV
-
-
-The following is a dynamic linking library for the API of Java.
-Copy it to the system directory or a directory of your project.
-
- jqdbm.dll
-
-
-The following is a Java archive of the classes.
-Include it in the CLASSPATH of your environment.
-
- qdbm.jar
-
-
-The following are utility commands for testing and debugging.
-
- dpmgr.exe
- dptest.exe
- dptsv.exe
- crmgr.exe
- crtest.exe
- crtsv.exe
- rlmgr.exe
- rltest.exe
- hvmgr.exe
- hvtest.exe
- cbtest.exe
- cbcodec.exe
- vlmgr.exe
- vltest.exe
- vltsv.exe
- odmgr.exe
- odtest.exe
- odidx.exe
- qmttest.exe
-
-
-The sub directory `cgi' contains CGI scripts, their configuration
-files, and their specifications.
-
-If you want an import library or a static library for Visual C++,
-please obtain the source package and use VCmakefile in it.
-
-
-QDBM was released under the terms of the GNU Lesser General Public
-License. See the file `COPYING.txt' for details.
-
-QDBM was written by Mikio Hirabayashi. You can contact the author
-by e-mail to `mikio@users.sourceforge.net'. However, as for
-topics which can be shared among other users, pleae send it to
-the mailing list. To join the mailing list, refer to the following
-URL.
-
- http://lists.sourceforge.net/lists/listinfo/qdbm-users
-
-
-Thanks.
-
-
-
-== END OF FILE ==
diff --git a/qdbm/misc/VCmakefile-old b/qdbm/misc/VCmakefile-old
deleted file mode 100644
index 8cd55467..00000000
--- a/qdbm/misc/VCmakefile-old
+++ /dev/null
@@ -1,169 +0,0 @@
-# Makefile to build QDBM using Microsoft Visual C++
-
-
-
-#================================================================
-# Setting Variables
-#================================================================
-
-
-# Targets
-MYLIBS = qdbm.lib
-LIBOBJS = depot.obj curia.obj relic.obj hovel.obj \
- cabin.obj villa.obj vista.obj odeum.obj myconf.obj
-MYBINS = dpmgr.exe dptest.exe dptsv.exe crmgr.exe crtest.exe crtsv.exe \
- rlmgr.exe rltest.exe hvmgr.exe hvtest.exe cbtest.exe cbcodec.exe \
- vlmgr.exe vltest.exe vltsv.exe odmgr.exe odtest.exe odidx.exe
-
-# VC++ directory
-VCPATH = C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7
-
-# Building binaries
-CLFLAGS = /I "$(VCPATH)\Include" /I "$(VCPATH)\PlatformSDK\Include" /I "." /O2 /nologo
-LIBFLAGS = /libpath:"$(VCPATH)\lib" /libpath:"$(VCPATH)\PlatformSDK\Lib" /libpath:"." /nologo
-LINKFLAGS = /libpath:"$(VCPATH)\lib" /libpath:"$(VCPATH)\PlatformSDK\Lib" /libpath:"." /nologo
-
-
-
-#================================================================
-# Suffix rules
-#================================================================
-
-
-.SUFFIXES :
-.SUFFIXES : .c .obj
-
-.c.obj :
- cl /c $(CLFLAGS) $<
-
-
-
-#================================================================
-# Actions
-#================================================================
-
-
-all : $(MYLIBS) $(MYBINS)
-
-
-clean :
- del *.obj *.lib *.dll *.exp *.exe
-
-
-
-#================================================================
-# Building binaries
-#================================================================
-
-
-qdbm.lib : $(LIBOBJS)
- lib $(LIBFLAGS) /OUT:$@ $(LIBOBJS)
-
-
-dpmgr.exe : dpmgr.obj qdbm.lib
- link $(LINKFLAGS) /OUT:$@ dpmgr.obj qdbm.lib
-
-
-dptest.exe : dptest.obj qdbm.lib
- link $(LINKFLAGS) /OUT:$@ dptest.obj qdbm.lib
-
-
-dptsv.exe : dptsv.obj qdbm.lib
- link $(LINKFLAGS) /OUT:$@ dptsv.obj qdbm.lib
-
-
-crmgr.exe : crmgr.obj qdbm.lib
- link $(LINKFLAGS) /OUT:$@ crmgr.obj qdbm.lib
-
-
-crtest.exe : crtest.obj qdbm.lib
- link $(LINKFLAGS) /OUT:$@ crtest.obj qdbm.lib
-
-
-crtsv.exe : crtsv.obj qdbm.lib
- link $(LINKFLAGS) /OUT:$@ crtsv.obj qdbm.lib
-
-
-rlmgr.exe : rlmgr.obj qdbm.lib
- link $(LINKFLAGS) /OUT:$@ rlmgr.obj qdbm.lib
-
-
-rltest.exe : rltest.obj qdbm.lib
- link $(LINKFLAGS) /OUT:$@ rltest.obj qdbm.lib
-
-
-hvmgr.exe : hvmgr.obj qdbm.lib
- link $(LINKFLAGS) /OUT:$@ hvmgr.obj qdbm.lib
-
-
-hvtest.exe : hvtest.obj qdbm.lib
- link $(LINKFLAGS) /OUT:$@ hvtest.obj qdbm.lib
-
-
-cbtest.exe : cbtest.obj qdbm.lib
- link $(LINKFLAGS) /OUT:$@ cbtest.obj qdbm.lib
-
-
-cbcodec.exe : cbcodec.obj qdbm.lib
- link $(LINKFLAGS) /OUT:$@ cbcodec.obj qdbm.lib
-
-
-vlmgr.exe : vlmgr.obj qdbm.lib
- link $(LINKFLAGS) /OUT:$@ vlmgr.obj qdbm.lib
-
-
-vltest.exe : vltest.obj qdbm.lib
- link $(LINKFLAGS) /OUT:$@ vltest.obj qdbm.lib
-
-
-vltsv.exe : vltsv.obj qdbm.lib
- link $(LINKFLAGS) /OUT:$@ vltsv.obj qdbm.lib
-
-
-odmgr.exe : odmgr.obj qdbm.lib
- link $(LINKFLAGS) /OUT:$@ odmgr.obj qdbm.lib
-
-
-odtest.exe : odtest.obj qdbm.lib
- link $(LINKFLAGS) /OUT:$@ odtest.obj qdbm.lib
-
-
-odidx.exe : odidx.obj qdbm.lib
- link $(LINKFLAGS) /OUT:$@ odidx.obj qdbm.lib
-
-
-depot.obj : depot.h myconf.h
-
-curia.obj : depot.h curia.h myconf.h
-
-relic.obj : depot.h relic.h myconf.h
-
-hovel.obj : depot.h curia.h hovel.h myconf.h
-
-cabin.obj : cabin.h myconf.h
-
-villa.obj : depot.h cabin.h villa.h myconf.h
-
-vista.obj : depot.h curia.h cabin.h villa.h vista.h myconf.h
-
-odeum.obj : depot.h curia.h cabin.h villa.h myconf.h
-
-myconf.obj : myconf.h
-
-dpmgr.obj dptest.obj dptsv.obj : depot.h cabin.h
-
-crmgr.obj crtest.obj crtsv.obj : depot.h curia.h cabin.h
-
-rlmgr.obj rltest.obj : depot.h relic.h cabin.h
-
-hvmgr.obj hvtest.obj : depot.h curia.h hovel.h cabin.h
-
-cbtest.obj cbcodec.obj : cabin.h
-
-vlmgr.obj vltest.obj vltsv.obj : depot.h cabin.h villa.h
-
-odmgr.obj odtest.obj odidx.obj : depot.h curia.h cabin.h villa.h odeum.h
-
-
-
-# END OF FILE
diff --git a/qdbm/misc/benchmark.pdf b/qdbm/misc/benchmark.pdf
deleted file mode 100644
index 8b9df904..00000000
--- a/qdbm/misc/benchmark.pdf
+++ /dev/null
Binary files differ
diff --git a/qdbm/misc/icon16.png b/qdbm/misc/icon16.png
deleted file mode 100644
index 6d6ed13d..00000000
--- a/qdbm/misc/icon16.png
+++ /dev/null
Binary files differ
diff --git a/qdbm/misc/icon20.png b/qdbm/misc/icon20.png
deleted file mode 100644
index edad7849..00000000
--- a/qdbm/misc/icon20.png
+++ /dev/null
Binary files differ
diff --git a/qdbm/misc/index.html b/qdbm/misc/index.html
deleted file mode 100644
index 7a5271c3..00000000
--- a/qdbm/misc/index.html
+++ /dev/null
@@ -1,202 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="author" content="Mikio Hirabayashi" />
-<link rel="contents" href="./" />
-<link rel="icon" href="icon16.png" />
-<link rev="made" href="mailto:mikio@users.sourceforge.net" />
-<title>QDBM: Quick Database Manager</title>
-<style type="text/css">html { margin: 0em 0em; padding: 0em 0em; background: #eeeeee none; }
-body { margin: 2em 2em; padding: 0em 0em;
- background: #eeeeee none; color: #111111;
- font-style: normal; font-weight: normal; }
-h1 { margin-top: 1.8em; margin-bottom: 1.3em; font-weight: bold; }
-h2 { margin-top: 1.8em; margin-bottom: 1.1em; font-weight: bold;
- border-left: solid 0.6em #445555; border-bottom: solid 1pt #bbbbbb;
- padding: 0.5em 0.5em; width: 60%; }
-h3 { margin-top: 1.8em; margin-bottom: 0.8em; font-weight: bold; }
-hr { margin-top: 2.5em; margin-bottom: 1.5em; height: 1pt;
- color: #999999; background-color: #999999; border: none; }
-div.note,div.navi { text-align: right; }
-div.logo { text-align: center; margin: 3em 0em; }
-div.logo img { border: inset 2pt #ccccdd; }
-p { margin: 0.8em 0em; line-height: 140%; }
-p,dd { text-indent: 0.8em; }
-div,pre { margin-left: 1.7em; margin-right: 1.7em; }
-pre { background-color: #ddddee; padding: 0.2em; border: 1pt solid #bbbbcc; font-size: smaller; }
-kbd { color: #111111; font-style: normal; font-weight: bold; }
-a { color: #0022aa; text-decoration: none; }
-a:hover,a:focus { color: #0033ee; text-decoration: underline; }
-a.head { color: #111111; text-decoration: none; }
-table { padding: 1pt 2pt 1pt 2pt; border: none; margin-left: 1.7em; border-collapse: collapse; }
-th { padding: 1pt 4pt 1pt 4pt; border-style: none;
- text-align: left; vertical-align: bottom; }
-td { padding: 1pt 4pt 1pt 4pt; border: 1pt solid #333333;
- text-align: left; vertical-align: top; }
-ul,ol,dl { line-height: 140%; }
-dt { margin-left: 1.2em; }
-dd { margin-left: 2.0em; }
-ul.lines { list-style-type: none; }
-@media print {
- html,body { margin: 0em 0em; background-color: #ffffff; color: #000000; }
- h1 { padding: 8em 0em 0.5em 0em; text-align: center; }
- h2 { page-break-before: always; }
- div.note { text-align: center; }
- div.navi,div.logo { display: none }
- hr { display: none; }
- pre { margin: 0.8em 0.8em; background-color: #ffffff;
- border: 1pt solid #aaaaaa; font-size: smaller; }
- a,kbd { color: #000000; text-decoration: none; }
- h1,h2,h3 { font-family: sans-serif; }
- p,div,li,dt,dd { font-family: serif; }
- pre,kbd { font-family: monospace; }
- dd { font-size: smaller; }
-}
-</style>
-<script type="text/javascript">function startup(){
- var elem = document.getElementById("headline");
- if(elem){
- var now = new Date();
- if((now.getFullYear() + now.getMonth() + now.getDate() + now.getHours()) % 4 == 0){
- var text;
- switch((now.getMonth() + now.getDate() + now.getMinutes()) % 10){
- default: text = "QDBM: Quicker Database Manager"; break;
- case 1: text = "QDBM: Quantumtheoretically Dangerous Blast Machine"; break;
- case 3: text = "QDBM: Quite Dramatic Body Metabolism"; break;
- case 5: text = "QDBM: Quality Documentation of Black Market"; break;
- case 7: text = "QDBM: Quake Damage Between Mountains"; break;
- case 9: text = "QDBM: Quiet Down Before Millennium"; break;
- }
- elem.firstChild.nodeValue = text;
- }
- }
-}
-</script>
-</head>
-
-<body onload="startup();">
-
-<h1 id="headline">QDBM: Quick Database Manager</h1>
-
-<div class="note">Copyright (C) 2000-2007 Mikio Hirabayashi</div>
-<div class="note">Last Update: Thu, 26 Oct 2006 15:00:20 +0900</div>
-<div class="navi">[<span class="void">English</span>/<a href="index.ja.html" hreflang="ja">Japanese</a>]</div>
-
-<div class="logo"><img src="logo.png" alt="QDBM" width="300" height="110" /></div>
-
-<hr />
-
-<h2>Overview</h2>
-
-<p>QDBM is a library of routines for managing a database. The database is a simple data file containing records, each is a pair of a key and a value. Every key and value is serial bytes with variable length. Both binary data and character string can be used as a key and a value. There is neither concept of data tables nor data types. Records are organized in hash table or B+ tree.</p>
-
-<p>As for database of hash table, each key must be unique within a database, so it is impossible to store two or more records with a key overlaps. The following access methods are provided to the database: storing a record with a key and a value, deleting a record by a key, retrieving a record by a key. Moreover, traversal access to every key are provided, although the order is arbitrary. These access methods are similar to ones of DBM (or its followers: NDBM and GDBM) library defined in the UNIX standard. QDBM is an alternative for DBM because of its higher performance.</p>
-
-<p>As for database of B+ tree, records whose keys are duplicated can be stored. Access methods of storing, deleting, and retrieving are provided as with the database of hash table. Records are stored in order by a comparing function assigned by a user. It is possible to access each record with the cursor in ascending or descending order. According to this mechanism, forward matching search for strings and range search for integers are realized. Moreover, transaction is available in database of B+ tree.</p>
-
-<p>QDBM is written in C, and provided as APIs of C, C++, Java, Perl, and Ruby. QDBM is available on platforms which have API conforming to POSIX. QDBM is a free software licensed under the GNU Lesser General Public License.</p>
-
-<hr />
-
-<h2>Documents</h2>
-
-<p>The following are documents of QDBM. They are contained also in the source package.</p>
-
-<ul>
-<li><a href="spex.html">Fundamental Specifications</a></li>
-<li><a href="xspex.html">Specifications of C++ API</a></li>
-<li><a href="jspex.html">Specifications of Java API</a></li>
-<li><a href="plspex.html">Specifications of Perl API</a></li>
-<li><a href="rbspex.html">Specifications of Ruby API</a></li>
-<li><a href="cgispex.html">Specifications of CGI scripts</a></li>
-</ul>
-
-<hr />
-
-<h2>Packages</h2>
-
-<p>The following are packages of QDBM. The Linux binary package contains APIs for C, C++, and Java. It contains CGI scripts also. The Windows binary package contains APIs for C and Java. It contains CGI scripts also.</p>
-
-<ul>
-<li><a href="qdbm-1.8.77.tar.gz">Latest Source Package (version 1.8.77)</a></li>
-</ul>
-
-<ul>
-<li><a href="past/">Past Versions</a></li>
-<li><a href="rpm/">RPM Binary Packages for Linux</a></li>
-<li><a href="win/">Binary Packages for Windows</a></li>
-<li><a href="misc/">Related Packages</a></li>
-</ul>
-
-<ul>
-<li><a href="http://www.freshports.org/databases/qdbm/">Binary Packages for FreeBSD</a></li>
-<li><a href="http://www.blastwave.org/packages.php/qdbm">Binary Packages for Solaris</a></li>
-<li><a href="http://hpux.cs.utah.edu/hppd/cgi-bin/search?package=on&amp;description=on&amp;term=qdbm&amp;Search=Search">Binary Packages for HP-UX</a></li>
-<li><a href="http://www.sbellon.de/sw-ports.html">Binary Packages for RISC OS</a></li>
-</ul>
-
-<hr />
-
-<h2>Applications</h2>
-
-<p>The following are links to applications of QDBM. If you run or find a project using QDBM, please tell it, and it will added to this list.</p>
-
-<ul>
-<li><a href="http://hyperestraier.sourceforge.net/">Hyper Estraier</a> : Full-text Search System for Communities written by Mikio Hirabayashi</li>
-<li><a href="http://estraier.sourceforge.net/">Estraier</a> : Personal Full-text Search System written by Mikio Hirabayashi</li>
-<li><a href="http://diqt.sourceforge.net/">Diqt</a> : Multilingual Dictionary Searcher written by Mikio Hirabayashi</li>
-<li><a href="http://rbbs.sourceforge.jp/">RBBS</a> : WWW-based Bulletin Board System written by Mikio Hirabayashi</li>
-<li><a href="http://harvest.sourceforge.net/">Harvest</a> : Distributed Search System written by Kang-Jin Lee et al</li>
-<li><a href="http://bogofilter.sourceforge.net/">Bogofilter</a> : Bayesian Spam Mail Filter written by Eric S. Raymond et al</li>
-<li><a href="http://www.foo.be/mqs/">MQS</a> : Minimalist Queue Services written by Alexandre Dulaunoy</li>
-<li><a href="http://www.zedshaw.com/projects/ruby_odeum/">Ruby/Odeum</a> : Ruby Binding to the Inverted API written by Zed A. Shaw</li>
-<li><a href="http://www.surfulater.com/">Surfulater</a> : Utility to Save and Organize Web Pages written by Soft As it Gets Pty Ltd</li>
-<li><a href="http://mutt-ng.berlios.de/">Mutt-NG</a> : Text Based Mail Client written by Andreas Krennmair et al</li>
-<li><a href="http://smfs.sourceforge.net/">SMFS</a> : Smart Sendmail Filters written by Eugene Kurmanin</li>
-<li><a href="http://dixit.sourceforge.net/">Dixit</a> : Romanian Dictionary Searcher written by Octavian Procopiuc</li>
-</ul>
-
-<hr />
-
-<h2>Brothers</h2>
-
-<p>There are many followers of UNIX DBM. Select the best suited one for your products. NDBM is ancient and you should not use it. SDBM is maintained by Apache Project, and GDBM is maintained by GNU Project. They are most popular and time-tested. TDB is maintained by Samba Team. It allows multiple simultaneous writers. While CDB does not support updating at a runtime, it is the fastest. Berkeley DB is very multifunctional and ACID compliant. It is used in many commercial products. Finally, QDBM is balanced of performance, functionality, portability, and usability.</p>
-
-<ul>
-<li><a href="bros/ndbm-bsd-5.1.m1.tar.gz">NDBM</a> : New DBM written by BSD</li>
-<li><a href="bros/sdbm-1.0.2.tar.gz">SDBM</a> : Substitute DBM written by Ozan S. Yigit</li>
-<li><a href="bros/gdbm-1.8.3.tar.gz">GDBM</a> : GNU Database Manager written by Philip A. Nelson et al</li>
-<li><a href="bros/tdb-1.0.6.tar.gz">TDB</a> : Trivial Database written by Andrew Tridgell et al</li>
-<li><a href="bros/tinycdb-0.75.tar.gz">TinyCDB</a> : Constant Database written by Michael Tokarev</li>
-<li><a href="bros/db-4.4.20.tar.gz">Berkeley DB</a> : Berkeley DB written by Sleepycat Software</li>
-</ul>
-
-<ul>
-<li><a href="benchmark.pdf">Report of Benchmark Test</a></li>
-<li><a href="http://tokyocabinet.sourceforge.net/">Tokyo Cabinet</a> : the successor of QDBM</li>
-</ul>
-
-<hr />
-
-<h2>Information</h2>
-
-<p>QDBM was written by <a href="http://qdbm.sourceforge.net/mikio/">Mikio Hirabayashi</a>. You can contact the author by e-mail to `mikio@users.sourceforge.net'. However, as for topics which can be shared among other users, pleae send it to the mailing list. To join the mailing list, refer to `<a href="http://lists.sourceforge.net/lists/listinfo/qdbm-users">http://lists.sourceforge.net/lists/listinfo/qdbm-users</a>'.</p>
-
-<p>The project page on SourceForge.net is `<a href="http://sourceforge.net/projects/qdbm/">http://sourceforge.net/projects/qdbm/</a>'.</p>
-
-<p>Update of this project is announced on Freshmeat.net at `<a href="http://freshmeat.net/projects/qdbm/">http://freshmeat.net/projects/qdbm/</a>'.</p>
-
-<hr />
-
-</body>
-
-</html>
-
-<!-- END OF FILE -->
diff --git a/qdbm/misc/index.ja.html b/qdbm/misc/index.ja.html
deleted file mode 100644
index 65ea073c..00000000
--- a/qdbm/misc/index.ja.html
+++ /dev/null
@@ -1,209 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="author" content="Mikio Hirabayashi" />
-<link rel="contents" href="./" />
-<link rel="icon" href="icon16.png" />
-<link rev="made" href="mailto:mikio@users.sourceforge.net" />
-<title>データベースライブラリ QDBM</title>
-<style type="text/css">html { margin: 0em 0em; padding: 0em 0em; background: #eeeeee none; }
-body { margin: 2em 2em; padding: 0em 0em;
- background: #eeeeee none; color: #111111;
- font-style: normal; font-weight: normal; }
-h1 { margin-top: 1.8em; margin-bottom: 1.3em; font-weight: bold; }
-h2 { margin-top: 1.8em; margin-bottom: 1.1em; font-weight: bold;
- border-left: solid 0.6em #445555; border-bottom: solid 1pt #bbbbbb;
- padding: 0.5em 0.5em; width: 60%; }
-h3 { margin-top: 1.8em; margin-bottom: 0.8em; font-weight: bold; }
-hr { margin-top: 2.5em; margin-bottom: 1.5em; height: 1pt;
- color: #999999; background-color: #999999; border: none; }
-div.note,div.navi { text-align: right; }
-div.logo { text-align: center; margin: 3em 0em; }
-div.logo img { border: inset 2pt #ccccdd; }
-p { margin: 0.8em 0em; line-height: 140%; }
-p,dd { text-indent: 0.8em; }
-div,pre { margin-left: 1.7em; margin-right: 1.7em; }
-pre { background-color: #ddddee; padding: 0.2em; border: 1pt solid #bbbbcc; font-size: smaller; }
-kbd { color: #111111; font-style: normal; font-weight: bold; }
-a { color: #0022aa; text-decoration: none; }
-a:hover,a:focus { color: #0033ee; text-decoration: underline; }
-a.head { color: #111111; text-decoration: none; }
-table { padding: 1pt 2pt 1pt 2pt; border: none; margin-left: 1.7em; border-collapse: collapse; }
-th { padding: 1pt 4pt 1pt 4pt; border-style: none;
- text-align: left; vertical-align: bottom; }
-td { padding: 1pt 4pt 1pt 4pt; border: 1pt solid #333333;
- text-align: left; vertical-align: top; }
-ul,ol,dl { line-height: 140%; }
-dt { margin-left: 1.2em; }
-dd { margin-left: 2.0em; }
-ul.lines { list-style-type: none; }
-@media print {
- html,body { margin: 0em 0em; background-color: #ffffff; color: #000000; }
- h1 { padding: 8em 0em 0.5em 0em; text-align: center; }
- h2 { page-break-before: always; }
- div.note { text-align: center; }
- div.navi,div.logo { display: none }
- hr { display: none; }
- pre { margin: 0.8em 0.8em; background-color: #ffffff;
- border: 1pt solid #aaaaaa; font-size: smaller; }
- a,kbd { color: #000000; text-decoration: none; }
- h1,h2,h3 { font-family: sans-serif; }
- p,div,li,dt,dd { font-family: serif; }
- pre,kbd { font-family: monospace; }
- dd { font-size: smaller; }
-}
-</style>
-<script type="text/javascript">function startup(){
- var elem = document.getElementById("headline");
- if(elem){
- var now = new Date();
- if((now.getFullYear() + now.getMonth() + now.getDate() + now.getHours()) % 4 == 0){
- var text;
- switch((now.getMonth() + now.getDate() + now.getMinutes()) % 24){
- default: text = "QDBM: 高速資料基盤管理器"; break;
- case 1: text = "QDBM: NDBMとは違うのだよ、NDBMとは!"; break;
- case 3: text = "QDBM: QDBMは伊達じゃないっ!"; break;
- case 5: text = "QDBM: 敢えて言おう、高速であると!"; break;
- case 7: text = "QDBM: しかし、私もDBMのはずだ!"; break;
- case 9: text = "QDBM: 今の私はQDBMだ。それ以上でもそれ以下でもない。"; break;
- case 11: text = "QDBM: 私はBerkeleyとは関係ない。私はいつも一人のDBMだった。"; break;
- case 13: text = "QDBM: 見せてもらおうか!Berkeleyのデータベースの性能とやらを!"; break;
- case 15: text = "QDBM: 悲しいけどこれ、DBMなのよね。"; break;
- case 17: text = "QDBM: 新しい時代を創るのはSQLではない!!"; break;
- case 19: text = "QDBM: えぇぃ、マイナーチェンジのくせにっ!"; break;
- case 21: text = "QDBM: よくもこんなくたびれたDBMが現役でいられるものだ。"; break;
- case 22: text = "QDBM: 見える!私にもレコードが見える"; break;
- case 23: text = "QDBM: そんなRDBみたいな口の利き方、おやめなさい!"; break;
- }
- elem.firstChild.nodeValue = text;
- }
- }
-}
-</script>
-</head>
-
-<body onload="startup();">
-
-<h1 id="headline">QDBM: Quick Database Manager</h1>
-
-<div class="note">Copyright (C) 2000-2007 Mikio Hirabayashi</div>
-<div class="note">Last Update: Thu, 26 Oct 2006 15:00:20 +0900</div>
-<div class="navi">[<a href="index.html" hreflang="en">English</a>/<span class="void">Japanese</span>]</div>
-
-<div class="logo"><img src="logo.png" alt="QDBM" width="300" height="110" /></div>
-
-<hr />
-
-<h2><a name="overview" id="overview" class="head">概要</a></h2>
-
-<p>QDBMはデータベースを扱うルーチン群のライブラリです。データベースといっても単純なもので、キーと値のペアからなるレコード群を格納したデータファイルです。キーと値は任意の長さを持つ一連のバイト列であり、文字列でもバイナリでも扱うことができます。テーブルやデータ型の概念はありません。レコードはハッシュ表またはB+木で編成されます。</p>
-
-<p>ハッシュ表のデータベースでは、キーはデータベース内で一意であり、キーが重複する複数のレコードを格納することはできません。このデータベースに対しては、キーと値を指定してレコードを格納したり、キーを指定して対応するレコードを削除したり、キーを指定して対応するレコードを検索したりすることができます。また、データベースに格納してある全てのキーを順不同に一つずつ取り出すこともできます。このような操作は、UNIX標準で定義されているDBMライブラリおよびその追従であるNDBMやGDBMに類するものです。QDBMはDBMのより良い代替として利用することができます。</p>
-
-<p>B+木のデータベースでは、キーが重複する複数のレコードを格納することができます。このデータベースに対しては、ハッシュ表のデータベースと同様に、キーを指定してレコードを格納したり取り出したり削除したりすることができます。レコードはユーザが指示した比較関数に基づいて整列されて格納されます。カーソルを用いて各レコードを昇順または降順で参照することができます。この機構によって、文字列の前方一致検索や数値の範囲検索が可能になります。また、B+木のデータベースではトランザクションが利用できます。</p>
-
-<p>QDBMはCで記述され、C、C++、Java、PerlおよびRubyのAPIとして提供されます。QDBMはPOSIX準拠のAPIを備えるプラットフォームで利用できます。QDBMはGNU Lesser General Public Licenseに基づくフリーソフトウェアです。</p>
-
-<hr />
-
-<h2>文書</h2>
-
-<p>以下の文書をお読みください。ソースパッケージにも同じものが含まれています。</p>
-
-<ul>
-<li><a href="spex-ja.html">基本仕様書</a></li>
-<li><a href="xspex-ja.html">C++用API仕様書</a></li>
-<li><a href="jspex-ja.html">Java用API仕様書</a></li>
-<li><a href="plspex-ja.html">Perl用API仕様書</a></li>
-<li><a href="rbspex-ja.html">Ruby用API仕様書</a></li>
-<li><a href="cgispex-ja.html">CGIスクリプト仕様書</a></li>
-<li><a href="tutorial-ja.html">チュートリアル</a></li>
-</ul>
-
-<hr />
-
-<h2>ダウンロード</h2>
-
-<p>以下のパッケージをダウンロードしてください。Linux用バイナリパッケージは、CとC++とJavaのAPIと、CGIスクリプトを納めています。Windows用バイナリパッケージは、CとJavaのAPIと、CGIスクリプトを納めています。</p>
-
-<ul>
-<li><a href="qdbm-1.8.77.tar.gz">最新のソースパッケージ(バージョン1.8.77)</a></li>
-</ul>
-
-<ul>
-<li><a href="past/">過去のバージョン</a></li>
-<li><a href="rpm/">Linux用バイナリパッケージ(RPM)</a></li>
-<li><a href="win/">Windows用バイナリパッケージ</a></li>
-<li><a href="misc/">関連するパッケージ</a></li>
-</ul>
-
-<ul>
-<li><a href="http://www.freshports.org/databases/qdbm/">FreeBSD用パッケージ</a></li>
-<li><a href="http://www.blastwave.org/packages.php/qdbm">Solaris用パッケージ</a></li>
-<li><a href="http://hpux.cs.utah.edu/hppd/cgi-bin/search?package=on&amp;description=on&amp;term=qdbm&amp;Search=Search">HP-UX用パッケージ</a></li>
-<li><a href="http://www.sbellon.de/sw-ports.html">RISC OS用パッケージ</a></li>
-</ul>
-
-<hr />
-
-<h2>アプリケーション</h2>
-
-<p>QDBMのアプリケーションには以下のものがあります。もしあなたのプロジェクトがQDBMを使っているなら、連絡をいただければこのリストに追加いたします。</p>
-
-<ul>
-<li><a href="http://hyperestraier.sourceforge.net/">Hyper Estraier</a> : 平林幹雄による共同体的全文検索システム</li>
-<li><a href="http://estraier.sourceforge.net/">Estraier</a> : 平林幹雄による個人用全文検索システム</li>
-<li><a href="http://diqt.sourceforge.net/">Diqt</a> : 平林幹雄による多言語辞書検索システム</li>
-<li><a href="http://rbbs.sourceforge.jp/">RBBS</a> : 平林幹雄によるWeb掲示板システム</li>
-<li><a href="http://harvest.sourceforge.net/">Harvest</a> : Kang-Jin Leeらによる分散情報検索システム</li>
-<li><a href="http://bogofilter.sourceforge.net/">Bogofilter</a> : Eric S. Raymondらによるベイズ式スパムメールフィルタ</li>
-<li><a href="http://www.foo.be/mqs/">MQS</a> : Alexandre Dulaunoyによるキュー管理サービス</li>
-<li><a href="http://www.zedshaw.com/projects/ruby_odeum/">Ruby/Odeum</a> : Zed A. Shawによる転置APIのRuby用インターフェイス</li>
-<li><a href="http://www.surfulater.com/">Surfulater</a> : Soft As it Gets Pty社によるWebページスクラップブック</li>
-<li><a href="http://mutt-ng.berlios.de/">Mutt-NG</a> : Andreas Krennmairらによるテキスト型メールクライアント</li>
-<li><a href="http://smfs.sourceforge.net/">SMFS</a> : Eugene KurmaninによるSendmail用フィルタシステム</li>
-<li><a href="http://dixit.sourceforge.net/">Dixit</a> : Octavian Procopiucによるルーマニア語辞書検索システム</li>
-</ul>
-
-<hr />
-
-<h2>兄弟</h2>
-
-<p>UNIX標準のDBMに追従したライブラリはたくさんあります。それぞれ特徴がありますので、あなたの製品にとって都合がいいものを選んでください。NDBMは古いので、もはや使う理由はないでしょう。SDBMはApache Projectで管理され、GDBMはGNU Projectで管理されています。それらは最も人気があり、また数多くテストされているものでしょう。TDBはSamba Teamで管理されており、複数同時の書き込みが可能です。TinyCDBは随時の更新はできませんが、最も高速に動作します。Berkeley DBは非常に多機能で、ACID準拠で、多くの商用製品で使われています。最後に、QDBMは性能と機能と移植性と利便性のバランスがとれた製品です。</p>
-
-<ul>
-<li><a href="bros/ndbm-bsd-5.1.m1.tar.gz">NDBM</a> : BSDによるNew DBM</li>
-<li><a href="bros/sdbm-1.0.2.tar.gz">SDBM</a> : Ozan S. YigitによるSubstitute DBM</li>
-<li><a href="bros/gdbm-1.8.3.tar.gz">GDBM</a> : Philip A. NelsonらによるGNU Database Manager</li>
-<li><a href="bros/tdb-1.0.6.tar.gz">TDB</a> : Andrew TridgellらによるTrivial Database</li>
-<li><a href="bros/tinycdb-0.75.tar.gz">TinyCDB</a> : Michael TokarevによるConstant Database</li>
-<li><a href="bros/db-4.4.20.tar.gz">Berkeley DB</a> : Sleepycat Software社によるBerkeley DB</li>
-</ul>
-
-<ul>
-<li><a href="benchmark.pdf">ベンチマークテストのレポート</a></li>
-<li><a href="http://tokyocabinet.sourceforge.net/">Tokyo Cabinet</a> : QDBMの後継製品</li>
-</ul>
-
-<hr />
-
-<h2>その他の情報</h2>
-
-<p>QDBMは<a href="http://qdbm.sourceforge.net/mikio/">平林幹雄</a>が作成しました。作者と連絡をとるには、`mikio@users.sourceforge.net' 宛に電子メールを送ってください。ただし、質問やバグレポートなど、他のユーザと共有できる話題はメーリングリストに送ってください。メーリングリストの参加方法については、`<a href="http://lists.sourceforge.net/lists/listinfo/qdbm-users">http://lists.sourceforge.net/lists/listinfo/qdbm-users</a>' を参照してください。</p>
-
-<p>SourceForge.netにおけるプロジェクトページは `<a href="http://sourceforge.net/projects/qdbm/">http://sourceforge.net/projects/qdbm/</a>' にあります。Freshmeatにおける更新情報は `<a href="http://freshmeat.net/projects/qdbm/">http://freshmeat.net/projects/qdbm/</a>' から参照できます。</p>
-
-<hr />
-
-</body>
-
-</html>
-
-<!-- END OF FILE -->
diff --git a/qdbm/misc/logo.png b/qdbm/misc/logo.png
deleted file mode 100644
index d5cf9771..00000000
--- a/qdbm/misc/logo.png
+++ /dev/null
Binary files differ
diff --git a/qdbm/misc/makevcdef b/qdbm/misc/makevcdef
deleted file mode 100755
index 7b36e307..00000000
--- a/qdbm/misc/makevcdef
+++ /dev/null
@@ -1,48 +0,0 @@
-#! /bin/sh
-
-#================================================================
-# makevcdef
-# Generator of module definition file for Visual C++
-#================================================================
-
-
-# check arguments
-file="$1"
-if [ -f "$file" ]
-then
- true
-else
- printf 'usage: makevcdef library\n' 1>&2
- exit 1
-fi
-
-
-# show headers
-name=`echo $file | sed -e 's/^lib//' -e 's/\..*//'`
-printf 'EXPORTS\r\n'
-
-
-# show variables
-nm -g "$file" | grep ' [BDR] ' | sed 's/.* [BDR] //' | grep -v '^_' | sort | uniq |
-while read name
-do
- num=$((num + 1))
- printf ' %s = %s DATA\r\n' "$name" "$name"
-done
-
-
-# show functions
-nm -g "$file" | grep ' T ' | sed 's/.* T //' | grep -v '^_' | sort | uniq |
-while read name
-do
- num=$((num + 1))
- printf ' %s = %s\r\n' "$name" "$name"
-done
-
-
-# exit normally
-exit 0
-
-
-
-# END OF FILE
diff --git a/qdbm/misc/mymemo-ja.html b/qdbm/misc/mymemo-ja.html
deleted file mode 100644
index 87de7843..00000000
--- a/qdbm/misc/mymemo-ja.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<meta name="author" content="Mikio Hirabayashi" />
-<link rel="contents" href="./" />
-<title>My Private Memo for QDBM</title>
-</head>
-
-<body>
-
-<h1>QDBMのための私的メモ</h1>
-
-<hr />
-
-<h2>cygwin+mingwでのビルド環境の設定方法</h2>
-
-<ul>
-<li>Cygwinのセットアップ時に、mingwのgccとmingwのzlibも選択する。</li>
-<li>mingwのlibiconvはmingwのサイトから手に入れる。そして、*.h は /usr/include/mingw の下に、*.dll.a は /lib/mingw の下に、*.dll は /binの下に移動させる。</li>
-<li>QDBMのビルド環境の設定は ./configure --enable-zlib --enable-iconv で行い、パッケージの作成は make win32pkg で行う。</li>
-</ul>
-
-<hr />
-
-</body>
-
-</html>
-
-<!-- END OF FILE -->
diff --git a/qdbm/misc/tutorial-ja.html b/qdbm/misc/tutorial-ja.html
deleted file mode 100644
index 66f1c3c3..00000000
--- a/qdbm/misc/tutorial-ja.html
+++ /dev/null
@@ -1,622 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta name="author" content="Mikio Hirabayashi" />
-<meta name="keywords" content="QDBM, tutrial" />
-<meta name="description" content="tutorial of QDBM" />
-<link rel="contents" href="./" />
-<link rev="made" href="mailto:mikio@users.sourceforge.net" />
-<title>Tutorial of QDBM Version 1 (Japanese)</title>
-<style type="text/css">html { margin: 0em 0em; padding: 0em 0em; background: #eeeeee none; }
-body { margin: 2em 2em; padding: 0em 0em;
- background: #eeeeee none; color: #111111;
- font-style: normal; font-weight: normal; }
-h1 { margin-top: 1.8em; margin-bottom: 1.3em; font-weight: bold; }
-h2 { margin-top: 1.8em; margin-bottom: 1.1em; font-weight: bold;
- border-left: solid 0.6em #445555; border-bottom: solid 1pt #bbbbbb;
- padding: 0.5em 0.5em; width: 60%; }
-h3 { margin-top: 1.8em; margin-bottom: 0.8em; font-weight: bold; }
-hr { margin-top: 2.5em; margin-bottom: 1.5em; height: 1pt;
- color: #999999; background-color: #999999; border: none; }
-div.note,div.navi { text-align: right; }
-div.logo { text-align: center; margin: 3em 0em; }
-div.logo img { border: inset 2pt #ccccdd; }
-p { margin: 0.8em 0em; line-height: 140%; }
-p,dd { text-indent: 0.8em; }
-div,pre { margin-left: 1.7em; margin-right: 1.7em; }
-pre { background-color: #ddddee; padding: 0.2em; border: 1pt solid #bbbbcc; font-size: smaller; }
-kbd { color: #111111; font-style: normal; font-weight: bold; }
-a { color: #0022aa; text-decoration: none; }
-a:hover,a:focus { color: #0033ee; text-decoration: underline; }
-a.head { color: #111111; text-decoration: none; }
-table { padding: 1pt 2pt 1pt 2pt; border: none; margin-left: 1.7em; border-collapse: collapse; }
-th { padding: 1pt 4pt 1pt 4pt; border-style: none;
- text-align: left; vertical-align: bottom; }
-td { padding: 1pt 4pt 1pt 4pt; border: 1pt solid #333333;
- text-align: left; vertical-align: top; }
-ul,ol,dl { line-height: 140%; }
-dt { margin-left: 1.2em; }
-dd { margin-left: 2.0em; }
-ul.lines { list-style-type: none; }
-@media print {
- html,body { margin: 0em 0em; background-color: #ffffff; color: #000000; }
- h1 { padding: 8em 0em 0.5em 0em; text-align: center; }
- h2 { page-break-before: always; }
- div.note { text-align: center; }
- div.navi,div.logo { display: none }
- hr { display: none; }
- pre { margin: 0.8em 0.8em; background-color: #ffffff;
- border: 1pt solid #aaaaaa; font-size: smaller; }
- a,kbd { color: #000000; text-decoration: none; }
- h1,h2,h3 { font-family: sans-serif; }
- p,div,li,dt,dd { font-family: serif; }
- pre,kbd { font-family: monospace; }
- dd { font-size: smaller; }
-}
-</style>
-</head>
-
-<body>
-
-<h1>QDBMのチュートリアル</h1>
-
-<div class="note">Copyright (C) 2000-2007 Mikio Hirabayashi</div>
-<div class="note">Last Update: Thu, 26 Oct 2006 15:00:20 +0900</div>
-<div class="navi">[<a href="http://qdbm.sourceforge.net/">Home</a>]</div>
-
-<hr />
-
-<h2>目次</h2>
-
-<ol>
-<li><a href="#introduction">イントロダクション</a></li>
-<li><a href="#depot">Depot: 基本API</a></li>
-<li><a href="#curia">Curia: 拡張API</a></li>
-<li><a href="#relic">Relic: NDBM互換API</a></li>
-<li><a href="#hovel">Hovel: GDBM互換API</a></li>
-<li><a href="#cabin">Cabin: ユーティリティAPI</a></li>
-<li><a href="#villa">Villa: 上級API</a></li>
-<li><a href="#odeum">Odeum: 転置API</a></li>
-</ol>
-
-<hr />
-
-<h2><a name="introduction" id="introduction" class="head">イントロダクション</a></h2>
-
-<p>QDBMは、シンプルながら便利なデータベースライブラリです。データベースというとSQLやリレーショナルデータベースを思い浮かべる人が多いと思いますが、QDBMはそんな高機能なものではありません。「キー」と「値」の組からなるレコードをファイルに保存したり、保存しておいたレコードの中から特定のキーを持つものを取り出す機能を提供するだけです。そのような機能をここでは「ハッシュデータベース」と呼ぶことにします。ハッシュデータベースの特長は、使い方が簡単で、パフォーマンスが高いことです。</p>
-
-<p>QDBMはC言語のライブラリです(他の言語のAPIもありますが)。QDBMにはハッシュデータベースの機能だけでなく、私(QDBMの作者)がプログラミングをする時によく使う機能が詰め込まれています。Cで書いたプログラムは高速に動作するのが利点ですが、C++、Java、Perl、Rubyといった比較的高級な言語では標準的にサポートされるデータ構造やアルゴリズムを自分で実装しなければなりません。そういった作業は面倒ですし、バグを生みやすいものです。そこで、QDBMの登場です。QDBMを再利用すれば、CでのプログラミングがPerlを使っているかのように手軽になります。しかも、UNIXでもWindowsでもMac OS Xでも利用できるので、移植性のあるプログラムが書きやすくなります。</p>
-
-<p>シンプルといいながら、QDBMの機能はなかなか豊富です。データベースとしては、ハッシュ表とB+木が利用できます。メモリ上で扱うユーティリティとしては、リストやマップなどがあります。MIMEやCSVやXMLの解析もできます。しまいには全文検索までできたりするので驚きです。</p>
-
-<p>このチュートリアルではQDBMの使い方を簡単に説明するとともに、基本仕様書の補足を述べます。QDBMの詳細については基本仕様書を御覧ください。なお、ここではハッシュ表やB+木といったデータ構造の説明はしませんので、不慣れな方は適当な本やWebサイトで調べておいてください。</p>
-
-<hr />
-
-<h2><a name="depot" id="depot" class="head">Depot: 基本API</a></h2>
-
-<p>データベースアプリケーションの典型的な例として、「社員番号を入力すると、その内線番号がわかる」というプログラムを考えてみましょう。社員番号をキーとして、それに対応する値である内線番号を検索するということです。</p>
-
-<p>まずはQDBMを使わないでやってみます。社員番号と内線番号の対応表は、CSVテキストでファイルに保存することにします。書式の例を以下に示します。</p>
-
-<pre>00001,8-902-1234
-00002,7-938-834
-00008,4-214-491
-</pre>
-
-<p>レコードを加える関数 `putphonenumber' と、レコードを検索する関数 `getphonenumber' を実装します。</p>
-
-<pre>#include &lt;stdio.h&gt;
-#include &lt;stdlib.h&gt;
-#include &lt;string.h&gt;
-
-#define PHONEFILE "phone"
-#define LINEBUFSIZ 256
-
-int putphonenumber(const char *id, const char *phone){
- FILE *OUT;
- /* ファイルを追記モードで開く */
- if(!(OUT = fopen(PHONEFILE, "a"))) return -1;
- /* レコードを書き込む */
- fprintf(OUT, "%s,%s\n", id, phone);
- /* ファイルを閉じる */
- if(fclose(OUT) != 0) return -1;
- return 0;
-}
-
-char *getphonenumber(const char *id){
- FILE *IN;
- char line[LINEBUFSIZ], *pivot, *phone;
- int len;
- /* ファイルを読み込みモードで開く */
- if(!(IN = fopen(PHONEFILE, "r"))) return NULL;
- /* 各行を読み込む */
- while(fscanf(IN, "%s", line) == 1){
- /* 区切り文字を処理する */
- if(!(pivot = strchr(line, ','))) continue;
- *pivot = '\0';
- pivot++;
- /* キーの一致判定 */
- if(strcmp(line, id) == 0){
- /* ファイルを閉じる */
- if(fclose(IN) != 0) return NULL;
- /* メモリを確保して戻り値を生成する */
- len = strlen(pivot);
- if(!(phone = malloc(len + 1))) return NULL;
- memcpy(phone, pivot, len + 1);
- return phone;
- }
- }
- /* ファイルを閉じる */
- fclose(IN);
- return NULL;
-}
-</pre>
-
-<p>`fscanf' を使っている時点でかなり貧弱ですが、きちんと書こうとすると非常に長くなるので妥協しました(ちなみに、255文字を越える行があったら暴走します)。とにかく、この程度の処理でやたら長いコードを書かねばならないのでは悲しくなります。さらに重大な欠点は、検索の処理が遅いということです。ファイルの最初から最後まで(平均的には半分まで)読まなければならないからです。既存のレコードを修正する時にもかなり面倒なことをしなければなりません。</p>
-
-<p>QDBMを使えばもっとエレガントなコードが書けます。上記と同じ機能の関数を実装してみます。</p>
-
-<pre>#include &lt;depot.h&gt;
-#include &lt;stdlib.h&gt;
-
-#define PHONEFILE "phone"
-
-int putphonenumber(const char *id, const char *phone){
- DEPOT *depot;
- /* データベースを追記モードで開く */
- if(!(depot = dpopen(PHONEFILE, DP_OWRITER | DP_OCREAT, -1))) return -1;
- /* レコードを書き込む */
- dpput(depot, id, -1, phone, -1, DP_DOVER);
- /* データベースを閉じる */
- if(!dpclose(depot)) return -1;
- return 0;
-}
-
-char *getphonenumber(const char *id){
- DEPOT *depot;
- char *phone;
- /* データベースを読み込みモードで開く */
- if(!(depot = dpopen(PHONEFILE, DP_OREADER, -1))) return NULL;
- /* レコードを探索して戻り値を生成する */
- phone = dpget(depot, id, -1, 0, -1, NULL);
- /* データベースを閉じる */
- dpclose(depot);
- return phone;
-}
-</pre>
-
-<p>もはやファイル形式はCSVファイルではなく、区切り文字が何であるか気にする必要はありません。プログラマはファイル形式がどうであるかなど考えなくてもよいのです。メモリの確保などもQDBMの内部でやってくれるので、バッファのサイズを気にする必要はありません(解放は必要です)。処理速度を気にする必要もありません。データベースがどんなに大きくても、レコードの追加や削除や検索が一瞬でできます。このように、プログラマをデータ管理の苦悩から解放するのがQDBMの役割です。</p>
-
-<p>上記の例ではQDBMの基本APIであるDepotを利用しています。まず、`DEPOT' という型が登場しています。これは標準ライブラリの `FILE' と同様に、操作対象のファイルの情報を格納している構造体の型です。この型へのポインタをハンドルとして各種の関数に渡すことになります。関数としては、`dpopen'、`dpclose'、`dpput' および `dpget' が登場しています。この四つの使い方を覚えればQDBMの半分は理解したようなものです。</p>
-
-<div><kbd>DEPOT *dpopen(const char *<var>name</var>, int <var>omode</var>, int <var>bnum</var>);</kbd></div>
-
-<p>`dpopen' はその名の通り、Depotのデータベースを開く関数です。その結果として `DEPOT' 型の構造体へのポインタが返されます。第1引数にはデータを格納するファイル名を指定します。これは相対パスで指定しても絶対パスで指定しても構いません。第2引数は接続モードを指定します。読み込みと書き込みの両方をするなら `DP_OWRITER' を指定します。ただし、データベースファイルが存在しない場合に新規作成するならば同時に `DP_OCREAT' をビットORとして加える必要があります。この二つを指定すると、`fopen' の `a+' モードとほぼ同じ意味になります。他に `DP_OTRUNC' というフラグがあるのですが、それはファイルを切り詰めることを指示します。それも加えて三つを指定すると `fopen' の `w+' モードとほぼ同じ意味になります。読み込みだけをする場合、`DP_OREADER' を指定します。これは `fopen' の `r' モードとほぼ同じ意味です。第3引数はハッシュ表のバケット数を指定します。とりあえずデフォルト値を意味する `-1' を指定しておけばいいでしょう。</p>
-
-<p>複数のプロセスが同じファイルを読み書きする場合、「レースコンディション」という問題が起こります。同時にファイルに書き込むと、内容が混ざって変になってしまう可能性があるのです。QDBMではそれに対処するために「ファイルロック」をかけます。あるプロセスがデータベースを書き込みモードで開いている場合は、他のプロセスがデータベースを開こうとしてもブロックされるのです。処理が失敗するわけではなく、既にデータベースを開いているプロセスがデータベースを閉じるまで待ってくれるのです。なお、読み込みモード同士であればレースコンディションは起こらないので同時にアクセスすることができます。</p>
-
-<div><kbd>int dpclose(DEPOT *<var>depot</var>);</kbd></div>
-
-<p>`dpclose' はデータベースを閉じる関数です。第1引数には `dpopen' で開いたハンドルを渡します。開いたデータベースは必ず閉じてください。そうしないとデータベースが壊れます(読み込みモードの場合は壊れませんが、メモリリークになります)。</p>
-
-<p>ところで、QDBMを使わない例では、書き込みの際に呼び出す `fprintf' の戻り値をチェックしていません。`fprintf' が失敗した場合は `fclose' もエラーを返すと規定されているからです。同様に、QDBMでもデータベースに一度でも致命的なエラーが起きた場合は `dpclose' がエラーを返すので、エラーチェックを簡略化することができるのです。</p>
-
-<div><kbd>int dpput(DEPOT *<var>depot</var>, const char *<var>kbuf</var>, int <var>ksiz</var>, const char *<var>vbuf</var>, int <var>vsiz</var>, int <var>dmode</var>);</kbd></div>
-
-<p>`dpput' はデータベースにレコードを追加する関数です。第1引数には `dpopen' で開いたハンドルを渡します。第2引数には、書き込むレコードのキーの内容を保持する領域へのポインタを指定します。第3引数にはその領域のサイズを指定します。それが負数の場合は、第2引数を文字列として扱って、`strlen' の値をサイズとして判定します(文字列とバイナリの両方を簡単に扱えるようにするためです)。第4引数と第5引数は、レコードの値に関して同様にポインタとサイズを指定します。第6引数は書き込みのモードです。データベース内には同じキーを持つ複数のレコードを格納することができないので、既存のレコードのキーと同一のキーを持つレコードを格納しようとした際にどうするかを指示する必要があります。`DP_DOVER' とした場合は、既存のレコードを新しいレコードで上書きします。`DP_DKEEP' とした場合は、既存のレコードを優先し、エラーが返されます(`DP_EKEEP' というエラーコードが外部変数 `dpecode' に設定されます)。</p>
-
-<p>`dpput' の書き込みモードには、`DP_DCAT' による「連結モード」もあります。これを利用することはあまりないかもしれませんが、他のDBMにはない特徴なので説明します。連結モードは、レコードの値として配列を入れる際に便利なのです。例えば、[10,11,12] という三つの数値を要素に持つ配列を格納していて、それを [10,11,12,13] にしたい場合を考えてみます。他のDBMでは、まずそのレコードを検索して、[10,11,12] を獲得してから、それを [10,11,12,13] に加工して値を生成し、元のレコードに上書きで書き込むといったことをしなければなりません。QDBMの場合は、連結モードで [13] を既存のレコードに書き込むだけで同じことができます。配列の要素数が大きい場合にはこの違いはパフォーマンスに大きな影響を及ぼします。</p>
-
-<div><kbd>char *dpget(DEPOT *<var>depot</var>, const char *<var>kbuf</var>, int <var>ksiz</var>, int <var>start</var>, int <var>max</var>, int *<var>sp</var>);</kbd></div>
-
-<p>`dpget' はデータベースを検索してレコードを取り出す関数です。第1引数は他と一緒ですね。第2引数と第3引数は `dpput' と同様に検索キーのポインタとサイズを指定します。第4引数と第5引数はとりあえず `0' と '-1' にするものだと思っていただいて結構です。一応説明すると、取り出す領域の開始オフセットと最大サイズを指定します。`-1' は無制限という意味です。例えばレコードの値が `abcdef' の場合に開始オフセットを `1'、サイズを `3' にした場合、`bcd' が取り出されます。戻り値は取り出した値の内容を記録した領域へのポインタです。その領域は `malloc' でヒープに確保されているので、アプリケーションの責任で `free' に渡して解放する必要があります。戻り値の領域は終端にゼロコードが付加されていることが保証されているので、文字列として利用できます。ただし、バイナリを扱う場合には明示的にサイズが知りたいでしょうから、その為に第6引数にサイズを受け取る変数へのポインタを指定することができます(このサイズには終端のゼロコードは勘定されません)。該当のレコードがない場合には `NULL' が返されます(`DP_ENOITEM' というエラーコードが外部変数 `dpecode' に設定されます)。</p>
-
-<p>Depotの関数で他によく使うものとして、`dpout'、`dpiterinit'、`dpiternext' があります。これらについても説明しておきます。</p>
-
-<div><kbd>int dpout(DEPOT *<var>depot</var>, const char *<var>kbuf</var>, int <var>ksiz</var>);</kbd></div>
-
-<p>`dpout' はデータベースからレコードを削除する関数です。三つの引数の扱いは `dpget' のものと同じです。該当のレコードがない場合はエラーを返します(`DP_ENOITEM' というエラーコードが外部変数 `dpecode' に設定されます)。</p>
-
-<p>`dpiterinit' と `dpiternext' はデータベースの中のレコードを一つ一つ見ていく場合に使います。先程の内線番号データベースの全レコードを表示する関数の例を以下に示します。</p>
-
-<pre>#include &lt;depot.h&gt;
-#include &lt;stdlib.h&gt;
-#include &lt;stdio.h&gt;
-
-#define PHONEFILE "phone"
-
-int printphonenumbers(void){
- DEPOT *depot;
- char *kbuf, *vbuf;
- /* データベースを読み込みモードで開く */
- if(!(depot = dpopen(PHONEFILE, DP_OREADER, -1))) return -1;
- /* イテレータを初期化する */
- dpiterinit(depot);
- /* 各レコードのキーを取り出す */
- while((kbuf = dpiternext(depot, NULL)) != NULL){
- /* 各レコードの値を取り出す */
- if((vbuf = dpget(depot, kbuf, -1, 0, -1, NULL)) != NULL){
- printf("%s: %s\n", kbuf, vbuf);
- /* 値の領域を解放する */
- free(vbuf);
- }
- /* キーの領域を解放する */
- free(kbuf);
- }
- /* データベースを閉じる */
- return dpclose(depot) ? 0 : -1;
-}
-</pre>
-
-<p>全てのレコードを横断的に見ていくことを「トラバーサルアクセス」と呼ぶことにします。トラバーサルアクセスの際には、「イテレータ」を利用します。イテレータは集合に含まれる個々の要素を処理する際に、その要素を一つずつ取り出す機能です。トラバーサルアクセスをはじめる前にはイテレータを初期化します。そして、イテレータが「打ち止め」の合図を返すまで繰り返して呼び出します。</p>
-
-<div><kbd>int dpiterinit(DEPOT *<var>depot</var>);</kbd></div>
-
-<p>`dpiterinit' はイテレータを初期化する関数です。特に説明は必要ありませんね。</p>
-
-<div><kbd>char *dpiternext(DEPOT *<var>depot</var>, int *<var>sp</var>);</kbd></div>
-
-<p>`dpiternext' はイテレータから次のレコードのキーを取り出す関数です。第1引数は他と同じです。例によって戻り値はゼロコードが付加された領域へのポインタです。領域は `malloc' で確保されているので、アプリケーションの責任で `free' してください。明示的にサイズを知りたい場合は第2引数にそれを受け取る変数へのポインタを指定します。もう取り出すレコードがなくなったら `NULL' が返されます(`DP_ENOITEM' というエラーコードが外部変数 `dpecode' に設定されます)。</p>
-
-<p>トラバーサルアクセスで各レコードを辿る順番については規定されていませんので、レコードの順序に依存したプログラミングをしてはいけません(そのような場合はB+木データベースを使いましょう)。また、イテレータを繰り返している途中でレコードを上書きした場合、既に読んだはずのレコードがまた取り出される可能性があります。途中でレコードを削除することに関しては問題ありません。</p>
-
-<p>ここまででDepotの基本的な使い方は説明し終えました。QDBMのそれ以外のAPIもDepotに似たような使い方をしますので、基本仕様書のサンプルコードを見れば理解してもらえると思います。</p>
-
-<hr />
-
-<h2><a name="curia" id="curia" class="head">Curia: 拡張API</a></h2>
-
-<p>Curiaは、Depotとほとんど同じ機能とインタフェースを備えますが、ファイルでなくディレクトリとしてデータベースを扱うAPIです。やたらと大量のデータを扱わなければならない場合にはCuriaがお薦めです。データをディレクトリの中の複数のファイルに分散して格納するので、Depotよりも大きな(2GB以上の)データベースを扱うことができます。Depotではハンドルに `DEPOT' へのポインタを使いましたが、Curiaでは `CURIA' へのポインタを使います。そして、Depotでは `dp' で始まっていた関数名が、Curiaでは `cr' で始まります。名前が違うだけで、使い方は全く一緒です。ただし、データベースを開く `cropen' という関数は、データベースの分割数を指定する引数が増えています。</p>
-
-<div><kbd>CURIA *cropen(const char *<var>name</var>, int <var>omode</var>, int <var>bnum</var>, int <var>dnum</var>);</kbd></div>
-
-<p>第1、第2、第3引数は `dpopen' のものと全く一緒です。第4引数は、データベースの分割数を指定します。ディレクトリの中に、指定した数だけのファイルが作られます。なお、第3引数で指定した値はその各々のデータベースファイルが持つバケット数になります。戻り値はCuriaのデータベースハンドルとなります。</p>
-
-<p>Curiaには「ラージオブジェクト」を扱う機能もあります。ラージオブジェクトとは、各レコードをファイルとして独立させて保存する仕組みです。ラージオブジェクトにすると通常のレコードより処理速度が落ちますが、データベースのサイズを無限に(ディスクが許す限り)大きくすることができます。なお、ラージオブジェクトのトラバーサルアクセスはサポートされません。</p>
-
-<hr />
-
-<h2><a name="relic" id="relic" class="head">Relic: NDBM互換API</a></h2>
-
-<p>Relicは、NDBMのアプリケーションをすべからくQDBMに乗り換えさせるという野望の下に作られたAPIです。パフォーマンスはオリジナルのNDBMの数倍は出ます。NDBMのアプリケーションはあまり見ないですが、Perl等のスクリプト言語がそのインタフェースを備えています。つまりRelicによって各種のスクリプト言語でQDBMが使えることが保証されるわけです。</p>
-
-<p>あなたのアプリケーションのソースコード中で `ndbm.h' をインクルードしている部分を `relic.h' に書き換え、リンク対象を `ndbm' から `qdbm' に換えて再コンパイルしください。それだけであなたのアプリケーションはQDBMに乗り換えることができます。なお、新たにアプリケーションを書く際には、RelicでなくDepotを利用することをお薦めします。</p>
-
-<hr />
-
-<h2><a name="hovel" id="hovel" class="head">Hovel: GDBM互換API</a></h2>
-
-<p>Hovelは、GDBMのアプリケーションをすべからくQDBMに乗り換えさせるという野望の下に作られたAPIです。パフォーマンスはオリジナルのGDBMの数倍は出ます。GDBMのアプリケーションは市場に多く見られますが、それらをお使いの場合は、ぜひともQDBMに移植してあげてください。パフォーマンスが目に見えてに改善されることうけあいです。</p>
-
-<p>あなたのアプリケーションのソースコード中で `gdbm.h' をインクルードしている部分を `hovel.h' に書き換え、リンク対象を `gdbm' から `qdbm' に換えて再コンパイルしください。それだけであなたのアプリケーションはQDBMに乗り換えることができます。なお、新たにアプリケーションを書く際には、HovelでなくDepotを利用することをお薦めします。</p>
-
-<p>通常、Hovelが生成するデータベースファイルはDepotのものと全く同じものです。しかし、ちょっと細工するとそれをCuriaによるデータベースディレクトリに変更することができます。データベースハンドルを取得する関数 `gdbm_open' を、`gdbm_open2' に書き換えればよいのです。単一のファイルにデータベースを格納している場合は、ファイルサイズが2GBまでという制限にひっかかってしまいますが、`gdbm_open2' を使えばそれを乗り越えることができます。`gdbm_open' を呼び出しているところ以外は全く変更する必要がないというのが嬉しいところです。</p>
-
-<div><kbd>GDBM_FILE gdbm_open2(char *<var>name</var>, int <var>read_write</var>, int <var>mode</var>, int <var>bnum</var>, int <var>dnum</var>, int <var>align</var>);</kbd></div>
-
-<p>第1引数は生成するファイルかディレクトリの名前です。第2引数と第3引数は `gdbm_open' の第3引数と第4引数として渡すものと一緒です。第4引数はバケットの要素数です。第5引数はデータベースファイルの分割数です。第6引数は各レコードのアラインメントです。戻り値は `gdbm_open' と同じくデータベースハンドルです。</p>
-
-<hr />
-
-<h2><a name="cabin" id="cabin" class="head">Cabin: ユーティリティAPI</a></h2>
-
-<p>Cabinは、データの操作を簡単に行うためのユーティリティを集めたAPIです。密かにQDBMのAPIの中で最も充実しています。特にリストとマップに関連する関数が重宝します。他にも、ファイルやディレクトリを読んだり、文字列を分割したり、CSVやXMLを解析したり、各種の符号化と復号もできます。ここではリストとマップとXMLについて詳しく説明します。</p>
-
-<p>リストとは、順序を持った集合のことです。Cabinが扱うリストには任意の文字列やバイナリを要素として加えることができます。リストの先頭に対して要素の追加と削除ができるとともに、リストの末尾に対して要素の追加と削除をすることもできます(つまりデクです)。また、配列を使って実装されているので、任意の順番の要素の値を高速に参照することができます。以下の例では、`first'、`second'、`third' という文字列を順に末尾から追加した上で、先頭から末尾まで要素の内容を表示しています。</p>
-
-<pre>#include &lt;cabin.h&gt;
-#include &lt;stdlib.h&gt;
-#include &lt;stdio.h&gt;
-
-void listtest(void){
- CBLIST *list;
- int i;
- /* リストを開く */
- list = cblistopen();
- /* 要素を末尾から追加する */
- cblistpush(list, "first", -1);
- cblistpush(list, "second", -1);
- cblistpush(list, "third", -1);
- /* 先頭から要素の内容を表示する */
- for(i = 0; i &lt; cblistnum(list); i++){
- printf("%s\n", cblistval(list, i, NULL));
- }
- /* リストを閉じる */
- cblistclose(list);
-}
-</pre>
-
-<p>`CBLIST' 型へのポインタをリストのハンドルとして用います。実際のハンドルは `cblistopen' を呼び出して獲得します。ハンドルを閉じてメモリを解放するには、`cblistclose' を呼び出します。`cblistpush' は末尾に要素を追加します。`cblistnum' はリストの要素数を返します。`cblistval' はリスト内の特定の番号(ゼロからはじまる)の要素を返します。リスト操作の関数はその他にもいくつかあります。</p>
-
-<p>マップとは、キーと値からなるレコードの集合です。Cabinが扱うマップには任意の文字列やバイナリをキーや値に持つレコードを格納することができます。キーが完全に一致するレコードを検索して値を取り出すことができます(実装はハッシュ表です)。マップ内のレコードを先頭から一つずつ取り出すこともできます。なお、各要素は格納した順番で並んでいることが保証されています。以下の例では、キー `one' と値 `first'、キー `two' と値 `second'、キー `three' と値 `third' のレコードを順に格納した上で、その各々を検索して表示しています。</p>
-
-<pre>#include &lt;cabin.h&gt;
-#include &lt;stdlib.h&gt;
-#include &lt;stdio.h&gt;
-
-void maptest(void){
- CBMAP *map;
- /* マップを開く */
- map = cbmapopen();
- /* レコードを追加する */
- cbmapput(map, "one", -1, "first", -1, 1);
- cbmapput(map, "two", -1, "second", -1, 1);
- cbmapput(map, "three", -1, "third", -1, 1);
- /* レコードを検索して内容を表示する */
- printf("one: %s\n", cbmapget(map, "one", -1, NULL));
- printf("two: %s\n", cbmapget(map, "two", -1, NULL));
- printf("three: %s\n", cbmapget(map, "three", -1, NULL));
- /* マップを閉じる */
- cbmapclose(map);
-}
-</pre>
-
-<p>`CBMAP' 型へのポインタをマップのハンドルとして用います。実際のハンドルは `cbmapopen' を呼び出して獲得します。ハンドルを閉じてメモリを解放するには、`cbmapclose' を呼び出します。`cbmapput' でレコードを追加します。`cbmapget' でレコードを検索します。マップ操作の関数はその他にもいくつかあります。</p>
-
-<p>XMLを簡単に処理するために、簡易的なパーザが用意されています。このパーザは妥当性検証をせず、書式の検査も厳密でないのが特徴です。したがって、一般的なHTMLやSGMLの解析にも用いることができます。単純な構造のXML文書を処理する際には、DOMやSAXといったAPIを使うよりも便利です。以下の例では、XML文書の中から `id' 属性の値で要素を指定して、そのテキストを取り出して表示します。</p>
-
-<pre>#include &lt;cabin.h&gt;
-#include &lt;stdlib.h&gt;
-#include &lt;string.h&gt;
-#include &lt;stdio.h&gt;
-
-void showtextbyid(const char *xml, const char *id){
- CBLIST *elems;
- CBMAP *attrs;
- const char *elem, *attr;
- char *orig;
- int i;
- /* タグとテキストのリストを取得する */
- elems = cbxmlbreak(xml, 1);
- /* リストの各要素をたどる */
- for(i = 0; i &lt; cblistnum(elems); i++){
- /* 要素を取り出す */
- elem = cblistval(elems, i, NULL);
- /* タグでない場合は読み飛ばす */
- if(elem[0] != '&lt;' || elem[1] == '?' || elem[1] == '!' || elem[1] == '/') continue;
- /* 属性のマップを取得する */
- attrs = cbxmlattrs(elem);
- /* ID要素の値を取り出し、一致を検査する */
- attr = cbmapget(attrs, "id", -1, NULL);
- if(attr &amp;&amp; !strcmp(attr, id)){
- /* 次の要素を取り出す */
- elem = cblistval(elems, i + 1, NULL);
- if(elem){
- /* 実体参照を復元して表示する */
- orig = cbxmlunescape(elem);
- printf("%s\n", orig);
- free(orig);
- }
- }
- /* 属性マップを閉じる */
- cbmapclose(attrs);
- }
- /* 要素リストを閉じる */
- cblistclose(elems);
-}
-</pre>
-
-<p>処理対象のXML文書のテキストを `cbxmlbreak' で分解します。例えば `&lt;body&gt;&lt;p id="nuts"&gt;NUTS&amp;amp;MILK&lt;/p&gt;&lt;/body&gt;' を分解すると、`&lt;body&gt;'、`&lt;p id="nuts"&gt;'、`NUTS&amp;amp;MILK'、`&lt;/p&gt;'、`&lt;/body&gt;' が得られます。そして、各要素を巡回します。1文字目が '&lt;' であればタグか各種の宣言であり、かつ2文字目が '?'、`!'、`/' のいずれでもなければ開始タグまたは空タグであると判断できます。タグに対して `cbxmlattrs' を呼ぶことで属性のマップが得られます。このマップは属性名をキーにして値を取り出すことができます。属性値やテキストセクションの文字列は文書内に出現したままの形式になっています。実体参照を含んだ文字列を復元するには `cbxmlunescape' を用います。</p>
-
-<p>GTK+に付属するGLibやApacheに付属するAPRなどの便利なライブラリが世の中にはありますので、単体でCabinを利用する価値はあまりありません。正直言って、GLibやAPRの方が高機能で、ユーザ数も多く、参考になる情報も多いです。とはいえ、Cabinの方が手軽に使えるので私は好きです。</p>
-
-<hr />
-
-<h2><a name="villa" id="villa" class="head">Villa: 上級API</a></h2>
-
-<p>Villaは、B+木のデータベースを扱うAPIです。B+木データベースにはユーザが指定した順序でレコードが並べられて格納されます。DepotやCuriaはキーの完全一致による検索しかできませんが、Villaを用いると範囲を指定してレコードを検索することができます。また、同じキーを持つ複数のレコードを格納することもできます。例えば、キーを文字列の辞書順(ABC順とかアイウエオ順と同じほぼ意味です)で並べるように指定した場合は、文字列の前方一致検索ができるのです。</p>
-
-<p>とはいえ、基本的な使い方はDepotと一緒です。Depotの説明で挙げた関数をVillaを使って実装しなおしてみます。</p>
-
-<pre>#include &lt;depot.h&gt;
-#include &lt;cabin.h&gt;
-#include &lt;villa.h&gt;
-#include &lt;stdlib.h&gt;
-
-#define PHONEFILE "phone"
-
-int putphonenumber(const char *id, const char *phone){
- VILLA *villa;
- /* データベースを追記モードで開く */
- if(!(villa = vlopen(PHONEFILE, VL_OWRITER | VL_OCREAT, VL_CMPLEX))) return -1;
- /* レコードを書き込む */
- vlput(villa, id, -1, phone, -1, VL_DOVER);
- /* データベースを閉じる */
- if(!vlclose(villa)) return -1;
- return 0;
-}
-
-char *getphonenumber(const char *id){
- VILLA *villa;
- char *phone;
- /* データベースを読み込みモードで開く */
- if(!(villa = vlopen(PHONEFILE, VL_OREADER, VL_CMPLEX))) return NULL;
- /* レコードを検索して戻り値を生成する */
- phone = vlget(villa, id, -1, NULL);
- /* データベースを閉じる */
- vlclose(villa);
- return phone;
-}
-</pre>
-
-<p>`VILLA' へのポインタは例によってデータベースハンドルです。`vlopen' でそのハンドルを獲得します。その第3引数の `VL_CMPLEX' は辞書順の比較を行う関数です。開いたハンドルは `vlclose' で閉じます。`vlput' はレコードを格納する関数で、`vlget' はレコードを検索する関数です。</p>
-
-<p>上記の例ではハッシュデータベースと全く同じ使い方をしましたが、順番に基づいてレコードにアクセスする機能がB+木データベースの特徴です。辞書順を例にとって説明します。キーがそれぞれ `one'、`two'、`three'、`four' というレコードを格納したとすれば、それは `four'、`one'、`three'、`two' という順番で並べられて保存されます。検索にはハッシュデータベースと同様に完全一致条件も使えます。さらに、「カーソル」という機能を使って範囲を指定した検索ができます。カーソルはレコードの位置を指し示します。例えば、`one' の場所にカーソルを飛ばすといった指定ができます。`one' がない場合は、`one' の直後の `three' の位置にカーソルが飛ぶことになります(`one' が複数あった場合は、その最初のレコードに飛びます)。カーソルは、現在位置から前に進めたり後ろに戻したりすることもできます。そして、カーソルの位置のレコードの内容を読み出せば、範囲を指定した検索ができるというわけです。以下の例は、`one' から `three' までのレコードのキーと値を表示する関数です。</p>
-
-<pre>#include &lt;depot.h&gt;
-#include &lt;cabin.h&gt;
-#include &lt;villa.h&gt;
-#include &lt;stdlib.h&gt;
-#include &lt;stdio.h&gt;
-
-#define WORDFILE "word"
-#define TOPWORD "one"
-#define BOTTOMWORD "three"
-
-void printwords(void){
- VILLA *villa;
- char *kbuf, *vbuf;
- int ksiz;
- /* データベースを読み込みモードで開く */
- if(!(villa = vlopen(WORDFILE, VL_OREADER, VL_CMPLEX))) return;
- /* カーソルを候補の先頭に飛ばす */
- vlcurjump(villa, TOPWORD, -1, VL_JFORWARD);
- /* 各候補を処理する */
- do {
- /* レコードのキーを取り出す */
- kbuf = vlcurkey(villa, &amp;ksiz);
- /* 候補が範囲外であれば抜ける */
- if(!kbuf || VL_CMPLEX(kbuf, ksiz, BOTTOMWORD, sizeof(BOTTOMWORD) - 1) &gt; 0){
- free(kbuf);
- break;
- }
- /* レコードの値を取り出して表示する */
- vbuf = vlcurval(villa, NULL);
- if(kbuf &amp;&amp; vbuf) printf("%s: %s\n", kbuf, vbuf);
- /* キーと値の領域を解放する */
- free(vbuf);
- free(kbuf);
- /* カーソルを次に進める */
- } while(vlcurnext(villa));
- /* データベースを閉じる */
- vlclose(villa);
-}
-</pre>
-
-<p>`vlcurjump' でカーソルを候補の先頭に飛ばしています。`VL_JFORWARD' はこれからカーソルを前に進めていく場合に指定します(候補の末尾に飛ばしてから後ろに戻して行く場合は `VL_JBACKWARD' を指定します)。do-whileループの条件部で `vlcurnext' を呼んでいますが、これがカーソルを前に進めています(データベースの最後まで来たら偽を返すのでループから抜けます)。`vlcurkey' と `vlcurval' はそれぞれカーソルのキーと値を取り出します。`VL_CMPLEX' を明示的に呼んでいる場所がありますが、ここで候補の末尾に来たかどうか判定しています。比較関数は、二つのキーのポインタとサイズを渡して、前者が大きい(つまり後ろに位置すべき)なら正の値、前者が小さい(つまり前に位置すべき)なら負の値、両者が同じならゼロを返すと規定されています。したがって、正の値が返された場合、今取り出したキーは候補の末尾よりも後ろだということになります。</p>
-
-<p>辞書順以外の比較関数も使えるところがVillaのミソです。int型の数値を比較する `VL_CMPINT' や、10進数の文字列を比較する `VL_CMPDEC' といった関数が最初から用意されています。さらに、あなたが自分で定義した関数も比較関数として使うことができます。使い方が面倒だという欠点を除けば、B+木データベースはハッシュデータベースよりも多くのシーンで活用できると思います。ファイルがハッシュデータベースよりも小さかったり、トランザクションが使えるといった特徴も、人によっては嬉しいかもしれません。</p>
-
-<p>Villaは、キュー(FIFO)を永続化する目的でも利用できます。`VL_CMPINT' を比較関数にしてデータベースを開きます。各レコードのキーはint型とし、値には任意のオブジェクトを入れることにします。キューに要素を追加するには、末尾のキーの数値(なければゼロ)をインクリメントしてキーを生成して格納します。キューから要素を取り出すには、先頭のレコードを取り出してから削除すればよいのです。そのような機能を持つラッパ関数を、`qopen'、`qclose'、`qappend'、`qconsume' といった名前で作っておくと小粋ですね。</p>
-
-<hr />
-
-<h2><a name="odeum" id="odeum" class="head">Odeum: 転置API</a></h2>
-
-<p>Odeumは、全文検索用の転置インデックスを扱うAPIです。テキストファイル(またはテキストを含むHTMLやMS-Wordの文書など)は単語の集合とみなせますが、ある単語がどのファイルに含まれるかという情報をデータベースにしたものを転置インデックスと呼びます。本の巻末にある索引は、ある単語がどのページに含まれるかという情報を持っていますが、それと似たようなものです。私がQDBMを開発する契機となったのは、とある全文検索システムの開発で使っていたGDBMのパフォーマンスに限界を感じたことです。その経緯から、QDBM(特にCuria)には転置インデックスの実現に都合のよい特徴がいくつか備わっています。</p>
-
-<p>転置インデックスの核となるのは、ある単語をキーとし、その単語を含むファイルのIDの配列を値とするレコードからなるデータベースです。単語は完全一致で検索できればよいので、データ構造にはハッシュ表を採用しています。転置インデックスのイメージを例示します。ファイル `penguin.txt' には「flightless marine birds」というテキストが格納されていて、ファイル `ostrich.txt' には、「flightless birds in africa」というテキストが格納されているとします。各ファイルには、読み込んだ順番でIDをつけることにします。これらを対象として転置インデックスを作成すると、以下のようになります。IDとファイル名の対応づけは別の「文書データベース」に保存しておきます。</p>
-
-<table summary="index example">
-<tr><td>flightless</td><td>1,2</td></tr>
-<tr><td>marine</td><td>1</td></tr>
-<tr><td>birds</td><td>1,2</td></tr>
-<tr><td>in</td><td>2</td></tr>
-<tr><td>africa</td><td>2</td></tr>
-</table>
-
-<p>その次に読み込んだ文書に「birds」という単語が含まれていた場合には、`birds' の値を [1,2,3] に変更することになります。このように、既存のレコードの値の末尾にデータを追加するという操作が頻繁に発生します。この処理を効率的に行うために、DepotやCuriaの書き込み操作には「連結モード」があるのです。</p>
-
-<p>検索時には、検索語をキーにして値の配列を取り出し、個々のIDに対応するファイル名を文書データベースから取り出して提示することになります。ただし該当の文書が多い場合にその全てを提示してもユーザは困惑するので、先頭の何件かに絞って取り出します。DepotやCuriaの読み込み操作ではレコードの値から特定の部分のみを取り出すことができるので、この処理を効率良く行うことができます。実際は、ファイルにおける単語のスコア(重要度)も配列要素の一部として格納しておいて、それを基準にソートしておくことによって、先頭の要素がユーザにとって意味のあるものにしています。</p>
-
-<p>ファイルには名前以外にも、タイトルや作者名や更新日時といった属性をつけたい場合があります。それらの情報は文書データベースに保存します。Odeumで扱うファイル(以後は文書と呼びます)は、ファイル名の代わりにURIをつけるものとしています。URI以外の属性はユーザがラベルをつけて任意のものを格納できます。</p>
-
-<p>Odeumは、文書のテキストや属性を元のデータから抽出する機能については提供しません。それらはドメインに強く依存するので、共通化することが難しいからです。したがって、アプリケーションがそれを実装する必要があります。Odeumのサンプルアプリケーションは、ローカルのファイルシステムにあるプレーンテキストとHTMLからテキストと属性を抽出できます。あなたのアプリケーションでは、PDFやMS-Wordの文書に対応するのもよいでしょう。Webから文書を取得してもよいでしょう。同じ理由から、Odeumはテキストから単語を抽出する機能についても提供しません。英語と日本語では全く異なる手法でテキストの解析をしなければなりませんが、そういったこともアプリケーションに任されます。Odeumのサンプルアプリケーションでは、単に空白で語を区切るという手法をとっています。あなたのアプリケーションでは、日本語の形態素解析を行うのもよいでしょう。英単語のステミング処理を行ってもよいでしょう。</p>
-
-<p>多くの言語では、同じ単語に対して異体や活用が存在します。例えば「使う/使っ(た)」「go/went」「child/children」などです。そこで、Odeumは各単語を「正規形」および「出現形」の組として扱います。テキストから出現形の単語を切り出したり、それらの正規形を生成する処理はアプリケーションに任されます。転置インデックスでのレコードのキーには正規形が使われます。「child」で検索すれば、「children」を含む文書も該当させられるということです。検索語に対しても正規化の処理を行えば、「children」で検索して「child」を該当にできます。なお、出現形もデータベースに記録されますが、それは検索結果として文書の要約を提示するなどの用途で利用されます(不要な場合は出現形を全て空文字列にして記憶領域を節約できます)。</p>
-
-<p>全文検索システムの善し悪しを評価する際には、スコアリング(ランキング)が重要な要素になります。検索結果が多い場合に、その中から絞り込んでユーザに提示する文書をどうやって選択するかということです。いくら検索速度が速くても、満足のいく検索結果が提示されずに何度も検索したり、無駄な文書を閲覧しなければならないのでは、結局は時間がかかることになってしまいます。Odeumでは、文書を登録する際に、そこに含まれる各単語について以下の式でスコアを算出して、文書IDとともに転置インデックスに格納しています。</p>
-
-<div><kbd>スコア = (該当語の出現数 * 10000) / log(文書内の総語数) ^ 3</kbd></div>
-
-<p>ある単語がたくさん出現するということは、その文書でその単語のことについて詳しく説明されている可能性が高いと判断できます。ただし、大きな文書は小さい文書よりも単語の出現数が多くなりますので、その調整をする必要があります。そこで、該当語の出現数を、総語数の自然対数の三乗で割っているのです。なお、テキストの先頭10%以内に出て来る単語は「トピックセンテンス」を構成するとみなして、初出時に限り10000でなく15000を加算しています。</p>
-
-<p>全文検索は通常、複数の検索語を使って行われます。その際には、各検索語のスコアを調整しないと、特定の検索語のスコアの影響が強すぎるという事態が発生します。例えば「the beatles」で検索した場合、「the」のスコアが「beatles」のスコアを圧倒して、「beatles」について知りたいのに、関係ない文書ばかりが提示されることになってしまいます。Odeumは転置インデックスの内容を提示するだけで、それ以後の処理はアプリケーションに任されます。Odeumに付属するサンプルアプリケーションでは以下の式で調整を行っています。</p>
-
-<div><kbd>調整済みスコア = 登録されたスコア / log(その語を含む文書数) ^ 2</kbd></div>
-
-<p>ありふれた単語はスコアを下げ、特徴的な単語はスコアを維持すべきです。そこで、登録されたスコアを、その語を含む文書数の自然対数の二乗で割っているのです(TF-IDF法を強化したものです)。各検索語の調整済みスコアを足したものを文書のスコアとし、その降順で検索結果を提示します。他にもドメインに依存した様々なスコアリング手法があると思いますが、アプリケーションがそれを実装できるのが嬉しいところです。</p>
-
-<p>Odeumのサンプルアプリケーションでは、関連文書検索(類似文書検索と呼んだ方が適切かもしれません)の機能も実装しています。ある文書(種文書と呼びます)に関連した文書の一覧を提示するものです。単語の出現傾向が似通った文書は互いに関連しているという考え方(ベクトル空間モデル)に基づいています。文書をデータベースに登録する際には、各文書に含まれる全単語に対して調整済みスコアを計算し、その上位32語(キーワードと呼びます)の情報を文書と対応づけて登録しておきます。検索時には、種文書のキーワードとスコアを取り出し、それを32次元のベクトルとして表現します。関連度を判定する対象の各文書からもキーワードとスコアを取り出し、種文書のベクトル空間に対応したベクトルを生成します。そうしてできた二つのベクトルのなす角が小さいものは関連度が高いと判定します。実際には、なす角の余弦(0から1の範囲で、完全一致する場合は1になる)が大きいものから提示されることになります。なお、登録された全ての文書を対象として類似度の判定を行うとあまりに時間がかかるので、キーワードでOR検索を行った結果の上位の文書のみを関連度算出の対象としています。</p>
-
-<p>前置きはここまでにして、Odeumの使用方法についての説明に入ります。URIが `http://tako.ika/uni.txt' で、そこから取り出したテキストが「The sun is driven by the Grateful Dead.」で、切り出した単語(正規形/出現形)が「the/The」「sun/sun」「be/is」「drive/driven」「by/by」「the/the」「grateful/Grateful」「die/dead」「(正規形なし)/.」だとしましょう(この処理はアプリケーションが独自に実装してください)(いわゆるストップワードは正規形を空文字列にして表現します)。それを `index' という名前のデータベースに登録する例を示します。</p>
-
-<pre>#include &lt;depot.h&gt;
-#include &lt;cabin.h&gt;
-#include &lt;odeum.h&gt;
-#include &lt;stdlib.h&gt;
-
-int docregistertest(void){
- ODEUM *odeum;
- ODDOC *doc;
- /* データベースを開く */
- if(!(odeum = odopen("index", OD_OWRITER | OD_OCREAT))) return -1;
- /* 文書を表現する */
- doc = oddocopen("http://tako.ika/uni.txt");
- oddocaddword(doc, "the", "the");
- oddocaddword(doc, "sun", "sun");
- oddocaddword(doc, "be", "is");
- oddocaddword(doc, "drive", "driven");
- oddocaddword(doc, "by", "by");
- oddocaddword(doc, "the", "the");
- oddocaddword(doc, "grateful", "Grateful");
- oddocaddword(doc, "die", "Dead");
- oddocaddword(doc, "", ".");
- /* 文書を登録する */
- odput(odeum, doc, -1, 1);
- /* 文書の領域を解放する */
- oddocclose(doc);
- /* データベースを閉じる */
- if(!odclose(odeum)) return -1;
- return 0;
-}
-</pre>
-
-<p>`ODEUM' へのポインタは例によってデータベースハンドルです。`odopen' でそのハンドルを獲得します。開いたハンドルは `odclose' で閉じます。`ODDOC' は文書ハンドルです。各文書の内容は文書ハンドルによって表現されます。`oddocopen' はハンドルを開く関数です。その第1引数で文書のURIを指定します。文書ハンドルは不要になったら `oddocclose' で解放します。テキストの各単語を文書に登録するには、`oddocaddword' を用います。その第2引数は単語の正規形で、第3引数は出現形です。文書を表現したら、それを `odput' でデータベースに登録します。第3引数は、文書データベースに登録する語数を指定します。`-1' にすると全部の語が登録されます。第4引数は、同じURIの既存の文書がある場合に、それを上書きするか否か指定します。</p>
-
-<p>`odput' の第3引数の指定が少し難しいので補足します。ある文書が適切に検索されるために、転置インデックスにおいて、その文書に含まれる全ての単語のレコードの値にその文書のIDが無条件で追加されます。ところで、多くの全文検索システムでは、検索結果の画面で該当の文書の要約を表示します。そのためには、文書データベースの中に、各文書と関連づけて含まれる単語を順番に記録しておく必要があります。検索語の周辺の文を切り出して表示する場合を考えると、検索語が文書中のどこに現れるかは予想できないので、全ての単語を文書データベースに記録しておかなければなりません。あるいは、冒頭の何語かだけ表示する場合には、その語数分の語を登録しておけばよいことになります。そういった決定をアプリケーションに任せるために、文書データベースに登録する語数を指定できるようになっているのです。</p>
-
-<p>以下の例では、`grateful' という単語を含む文書を検索して、そのURIとスコアを表示します。まず転置インデックスを検索して結果の配列を受け取ります。その配列の各要素は文書のIDとスコアの組です。文書の内容を取得するには、文書IDを使って文書データベースに問い合わせます。</p>
-
-<pre>#include &lt;depot.h&gt;
-#include &lt;cabin.h&gt;
-#include &lt;odeum.h&gt;
-#include &lt;stdlib.h&gt;
-#include &lt;stdio.h&gt;
-
-void docsearchtest(void){
- ODEUM *odeum;
- ODPAIR *pairs;
- ODDOC *doc;
- int i, pnum;
- /* データベースを読み込みモードで開く */
- if(!(odeum = odopen("index", OD_OREADER))) return;
- /* 転置インデックスを検索する */
- pairs = odsearch(odeum, "grateful", -1, &amp;pnum);
- if(pairs &amp;&amp; pnum &gt; 0){
- /* 該当の各文書を処理する */
- for(i = 0; i &lt; pnum; i++){
- /* 文書データベースから文書を取り出す */
- if(!(doc = odgetbyid(odeum, pairs[i].id))) continue;
- /* 文書の内容を表示する */
- printf("URI: %s\n", oddocuri(doc));
- printf("SCORE: %d\n", pairs[i].score);
- /* 文書の領域を解放する */
- oddocclose(doc);
- }
- }
- /* 検索結果の領域を解放する */
- free(pairs);
- /* データベースを閉じる */
- odclose(odeum);
-}
-</pre>
-
-<p>転置インデックスを検索するのが `odsearch' という関数です。第2引数には正規形の検索語を指定します。第3引数には、検索する文書の最大数を指定しますが、全部取り出す場合は `-1' とします。結果の配列はスコアの降順でソートされていることが規定されています。第4引数には、結果の配列の要素数を格納する変数のポインタを指定します。次に、配列の各要素を処理していきます。`odgetbyid' は文書IDを用いて文書の内容を問い合わせる関数です。転置インデックスの中には既に削除されたり上書きされてIDが変更された文書の情報も入っているので(最適化すれば不要な情報はなくなりますが)、`odgetbyid' は失敗する可能性があります。そういう時は単に無視して次のループに進んでください。文書が取得できたら、あとはそれを表示します。`oddocuri' は文書のURIを返す関数です。他にも文書の情報を取得する関数がいくつか用意されています。</p>
-
-<p>Odeumでは、複数の検索語を用いて、AND条件(検索語の全てを含む)やOR条件(検索語のいずれかを含む)やNOTAND条件(検索語の前者を含むが後者は含まない)といった集合演算を処理するための関数が用意されているほか、全文検索システムの実装に便利なユーティリティ関数が多数提供されます。全文検索システムを実装する際には性能と精度のバランスを考えなければなりませんが、OdeumのAPIはアプリケーションがそれを任意に決められるように設計されています。大規模なインデックスを扱う際には、まず精度を落した検索を行って、その結果がユーザの要求を満たさなければ精度を高めたパラメータで再検索する手法が有効でしょう。</p>
-
-<hr />
-
-</body>
-
-</html>
-
-<!-- END OF FILE -->
diff --git a/qdbm/misc/win32check.bat b/qdbm/misc/win32check.bat
deleted file mode 100644
index 63dae180..00000000
--- a/qdbm/misc/win32check.bat
+++ /dev/null
@@ -1,111 +0,0 @@
-dptest write casket 50000 5000
-if errorlevel 1 goto error
-dptest read casket
-if errorlevel 1 goto error
-dptest read -wb casket
-if errorlevel 1 goto error
-dptest rcat casket 50000 50 500 32 32
-if errorlevel 1 goto error
-dptest combo casket
-if errorlevel 1 goto error
-dptest wicked casket 5000
-if errorlevel 1 goto error
-del /Q casket
-
-crtest write casket 50000 500 10
-if errorlevel 1 goto error
-crtest read casket
-if errorlevel 1 goto error
-crtest read -wb casket
-if errorlevel 1 goto error
-crtest rcat casket 50000 5 10 500 32 32
-if errorlevel 1 goto error
-crtest combo casket
-if errorlevel 1 goto error
-crtest wicked casket 5000
-if errorlevel 1 goto error
-rd /S /Q casket
-
-crtest write -lob casket 1000 50 10
-if errorlevel 1 goto error
-crtest read -lob casket
-if errorlevel 1 goto error
-rd /S /Q casket
-
-rltest write casket 50000
-if errorlevel 1 goto error
-rltest read casket 50000
-if errorlevel 1 goto error
-del /Q casket*
-
-hvtest write casket 50000
-if errorlevel 1 goto error
-hvtest read casket 50000
-if errorlevel 1 goto error
-del /Q casket
-
-hvtest write -qdbm casket 50000
-if errorlevel 1 goto error
-hvtest read -qdbm casket 50000
-if errorlevel 1 goto error
-rd /S /Q casket
-
-cbtest sort 5000
-if errorlevel 1 goto error
-cbtest strstr 500
-if errorlevel 1 goto error
-cbtest list 50000
-if errorlevel 1 goto error
-cbtest map 50000
-if errorlevel 1 goto error
-cbtest wicked 5000
-if errorlevel 1 goto error
-cbtest misc
-if errorlevel 1 goto error
-
-vltest write -tune 25 64 32 32 casket 50000
-if errorlevel 1 goto error
-vltest read casket
-if errorlevel 1 goto error
-vltest rdup -tune 25 64 256 256 casket 50000 50000
-if errorlevel 1 goto error
-vltest combo casket
-if errorlevel 1 goto error
-vltest wicked casket 5000
-if errorlevel 1 goto error
-del /Q casket
-
-vltest write -int -cz -tune 25 64 32 32 casket 50000
-if errorlevel 1 goto error
-vltest read -int casket
-if errorlevel 1 goto error
-vltest rdup -int -cz -tune 25 64 256 256 casket 50000 50000
-if errorlevel 1 goto error
-vltest combo -cz casket
-if errorlevel 1 goto error
-vltest wicked -cz casket 5000
-if errorlevel 1 goto error
-del /Q casket
-
-odtest write casket 500 50 5000
-if errorlevel 1 goto error
-odtest read casket
-if errorlevel 1 goto error
-odtest combo casket
-if errorlevel 1 goto error
-odtest wicked casket 500
-if errorlevel 1 goto error
-rd /S /Q casket
-
-@echo off
-echo #================================
-echo # SUCCESS
-echo #================================
-goto :EOF
-
-:error
-@echo off
-echo #================================
-echo # ERROR
-echo #================================
-goto :EOF