diff options
Diffstat (limited to 'qdbm/misc')
-rw-r--r-- | qdbm/misc/COPYING.txt | 504 | ||||
-rw-r--r-- | qdbm/misc/README-win32.txt | 101 | ||||
-rw-r--r-- | qdbm/misc/VCmakefile-old | 169 | ||||
-rw-r--r-- | qdbm/misc/benchmark.pdf | bin | 0 -> 52196 bytes | |||
-rw-r--r-- | qdbm/misc/icon16.png | bin | 0 -> 339 bytes | |||
-rw-r--r-- | qdbm/misc/icon20.png | bin | 0 -> 275 bytes | |||
-rw-r--r-- | qdbm/misc/index.html | 202 | ||||
-rw-r--r-- | qdbm/misc/index.ja.html | 209 | ||||
-rw-r--r-- | qdbm/misc/logo.png | bin | 0 -> 11430 bytes | |||
-rwxr-xr-x | qdbm/misc/makevcdef | 48 | ||||
-rw-r--r-- | qdbm/misc/mymemo-ja.html | 34 | ||||
-rw-r--r-- | qdbm/misc/tutorial-ja.html | 622 | ||||
-rw-r--r-- | qdbm/misc/win32check.bat | 111 |
13 files changed, 2000 insertions, 0 deletions
diff --git a/qdbm/misc/COPYING.txt b/qdbm/misc/COPYING.txt new file mode 100644 index 00000000..b1e3f5a2 --- /dev/null +++ b/qdbm/misc/COPYING.txt @@ -0,0 +1,504 @@ + 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 new file mode 100644 index 00000000..d5a98e2d --- /dev/null +++ b/qdbm/misc/README-win32.txt @@ -0,0 +1,101 @@ +================================================================ + 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 new file mode 100644 index 00000000..8cd55467 --- /dev/null +++ b/qdbm/misc/VCmakefile-old @@ -0,0 +1,169 @@ +# 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 Binary files differnew file mode 100644 index 00000000..8b9df904 --- /dev/null +++ b/qdbm/misc/benchmark.pdf diff --git a/qdbm/misc/icon16.png b/qdbm/misc/icon16.png Binary files differnew file mode 100644 index 00000000..6d6ed13d --- /dev/null +++ b/qdbm/misc/icon16.png diff --git a/qdbm/misc/icon20.png b/qdbm/misc/icon20.png Binary files differnew file mode 100644 index 00000000..edad7849 --- /dev/null +++ b/qdbm/misc/icon20.png diff --git a/qdbm/misc/index.html b/qdbm/misc/index.html new file mode 100644 index 00000000..7a5271c3 --- /dev/null +++ b/qdbm/misc/index.html @@ -0,0 +1,202 @@ +<?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&description=on&term=qdbm&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 new file mode 100644 index 00000000..65ea073c --- /dev/null +++ b/qdbm/misc/index.ja.html @@ -0,0 +1,209 @@ +<?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&description=on&term=qdbm&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 Binary files differnew file mode 100644 index 00000000..d5cf9771 --- /dev/null +++ b/qdbm/misc/logo.png diff --git a/qdbm/misc/makevcdef b/qdbm/misc/makevcdef new file mode 100755 index 00000000..7b36e307 --- /dev/null +++ b/qdbm/misc/makevcdef @@ -0,0 +1,48 @@ +#! /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 new file mode 100644 index 00000000..87de7843 --- /dev/null +++ b/qdbm/misc/mymemo-ja.html @@ -0,0 +1,34 @@ +<?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 new file mode 100644 index 00000000..66f1c3c3 --- /dev/null +++ b/qdbm/misc/tutorial-ja.html @@ -0,0 +1,622 @@ +<?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 <stdio.h> +#include <stdlib.h> +#include <string.h> + +#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 <depot.h> +#include <stdlib.h> + +#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 <depot.h> +#include <stdlib.h> +#include <stdio.h> + +#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 <cabin.h> +#include <stdlib.h> +#include <stdio.h> + +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 < 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 <cabin.h> +#include <stdlib.h> +#include <stdio.h> + +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 <cabin.h> +#include <stdlib.h> +#include <string.h> +#include <stdio.h> + +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 < cblistnum(elems); i++){ + /* èŠçŽ ãåãåºã */ + elem = cblistval(elems, i, NULL); + /* ã¿ã°ã§ãªãå Žåã¯èªã¿é£ã°ã */ + if(elem[0] != '<' || elem[1] == '?' || elem[1] == '!' || elem[1] == '/') continue; + /* å±æ§ã®ããããååŸãã */ + attrs = cbxmlattrs(elem); + /* IDèŠçŽ ã®å€ãåãåºããäžèŽãæ€æ»ãã */ + attr = cbmapget(attrs, "id", -1, NULL); + if(attr && !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' ã§å解ããŸããäŸãã° `<body><p id="nuts">NUTS&amp;MILK</p></body>' ãå解ãããšã`<body>'ã`<p id="nuts">'ã`NUTS&amp;MILK'ã`</p>'ã`</body>' ãåŸãããŸãããããŠãåèŠçŽ ãå·¡åããŸãã1æåç®ã '<' ã§ããã°ã¿ã°ãåçš®ã®å®£èšã§ããããã€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 <depot.h> +#include <cabin.h> +#include <villa.h> +#include <stdlib.h> + +#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 <depot.h> +#include <cabin.h> +#include <villa.h> +#include <stdlib.h> +#include <stdio.h> + +#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, &ksiz); + /* åè£ãç¯å²å€ã§ããã°æãã */ + if(!kbuf || VL_CMPLEX(kbuf, ksiz, BOTTOMWORD, sizeof(BOTTOMWORD) - 1) > 0){ + free(kbuf); + break; + } + /* ã¬ã³ãŒãã®å€ãåãåºããŠè¡šç€ºãã */ + vbuf = vlcurval(villa, NULL); + if(kbuf && 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 <depot.h> +#include <cabin.h> +#include <odeum.h> +#include <stdlib.h> + +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 <depot.h> +#include <cabin.h> +#include <odeum.h> +#include <stdlib.h> +#include <stdio.h> + +void docsearchtest(void){ + ODEUM *odeum; + ODPAIR *pairs; + ODDOC *doc; + int i, pnum; + /* ããŒã¿ããŒã¹ãèªã¿èŸŒã¿ã¢ãŒãã§éã */ + if(!(odeum = odopen("index", OD_OREADER))) return; + /* 転眮ã€ã³ããã¯ã¹ãæ€çŽ¢ãã */ + pairs = odsearch(odeum, "grateful", -1, &pnum); + if(pairs && pnum > 0){ + /* 該åœã®åææžãåŠçãã */ + for(i = 0; i < 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 new file mode 100644 index 00000000..63dae180 --- /dev/null +++ b/qdbm/misc/win32check.bat @@ -0,0 +1,111 @@ +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
|