pax_global_header00006660000000000000000000000064112526163270014517gustar00rootroot0000000000000052 comment=e64fb254272a23e2195020cb731e0d21b471dd71 hyperestraier-1.4.13/000077500000000000000000000000001125261632700144735ustar00rootroot00000000000000hyperestraier-1.4.13/COPYING000066400000000000000000000634761125261632700155460ustar00rootroot00000000000000 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. Copyright (C) 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. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! hyperestraier-1.4.13/ChangeLog000066400000000000000000001206371125261632700162560ustar00rootroot000000000000002007-12-24 Mikio Hirabayashi * mymorph.c (est_mecab_analyze): an option about EOS was added. - Release: 1.4.13 2007-11-18 Mikio Hirabayashi * estraier.c: code clean-up. - Bugs related to type casting of perl binding were fixed. - Release: 1.4.12 2006-11-11 Mikio Hirabayashi * estraier.c (est_resmap_add): "method" argument was added. * estraier.c (est_inode): a bug related to overflow was fixed. * estraier.c (est_narrow_score): a bug related to attribute distinction was fixed. * estraier.c (est_search_union): search accuracy with trailing uni-gram was improved. * estmaster.c (searchlocal): a bug related to scanning with regular expressions was fixed. * estscout.c (realmain): "union", "score", and "idsuffix" attributes were added. * estsupt.c (realmain): "score" attribute was added. * estsupt.c (procsearch): accuracy of hint was improved. * estsupt.c (realmain): "logmsg" parameter was added. * estscout.c (realmain): "distinct" parameter was added. * estscout.c (showresult): cache clear at random was added. - Release: 1.4.11 2006-11-11 Mikio Hirabayashi * estraier.c (est_set_ecode): new function. * estraier.c (est_search_union): scoring of ASIS mode was modified. * estraier.c (est_resmap_add, est_resmap_dump_keys): new functions. * estraier.c (est_narrow_scores): efficiency of narrowing index was improved. * estraier.c (est_utime): new function. * estraier.c (est_cond_scores, est_cond_set_narrowing_scores): new functions. * estraier.c (est_rescc_put): a bug of memory leak was fixed. * estnode.c: the function "est_datum_printf" was replaced by "cbdatumprintf". * estmaster.c (sendnodecmdsearch): accuracy of hints was improved. * estfraud.c (sendnodecmdputdoc): accuracy of hints was improved. * estfraud.c (sendnodecmdputdoc): morphological analyzer support was added. * estfraud.c (sendnodecmdputdoc): accuracy of hints was improved. * estwaver.c (runinit, procinit): "-apn", "-acc", "-sv", "-si", "-sa" options was added. * estscout.c: new file. * estsupt.c: new file. - Release: 1.4.10 2006-11-03 Mikio Hirabayashi * estraier.c (est_doc_score): new function. * estraier.c (est_db_check_option): new function. * estraier.c (est_search_union): a bug related to scoring when ASIS mode was fixed. * estraier.c (est_db_score_doc): difference operator was added. * estcmd.c (procinform): display of known options was added. * estcmd.c (doputdoc): modification date of files became able to be recorded as score. * estseek.c (showresult): accuracy of "{hnum}" operator was improved. * estwaver.c (runinit, procinit): "-xs", "-xl", "-xh" options were added. - "set_score" and "score" methods were added to language bindings and node APIs. - Release: 1.4.9 2006-11-03 Mikio Hirabayashi * estfraud.c (realmain): handling path information was modified. * estseek.c (outputlog): "{hnum}" operator was added to the log format. - A bug related to optimization on Intel Mac series was escaped. - Release: 1.4.8 2006-10-20 Mikio Hirabayashi * estraier.c (est_db_open): "ESTDBHUGE2" and "ESTDBHUGE3" options were added. * estraier.c (est_db_repair): a bug related to the attribute database was added. * estraier.c (est_cond_distinct): new function. * estmaster.c (startup): "extdelay" attribute was added. * estfraud.c (realmain): "extdelay" attribute was added. * estfraud.c (sendnodecmdsearch): a bug related to attribute search was fixed. * estseek.c (main): a bug related to FastCGI was fixed. - Release: 1.4.7 2006-10-15 Mikio Hirabayashi * estraier.c (est_db_search_meta): a bug about the skip parameter was fixed. * estcmd.c (runmulti, procmulti): new functions. * estseek.c (showdoc): class name based on attribute name was added. * estseek.c (realmain): "helpfile" attribute was added. * estseek.c (shownaviform): new function. * estseek.c (realmain): "logformat" attribute was added. - A bug about URL encoding in the pure Ruby API was fixed. - Release: 1.4.6 2006-09-24 Mikio Hirabayashi * estraier.c (est_search_aidx_attr): case insensitive mode was added. * estraier.c (est_check_cjk_only): new function. * estraier.c (est_make_cattr_list): search speed with CJK characters was improved. * estraier.c (est_db_add_attr_index): altering attribute index was added. * estraier.c (est_db_attr_index_exprs): new function. * estraier.c (est_regex_match_str): new function. * estraier.c (est_str_make_snippet): new function. * estraier.c (est_db_merge): a bug related to discordance of the ID attribute was fixed. * estraier.c (est_db_merge): division of inverted files was added. * estseek.c (showformforweb): new function. * estseek.c (realmain, showdoc): "deftitle" and "attrwidth" attributes were added. * estseek.c (showtitle): new function. * wavermod.c (waver_init, waver_open): "urlrule" attribute was added. * estproxy.c: new file. - Release: 1.4.5 2006-09-20 Mikio Hirabayashi * estraier.c (est_db_pseudo_doc_num): new function. * estcmd.c (runregex, procregex): "-ci" option was added. * estseek.c (realmain): "formtype" and "candir" attributes were added. * estseek.c (showformforfile, showformformail): new functions. * estfraud.c (sendnodecmdputdoc, sendnodecmdoutdoc, sendnodecmdsync): new functions. - Release: 1.4.4 2006-09-14 Mikio Hirabayashi * estraier.c (est_regex_replace): replacement with "\1" through "\9" were added. * estcmd.c (runregex, procregex): new functions. * estbutler.c (runsearch, procsearch): "wildmax" parameter was added. * wavermod.c (make_doc_from_html): links of "object" and "embed" elements were added. * estfraud.c: new file. - Release: 1.4.3 2006-09-05 Mikio Hirabayashi * estraier.c (est_db_set_cache_size): parameters now support zero value. * estcmd.c (doputdoc): "-fx" option now supports "*". * estseek.c (realmain, showform): "perpage" attribute was added. * estmaster.c (sendmasterdata, sendmasterdataui): referer checking was modified. * wavermod.c (waver_init, fetch_document): "replace" attribute was added. * myconf.h: a wrong message about version requirement of QDBM was fixed. - Release: 1.4.2 2006-08-31 Mikio Hirabayashi * estraier.c (est_cond_set_options): "ESTCONDROUGH" and other options were added. * estraier.c (est_phrase_from_rough): new function. * estraier.c (est_phrase_from_union, est_phrase_from_isect): new functions. * estmaster.c (startup): "uiphraseform" attribute was added. * estcmd.c (runsearch, procsearch): "-sfr" options and so on were added. * estcmd.c (rungather, procgather): "-aa" option was added. * estseek.c (main, showpage): "genrecheck" and "phraseform" attributes were added. * estseek.c (showpage): accuracy of sequencial scan was improved. - Release: 1.4.1 2006-08-27 Mikio Hirabayashi * estraier.c (est_strstr_sparse): new function. * estraier.c (est_db_add_pseudo_index): new functions. * estraier.c (est_pidx_uri_to_id, est_db_score_doc): new functions. * estraier.c (est_db_get_doc, est_db_get_doc_attr): pseudo index was to be supported. * estraier.c (est_make_cattr_list, est_free_cattr_list): new functions. - Bugs of doc.keywords methods of language bindings was fixed. - Release: 1.4.0 2006-08-18 Mikio Hirabayashi * estbutler.c (procsearch): a bug about handling "max" and "skip" parameters was fixed. - Release: 1.3.9 2006-08-15 Mikio Hirabayashi * estraier.c (est_search_aidx_attr): speed of the "NUMBT" operator was improved. * estraier.c (est_aidx_attr_narrow): speed of the "NUMBT" operator was improved. * estmaster.c (searchlocal): a bug of attribute search was fixed. - Release: 1.3.8 2006-08-08 Mikio Hirabayashi * estraier.c (est_search_union): a bug of bus error on SPARC environment was fixed. * estmaster.c (startup): "helpershift" attribute was added. * estmaster.c (sendnodecmdinformhelper): new function. * estbutler.c (runinform, procinform): new functions. * estbutler.c (rungetdoc, procgetdoc): new functions. * estbutler.c (rungetdocattr, procgetdocattr): new functions. * estbutler.c (runetchdoc, procetchdoc): new functions. * estbutler.c (runuriid, procuriid): new functions. - Release: 1.3.7 2006-08-01 Mikio Hirabayashi * estraier.c (est_normalize_text): some symbol marks were to be normalized. * estmaster.c (sendnodecmdsearchhelper): blocking because of mutex was cleared. * estseek.c (realmain): a bug about attribute search was fixed. - building option to use Vista database instead of Villa was added. - Release: 1.3.6 2006-07-28 Mikio Hirabayashi * estraier.c (est_normalize_text): symbol marks were to be normalized. * estmaster.c (sendnodecmdsearchhelper): new function. * estmastersearch.c: new file. * estseek.c (realmain): type of "scancheck" attribute was changed to integer. - Release: 1.3.5 2006-07-18 Mikio Hirabayashi * estraier.c (est_db_open): a parameter of B+ tree was modified for space efficiency. * estraier.c (est_db_open): "ESTDBSMALL" option was added. * mymorph.c (est_mecab_analyze): accuracy of extracting complex words was improved. - Release: 1.3.4 2006-07-13 Mikio Hirabayashi * estraier.c (est_db_search): a bug about union of natural scores was fixed. * estraier.c (est_cond_set_mask, est_cond_mask): new functions. * estnode.c (est_node_admins, est_node_users, est_node_links): new functions. * estmaster.c (getnodeoptions): new function. * estmaster.c (syncnodes): a trying lock was replaced by a usual lock. * estmaster.c (communicate): a CSRF vulnerability was cleared. * estmaster.c (sendnodecmdsearchui, sendnodecmdsearchui): masks was added. * estcall.c (runsearch, procsearch): "-mask" option was added. - Release: 1.3.3 2006-07-07 Mikio Hirabayashi * estraier.c (est_db_repair): new function. * estnode.c (est_node_sync, est_node_optimize): new functions. * estmaster.c (sendnodecmdsync, sendnodecmdoptimize): new functions. * estmaster.c (refreshnode, flushnode, syncnodes): mutex was to be shared. * estcmd.c (runrepair, procrepair): new functions. * estcall.c (procsync, procoptimize): new functions. * mymorph.c (est_mecab_analyze): accuracy of extracting complex words was improved. - Release: 1.3.2 2006-06-30 Mikio Hirabayashi * estraier.c (est_db_search_meta): new function. * estseek.c (realmain): a bug about the file separator was fixed. * estmttest.c (runregression, procregression): new functions. - Release: 1.3.1 2006-06-25 Mikio Hirabayashi * estraier.c (est_db_open): "ESTDBSCVOID" option and so on were added. * estraier.c (est_db_open): database format was modified. * estraier.c (est_inodes_delete_informer): new function. * estraier.c (est_doc_set_score): new function. * estraier.c (est_narrow_scores): sorting operators for ID numbers and scores were added. * estraier.c (est_db_merge): new function. * estcmd.c (runcreate, proccreate): "-sv" option and so on were added. * estcmd.c (rungather, procgather): "-ss" option was added. * estcmd.c (runmerge, procmerge): new functions. - Release: 1.3.0 2006-06-03 Mikio Hirabayashi * estraier.c (est_db_set_informer): arguments of the callback were increased. * estraier.c (est_db_flush): frequency of disk access was reduced. * estmaster.c (sendnodecmdsearch): hints for "TIME#n" were added. - The Java binding and the Ruby binding were to support callback for database events. - Perl binding using XS (not SWIG) was added. - Release: 1.2.9 2006-05-20 Mikio Hirabayashi * estraier.c (est_db_open): databases were tuned for QDBM 1.8.58 or later. * estraier.c (est_db_close): the order of flushing was optimized for no-lock mode. * estraier.c (est_idx_memsync): new function. * estcmd.c (runsearch, procsearch): no-lock mode and non-blocking mode were added. * estseek.c (realmain): "lockdb" attribute was added. * wavermod.c (waver_current_node_load): new function. - Release: 1.2.8 2006-05-16 Mikio Hirabayashi * estraier.c (est_proc_env_reset): new function. * estraier.c (est_db_flush): a flag to be under flushing was added. * estraier.c (est_db_open): databases were tuned to curb ballooning. * estnode.c (est_node_cache_usage): new function. * estnode.c (est_noderes_mdate): new function. * estmaster.c (startup): "bindaddr" attribute was added. * estmaster.c (sendnodecmdcacheusage): new function. * estmaster.c (sendnodecmdsearch): a bug of race condition was fixed. * estmaster.c (die): dying messages was to be written into the log file. * estcmd.c (runsearch, procsearch): "-aux" option was added. * estcall.c (procsearch): a bug about "-max" option was fixed. * estcall.c (runsearch, procsearch): "-aux" option was added. * wavermod.c (waver_init, waver_open): "seedkeynum" and "savekeynum" attributes were added. * wavermod.c (waver_set_current_node, waver_node_put_doc): new functions. * estwaver.c (geturldoc): saving files and postprocessor calling were added. - The Java binding and the Ruby binding were to support setting auxiliary permission. - Release: 1.2.7 2006-05-10 Mikio Hirabayashi * estraier.c (est_cond_set_eclipse): option constants were added. * estraier.c (est_url_sameness): new function. * estcmd.c (rungather, procgather, runextkeys, procextkeys): "-ncm" option was added. * estcmd.c (runextkeys, proxectkeys): "-ws" option was added. * estseek.c (showform): options to clip documents by URL were added. * estseek.c (main, showform): "perpage" attribute was deleted. * estwaver.c (seedurldocs): new function. * estwaver.c (geturldoc): checking mass visit was added. * wavermod.c (waver_open, waver_close): trace database was changed from Villa to Curia. * estmaster.c (startup, communicate): "recvmax" attribute was added. - The Java binding and the Ruby binding were to support wild card configuration. - Release: 1.2.6 2006-05-01 Mikio Hirabayashi * estmaster.c (sendnodecmdsearchui): robot exclusion control was added. * estwaver.c (runcrawl, proccrawl): "-revcont" option was added. * estwaver.c (enqueuelinks): "strategy" option was added. * estwaver.c (enqueuelinks): similarity was to be inherited. * wavermod.c (queue_slim): new function. * estraier.c (est_db_put_doc): an option to use "@weight" attribute was added. * estcmd.c (runput, procput, rungather, procgather): "-ws" option was added. - Release: 1.2.5 2006-04-25 Mikio Hirabayashi * estnode.c (est_get_host_addr): a bug about race confition of threads was fixed. * wavermod.c (fetch_document): a bug about checking "content-type" header was fixed. * wavermod.c (make_doc_from_html): "frame" and "link" elements were to be followed. * wavermod.c (make_doc_from_draft, make_doc_from_mime, make_doc_with_xcmd): new functions. * wavermod.c (waver_open): "allowrx" and "denyrx" were to be able to be more than once. * estwaver.c (runcrawl, proccrawl): "-restart" and "-revisit" options were added. * estcmd.c (doputdoc): "_lpath", "_lreal", and "_lfile" were not to be overwritten. * estwolefind (outputlist): WWWOFFLE 2.9a was to be supported. - Release: 1.2.4 2006-04-20 Mikio Hirabayashi * estraier.c (est_db_edit_doc): a bug of ID assignment was fixed. * estraier.c (est_db_get_doc_attr): attribute indexes were to be used. * estraier.c (est_regex_new): case insensitive mode was added. * estnode.c (est_url_shuttle): a bug when "resbody" was null was fixed. * estwaver.c: new file. * wavermod.c: new file. * Makefile.in: a bug about compilation on Mac OS X was fixed. - Release: 1.2.3 2006-04-15 Mikio Hirabayashi * estraier.c (est_check_strand, est_check_stror): checking rules were changed. * estraier.c (est_search_union): a bug about memory allocation with regex was fixed. * estraier.c (est_check_stroreq): new function. * estmaster.c (startup): "attrindex" attribute was added. * mastermod.c (log_rotate): new function. * estcmd.c (runcreate, runput, rungather): "-tr" option was added. - Release: 1.2.2 2006-04-10 Mikio Hirabayashi * estraier.c (est_db_put_doc): dispensable trailer was purged from record. * estraier.c (est_db_add_attr_index): new function. * estraier.c (est_aidx_seq_put, est_aidx_seq_out, est_aidx_seq_narrow): new functions. * estraier.c (est_aidx_attr_put, est_aidx_attr_out, est_aidx_attr_narrow): new functions. * estnode.c (est_url_shuttle): "limsize" parameter was added. * mastermod.c (nmgr_clear): new function. * estcmd.c (runcreate, proccreate): new functions. - The Java binding and the Ruby binding were to support attribute indexes. - The Java binding and the Ruby binding were to support feedback of scores. - Release: 1.2.1 2006-03-12 Mikio Hirabayashi * estraier.c (est_weight_keywords): weighting algorithm was enhanced. * estraier.c (est_db_set_wildmax): new function. * estraier.c (est_narrow_scores): disjunction of attribute conditions was added. * estraier.c (est_doc_dup, est_cond_dup): new functions. * estcmd.c (rungather, doputfile): default value of "-lf" options was changed. * estseek.c (realmain): "wildmax" parameter was added. * estmaster.c (main): "wildmax" parameter was added. - A bug about the skip parameter in the pure Java API was fixed. - The Java binding and the Ruby binding were to support similarity eclipse. - Release: 1.1.6 2006-03-08 Mikio Hirabayashi * estraier.c (est_weight_keywords): new function. * estraier.c (est_doc_slim): new function. * estcmd.c (rungather, doputfile): "-lt" and "-lf" options were added. * estmaster.c (startup, sendnodecmdputdoc): "limittextsize" attribute was added. - Release: 1.1.5 2006-03-03 Mikio Hirabayashi * estraier.c (est_cond_set_skip, est_cond_skip): new functions. * estraier.c (est_memory_usage): new function. * estraier.c (est_deflate, est_inflate): "mode" parameter was added. * estnode.c (est_node_set_skip): removed. * estcmd.c (doputdoc, procextkeys): finishing was to occur when the RAM runs out. * estmaster.c (communicate, sendnodecmdsearchui): gzip encoding was added. * estcall.c (runsearch, procsearch): "-vu" option was added. - Java API was to support deflated transfer. - Release: 1.1.4 2006-01-01 Mikio Hirabayashi * estraier.c (est_db_open): tuning parameters of perfect N-gram mode were modified. * estraier.c (est_db_open): compression with LZO and BZIP2 was added. * estraier.c (est_set_vnumbuf, est_read_vnumbuf): new functions. * estmaster.c (dispatch): preemption during synchronization was implemented. * estmaster.c (sendmasterdata): "backup" was added. * estmaster.c (backupdb): new function. * estmaster.c (searchlocal, searchremote): minimum number to retrieve was to be set. * estmaster.c (sendnodecmdsearch): "skip" parameter was added. * estcmd.c (runwords, procwords): "-kt" option was added. * estcall.c (runsearch, procsearch): "-sk" option was added. * estcmd.c (runsearch, procsezrch): "-sn" option was added. * mymorth.c (est_mecab_analyze): MeCab 0.90 was supported. - Release: 1.1.3 2005-12-15 Mikio Hirabayashi * estraier.c (est_db_open): "ESTDBHUGE" was added. * estraier.c (est_regex_replace): "&" was to be handled. * estraier.c (est_cond_set_expander): new function. * estcmd.c (runput, rungather): "-lg" was renamed to "-xl", and "-xh" was added. * estseek.c (showdoc): a bug about calculating similarity was fixed. * estseek.c (realmain): "qxpndcmd" was added. * estseek.c (expandquery): new function. * estmaster.c (realmain, startup): "-ro" option was added. * estmaster.c (sendnodecmdsearchui): the output format modified for OpenSearch 1.1. - Release: 1.1.2 2005-12-04 Mikio Hirabayashi * estraier.c (est_keyword_num, est_keyword_rec_size): new functions. * estraier.c (est_keyword_iter_init, est_keyword_iter_next): new functions. * estraier.c (est_search_union): scoring was to use standard deviation. * estraier.c (est_expand_keyword_bw, est_expand_keyword_ew): new functions. * estraier.c (est_db_open): "ESTDBLARGE" was added. * estseek.c (realmain, setsimilarphrase): "smlrtune" was added. * estseek.c (realmain, showpage): "relkeynum" was added. * estmaster.c (startup, setsimilarphrase): "uismlrtune" was added. * estmaster.c (sendnodecmdsearchatom, nodecmdopensearch): conformed to draft 2. - Release: 1.1.1 2005-11-22 Mikio Hirabayashi * estraier.h: "ESTCONDETCH" was abolished. * estraier.c (est_db_open): a bug about not to check old format was fixed. * estraier.c (est_db_etch_doc): algorithm of TF-IDF tuning was modified. * estraier.c (est_canonicalize_text): accentuated characters were to be canonicalized. * estraier.c (est_doc_new_from_draft, est_doc_dump_draft): keywords was to be handled. * estraier.c (est_db_put_doc): keywords was to be stored. * estraier.c (est_db_out_doc, est_db_flush): keywords was to be cleaned. * estraier.c (est_db_inode): new function. * estraier.c (est_search_keywords): new function. * estraier.c (est_cond_set_auxiliary, est_cond_auxiliary): new functions. * estraier.c (est_inode, est_inodes_delete): new functions. * estraier.c (est_search_similar): accuracy was improved. * mymorph.c: new file. * estnode.c (est_resdoc_vector): renamed as "est_resdoc_keywords". * estnode.c (est_url_shuttle_impl): memory allocation was to be more effective. * estcmd.c (procsearch, procextkeys): morphological analyzer support was added. * estcmd.c (rungather, procgather): "-kn" and "-um" was added. * estcmd.c (procgather): path of each directory was to be canonicalized. - Some bugs of the pure Java API and the pure Ruby API were fixed. - Release: 1.1.0 2005-11-11 Mikio Hirabayashi * estraier.c (est_eclipse_scores): accuracy was improved. * estraier.c (est_narrow_scores): a bug of segmentation fault was fixed. * estraier.c (est_regex_new, est_regex_delete, est_regex_match): new functions. * estraier.c (est_expand_word_rx): new function. * estreier.c (est_db_put_keywords, est_db_get_keywords): new functions. * estraier.c (est_db_measure_doc): new function. * estraier.c (est_db_set_vectorizer): abolished. * estcmd.c (runextkeys, procextkeys): "-no" was added. * estcmd.c (runpurge, procpurge, runextkeys, procextkeys): "-attr" was added. * estcmd.c (rundraft, procdraft): "-kn" was added. * estcmd.c (procgather): a bug of handling drive characters on Windows was fixed. * estseek.c (realmain, makeshownuri): "lprefix" and so on were abolished. * estmaster.c (startup, makeshownuri): "uilprefix" and so on were abolished. * estmaster.c (startup, sendnodecmdputdoc): "lateextkeys" was added. * estmaster.c (searchlocal): a bug of segmentation fault was fixed. - Release: 1.0.6 2005-11-08 Mikio Hirabayashi * estraier.c (est_narrow_scores): speed of attribute search was improved. * estcmd.c (doputdoc, procpurge, procextkeys): local paths was to be printed. * estcmd.c (doputdoc): "@size" was to be added even with "-fo" option. * estcmd.c (procsearch): "_lfile" was to be printed when human readable mode. * estcmd.c (procout, procedit, procget, procuriid): retrieving by local path was added. * estcmd.c (procpurge): retrieving by local path was added. * estcmd.c (runiconv, prociconv): new functions. * estcmd.c (procedit): "-pc" was to convert the encoding of the attribute value. * estseek.c (realmain, showform): "clipview" attribute was added. - Release: 1.0.5 2005-11-02 Mikio Hirabayashi * estraier.c (est_vector_cosine): new function. * estraier.c (est_eclipse_scores): new function. * estcmd.c (runsearch, procsearch): "-ec" option was added. * estcmd.c (procgather, procpurge): "-no" option was added. * estcmd.c (urltopath): a bug about drive letter was fixed. * estcmd.c (runlist, proclist): "-lp" option was added. * estseek.cgi (showresult): similar eclipse was implemented. * estmaster.c (startup, searchlocal): "rateuri" attribute was added. * estmaster.c (sendmenudata): new function. - Release: 1.0.4 2005-11-01 Mikio Hirabayashi * estraier.c (est_doc_set_id): new function. * estraier.c (est_db_search): "[ID]" and "[URI]" was added. * estraier.c (est_check_strand, est_check_stror): new functions. * estnode.c (est_node_iter_init, est_node_iter_next): new functions. * estcmd.c (runlist, proclist): new functions. * estnode.c (est_node_set_snippet_width): new function. * estnode.c (est_noderes_eclipse, est_resdoc_vector): new functions. * estnode.c (est_parse_search_body): "%VECTOR" was to be handled. * estmaster.c (node_etch_doc): new function. * estmaster.c (sendnodecmdsearch): width of snippets was to be able to be changed. * estcall.c (runsearch, procsearch): "-kw" and "-ec" options was added. - Release: 1.0.3 2005-10-28 Mikio Hirabayashi * estraier.c (est_db_etch_doc): disadvantage bias of hiragana was added. * estraier.c (est_db_interrupt): new function. * estraier.c (est_db_flush): interruption was implemented. * estraier.c (est_db_put_doc): "@digest" was to be added. * estraier.c (est_db_iter_init): "upper" parameter was added. * estnode.c (est_url_shuttle_impl): deflate encoding was added. * estcmd.c (iswinbadname): new function. * estcmd.c (est_doc_new_form_html): "lang" of "html" was to be handled. * estmaster.c (sendnodecmdgetdoc, sendnodecmdsearch): deflate encoding was added. * estmaster.c (startup, sendnodecmdsearch): "searchmax" attribute was added. * estmaster.c (estnodecmdlist): new function. * estmaster.c: wait time for flushing was changed. * estmaster.c: "@scoreweight" was deleted. * estraier.h: "@weight" and "@adate" was added. - Release: 1.0.2 2005-10-20 Mikio Hirabayashi * estraier.c (est_idx_size_current): new function. * estraier.c (est_db_flush): criterion of adding a new database was changed. * estraier.c (est_db_list_rescc): new function. * estraier.c (est_db_used_cache_size): bumped up to the private API. * estraier.c (est_db_flush): algorithm of cleaning dispensable keys was changed. * estraier.c (est_idx_put_one, est_idx_get_one): new functions. * estcmd.c (procdraft): "@uri" and "@mdate" was to be added. * estcmd.c (est_doc_new_with_xcmd): arguments in the command line were to be escaped. * estmaster.c (sendmasteruidata): the label was to be able to be changed. * estmaster.c (sendnodecmdsearchui): deflate encoding was added. * estmaster.c (searchremote): a bug of redundant score weighting was fixed. - Release: 1.0.1 2005-10-15 Mikio Hirabayashi * estraier.c (est_db_refresh, est_db_charge): new functions. * estcmd.c (runsearch, procsearch): "-sk" option was added. * estcmd.c (est_doc_new_from_html): parsing "script" tag and "style" tag was improved. * estmaster.c (sendnodecmdsearchrss, catdocdatarss): new functions. * estmaster.c (sendnodecmdsearchui, sendnodecmdsearchatom): navigation links were added. * estmaster.c (sendfavicondata): new function. * myimage.dat: new file. - estmaster was to support RSS 1.0. - estmaster was to support virtual URL of reverse proxy. - Release: 1.0.0 2005-10-08 Mikio Hirabayashi * estraier.c (est_set_cache_size): "rnum" parameter was added. * estraier.c (est_rescc_get, est_rescc_put): new functions. * estraier.c (est_db_edit_doc): the URI attribute was to be modifiable. * estraier.c (est_db_set_doc_entity, est_db_get_doc_entity): new functions. * estmaster.c (sendoptions): new function. * estmaster.c (sendnodecmdopensearch): a bug of violation of the standard was fixed. * estmaster.c (startup): some attributes for cache were added. * estmaster.c (svmain, sendstatus, svdispatch): new functions. * estcmd.c (doputdoc): st_ctime of each file was not to be recorded. * estseek.c (realmain): hacking attribute "scan" was added. - The node master as a windows service is now supported. - Release: 0.9.2 2005-09-25 Mikio Hirabayashi * estmaster.c (sendnodedata): URLs of "masterui" and "searchui" were changed. * estmaster.c (sendnodecmdsearchatom, catdocdataatom): new functions. * estmaster.c (log_print): a bug of segmantation fault on AMD64 was fixed. - estmaster was to support Atom 1.0 and OpenSearch 1.1. - Manual files for nroff were added. - Release: 0.9.1 2005-09-10 Mikio Hirabayashi * estraier.c (est_db_word_iter_init, est_db_word_iter_next): new functions. * estnode.c (est_node_etch_doc): new function. * estcmd.c (runwords, procwords): new functions. * estmaster.c (startup): whether to open the log file was to be checked. * estmaster.c (startup, searchlocal, searchremote): "mergemethod" attribute was added. * estmaster.c (startup): "smlrvnum" attribute was added. * estmaster.c (startup): "_dfdb" file was to be read. * estmaster.c (sendnodecmdetchdoc): new function. * estmaster.c (searchlocal, searchremote): "@scoreweight" attribute was to be handled. * estmaster.c (sendnodecmdsearchui): similarity search was to be supported. * estcall.c (runetch, procetch): new functions. - The pure Java API and the pure Ruby API were to support "est_node_etch_doc". - Release: 0.9.0 2005-09-08 Mikio Hirabayashi * estraier.c (est_db_scan_doc): new function instead of "est_doc_scan". * estraier.c (est_deflate, est_inflate): Compressing options was changed. * estraier.c: a tuning parameter of B+ tree was changed. * estcmd.c (est_doc_new_from_mime): gzipped or deflated content was supported. * estcmd.c (rungather, procgather): "-bc" option was added. * estcmd.c (runsearch, procsearch): "-kn" option was added. * estmaster.c (startup, searchlocal): "scancheck" attribute was added. - estwolefind was to support cache files of FTP. - estraiernative.jar was renamed as estraier.jar. - Release: 0.5.7 2005-08-31 Mikio Hirabayashi * estcmd.c (rungather, procgather): "-rm" option was added. * Database.java (err_msg): changed as an instance method. - Ruby binding as an extention library was added. - estcallpure.rb was renamed as estcall.rb. - Release: 0.5.6 2005-08-26 Mikio Hirabayashi * Makefile.in: a bug about compilation on Mac OS X was fixed. - Release: 0.5.5.1 2005-08-16 Mikio Hirabayashi * estraier.h: "ESTCONDAGIT" was changed to "ESTCONDAGITO". * estraier.c (est_db_edit_doc): bumped up to the public API. * estnode.c (est_url_shuttle_impl): a bug of memory leak was fixed. * estcmd.c (runedit, procedit): new functions. * estmaster.c (startup, dispatch): "idleflush" and "idlesync" attributes were added. * estmaster.c (startup): "logfile" attribute was added. * estmaster.c (sendmasterdata, sendmasteruidata): an action of synchronus was added. * estmaster.c (sendnodecmdeditdoc): new function. * estmaster.c (startup): databases were to be checked before being opened. - Java binding using JNI was added. - Packaging of the pure Java interface was changed. - Packaging of the pure Ruby interface was changed. - The Windows package was to be include files for Java and Ruby. - Release: 0.5.5 2005-08-04 Mikio Hirabayashi * estraier.h: "ESTCONDUSU" was changed to "ESTCONDUSUAL". * estraier.c (est_search_union): a bug about query expansion was fixed. * estraier.c (est_search_union): wild cards were supported. * estraier.c (est_doc_scan): new function. * estraier.c (est_enc_name): accuracy of detection was improved. * estraier.c (est_hints_to_words, est_expand_word_ew, est_signal): new functions. * estmaster.c (sendnodecmdsearchui): numbers of documents and words were to be shown. * estmaster.c (makeshownuri): behavior of replacement was changed. * estmaster.c (syncnodes): new function. * mastermod.c (esmap_list): sorting by attributes was featured. * estcmd.c (pathtourl): a bug about drive letter on Windows was fixed. * estcmd.c (rungather, procgather): "-pf" option was abolished. * estcmd.c (runsearch, procsearch): "-cd" option was added. * estseek.c (main, showdoc): "showlreal" attribute was featured. * estseek.c (makeshownuri): behavior of replacement was changed. * estwolefind: "_lpath" was to be specified. - Release: 0.5.4 2005-07-28 Mikio Hirabayashi * estraier.c (est_canonicalize_text): a bug about special characters was fixed. * estraier.c (est_idx_size): a bug about overflow was fixed. * estraier.c (est_db_inform): the number of dispensable keys was to be reported. * estnode.c (est_init_net_env, est_free_net_env): made be MT-safe. * estwolefind: new file. * estcmd.c (estrungather, doputdoc): attribute definition with TSV was featured. - A class library of the node API for Ruby was added. - The Java API was modified based on the factory method pattern. - Some example programs were added. - Release: 0.5.3 2005-07-25 Mikio Hirabayashi - A class library of the node API for Java was added. * estmaster.c (sendnodecmdsearchui): a bug about sorting order was fixed. * estnode.c (est_node_search): simplified phrase was supported. - Release: 0.5.2 2005-07-20 Mikio Hirabayashi * estmaster.c (startup): "cachesize" attribute was supported. * estmaster.c (communicate): a problem on Mac OS X was solved. * estmaster.c (sendmasteruidata): editing admins, users, and links was featured. * estmaster.c (sendnodecmdsearchui, catdocdataui, makeshownuri): new functions. * mastermod.c (be_daemon): exit code was changed. * estnode.c (est_free_net_env): new function. - Release: 0.5.1 2005-07-16 Mikio Hirabayashi * estmaster.c, mastermod.h, mastermod.c, md5.h, md5.c: new files. * estcmd.c (runget, procget, runout, procout): specifying with URI was supported. * estcmd.c (est_doc_new_with_xcmd): the original path was to be given via environ. * estcmd.c (est_doc_new_with_xcmd): a mode without copying original file was added. * estcmd.c (est_doc_new_from_mime): sub parts of MIME was to be handled recursively. * estcmd.c (runextkeys, procextkeys): "-ni" option was added. * estraier.c (est_db_get_doc_attr): new function. * estresult.dtd: result of estcall was supported. * estraier.idl: new file. - Release: 0.5.0 2005-06-09 Mikio Hirabayashi * estraier.c (est_cond_score): new function. * estcmd.c (procsearch): scores were to be able to be shown. * estseek.c (showdoc): scores were to be able to be shown. * estraier.c (est_random_fclose): new function. * estraier.c (est_fill_key_cache): new function. * estraier.c (est_db_set_special_cache): new function. * estcmd.c (est_doc_new_with_xcmd): original size of a document was to be recorded. * estcmd.c (est_ext_type): new function. - Speed of indexing on Windows was improved due to enhancement of QDBM. - Release: 0.3.13 2005-06-07 Mikio Hirabayashi * estraier.c (est_narrow_scores): new function. * estcmd.c (pathtourl): a problem againt Shift_JIS was resolved. * estcmd.c (urltofile): new function. * estseek.c (showdoc): the local file name of a document was to be able to be shown. * hyperestraier.pc.in: new file. - Release: 0.3.12 2005-05-25 Mikio Hirabayashi * estraier.c (est_search_union): forward matching extension was abolished. * estraier.c (est_break_text_perfng, est_char_category_perfng): new functions. * estload.c: new file. * estseek.c (main, realmain): FastCGI was supported. * estcmd.c (runsearch): number of documents searched for by default was changed. * Makefile.in: HP-UX and others were supported. - Release: 0.3.11 2005-05-20 Mikio Hirabayashi * estraier.c (est_db_add_meta, est_db_meta_names, est_db_meta): new functions. * estraier.c (est_make_crypt, est_match_crypt): new functions. * estraier.c (est_search_union): forward matching extension was featured. * estseek.c (main, showform): specifying attributes with select boxes was featured. * estseek.c (main, showresult): incremental search was featured. - Release: 0.3.10 2005-05-10 Mikio Hirabayashi * estmtdb.h, estmtdb.c: new files. * estraier.c (est_enc_name): English, Chinese, and Korean were supported. * estraier.c (est_break_text): normalization was to be able to be omitted. * estraier.c (est_db_open): non-blocking lock was featured. - some functions of Cabin were replaced by macros. - Pthreads for Win32 was added to the binary package for Windows. - Release: 0.3.9 2005-05-05 Mikio Hirabayashi * estcmd.c (runsearch, procsearch): to display XML was featured. * estcmd.c (runsearch, procsearch): similarity search with a seed document was featured. * estseek.c (main, showresult): to display detail was featured. * estseek.c (outputlog): new function. * estseek.c (main, makeshowuri): "gsuffix" attribute was added. - xdoc2txt was added to the binary package for Windows. - Release: 0.3.8 2005-05-01 Mikio Hirabayashi * estraier.c (est_db_etch_doc): new function. * estraier.c (est_phrase_vector, est_get_tvmap, est_vec_cos): new functions. * estcmd.c (runextkeys, procextkeys): new functions. * estseek.c (vectorizer, setsimilarphrase): new functions. * estseek.c (makeshownuri): arbitrary replacement was featured. - Release: 0.3.7 2005-04-28 Mikio Hirabayashi * estcmd.c (est_doc_new_from_html): all meta information was to be recorded as attributes. * estcmd.c (est_doc_new_from_mime): title and author of MHTML was to be handled. * estcmd.c (doput): "stat" was to be used instead of "lstat". * estcmd.c (est_doc_new_with_xcmd): new function. - Release: 0.3.6 2005-04-25 Mikio Hirabayashi * estraier.c (est_db_out_doc, est_db_flush): partial optimization was featured. * estraier.c (est_uconv_in, est_uconv_out): new functions. * estcmd.c (runout, rungather, runpurge): the option "-cl" was featured. * estcmd.c (est_doc_new_from_html): times of calling est_html_raw_text was reduced. - Release: 0.3.5 2005-04-22 Mikio Hirabayashi * estraier.c (est_snippet_add_text, est_str_fwmatch_wide): multibyte support was enhanced. * estraier.c (est_search_union, est_search_uvset): hints of negative words were changed. * estraier.c (est_search_union): search accuracy with latin alphabet was improved. * estraier.c (est_snippet_add_text): highlight counting was dropped. * estraier.c (est_doc_scan_words): new function. * estseek.c (showresult): negative words were to be ignored. * estseek.c (showresult): a warning mark to be optimize was featured. * estseek.c (main): encoding conversion of the parameters was featured. * estseek.c (makeshownuri): new function. * estcmd.c (procpurge, doputdoc): handling the "_lpath" attribute was featured. - Release: 0.3.4 2005-04-20 Mikio Hirabayashi * myconf.h: new file. * estraier.c (est_db_sync): to write meta data. * estraier.c (est_db_flush): new function. * estraier.h: export declaration for C++ was added. * Makefile.in: MinGW support was added. - Release: 0.3.3 2005-04-18 Mikio Hirabayashi * estraier.c (est_db_optimize): a parameter "options" was added. * estraier.c (est_db_sync): a parameter "options" was added. * Makefile.in: Mac OS X support was added. - An API references in English and Japanese were written. - Release: 0.3.2 2005-04-16 Mikio Hirabayashi - The initial version. - Release: 0.3.1 hyperestraier-1.4.13/Makefile.in000066400000000000000000000762641125261632700165570ustar00rootroot00000000000000# Makefile for Hyper Estraier #================================================================ # Setting Variables #================================================================ # Generic settings SHELL = @SHELL@ # Packaging PACKAGE = @PACKAGE_NAME@ VERSION = @PACKAGE_VERSION@ PACKAGEDIR = $(PACKAGE)-$(VERSION) PACKAGETGZ = $(PACKAGE)-$(VERSION).tar.gz LIBVER = @LIBVER@ LIBREV = @LIBREV@ PROTVER = @PROTVER@ # Targets MYHEADS = estraier.h estmtdb.h estnode.h MYLIBOBJS = estraier.o estmtdb.o estnode.o md5.o MYLIBS = libestraier.a libestraier.so.$(LIBVER).$(LIBREV).0 \ libestraier.so.$(LIBVER) libestraier.so MYBINS = estcmd estmttest estmaster estbutler estcall estwaver estload MYCGIS = estseek.cgi estfraud.cgi estproxy.cgi estscout.cgi estsupt.cgi MYSCRIPTS = estconfig estwolefind MYCONFS = estseek.conf estseek.tmpl estseek.top estseek.help \ estfraud.conf estproxy.conf estscout.conf estsupt.conf \ estresult.dtd estraier.idl locale filter increm MYDOCS = COPYING ChangeLog THANKS doc MYMAN1S = estconfig.1 estcmd.1 estmaster.1 estwaver.1 estcall.1 MYMAN3S = estraier.3 estnode.3 MYPCS = hyperestraier.pc MYMACLIBS = libestraier.a libestraier.$(LIBVER).$(LIBREV).0.dylib \ libestraier.$(LIBVER).dylib libestraier.dylib MYHPUXLIBS = libestraier.a libestraier.sl MYWINLIBS = libestraier.a libestraier.dll.a MYCORELIBS = libestcore.a MYFCGIS = estseek.fcgi estfraud.fcgi estproxy.fcgi estscout.fcgi estsupt.fcgi # Install destinations prefix = @prefix@ exec_prefix = @exec_prefix@ MYHEADDIR = @includedir@ MYLIBDIR = @libdir@ MYBINDIR = @bindir@ MYLIBEXECDIR = @libexecdir@ MYDATADIR = @datadir@/$(PACKAGE) MYMAN1DIR = @mandir@/man1 MYMAN3DIR = @mandir@/man3 MYPCDIR = @libdir@/pkgconfig DESTDIR = # Building binaries CC = @CC@ CPPFLAGS = @CPPFLAGS@ -I. -I$(MYHEADDIR) \ -I$(HOME)/include -I/usr/local/include -I/usr/include/qdbm @MYCPPOPTS@ \ -D_XOPEN_SOURCE_EXTENDED=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__=1 -D_HPUX_SOURCE=1 \ -DPIC=1 -D_THREAD_SAFE=1 -D_REENTRANT=1 @MYDEFS@ CFLAGS = @MYCFLAGS@ LDFLAGS = @LDFLAGS@ -L. -L$(MYLIBDIR) -L$(HOME)/lib -L/usr/local/lib @MYLDOPTS@ LIBS = @LIBS@ MTLIBS = @MYMTLIBS@ SKLIBS = @MYSKLIBS@ APPLIBS = @MYAPPLIBS@ LDENV = LD_RUN_PATH=/lib:/usr/lib:$(MYLIBDIR):$(HOME)/lib:/usr/local/lib:@MYRUNPATH@:. RUNENV = LD_LIBRARY_PATH=.:/lib:/usr/lib:$(MYLIBDIR):$(HOME)/lib:/usr/local/lib:@MYRUNPATH@ MYPOSTCMD = @MYPOSTCMD@ #================================================================ # Suffix rules #================================================================ .SUFFIXES : .SUFFIXES : .c .o .c.o : $(CC) -c $(CPPFLAGS) $(CFLAGS) $< #================================================================ # Actions #================================================================ all : $(MYLIBS) $(MYBINS) $(MYCGIS) @$(MYPOSTCMD) @printf '\n' @printf '#================================================================\n' @printf '# Ready to install.\n' @printf '#================================================================\n' clean : rm -rf $(MYLIBS) $(MYBINS) $(MYCGIS) $(MYCORELIBS) $(MYFCGIS) \ *.exe *.o a.out *.dll.a *.dll *.dylib *.sl \ check.out gmon.out leak.log casket casket-* *~ version : vernum=`expr $(LIBVER)00 + $(LIBREV)` ; \ sed -e 's/_EST_VERSION.*/_EST_VERSION "$(VERSION)"/' \ -e "s/_EST_LIBVER.*/_EST_LIBVER $$vernum/" \ -e 's/_EST_PROTVER.*/_EST_PROTVER "$(PROTVER)"/' estraier.h > estraier.h~ [ -f estraier.h~ ] && mv -f estraier.h~ estraier.h install : mkdir -p $(DESTDIR)$(MYHEADDIR) cp -Rf $(MYHEADS) $(DESTDIR)$(MYHEADDIR) mkdir -p $(DESTDIR)$(MYLIBDIR) cp -Rf $(MYLIBS) $(DESTDIR)$(MYLIBDIR) mkdir -p $(DESTDIR)$(MYBINDIR) cp -Rf $(MYBINS) $(MYSCRIPTS) $(DESTDIR)$(MYBINDIR) mkdir -p $(DESTDIR)$(MYLIBEXECDIR) cp -Rf $(MYCGIS) $(DESTDIR)$(MYLIBEXECDIR) mkdir -p $(DESTDIR)$(MYDATADIR) cp -Rf $(MYCONFS) $(MYDOCS) $(DESTDIR)$(MYDATADIR) mkdir -p $(DESTDIR)$(MYMAN1DIR) cd man && cp -Rf $(MYMAN1S) $(DESTDIR)$(MYMAN1DIR) mkdir -p $(DESTDIR)$(MYMAN3DIR) cd man && cp -Rf $(MYMAN3S) $(DESTDIR)$(MYMAN3DIR) mkdir -p $(DESTDIR)$(MYPCDIR) cp -Rf $(MYPCS) $(DESTDIR)$(MYPCDIR) @printf '\n' @printf '#================================================================\n' @printf '# Thanks for using Hyper Estraier.\n' @printf '#================================================================\n' install-strip : make DESTDIR=$(DESTDIR) install cd $(DESTDIR)$(MYBINDIR) && strip $(MYBINS) cd $(DESTDIR)$(MYLIBEXECDIR) && strip $(MYCGIS) uninstall : cd $(DESTDIR)$(MYHEADDIR) && rm -f $(MYHEADS) cd $(DESTDIR)$(MYLIBDIR) && rm -f $(MYLIBS) cd $(DESTDIR)$(MYBINDIR) && rm -f $(MYBINS) $(MYSCRIPTS) cd $(DESTDIR)$(MYMAN1DIR) && rm -f $(MYMAN1S) cd $(DESTDIR)$(MYMAN3DIR) && rm -f $(MYMAN3S) cd $(DESTDIR)$(MYLIBEXECDIR) && rm -f $(MYCGIS) rm -rf $(DESTDIR)$(MYDATADIR) cd $(DESTDIR)$(MYPCDIR) && rm -f $(MYPCS) dist : make version make distclean ( cd javanative && ./configure && make dist ) ( cd javapure && ./configure && make dist ) ( cd rubynative && ./configure && make dist ) ( cd rubypure && ./configure && make dist ) ( cd perlnative && ./configure && make dist ) cd .. && tar cvf - $(PACKAGEDIR) | gzip -c > $(PACKAGETGZ) sync ; sync distclean : clean ( cd javanative && if [ -f Makefile ] ; then make distclean ; fi ) ( cd javapure && if [ -f Makefile ] ; then make distclean ; fi ) ( cd rubynative && if [ -f Makefile ] ; then make distclean ; fi ) ( cd rubypure && if [ -f Makefile ] ; then make distclean ; fi ) ( cd perlnative && if [ -f Makefile ] ; then make distclean ; fi ) ( cd windows && make clean ) ( cd example && make clean ) rm -rf Makefile estconfig hyperestraier.pc \ config.cache config.log config.status autom4te.cache casket : $(MYLIBS) $(MYBINS) $(MYCGIS) rm -rf casket ./estcmd create -tr -xl -attr '@uri' seq -attr '@title' str \ -attr '@author' str -attr '@mdate' num -attr '@size' num casket ./estcmd gather -cl -ws -il ja -cm -sd casket . multicasket : rm -rf casket casket-* ./estcmd create -tr -xl -attr '@uri' seq -attr '@title' str \ -attr '@author' str -attr '@mdate' num -attr '@size' num casket-doc ./estcmd gather -il ja casket-doc doc ./estcmd extkeys -um casket-doc ./estcmd gather -il ja casket-misc misc ./estcmd extkeys -um casket-misc scoutcasket : rm -rf casket casket-* ./estcmd gather -il ja casket-0 . ./estcmd gather -il ja casket-1 doc ./estcmd gather -il ja casket-2 misc nodecasket : $(MYLIBS) $(MYBINS) $(MYCGIS) rm -rf casket ./estmaster init -ex casket ./estcmd gather -cl -il ja -cm -sd casket/_node/sample0 . ./estcmd extkeys casket/_node/sample0 ./estmaster start -bg casket ; sleep 1 masterurl='http://admin:admin@localhost:1978/master' ; \ ./estcall raw "$$masterurl?action=useradd&name=mikio&passwd=oikim" ./estcall setuser -auth admin admin 'http://localhost:1978/node/sample0' mikio 1 ./estcall setlink -auth mikio oikim 'http://localhost:1978/node/sample0' \ 'http://localhost:1978/node/sample0' 'Sample0' 20000 ./estcall setlink -auth mikio oikim 'http://localhost:1978/node/sample0' \ 'http://localhost:1978/node/sample1' 'Sample1' 10100 ./estcall setlink -auth mikio oikim 'http://localhost:1978/node/sample0' \ 'http://localhost:1978/node/sample2' 'Sample2' 9800 ./estcall setlink -auth admin admin 'http://localhost:1978/node/sample1' \ 'http://localhost:1978/node/sample0' 'Sample0' 10001 ./estcall setlink -auth admin admin 'http://localhost:1978/node/sample2' \ 'http://localhost:1978/node/sample0' 'Sample0' 10002 ./estcall search -dpt 2 'http://localhost:1978/node/sample0' "mikio" > /dev/null ./estcall raw \ 'http://localhost:1978/node/sample1/search?phrase=mikio&depth=2' > /dev/null ./estcall raw \ 'http://localhost:1978/node/sample1/search_ui?phrase=mikio&depth=2' > /dev/null ./estcall raw \ 'http://localhost:1978/node/sample1/search_atom?phrase=mikio&depth=2' > /dev/null ./estcall raw \ 'http://localhost:1978/node/sample1/search_rss?phrase=mikio&depth=2' > /dev/null ./estmaster stop casket mastercasket : $(MYLIBS) $(MYBINS) $(MYCGIS) rm -rf casket-master ./estmaster init casket-master ./estmaster start -bg casket-master ; sleep 1 masterurl='http://admin:admin@localhost:1978/master' ; \ ./estcall raw "$$masterurl?action=nodeadd&name=node0&label=Node0" ; \ ./estcall raw "$$masterurl?action=nodeadd&name=node1&label=Node1" ; \ ./estcall raw "$$masterurl?action=nodeadd&name=node2&label=Node2" ; \ ./estcall raw "$$masterurl?action=nodeadd&name=node3&label=Node3" ./estcall setlink -auth admin admin 'http://localhost:1978/node/node0' \ 'http://localhost:1978/node/node1' 'Node1' 10002 ./estcall setlink -auth admin admin 'http://localhost:1978/node/node0' \ 'http://localhost:1978/node/node2' 'Node2' 10002 ./estcall setlink -auth admin admin 'http://localhost:1978/node/node0' \ 'http://localhost:1978/node/node3' 'Node3' 10002 ./estmaster stop casket-master wavercasket : $(MYLIBS) $(MYBINS) $(MYCGIS) rm -rf casket-waver ./estwaver init casket-waver printf '1,$$ s/guide-en/guide-ja/\nw\n' | ex casket-waver/_conf printf '/qdbm\.sourceforge\.net/ d\nw\n' | ex casket-waver/_conf printf '1,$$ s/^interval:.*/interval: 0/\nw\n' | ex casket-waver/_conf printf '1,$$ s/^timeout:.*/timeout: 180/\nw\n' | ex casket-waver/_conf printf '1,$$ s/^language:.*/language: 1/\nw\n' | ex casket-waver/_conf printf '1,$$ s/^threadnum:.*/threadnum: 20/\nw\n' | ex casket-waver/_conf printf '1,$$ s/^#node/node/\nw\n' | ex casket-waver/_conf pseudocasket : rm -rf casket casket-pidx ./estcmd create -tr -xl -attr '@uri' seq -attr '@title' str \ -attr '@author' str -attr '@mdate' num -attr '@size' num casket ./estcmd gather -il ja casket ./doc mkdir casket-pidx cp -f misc/*.est casket-pidx chmod -R 777 casket casket-pidx check : rm -rf casket casket-* $(RUNENV) $(RUNCMD) ./estcmd create -tr -xl -attr '@uri' seq -attr '@title' str \ -attr '@author' str -attr '@mdate' num -attr '@size' num casket $(RUNENV) $(RUNCMD) ./estcmd put -ws casket ./misc/test001.est $(RUNENV) $(RUNCMD) ./estcmd put -ws casket ./misc/test002.est $(RUNENV) $(RUNCMD) ./estcmd put -ws casket ./misc/test003.est $(RUNENV) $(RUNCMD) ./estcmd put -cl casket ./misc/test004.est $(RUNENV) $(RUNCMD) ./estcmd put -cl casket ./misc/test005.est $(RUNENV) $(RUNCMD) ./estcmd put -cl casket ./misc/test006.est $(RUNENV) $(RUNCMD) ./estcmd get casket 1 > check.out $(RUNENV) $(RUNCMD) ./estcmd get casket 2 > check.out $(RUNENV) $(RUNCMD) ./estcmd get casket 3 > check.out $(RUNENV) $(RUNCMD) ./estcmd get casket 4 > check.out $(RUNENV) $(RUNCMD) ./estcmd get casket 5 > check.out $(RUNENV) $(RUNCMD) ./estcmd get casket 6 > check.out $(RUNENV) $(RUNCMD) ./estcmd get casket 1 @uri > check.out $(RUNENV) $(RUNCMD) ./estcmd get -pidx misc casket 2000000001 > check.out $(RUNENV) $(RUNCMD) ./estcmd get -pidx misc casket 2000000002 > check.out $(RUNENV) $(RUNCMD) ./estcmd get -pidx misc casket 2000000001 @uri > check.out $(RUNENV) $(RUNCMD) ./estcmd get -pidx misc casket 2000000002 @uri > check.out $(RUNENV) $(RUNCMD) ./estcmd list -lp casket $(RUNENV) $(RUNCMD) ./estcmd uriid casket "mailto:mikio@users.sourceforge.net" $(RUNENV) $(RUNCMD) ./estcmd meta casket "mikio" "hirabayashi" $(RUNENV) $(RUNCMD) ./estcmd meta casket $(RUNENV) $(RUNCMD) ./estcmd search casket "Mikio Hirabayashi" $(RUNENV) $(RUNCMD) ./estcmd search -nl casket `printf '\xe3\x81\x93\n'` > check.out $(RUNENV) $(RUNCMD) ./estcmd search -cd casket `printf '\x32\xe8\xbc\xaa\n'` > check.out $(RUNENV) $(RUNCMD) ./estcmd search -nb -vu -cd casket "mikio OR enjoy OR hoge" $(RUNENV) $(RUNCMD) ./estcmd search -va -cd -max 1 casket "mikio OR momoyama AND GNU" $(RUNENV) $(RUNCMD) ./estcmd search -vf -kn 8 casket "mikio ANDNOT LGPL" > check.out $(RUNENV) $(RUNCMD) ./estcmd search -vs -kn 8 casket "dream OR estraier" > check.out $(RUNENV) $(RUNCMD) ./estcmd search -vh -kn 8 casket "mikio AND estraier" > check.out $(RUNENV) $(RUNCMD) ./estcmd search -vx -kn 8 -sim 2 casket > check.out $(RUNENV) $(RUNCMD) ./estcmd search -va -ec 0.5 casket "mikio" > check.out $(RUNENV) $(RUNCMD) ./estcmd search -vs -ec -0.5 casket "estraier" > check.out $(RUNENV) $(RUNCMD) ./estcmd search -vx -ec dir casket "mikio OR estraier" > check.out $(RUNENV) $(RUNCMD) ./estcmd search -vu \ -attr "@uri STRBW http" casket "sample" $(RUNENV) $(RUNCMD) ./estcmd search -vu \ -attr '@title !ISTRINC ESTRAIER' casket "estraier" $(RUNENV) $(RUNCMD) ./estcmd search -vu \ -attr '@title ISTRRX ^est' -attr '@title !STRRX J' casket "estraier" $(RUNENV) $(RUNCMD) ./estcmd search -vu \ -attr '@title,author,to ISTRINC mikio' casket "mikio AND hirabayashi" $(RUNENV) $(RUNCMD) ./estcmd search -vu \ -attr "@cdate NUMEQ Wed, 23 Dec 2004 10:18:23 +0900" -attr "@uri STREW txt" casket $(RUNENV) $(RUNCMD) ./estcmd search -vu -attr '@title' -ord "@title STRA" casket "[UVSET]" $(RUNENV) $(RUNCMD) ./estcmd search -vu -ord "@cdate NUMD" casket "[UVSET]" $(RUNENV) $(RUNCMD) ./estcmd search -gf -sf -ni casket \ '"Hyper Estraier" miki* | *nix | put_* | *_doc' > check.out $(RUNENV) $(RUNCMD) ./estcmd search -vs -hs casket \ '[SIMILAR] WITH 10 mikio WITH 5 unix' > check.out $(RUNENV) $(RUNCMD) ./estcmd search -va -hs casket '[ID] 1' > check.out $(RUNENV) $(RUNCMD) ./estcmd search -va -hs casket '[URI] data001' > check.out $(RUNENV) $(RUNCMD) ./estcmd search -va -hs casket '[RANK] 5 @size' > check.out $(RUNENV) $(RUNCMD) ./estcmd search -va -hs casket '[RANK] -5 @mdate' > check.out $(RUNENV) $(RUNCMD) ./estcmd search -pidx misc -vx -max -1 casket "[UVSET]" > check.out $(RUNENV) $(RUNCMD) ./estcmd search -pidx misc -vs -max -1 casket "mikio" > check.out $(RUNENV) $(RUNCMD) ./estcmd search -pidx misc -va -max -1 \ -attr '@title STRINC a' -attr '@uri STRINC f' casket "estraier" > check.out $(RUNENV) $(RUNCMD) ./estcmd search -pidx misc -vs -max -1 \ -attr '@title,@size,@uri STRINC f' -attr '@size NUMGT 0' casket "estraier" > check.out $(RUNENV) $(RUNCMD) ./estcmd search -pidx misc -vs -max -1 \ -attr '@title,@size,@uri STRRX (a|b|0)' -ord '@size NUMD' casket "estraier" > check.out $(RUNENV) $(RUNCMD) ./estcmd search -pidx misc -vf -dis '@type' \ casket "[UVSET]" > check.out $(RUNENV) $(RUNCMD) ./estcmd break "@This is a pen." $(RUNENV) $(RUNCMD) ./estcmd break ./misc/zen.txt > check.out $(RUNENV) $(RUNCMD) ./estcmd break -apn ./misc/chars.txt > check.out $(RUNENV) $(RUNCMD) ./estcmd break -acc ./misc/chars.txt > check.out $(RUNENV) $(RUNCMD) ./estcmd iconv "@This is a pen." $(RUNENV) $(RUNCMD) ./estcmd iconv ./misc/zen.txt > check.out $(RUNENV) $(RUNCMD) ./estcmd regex mikio Makefile.in > check.out $(RUNENV) $(RUNCMD) ./estcmd regex -repl MIKIO mikio Makefile.in > check.out $(RUNENV) $(RUNCMD) ./estcmd scandir -pu > check.out $(RUNENV) $(RUNCMD) ./estcmd scandir -td > check.out $(RUNENV) $(RUNCMD) ./estcmd out casket 3 $(RUNENV) $(RUNCMD) ./estcmd out casket 4 $(RUNENV) $(RUNCMD) ./estcmd edit casket 5 '@title' "five" $(RUNENV) $(RUNCMD) ./estcmd edit casket 5 '@uri' "http://five.org/5" $(RUNENV) $(RUNCMD) ./estcmd gather -il ja -bc -lf 0.05 -cm -cs 0.2 casket . $(RUNENV) $(RUNCMD) ./estcmd gather -cl -ws -il ja -lt 10 -pc UTF-8 -cm -sd casket . $(RUNENV) $(RUNCMD) ./estcmd extkeys -ni casket $(RUNENV) $(RUNCMD) ./estcmd extkeys -fc -kn 64 casket $(RUNENV) $(RUNCMD) ./estcmd extkeys -fc -kn 64 -um casket $(RUNENV) $(RUNCMD) ./estcmd words casket > check.out $(RUNENV) $(RUNCMD) ./estcmd draft ./misc/test003.est > check.out $(RUNENV) $(RUNCMD) ./estcmd draft -um ./misc/test003.est > check.out $(RUNENV) $(RUNCMD) ./estcmd search -vs -hs casket \ '[SIMILAR] WITH 0 html WITH 5 gnu' > check.out $(RUNENV) $(RUNCMD) ./estcmd purge casket $(RUNENV) $(RUNCMD) ./estcmd optimize casket $(RUNENV) $(RUNCMD) ./estcmd list casket $(RUNENV) $(RUNCMD) ./estcmd search -vf casket \ "[UVSET] ANDNOT mikio" > check.out QUERY_STRING="phrase=mikio%20|%20estraier" \ $(RUNENV) $(RUNCMD) ./estseek.cgi > check.out QUERY_STRING="phrase=mikio&attr=@uri%20STRINC%20html" \ $(RUNENV) $(RUNCMD) ./estseek.cgi > check.out QUERY_STRING="phrase=estraier&order=@size%20NUMD" \ $(RUNENV) $(RUNCMD) ./estseek.cgi > check.out QUERY_STRING="phrase=mikio%7C%B4%B4%CD%BA&attr=&order=&perpage=5&pagenum=2&enc=EUC-JP" \ $(RUNENV) $(RUNCMD) ./estseek.cgi > check.out QUERY_STRING="similar=53&perpage=8&pagenum=2" \ $(RUNENV) $(RUNCMD) ./estseek.cgi > check.out QUERY_STRING="phrase=%5BSIMILAR%5D+WITH+2000+estraier&perpage=8&pagenum=2" \ $(RUNENV) $(RUNCMD) ./estseek.cgi > check.out QUERY_STRING="phrase=mikio%7Cestraier&clip=2&pagenum=2" \ $(RUNENV) $(RUNCMD) ./estseek.cgi > check.out PATH_INFO="/casket/inform" $(RUNENV) $(RUNCMD) ./estfraud.cgi > check.out PATH_INFO="/casket/search" QUERY_STRING="phrase=mikio%20|%20estraier" \ $(RUNENV) $(RUNCMD) ./estfraud.cgi > check.out PATH_INFO="/casket/search" QUERY_STRING="phrase=mikio&attr1=@uri%20STRINC%20html" \ $(RUNENV) $(RUNCMD) ./estfraud.cgi > check.out PATH_INFO="/casket/get_doc" QUERY_STRING="uri=data001" \ $(RUNENV) $(RUNCMD) ./estfraud.cgi > check.out PATH_INFO="/casket/get_doc_attr" QUERY_STRING="uri=data001&attr=@uri" \ $(RUNENV) $(RUNCMD) ./estfraud.cgi > check.out PATH_INFO="/casket/etch_doc" QUERY_STRING="uri=data002" \ $(RUNENV) $(RUNCMD) ./estfraud.cgi > check.out PATH_INFO="/casket/uri_to_id" QUERY_STRING="uri=data003" \ $(RUNENV) $(RUNCMD) ./estfraud.cgi > check.out $(RUNENV) $(RUNCMD) ./estcmd randput casket 25 $(RUNENV) $(RUNCMD) ./estcmd search casket `printf '\xe3\x81\x93\n'` > check.out $(RUNENV) $(RUNCMD) ./estcmd search casket "vw OR wx OR xy OR yz" > check.out $(RUNENV) $(RUNCMD) ./estcmd create \ -attr '@genre' str -attr '@id' num -attr '@digest' seq casket $(RUNENV) $(RUNCMD) ./estcmd optimize casket $(RUNENV) $(RUNCMD) ./estcmd wicked casket 1000 $(RUNENV) $(RUNCMD) ./estcmd regression casket $(RUNENV) $(RUNCMD) ./estmttest wicked casket 1000 1 $(RUNENV) $(RUNCMD) ./estmttest regression casket rm -rf casket casket-* $(RUNENV) $(RUNCMD) ./estcmd gather -il ja -xh -sv casket . $(RUNENV) $(RUNCMD) ./estcmd search -vu -hs casket "mikio OR estraier" > check.out $(RUNENV) $(RUNCMD) ./estcmd optimize casket $(RUNENV) $(RUNCMD) ./estcmd search -vu -hs casket "hyper estraier" > check.out $(RUNENV) $(RUNCMD) ./estcmd gather -tr -il ja -sa -ss '@size' casket . $(RUNENV) $(RUNCMD) ./estcmd search -vs -hs casket "mikio AND unix" > check.out $(RUNENV) $(RUNCMD) ./estcmd optimize casket $(RUNENV) $(RUNCMD) ./estcmd search -vf -hs casket "mikio NOT unix" > check.out rm -rf casket casket-* $(RUNENV) $(RUNCMD) ./estcmd create -tr -xl -attr '@uri' seq -attr '@title' str \ -attr '@author' str -attr '@mdate' num -attr '@size' num casket $(RUNENV) $(RUNCMD) ./estcmd uriid -pidx misc casket "data001" $(RUNENV) $(RUNCMD) ./estcmd get -pidx misc casket "data002" > check.out $(RUNENV) $(RUNCMD) ./estcmd search -pidx misc -vs -hs casket "[URI] data003" > check.out $(RUNENV) $(RUNCMD) ./estcmd search -pidx misc -vx -hs casket "the" > check.out $(RUNENV) $(RUNCMD) ./estcmd gather -il ja casket ./doc $(RUNENV) $(RUNCMD) ./estcmd put casket ./misc/data001.est $(RUNENV) $(RUNCMD) ./estcmd put casket ./misc/data002.est $(RUNENV) $(RUNCMD) ./estcmd extkeys casket $(RUNENV) $(RUNCMD) ./estcmd gather -il ja casket-child ./misc $(RUNENV) $(RUNCMD) ./estcmd extkeys casket-child $(RUNENV) $(RUNCMD) ./estcmd multi -db casket -db casket-child \ -cd -hs -hu -dis '@type' mikio > check.out $(RUNENV) $(RUNCMD) ./estcmd multi -db casket -db casket-child \ -cd -hs -hu -attr '@uri ISTRINC est' -max -1 -sk 10 estraier > check.out $(RUNENV) $(RUNCMD) ./estcmd merge casket casket-child $(RUNENV) $(RUNCMD) ./estcmd merge casket-child casket $(RUNENV) $(RUNCMD) ./estcmd merge -cl casket casket-child $(RUNENV) $(RUNCMD) ./estcmd search -vs -hs casket "mikio OR unix" > check.out rm -rf casket casket-* $(RUNENV) $(RUNCMD) ./estmaster unittest casket rm -rf casket casket-* $(RUNENV) $(RUNCMD) ./estwaver unittest casket rm -rf casket casket-* $(RUNENV) $(RUNCMD) ./estcmd gather -il ja -xl -kn 48 -um casket misc $(RUNENV) $(RUNCMD) ./estcmd search -vu -kn 32 -um -ec 0.5 -sim 2 casket > check.out $(RUNENV) $(RUNCMD) ./estcmd purge -cl -fc -attr '@uri STREW .html' casket $(RUNENV) $(RUNCMD) ./estcmd repair -rst casket $(RUNENV) $(RUNCMD) ./estcmd search -vf casket "[UVSET]" > check.out $(RUNENV) $(RUNCMD) ./estcmd search -vs -attr "@uri STRINC" casket > check.out $(RUNENV) $(RUNCMD) ./estcmd words -kw casket > check.out $(RUNENV) $(RUNCMD) ./estcmd words -kt casket > check.out rm -rf casket casket-* $(RUNENV) $(RUNCMD) ./estcmd gather -il ja casket-1 misc $(RUNENV) $(RUNCMD) ./estcmd gather -il ja -xl casket-2 misc $(RUNENV) $(RUNCMD) ./estcmd gather -il ja -xh casket-3 misc QUERY_STRING="phrase1=mikio&stmode=1" \ $(RUNENV) $(RUNCMD) ./estscout.cgi > check.out QUERY_STRING="phrase1=mikio&phrase2=mikio&stmode=1" \ $(RUNENV) $(RUNCMD) ./estscout.cgi > check.out QUERY_STRING="phrase1=mikio&phrase2=mikio&phrase3=mikio&stmode=1" \ $(RUNENV) $(RUNCMD) ./estscout.cgi > check.out QUERY_STRING="phrase1=mikio&phrase2=mikio&attr1=%40uri%20STRBW%20file&stmode=1" \ $(RUNENV) $(RUNCMD) ./estscout.cgi > check.out QUERY_STRING='attr1=%40uri%20ISTRRX%20(txt%7Ceml%7Chtml)%24&max=20&stmode=1' \ $(RUNENV) $(RUNCMD) ./estscout.cgi > check.out QUERY_STRING='phrase2=mikio&attr1=%40uri%20STRINC%20test&stmode=1' \ $(RUNENV) $(RUNCMD) ./estscout.cgi > check.out rm -rf casket casket-* @printf '\n' @printf '#================================================================\n' @printf '# Checking completed.\n' @printf '#================================================================\n' check-valgrind : make RUNCMD="valgrind --tool=memcheck --log-fd=1" check | tee leak.log grep ERROR leak.log grep 'at exit' leak.log check-xml : make casket ./estcmd search -vx casket "mikio" > check.out ; \ xmllint --dtdvalid estresult.dtd --noout check.out ./estcmd search -vx -max 3 casket "hyper estraier AND mikio" > check.out ; \ xmllint --dtdvalid estresult.dtd --noout check.out ./estcmd search -vx -ec 0.5 casket "hyper estraier ANDNOT unix" > check.out ; \ xmllint --dtdvalid estresult.dtd --noout check.out ./estcmd search -vx -sim 3 casket > check.out ; \ xmllint --dtdvalid estresult.dtd --noout check.out QUERY_STRING="" ./estseek.cgi | \ tr -d '\r' | sed -n '/^$$/,$$ p' | grep -v '^$$' > check.out ; \ xmllint --noout check.out QUERY_STRING="phrase=mikio" ./estseek.cgi | \ tr -d '\r' | sed -n '/^$$/,$$ p' | grep -v '^$$' > check.out ; \ xmllint --noout check.out QUERY_STRING="phrase=mikio&perpage=3&pagenum=2" ./estseek.cgi | \ tr -d '\r' | sed -n '/^$$/,$$ p' | grep -v '^$$' > check.out ; \ xmllint --noout check.out QUERY_STRING="phrase=mikio&detail=3" ./estseek.cgi | \ tr -d '\r' | sed -n '/^$$/,$$ p' | grep -v '^$$' > check.out ; \ xmllint --noout check.out world : make cd javanative ; [ -f Makefile ] || ./configure ; make cd javapure ; [ -f Makefile ] || ./configure ; make cd rubynative ; [ -f Makefile ] || ./configure ; make cd rubypure ; [ -f Makefile ] || ./configure ; make cd perlnative ; [ -f Makefile ] || ./configure ; make check-world : make check cd javanative ; [ -f Makefile ] || ./configure ; make check cd rubynative ; [ -f Makefile ] || ./configure ; make check cd perlnative ; [ -f Makefile ] || ./configure ; make check install-world : make install cd javanative ; [ -f Makefile ] || ./configure ; make install cd javapure ; [ -f Makefile ] || ./configure ; make install cd rubynative ; [ -f Makefile ] || ./configure ; make install cd rubypure ; [ -f Makefile ] || ./configure ; make install cd perlnative ; [ -f Makefile ] || ./configure ; make install uninstall-world : make uninstall make uninstall-fcgi cd javanative ; [ -f Makefile ] || ./configure ; make uninstall cd javapure ; [ -f Makefile ] || ./configure ; make uninstall cd rubynative ; [ -f Makefile ] || ./configure ; make uninstall cd rubypure ; [ -f Makefile ] || ./configure ; make uninstall cd perlnative ; [ -f Makefile ] || ./configure ; make uninstall mac : make MYLIBS="$(MYMACLIBS)" CFLAGS="-Wall -fsigned-char -fno-common -O2 -DNDEBUG" check-mac : make RUNENV="DYLD_LIBRARY_PATH=." check install-mac : make MYLIBS="$(MYMACLIBS)" install uninstall-mac : make MYLIBS="$(MYMACLIBS)" uninstall hpux : make MYLIBS="$(MYHPUXLIBS)" check-hpux : make RUNENV="SHLIB_PATH=." check install-hpux : make MYLIBS="$(MYHPUXLIBS)" install uninstall-hpux : make MYLIBS="$(MYHPUXLIBS)" uninstall win : make CC="gcc -mno-cygwin" MYBINS="$(MYBINS) estmaster-sv" MYLIBS="$(MYWINLIBS)" \ CFLAGS="-Wall -fsigned-char -O0 -DNDEBUG" LIBS="-lqdbm -lz -liconv -lregex" \ MTLIBS="-lpthreadGC2" SKLIBS="-lws2_32" winpkg : make win && strip *.exe cd javanative && ./configure && make win cd javapure && ./configure && make cd rubypure && ./configure && make cd windows && make rm -rf $(PACKAGE) mkdir -p $(PACKAGE) cp -Rf estraier.dll libestraier.dll.a estraier.h estmtdb.h \ estcmd.exe estmttest.exe estmaster.exe estmaster-sv.exe estbutler.exe \ estcall.exe estwaver.exe estload.exe \ estseek.cgi estfraud.cgi estproxy.cgi estscout.cgi estsupt.cgi \ $(MYCONFS) doc $(PACKAGE) rm -rf $(PACKAGE)/filter cp -Rf /bin/mgwz.dll /bin/libiconv-2.dll /bin/regex.dll \ /usr/local/bin/qdbm.dll $(PACKAGE) cp -Rf /bin/pthreadGC2.dll /lib/mingw/libpthreadGC2.a $(PACKAGE) cp -Rf /usr/local/include/depot.h /usr/local/include/curia.h \ /usr/local/include/cabin.h /usr/local/include/villa.h $(PACKAGE) cp -Rf /usr/include/mingw/pthread.h /usr/include/mingw/sched.h \ /usr/include/mingw/semaphore.h $(PACKAGE) cp -Rf /usr/local/xdoc2txt/* $(PACKAGE) cp -Rf javanative/estraier.jar javanative/jestraier.dll $(PACKAGE) cp -Rf javapure/estraierpure.jar $(PACKAGE) cp -Rf rubypure/estraierpure.rb rubypure/estcall.rb $(PACKAGE) cp -Rf windows/*.exe windows/*.bat windows/*.txt $(PACKAGE) zip -r $(PACKAGEDIR)-win32.zip $(PACKAGE) mv -f $(PACKAGEDIR)-win32.zip .. corelib : $(MYCORELIBS) fcgi : $(MYFCGIS) install-fcgi : cp -Rf $(MYFCGIS) $(DESTDIR)$(MYLIBEXECDIR) uninstall-fcgi : cd $(DESTDIR)$(MYLIBEXECDIR) && rm -f $(MYFCGIS) .PHONY : all clean install casket check #================================================================ # Building binaries #================================================================ libestraier.a : $(MYLIBOBJS) $(AR) $(ARFLAGS) $@ $(MYLIBOBJS) libestraier.so.$(LIBVER).$(LIBREV).0 : $(MYLIBOBJS) if $(CC) --print-prog-name=ld | egrep -i '(solaris|/ccs/|/ucb/)' > /dev/null ; \ then \ $(CC) -shared -Wl,-G,-h,libestraier.so.$(LIBVER) -o $@ $(MYLIBOBJS) \ $(LDFLAGS) $(SKLIBS) $(MTLIBS) $(LIBS) ; \ else \ $(CC) -shared -Wl,-soname,libestraier.so.$(LIBVER) -o $@ $(MYLIBOBJS) \ $(LDFLAGS) $(SKLIBS) $(MTLIBS) $(LIBS) ; \ fi libestraier.so.$(LIBVER) : libestraier.so.$(LIBVER).$(LIBREV).0 ln -f -s libestraier.so.$(LIBVER).$(LIBREV).0 $@ libestraier.so : libestraier.so.$(LIBVER).$(LIBREV).0 ln -f -s libestraier.so.$(LIBVER).$(LIBREV).0 $@ libestraier.$(LIBVER).$(LIBREV).0.dylib : $(MYLIBOBJS) $(CC) -dynamiclib -o $@ \ -install_name $(MYLIBDIR)/libestraier.$(LIBVER).dylib \ -current_version $(LIBVER).$(LIBREV).0 \ -compatibility_version $(LIBVER) \ $(MYLIBOBJS) $(LDFLAGS) $(SKLIBS) $(MTLIBS) $(LIBS) libestraier.$(LIBVER).dylib : libestraier.$(LIBVER).$(LIBREV).0.dylib ln -f -s libestraier.$(LIBVER).$(LIBREV).0.dylib $@ libestraier.dylib : libestraier.$(LIBVER).$(LIBREV).0.dylib ln -f -s libestraier.$(LIBVER).$(LIBREV).0.dylib $@ libestraier.sl : $(MYLIBOBJS) $(CC) -shared -Wl,-b -o $@ $(MYLIBOBJS) libestraier.dll.a : estraier.dll estraier.dll : $(MYLIBOBJS) $(CC) -shared -o $@ \ -Wl,--out-implib=lib$@.a \ -Wl,--export-all-symbols \ -Wl,--enable-auto-import \ -Wl,--add-stdcall-alias \ -Wl,--whole-archive \ -Wl,--no-whole-archive \ $(MYLIBOBJS) $(LDFLAGS) $(SKLIBS) $(MTLIBS) $(LIBS) libestcore.a : estraier.o md5.o $(AR) $(ARFLAGS) $@ estraier.o md5.o estcmd : estcmd.o mymorph.o $(MYLIBS) $(LDENV) $(CC) $(CFLAGS) -o $@ estcmd.o mymorph.o \ $(LDFLAGS) -lestraier $(APPLIBS) $(SKLIBS) $(MTLIBS) $(LIBS) estmttest : estmttest.o $(MYLIBS) $(LDENV) $(CC) $(CFLAGS) -o $@ estmttest.o \ $(LDFLAGS) -lestraier $(APPLIBS) $(SKLIBS) $(MTLIBS) $(LIBS) estmaster : estmaster.o mastermod.o mymorph.o $(MYLIBS) $(LDENV) $(CC) $(CFLAGS) -o $@ estmaster.o mastermod.o mymorph.o \ $(LDFLAGS) -lestraier $(APPLIBS) $(SKLIBS) $(MTLIBS) $(LIBS) estmaster-sv : estmaster.c mastermod.o mymorph.o $(MYLIBS) $(LDENV) $(CC) $(CPPFLAGS) $(CFLAGS) -DMYWINSERV=1 -o $@ \ estmaster.c mastermod.o mymorph.o \ $(LDFLAGS) -lestraier $(APPLIBS) $(SKLIBS) $(MTLIBS) $(LIBS) estbutler : estbutler.o mastermod.o $(MYLIBS) $(LDENV) $(CC) $(CFLAGS) -o $@ estbutler.o mastermod.o \ $(LDFLAGS) -lestraier $(APPLIBS) $(SKLIBS) $(MTLIBS) $(LIBS) estcall : estcall.o $(MYLIBS) $(LDENV) $(CC) $(CFLAGS) -o $@ estcall.o \ $(LDFLAGS) -lestraier $(APPLIBS) $(SKLIBS) $(MTLIBS) $(LIBS) estwaver : estwaver.o wavermod.o mymorph.o $(MYLIBS) $(LDENV) $(CC) $(CFLAGS) -o $@ estwaver.o wavermod.o mymorph.o \ $(LDFLAGS) -lestraier $(APPLIBS) $(SKLIBS) $(MTLIBS) $(LIBS) estload : estload.o $(MYLIBS) $(LDENV) $(CC) $(CFLAGS) -o $@ estload.o \ $(LDFLAGS) -lestraier $(APPLIBS) $(SKLIBS) $(MTLIBS) $(LIBS) estseek.cgi : estseek.o $(MYLIBS) $(LDENV) $(CC) $(CFLAGS) -o $@ estseek.o \ $(LDFLAGS) -lestraier $(APPLIBS) $(SKLIBS) $(MTLIBS) $(LIBS) estseek.fcgi : estseek.c $(MYLIBS) $(LDENV) $(CC) $(CPPFLAGS) $(CFLAGS) -DMYFCGI -o $@ estseek.c \ $(LDFLAGS) -lfcgi -lestraier $(APPLIBS) $(SKLIBS) $(MTLIBS) $(LIBS) estfraud.cgi : estfraud.o mastermod.o mymorph.o $(MYLIBS) $(LDENV) $(CC) $(CFLAGS) -o $@ estfraud.o mastermod.o mymorph.o \ $(LDFLAGS) -lestraier $(APPLIBS) $(SKLIBS) $(MTLIBS) $(LIBS) estfraud.fcgi : estfraud.c mastermod.o mymorph.o $(MYLIBS) $(LDENV) $(CC) $(CPPFLAGS) $(CFLAGS) -DMYFCGI -o $@ estfraud.c mastermod.o mymorph.o \ $(LDFLAGS) -lfcgi -lestraier $(APPLIBS) $(SKLIBS) $(MTLIBS) $(LIBS) estproxy.cgi : estproxy.o $(MYLIBS) $(LDENV) $(CC) $(CFLAGS) -o $@ estproxy.o \ $(LDFLAGS) -lestraier $(APPLIBS) $(SKLIBS) $(MTLIBS) $(LIBS) estproxy.fcgi : estproxy.c $(MYLIBS) $(LDENV) $(CC) $(CPPFLAGS) $(CFLAGS) -DMYFCGI -o $@ estproxy.c \ $(LDFLAGS) -lfcgi -lestraier $(APPLIBS) $(SKLIBS) $(MTLIBS) $(LIBS) estscout.cgi : estscout.o $(MYLIBS) $(LDENV) $(CC) $(CFLAGS) -o $@ estscout.o \ $(LDFLAGS) -lestraier $(APPLIBS) $(SKLIBS) $(MTLIBS) $(LIBS) estscout.fcgi : estscout.c $(MYLIBS) $(LDENV) $(CC) $(CPPFLAGS) $(CFLAGS) -DMYFCGI -o $@ estscout.c \ $(LDFLAGS) -lfcgi -lestraier $(APPLIBS) $(SKLIBS) $(MTLIBS) $(LIBS) estsupt.cgi : estsupt.o $(MYLIBS) $(LDENV) $(CC) $(CFLAGS) -o $@ estsupt.o \ $(LDFLAGS) -lestraier $(APPLIBS) $(SKLIBS) $(MTLIBS) $(LIBS) estsupt.fcgi : estsupt.c $(MYLIBS) $(LDENV) $(CC) $(CPPFLAGS) $(CFLAGS) -DMYFCGI -o $@ estsupt.c \ $(LDFLAGS) -lfcgi -lestraier $(APPLIBS) $(SKLIBS) $(MTLIBS) $(LIBS) estcmd.o estmttest.o mastermod.o estmaster.o estbutler.o \ estcall.o estwaver.o estload.o \ estseek.o estfraud.o estproxy.o estscout.o estsupt.o mymorph.o : \ myconf.h md5.h estraier.h estmtdb.h estnode.h mymorph.o estcmd.o estmaster.o estwaver.o estfraud.o : mymorph.h md5.o : md5.h estraier.o : myconf.h md5.h estraier.h estmtdb.o : myconf.h md5.h estraier.h estmtdb.h estnode.o : myconf.h md5.h estraier.h estmtdb.h estnode.h mastermod.o estmaster.o estbutler.o : mastermod.h estmaster.o : myimage.dat wavermod.o estwaver.o : wavermod.h # END OF FILE hyperestraier-1.4.13/README000066400000000000000000000032601125261632700153540ustar00rootroot00000000000000================================================================ Hyper Estraier: a full-text search system for communities Copyright (C) 2004-2005 Mikio Hirabayashi ================================================================ Please read the following documents with a WWW browser. How to install QDBM is explained in the specification. README - this file COPYING - license ChangeLog - history of enhancement THANKS - list of contributors doc/index.html - index of documents Contents of the directory tree is below. ./ - sources of Hyper Estraier ./locale/ - locale files ./filter/ - filter scripts ./increm/ - files for incremental search ./emskel/ - skelton of configuration ./doc/ - manuals and specifications ./man/ - manuals for nroff ./javanative/ - sources of the Java binding ./javapure/ - sources of the pure Java interface ./rubynative/ - sources of the Ruby binding ./rubypure/ - sources of the pure Ruby interface ./win/ - files for Windows ./example/ - sample code of tutorial ./lab/ - for test and experiment ./misc/ - miscellaneous files Hyper Estraier is released under the terms of the GNU Lesser General Public License. See the file `COPYING' for details. Hyper Estraier 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/hyperestraier-users Thanks. == END OF FILE == hyperestraier-1.4.13/THANKS000066400000000000000000000014711125261632700154110ustar00rootroot00000000000000================================================================ Thanks to all of the following for their valuable suggestions or contributions. ================================================================ Information-technology Promotion Agency, Japan - supporting Hyper Estraier in Exploratory Software Project Fumitoshi Ukai - the project manager of Hyper Estraier in ESP of IPA Yuji -Tekiretsu- Hamada - contribution of the project logo image hishida - allowing us to include xdoc2txt in the binary package L. Peter Deutsch - allowing for us to use MD5 implementation Dobrica Pavlinusic - contribution of documents in English Tokuhiro Matsuno - contribution of bindings of some scripting languages Akihiro -Doctor- Nakao - contribution of the project logo image == END OF FILE == hyperestraier-1.4.13/configure000077500000000000000000003532031125261632700164100ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for hyperestraier 1.4.13. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='hyperestraier' PACKAGE_TARNAME='hyperestraier' PACKAGE_VERSION='1.4.13' PACKAGE_STRING='hyperestraier 1.4.13' PACKAGE_BUGREPORT='' ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT LIBVER LIBREV PROTVER MYCFLAGS MYCPPOPTS MYDEFS MYLDOPTS MYMTLIBS MYSKLIBS MYAPPLIBS MYRUNPATH MYPOSTCMD LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures hyperestraier 1.4.13 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of hyperestraier 1.4.13:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-debug build for debugging --enable-devel build for development --enable-stable build for stable release --enable-profile build for profiling --enable-static link statically --enable-mecab feature mecab morphological analyzer --disable-zlib build without ZLIB compression --enable-lzo build with LZO compression --enable-bzip build with BZIP2 compression --enable-vista build with Vista database Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF hyperestraier configure 1.4.13 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by hyperestraier $as_me 1.4.13, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Export variables LIBVER=8 LIBREV=38 PROTVER="1.0" MYCFLAGS="-Wall -fPIC -fsigned-char -O3 -fomit-frame-pointer -fforce-addr" MYCPPOPTS="" MYDEFS="-DNDEBUG" MYLDOPTS="" MYMTLIBS="" MYSKLIBS="" MYAPPLIBS="" MYRUNPATH="" MYPOSTCMD="true" # Building paths pathtmp="$PATH" PATH="$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin" PATH="$PATH:/usr/ccs/bin:/usr/ucb:/usr/xpg4/bin:/usr/xpg6/bin:$pathtmp" LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LIBRARY_PATH" LD_LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH" CPATH="$HOME/include:/usr/local/include:$CPATH" PKG_CONFIG_PATH="$HOME/lib/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH if type pkg-config > /dev/null 2>&1 then PATH="$PATH:`pkg-config --variable=bindir qdbm`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" CPATH="$CPATH:`pkg-config --variable=includedir qdbm`" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH fi #================================================================ # Options #================================================================ # Internal variables enables="" stable="no" # Debug mode # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" fi; if test "$enable_debug" = "yes" then MYCFLAGS="-Wall -ansi -pedantic -fPIC -fsigned-char -g" MYDEFS="" MYLDOPTS="-static" enables="$enables (debug)" stable="yes" fi # Developping mode # Check whether --enable-devel or --disable-devel was given. if test "${enable_devel+set}" = set; then enableval="$enable_devel" fi; if test "$enable_devel" = "yes" then MYCFLAGS="-Wall -ansi -pedantic -fPIC -fsigned-char -g -O2 -pipe" MYDEFS="" MYPOSTCMD="sync ; sync" enables="$enables (devel)" stable="yes" fi # Stable mode # Check whether --enable-stable or --disable-stable was given. if test "${enable_stable+set}" = set; then enableval="$enable_stable" fi; if test "$enable_stable" = "yes" then MYCFLAGS="-Wall -ansi -pedantic -fPIC -fsigned-char -O2" enables="$enables (stable)" stable="yes" fi # Profiling mode # Check whether --enable-profile or --disable-profile was given. if test "${enable_profile+set}" = set; then enableval="$enable_profile" fi; if test "$enable_profile" = "yes" then MYCFLAGS="-Wall -pedantic -fPIC -fsigned-char -g -pg -O2 -Werror" enables="$enables (profile)" fi # Static mode # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" fi; if test "$enable_static" = "yes" then MYLDOPTS="-static" enables="$enables (static)" fi # Enable MeCab morphological analyzer # Check whether --enable-mecab or --disable-mecab was given. if test "${enable_mecab+set}" = set; then enableval="$enable_mecab" fi; if test "$enable_mecab" = "yes" then MYDEFS="$MYDEFS -D_MYMECAB" MYAPPLIBS="$MYAPPLIBS -lmecab -lstdc++" enables="$enables (mecab)" fi # Disable ZLIB compression # Check whether --enable-zlib or --disable-zlib was given. if test "${enable_zlib+set}" = set; then enableval="$enable_zlib" fi; if test "$enable_zlib" = "no" then MYDEFS="$MYDEFS -D_MYNOZLIB" enables="$enables (no-zlib)" fi # Enable LZO compression # Check whether --enable-lzo or --disable-lzo was given. if test "${enable_lzo+set}" = set; then enableval="$enable_lzo" fi; if test "$enable_lzo" = "yes" then MYDEFS="$MYDEFS -D_MYLZO" enables="$enables (lzo)" fi # Enable BZIP2 compression # Check whether --enable-bzip or --disable-bzip was given. if test "${enable_bzip+set}" = set; then enableval="$enable_bzip" fi; if test "$enable_bzip" = "yes" then MYDEFS="$MYDEFS -D_MYBZIP" enables="$enables (bzip)" fi # Enable Vista database # Check whether --enable-bzip or --disable-bzip was given. if test "${enable_bzip+set}" = set; then enableval="$enable_bzip" fi; if test "$enable_vista" = "yes" then MYDEFS="$MYDEFS -D_MYVISTA" enables="$enables (vista)" fi # Messages printf '#================================================================\n' printf '# Configuring Hyper Estraier version %s%s.\n' "$PACKAGE_VERSION" "$enables" printf '#================================================================\n' #================================================================ # Checking Commands and Libraries #================================================================ # C compiler ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "$enable_devel" != "yes" && test "$enable_profile" != "yes" then if uname | egrep -i 'Linux' > /dev/null 2>&1 && test "$stable" != "yes" && uname -m | egrep -i '(x|i)(3|4|5|6|7|8|9)?86' > /dev/null 2>&1 then MYCFLAGS="$MYCFLAGS -minline-all-stringops" fi if uname | egrep -i 'SunOS' > /dev/null 2>&1 then MYCFLAGS="-Wall -fPIC -fsigned-char -O1" fi if uname | egrep -i 'BSD' > /dev/null 2>&1 then MYCFLAGS="-Wall -fPIC -fsigned-char -O1" fi if gcc --version | egrep -i '^2\.(8|9)' > /dev/null 2>&1 then MYCFLAGS="-Wall -fPIC -fsigned-char -O1" fi fi # Underlying libraries echo "$as_me:$LINENO: checking for main in -lc" >&5 echo $ECHO_N "checking for main in -lc... $ECHO_C" >&6 if test "${ac_cv_lib_c_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_c_main" >&5 echo "${ECHO_T}$ac_cv_lib_c_main" >&6 if test $ac_cv_lib_c_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBC 1 _ACEOF LIBS="-lc $LIBS" fi echo "$as_me:$LINENO: checking for main in -lm" >&5 echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6 if test "${ac_cv_lib_m_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_m_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5 echo "${ECHO_T}$ac_cv_lib_m_main" >&6 if test $ac_cv_lib_m_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi echo "$as_me:$LINENO: checking for main in -lregex" >&5 echo $ECHO_N "checking for main in -lregex... $ECHO_C" >&6 if test "${ac_cv_lib_regex_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lregex $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_regex_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_regex_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_regex_main" >&5 echo "${ECHO_T}$ac_cv_lib_regex_main" >&6 if test $ac_cv_lib_regex_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBREGEX 1 _ACEOF LIBS="-lregex $LIBS" fi echo "$as_me:$LINENO: checking for main in -liconv" >&5 echo $ECHO_N "checking for main in -liconv... $ECHO_C" >&6 if test "${ac_cv_lib_iconv_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liconv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_iconv_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_iconv_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_main" >&5 echo "${ECHO_T}$ac_cv_lib_iconv_main" >&6 if test $ac_cv_lib_iconv_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBICONV 1 _ACEOF LIBS="-liconv $LIBS" fi if test "$enable_zlib" != "no" || pkg-config --libs qdbm 2>&1 | grep '\-lz' > /dev/null 2>&1 then echo "$as_me:$LINENO: checking for main in -lz" >&5 echo $ECHO_N "checking for main in -lz... $ECHO_C" >&6 if test "${ac_cv_lib_z_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_z_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_z_main" >&5 echo "${ECHO_T}$ac_cv_lib_z_main" >&6 if test $ac_cv_lib_z_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF LIBS="-lz $LIBS" fi fi if test "$enable_lzo" = "yes" || pkg-config --libs qdbm 2>&1 | grep '\-llzo2' > /dev/null 2>&1 then echo "$as_me:$LINENO: checking for main in -llzo2" >&5 echo $ECHO_N "checking for main in -llzo2... $ECHO_C" >&6 if test "${ac_cv_lib_lzo2_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llzo2 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_lzo2_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_lzo2_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2_main" >&5 echo "${ECHO_T}$ac_cv_lib_lzo2_main" >&6 if test $ac_cv_lib_lzo2_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBLZO2 1 _ACEOF LIBS="-llzo2 $LIBS" fi fi if test "$enable_bzip" = "yes" || pkg-config --libs qdbm 2>&1 | grep '\-lbz2' > /dev/null 2>&1 then echo "$as_me:$LINENO: checking for main in -lbz2" >&5 echo $ECHO_N "checking for main in -lbz2... $ECHO_C" >&6 if test "${ac_cv_lib_bz2_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbz2 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bz2_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bz2_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_bz2_main" >&5 echo "${ECHO_T}$ac_cv_lib_bz2_main" >&6 if test $ac_cv_lib_bz2_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBBZ2 1 _ACEOF LIBS="-lbz2 $LIBS" fi fi echo "$as_me:$LINENO: checking for main in -lqdbm" >&5 echo $ECHO_N "checking for main in -lqdbm... $ECHO_C" >&6 if test "${ac_cv_lib_qdbm_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lqdbm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_qdbm_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_qdbm_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_qdbm_main" >&5 echo "${ECHO_T}$ac_cv_lib_qdbm_main" >&6 if test $ac_cv_lib_qdbm_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBQDBM 1 _ACEOF LIBS="-lqdbm $LIBS" fi # For libraries of pthreads echo "$as_me:$LINENO: checking for main in -lpthread" >&5 echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6 if test "${ac_cv_lib_pthread_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthread_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6 if test $ac_cv_lib_pthread_main = yes; then MYMTLIBS="-lpthread $MYMTLIBS" fi # For libraries of socket echo "$as_me:$LINENO: checking for main in -lnsl" >&5 echo $ECHO_N "checking for main in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_main" >&6 if test $ac_cv_lib_nsl_main = yes; then MYSKLIBS="-lnsl $MYSKLIBS" fi echo "$as_me:$LINENO: checking for main in -lsocket" >&5 echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5 echo "${ECHO_T}$ac_cv_lib_socket_main" >&6 if test $ac_cv_lib_socket_main = yes; then MYSKLIBS="-lsocket $MYSKLIBS" fi echo "$as_me:$LINENO: checking for main in -lresolv" >&5 echo $ECHO_N "checking for main in -lresolv... $ECHO_C" >&6 if test "${ac_cv_lib_resolv_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_resolv_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_resolv_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_main" >&5 echo "${ECHO_T}$ac_cv_lib_resolv_main" >&6 if test $ac_cv_lib_resolv_main = yes; then MYSKLIBS="-lresolv $MYSKLIBS" fi # For old BSDs if uname -a | grep BSD > /dev/null && test -f /usr/lib/libc_r.a && test ! -f /usr/lib/libpthread.a then LIBS=`printf '%s' "$LIBS" | sed 's/-lc/-lc_r/g'` fi # Set the runtime library path if test "$prefix" != "NONE" then MYRUNPATH="$prefix/lib" fi # Checking the version of QDBM with pkg-config if type pkg-config > /dev/null 2>&1 then printf 'checking the version of QDBM ... ' if pkg-config --atleast-version=1.8.75 qdbm then printf 'ok (%s)\n' `pkg-config --modversion qdbm` MYCPPOPTS="$MYCPPOPTS -I`pkg-config --variable=includedir qdbm`" MYLDOPTS="$MYLDOPTS -L`pkg-config --variable=libdir qdbm`" MYRUNPATH="$MYRUNPATH:`pkg-config --variable=libdir qdbm`" else printf 'no (maybe not installed or too old)\n' fi fi #================================================================ # Generic Settings #================================================================ # Export variables # Targets ac_config_files="$ac_config_files Makefile estconfig hyperestraier.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by hyperestraier $as_me 1.4.13, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ hyperestraier config.status 1.4.13 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "estconfig" ) CONFIG_FILES="$CONFIG_FILES estconfig" ;; "hyperestraier.pc" ) CONFIG_FILES="$CONFIG_FILES hyperestraier.pc" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@LIBVER@,$LIBVER,;t t s,@LIBREV@,$LIBREV,;t t s,@PROTVER@,$PROTVER,;t t s,@MYCFLAGS@,$MYCFLAGS,;t t s,@MYCPPOPTS@,$MYCPPOPTS,;t t s,@MYDEFS@,$MYDEFS,;t t s,@MYLDOPTS@,$MYLDOPTS,;t t s,@MYMTLIBS@,$MYMTLIBS,;t t s,@MYSKLIBS@,$MYSKLIBS,;t t s,@MYAPPLIBS@,$MYAPPLIBS,;t t s,@MYRUNPATH@,$MYRUNPATH,;t t s,@MYPOSTCMD@,$MYPOSTCMD,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi chmod 755 estconfig # Messages printf '#================================================================\n' printf '# Ready to make.\n' printf '#================================================================\n' # END OF FILE hyperestraier-1.4.13/configure.in000066400000000000000000000160741125261632700170140ustar00rootroot00000000000000# Source of configuration for Hyper Estraier #================================================================ # Generic Settings #================================================================ # Targets AC_INIT(hyperestraier, 1.4.13) # Export variables LIBVER=8 LIBREV=38 PROTVER="1.0" MYCFLAGS="-Wall -fPIC -fsigned-char -O3 -fomit-frame-pointer -fforce-addr" MYCPPOPTS="" MYDEFS="-DNDEBUG" MYLDOPTS="" MYMTLIBS="" MYSKLIBS="" MYAPPLIBS="" MYRUNPATH="" MYPOSTCMD="true" # Building paths pathtmp="$PATH" PATH="$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin" PATH="$PATH:/usr/ccs/bin:/usr/ucb:/usr/xpg4/bin:/usr/xpg6/bin:$pathtmp" LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LIBRARY_PATH" LD_LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH" CPATH="$HOME/include:/usr/local/include:$CPATH" PKG_CONFIG_PATH="$HOME/lib/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH if type pkg-config > /dev/null 2>&1 then PATH="$PATH:`pkg-config --variable=bindir qdbm`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" CPATH="$CPATH:`pkg-config --variable=includedir qdbm`" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH fi #================================================================ # Options #================================================================ # Internal variables enables="" stable="no" # Debug mode AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [build for debugging])) if test "$enable_debug" = "yes" then MYCFLAGS="-Wall -ansi -pedantic -fPIC -fsigned-char -g" MYDEFS="" MYLDOPTS="-static" enables="$enables (debug)" stable="yes" fi # Developping mode AC_ARG_ENABLE(devel, AC_HELP_STRING([--enable-devel], [build for development])) if test "$enable_devel" = "yes" then MYCFLAGS="-Wall -ansi -pedantic -fPIC -fsigned-char -g -O2 -pipe" MYDEFS="" MYPOSTCMD="sync ; sync" enables="$enables (devel)" stable="yes" fi # Stable mode AC_ARG_ENABLE(stable, AC_HELP_STRING([--enable-stable], [build for stable release])) if test "$enable_stable" = "yes" then MYCFLAGS="-Wall -ansi -pedantic -fPIC -fsigned-char -O2" enables="$enables (stable)" stable="yes" fi # Profiling mode AC_ARG_ENABLE(profile, AC_HELP_STRING([--enable-profile], [build for profiling])) if test "$enable_profile" = "yes" then MYCFLAGS="-Wall -pedantic -fPIC -fsigned-char -g -pg -O2 -Werror" enables="$enables (profile)" fi # Static mode AC_ARG_ENABLE(static, AC_HELP_STRING([--enable-static], [link statically])) if test "$enable_static" = "yes" then MYLDOPTS="-static" enables="$enables (static)" fi # Enable MeCab morphological analyzer AC_ARG_ENABLE(mecab, AC_HELP_STRING([--enable-mecab], [feature mecab morphological analyzer])) if test "$enable_mecab" = "yes" then MYDEFS="$MYDEFS -D_MYMECAB" MYAPPLIBS="$MYAPPLIBS -lmecab -lstdc++" enables="$enables (mecab)" fi # Disable ZLIB compression AC_ARG_ENABLE(zlib, AC_HELP_STRING([--disable-zlib], [build without ZLIB compression])) if test "$enable_zlib" = "no" then MYDEFS="$MYDEFS -D_MYNOZLIB" enables="$enables (no-zlib)" fi # Enable LZO compression AC_ARG_ENABLE(lzo, AC_HELP_STRING([--enable-lzo], [build with LZO compression])) if test "$enable_lzo" = "yes" then MYDEFS="$MYDEFS -D_MYLZO" enables="$enables (lzo)" fi # Enable BZIP2 compression AC_ARG_ENABLE(bzip, AC_HELP_STRING([--enable-bzip], [build with BZIP2 compression])) if test "$enable_bzip" = "yes" then MYDEFS="$MYDEFS -D_MYBZIP" enables="$enables (bzip)" fi # Enable Vista database AC_ARG_ENABLE(bzip, AC_HELP_STRING([--enable-vista], [build with Vista database])) if test "$enable_vista" = "yes" then MYDEFS="$MYDEFS -D_MYVISTA" enables="$enables (vista)" fi # Messages printf '#================================================================\n' printf '# Configuring Hyper Estraier version %s%s.\n' "$PACKAGE_VERSION" "$enables" printf '#================================================================\n' #================================================================ # Checking Commands and Libraries #================================================================ # C compiler AC_PROG_CC if test "$enable_devel" != "yes" && test "$enable_profile" != "yes" then if uname | egrep -i 'Linux' > /dev/null 2>&1 && test "$stable" != "yes" && uname -m | egrep -i '(x|i)(3|4|5|6|7|8|9)?86' > /dev/null 2>&1 then MYCFLAGS="$MYCFLAGS -minline-all-stringops" fi if uname | egrep -i 'SunOS' > /dev/null 2>&1 then MYCFLAGS="-Wall -fPIC -fsigned-char -O1" fi if uname | egrep -i 'BSD' > /dev/null 2>&1 then MYCFLAGS="-Wall -fPIC -fsigned-char -O1" fi if gcc --version | egrep -i '^2\.(8|9)' > /dev/null 2>&1 then MYCFLAGS="-Wall -fPIC -fsigned-char -O1" fi fi # Underlying libraries AC_CHECK_LIB(c, main) AC_CHECK_LIB(m, main) AC_CHECK_LIB(regex, main) AC_CHECK_LIB(iconv, main) if test "$enable_zlib" != "no" || pkg-config --libs qdbm 2>&1 | grep '\-lz' > /dev/null 2>&1 then AC_CHECK_LIB(z, main) fi if test "$enable_lzo" = "yes" || pkg-config --libs qdbm 2>&1 | grep '\-llzo2' > /dev/null 2>&1 then AC_CHECK_LIB(lzo2, main) fi if test "$enable_bzip" = "yes" || pkg-config --libs qdbm 2>&1 | grep '\-lbz2' > /dev/null 2>&1 then AC_CHECK_LIB(bz2, main) fi AC_CHECK_LIB(qdbm, main) # For libraries of pthreads AC_CHECK_LIB(pthread, main, MYMTLIBS="-lpthread $MYMTLIBS") # For libraries of socket AC_CHECK_LIB(nsl, main, MYSKLIBS="-lnsl $MYSKLIBS") AC_CHECK_LIB(socket, main, MYSKLIBS="-lsocket $MYSKLIBS") AC_CHECK_LIB(resolv, main, MYSKLIBS="-lresolv $MYSKLIBS") # For old BSDs if uname -a | grep BSD > /dev/null && test -f /usr/lib/libc_r.a && test ! -f /usr/lib/libpthread.a then LIBS=`printf '%s' "$LIBS" | sed 's/-lc/-lc_r/g'` fi # Set the runtime library path if test "$prefix" != "NONE" then MYRUNPATH="$prefix/lib" fi # Checking the version of QDBM with pkg-config if type pkg-config > /dev/null 2>&1 then printf 'checking the version of QDBM ... ' if pkg-config --atleast-version=1.8.75 qdbm then printf 'ok (%s)\n' `pkg-config --modversion qdbm` MYCPPOPTS="$MYCPPOPTS -I`pkg-config --variable=includedir qdbm`" MYLDOPTS="$MYLDOPTS -L`pkg-config --variable=libdir qdbm`" MYRUNPATH="$MYRUNPATH:`pkg-config --variable=libdir qdbm`" else printf 'no (maybe not installed or too old)\n' fi fi #================================================================ # Generic Settings #================================================================ # Export variables AC_SUBST(LIBVER) AC_SUBST(LIBREV) AC_SUBST(PROTVER) AC_SUBST(MYCFLAGS) AC_SUBST(MYCPPOPTS) AC_SUBST(MYDEFS) AC_SUBST(MYLDOPTS) AC_SUBST(MYMTLIBS) AC_SUBST(MYSKLIBS) AC_SUBST(MYAPPLIBS) AC_SUBST(MYRUNPATH) AC_SUBST(MYPOSTCMD) AC_SUBST(CPPFLAGS) AC_SUBST(LDFLAGS) # Targets AC_OUTPUT(Makefile estconfig hyperestraier.pc) chmod 755 estconfig # Messages printf '#================================================================\n' printf '# Ready to make.\n' printf '#================================================================\n' # END OF FILE hyperestraier-1.4.13/doc/000077500000000000000000000000001125261632700152405ustar00rootroot00000000000000hyperestraier-1.4.13/doc/cguide-en.html000066400000000000000000000271571125261632700200020ustar00rootroot00000000000000 Crawler Guide of Hyper Estraier Version 1

Crawler Guide

Copyright (C) 2004-2007 Mikio Hirabayashi
Last Update: Tue, 06 Mar 2007 12:05:18 +0900

Table of Contents

  1. Introduction
  2. Tutorial
  3. Crawler Command

Introduction

This guide describes usage of Hyper Estraier's web crawler. If you haven't read user's guide and P2P guide yet, now is a good moment to do so.

estcmd can index files on local file system only. Though files on remote hosts can be indexed by using NFS or SMB remote mount mechanism, unspecified number of web sites on Internet can not be mounted by them. Though such web crawlers as wget can do prefetch of those files, it involves high overhead and wastes much disk space.

The command estwaver is useful to crawl arbitrary web sites and to index their documents directly. estwaver is so intelligent that it supports not only depth first order and width first but also similarity oriented order. It crawls documents similar to specified seed documents preferentially.


Tutorial

First step is creation of the crawler root directory which contains a configuration file and some databases. Following command will create casket, the crawler root directory:

estwaver init casket

By default, the configuration is to start crawling at the project page of Hyper Estraier. Let's try it as it is:

estwaver crawl casket

Then, documents are fetched one after another and they are indexed into the index. To stop the operation, you can press Ctrl-C on terminal.

When the operation finishes, there is a directory _index in the crawler root directory. It is an index which can be treated with estcmd and so on. Let's try to search the index as with the following command:

estcmd search -vs casket/_index "hyper estraier"

If you want to resume the crawling operation, perform estwaver crawl again.


Crawler Command

This section describes specification of estwaver, whose purpose is to index documents on the Web.

Synopsis and Description

estwaver is an aggregation of sub commands. The name of a sub command is specified by the first argument. Other arguments are parsed according to each sub command. The argument rootdir specifies the crawler root directory which contains configuration file and so on.

estwaver init [-apn|-acc] [-xs|-xl|-xh] [-sv|-si|-sa] rootdir
Create the crawler root directory.
If -apn is specified, N-gram analysis is performed against European text also.
If -acc is specified, character category analysis is performed instead of N-gram analysis.
If -xs is specified, the index is tuned to register less than 50000 documents.
If -xl is specified, the index is tuned to register more than 300000 documents.
If -xh is specified, the index is tuned to register more than 1000000 documents.
If -sv is specified, scores are stored as void.
If -si is specified, scores are stored as 32-bit integer.
If -sa is specified, scores are stored as-is and marked not to be tuned when search.
estwaver crawl [-restart|-revisit|-revcont] rootdir
Start crawling.
If -restart is specified, crawling is restarted from the seed documents.
If -revisit is specified, collected documents are revisited.
If -revcont is specified, collected documents are revisited and then crawling is continued.
estwaver unittest rootdir
Perform unit tests.
estwaver fetch [-proxy host port] [-tout num] [-il lang] url
Fetch a document.
url specifies the URL of a document.
-proxy specifies the host name and the port number of the proxy server.
-tout specifies timeout in seconds.
-il specifies the preferred language. By default, it is English.

All sub commands return 0 if the operation is success, else return 1. A running crawler finishes with closing the database when it catches the signal 1 (SIGHUP), 2 (SIGINT), 3 (SIGQUIT), or 15 (SIGTERM).

When crawling finishes, there is a directory _index in the crawler root directory. It is an index available by estcmd and so on.

Constitution of the Crawler Root Directory

The crawler root directory contains the following files and directories.

  • _conf : configuration file.
  • _log : log file.
  • _meta : database file for meta data.
  • _queue : priority queue of URLs to be crawled.
  • _trace/ : tracking records of crawled URLs.
  • _index/ : index directory.
  • _tmp/ : directory for temporary files.

Configuration File

The configuration file is composed of lines and the name of an variable and the value separated by ":" are in each line. By default, the following configuration is there.

seed: 1.5|http://hyperestraier.sourceforge.net/uguide-en.html
seed: 1.0|http://hyperestraier.sourceforge.net/pguide-en.html
seed: 1.0|http://hyperestraier.sourceforge.net/nguide-en.html
seed: 0.0|http://qdbm.sourceforge.net/
proxyhost:
proxyport:
interval: 500
timeout: 30
strategy: 0
inherit: 0.4
seeddepth: 0
maxdepth: 20
masscheck: 500
queuesize: 50000
replace: ^http://127.0.0.1/{{!}}http://localhost/
allowrx: ^http://
denyrx: \.(css|js|csv|tsv|log|md5|crc|conf|ini|inf|lnk|sys|tmp|bak)$
denyrx: \.(zip|tar|tgz|gz|bz2|tbz2|z|lha|lzh)(\?.*)?$
denyrx: ://(localhost|[a-z]*\.localdomain|127\.0\.0\.1)/
noidxrx: /\?[a-z]=[a-z](;|$)
urlrule: \.est${{!}}text/x-estraier-draft
urlrule: \.(eml|mime|mht|mhtml)${{!}}message/rfc822
typerule: ^text/x-estraier-draft${{!}}[DRAFT]
typerule: ^text/plain${{!}}[TEXT]
typerule: ^(text/html|application/xhtml+xml)${{!}}[HTML]
typerule: ^message/rfc822${{!}}[MIME]
language: 0
textlimit: 128
seedkeynum: 256
savekeynum: 32
threadnum: 10
docnum: 10000
period: 10000s
revisit: 7d
cachesize: 256
#nodeserv: 1|http://admin:admin@localhost:1978/node/node1
#nodeserv: 2|http://admin:admin@localhost:1978/node/node2
#nodeserv: 3|http://admin:admin@localhost:1978/node/node3
logfile: _log
loglevel: 2
draftdir:
entitydir:
postproc:

Meaning of each variable is the following.

  • seed : specifies the weight and the URL of a seed document, separated by "|". This can be more than once.
  • proxyhost : specifies the host name of the proxy server.
  • proxyport : specifies the port number of the proxy server.
  • interval : specifies waiting interval of each request (in milliseconds).
  • timeout : specifies timeout of each request (in seconds).
  • strategy : specifies strategy of crawling path (0:balanced, 1:similarity, 2:depth, 3:width, 4:random).
  • inherit : specifies inheritance ratio of similarity from the parent.
  • seeddepth : specifies maximum depth of seed documents.
  • maxdepth : specifies maximum depth of recursion.
  • masscheck : specifies standard value for checking mass sites.
  • queuesize : specifies maximum number of records of the priority queue.
  • replace : specifies regular expressions and replacement strings to normalize URLs. This can be more than once.
  • allowrx : specifies allowing regular expressions of URLs to be visited. This can be more than once.
  • denyrx : specifies denying regular expressions of URLs to be visited. This can be more than once.
  • noidxrx : specifies denying regular expressions of URLs to be indexed. This can be more than once.
  • urlrule : specifies URL rules (regular expressions and media types). This can be more than once.
  • typerule : specifies media type rules (regular expressions and filter commands). This can be more than once.
  • language : specifies the preferred language (0:English, 1:Japanese, 2:Chinese, 3:Korean, 4:misc).
  • textlimit : specifies text size limitation (in kilobytes).
  • seedkeynum : specifies the total number of keywords for seed documents.
  • savekeynum : specifies the number of keywords saved for each document.
  • threadnum : specifies the number of threads running in parallel.
  • docnum : specifies the number of documents to collect.
  • period : specifies running time period (in s:seconds, m:minutes, h:hours, d:days).
  • revisit : specifies revisit span (in s:seconds, m:minutes, h:hours, d:days).
  • cachesize : specifies the maximum size of the index cache (in megabytes).
  • nodeserv : specifies the ID number and the URL of a node server, separated by "|". This can be more than once.
  • logfile : specifies the path of the log file (relative path or absolute path).
  • loglevel : specifies logging level (1:debug, 2:information, 3:warning, 4:error, 5:none).
  • draftdir : specifies the path of the draft directory (relative path or absolute path).
  • entitydir : specifies the path of the entity directory (relative path or absolute path).
  • postproc : the postprocessor for retrieved files.

allowrx, denyrx, and noidxrx are evaluated in the order of description. Alphabetical characters are case-insensitive.

Arbitrary filter commands can be specified with typerule. The interface of filter command is same as with -fx option of estcmd gather. For example, the following specifies to process PDF documents.

typerule: ^application/pdf${{!}}H@/usr/local/share/hyperestraier/filter/estfxpdftohtml

hyperestraier-1.4.13/doc/cguide-ja.html000066400000000000000000001022721125261632700177620ustar00rootroot00000000000000 Crawler Guide of Hyper Estraier Version 1 (Japanese)

繧ッ繝ュ繝シ繝ゥ繧ャ繧、繝

Copyright (C) 2004-2007 Mikio Hirabayashi
Last Update: Tue, 06 Mar 2007 12:05:18 +0900

逶ョ谺。

  1. 縺ッ縺倥a縺ォ
  2. 繝√Η繝シ繝医Μ繧「繝ォ
  3. 繧ッ繝ュ繝シ繝ゥ繧ウ繝槭Φ繝
  4. Web讀懃エ「繧ィ繝ウ繧ク繝ウ縺ョ螳溽樟

縺ッ縺倥a縺ォ

縺薙ョ繧ャ繧、繝峨〒縺ッ縲?yper Estraier縺ョWeb繧ッ繝ュ繝シ繝ゥ縺ョ隧ウ邏ー縺ェ菴ソ縺譁ケ繧定ェャ譏弱@縺セ縺吶繝ヲ繝シ繧カ繧ャ繧、繝縺ィP2P繧ャ繧、繝繧偵∪縺縺願ェュ縺ソ縺ァ縺ェ縺蝣エ蜷医ッ蜈医↓縺昴■繧峨↓逶ョ繧帝壹@縺ヲ縺翫>縺ヲ縺上□縺輔>縲

estcmd縺縺ィ繝ュ繝シ繧ォ繝ォ縺ョ繝輔ぃ繧、繝ォ繧キ繧ケ繝繝荳翫↓縺ゅk譁譖クシ医ヵ繧。繧、繝ォシ峨r蟇セ雎。縺ィ縺励◆繧、繝ウ繝繧ッ繧キ繝ウ繧ー縺励°縺ァ縺阪∪縺帙s縲NFS繧ТMB遲峨r逕ィ縺縺ヲ繝輔ぃ繧、繝ォ繧キ繧ケ繝繝繧偵Μ繝「繝シ繝医槭え繝ウ繝医☆繧後ー蛻・縺ョ繝槭す繝ウ縺ォ縺ゅk譁譖ク繧偵う繝ウ繝繧ッ繧キ繝ウ繧ー縺吶k縺薙→繧ゅ〒縺阪∪縺吶′縲∽ク咲音螳壼ッセ謨ー縺ョWeb繧オ繧、繝医ョ譁譖ク繧呈桶縺翫≧縺ィ縺吶k縺ィ縺昴≧繧ゅ>縺阪∪縺帙s縲wget縺ェ縺ゥ縺ョ繧ッ繝ュ繝シ繝ゥ縺ァ譁譖ク繧帝寔繧√※譚・縺ヲ繝ュ繝シ繧ォ繝ォ縺ォ菫晏ュ倥@縺ヲ縺九i繧、繝ウ繝繧ッ繧キ繝ウ繧ー縺吶k縺薙→繧り縺医i繧後∪縺吶′縲√ョ繧」繧ケ繧ッ螳ケ驥上ョ蝠城。後d譖エ譁ー鬆サ蠎ヲ縺ョ蝠城。後↑縺ゥ縺後≠繧翫∪縺吶

Web荳翫ョ繝ェ繝ウ繧ッ繧定セソ縺」縺ヲ譁譖ク繧貞庶髮縺吶k縺薙→繧淡eb繧ッ繝ュ繝シ繝ェ繝ウ繧ー縺ィ險縺縲√◎縺ョ繝励Ο繧ー繝ゥ繝繧淡eb繧ッ繝ュ繝シ繝ゥ縺ィ險縺縺セ縺吶Hyper Estraier縺ォ莉伜ア槭ョWeb繧ッ繝ュ繝シ繝ゥestwaver繧剃スソ縺縺ィ縲∽ササ諢上ョWeb繧オ繧、繝医ョ譁譖ク繧堤峩謗・逧縺ォ繧、繝ウ繝繝繧ッ繧ケ縺ォ逋サ骭イ縺吶k縺薙→縺後〒縺阪∪縺吶

estwaver縺ッ雉「縺繧ッ繝ュ繝シ繝ゥ縺ァ縺吶よキア縺募━蜈域爾邏「繧蟷蜆ェ蜈域爾邏「縺ョ繧医≧縺ェ蜊倡エ斐↑繧「繝ォ繧エ繝ェ繧コ繝縺ァ縺ェ縺上∵枚譖ク縺ョ蜀螳ケ繧貞愛譁ュ縺励※髢「騾」縺吶k繧ゅョ繧貞━蜈育噪縺ォ霎ソ縺」縺ヲ陦後″縺セ縺吶らィョ譁譖ク縺ィ縺励※謖螳壹@縺滓枚譖ク縺ッ縲∵爾邏「縺ョ襍キ轤ケ縺ォ縺ェ繧九→縺ィ繧ゅ↓縲鬘樔シシ蠎ヲ蛻、螳壹ョ譚先侭縺ォ繧ゅ↑繧翫∪縺吶る。樔シシ讀懃エ「縺ィ蜷後§隕鬆倥〒遞ョ譁譖ク縺ョ繝吶け繝医Ν縺ョ蜥後↓蟇セ縺吶k鬘樔シシ蠎ヲ繧堤ョ怜コ縺励√◎繧後′鬮倥>譁譖ク縺ョ繝ェ繝ウ繧ッ蜈医r蜆ェ蜈育噪縺ォ霎ソ繧翫∪縺吶


繝√Η繝シ繝医Μ繧「繝ォ

estwaver繧ょ、壼スゥ縺ェ讖溯ス繧偵b縺」縺ヲ縺縺セ縺吶′縲∝渕譛ャ逧縺ェ菴ソ縺譁ケ縺ッ蜊倡エ斐〒縺吶ょョ滄圀縺ォ蜍輔°縺励↑縺後i菴ソ縺譁ケ繧定コォ縺ォ縺、縺代※縺縺阪∪縺励g縺縲

蝓コ譛ャ逧縺ェ菴ソ縺譁ケ

繧ッ繝ュ繝シ繝ゥ繧貞虚縺九☆貅門y縺ィ縺励※縲∽サ・荳九ョ繧ウ繝槭Φ繝峨r螳溯。後@縺ヲ繧ッ繝ュ繝シ繝ゥ繝ォ繝シ繝医ョ繧」繝ャ繧ッ繝医Μ繧剃ス懊▲縺ヲ縺上□縺輔>縲ゅけ繝ュ繝シ繝ゥ繝ォ繝シ繝医ョ繧」繝ャ繧ッ繝医Μ縺ィ縺ッ縲√け繝ュ繝シ繝ゥ縺ョ蜍穂ス懊↓蠢隕√↑險ュ螳壹ヵ繧。繧、繝ォ縺ェ縺ゥ繧呈シ邏阪☆繧九ョ繧」繝ャ繧ッ繝医Μ繝繝ェ繝シ縺ョ繝医ャ繝励ョ縺薙→縺ァ縺吶

estwaver init casket

繝繝輔か繝ォ繝医〒縺ッHyper Estraier縺ョ繝帙シ繝繝壹シ繧ク縺ェ縺ゥ繧定オキ轤ケ縺ィ縺励※繧ッ繝ュ繝シ繝ェ繝ウ繧ー繧定。後≧繧医≧縺ォ險ュ螳壹&繧後※縺縺セ縺吶casket/_conf繧堤キィ髮縺吶l縺ー縲∬ィュ螳壹r螟画峩縺吶k縺薙→縺後〒縺阪∪縺吶ゅ→繧翫≠縺医★縺ッseed縺ィ縺縺鬆逶ョ繧堤キィ髮縺励※縲∝キ。蝗槭ョ襍キ轤ケ縺ィ縺ェ繧偽RL縺ォ螂ス縺阪↑繧オ繧、繝医ョURL繧呈欠螳壹@縺ヲ縺上□縺輔>縲ゅ|縲阪ョ蜑阪ョ驛ィ蛻縺ッ鬘樔シシ蠎ヲ蛻、螳壹ョ驥阪∩莉倥¢縺ェ縺ョ縺ァ縺吶′縲√→繧翫≠縺医★縺ッ縲1.0縲阪↓縺励※縺翫¢縺ー繧医>縺ァ縺励g縺縲ゅ↑縺翫√励Ο繧ッ繧キ繧剃スソ繧上↑縺縺ィWeb縺瑚ヲ九i繧後↑縺迺ー蠅縺ァ縺ッ縲proxyhost縺ィproxyport縺ォ繝励Ο繧ッ繧キ縺ョ繝帙せ繝亥錐縺ィ繝昴シ繝育分蜿キ繧定ィュ螳壹☆繧九%縺ィ繧ょソ隕√〒縺吶ゅ∪縺溘∵律譛ャ隱槭ョ繧オ繧、繝医r蜆ェ蜈医@縺ヲ蟾。蝗槭@縺溘>蝣エ蜷医ッlanguage1縺ォ縺吶k縺ィ繧医>縺ァ縺励g縺縲ゆセ九∴縺ー莉・荳九ョ繧医≧縺ォ險ュ螳壹@縺セ縺吶

seed: 1.0|http://www.asahi.com/
seed: 1.0|http://www.yomiuri.co.jp/
seed: 1.0|http://www.mainichi.co.jp/
...
proxyhost: proxy.yourdomain.ad.jp
proxyport: 8080
...
language: 1
...

縺昴l縺ァ縺ッ縲√け繝ュ繝シ繝ゥ繧貞虚縺九@縺ヲ縺ソ縺セ縺励g縺縲ゆサ・荳九ョ繧ウ繝槭Φ繝峨r螳溯。後@縺ヲ縺上□縺輔>縲

estwaver crawl casket

縺吶k縺ィ縲∵枚譖ク縺檎カ壹縺ィ蜿門セ励&繧後※繧、繝ウ繝繝繧ッ繧ケ縺ォ逋サ骭イ縺輔l縺ヲ縺縺阪∪縺吶ょ●豁「縺輔○縺溘>蝣エ蜷医ッ遶ッ譛ォ縺ァCtrl-C繧貞・蜉帙@縺ヲ縺上□縺輔>縲ゅ@縺ー繧峨¥蠕縺、縺ィ蛛懈ュ「縺励∪縺吶

繧ッ繝ュ繝シ繝ェ繝ウ繧ー縺檎オゅ▲縺滓凾縺ォ縺ッ縲√け繝ュ繝シ繝ゥ繝ォ繝シ繝医ョ繧」繝ャ繧ッ繝医Μ縺ョ荳ュ縺ォ_index縺ィ縺縺繝繧」繝ャ繧ッ繝医Μ縺後〒縺阪※縺縺セ縺吶ゅ%繧後′estcmd遲峨〒蛻ゥ逕ィ縺ァ縺阪k繧、繝ウ繝繝繧ッ繧ケ縺ァ縺吶ゆス懈舌&繧後◆繧、繝ウ繝繝繧ッ繧ケ繧剃スソ縺」縺ヲ讀懃エ「繧定。後▲縺ヲ縺ソ縺セ縺励g縺縲

estcmd search -vs casket/_index "hyper estraier"

荳ュ譁ュ縺励◆繧ッ繝ュ繝シ繝ェ繝ウ繧ー繧貞埼幕縺吶k縺ォ縺ッ縲∝阪ウestwaver crawl繧貞ョ溯。後@縺セ縺吶

estwaver crawl casket

-revisit繧ェ繝励す繝ァ繝ウ繧偵▽縺代※estwaver crawl繧貞ョ溯。後☆繧九→縲∵里縺ォ繧、繝ウ繝繝繧ッ繧ケ縺ォ逋サ骭イ縺励◆譁譖ク縺ョ縺ソ繧貞ッセ雎。縺ォ縺励※蜀榊キ。蝗槭r陦後>縲∵峩譁ー縺輔l縺滓枚譖ク繧偵う繝ウ繝繝繧ッ繧ケ縺ォ蜿肴丐縺輔○縺溘j縲∝炎髯、縺輔l縺滓枚譖ク縺ョ諠蝣ア繧偵う繝ウ繝繝繧ッ繧ケ縺九i蜑企勁縺励◆繧翫〒縺阪∪縺吶

estwaver crawl -revisit casket

-revcont繧ェ繝励す繝ァ繝ウ繧偵▽縺代※estwaver crawl繧貞ョ溯。後☆繧九→縲∵里蟄倥ョ譁譖ク縺ョ蜀榊キ。蝗槭r陦後▲縺ヲ縺九i縲∽サ悶ョ譁譖ク縺ョ繧ッ繝ュ繝シ繝ェ繝ウ繧ー繧堤カ夊。後@縺セ縺吶-restart繧ェ繝励す繝ァ繝ウ繧偵▽縺代※estwaver crawl繧貞ョ溯。後☆繧九→縲√け繝ュ繝シ繝ェ繝ウ繧ー繧呈怙蛻昴°繧峨d繧顔峩縺励※縲仝eb荳翫〒譖エ譁ー縺輔l縺滓枚譖ク縺ョ蜀螳ケ繧偵う繝ウ繝繝繧ッ繧ケ縺ォ蜿肴丐縺輔○繧九%縺ィ縺後〒縺阪∪縺吶る壼クク縺ョ驕狗畑縺ァ縺ッ縲-revcont繧ェ繝励す繝ァ繝ウ縺ァ螳壽悄逧縺ォ繧、繝ウ繝繝繧ッ繧ケ繧呈峩譁ー縺吶k縺ョ縺後h縺縺ァ縺励g縺縲

繧、繝ウ繝医Λ繝阪ャ繝医〒縺ョ蛻ゥ逕ィ

莨∵・ュ繧蟄ヲ譬。縺ェ縺ゥ縺ョ繧、繝ウ繝医Λ繝阪ャ繝医〒縺縺上▽縺九ョWeb繧オ繧、繝医r驕句霧縺励※縺繧句エ蜷医↓繧ゅけ繝ュ繝シ繝ゥ繧剃スソ縺」縺ヲ繧、繝ウ繝繧ッ繧キ繝ウ繧ー繧偵☆繧九→萓ソ蛻ゥ縺ァ縺吶ゅう繝ウ繝医Λ繝阪ャ繝医ョ譁譖ク縺九i繧ょ、夜Κシ医う繝ウ繧ソ繝シ繝阪ャ繝茨シ峨∈縺ョ繝ェ繝ウ繧ッ縺悟シオ縺」縺ヲ縺ゅk縺薙→縺瑚縺医i繧後k縺ョ縺ァ縲casket/_conf縺ョallowrx繧堤キィ髮縺励※蟾。蝗槫医r蛻カ髯舌@縺セ縺吶ゆセ九∴縺ー縲estraier.ad.jp繝峨Γ繧、繝ウ縺ョ縺ソ繧貞キ。蝗槭☆繧句エ蜷医ッ莉・荳九ョ繧医≧縺ォ縺励∪縺吶

seed: 1.0|http://www.estraier.ad.jp/
seed: 1.0|http://intra.estraier.ad.jp/
...
allowrx: ^http://[^/]*\.estraier.ad.jp/
...

繝弱シ繝峨し繝シ繝舌∈縺ョ逋サ骭イ

謨ー逋セ荳莉カ莉・荳翫ョ譁譖ク繧貞ッセ雎。縺ォ縺励◆縺蝣エ蜷医ッ縲∝キ。蝗槭@縺滓枚譖ク繧貞ィ縺ヲ蜊倅ク縺ョ繧、繝ウ繝繝繧ッ繧ケ縺ォ逋サ骭イ縺励※縺縺上ョ縺ッ繧ケ繧ア繝シ繝ゥ繝薙Μ繝繧」縺ョ隕ウ轤ケ縺九i迴セ螳溽噪縺ァ縺ッ縺ゅj縺セ縺帙s縲ゅ∪縺溘√け繝ュ繝シ繝ゥ縺悟虚菴懊@縺ヲ縺繧矩俣縺ッ繧、繝ウ繝繝繧ッ繧ケ縺後Ο繝繧ッ縺輔l縺ヲ縺励∪縺縺ィ縺縺谺轤ケ繧ゅ≠繧翫∪縺吶12P讖滓ァ九ョ繝弱シ繝峨し繝シ繝舌↓譁譖ク繧堤匳骭イ縺吶k縺ィ縺昴ョ蝠城。後r隗」豎コ縺ァ縺阪∪縺吶ゅ◎繧後↓縺ッ縲casket/_conf縺ョnodeserv繧堤キィ髮縺励※縲∫匳骭イ蜈医ョ繝弱シ繝峨し繝シ繝舌r謖螳壹@縺セ縺吶ゆセ九∴縺ー縲http://foo.estraier.ad.jp:1978/node/node1縺ィhttp://bar.estraier.ad.jp:1978/node/node2縺ィhttp://baz.estraier.ad.jp:1978/node/node3縺ョ3縺、縺ョ繝弱シ繝峨し繝シ繝舌↓蛻謨」縺励※逋サ骭イ縺吶k蝣エ蜷医ッ縲∽サ・荳九ョ繧医≧縺ォ縺励∪縺吶ゅ|縲阪ョ蜑阪ョ驛ィ蛻縺ッ繝弱シ繝峨し繝シ繝舌↓縺、縺代kID縺ェ縺ョ縺ァ縺吶′縲∝推縲縺後Θ繝九シ繧ッ縺ォ縺ェ繧九h縺縺ォ驕ゥ蠖薙↑逡ェ蜿キ繧呈欠螳壹@縺ヲ縺上□縺輔>縲ゅadmin:admin縲阪ョ驛ィ蛻縺ォ縺ッ繝弱シ繝峨し繝シ繝舌↓謗・邯壹☆繧矩圀縺ョ繝ヲ繝シ繧カ諠蝣ア繧呈欠螳壹@縺ヲ縺上□縺輔>縲

nodeserv: 1|http://admin:admin@foo.estraier.ad.jp:1978/node/node1
nodeserv: 2|http://admin:admin@bar.estraier.ad.jp:1978/node/node2
nodeserv: 3|http://admin:admin@baz.estraier.ad.jp:1978/node/node3

隍謨ー縺ョ繝弱シ繝峨し繝シ繝舌r謖螳壹☆繧九→驕ゥ蠖薙↑莉カ謨ー豈弱↓蛻謨」縺励※逋サ骭イ縺輔l繧九ョ縺ァ縲∵、懃エ「縺吶k髫帙↓縺ッ繝弱シ繝峨し繝シ繝舌ョ繝。繧ソ讀懃エ「讖溯ス繧貞茜逕ィ縺吶k縺薙→縺ォ縺ェ繧翫∪縺吶


繧ッ繝ュ繝シ繝ゥ繧ウ繝槭Φ繝

縺薙%縺ァ縺ッ縲仝eb荳翫ョ譁譖ク繧貞ッセ雎。縺ィ縺励◆繧、繝ウ繝繝繧ッ繧ケ繧剃ス懊k縺溘a縺ョ繧ウ繝槭Φ繝estwaver縺ョ隧ウ邏ー縺ェ莉墓ァ倥r隱ャ譏弱@縺セ縺吶

譖ク蠑

estwaver縺ッ螟壹¥縺ョ繧オ繝悶さ繝槭Φ繝峨ョ髮蜷井ス薙〒縺吶ゅし繝悶さ繝槭Φ繝峨ョ蜷榊燕縺ッ隨ャ1蠑墓焚縺ァ謖螳壹&繧後∪縺吶ゅ◎縺ョ莉悶ョ蠑墓焚縺ッ繧オ繝悶さ繝槭Φ繝峨ョ遞ョ鬘槭↓蠢懊§縺ヲ隗」驥医&繧後∪縺吶rootdir縺ィ縺縺蠑墓焚縺ッ繧ッ繝ュ繝シ繝ゥ繝ォ繝シ繝医ョ繧」繝ャ繧ッ繝医Μ縺ァ縺吶ゅけ繝ュ繝シ繝ゥ繝ォ繝シ繝医ョ繧」繝ャ繧ッ繝医Μ縺ィ縺ッ縲√け繝ュ繝シ繝ゥ縺ョ蜍穂ス懊↓蠢隕√↑險ュ螳壹ヵ繧。繧、繝ォ縺ェ縺ゥ繧呈シ邏阪☆繧九ョ繧」繝ャ繧ッ繝医Μ繝繝ェ繝シ縺ョ繝医ャ繝励ョ縺薙→縺ァ縺吶

estwaver init [-apn|-acc] [-xs|-xl|-xh] [-sv|-si|-sa] rootdir
繧ッ繝ュ繝シ繝ゥ繝ォ繝シ繝医ョ繧」繝ャ繧ッ繝医Μ繧剃ス懈舌@縺セ縺吶
-apn繧偵▽縺代k縺ィ縲∝ィ縺ヲ縺ョ險隱槭rN-gram豕輔〒蜃ヲ逅縺励∪縺吶
-acc繧偵▽縺代k縺ィ縲¨-gram豕輔ョ莉」繧上j縺ォ譁蟄礼ィョ蛻鬘樊ウ輔r蛻ゥ逕ィ縺励∪縺吶
-xs繧偵▽縺代k縺ィ縲50000莉カ譛ェ貅縺ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-xl繧偵▽縺代k縺ィ縲300000莉カ莉・荳翫ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-xh繧偵▽縺代k縺ィ縲1000000莉カ莉・荳翫ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-sv繧偵▽縺代k縺ィ縲√せ繧ウ繧「諠蝣ア繧堤エ譽縺励∪縺吶
-si繧偵▽縺代k縺ィ縲√せ繧ウ繧「諠蝣ア繧32繝薙ャ繝医ョ謨ー蛟、縺ィ縺励※險倬鹸縺励∪縺吶
-sa繧偵▽縺代k縺ィ縲√せ繧ウ繧「諠蝣ア繧偵◎縺ョ縺セ縺セ菫晏ュ倥@縺滉ク翫〒讀懃エ「譎ゅ↓隱ソ謨エ縺輔l縺ェ縺繧医≧縺ォ繝槭シ繧ッ縺励∪縺吶
estwaver crawl [-restart|-revisit|-revcont] rootdir
繧ッ繝ュ繝シ繝ェ繝ウ繧ー繧帝幕蟋九@縺セ縺吶
-restart繧偵▽縺代k縺ィ縲∽サ・蜑阪↓蛛懈ュ「縺励◆迥カ諷九r辟。隕悶@縺ヲ遞ョ譁譖ク縺九i繧ッ繝ュ繝シ繝ェ繝ウ繧ー繧偵d繧顔峩縺励∪縺吶
-revisit繧偵▽縺代k縺ィ縲∽サ・蜑阪↓蜿朱寔縺励◆譁譖ク縺ョ蜀榊叙蠕励ョ縺ソ繧定。後>縺セ縺吶
-revcont繧偵▽縺代k縺ィ縲∽サ・蜑阪↓蜿朱寔縺励◆譁譖ク縺ョ蜀榊叙蠕励r陦後▲縺溷セ後↓繧ッ繝ュ繝シ繝ェ繝ウ繧ー繧堤カ咏カ壹@縺セ縺吶
estwaver unittest rootdir
繝ヲ繝九ャ繝医ユ繧ケ繝医r陦後>縺セ縺吶
estwaver fetch [-proxy host port] [-tout num] [-il lang] url
蜊倅ク縺ョ譁譖ク繧貞叙蠕励@縺セ縺吶
url縺ッ蜿門セ励☆繧区枚譖ク縺ョURL繧呈欠螳壹@縺セ縺吶
-proxy縺ッ繝励Ο繧ッ繧キ縺ョ繝帙せ繝亥錐縺ィ繝昴シ繝育分蜿キ繧呈欠螳壹@縺セ縺吶
-tout縺ッ繧ソ繧、繝繧「繧ヲ繝医ョ譎る俣繧堤ァ貞腰菴阪〒謖螳壹@縺セ縺吶
-il縺ッ譁蟄励さ繝シ繝峨ョ蛻、螳壹〒蜆ェ蜈医&繧後k險隱槭r謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ闍ア隱槭〒縺吶

蜈ィ縺ヲ縺ョ繧オ繝悶さ繝槭Φ繝峨ッ縲∝ヲ逅縺梧ュ」蟶ク縺ォ邨ゆコ縺励◆蝣エ蜷医↓縺ッ0繧偵√◎縺縺ァ縺ェ縺蝣エ蜷医ッ1繧堤オゆコ繧ケ繝繝シ繧ソ繧ケ縺ォ縺励∪縺吶りオキ蜍穂クュ縺ョ繧ッ繝ュ繝シ繝ゥ縺ォ1シSIGHUPシ峨2シSIGINTシ峨3シSIGQUITシ峨15シSIGTERMシ峨ョ縺ゥ繧後°縺ョ繧キ繧ー繝翫Ν繧帝√k縺薙→縺ォ繧医j縲√ョ繝シ繧ソ繝吶シ繧ケ繧帝哩縺倥※豁」蟶ク邨ゆコ縺輔○繧九%縺ィ縺後〒縺阪∪縺吶

繧ッ繝ュ繝シ繝ゥ繝ォ繝シ繝医ョ繧」繝ャ繧ッ繝医Μ縺ョ讒区

繧ッ繝ュ繝シ繝ゥ繝ォ繝シ繝医ョ繧」繝ャ繧ッ繝医Μ縺ッ莉・荳九ョ繝輔ぃ繧、繝ォ繧繝繧」繝ャ繧ッ繝医Μ繧呈シ邏阪@縺ヲ縺縺セ縺吶

  • _conf : 險ュ螳壹ヵ繧。繧、繝ォ縲りゥウ邏ー縺ッ蠕瑚ソー縺励∪縺吶
  • _log : 繝ュ繧ー繝輔ぃ繧、繝ォ縲ゅけ繝ュ繝シ繝ゥ縺ョ繧、繝吶Φ繝医Ο繧ー繧定ィ倬鹸縺励∪縺吶
  • _meta : 繝。繧ソ繝繝シ繧ソ縺ョ繝繝シ繧ソ繝吶シ繧ケ繝輔ぃ繧、繝ォ縲る崎、襍キ蜍暮亟豁「縺ョ繝ュ繝繧ッ讖滓ァ九b蜈シ縺ュ縺セ縺吶
  • _queue : 蟾。蝗槫医ョ繝励Λ繧、繧ェ繝ェ繝繧」繧ュ繝・繝シ縺ョ繝繝シ繧ソ繝吶シ繧ケ繝輔ぃ繧、繝ォ縲
  • _trace/ : 蟾。蝗櫁ィ倬鹸縺ョ繝繝シ繧ソ繝吶シ繧ケ繝繧」繝ャ繧ッ繝医Μ縲
  • _index/ : 繧、繝ウ繝繝繧ッ繧ケ繝繧」繝ャ繧ッ繝医Μ縲
  • _tmp/ : 繝繝ウ繝昴Λ繝ェ繝輔ぃ繧、繝ォ繧貞・繧後k繝繧」繝ャ繧ッ繝医Μ縲

險ュ螳壹ヵ繧。繧、繝ォ

險ュ螳壹ヵ繧。繧、繝ォ縺ッ縲∝、画焚蜷阪→蛟、繧偵:縲阪〒蛹コ蛻縺」縺溷ス「蠑上ョ陦後r荳ヲ縺ケ縺溘b縺ョ縺ァ縺吶ゅョ繝輔か繝ォ繝医〒縺ッ縲∬ィュ螳壹ヵ繧。繧、繝ォ縺ッ莉・荳九ョ繧医≧縺ェ蜀螳ケ縺ォ縺ェ縺」縺ヲ縺縺セ縺吶

seed: 1.5|http://hyperestraier.sourceforge.net/uguide-en.html
seed: 1.0|http://hyperestraier.sourceforge.net/pguide-en.html
seed: 1.0|http://hyperestraier.sourceforge.net/nguide-en.html
seed: 0.0|http://qdbm.sourceforge.net/
proxyhost:
proxyport:
interval: 500
timeout: 30
strategy: 0
inherit: 0.4
seeddepth: 0
maxdepth: 20
masscheck: 500
queuesize: 50000
replace: ^http://127.0.0.1/{{!}}http://localhost/
allowrx: ^http://
denyrx: \.(css|js|csv|tsv|log|md5|crc|conf|ini|inf|lnk|sys|tmp|bak)$
denyrx: \.(zip|tar|tgz|gz|bz2|tbz2|z|lha|lzh)(\?.*)?$
denyrx: ://(localhost|[a-z]*\.localdomain|127\.0\.0\.1)/
noidxrx: /\?[a-z]=[a-z](;|$)
urlrule: \.est${{!}}text/x-estraier-draft
urlrule: \.(eml|mime|mht|mhtml)${{!}}message/rfc822
typerule: ^text/x-estraier-draft${{!}}[DRAFT]
typerule: ^text/plain${{!}}[TEXT]
typerule: ^(text/html|application/xhtml+xml)${{!}}[HTML]
typerule: ^message/rfc822${{!}}[MIME]
language: 0
textlimit: 128
seedkeynum: 256
savekeynum: 32
threadnum: 10
docnum: 10000
period: 10000s
revisit: 7d
cachesize: 256
#nodeserv: 1|http://admin:admin@localhost:1978/node/node1
#nodeserv: 2|http://admin:admin@localhost:1978/node/node2
#nodeserv: 3|http://admin:admin@localhost:1978/node/node3
logfile: _log
loglevel: 2
draftdir:
entitydir:
postproc:

縺昴l縺槭l縺ョ螟画焚縺ョ讖溯ス繧剃サ・荳九↓遉コ縺励∪縺吶

  • seed : 遞ョ譁譖ク縺ョ驥阪∩莉倥¢縺ィURL繧偵|縲阪〒蛹コ蛻縺」縺ヲ謖螳壹@縺セ縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • proxyhost : 繝励Ο繧ッ繧キ繧オ繝シ繝舌ョ繝帙せ繝亥錐繧呈欠螳壹@縺セ縺吶
  • proxyport : 繝励Ο繧ッ繧キ繧オ繝シ繝舌ョ繝昴シ繝育分蜿キ繧呈欠螳壹@縺セ縺吶
  • interval : 蜷譁譖ク繧貞叙蠕励☆繧矩圀縺ョ蠕縺。譎る俣繧偵Α繝ェ遘貞腰菴阪〒謖螳壹@縺セ縺吶
  • timeout : 蜷譁譖ク繧貞叙蠕励☆繧矩圀縺ョ繧ソ繧、繝繧「繧ヲ繝医ョ譎る俣繧堤ァ貞腰菴阪〒謖螳壹@縺セ縺吶
  • strategy : 繝ェ繝ウ繧ッ繧貞キ。蝗槭☆繧区婿驥昴r謖螳壹@縺セ縺吶0縺ェ繧峨ヰ繝ゥ繝ウ繧ケ謌ヲ逡・縲1縺ェ繧画キア縺暮。樔シシ蠎ヲ蜆ェ蜈域姶逡・縲2縺ェ繧画キア縺募━蜈域姶逡・縲3縺ェ繧牙ケ蜆ェ蜈域姶逡・縲4縺ェ繧臥┌菴懃ぜ謌ヲ逡・縺ァ縺吶
  • inherit : 繝ェ繝ウ繧ッ蜈縺九i邯呎価縺吶k鬘樔シシ蠎ヲ縺ョ蜑イ蜷医r謖螳壹@縺セ縺吶
  • seeddepth : 遞ョ譁譖ク縺ョ豺ア縺輔r謖螳壹@縺セ縺吶
  • maxdepth : 繝ェ繝ウ繧ッ繧定セソ繧区キア縺輔ョ蛻カ髯舌r謖螳壹@縺セ縺吶
  • masscheck : 繧オ繧、繝医∈縺ョ雋闕キ髮荳ュ繧貞愛螳壹☆繧矩圀縺ョ蝓コ貅悶→縺ェ繧玖ィェ蝠乗焚繧呈欠螳壹@縺セ縺吶
  • queuesize : 蜆ェ蜈亥コヲ莉倥″蠕縺。陦悟励ョ譛螟ァ繝ャ繧ウ繝シ繝画焚繧呈欠螳壹@縺セ縺吶
  • replace : URL繧呈ュ」隕丞喧縺吶k縺溘a縺ョ豁」隕剰。ィ迴セ縺ィ鄂ョ謠帶枚蟄怜励r謖螳壹@縺セ縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • allowrx : 險ェ蝠上☆繧九%縺ィ繧定ィア蜿ッ縺吶kURL繧呈ュ」隕剰。ィ迴セ縺ァ謖螳壹@縺セ縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • denyrx : 險ェ蝠上☆繧九%縺ィ繧堤ヲ∵ュ「縺吶kURL繧呈ュ」隕剰。ィ迴セ縺ァ謖螳壹@縺セ縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • noidxrx : 險ェ蝠上☆繧九′逋サ骭イ縺励↑縺ФRL繧呈ュ」隕剰。ィ迴セ縺ァ謖螳壹@縺セ縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • urlrule : URL縺ョ豁」隕剰。ィ迴セ縺ィ縺昴l縺ォ蟇セ蠢懊☆繧九Γ繝繧」繧「繧ソ繧、繝励r謖螳壹@縺セ縺吶ゅ%縺ョ隕丞援縺ッContent-Type繝倥ャ繝繧医j繧ょ━蜈医&繧後∪縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • typerule : 繝。繝繧」繧「繧ソ繧、繝励→縺昴l縺ォ蟇セ蠢懊☆繧九ヵ繧」繝ォ繧ソ繧呈欠螳壹@縺セ縺吶ゅΓ繝繧」繧「繧ソ繧、繝励ッ豁」隕剰。ィ迴セ縺ァ謖螳壹@縲√ヵ繧」繝ォ繧ソ縺ッ譁譖ク繝峨Λ繝輔ヨ逕ィ縺ェ繧峨[DRAFT]縲阪→縺励√励Ξ繝シ繝ウ繝繧ュ繧ケ繝育畑縺ェ繧峨[TEXT]縲阪→縺励?TML逕ィ縺ェ繧峨[HTML]縲阪→縺励`IME逕ィ縺ェ繧峨[MIME]縲阪→縺励∪縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • language : 螂ス縺セ縺励>險隱槭r謖螳壹@縺セ縺吶0縺ェ繧芽恭隱槭1縺ェ繧画律譛ャ隱槭2縺ェ繧我クュ蝗ス隱槭3縺ェ繧蛾沒蝗ス隱槭4縺ェ繧画悴謖螳壹〒縺吶
  • seedkeynum : 遞ョ譁譖ク縺九i謚ス蜃コ縺吶k繧ュ繝シ繝ッ繝シ繝峨ョ邱乗焚繧呈欠螳壹@縺セ縺吶
  • savekeynum : 逋サ骭イ譁譖ク縺ョ蜷縲縺ァ菫晏ュ倥☆繧九く繝シ繝ッ繝シ繝峨ョ邱乗焚繧呈欠螳壹@縺セ縺吶
  • threadnum : 荳ヲ蛻怜ョ溯。後☆繧九せ繝ャ繝繝峨ョ謨ー繧呈欠螳壹@縺セ縺吶
  • docnum : 蜿門セ励☆繧区枚譖ク縺ョ邱乗焚繧呈欠螳壹@縺セ縺吶
  • period : 蜍穂ス懈凾髢薙r謖螳壹@縺セ縺吶ゅ茎縲阪r謗・蟆セ縺輔○繧九→遘貞腰菴阪√稽縲阪r謗・蟆セ縺輔○繧九→蛻蜊倅ス阪√敬縲阪r謗・蟆セ縺輔○繧九→譎ょ腰菴阪√慧縲阪r謗・蟆セ縺輔○繧九→譌・蜊倅ス阪↓縺ェ繧翫∪縺吶
  • revisit : 蜀崎ィェ蝠上ョ譛滄俣繧呈欠螳壹@縺セ縺吶ゅ茎縲阪r謗・蟆セ縺輔○繧九→遘貞腰菴阪√稽縲阪r謗・蟆セ縺輔○繧九→蛻蜊倅ス阪√敬縲阪r謗・蟆セ縺輔○繧九→譎ょ腰菴阪√慧縲阪r謗・蟆セ縺輔○繧九→譌・蜊倅ス阪↓縺ェ繧翫∪縺吶
  • cachesize : 繧、繝ウ繝繝繧ッ繧ケ逕ィ繧ュ繝」繝繧キ繝・縺ョ繧オ繧、繧コ繧偵Γ繧ャ繝舌う繝亥腰菴阪〒謖螳壹@縺セ縺吶
  • nodeserv : 逋サ骭イ蜈医ョ繝弱シ繝峨し繝シ繝舌r謖螳壹@縺セ縺吶ID縺ィURL繧偵|縲阪〒蛹コ蛻縺」縺ヲ謖螳壹@縺セ縺吶りェ崎ィシ諠蝣ア縺ッ繝帙せ繝亥錐縺ョ蜑阪↓縲name:pass@縲阪ョ蠖「蠑上〒險倩ソー縺励∪縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • logfile : 繝ュ繧ー繝輔ぃ繧、繝ォ縺ョ蜷榊燕繧呈欠螳壹@縺セ縺吶らオカ蟇セ繝代せ縺狗嶌蟇セ繝代せ縺ァ謖螳壹@縺セ縺吶
  • loglevel : 繝ュ繧ー縺ョ繝ャ繝吶Ν繧呈欠螳壹@縺セ縺吶1縺ェ繧峨ョ繝舌ャ繧ー縲2縺ェ繧蛾壼クク縲3縺ェ繧芽ュヲ蜻翫4縺ェ繧峨お繝ゥ繝シ縲5縺ェ繧臥┌縺励〒縺吶
  • draftdir : 蜿門セ励@縺滓枚譖ク縺ョ譁譖ク繝峨Λ繝輔ヨ繧剃ソ晏ュ倥☆繧九ョ繧」繝ャ繧ッ繝医Μ繧呈欠螳壹@縺セ縺吶らオカ蟇セ繝代せ縺狗嶌蟇セ繝代せ縺ァ謖螳壹@縺セ縺吶
  • entitydir : 蜿門セ励@縺滓枚譖ク縺ョ螳滉ス薙ョ繝シ繧ソ繧剃ソ晏ュ倥☆繧九ョ繧」繝ャ繧ッ繝医Μ繧呈欠螳壹@縺セ縺吶らオカ蟇セ繝代せ縺狗嶌蟇セ繝代せ縺ァ謖螳壹@縺セ縺吶
  • postproc : 蜿門セ励@縺滓枚譖ク縺ョ繝繝シ繧ソ縺ォ蟇セ縺吶k蠕悟ヲ逅縺ョ繧ウ繝槭Φ繝峨r謖螳壹@縺セ縺吶

allowrx縺ィdenyrx縺ィnoidxrx縺ッ險倩ソー縺励◆鬆逡ェ縺ォ隗」驥医&繧後∪縺吶ゅ∪縺溘∵ュ」隕剰。ィ迴セ縺ォ縺翫¢繧玖恭蟄励ョ螟ァ譁蟄励→蟆乗枚蟄励ッ蛹コ蛻・縺輔l縺セ縺帙s縲

蟾。蝗樊姶逡・

險ュ螳壹ヵ繧。繧、繝ォ縺ョstrategy縺ィ縺縺鬆逶ョ縺ァ縺ッ縲√Μ繝ウ繧ッ繧貞キ。蝗槭☆繧矩圀縺ョ謌ヲ逡・繧呈欠螳壹☆繧九%縺ィ縺後〒縺阪∪縺吶ゅヰ繝ゥ繝ウ繧ケ謌ヲ逡・縲∵キア縺募━蜈域姶逡・縲∝ケ蜆ェ蜈域姶逡・縲鬘樔シシ蠎ヲ蜆ェ蜈域姶逡・縺九i驕ク縺カ縺薙→縺後〒縺阪∪縺吶

繝舌Λ繝ウ繧ケ謌ヲ逡・縺ァ縺ッ縲仝eb繧ッ繝ュ繝シ繝ゥ縺ィ縺励※譛繧る←蛻縺ァ縺ゅm縺縺ィ縺縺謖ッ闊槭>繧偵@縺セ縺吶る。樔シシ蠎ヲ蜆ェ蜈医r繝吶シ繧ケ縺ォ縲∝、壽焚縺ョ繧オ繧、繝医°繧臥ィョ譁譖ク縺ョ蜀螳ケ縺ォ霑代>譁譖ク繧貞柑邇濶ッ縺城寔繧√i繧後k繧医≧縺ォ隱ソ謨エ繧偵@縺セ縺吶ゅヶ繝ュ繧ー遲峨ョ繧オ繧、繝亥繝ェ繝ウ繧ッ縺ォ謐輔i繧上l縺ヲ蜷後§繧医≧縺ェ譁譖ク縺ー縺九j髮繧√◆繧顔音螳壹ョ繧オ繧、繝医↓鬮倥>縺ォ雋闕キ繧剃ク弱∴縺溘j縺励↑縺繧医≧縺ォ縲∽サ悶ョ繧オ繧、繝医∈縺ョ繝ェ繝ウ繧ッ縺ォ遘サ蜍輔@繧縺吶>繧医≧縺ォ縺励∪縺吶る。樔シシ蠎ヲ蜆ェ蜈域姶逡・縺ッ縲√◎縺ョ繧医≧縺ェ隱ソ謨エ繧偵@縺ェ縺縺ァ鬘樔シシ蠎ヲ縺ョ縺ソ縺ァ蟾。蝗槫医r豎コ螳壹@縺セ縺吶

豺ア縺募━蜈域姶逡・縺ィ蟷蜆ェ蜈域姶逡・縺ッ縲∽ク闊ャ逧縺ェ繝繝ェ繝シ讒矩縺ョ謗「邏「繧「繝ォ繧エ繝ェ繧コ繝縺ィ縺励※縺ョ豺ア縺募━蜈域爾邏「繧蟷蜆ェ蜈域爾邏「縺ィ縺サ縺シ蜷後§謖ッ闊槭>繧偵@縺セ縺吶よキア縺募━蜈医ッ繝。繝「繝ェ菴ソ逕ィ驥上r謚代∴繧峨l繧九→縺縺蛻ゥ轤ケ縺後≠繧翫∪縺吶′縲√ヶ繝ュ繧ー遲峨ョ繧オ繧、繝亥繝ェ繝ウ繧ッ縺ォ謐輔i繧上l繧句庄閭ス諤ァ縺碁ォ倥>縺ョ縺ァ縲∽ク咲音螳壼、壽焚縺ョ繧オ繧、繝医r蟾。蝗槭☆繧狗畑騾斐↓縺ッ蜷代″縺セ縺帙s縲ょケ蜆ェ蜈域爾邏「縺ッ螟壽ァ倥↑繧オ繧、繝医°繧画枚譖ク繧帝寔繧√i繧後k縺ィ縺縺蛻ゥ轤ケ縺後≠繧翫∪縺吶′縲∝キ。蝗槭☆繧狗ッ蝗イ縺後≠縺セ繧翫↓蠎縺上↑繧九ョ縺ァ縲√%繧後b荳咲音螳壼、壽焚縺ョ繧オ繧、繝医r蟾。蝗槭☆繧狗畑騾斐↓縺ッ蜷代″縺セ縺帙s縲ら┌菴懃ぜ謌ヲ逡・縺ッ蟾。蝗槫医ョ蜆ェ蜈亥コヲ繧堤┌菴懃ぜ縺ォ豎コ螳壹☆繧九ョ縺ァ迚ケ螳壹ョ繧オ繧、繝医↓雋闕キ縺碁寔荳ュ縺励↓縺上>縺ィ縺縺蛻ゥ轤ケ縺後≠繧翫∪縺吶′縲∝ケ蜆ェ蜈域爾邏「縺ィ蜷後§谺轤ケ縺後≠繧翫∪縺吶ゅ↑縺翫√槭Ν繝√せ繝ャ繝繝峨〒蜍輔¥縺ョ縺ァ縲∵キア縺募━蜈域姶逡・縺ッ螳悟ィ縺ェ豺ア縺募━蜈域爾邏「縺ォ縺ッ縺ェ繧峨★縲√せ繝ャ繝繝画焚縺ョ蛻縺縺大ケ縺悟コ縺ヲ譚・縺セ縺吶ょョ悟ィ縺ェ豺ア縺募━蜈域爾邏「繧偵@縺溘>蝣エ蜷医ッ繧ケ繝ャ繝繝画焚繧1縺ォ縺励※縺上□縺輔>縲

迚ケ螳壹ョ繧オ繧、繝医ョ譁譖ク繧貞ィ縺ヲ髮繧√k縺ェ繧峨ー縲√←縺ョ謌ヲ逡・繧剃スソ縺」縺ヲ繧らオ先棡縺ッ蜷後§縺ァ縺吶ゅ→縺ッ縺縺医√Γ繝「繝ェ菴ソ逕ィ驥上r謚代∴縺溘>縺ェ繧峨ー豺ア縺募━蜈域姶逡・繧剃スソ縺縲√ヶ繝ュ繧ー遲峨ョWeb繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺後≠繧句エ蜷医↓蛯吶∴繧九↑繧峨ー蟷蜆ェ蜈域姶逡・縺狗┌菴懃ぜ謌ヲ逡・繧剃スソ縺縺ィ繧医>縺ァ縺励g縺縲

縺ゅk繧オ繧、繝医↓髢「騾」縺吶k譁譖ク繧帝寔繧√◆縺蝣エ蜷医↓縲√◎縺ョ繧オ繧、繝医ョ蜈ィ縺ヲ縺ョ繝壹シ繧ク繧呈欠螳壹☆繧九ョ縺碁擇蛟偵↑蝣エ蜷医ッ縲∬ィュ螳壹ヵ繧。繧、繝ォ縺ョseeddepth縺ョ蛟、繧貞「励d縺吶→萓ソ蛻ゥ縺ァ縺吶seed縺ォ謖螳壹@縺欟RL縺九i縺ョ謖螳壹@縺溘帙ャ繝玲焚莉・蜀縺ァ蛻ー驕斐〒縺阪k譁譖ク縺悟ィ縺ヲ遞ョ譁譖ク縺ォ縺ェ繧翫∪縺吶

繝輔ぅ繝ォ繧ソ繝励Ο繧ー繝ゥ繝

typerule縺ァ縺ッ縲√{{!}}縲阪ョ蠕後↓莉サ諢上ョ繝輔ぅ繝ォ繧ソ繝励Ο繧ー繝ゥ繝縺ョ繧ウ繝槭Φ繝峨r譖ク縺上%縺ィ縺後〒縺阪∪縺吶ゅヵ繧」繝ォ繧ソ繝励Ο繧ー繝ゥ繝縺ョ莉墓ァ倥ッestcmd gather縺ョ縲-fx縲阪が繝励す繝ァ繝ウ縺ィ蜷後§縺ァ縲∫ャャ1蠑墓焚縺ォ蟇セ雎。譁譖ク縺ョ繝代せ縲∫ャャ2蠑墓焚縺ォ蜃コ蜉帛医ョ繝代せ縺梧ク。縺輔l縺ヲ蜻シ縺ウ蜃コ縺輔l縺セ縺吶ゆセ九∴縺ーPDF譁譖ク繧貞ヲ逅縺吶k縺ォ縺ッ莉・荳九ョ繧医≧縺ォ謖螳壹@縺セ縺吶

typerule: ^application/pdf${{!}}H@/usr/local/share/hyperestraier/filter/estfxpdftohtml

繝輔ぃ繧、繝ォ縺ョ菫晏ュ倥→蠕悟ヲ逅

險ュ螳壹ヵ繧。繧、繝ォ縺ョdraftdirentitydir縺ィ縺縺鬆逶ョ繧呈欠螳壹@縺溷エ蜷医√け繝ュ繝シ繝ゥ縺悟叙蠕励@縺滓枚譖ク縺ョ譁譖ク繝峨Λ繝輔ヨ繧螳滉ス薙ョ繝シ繧ソ縺ョ繝輔ぃ繧、繝ォ繧偵◎縺ョ繝繧」繝ャ繧ッ繝医Μ縺御ソ晏ュ倥&繧後∪縺吶ゅ&繧峨↓縲postproc繧呈欠螳壹☆繧九→縲∝九縺ョ譁譖ク繧貞叙蠕励☆繧句コヲ縺ォ縲∵欠螳壹@縺溘さ繝槭Φ繝峨′蜻シ縺ウ蜃コ縺励※蠕悟ヲ逅繧定。後≧縺薙→縺後l縺セ縺吶らャャ1蠑墓焚縺ォ縺ッ菫晏ュ倥@縺滓枚譖ク繝峨Λ繝輔ヨ縺ョ繝輔ぃ繧、繝ォ縺ョ繝代せ縺後∫ャャ2蠑墓焚縺ォ縺ッ菫晏ュ倥@縺溷ョ滉ス薙ョ繝シ繧ソ縺ョ繝輔ぃ繧、繝ォ縺ョ繝代せ縺梧ク。縺輔l縺セ縺吶draftdirentitydir繧呈欠螳壹@縺ェ縺縺ァpostproc縺ョ縺ソ繧呈欠螳壹@縺溷エ蜷医√ユ繝ウ繝昴Λ繝ェ繝輔ぃ繧、繝ォ縺御ス懈舌&繧後※縺昴ョ繝代せ縺悟シ墓焚縺ィ縺励※貂。縺輔l縺セ縺吶

萓九∴縺ー縲∝叙蠕励@縺滓枚譖ク繧偵Γ繝シ繝ォ縺ァ騾∽ソ。縺吶k縺ォ縺ッ縲∽サ・荳九ョ繧医≧縺ェ繧キ繧ァ繝ォ繧ケ繧ッ繝ェ繝励ヨ繧剃ス懊▲縺ヲ縲√◎縺ョ繧ウ繝槭Φ繝牙錐繧postproc縺ォ謖螳壹@縺セ縺吶

#! /bin/sh
address="mikio@estraier.ad.jp"
url=`sed -n -e '/^@uri/ s/^@uri=// p' "$1"`
uuencode "$2" entity.dat | mail -s "[estwaver] $url" "$address"

驕ゥ蠖薙↑蠕悟ヲ逅縺ョ繧ウ繝槭Φ繝峨r逕ィ縺繧後ー縲estwaver繧辿yper Estraier莉・螟悶ョ讀懃エ「繧キ繧ケ繝繝縺ョ蜿朱寔繧ィ繝シ繧ク繧ァ繝ウ繝医→縺励※逕ィ縺繧九%縺ィ縺後〒縺阪∪縺吶よ枚譖ク邂。逅繧キ繧ケ繝繝縺ョ繝輔Ο繝ウ繝医お繝ウ繝峨→縺励※菴ソ縺」縺ヲ繧ゅh縺縺ァ縺励g縺縲ょセ悟ヲ逅縺ョ縺ソ繧定。後▲縺ヲHyper Estraier縺ョ繧、繝ウ繝繝繧ッ繧ケ縺ォ譁譖ク繧貞・繧後k蠢隕√′縺ェ縺蝣エ蜷医ッ縲∬ィュ螳壹ヵ繧。繧、繝ォ縺ョnoidx縺ョ蛟、繧^http://縺ェ縺ゥ縺ィ縺励※縺上□縺輔>縲


Web讀懃エ「繧ィ繝ウ繧ク繝ウ縺ョ螳溽樟

Hyper Estraier縺ョ繝槭ル繝・繧「繝ォ鄒、繧偵%縺薙∪縺ァ隱ュ縺ソ騾イ繧√※縺上l縺溘≠縺ェ縺溘ッ蛛峨>シ 縺、縺縺ォWeb讀懃エ「繧ィ繝ウ繧ク繝ウ繧呈ァ狗ッ峨☆繧区凾縺梧擂縺セ縺励◆縲りェー縺ァ繧りェ蛻縺ョWeb讀懃エ「繧ィ繝ウ繧ク繝ウ繧呈戟縺ヲ繧九h縺縺ォ縺吶k縺ィ縺縺縲?yper Estraier縺ョ逶ョ讓吶′縺薙%縺ォ邨仙ョ溘@縺セ縺吶ゅ%縺薙〒縺ッ縺昴ョ縺溘a縺ョ繝弱え繝上え繧定ェャ譏弱@縺セ縺吶

繧、繝ウ繝繝繧ッ繧ケ逕ィ繝弱シ繝峨し繝シ繝舌ョ貅門y

縺セ縺壹ッ縲√う繝ウ繝繝繧ッ繧ケ繧堤ョ。逅縺吶k繝弱シ繝峨し繝シ繝舌r讒狗ッ峨@縺セ縺吶ゅ〒縺阪k縺縺大、ァ驥上ョ譁譖ク繧偵〒縺阪k縺縺鷹ォ倬溘↓讀懃エ「縺吶k縺ォ縺ッ縲√〒縺阪k縺縺大、壹¥縺ョ繧ウ繝ウ繝斐Η繝シ繧ソ縺ァ蛻謨」蜃ヲ逅繧偵&縺帙◆譁ケ縺梧怏蛻ゥ縺ェ縺ョ縺ッ險縺縺セ縺ァ繧ゅ≠繧翫∪縺帙s縺後√→繧翫≠縺医★縺ッPC1蜿ー縺ァ繧8eb讀懃エ「繧ィ繝ウ繧ク繝ウ縺ッ螳溽樟縺ァ縺阪∪縺吶

PC1蜿ー縺ァ驕狗畑縺吶k蝣エ蜷医↓繧ゅ∬、謨ー縺ョ繝弱シ繝峨し繝シ繝舌r逕ィ縺縺滓婿縺後う繝ウ繝繧ッ繧キ繝ウ繧ー縺ョ蜉ケ邇縺後h縺上↑繧翫∪縺吶ゅ∪縺溘∝九縺ョ繝弱シ繝峨し繝シ繝舌ッ蛻・縲縺ョ繝弱シ繝峨槭せ繧ソ荳翫〒蜍輔°縺励◆譁ケ縺悟柑邇縺後h縺上↑繧翫∪縺吶ゅ◎縺ョ逅逕ア縺ッ縲√槭Ν繝√励Ο繧サ繝繧オ繧繝槭Ν繝√さ繧「繝励Ο繧サ繝繧オ縺ョ諱ゥ諱オ縺悟女縺代d縺吶¥縺ェ繧九%縺ィ縺ィ縲√≠繧九ヮ繝シ繝峨し繝シ繝舌′繧ュ繝」繝繧キ繝・繧偵ヵ繝ゥ繝繧キ繝・縺励※縺繧矩俣縺ォ蛻・縺ョ繝弱シ繝峨し繝シ繝舌↓逋サ骭イ蜈医r蜑イ繧頑険縺」縺ヲ蜃ヲ逅騾溷コヲ縺ョ菴惹ク九r謚第ュ「縺ァ縺阪k縺薙→縺ァ縺吶

縺薙%縺ァ縺ッ縲√ortho.estraier.ad.jp縲阪para.estraier.ad.jp縲阪meta.estraier.ad.jp縲阪→縺縺3蜿ー縺ョPC繧呈園譛峨@縺ヲ縺繧九%縺ィ繧呈Φ螳壹@縺セ縺吶ゅ◎繧後◇繧1GB縺ョ螳溘Γ繝「繝ェ繧呈政霈峨@縺ヲ縺繧九→縺励∪縺吶ゅ◎繧後◇繧後↓1縺、縺壹▽繝弱シ繝峨槭せ繧ソ縺ィ繝弱シ繝峨し繝シ繝舌r驟咲スョ縺吶k縺薙→縺ォ縺励∪縺励g縺縲ゆサ・荳九↓菴懈・ュ萓九r遉コ縺励∪縺吶′縲orthoparameta縺ァ蜷梧ァ倥ョ菴懈・ュ繧偵@縺ヲ縺上□縺輔>縲

mkdir -p /home/mikio/var
cd /home/mikio/var
estmaster init master

驕ゥ蠖薙↑繧ィ繝繧」繧ソ縺ァ/home/mikio/var/master/_conf繧帝幕縺縺ヲ縲cachesize縺ョ蛟、繧512縺ォ縺励※縺上□縺輔>縲ょョ溘Γ繝「繝ェ縺ョ謳ュ霈蛾上′1GB縺ェ繧峨ー縲√◎縺ョ蜊雁縺上i縺縺ョ螳ケ驥上ョ繧ュ繝」繝繧キ繝・繧剃スソ縺縺ョ縺梧悍縺セ縺励>縺ァ縺吶

繝弱シ繝峨槭せ繧ソ繧偵ョ繝シ繝「繝ウ縺ィ縺励※襍キ蜍輔@縺セ縺吶

estmaster start -bg master

繝弱シ繝峨槭せ繧ソ縺ョUIシWeb繝悶Λ繧ヲ繧カ縺ァhttp://ortho.estraier.ad.jp:1978/master_ui縺ェ縺ゥ縺ォ謗・邯夲シ峨r菴ソ縺」縺ヲ縲∫ョ。逅閠繝ヲ繝シ繧カ繧定ィュ螳壹@縺セ縺吶ゅ%縺薙〒縺ッ繝ヲ繝シ繧カ蜷阪′縲mikio縲阪〒縲√ヱ繧ケ繝ッ繝シ繝峨′縲oikim縲阪→縺縺縺薙→縺ォ縺励∪縺吶ゅ∪縺溘√ヮ繝シ繝峨し繝シ繝舌r菴懊j縺セ縺吶ゅ%縺薙〒縺ッ蜷榊燕繧偵child縲阪→縺励√Λ繝吶Ν縺ッ繝帙せ繝亥錐繧偵▽縺代k縺薙→縺ォ縺励∪縺吶

繝。繧ソ讀懃エ「逕ィ繝弱シ繝峨し繝シ繝舌ョ貅門y

orthoparameta縺ョ蜷繝帙せ繝医↓繝弱シ繝峨し繝シ繝舌r讒狗ッ峨@縺溘i縲√◎繧後i縺ォ繝。繧ソ讀懃エ「繧偵☆繧九◆繧√ョ隕ェ繝弱シ繝峨r蛻・縺ォ菴懊j縺セ縺吶ゅ%縺薙〒縺ッortho縺ョ繝弱シ繝峨槭せ繧ソ縺ォ菴懊k縺薙→縺ォ縺励※縲∝錐蜑阪ッ縲parent縲阪〒繝ゥ繝吶Ν縺ッ縲estraier.ad.jp縲阪r縺、縺代k縺薙→縺ォ縺励∪縺吶

隕ェ繝弱シ繝峨°繧牙推縲縺ョ蟄舌ヮ繝シ繝峨↓繝ェ繝ウ繧ッ繧貞シオ繧翫∪縺吶ゅ%縺ョ菴懈・ュ縺ッ縺ゥ縺ョ繝帙せ繝井ク翫〒陦後▲縺ヲ繧よァ九>縺セ縺帙s縲

estcall setlink -auth mikio oikim http://ortho.estraier.ad.jp:1978/node/parent \
  http://ortho.estraier.ad.jp:1978/node/child ortho 10000
estcall setlink -auth mikio oikim http://ortho.estraier.ad.jp:1978/node/parent \
  http://para.estraier.ad.jp:1978/node/child para 10000
estcall setlink -auth mikio oikim http://ortho.estraier.ad.jp:1978/node/parent \
  http://meta.estraier.ad.jp:1978/node/child meta 10000

縺縺セ縺剰ィュ鄂ョ縺ァ縺阪※縺繧九°遒コ隱阪☆繧九◆繧√↓縲∬ヲェ繝弱シ繝峨ョ讀懃エ「逕ィ繝ヲ繝シ繧カ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケシhttp://ortho.estraier.ad.jp:1978/node/parent/master_uiシ峨↓謗・邯壹@縺ヲ縺上□縺輔>縲ゅ◎縺薙〒縲√link#1: ortho縲阪link#2: para縲阪link#3: meta縲阪ョ3縺、縺ョ繝ェ繝ウ繧ッ縺瑚。ィ遉コ縺輔l縺ヲ縺繧九ッ縺壹〒縺吶ゅ◎繧後◇繧後ョ繝ェ繝ウ繧ッ繧帝∈謚槭@縺ヲ縺ソ縺ヲ縲√◎繧後◇繧後ョ繝弱シ繝峨し繝シ繝舌ョ繝ヲ繝シ繧カ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縺ォ騾イ繧√k縺九←縺縺九b遒コ隱阪@縺ヲ縺上□縺輔>縲ゅ↑縺翫∬ヲェ繝弱シ繝峨°繧蛾俣驕輔▲縺ヲ繝ェ繝ウ繧ッ繧貞シオ縺」縺ヲ縺励∪縺」縺溷エ蜷医ッ縲10000縺ョ驛ィ蛻繧-1縺ォ螟峨∴縺ヲestcall setlink繧貞ョ溯。後@縺ヲ繝ェ繝ウ繧ッ繧呈カ医@縺ヲ縺上□縺輔>縲

繧ッ繝ュ繝シ繝ゥ縺ョ貅門y

繧ッ繝ュ繝シ繝ゥ縺ッmeta縺ァ蜍輔°縺吶%縺ィ縺ォ縺励∪縺吶ゅけ繝ュ繝シ繝ゥ逕ィ縺ョ繝繧」繝ャ繧ッ繝医Μ繧定ィュ鄂ョ縺励∪縺吶

cd /home/mikio/var
estwaver init waver

驕ゥ蠖薙↑繧ィ繝繧」繧ソ縺ァ/home/mikio/var/waver/_conf繧帝幕縺縺ヲ縲seed縺ォ蛟、縺ォ遞ョ譁譖ク縺ョ驥阪∩莉倥¢縺ィURL繧呈欠螳壹@縺ヲ縺上□縺輔>縲ゅ励Ο繧ッ繧キ繧剃スソ縺蝣エ蜷医ッproxyhostproxyport繧よ欠螳壹@縺ヲ縺上□縺輔>縲ゅ∪縺溘∵律譛ャ隱槭ョ繧オ繧、繝医ョ譁蟄励さ繝シ繝峨ョ隱崎ュ倡紫繧剃ク翫£繧九◆繧√↓縲language繧りィュ螳壹@縺滓婿縺後>縺縺ァ縺励g縺縲ゅ◎縺励※縲∝叙蠕励@縺滓枚譖ク縺ョ逋サ骭イ蜈医ョ繝弱シ繝峨b謖螳壹@縺セ縺吶

seed: 1.5|http://hyperestraier.sourceforge.net/
seed: 1.0|http://estraier.sourceforge.net/
seed: 0.5|http://www.namazu.org/
...
proxyhost: proxy.estraier.ad.jp
proxyport: 3128
...
language: 1
...
nodeserv: 1|http://ortho.estraier.ad.jp:1978/node/child
nodeserv: 2|http://para.estraier.ad.jp:1978/node/child
nodeserv: 3|http://meta.estraier.ad.jp:1978/node/child
...

nodeserv縺ァ繧上*繧上*ID繧偵▽縺代※縺繧九ョ縺ッ縲√ヮ繝シ繝峨し繝シ繝舌ョURL縺悟、峨∴繧峨l繧九h縺縺ォ縺吶k縺溘a縺ァ縺吶estwaver縺ッ縺ゥ縺ョ譁譖ク繧偵←縺ョ繝弱シ繝峨↓逋サ骭イ縺励◆縺九rID繧剃スソ縺」縺ヲ險倬鹸縺励※縲∵枚譖ク縺梧峩譁ー縺輔l縺滓凾縺ォ蜿、縺諠蝣ア繧呈カ医@縺セ縺吶ゅ@縺溘′縺」縺ヲ縲!D縺輔∴螟峨∴縺ェ縺代l縺ーURL繧貞、峨∴縺ヲ繧ょ撫鬘後↑縺乗峩譁ー繧定。後≧縺薙→縺後〒縺阪k縺ョ縺ァ縺吶

繧ッ繝ュ繝シ繝ゥ縺ョ螳溯。

縺輔※縲√>繧医>繧医け繝ュ繝シ繝ゥ繧貞ョ溯。後@縺セ縺吶-revcont繧ェ繝励す繝ァ繝ウ縺ッ縲∵里縺ォ蜿門セ励@縺滓枚譖ク縺ァ蜀崎ィェ蝠丞捉譛溘↓縺ェ縺」縺溘b縺ョシ郁ィュ螳壹ヵ繧。繧、繝ォ縺ョrevisit縺ァ謖螳夲シ峨r蟾。蝗槭@縺滉ク翫〒譁ー縺溘↑譁譖ク縺ョ蟾。蝗槭r邯咏カ壹☆繧区欠螳壹〒縺吶′縲∵怙蛻昴°繧峨▽縺代※縺縺ヲ繧ょ撫鬘後ッ縺ゅj縺セ縺帙s縲

estwaver crawl -revcont waver

縺薙l縺ァ蟾。蝗槭&繧後◆譁譖ク縺檎カ壹縺ィ逋サ骭イ縺輔l縺ヲ縺縺阪∪縺吶りヲェ繝弱シ繝峨ョ讀懃エ「逕ィ繝ヲ繝シ繧カ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケシhttp://ortho.estraier.ad.jp:1978/node/parent/search_uiシ峨〒遒コ隱阪@縺ヲ縺ソ縺ヲ縺上□縺輔>縲ゅΓ繧ソ讀懃エ「繧定。後≧縺溘a縺ォ縲depth縺ョ險ュ螳壹ッ1莉・荳翫↓縺励※縺上□縺輔>縲

繝繝輔か繝ォ繝医ョ險ュ螳壹〒縺ッ10000莉カ縺ョ譁譖ク繧貞叙蠕励@縺滓凾轤ケ縺ァ繧ッ繝ュ繝シ繝ゥ縺ッ蛛懈ュ「縺吶k繧医≧縺ォ縺ェ縺」縺ヲ縺繧九ョ縺ァ縲√b縺」縺ィ縺溘¥縺輔s髮繧√◆縺蝣エ蜷医ッ險ュ螳壹ヵ繧。繧、繝ォ縺ョdocnum縺ョ蛟、繧貞「励d縺励※縺上□縺輔>縲ょ、應クュ縺ェ縺ゥ縺ォ螳壽悄逧縺ォ繧ッ繝ュ繝シ繝ゥ繧定オー繧峨○縺溘>蝣エ蜷医ッ縲cron縺ェ縺ゥ縺ォestwaver縺ョ襍キ蜍輔せ繧ッ繝ェ繝励ヨ繧堤匳骭イ縺励※縺翫¥縺ィ繧医>縺ァ縺励g縺縲

縺翫o繧翫↓

險ュ螳壹′髱「蛟偵〒髱「逶ョ辟。縺縺ァ縺吶ゅ⊇縺ィ繧薙←縺ョ險ュ螳壹ッ繝弱シ繝陰PI繧剃スソ縺」縺溘jREST鬚ィ縺ョ繝ェ繧ッ繧ィ繧ケ繝医r逋コ陦後@縺溘j縺吶l縺ー閾ェ蜍募喧縺ァ縺阪k縺ッ縺壹↑繧薙〒縺吶′縲√◎縺ョ霎コ縺ョ繧、繝ウ繝繧ー繝ャ繝シ繧キ繝ァ繝ウ縺ッ莉雁セ後ョ隱イ鬘後→縺縺縺薙→縺ァ縲ゅ↑縺翫√ヮ繝シ繝陰PI繧剃スソ縺」縺滓、懃エ「繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ繧剃ス懊k縺ィ縲∬ェ蜑阪ョ讀懃エ「繧ィ繝ウ繧ク繝ウ繧呈ァ倥縺ェ逕ィ騾斐↓菴ソ縺医k繧医≧縺ォ縺ェ繧九→諤昴>縺セ縺吶ゅヮ繝シ繝峨し繝シ繝舌ョOpenSearch讖溯ス繧貞茜逕ィ縺励※莉悶ョ讀懃エ「繧ィ繝ウ繧ク繝ウ縺ィ騾」謳コ縺輔○縺ヲ繧る擇逋ス縺縺ァ縺励g縺縲

Web蜈ィ菴薙ョ讀懃エ「繧ィ繝ウ繧ク繝ウ縺ッGoogle繧Шahoo縺ォ莉サ縺帙※縺翫¥縺ィ縺励※縲?yper Estraier繧剃スソ縺縺ィ縲仝eb縺ョ荳ュ縺ァ繝帙ャ繝医↑驛ィ蛻縺ォ邨槭▲縺滓、懃エ「繧キ繧ケ繝繝繧偵√う繝ウ繧ソ繝シ繝阪ャ繝井ク翫ョ繝ヲ繝シ繧カ繧ウ繝溘Η繝九ユ繧」縺悟鵠隱ソ縺励※讒狗ッ峨〒縺阪k繧医≧縺ォ縺ェ繧翫∪縺吶estmaster縺ョP2P讖滓ァ九↓繧医▲縺ヲPC謨ー蜿ー縺ァ繧ょ謨」蜃ヲ逅縺ョ繧、繝ウ繝繧ッ繧キ繝ウ繧ー縺後〒縺阪k繧医≧縺ォ縺励estwaver縺ョ鬘樔シシ譁譖ク蟾。蝗樊ゥ滓ァ九↓繧医▲縺ヲ闊亥袖縺ョ縺ゅk譁譖ク繧帝∈謚樒噪縺ォ蜿門セ励〒縺阪k繧医≧縺ォ縺励※縺繧九ョ縺ッ縺昴ョ縺溘a縺ェ縺ョ縺ァ縺吶ゅう繝ウ繧ソ繝シ繝阪ャ繝井ク翫↓險ュ鄂ョ縺輔l縺溘ヮ繝シ繝峨し繝シ繝舌′縺ゥ繧薙←繧灘「励∴縺ヲ縲√◎繧後i縺御コ偵>縺ォ繝ェ繝ウ繧ッ縺怜粋縺繧医≧縺ォ縺ェ繧後ー縲√″縺」縺ィ髱「逋ス縺荳也阜縺瑚ヲ九∴縺ヲ譚・繧九〒縺励g縺シ医>縺輔&縺句ヲ諠ウ豌怜袖シ峨


hyperestraier-1.4.13/doc/common.css000066400000000000000000000052301125261632700172420ustar00rootroot00000000000000/* * Style Sheets commonly used by documents of Hyper Estraier */ 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; margin-right: 0em; } div.logo { text-align: center; margin: 3em 0em; } div.logo img { border: inset 2pt #ccccdd; } div.illust { margin: 1em 0em; text-align: center; } div.illust img { border: solid 1pt #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; } strong { font-style: normal; font-weight: bold; color: #000000; } code { font-style: normal; font-weight: normal; color: #000000; } kbd { font-style: normal; font-weight: bold; color: #000000; } a { color: #0022aa; text-decoration: none; } a:hover,a:focus { color: #0033ee; text-decoration: underline; } a.head { color: #111111; text-decoration: none; } span.void { color: #888888; } 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; } th.mini { font-size: smaller; } td { padding: 1pt 4pt 1pt 4pt; border: 1pt solid #333333; text-align: left; vertical-align: top; } td.mini { font-size: smaller; } ul,ol,dl { line-height: 140%; } dt { margin-left: 1.1em; } dd { margin-left: 1.8em; } ul.lines { list-style-type: none; } span.word { text-decoration: underline; margin: 0em 0.1em; } @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; } } /* END OF FILE */ hyperestraier-1.4.13/doc/coreframe.png000066400000000000000000000352011125261632700177120ustar00rootroot00000000000000臼NG  IHDRミツ4上「0PLTE*-)`b_blI○e件穀杜ォョョケケ歳ムマノ站イアラルロケ゚ヤナサQ pHYs  囿 IDATxレ抂維ネコ鍖謝ノサ-C謐嶼 h゚{摯}曦c゙ 纜>モキ瓣タ~マW4$ト匸izユミセ絛4tスメ<.*$M ルシ^フ83BV BhWJイ-キエeKイコ肚D.UゥT・櫟_}U*}E靂篳 チ フヘ@マ@O謖ェサャヨ]シ豢ケdマ閹%夲 パ?rロ・3ミスマヘ7G;yコ'、逎_3ミ'%エ(3}ツ鰰赦@Z栫>ル゙氈6Aォv)リ絛{エム゙フ@レ゙ナ(tUb{ョ9ミf'ン蜀Oフ@:,ィ%!ヨネG。K.5h キ1"アyCHォf>BモぼトミFBTマィ紳~* アT、du吉椒Uィハルヲ*ムHμエユキYヲコ!ヲ~<>ム ェ!h※ム゚0dZ掾>Mtフモ4Fミ@,-Мミqュh尉tテMt勾゙ *ナg「縟ミZUjヶォj/錚u鑠ユ *):~|~-S エdノ6]鷺&頭。g5 4ユヘ別縺墻]0ムチ~ハBjl:b@ク朦5:Aミ4ュCK剋丐チマ@GYイq@ァ>ミ*U*tE牘jサ(ーチソjYUY @ィ @・ヨ鎌l0h礪(|怎齶軈/ヘ+>レ橿聾sG貪GG\+/クK躇呻涌モムWソ|サ獺FYuゥ tケWD 眦GD&ナL:GX茘0FL9<:zEx7ァッxフqDミpミ8ヨ!9kゾエ#ォクs霑~江Q娃62?マ>屮ワ7?償~桙 g *アホzヲ 0@J Y甅顱ミ?キ"s餞N?{ラOSGック牝OE6>tミ臨JRコS」駿п0hL顱ミ,,ミxワばAX Q割Mミ"ト>hミ6ムQIGヤ.ムqt&yワ#(4xケ」h$ヨ。pツSh&I,ミGyIム聡ミL7閠ヨ 寥&リc:h#>Eミ・@ヌ99Tlゥ霈:Eミ^゚◇ホゥ_ュa@0V9フノ )*w> {@匡vKDアOネS褌u゚ー4霪ミヌ}yコオ籐 .46hmコ"夛Y?Aッ゙ミ嶼qフtア詛ンユレレvmq!獏ンYト聳ワe-セ1遵ョヒ」ナレラ:ロ{エオク^ッゾvコ、NエヌjG7鍜$D`C.ユ゚rg_?サs\lソイIーメ&ワ#ョラケlタwア6オ響狸ーェ?シvヌC'ァ,「スжクlソ!ーゥwk有ミ7k舅 ヨ゚\z}ツ諱HQャィ;w矚テサ58ウスユ「cコZエ#-]Tnn」u6J蕷-$1瀁ツヤwD1ア ヌnnΔ&ュ3ミ赭]:ヲモ}ハ$ュ4軈F耀抔;、gンテ拷ウトv$ aタi: w」┯hカ゚|Vサd}ルナオ恚勗;ヌンヘミョムv@ラk$ヤコセヲTレ夭dhャうWt hトソ4磯ヘzGt@}ヘ情ホ@h Eォ1L`cx玻iョカ゚\oヨ冴#hm!0~旙栫{サzwキホ6hSステ}'dGI菅m:NXョ3ミ;,ォュ l゙,セニ}J」uウSテリUウK"・サテR゚シkvXカMfレ・ムサミ精ラ庸}lマ@サΕュラカニノ*クQpc荒X゚;}8梳fリlv$ス74ヲレチタタノヨク吁袙エヤァ7マh]SA*ハ!ィF アW*ゥ%チ q傑欒篠,ユ4!寢タヲY該iニhS(B\/ナネn9 _ yミ烙,腔ルt gネeケ-ミeZjェケb腕4^a:_hミヲ枸dム6イdVン)ツQP劔oZ朝7ゥ薈カ7+ン丐ャ総ム炉レe 45:F3P8$U U (LJMゥモ>d*2 猿J「アロhpハシLJレ・ヲ/RMニ[3_( I欧=院pセ」復VDyoハ2じナ16M蒋BCホaP当吉Mtネ'AモB戟.屏7レ@ZRュ\4Yス11hZ陲! Zチレ 刷Yヘ.ミエト@ウk+エテ鍔.俵-&cョ0hZムニィ? ホhEミ粕tSノ h4?.抹レミ啌P)n4-(rc7搭%++勗ツkE[1!%U50莨  タD諧カ@誰 j堕_ユワH 、ZヲXホx9[。p~ロ掲セcT頼コャKェNo]湊&ゥ澄。「求酘ScnZ朴テ?(┿マフナf=C_@ャ蝨∇r豸スゥムャ繿靤ン掾tma゚。ァ鑷@ソvハyw{z ミ゙サ; 4鉞B識ウ磋議ミ76Mテ:ホ#67=トy}ネ゙サ塩-t|6コ8eミザnエ゚タMzノミSヒ汳Z\゙_wナ平スス萃teト・、クZY^Tソ倆~カヲ zw?アキエキエー湎ンq-簪ヅバハトァン?B傾Z譌C@T恋蘭 メ硝[,h/9り@モ@ンЖEdtフ3犧チ)GNP$夢)O:RV<[KツE'tメ J.: AAぼP]4/Dミ踏i2G5A(メエ・M瀲爍W2=LァネイK レ)5[*meeteユノウ編ハハJノsェスエ仍-・=+){Kロz,ミシFCロ Jョ刑」アg0OコアWR圉阻エム/衙<+漸S:+、ソ*」悼ス萪B2>z7ケ権痛ノeエD$Oeiナ>h{簗セク偕エYvE夷@モ3エ'」.ャcミ翼レ同JE 4ホ%キノAゥハ|@ォ^G斫ッ\zTロチ驕{AzhZ'ッイ昃メァ hミョサ eコrカカ9ハZ ヘコュuX3債楊v○I:rt笊amサ膳 ホPラロ&I穴d_Xh 4オ5篇^5ユ烙n.箒>鬲MG菊5h@{t駛?ミネコ DヨヨニX侘4孥ク糀ホyンn X3bォEJ_「ラャo咢固ソ$Eq< ミ柯@'エ止]泳オbョI8ヒェZ[$ッYVx!N$カツx.?mwヨrウ ウユLノクキ眥栢メ 耀U エ'6ルエVch8衄ヌg'VF) サYyzD{zスョJ`z,稗tテウ繧ホ籥細!驛wV孑>!祭аチQ:咐P0>コJ>趙テ橙籘ニソqA;劉qWラx`@テ]W=m8タ&ネ。q ミ鐓ノ 1ヨエ去q塰ヌ工p8Sンウナュニミ]ミ簑「ォ5ソ蚋髪`ニミコ )楮qU"^&2h=リ+W:$]ー0裴闌<mH゙]レ[g=v]>イ0儔ハミ5ニEミ/9C5rTRッ Stz柘膿ミz齎[軼~戀タ翊ネ縺Uロx3ミ/揀:痒a゙傘・嵜 クeZ5テsミjm h綣ッッxt)ュ「0旃サカ喧ロ薫ンコリk+小xP伉8龜N稱。56" !Gチ_イzヨG倹5┴.j*R2工au";d カ8h*q#ェEヒ單 ヌ4M・m阯8境レ゙gF舁|瓩aNソコレ4' h tテ昂=1,RC獏゚蛉_ム痺]H~&6コヨaォメ癶ォUエQ+:<ラァ慂E_ #9PT幄*7-ミ;&hUマjhj丐Uウ蝨 鏖6「0}hル畝「吹 ュI) (アEノュI-律L?ミe?@~襤俺ェVォ澆6ΥチァェVィFユカエラサ ミス1ト 4nuチレUsミ 鳶@マ@マ@毆ミ}hOAマC檗ウョウs許lv?甅%ォ摶黝ニ@キ_ホ絎るサ )ZヌXァ3ミセW・捩~p|フtョ゚囲xwF3マ; 閙ヨ-~{!ミ;愴怨:)h-!テモBWe%メ◇ミ@O眷~玲2蓼}夂2 瘤IテEス蟷o鍾S酪ヒ<n4チiyV  軼ワメ/ァ圜UgI ヌソsR:|懈臘"Hゥケ胱<ソ#体{}oI膽マA"R九w紳-cタケロg・}pフG菲@7]ンS・ミマ=管98フdキヌ#ヌソ/;蔭=マ[ホムx7wシ9~歟「" キ(テa(゚゚N(:レh&1_tルセgr}麭ォ1苡wPzドチコノ・キ遐SLァQ捶タ u }カ粹<蝗t陽g、q\趾テA-n tホ叛跨傳゚゚コトノ`Aゥ/釈*qェン近テノケ Z庶5=MK1f~ヌso"琥4樟ヒセ~マh0?w燉R 4o799hン芽笥コNア]t、p棉 4ヲj1s倔q 婆ミ゚テツLレ香~U・.」c 4>'e4(S毎45lマAW禄Nウ S什c8gノ霽&h,瑰 ミ ェ+ェQ)V恰藐ラハ・j@ヒヌ「 k誑 >テフサセ/{゚ロEG |セe!Tw|0sール{A SキミX絖7h懃"Iル)-IZヒ彫KI呈K@Е葎ォGOコKL泙G ヌyP2ー}ミヌィW・霍ワ胱ゥo};韵ツ聲テxマ。@%-fャKQ 1淬:ミZ+Ru榿Jエ。6エャ枡~ΟbN 鰮ヲ:h墹 -!aツカケo゚ュ 0ムq廚歙!Au_V< ワh&z@$ュ・价ッGユ&'ィGミ怙3・カ誇TwD -:ヨQCo、,?~カヌー]U}齎セ1販 q[チ6|poーメイ Muルャス閇EP&M鋼l4=;Y3:o6確ミ2m6UT礦uホレ辱ロ゚ 卅Lト'A'Rアghオ虍4MGhS(\レヤLソ.ト)wnF羲P2」[ヲ サコ'Aロニ藁オ拗t」マ。eAョ>ヨA$LΩシハ隅フテT黴ヨb頬|L+ゥB梧#:律MF走タ F鯖Eゥ;yO撃Q6メテet∫「ヌ靹ミト=Zョハ%*釁FヲY-冕6ェR=~*C[cvT 号zYチメセッミスNP$%B#j e3ソーaムPrTヒ宀J忍キAW+エ 窒Kサ懊キ瑁 屏モR「h)ユ-ILァ1AkR忍[+Yレィ~モ ニW{@」:)"隕レFyヤョム2漂4KカテG蓐鐵&>Z)」K*成ヲ鍬eエaノ鏐KFW 」S醪徃ミユ1慟_裳$ヤ:エイ。Lヒ~nHェュ」蒲ウYM゙ミ2}B8゚俯ル&$ヘsンoFワホヲ┠]E(應8贖;スヌSラhラ&9jムa」']アヒ('ッv7ッィSフ4:df[KiL'd:=付刮モcテ@ヌニQ^ェyHy袙.8PKニセvyq;ョ 4」ヌキ*1pハ縱~站 ×/Op)マleハサ6ンセ、4A饋ハAI鶚ワ ミカ伽ニ$ユ瀑>H゚Ne|靤ヌ汕nニユIJ,Pケレヤ1?2=ノ]h 鰾 @ミ'?囘"zg Iミ=sニ'夾_ハ ケ|ルスエ!,ンK8ア93ナA」ユ椦{z5痼ホc!lー{ユナ\ロヒ#Jリ}z怖ヒェm*措ゥ.d鎭X口e矗Kz#tァa褄ァQスン <{メヒ躅X,イr ツRz)AヤヒDIx<\ コLTc9 >4メ ~J>yFク煉{マy"損ァ ソ 蓁g盪タ覈楞ァ涵猖ラマケp蒟3ク@vAp ホ騰$Eセ~#a86 ラ}Iュ" ャy6'rカフ> y・p/y4e猿輳(:r_?膾8「絋マ@?ス|.%S_ァセ・d}&_?yVR 9IE !陽陂{Qー!\ヘノ餔^ヲ蹲ミ沽Sr!涜ユ"5ハヒ=フゥ{ャアA\ヒ048x)O」 蝶タ゚c-ヌZ]ヘ:s$Z?♯vニiLgモOXモ,/タ}qナw4ッ踵鏨8k/%V眇斂ユ:8瓮号ーウU」狎 M .YエS」#阯マァQEyノ兒滝ッル5'閧モチc/8 」ッ訖レ=賽慊_裹ヤ'マ「0ばa搏AF+)ナ-?¬ト+dオミ=ヤMヤーW。太Zヌユ\ク:5ュ ZD ハ檻ュ肚sヨダメ:,ミ)FQ」bZヌ如ソ`コ'ィ薮^゙c{^ーナTI゙aQュbヒ R(|ノイサ・_h彦U?蒋3|レuE|o。ノiθ:fクヘMコk ァ3コ)韈vシマGa\ミケiネニソ[◇ツヒルQqクjW岼ヲ*ニ<:,ホq-82’|W丶tc-状v莖g$=Vィ6A?エgkeMRgN[仔rミT追]オUo「メ隲ソホfQセ巵RH]u sLfdハ梢収ヌウH[W;lE薨&ミクW蕎ャミ゙/>6B!ョ伍&<レハ賛Sxシ詬Auレ]gH^.gニKメgォ(歉ラ鼓5チ^メV髄∀ヌ憊vチウロ>?レMラ圉銕>AS#/8タツムヌ羮ャw延プミQa6怡@ 覽賦イ。ーM・by^クsィメsh゙ニXュIup゙ュVF霏シ{S;* t! Com85メアlDユI)@{涕>」+ヒ;YZ3.紆0悗モ,63yァッヤ 3秧攣コIH健nxリpヘy#ユケャワロ蠣リ2タ$腐 ァ6ツ薨ノ6 Gム9ユSR4ワD4w「ユ澡セ。誹トi*サ」ケxc示b埜ェ]nー=ァUテmホ&ュミ Gテ8S塾エ~zZ%&9濕膊髱剔kトi.KS黽Qミqコ=テuOA[yп.輛オyシ )bへ.ch∵Qナ>hZ翹 Hsムェ エレス3W襠むヘヒウ=レタ?O洪ム。S*袤「#ラ)ンコヲレ丐」tヌ CテォgカΩニ0Wフu*hシjユス5xォ1エ@sエ4=築レgjvー唄S。cjQsクWb龜 叛ShKt(マ@レ6@`'E\6Q ュ@G、チコャ[ノSホ茫H* 谷ェ.U蒜53ミニ:l]pョァス; マ@{ッ゙刄」ヘ エァァ"A暄4ョohTォテ<ァDOゥ=.メ/ェレ8フウ:vi眩胄)yカhG腴Т Tすハ寰hyマei肝。エ9・Mツ)ヲlBス抒GOホL l)尨:ンYムョャpp`J抹ュ占ルi便Vネpォ森ZVネウB%陛メbVPZL尖9ァ・[旦?0V椚番Dj揩蚕」UミnマタヤaiャNMIOMル戞ヒ捲鉅Yム`ネh)@2Zヒzu.フ@胄3ミ 鞣 エ/ョ9==ア+ヘ@ユhハr暸|P唆0-ヌ竣Xhj~jeユEzA淑?レGラ+a臻猴ャばメサf/h2マ@マ@マ@マ@マ@マ@マ@マ@エ1 擡ノIDAT\〒ム[G 。4セnt「ウ'ウwコ:葢常3qモKュOクmn~@2オ]i拮,ミ ヌ0ュΟ コリBotyミリュハム「℃D7Nュ YC叩3Bコククニ5オテVネ88N3ムX3ヌax,ヌ;U8X啼)`モフォfゥ=遞Fツモ ヌ5エtp ~綱j+堡_ヘC .クキ2%ア段b|h椅зウ・イ@)膰 ケ2ミZM.齢.ア鹸SN」AV(&^f髪 1ョサ。鈬"ノ啝ィ%d+F傭賈!ィメ,ナ堽ッ覆Mホ'Taj夜ミ2U碩e#.ミ51コ+qI oVャケcトツクシサ疝「゙Nム意yル[)b4ヨネツケ穡ヲa:Jp.h オfN7_e{t6LV3bl y稿-C@|閇LVjニ嶐9:銃j 聶ヘjミ>')jニフ[y躓ウ.fJpケェ枸dエ荷]メ.テy L鬘接fmト屎狡,コ9就臑<)ミJA"hF8ヲG$aマ◇ホJ*ァ玻6w:槻ホ#戳X,$@Y)ヨ、クXmSJォ聖IJ囓メZ3Acュhvヲ6,6O^ヲ谷θMョ^8ニhゥェ甸M尅tム先1o(ェ)」ャ;R核駘- ラノ猪"穐Y嬲。 cE2A庠。ゥZムmミ8W!K*ェZ.d49T P9Mミイ「カ@テチ エ/6hT)ZカA 4ッlヘホヤ レフ@胄エwカ:驂拶カh歃tレw怎!懐 :0}i羮ハラ濘ェ?&雋$SC抽猖G・隕g<イ鰉$エ_%eヘ法6; z=h Rレt・原ワ鞴ゥI&ネイ犯鉛剋GTレ"+-;ョb/d゚メ唳5テスY&ヒJkエョウキエmミmケnc、h、Zv5ミD」eュ^<$ネwRFミ:Fヨイ衽6YチZス陂賻xf4OZ卸ャフwRBエ卵c?7Msノハ2ヘ6Kk3ヘmルh[馮ウ、畋*ュヘ UZユ^Z[V、ウ岐cキQ喧vL[ ア蜻WOキzAGハモpjヒ」+A3紵V;゙,2」ウ@系uLfNt3 スシ眞]怐<シ3」GON{ォマナタ`pニIマ=h/サセシ,ヲ0Fr 8^楡 ニ抔テオミメケ. ォヤYミqケDeDレ^G坑Zクイカ~濘燬kラAカWC}ハCkTアンユvDョェモ=1拌スQAa1舸ンFA2lYMッtuXkーF^qQwノmmュ ユom>8;ソユ峯コヒnZd@オエ ミgvT、Eラ1ウzス*m>ミ}杙#薹ン#キ]籐「=コO;、 杪fjネオ経=ゥwス啅ロuoンjニッx植隣椽ヘ?テ|cx"オッ>クヘnィ^キ14 <ヒE6w _8ラ?ィ!車孚狒<マcqhC、mコ約」c8アzァマテアンソ [ン'テ陰良轎荀<ソ@?ー柎チヌ| ゚'}ヨcケhu非)ォwニ 7Aw ネ+>ノ顫5?+モ_O惆聰?ン幢隸L::?,舷 _=・Jラョ澀eR=レ]ミ]煉U}ヘメオオ|xソb{9ミ]ォzmユs餡[ワョzBホ]ミ]c蛮1ウヌ」崑ケ エヌ tラ艮L「゙\サホ爰ス{pxh\- 2Tヨェイ?+哲qtセ4^スヘk強w 6ミwッ&ヤ」-ミカ▼>コ1"h{[ヤシォュ殻[.j オュ5qアsセP」]MlOレセ}閥サヨ]aン{ェP」]メ」]晨レ恪!^冲 ヘヨレオ+=ヌ> サ ケpx@oン> Y8< -n.'ツn-B>>トートュAア□ヘレク*,ョュ#Fj[嫐精゚Sダ」ム塔Fネ「(゙~r聰ツ- 固トC"&nj} >wo扇<Fk$6>」Nt4'狽T4ラソF」]c3クー"txp睨 ィ?ンク!\<6Kワ :zWテェcgN'xュ5IZク".イスCミ\萃テeア%」 44#ヌンH 柘樂W#WWxHョuソ松A#Wミ: 'ヤ:~ 俄ツ癈 錺ィ|瀋ィレ"DI x臨nヤァwウvミ^ホィuKス回}2A燒雕タDヌヤih+oアロ0ーFロォ)サキ@Z績箝ロ 童ノ飯ヒキAリOnm嫋2ミ^爵u' b$o∃"ォム-脾爪ミPラo-$胴a_<,:l縢S袙;房ミォナL蒐Дヨ~|(Bmkァレヒア;ン普誓_7,09HB糠"アKSス1Iニ」oンaM瑠1ミウ:iャデレモ・&廖3*閭ロ#ゐィミラ盞Vネサ^ヤ|Vモホ・ノw]rイN エリ ヲ=RjLtンi y : LaユJhoロツゥN#::ス3 ヲク kォ菌?_ュ#h6Qタワゥ/n竒崘:{セ777ッンefミ屁クA゚o]アロ -ミL6(ロ !。トv-?uリヤAッ軫ララタホンフ資"!祺趨\ェソセネ29浤仆;禍カ エヲ$ァコ_。ン國ワ*ロッッ3j"゙ョ?シYサク]t ゙EMモクZ:。5ト_ヌ」jッ/ユkホオyス~躋苓チホ]ンユ$劬?ヤ鑪&ユソ% EロオKヨチ_/アG盂 ィムxロ瘰}疊記ケsキ tヤミcZラ 8ヘイdヘacXロLワ4テュユ拙"ュ-ィ |3憺フ@fヲ獵R x3@<黔PニホコzエヌI-ミhキヌ純57鏘赤 4HkムェソI斉%誓。uム瑟C@暴iユЦク:aヘキサA{lGcメ:'貝シ嶢レカ):,ョラロ擬xタZま|}゚"vミ-ョ」0AッBツ6h瀟ミO$曁ヒYハBr,'忠ム^ム隕%」kWLヘDBfw「"nム⊥6h%4Eヌ姙ュヨレ7.FsEチ喉邉ェヨW^wb峽a 4カ|ュニセセTテ&0ト、Vw康、ア@ウミBトo欹w‡z4@hレB:ロ」゙≫Vhミメzw&hp;>`スNワ5<hヤ@5エj4puヲ'2檮.ミ^: 垳0館;,($カ゚Q\スYOJッ4臆MシX>$袮!汰゙-:~ 姥-ミ睡.刈Gテチ?ve堰`※属.xbーmrオタァ^サGミ0゙ケ:]bu蹠!o置ォ ^gnトjh]彼 麑絶tZL稷覯mミ瘁6+'嶷晁TワLx擅。エyム梳託{@両カ$テ(ンcメ梳~x?ワヲr Aウ 陏9ラZ錠Z/エ逼ヘ謫珠レ「kスsルエ埜}ニ脊<ノ妥ィク= 祈<ソ、辨キ頼p鷄ミオ・}ミ)笂Aゥ&ア。7搜゙ァゞ2ョ・a.ツ ゙{&雙 ・aL+aCZ゚!ツ虐ミ釛|ト鷯yal+aバmyC゙コ  リ4レ涓ニツ∴]佶kエ'ニォ|=宴∠K阮ス0ャ錺 1Aプ mBkyテ噬$ウ京d喙カeレ ソIエニ~働纈」khホu4キンアW:ェ寫GキA?Gw諫ム噬籖33ニcミ雫8ウK筧+ウシa隈 /散袍翫「マ/gレ疸 オウnフ;凝、^q<懴レy}レメ遐t 朴:ヌオノンキv^AOu)ヤリ ネ=}.A淑O2譱8陦:゙ミノ`誌'緇キヨ」ッL:ロ蝪亮踞.M 、h&/3 霓撫pVα$%矚ハ-ィ{ノ]W=愴妃サー壇アノ8v/d5=シ?営コ」^X(儉&裡..暇eタエ申コ畢"鐡RワqNqayayメ^+x<ヒせw@ScL+aU:闖?J/イ~i∀h矗.ホ&Eモ g凪%シK|a゚彖コキ4ミ 4チア@s關クヤスサソミ{ミ!qeiYエ@/'瀏W\:{ンT@トェイzokツスイo~ タ@ョネfホ@スkむロ_レmヤ靤-ム゙@ミ+Gスwaw?アソ`MエQ &鞏・=xヨEx沃/8'カ 1EセGとソeq_\Z^`'JーエシエrhマA渊A・陟ォw3ミ3ミAンア@タニ<スハjVス|ス ョo~M7滸陟uチu&騾93/H。左7YAョ1DルQ゚t>%lユA慘WFmミ*6ヤニ桿jォaqUt'Gy|?1裂{?斧癶sEn7Rhリ島ゥセx4rヌb:oヒ鼠)_n{沙カ味ス1 エ゙櫪1ユホツリゥ\?yLコンtヒ載p迥j7鈩枡fnメZm+鑠+ニワoトX尉9ナiトHッ{ノy3筺pツ国禝ェ\喪ゥャチsjKt莽 l0チV&ヒ$R%dセコfツxォレッカ@悠X%、ァミ D曵ァIネヨ=ェユオヘ?G}ャフ'鑁$」シ麦」DRクc*、0・・tフ爨rP爽NJナメ畸サFァUコS裄嚊哉ノ揩ーニS、OョsゥUハ(|ケカ襴ケJァ:ァsニ5j・d.埣@ォ4喉ェ]6ツリ5A6c獗.w埔R即!毀pムツュ9ハ● マメ翹鼠ッV ツ「ヒィkォち{8G dラム:v熈JzI フネuホ-Qオチェ枷i;1Q嚏l`cネNミ}TC苺エーカレヨレ5チ゚6ーh5蹼ク "$<'0ミ;jN5Aキp2ムaDヒ:ァcレN ネZ箭&h8とム-セ鰺オュI)omョ}'ノモ沽@テキj4w鰉 エPユh-.ミmj)ィモャF#B;hP .3ミPEムチNョ;2ュ_ュ$Q\ロェF逼マu@[2嘯姑江FァTニ^c血0カリvmむIg剏!2レ9t6QF翹u輒T i睫レ39RロBq盻Xコノω!酖千「h t、タ9eVニ#5、秕u「 轢エ1+uX燧アニ゙+A4杤oア穐"・クオ` n.-2mネ'Lマ3ユルヤ」…+v鰉h|?awリ}ノ嶋レレタ* ォLMカ#ィGテ]濆0ムpr}69ェユ瓦恬セ4ヌ;゚}[テJ゚aャ「lT1.yr<夾ニMオ *YA陋塁゙Yカp継ェmPゥェRkp Oレ亢ェー ェカ永fHーニ}ヌ7。クG>゙nCgnタタ?6ヌX 桂ロヵーJx4ウラ8オZ Kル廩Y迷蔓麕V」e(+3AG&ミkzp ィO桷q "MA+まョ!寨 キA0cJ') ノg・フZ) ナ耄ャx フェdマJ7ヘャR摺甥[Yゥュャレ・・ャエ,+Rヲヘャフ之iュャx2゚ハ*ヨノ*ラノsョ填spV,%f包\^、填G{Jロ曄モソヨ隧 ゥf6上ニリY扠I朮 9z榻チミセ=熟zzz詛g?x溟ヌPII $!IENDョB`hyperestraier-1.4.13/doc/gateframe.png000066400000000000000000000457521125261632700177160ustar00rootroot00000000000000臼NG  IHDRミ^巒リ娠LTE"$3;3<=+I^LN_]Z^Fa`YdlgrsUey_mwz{xc]怨月p~噐樗k|末囈「」v銚カアイ*シ妙アォ」ケ・スタ叫メヲアヒカゥメモツノテハホ隼モスネワ・ンレ苔ン渕鮠ヤルメキ褂ィンロマノ鴉鞳ソヘケワ;ヘbKGDH pHYs  囿tIMEラ ゥ韓 IDATxレ揄bェ:@,"4blE笈レwアwo&E玉ワJュ@(a2ル:?mhテ Nエ。コ mh×臆ンnテ0ワlgシルマ冗X弱x??3ヌ-gス婪,タN遵ノ.Tル宍ロ9筏mR絛,lBテ潔Y?ロnニ-リz゙雪ェ2ミ]0ー]ラカISB(・~ク 8;;゙ pッナ!カmサpJ@ミ>v;ィ゙z E砒レカ惺@ !ツ ェv轢ヤエチnGLリ"=BэーO(ッz涎厄閭/xエッレsA\裏メ トxル」楳>ァ圓ヤ~_dカハカマ)bマ ツ^Tトレ 暑oA-テ[оラエノn シ7 [_喘ィr9ヨn7ムヘtiソr`[sw; ムツイ+Pッ√∀ャ8Pタ刊k鈍nミG攷m×f泡1yェf唸ゥ! lェケ3ロカ@?掵畊}Eウ[市t6オ5・狃ォ)ヤイ2%~ミメ|A]CUxミソヲイ~!Cォセ瑯tェーpモトヤ鍜j~}=ス廈PXミuzメ残ュZn雛:ソィナ勒座ーヤs゙_セォg-ミ遵ウoLケァqTGf1OUN萄テ災06マシツ霽 ゙Xmリ.>v?:ニMト`ゼW#鴣ェ^頼ミA゙ナOE"6@CリヘZ$nャ潔iロZDdモ6藁(ホ ー/゚@、&ロ僣*al衰タkヘX謚:メ窺ル賜ヤ?otフZ"フ7ョヲ0$艢ル Jコ瓠Gネ'・1トヘF荊ルヤタ鞐ヨー」ミセイ79綴2マャミcヘk× ラsニォhミネエ「セt慝ミカ「KンQEvswサKィユuサ耋rリ7S}ィo]}ケ隊ォ<ヌ:憊琺%^0ヨ7ヒnr ミ~/l×:aヲ残 カ @東fO∋O揶8zルP7ネヲシ卍ァ>曷モ ;゙HテDKタシ>]"モC袴サ,^コ4オ6肛hァwC/5 ア;曾b8ル$64オ O唯a 「( tkMHニ$nネ$JR輕頌ヲ蟻ハケ+懇ー@'タre}額\f@テS +.Dサラ鮑~竟ホソY$゚u!3bRラGハ6アEク \~ 尢]7「H,y*\6死・DOH犲脳%ゥi -1 ニz.ミCz VラミSョ。覧GH}!7ヒ4}NOウoリッ`72&カnX{`<ヤケF;zコ ァ9 泛廂轢蚕ュJュ*?ッヤ;& vqp广d桑テC]2z塩3佰モ%/揖ヲxY,;チM惹4愽、勾4マヒJンンマu蓄ケ」^_QL"]寧。ム゙ミマGヌY]E饉ッ9泌%;マgキsM簾O゙テCtモPアオ樸ツス。_yヨv9゙ }<(X__器應朔レCVタ ル叟4md?敞ヲコネ」ニヘヲc98ム リQ#x ;;コメチ檗p1ー0リヲ遠ム|Lz=ヌニツ%鉞蕁イCマチケ袒;ェ匕KPo?。M}a"6+oニ2リュ-6oリ沱o誂O'ワ!゚Z」リ顔イゥWeGq葫 vDモzコ長}uツ+ネrツ?}Gロケ2F ウK<ユキキロY=6ケRメ&Jトz-9囿*,竅ヘェ盖~メ>リvnO;roD-イ烏縮cマルイェーモwfロ6腓「≫痞ケ8i_勍「)イ「b廓B qト刑稍Rhムss穿Ij3xE11瓦ホU恊gR-ー蕎洒鈞<サ{=4鰹iオシC蚰嶌w恠゚ロカ@キ。|テd*渤%ba欣Яウヌ「<vN"塋9轢エケ7エツワΟ$ヤ-ミ橿ォz~ッリb>ツl ワカ@キ1`Fヒヤ852ラXヌ絲Bマ鷦ウ6ワ袂トクャ^ス゚トl=#ヌyユn-ミEmf瀕ヲ鷓スセ$&ニ$ノョ卵ク5NN灑-'イアT'ウhヒoルロブカコ eエ/.|.Gホャ残FOレ#:5XDhヘア$/t5,'ッ佐$BヒpP6;pPフチ-オgチ 祥Z&マツT6Cル8オ@キ。X詭 メo>廊&トソ:I゚ノ゙ソto2_'+ュSi土z俤テ3<&%{b汳マ沽+ヌ!c+ヨ砥・徒|t觚ナマg-ミm(f田カョ(_ツEfラ撰ヌ褄ラホカコ E/s也h4T 縮)>.ka,タ・キツyg拱∪i'ヌ&*落オ.銭wNレ9ヨ*齠ネ=ミュnテ9ト・怒スリ學゙2茖シオ@Ls3詭向8<・ヌD9F2ヘチヌ<鈬ヘ9セ > ノ@;l 謫u"ゥコ ナX謐~鐔OgoZ5|:ヨ?u21: h 誑vvシノ、マ直1Dユj!#?、5鷭8T{道←遯G゙d「xx&黝"9弍!ス\Rkrエ蘯Wテ32閉hトミト。vN44メzリ鏈ウ6tヒキ~斈ィ蓮2 >^kL@rユヨ(ナメラ4、ク萎>!_クHZマ'昴jd[)lC脂畉ャヒ[カ<ミタヨミkgイv脆ケア,H」ヲ@3ッQヌ鬲O朖ヨナヤ顫8XCュnテア^vT\トwWキ田ャ"Xu^ッュト膵#妻1メリ岷ミミ&*$ツ婆5= ミ ョル @C^廻ア>攤トw゙コCキ!Eルb莞y9N」vヲェ@ル\Uラ`Qィ壱 Gロカ@Wユハャ粒蜚c6[W 土ナ チ({ナN>キ檮*zM言SiHZリァルロyvXi'Xラe領;,{lZ^ソ恋yfIシ、[t"{?ウ}カzI楊&%ォ}゙ウ奘彷擶ケlv。?5^*m霏 [_ロトタアァキT\ノ熹ラ;uハロ叟>-ミナン^ソシ!$xuカ^スeム$オト錚(;ヨ貉ィァ_E=8朋3Xヤ-ミ猷油8j~[l!ヘv3ン3葩Wレ鮨nPg?シ衿ス'ワ噛W#エлケ[疚-ナッ「(r%!シー3kp照マ#Oム} 3NコE、キg&イァ %ゥVX}刻闢 トソ<ケ!トKRス?ミbk yタソtハ鵈%‡ゥ價*ッ%K!/dァ#3Lス痾hf%|hp#ョt汪/゚W薦莅vエH双-セ、ヲヌa$Lサ渡2スMsソー對霓ヤ#篁<ミE勇憶セミ破 5ンUカ!>n|E ヤ@Q74カ4%%d9Lj6 ラU陲感<ミUy頒挌カ(ヨ8Vぺッ聚ア)ヌl+JLL免Rイホ4リラ", 3」。繙ホゥ=.ミ *@ 'レフT^g=+zz](イiコAHJ:Pbb按授&、fヒク+4 t羈*l鏃コメ@λ姫4. eヘ:t桑6ナ壤ンカs駆ヲシル壽7澂)ァ5R頡w/」サムナh}F#フ%Fル ロク/ O渓@31エ罹Rxモ十サ処>S岳_ 對:ュョ戊メdサユnエK8Zシ*v如* r(寶カエ洩ア蛤Qワリ5 71D亳bFヲツ@エqリク旺" ゚0ba&h(椙・L6)9.ル櫟P霾tAサPヌRタ&イモRネ'・phI)"エォュQEmEC刋m4リト連フ$゚6ヲヒHフ |ヨサ%ミ釵"゚筥ホ藜 U^*ウ7Uwヘ7#*聨ァリk怪;@9らS」>&トW2ナ0」*@cセャ>"OJANJAアt_ RクZ1梅ンqQv萢__&WyY$$Oャbr険j,dT(毫?tK」゙褝jYミJ彙KJゥ筴&゙.ヘ(・oT! 憫鵁cャミ ラhRP?S 痘ツLヘVテRP瀞 S pンJ@ヒ/R筧j夐|ラ1ウ&ヤクFゥ浤「瑕ウ}ッ墓イネキE-サ「#5: tLmロフ霹j擴ミシG@R$ゥ|ョ{T喚マUAYサカI「#ッs"ロ=2m/-ハトhh|ゥツ埒ニ;ャ" ヌァ@ZタLム~Q{派&喚@'・`@豆&; レ欷 ムaニgJA4_桔罪≧;蘢‥frタ4セン2輸tヤッソュ鍠シZR)D= クh0`%ヒキヒ抱nXェxL)ャ/C-: dョゥャ$、@」雕fカ+MRリャーヽDI)「、^hE鰻ミc※u,Mン8儔x4(健V mvヒン(ヒMクHタオエシRnサ彝鰮q35+ーt椅@ン9]ハトhレm&W.}ウ*_ェ:ァ".4s襷 陬*刈ヲレ]潛ュTェ +5_ uホ嚮ム霤颶P志|@Wヲ,顫DW:}゚F/t、 テテRム7コro!@ラォTh。期÷&テ災06 韭D コ0:@議÷6ヌwS ミ5屋 セイオ@?8ミuチシ榮%AThソH) ツvマ ,t苴k・タ蕊オKムンミ俗ヌS!a<K@覬\)ワ6@誄,ョ、@Gカミッ5ユ」*@豢滾:ミセセY苅フ@O 4{7Cサ ミョ キWZーハZv」ヌz8ユァK]|K}:ヤヌィ簸畴リムァgt県ネヘ>ホM!b セhム(Mオ*@救)ヌ@+b溏M7x|;ャシ\NサI_ve@uレ].ヌRZ.agルe?ァ<J羈)!ヲロe辭搓>ス餽/[レョエ*.ыエワtA)ミタヲ'$木マ9゙樓,・庫62サV僚ンホtャ?惜ムンヘヘzsヲ@ ミセオ@キ@?ミ]tハSL謐4cb:ユ準1tw<ユ; ヌヒ'z@O韃%ニソ+uーヲC pΞnX<゙從悶4%p1&[N韶.__靆~$@[DキZラサテ1リCtテ鞏ョ'蕊晟p管xァァイ゙ユ・x1栖ォーァヒモ%ソ「」w侶f・リヒハ sサ+ナ雛b剿「;>*Euヌ\ dv}隆ヤMイター;С-yフハトtウm臑w磧oニ胝誨2」゙!ヤ砂ヒト利QfS題ホ即 )裹:zmコフ韭Lkj鐇・韆L=招陸煎ョテR鍼) チ贋+}ムd麗&「Xヲ))K(エFヲシ柁/ッ。カa差LGァ9゙カ}}魅ヤMワタラ旦})Y%W沁%ンR]・J。o死ホkリ:!KチK2ヘ未ミリp儁゚wエフイ澡) #y :khクカ」cォ╋|ン疚購31ォd◇b=-54ワヒ・(ァi)Nホ"z_灰CgKQ!f4マ" 4Kュ殞$@壟Fb。N,縡4ウ^7]nスJ恃ヲイk ルョ }(ナィzカPЛ)ニi)ニG・ィ4k瀑6ノ塀IyJLニホ・6t)自.ーヘrhヌteァ把x_?4+ナホ~韃x゚タ,^]ィ 嚀ッ%1{鮨/2ンuosJq病竊y&ルュラB@}B}Jヌチ1幻・ーm)l:擶ッ/D97珂7モタ,&moサソレロョ筺GSヘDイ」G豫アケNUンォ@救ャコmh 戞}Jカ9yъXハメ8whモU#ア,薹クッ握Cオ淨7:ネ吃コP8チ|ワ~Iカ @MJK@セ薐筴IRル mlマ■采 %=、j8"p8z"$ラヌイ総ヘ未タ伉タS !m霾^ミナb鐶/{|"7ノ!]撼」ヌ'~ノ嚇6IF6@゚,ミ8齶 カ}5ノケ蛄旧.P ラvエニィリソT >レ,V(E゚闊,セナネ冫O")m鞣ユΡ;NV=2@渭Z舶リ$ミセq(eタ^壤レ.@G_キ渺.レラxVレソ!ー喰Pァhロ抄x}%EYh%pP。恕Y%4篏モ。マウウ値yヲk &"ミjS^ーヌレ>ニqp┏+ケyヨ晉cュ購[ケ$d5私チu險A怖Kン*@茆jレ@モエナv\mタ飼oeチT*坐cMgタロ哥セョヒ.:2&證wサR゚rf硼.ゥヲォッ$%レz=:Y゚サ?ミエミ 利゚2ヒ9ミト球フ※タア;ク゚審カaォムEg倦'ヌ「佶qセRク g磁ェ}ヒr ロミムn 纎 ミ:香(ハ1ミp=p3OAニ:@P8<ヌロ7ロBh鞣フU:nヌJウフ<ァマ_サ5ノマエi耜yi鑽シ]ニmヌo エ酋カx ョラPh8G_Z|ワ+マ漾m閻Nネpュ「!ミd@\[q応咲ミ}ア8zq龜+cC_r・m{フ凵5イzM師|カhWK!uトL:))恬ymス{ル」ih *xAsチjf;双 H JァI瞞7Kククャ佰@]ッ・榛#X#タv「桷ュラキfE門 (6荼綵ュZワ!y;q@;^ン}卷ヒ-ツィムク;[V@キ篇ラv;Oユサン@SSQネ*鈎レ6|;「チFロ&&r濕タコ<ソp笆」ェwマケ(=_濁]~ロマ8タlャズ| 4;Bvヒナノクー欅ヨre2ヨ!ツYク2b」怐ヲサー_圏m ュ<"j2盞V筬]゙gキェ%「t,gスsAウ|. mイ @シo广n銹Uo Oミ饗@;Lョ(iヲヲ/ヒk燕ンmミ!シ斯レヤッ場ヨ#LアマVS{@チアzケ}コ臘=釧Igラ]ヒラ{oアn&;zhLトz歛メ9p4ォ、ラgXキ@ {Z粨ケ霏ロァゲンメ\QF+ノッz簓|ェ?マge?$ミオ\ミ9uテFpNsq^"ゾ頑zGトOミ<(カコ^恒rル1s* テンレv顳dェm t ワ\-、、当カBノ*(jッァ=!ヒ劃シ9a x」「ェ舒_憺lキ ケC瀚゙モ 菘╂、゙S*ホiUlリ担4・ラウEケ1ホO$糺%/ィツルsンwョ ヤoFョ_Lーロ/TA,SKモF?Lヒ[ニァラ異枹#盛 4{∴B<シ鋒ヲ縦ョ}5&コミE6 G|l2}ケ椋ン r」ケカw4ラ5cリsオリ卜Jp/タs2Zテ<2H;忘 サ@ム-ミ%ゥ禦|X「b@ウカ昶ホYソ^ァ]A@ロnフlサ゚アゥルカSl エゥ・rャa2AF| tウ羮E?.ムアefhルホゲy棧馥湍 氈踴レチ8:2ゥッヘ ム 、A 獅d{槞"i4アj課崚ァアッ%|*AL 7ホ鍠Nカc篤セАGn 4K&ト穡 韋9ホ5EケRヲ"*ゥセ「勣0ミ?・ァヘテ5キシ]0ヌ?M!fフj{ヲ「タ(&aキ%PリVーァ(Qエ寂hy_蛬$羲槻2)シヨm:GQ渫Auッ。j=ヘg汳聹4Iトレクp .uIFナヌ 。辯~.<゚゚ 力佯針エ槻ヨ ホt^シ?゙ゥノ笏幃c姚u}ヨスV ツ]ィiナキロァ6星ig ,ノ|キニヘ。莞鱒サ}^阡WM5 kトツ;カgYUニOヲネ・ウシツS坩8bロ] カ藥ラ銹摘ア@/スjG(0ソGFUKg[YハャEQ}9ヒ団クレ@Oサ9|J「.、ウュ,Wゥ簓ヒT.-gヨ"隋Oサンxウヤサテ蘿リ鵺pィ:碼颶vヌー7bJH:ウ}ヤ訖vオェトス「c珍ミモノt3.ヌ」'@w励rセ ハヒヘクウム!>ヒヒMァgフ ヒ_mスト、帽w!6<ミh=Mnニ:橸t1/A!・ヒアセi閭ルQm=キY゚ェaW幃」 rケ.鯛c%VML^JLCウd普zッ、ォ.PXスず7>ャソアャマ左2ツォモ%mt4?女濘・ヤKi鑿^カニ'亠@'Jコ鴨・V-ホowアm-ケワv`Ef゙>7ヒロny8述モ%ォ0&) =ュ>゚3Vォユロo洵ムスセ天ォマキK@s%]k ルミゥケ6 カuシカ鑓 +c0梏袿v#naシソスIスュ佝ソム7浴F%]sM艘Dn|xm-%>゚翼|榛e-]ア。%ヨ^ヌユヨ$pU彦:'ヘ__{イオ=ミ」マw06>U?Lセ tLャイ-;`+ラレZ窿ンpQ・e*ィ效j^ス」コo゚沺~]Cヌエ'bTア欠\ュケ:&テ・H槁y。ウ-#B/V6ロyワユ*ミg` f∪クTxゥ龜%b敕G_ュ3 ^%泣jノL紬ュ](ミ]1フ1 4aZラヌ}}Hミ暦}Ux$haJコ^シ_嬬Z禊1?ナニ+ネーKスコ tチ膚該耳ョマ8ヒj凭dS$3シq褊tcYtH瓸ァWニオ^ユナUロZ窿}Pヌ)チiァキuv9a(ニh~2)ヌaj6憩dィ巒N恍ョルmTV1\-ミMメ懦`ソャ弟8qメM奐 pャカK5x~hK 5。#ーZw})テ;`臧そェu挾ワ#エ~ヲテZbロ;@:`|nワ剥7g、s0゙゙'エ醇ユ喙y蹈D___wxbk`袒ケ(倖摶;晤突僂wヤ 」、%ラケ(「ィロ1\B獅("?笆|{O糺ヤ( j)マh貭茨耻~貭テ舟ョ鶩R;αB。'ZゥカオD@SB コ` セ邉=ワP干[ク>Mネ"ンテ$>aゥヤ'< a 0"堆亜&9ネN腸lラ%セ`カ鑓Tヒ,Чワ奠cクm/セ球「颯ノ「T0ミ??^Vヨ o!aオトソワR霾.H 2ス ツタロ;コ韵慶クl-アミ4aコ qメ& @ネjメ「ョ4ケ擅QN|#@7、、Eヌ;7ヌp54Sヘ羣紊?ワEケモノネ「ト `Qc潭」セナ;n梅#マ テ5kョ tツ ユ3兢クリ菲銭ルI8> 8"8蘯.ニー=摸ヲ,B6z_|ル們イ杰ミF4t#シCムiFt顰ゥ゙yツ∃&闍N\y:!訝1 d灑uコ 駕.:d。B俳E! >膽A歓、5Bテ鯖vEO/ヲニx ストEヌe|1\b>F VD"ミ ?jハ`4タIL<霄.ア$ョョ>蓉]1y2ミ゚:巨瑯88ャニネレ?蚩フ!ミmKQz@aミ26昨$\、矣「0ミルワvヤミ?ロュRャ 6ユヘk憶゙@.HC逧イ2`4 9zク@ェ4ォ)"ミ"ソ フ1&@突zq ン/5モ[ール:\/m|m該モfG4t2ヲG1k@]マEセum'オト。d朶エQエオヲ ク?dpナン\・ーY^ウ~シソQKャンーRタロシP:t嬪>ケa #セ幺ヘ*兒稾オl霙}9テqウス7Nョーソ5ヒC蜈 ソ^ウw^Uア2。゚7 ・&AヤナァモmワiPo搴bカヘヒu」ョtKD]?ゥ溏ニy"/;Y゚Rl4ル'ニ$ル^ヲ>=t*=hJ 麗ァスHaマモ拉ウ浪喉ケ@rワk S、^テA、゚"[+{キ ウ{螽」}pワWマ{ 8ョ殼軾アpaーソソ?砠ヌΚホ@予蚶カa4ヌルマ46。テ-,巫qセキ ヲwOk ェ120ェsウ「ヲョ ゚iネDe件ソtヘ±オ}UOE -\I}嫗ツヲ添ュUw亘ヘ}ユサコp飫-ZI} 5ヘタレ:| ラk6)レス燃猶nニD寢 トk С.「a`離DZャ>t絖ァ`ア1\ヨォサMモ テeB艢U}VСTD莉&伝aA]S9'bェ、/ン,メYーツセrウゥP@T゚F溽鉋エTu默 Tシ易扈"K"lEャ.0j休3~?[浴>鵄$(i-キP{ ′9vfP閘セワ墅{タ &dl_宮WK夘?ェ|)屈XレAェリカotホjuuFレマ倉fT}^<唆ノ總PT├ムウ"゙級0NV=シ 4@ナ`アン_fExャ艚&テ共トヨ「6 板@g=萢lァR譽ヘ@'5ナソp ァ窿x浤悚2iニョ虐qLッEキレ曝6ンネ{eS」ク易{r)ト,.b4j8Rサ浴V9SL4盖テ7|ケ\・軣m淮5e湍E ミト, qセZ'J・ス?:ラ洛]HヒlcLm%葬゚#キテ゚?eyrモヘュホ,W郁n伺T>ヒ薺>r"ャ戈弍ョハ0ワR@Iリ8ルタ淪(c荒pソ サ找$eorHエミル|ソ4xA&&?@。|ヒ }ミヤ Z恢ォナラRGNbP6觚ニ:Pャ2ヒ:9:ィ5・+ス。ユf噬斗LノD+ラyE岸g听Gクマホ`Z)釡aコPセe:紊Bnツ|クm鎗<タi)ミョ「hエ>*セョ$}ヒレれsdyDシ129Tィ%DX」,バ邁コシnxヨ♀゚`ノ5ヘ煉ナヘ:?_$H9紿Aフ.ミナ沃粡9エIn 鉤s卯ツヨ躓呈スZスWE*ナ*T゙s∇串イH゚{ミリ辭qUト;1ェtdR 64ロ`?閃/+ミ(Vチ<ナサwrbゥM+}俳D5溷bセPGベ-ィ4ネ%棄螢齦QdG@テ!P♭X9韲ォ hノW<ミゥ C}S-\ョduB!0賞ヲ蜍P"ホヘ*鍬$フチVSa"∵イ゚]hクK>゙(ツリ :H"」/圉昇tル]護シ驚/>/ェMr須-_リ@|Tワ \fL吁F耐l 咼ヲyR踈Mイ゚p栲皚6゙5@)チ膽>Eル轣ホツ。q#ア#ユ]隕ャ\nX9ロョ/ケ・Doサ鍖炙ンキコy齏賜k@q セ。@ラvRh1H零> 宸セ瘁ョユケ」ミト]イヌラ]>テロム[ミEコクs@殱カ鹸.スOオUョュヲォuッo|4エ キ}Pケ V迥ナt゙F+0fム嫗\コー印@」RD|q鎔0セGゥフgホ/ツハ$78務ォ+鳰@ラ6]uトJ]罐y・7ミ─@ヒハ嚢フ嵬t」央ム+"ミy"ヤキ轣..ミo滂<P+'IdラオBq ]YIラコ繭ョ3ォN-&@ソ#B#。c8Jxー8\5OトE"結". タ┥_儒ミM死コWノサツiヨヒ@Gハ漣Qォ_リ6ヘB桎瞻  序褝ケラ1f:+Bヘq闍"n弯>祟゙℃l}8テゥ※糘Mソ0ミ9cw ’a|m?>!N*外DィォTDY5宙ォ@G]ト~盞ニ'Jュdrh纃タ06」@乍R`セK:ミァ"ソミセ-ミア:カ沺ノム Vャオカマ}Nト鶺トyAトェs@ヒWノソhナッcラ&{蛛ヲFh8ミハr#I*エ=夲イオ~鍜C偽ミアワb@]アN浮@+モ游顯-b@a^カ@キ@キ@キ@キ@キ@?ミルc贔*tVトJュtW>&霈;=]6エ酢ォ撥ヘロキキX'コソ>K9%">E\Hトy"ョ}UDu%タbノ@b殕ソ屆^f糲yN醤,-$゚ @/サゥ澣&1詔'ヘd|モctFソス龍=3ラnQウ"ヤオク>#"ハクエハDシ汕xマ勘Xー\ツヌx3マ!k*癩^pトマサp ;SモM"k- ゚j@什fc&Mgル3!'スロンO`墅fハ ょコ;ミシYBBr童釁[カウ[ッ(^ト鼬壱@%@QhクメXG 4]NァRVwケ走x~8斂ヒ!`4緤w:黜ョ梟塵5蘰弾<&@孀w9」)俥@Q恫N1褂ア誣~被{Yhポ争イ@迚( t1@缸`m62;qテ%@`Aゥ ヌモ5-靆ヨsモz 4jmフ^|@COミpnリナLヘ」ュニロ杆リ狆*y>y$「(ミヌ"VYK]ミK 屡)XKy詣v)韭ヨz:]ハhj肯)ミモ{棣gレhシz_}b滉C3r1 虻tW. 「:ミ]PRンp家゙ケ]クソャ翕Rヌ馴ヘxQ]ス 戟・ケワt-$゚j@Oサンナ」5y鐔&4b<メ ;}4tO7ノ廈カ~雉6< mテハ :r|糞6 4跌]℃エr@醪X卻」ア$ミ#サセメカセdK!hカ8~ケ・?))ツヲィク易 *エルカォ エ+罟リエハl^e;ー圧SLqf格ソク添ェロミッモ囂Zウ ユxシ4ル9$ーノ1a"VァiTu嫂10.フセ汕\チク&籏RFャUム翆スFャEGャ侖ニ゙HキYc% &[etpナ,エシノ%唔 英5%G_ヒチ>0rD鑞装韭ーウc ン->H繭糘,qyL。ネ/L笵ヘoョEY ノR%ラー"p ォ:"53善Zマ-'eク"「リィ艸ゥr」セ襠K・\ヒ禀F:S搴ルャuョナイホ_ヤシCヘy9M'V眺キ,r圻EeInc@ラbv4WFケe」/ヤ 2譫笥8a哂Q偕ェウGj4嶺_蟒P工@in tT#゚Z@ソ」}イVPoハG)6ーKァ雨ィ譛e9xQワ Hc旭(蚶" t4!@Cスュメaィ8」zT\タ pe驍舶:.ア1緲セシメM~Wツト} ソツ ク6|9Ph;ヲ ~3 暫そjWmタuQマEDLト隆ァォ}\ァル、脊$嚶L[ユノニ薊?カ{ュメwEi :p5ヘーツォシ%i*fB℃ィ懐イe?~gシJ2カ M+粐,エoテ]ツ壽wレ2・イ ミ)\カ晋サ5ツ0レU6。ナ外%?rQ疽_)o=ム\ゥ溜_ケvワ!クH/[・マgK9ハ__圓遡ッカ寢o聆<^oォミムrcォwcレ-シRレA エニF-階ケ"ヌ※ク1ナフ}夜DDАァ"ムQ鵡」V@9A弍覃q]セタTフッ/$搗.ezノ9皀DD1。ク/ァ$ミT.モk謚Z)キHェ" hVヲ聆J「ヨミ~h_ロクdー果頬W沿ED@威Pト9sjs\スヲ4z|ケ萢6qUエlODト、Sラ$F[krP鈩aE凹ヘエャV枇j職セ^筑argエ。qゥ霏'ィq捏M!ゥクWjVヒED_{.ョCsマノh猾 エッ/ェ-1}エAメU檐"(ウ7_;y゚ァ,ミ85_Xワメ見Qゥェォ8qIノ僕ヨ櫓ナ=Zスウuョ|aフミ7ネンM室ホW0蛹Oケb哲yri瞳HYス/ュァ扼X倦bwヲvEKヨ克 #1」N ミノj鷹6質0+ノ ゚闊T'テ肢Uキsk0掴ヒ,ル7トサタF蓄;}夾!゚モ固 ウ|セスョホォレ鞋Qヘ>チMu蛛.?セFミ佑s@_マ yヲs穩R厄Hヤン]h聴 Mム・|p""蕉ヒニス瓶 ~ネ~、H q uD借i飯モG@GrS"zzu'WqLロカiヌe36ラu」司岾貮&1e?ヨl8"蝸ー=@」マv$zE3M7:ロrS・メミ〔' +ャ=ツ更{ロュ;ョ+ナョ阨pー=クラ.Jt」箪鑿\殼ヲセ+\ォVトマキニ.塵3@0ユタq・゙}tムミ4hJチ。ヤ,dO' Rフセ ロj,ゥクホD uxコ@セヘヘ2ニケキ゚V|<弉]}$#モヤh;Vエ闔iレ`d2 :ur尾iセ:ネ査.I7MjVンムpラ19 テHFシ)ミm阨a健オ$h!}ハs斛コmG英$Gノケ∈ムタタッC1・リ;WU゚護 o丘JVyンblラ-4z ] ゚ff教>カ.。澱M莞`ワォ),」H]。6挈顆レミomC H劒蔑キTッAモ^紗>~靈6韃x|楓ツ@壤リムCI/`ー鮴゚^mu;埴ニキ嚊ハンrォ]w跼ヌz+Oズ6リL恷裔置fコ チ黙涵タO4エ、~L;ソ3-ネ酢;+1]顏法G;カ?@c9.i9f軌女クJx q1愿リi}sM執マO`リクリンヲ@{ン韋@GBi<際Nェ>n>ミ+」ムユノ斧hu3&1ミr土ル+勹「(噫 ? ミヒェ@{oL~コナキKΝ閉w、w、ョスュfセKZ/聳ャr狗zn'コrK盂ノQハヘmhU}ア椹Y顫 pツ洶テVj> pナA・瀧ト#?pO」 hfX )コーキm)|ン,蓚fホiツャハ ユルf、_Kケ1綱コ モテqトWd{擽@_\.Ly}5ィヘkbYルZ3アtVd碼ニコda|縲cウーテPgハr@oキ?タ蔕'ルN?折_{!投瑣2理抑慷ツー?ノ\撞WD6K゚=]& ネIDATコル冦~Zg|P 瞎8幺 .:kR9テ7s慴噐ホフofノ樒а[クgy9sf3 ョHョ -L1」BヒfPト稽!:麗$イ=剥{*JaI,=、D3?楠yiXLV゙斥f"Pカioム ヤ]Noウ^ノ"#チ@ウツソフヌ?セ/?ン;$IB遅ス朧&II「饋イボ式'儖メス}.イ'2R写野}LOf7 詔>L~* 2&&CトL踞eタモア7Zフエセカ ィヲk][s嘔ッユミマォウOャ;ヘpィG莢.ヘ4ケ@ 鰛БIテ!ヲh繖W 泪ォラロス1鬱Q髷ウP!|罰y4ソfnテマェ^Oc%V、S拉ヌPモ73Sミs愀サF吏翕ヌE,輒 }I獎咨聆C> 怎逗3ン[;ヤ,ッ8ヘ'Qウ: ムノeルウ =ミ+ku2鬩z橡DE.ラス鉦?3:,g2鬚!;8ヒ!タ*\bI9ミ:Qラニトsオz。エv、ノ徭&C5Rq+勉ヘゥn×Aエg6@キハョャ。ラ=iヌ0 。4&cOァ 」ウ翆J)u-?77 軅: ヤレC勢ハ撻媼_-「m{タ5韲Y倩lッ&ミwJT@O假,温ノe∝ム幢∵釉kク 顋К, 4*。ュノァャ`ラ普^ッ{h0&龕 &o遏;驂フ c「ヨ)ミ オ=0クオヲ: ミアsァ スサf~ゥホレj>跋イdマUu) 畊モUユ9hU 6ワc皖Pe惠aニ圍ナユ与kィ釶档ヤ5ネ5イ^需ナニ突N俟ヒ轤ナロ・銜訌マラオ`゚uNッ5ォケ/aZ$ミ`/sa\;フヨ摎B_mリ.禮ls!8ァ?Rcd>」ウ橋|ミヘE媚fm・/レム aチチ:ワホョニノ棟ヒァ'I淦"a2ロカ@ノ!vb%ス欹vD12tヲ析キチVヤヤvアO|?;J;|レdキ-マフヨgヲ1@イq+u|崗ャメ跛XsQ羔スm6?9ムフ輅V{疣ュ Lラ%ホQ、GQ瓔QM。 zウ]h!uワヒホg8N^ノb燬嶌胝&チ"aル|B\w0vヘツ3: テソ= X tョナヘ"キ.iェ「AU釜ヲmロ.hA哭pw+8( 竏M嬰疔Zソ゚wヨ?h瞼,lX t)シLホ8ヌ`セ哇-P臍ゥフz鹽キ 8@釟|2RPーッegzト-カ@抜D,5^ ツn7qョネルnンテ憖マリ藉FoキロVキ@7ナzネf,EレAUホ;ィ>゚3[-ネチ押Nウ;(ッッアヤxホ突L0鋪ト-ミmhC tZロミヨ"bィ・チIENDョB`hyperestraier-1.4.13/doc/icon16.png000066400000000000000000000004611125261632700170460ustar00rootroot00000000000000臼NG  IHDR(-S3PLTE786`H,\wQSP/ydHq泳liV盾ャ里、カココホヤメ肄踝Eb\ソ┴tRNS@齎fbKGDH pHYs  訂・tIMEユ !ソ帛ィwIDATモMホ[テ @Q5レj+チfr?マ リrャ漆b[z`ツLp[VPDPマD>チマ w] h=dz`フmuゥ`$=.+ネ#@agヌ"溢ソ4寓レ託nョムッ咫ム'L>ッニA lモ報IENDョB`hyperestraier-1.4.13/doc/index.html000066400000000000000000000175421125261632700172460ustar00rootroot00000000000000 Hyper Estraier: a full-text search system for communities

Hyper Estraier: a full-text search system for communities

Copyright (C) 2004-2007 Mikio Hirabayashi
Last Update: Tue, 06 Mar 2007 12:05:18 +0900

Overview

Hyper Estraier is a full-text search system. You can search lots of documents for some documents including specified words. If you run a web site, it is useful as your own search engine for pages in your site. Also, it is useful as search utilities of mail boxes and file servers.

The characteristic of Hyper Estraier is the following.

  • High performance of search
  • High scalability of target documents
  • Perfect recall ratio by N-gram method
  • High precision by hybrid mechanism of N-gram and morphological analyzer
  • Phrase search, regular expressions, attribute search, and similarity search
  • Multilingualism with Unicode
  • Independent of file format and repository
  • Intelligent web crawler
  • Simple and powerful API
  • Supporting P2P architecture

Hyper Estraier is an open-source software released under the terms of the GNU Lesser General Public License. It works on Linux, Windows, Mac OS X, and other UNIX-like systems.


Documents

The following are documents of Hyper Estraier. They are contained also in the source package.


Download

The following are packages of Hyper Estraier.


Language Bindings

Class libraries for Java are also provided.

Class libraries for Ruby are also provided.

Class libraries for Perl are also provided.

If you are a programmer of Python, SWIG bindings are useful.


Demonstration

The following are demonstration sites of Hyper Estraier.


Related Links

The following are related links of Hyper Estraier.

  • QDBM : internal database engine of Hyper Estraier
  • Libiconv : character code converter used in Hyper Estraier
  • Zlib : data compressor used in Hyper Estraier
  • Estraier : predecessor of Hyper Estraier
  • mod_estraier : Apache module for full-text search as a proxy
  • pgestraier : PostgreSQL interface for Hyper Estraier
  • acts_as_searchable : Ruby on Rails interface for Hyper Estraier
  • Search-Estraier : Perl interface for Hyper Estraier
  • Strigi : desktop search system supporting Hyper Estraier
  • Mew : mailer on Emacs supporing Hyper Estraier

Information

Hyper Estraier was written and is maintained 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, please send it to one of the mailing lists. To join the mailing list in English, refer to `http://lists.sourceforge.net/lists/listinfo/hyperestraier-users'. To join the mailing list in Japanese, refer to `http://lists.sourceforge.net/lists/listinfo/hyperestraier-users-ja'.

The project page on SourceForge.net is `http://sourceforge.net/projects/hyperestraier/'. Update of this project is announced on Freshmeat.net at `http://freshmeat.net/projects/hyperestraier/'.


hyperestraier-1.4.13/doc/index.ja.html000066400000000000000000000320761125261632700176360ustar00rootroot00000000000000 蜈ィ譁讀懃エ「繧キ繧ケ繝繝 Hyper Estraier

雜霑キ蟄: 蜈ア蜷御ス鍋噪蜈ィ譁讀懃エ「邉サ

Copyright (C) 2004-2007 Mikio Hirabayashi
Last Update: Tue, 06 Mar 2007 12:05:18 +0900

讎りヲ

Hyper Estraier縺ッ蜈ィ譁讀懃エ「繧キ繧ケ繝繝縺ァ縺吶ゅ◆縺上&繧薙ョ譁譖ク縺ョ荳ュ縺九i縲∫音螳壹ョ隱槫唱繧貞性繧繧ゅョ繧呈爾縺励※縲∬ゥイ蠖薙☆繧九b縺ョ縺ョ荳隕ァ繧定。ィ遉コ縺吶k縺薙→縺後〒縺阪∪縺吶8eb繧オ繧、繝医r驕句霧縺励※縺繧区婿縺ェ繧峨∬ェ蛻縺ョ繧オ繧、繝亥ーら畑縺ョ讀懃エ「繧ィ繝ウ繧ク繝ウ縺ィ縺励※蛻ゥ逕ィ縺吶k縺薙→縺後〒縺阪∪縺吶ゅΓ繝シ繝ォ繝懊ャ繧ッ繧ケ繧繝輔ぃ繧、繝ォ繧オ繝シ繝舌r蟇セ雎。縺ィ縺励◆讀懃エ「繝繝シ繝ォ縺ィ縺励※蛻ゥ逕ィ縺吶k縺薙→繧ゅ〒縺阪∪縺吶

Hyper Estraier縺ォ縺ッ縲∵ャ。縺ョ繧医≧縺ェ迚ケ蠕エ縺後≠繧翫∪縺吶

  • 繧、繝ウ繝繝繧ッ繧ケ繧剃スソ縺」縺滄ォ倬溘↑讀懃エ「縺後〒縺阪∪縺吶
  • 螟ァ驥上ョ譁譖ク縺ョ繧、繝ウ繝繝繧ッ繧ケ繧堤洒譎る俣縺ァ菴懈舌〒縺阪∪縺吶
  • N-gram譁ケ蠑上↓繧医k貍上l縺ョ縺ェ縺讀懃エ「縺後〒縺阪∪縺吶
  • 蠖「諷狗エ隗」譫舌→N-gram縺ョ繝上う繝悶Μ繝繝画ゥ滓ァ九〒讀懃エ「邊セ蠎ヲ繧貞髄荳翫&縺帙∪縺吶
  • 繝輔Ξ繝シ繧コ讀懃エ「繧豁」隕剰。ィ迴セ讀懃エ「繧螻樊ァ讀懃エ「繧鬘樔シシ讀懃エ「繧偵し繝昴シ繝医@縺セ縺吶
  • 荳也阜蜷蝗ス縺ョ險隱槭′謇ア縺医∪縺吶
  • 蟇セ雎。譁譖ク縺ョ謇蝨ィ繧蠖「蠑上↓萓晏ュ倥@縺セ縺帙s縲
  • 雉「縺Цeb繧ッ繝ュ繝シ繝ゥ縺御サ伜ア槭@縺ヲ縺縺セ縺吶
  • 繝ゥ繧、繝悶Λ繝ェ縺ィ縺励※蜷遞ョ陬ス蜩√↓邨縺ソ霎シ繧√∪縺吶
  • P2P騾」謳コ讖溯ス繧偵し繝昴シ繝医@縺セ縺吶

Hyper Estraier縺ッGNU Lesser General Public License縺ォ蝓コ縺・縺縺ヲ驟榊ク縺輔l繧九ヵ繝ェ繝シ繧ス繝輔ヨ繧ヲ繧ァ繧「縺ァ縺吶Linux縲仝indows縲`ac OS X縺翫h縺ウ縺昴ョ莉悶ョUNIX邉サOS縺ョ荳翫〒蜍穂ス懊@縺セ縺吶


譁譖ク

莉・荳九ョ譁譖ク繧偵♀隱ュ縺ソ縺上□縺輔>縲ゅた繝シ繧ケ繝代ャ繧ア繝シ繧ク縺ォ繧ょ酔縺倥b縺ョ縺悟性縺セ繧後※縺縺セ縺吶


繝繧ヲ繝ウ繝ュ繝シ繝

莉・荳九ョ繝代ャ繧ア繝シ繧ク繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ヲ縺上□縺輔>縲


險隱槭ヰ繧、繝ウ繝繧」繝ウ繧ー

Java縺ョ繧ッ繝ゥ繧ケ繝ゥ繧、繝悶Λ繝ェ繧ら畑諢上@縺ヲ縺縺セ縺吶ョ縺ァ縲驕ゥ螳懊#蛻ゥ逕ィ縺上□縺輔>縲

Ruby縺ョ繧ッ繝ゥ繧ケ繝ゥ繧、繝悶Λ繝ェ繧ら畑諢上@縺ヲ縺縺セ縺吶ョ縺ァ縲驕ゥ螳懊#蛻ゥ逕ィ縺上□縺輔>縲

Perl縺ョ繧ッ繝ゥ繧ケ繝ゥ繧、繝悶Λ繝ェ繧ら畑諢上@縺ヲ縺縺セ縺吶ョ縺ァ縲驕ゥ螳懊#蛻ゥ逕ィ縺上□縺輔>縲

Python繧偵♀菴ソ縺縺ェ繧峨ー縲ヾWIG縺ョ險隱槭ヰ繧、繝ウ繝繧」繝ウ繧ー繧偵#蛻ゥ逕ィ縺上□縺輔>縲


繝繝「繝ウ繧ケ繝医Ξ繝シ繧キ繝ァ繝ウ

莉・荳九ョ繝繝「繧オ繧、繝医r隧ヲ縺励※縺ソ縺ヲ縺上□縺輔>縲


髢「騾」繧オ繧、繝

莉・荳九ッHyper Estraier縺ォ髢「騾」縺吶k繧オ繧、繝医〒縺吶

  • QDBM : Hyper Estraier縺ョ蜀驛ィ縺ァ菴ソ縺」縺ヲ縺繧九ョ繝シ繧ソ繝吶シ繧ケ繝ゥ繧、繝悶Λ繝ェ
  • Libiconv : Hyper Estraier縺ョ蜀驛ィ縺ァ菴ソ縺」縺ヲ縺繧区枚蟄励さ繝シ繝牙、画鋤繝ゥ繧、繝悶Λ繝ェ
  • Zlib : Hyper Estraier縺ョ蜀驛ィ縺ァ菴ソ縺」縺ヲ縺繧九ョ繝シ繧ソ蝨ァ邵ョ繝ゥ繧、繝悶Λ繝ェ
  • Estraier : Hyper Estraier縺ョ蜑崎コォ
  • mod_estraier : 蜈ィ譁讀懃エ「讖溯ス莉倥″繝励Ο繧ッ繧キ縺ョApache繝「繧ク繝・繝シ繝ォ
  • pgestraier : PostgreSQL縺九i繝弱シ繝峨し繝シ繝舌r謫堺ス懊☆繧九う繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ
  • acts_as_searchable : Ruby on Rails縺九i繝弱シ繝峨し繝シ繝舌r謫堺ス懊☆繧九う繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ
  • Search-Estraier : 繝弱シ繝陰PI縺ョPerl繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ
  • Strigi : 繝繝シ繝「繝ウ蝙九ョ繧ケ繧ッ繝医ャ繝玲、懃エ「繝繝シ繝ォ
  • gdestraier : GNOME迺ー蠅縺ョ繝繧ケ繧ッ繝医ャ繝玲、懃エ「繝繝シ繝ォ
  • Mew : Emacs繧ィ繝繧」繧ソ荳翫〒蜍穂ス懊☆繧九Γ繝シ繝ゥ
  • KaMailV3 : xyzzy繧ィ繝繧」繧ソ荳翫〒蜍穂ス懊☆繧九Γ繝シ繝ゥ
  • DesktopHE : Windows逕ィ繝繧ケ繧ッ繝医ャ繝玲、懃エ「繝繝シ繝ォ

縺昴ョ莉悶ョ諠蝣ア

Hyper Estraier縺ッ蟷ウ譫怜ケケ髮縺御ス懈舌@縺セ縺励◆縲ゆス懆縺ィ騾」邨。繧偵→繧九↓縺ッ縲〜mikio@users.sourceforge.net' 螳帙↓髮サ蟄舌Γ繝シ繝ォ繧帝√▲縺ヲ縺上□縺輔>縲ゅ◆縺縺励∬ウェ蝠上d繝舌げ繝ャ繝昴シ繝医↑縺ゥ縲∽サ悶ョ繝ヲ繝シ繧カ縺ィ蜈ア譛峨〒縺阪k隧ア鬘後ッ繝。繝シ繝ェ繝ウ繧ー繝ェ繧ケ繝医↓騾√▲縺ヲ縺上□縺輔>縲ゅΓ繝シ繝ェ繝ウ繧ー繝ェ繧ケ繝医ョ蜿ょ刈譁ケ豕輔↓縺、縺縺ヲ縺ッ縲〜http://lists.sourceforge.net/lists/listinfo/hyperestraier-users-ja'シ域律譛ャ隱朞Lシ峨→ `http://lists.sourceforge.net/lists/listinfo/hyperestraier-users'シ郁恭隱朞Lシ峨r蜿らァ縺励※縺上□縺輔>縲

SourceForge.net縺ォ縺翫¢繧九励Ο繧ク繧ァ繧ッ繝医壹シ繧ク縺ッ `http://sourceforge.net/projects/hyperestraier/' 縺ォ縺ゅj縺セ縺吶Freshmeat縺ォ縺翫¢繧区峩譁ー諠蝣ア縺ッ `http://freshmeat.net/projects/hyperestraier/' 縺九i蜿らァ縺ァ縺阪∪縺吶


hyperestraier-1.4.13/doc/intro-en.html000066400000000000000000000355271125261632700176750ustar00rootroot00000000000000 Introduction of Hyper Estraier Version 1

Introduction

Copyright (C) 2004-2007 Mikio Hirabayashi
Last Update: Tue, 06 Mar 2007 12:05:18 +0900

Table of Contents

  1. Introduction
  2. Installation
  3. Deployment
  4. Complement

Introduction

Hyper Estraier is a full-text search system. You can search lots of documents for some documents including specified words. If you run a web site, it is useful as your own search engine for pages in your site. Also, it is useful as search utilities of mail boxes and file servers.

The characteristic of Hyper Estraier is the following.

  • High performance of search
  • High scalability of target documents
  • Perfect recall ratio by N-gram method
  • High precision by hybrid mechanism of N-gram and morphological analyzer
  • Phrase search, regular expressions, attribute search, and similarity search
  • Multilingualism with Unicode
  • Independent of file format and repository
  • Intelligent web crawler
  • Simple and powerful API
  • Supporting P2P architecture

To begin with, please try the demonstration site of Hyper Estraier so that you will grasp overview of Hyper Estraier.

Hyper Estraier has two aspects. One is as a library to construct a full-text search system. That is, API (application programming interface) is provided for programmers. It enables for you to embed advanced functions of full-text search into your applications.

The other is as an application of the API described above. A command and a CGI script are provided. Using them, you can construct a typical full-text search system without any programming.

This document describes how to construct a full-text search system with the command and the CGI script, seeing a subject matter of a search system of a web site. Let's start with learning of the command and then step to the API.


Installation

This section describes how to install Hyper Estraier with the source package. As for a binary package, see its installation manual.

Preparation

Hyper Estraier is available on UNIX-like systems and Windows NT series. At least, the following environment are supported.

  • Linux 2.2 and later (IA32/IA64/AMD64/SPARC/Alpha)
  • FreeBSD 4.9 and later (IA32/Alpha)
  • Solaris 8 and later (IA32/SPARC)
  • Mac OS X 10.2 and later (IA32/PowerPC)
  • HP-UX 11.11 and later (IA64/PA-RISC)
  • Windows 2000 and later (IA32/IA64/AMD64)

gcc 2.95 or later and make are required to install Hyper Estraier with the source package. They are installed by default on Linux, FreeBSD and so on.

As Hyper Estraier depends on the following libraries, install them beforehand.

  • libiconv : for conversion of character encodings. 1.9.1 or later is suggested (glibc includes it).
  • zlib : for loss-less data compression. 1.2.1 or later is suggested.
  • QDBM : for embedded database. 1.8.75 or later is required.

As well, it is suggested to build QDBM with enabling zlib (./configure --enable-zlib) so that the index of Hyper Estraier becomes smaller. Note that QDBM 1.8.74 or earlier is not supported.

Installation

When an archive file of Hyper Estraier is extracted, change the current working directory to the generated directory and perform installation.

Run the configuration script.

./configure

Build programs.

make

Perform self-diagnostic test.

make check

Install programs. This operation must be carried out by the root user.

make install

Result

When a series of work finishes, the following files will be installed.

/usr/local/include/estraier.h
/usr/local/include/estmtdb.h
/usr/local/include/estnode.h
/usr/local/lib/libestraier.a
/usr/local/lib/libestraier.so.8.38.0
/usr/local/lib/libestraier.so.8
/usr/local/lib/libestraier.so
/usr/local/lib/pkgconfig/hyperestraier.pc
/usr/local/bin/estcmd
/usr/local/bin/estmttest
/usr/local/bin/estmaster
/usr/local/bin/estbutler
/usr/local/bin/estcall
/usr/local/bin/estwaver
/usr/local/bin/estload
/usr/local/bin/estconfig
/usr/local/bin/estwolefind
/usr/local/libexec/estseek.cgi
/usr/local/libexec/estfraud.cgi
/usr/local/libexec/estproxy.cgi
/usr/local/libexec/estscout.cgi
/usr/local/libexec/estsupt.cgi
/usr/local/share/hyperestraier/estseek.conf
/usr/local/share/hyperestraier/estseek.tmpl
/usr/local/share/hyperestraier/estseek.top
/usr/local/share/hyperestraier/estseek.help
/usr/local/share/hyperestraier/estfraud.conf
/usr/local/share/hyperestraier/estproxy.conf
/usr/local/share/hyperestraier/estscout.conf
/usr/local/share/hyperestraier/estsupt.conf
/usr/local/share/hyperestraier/estresult.dtd
/usr/local/share/hyperestraier/estraier.idl
/usr/local/share/hyperestraier/locale/...
/usr/local/share/hyperestraier/filter/...
/usr/local/share/hyperestraier/increm/...
/usr/local/share/hyperestraier/doc/...
/usr/local/man/man1/...
/usr/local/man/man3/...

Mac OS X, HP-UX, and Windows

On Mac OS X, perform `make mac' instead of `make', and `make check-mac' instead of `make check', and `make install-mac' instead of `make install'. As well, `libqdbm.dylib' and so on are created instead of `libestraier.so' and so on.

On HP-UX, perform `make hpux' instead of `make', and `make check-hpux' instead of `make check', and `make install-hpux' instead of `make install'. As well, `libqdbm.sl' is created instead of `libestraier.so' and so on.

On Windows, the Cygwin environment is required for building. Moreover, MinGW versions of zlib, libiconv, regex, QDBM, and Pthreads are required. On that basis, perform `make win'. No installation command is provided for Windows.

Options of configure

The following options can be specified with `./configure'.

  • --enable-debug : build for debugging. Enable debugging symbols, do not perform optimization, and perform static linking.
  • --enable-devel : build for development. Enable debugging symbols, perform optimization, and perform dynamic linking.
  • --enable-mecab : enable MeCab for keyword extraction.
  • --disable-zlib : disable ZLIB compression of the index.
  • --enable-lzo : use LZO compression instead of ZLIB.
  • --enable-bzip : use BZIP2 compression instead of ZLIB.
  • --enable-vista : use Vista database instead of Villa.

Deployment

This section describes how to create an index, and deploy the CGI script.

Administration Command

A database called inverted index is used in order to search for documents quickly. That is, you should make the index containing target documents before you search some of them.

estcmd is provided to administrate indexes. estcmd handles each file on the file system of the local host, as each document. estcmd can register documents to the index and remove them from the index. Moreover, estcmd can gather documents under a directory and register them as a job lot. Supported file formats are plain-text, HTML, and e-mail (MIME).

As other formats are also supported by using filters, the method is mentioned later.

Indexing

It is presupposed that you run a web site and its contents are under `/home/www/public_html'. Then, let's register them into the index as `/home/www/casket'.

cd /home/www
estcmd gather -sd casket /home/www/public_html

Files under `/home/www/public_html' are gathered and registered into a new index named as `casket'. That's all for indexing.

Deployment of the CGI Script

It is presupposed that the URL of a directory for CGI scripts is `http://www.estraier.ad.jp/cgi-bin/' and its local path is `/home/www/cgi-bin'. Then, let's deploy requisite files into there.

cd /home/www/cgi-bin/
cp /usr/local/libexec/estseek.cgi .
cp /usr/local/share/hyperestraier/estseek.* .

`/usr/local/libexec/estseek.cgi', `estseek.(conf|tmpl|top|help)' in `/usr/local/share/hyperestraier/' are copied into `/home/www/cgi-bin/'. estseek.cgi is the CGI script. estseek.conf is the configuration file. estseek.tmpl is the template file. estseek.top is for the message of the top page. estseek.help is for the usage of search functions.

Open estseek.conf with a text editor and modify it. Most items are not needed to be modified, except for `indexname' and `replace'. Do as the following.

indexname: /home/www/casket
...
replace: file:///home/www/public_html/{{!}}http://www.estraier.ad.jp/
...

`indexname' specifies the path of the index. `replace' specifies regular expressions and replacement strings to convert the local URL of each document for the web server.

Let's Try It

All set? Let's access the URL `http://www.estraier.ad.jp/cgi-bin/estseek.cgi' with your favorite web browser. How to use is described on the page.

Updating the Index

When some documents in your site are modified or new documents are added, please update the index at regular intervals. Though it is okay to delete the index and remake it, incremental registration is useful.

The `-sd' option added when indexing is to record modification time of each document. And it is useful for incremental registration. Let's perform the following command.

cd /home/www
estcmd gather -cl -sd -cm casket /home/www/public_html

The option `-cm' is to ignore files which are not modified. The option `-cl' is to clean up data of overwritten documents.

Reflection of Deleted Documents

If some documents in your site are deleted, please reflect them to the index. Let's perform the following command.

cd /home/www
estcmd purge -cl casket

All records in the index are scanned and records of deleted documents are removed. The option `-cl' is to clean up data of overwritten documents.

Optimization

Iteration of `gather' and `purge' makes the index fat gradually. Optimization is to eliminate the dispensable regions and keeps the index small.

cd /home/www
estcmd optimize casket

If `gather' or `purge' is performed without the `-cl' option, records of deleted documents are not deleted though deletion marks was applied to them. `optimize' is useful to delete such void regions.

Automated Administration

`cron' enables you to automate operations for administration. Register the following script to `crontab'.

/usr/local/bin/estcmd gather -cl -sd -cm /home/www/casket /home/www/public_html
/usr/local/bin/estcmd purge -cl /home/www/casket

For more detail

Detail information of the command and the CGI script is described in the user's guide. Moreover, for information of the API, see the programming guide.


Complement

This section describes how to contact the author and the license of Hyper Estraier.

Contact

Hyper Estraier was written and is maintained 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, please send it to one of the mailing lists. To join the mailing list, refer to `http://lists.sourceforge.net/lists/listinfo/hyperestraier-users'.

License

Hyper Estraier 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 any later version.

Hyper Estraier 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 Hyper Estraier (See the file `COPYING'); if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

Acknowledgment

Hyper Estraier was developed under management by Fumitoshi Ukai and supports by Exploratory Software Project of Information-technology Promotion Agency, Japan (IPA).


hyperestraier-1.4.13/doc/intro-ja.html000066400000000000000000000572121125261632700176600ustar00rootroot00000000000000 Introduction of Hyper Estraier Version 1 (Japanese)

繧、繝ウ繝医Ο繝繧ッ繧キ繝ァ繝ウ

Copyright (C) 2004-2007 Mikio Hirabayashi
Last Update: Tue, 06 Mar 2007 12:05:18 +0900

逶ョ谺。

  1. 縺ッ縺倥a縺ォ
  2. 繧、繝ウ繧ケ繝医シ繝ォ
  3. 讀懃エ「讖溯ス縺ョ驟榊y
  4. 陬懆カウ

縺ッ縺倥a縺ォ

Hyper Estraier縺ッ蜈ィ譁讀懃エ「繧キ繧ケ繝繝縺ァ縺吶ゅ◆縺上&繧薙ョ譁譖ク縺ョ荳ュ縺九i縲∫音螳壹ョ隱槫唱繧貞性繧繧ゅョ繧呈爾縺励※縲∬ゥイ蠖薙☆繧九b縺ョ縺ョ荳隕ァ繧定。ィ遉コ縺吶k縺薙→縺後〒縺阪∪縺吶8eb繧オ繧、繝医r驕句霧縺励※縺繧区婿縺ェ繧峨∬ェ蛻縺ョ繧オ繧、繝亥ーら畑縺ョ讀懃エ「繧ィ繝ウ繧ク繝ウ縺ィ縺励※蛻ゥ逕ィ縺吶k縺薙→縺後〒縺阪∪縺吶ゅΓ繝シ繝ォ繝懊ャ繧ッ繧ケ繧繝輔ぃ繧、繝ォ繧オ繝シ繝舌r蟇セ雎。縺ィ縺励◆讀懃エ「繝繝シ繝ォ縺ィ縺励※蛻ゥ逕ィ縺吶k縺薙→繧ゅ〒縺阪∪縺吶

Hyper Estraier縺ォ縺ッ縲∵ャ。縺ョ繧医≧縺ェ迚ケ蠕エ縺後≠繧翫∪縺吶

  • 繧、繝ウ繝繝繧ッ繧ケ繧剃スソ縺」縺滄ォ倬溘↑讀懃エ「縺後〒縺阪∪縺吶
  • 螟ァ驥上ョ譁譖ク縺ョ繧、繝ウ繝繝繧ッ繧ケ繧堤洒譎る俣縺ァ菴懈舌〒縺阪∪縺吶
  • N-gram譁ケ蠑上↓繧医k貍上l縺ョ縺ェ縺讀懃エ「縺後〒縺阪∪縺吶
  • 蠖「諷狗エ隗」譫舌→N-gram縺ョ繝上う繝悶Μ繝繝画ゥ滓ァ九〒讀懃エ「邊セ蠎ヲ繧貞髄荳翫&縺帙∪縺吶
  • 繝輔Ξ繝シ繧コ讀懃エ「繧豁」隕剰。ィ迴セ讀懃エ「繧螻樊ァ讀懃エ「繧鬘樔シシ讀懃エ「繧偵し繝昴シ繝医@縺セ縺吶
  • 荳也阜蜷蝗ス縺ョ險隱槭′謇ア縺医∪縺吶
  • 蟇セ雎。譁譖ク縺ョ謇蝨ィ繧蠖「蠑上↓萓晏ュ倥@縺セ縺帙s縲
  • 雉「縺Цeb繧ッ繝ュ繝シ繝ゥ縺御サ伜ア槭@縺ヲ縺縺セ縺吶
  • 繝ゥ繧、繝悶Λ繝ェ縺ィ縺励※蜷遞ョ陬ス蜩√↓邨縺ソ霎シ繧√∪縺吶
  • P2P騾」謳コ讖溯ス繧偵し繝昴シ繝医@縺セ縺吶

縺セ縺壹ッ縲?yper Estraier縺ョ繝繝「繧オ繧、繝茨シWikipedia讀懃エ「Java縺ョAPI讀懃エ「シ峨r隧ヲ縺励※縺ソ縺ヲ縺上□縺輔>縲Hyper Estraier縺後←繧薙↑繧ゅョ縺九♀蛻縺九j縺縺溘□縺代k縺九→諤昴>縺セ縺吶

Hyper Estraier縺ッ莠後▽縺ョ蛛エ髱「繧呈戟縺。縺セ縺吶ゆク縺、逶ョ縺ッ縲∝ィ譁讀懃エ「繧キ繧ケ繝繝繧呈ァ狗ッ峨☆繧九◆繧√ョ繝ゥ繧、繝悶Λ繝ェ縺ァ縺ゅk縺薙→縺ァ縺吶ゅ▽縺セ繧翫√励Ο繧ー繝ゥ繝槭′蛻ゥ逕ィ縺吶kAPIシApplication Programming Interfaceシ峨r蛯吶∴縺ヲ縺縺セ縺吶Hyper Estraier縺ョAPI繧貞茜逕ィ縺吶k縺薙→縺ォ繧医j縲∝ィ譁讀懃エ「縺ョ鬮伜コヲ縺ェ讖溯ス繧定ェ蛻縺ョ繝励Ο繧ー繝ゥ繝縺ォ邁。蜊倥↓邨縺ソ霎シ繧縺薙→縺後〒縺阪∪縺吶

莠後▽逶ョ縺ッ縲∽ク願ソー縺ョAPI繧剃スソ縺」縺溘い繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ァ縺ゅk縺薙→縺ァ縺吶よ、懃エ「逕ィ縺ョ繧、繝ウ繝繝繧ッ繧ケ繧堤ョ。逅縺吶k繧ウ繝槭Φ繝峨→縲仝eb繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縺ァ讀懃エ「繧定。後≧縺溘a縺ョCGI繧ケ繧ッ繝ェ繝励ヨ縺梧署萓帙&繧後∪縺吶ゅ◎繧後i繧剃スソ縺縺薙→縺ォ繧医j縲∝ク蝙狗噪縺ェ讀懃エ「繧キ繧ケ繝繝縺ェ繧峨励Ο繧ー繝ゥ繝溘Φ繧ー繧偵@縺ェ縺縺ァ讒狗ッ峨☆繧九%縺ィ縺後〒縺阪∪縺吶

縺薙ョ譁譖ク縺ァ縺ッ縲仝eb繧オ繧、繝医ョ讀懃エ「讖溯ス繧帝。梧攝縺ォ縲∽ク願ソー縺ョ繧ウ繝槭Φ繝峨→CGI繧ケ繧ッ繝ェ繝励ヨ繧剃スソ縺」縺ヲ讀懃エ「繧キ繧ケ繝繝繧呈ァ狗ッ峨☆繧区婿豕輔r隱ャ譏弱@縺セ縺吶ゅ∪縺壹ッ莉伜ア槭ョ繧ウ繝槭Φ繝峨→繧ГGI繧ケ繧ッ繝ェ繝励ヨ繧貞茜逕ィ譁ケ豕輔r鄙貞セ励@縺ヲ縺九i縲√◎繧後〒縺ッ螳溽樟縺ァ縺阪↑縺讖溯ス縺悟ソ隕√↑繧峨ーAPI繧剃スソ縺」縺溘い繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ァ陬懊≧繧医≧縺ォ縺吶k縺ィ繧医>縺ァ縺励g縺縲Hyper Estraier縺ッ雎雁ッ後↑讖溯ス繧貞y縺医※縺縺セ縺吶′縲√◎縺ョ蜈ィ縺ヲ縺ョ菴ソ縺譁ケ繧定ヲ壹∴繧句ソ隕√ッ縺ゅj縺セ縺帙s縲8eb繧オ繧、繝医ョ讀懃エ「繧キ繧ケ繝繝繧呈ァ狗ッ峨☆繧九↑繧峨√%縺ョ譁譖ク縺縺題ェュ繧√ー蜊∝縺ァ縺吶


繧、繝ウ繧ケ繝医シ繝ォ

Hyper Estraier縺ョ繧ス繝シ繧ケ繝代ャ繧ア繝シ繧ク縺九i縺ョ繧、繝ウ繧ケ繝医シ繝ォ譁ケ豕輔r隱ャ譏弱@縺セ縺吶ゅヰ繧、繝翫Μ繝代ャ繧ア繝シ繧ク縺ョ繧、繝ウ繧ケ繝医シ繝ォ譁ケ豕輔↓縺、縺縺ヲ縺ッ縺昴l縺槭l縺ョ繝代ャ繧ア繝シ繧ク縺ョ隱ャ譏取嶌繧偵#隕ァ縺上□縺輔>縲

蜑肴署

Hyper Estraier縺ョ迴セ蝨ィ繝舌シ繧ク繝ァ繝ウ縺ッ縲ゞNIX邉サ縺翫h縺ウWindows NT邉サ縺ョOS縺ァ蛻ゥ逕ィ縺吶k縺薙→縺後〒縺阪∪縺吶ょー代↑縺上→繧ゅ∽サ・荳九ョ迺ー蠅縺ァ縺ッ蜍穂ス懊☆繧九ッ縺壹〒縺吶

  • Linux 2.2莉・髯 (IA32/IA64/AMD64/SPARC/Alpha)
  • FreeBSD 4.9莉・髯 (IA32/Alpha)
  • Solaris 8莉・髯 (IA32/SPARC)
  • Mac OS X 10.2莉・髯 (IA32/PowerPC)
  • HP-UX 11.11莉・髯 (IA64/PA-RISC)
  • Windows 2000莉・髯 (IA32/IA64/AMD64)

繧ス繝シ繧ケ繝代ャ繧ア繝シ繧ク繧堤畑縺縺ヲHyper Estraier繧偵う繝ウ繧ケ繝医シ繝ォ縺吶k縺ォ縺ッ縲gcc縺ョ繝舌シ繧ク繝ァ繝ウ2.95莉・髯阪→make縺悟ソ隕√〒縺吶ゅ◎繧後i縺ッLinux繧ЁreeBSD縺ォ縺ッ讓呎コ也噪縺ォ繧、繝ウ繧ケ繝医シ繝ォ縺輔l縺ヲ縺縺セ縺吶

Hyper Estraier縺ッ縲∽サ・荳九ョ繝ゥ繧、繝悶Λ繝ェ繧貞茜逕ィ縺励※縺縺セ縺吶ゆコ医a縺昴l繧峨r繧、繝ウ繧ケ繝医シ繝ォ縺励※縺翫>縺ヲ縺上□縺輔>縲

  • libiconv : 譁蟄励さ繝シ繝牙、画鋤縲ゅヰ繝シ繧ク繝ァ繝ウ1.9.1莉・髯搾シglibc縺ォ繧ょ酔譴アシ峨
  • zlib : 蜿ッ騾繝繝シ繧ソ蝨ァ邵ョ縲ゅヰ繝シ繧ク繝ァ繝ウ1.2.1莉・髯阪
  • QDBM : 邨縺ソ霎シ縺ソ逕ィ繝繝シ繧ソ繝吶シ繧ケ縲ゅヰ繝シ繧ク繝ァ繝ウ1.8.75莉・髯阪

縺ェ縺翫_DBM繧偵う繝ウ繧ケ繝医シ繝ォ縺吶k髫帙↓縺ッ縲】lib繧呈怏蜉ケ蛹厄シ./configure --enable-zlibシ峨@縺ヲ縺翫¥縺薙→繧偵♀阮ヲ繧√@縺セ縺吶ゅ◎縺ョ譁ケ縺粂yper Estraier縺ョ菴懊k繧、繝ウ繝繝繧ッ繧ケ縺悟ー上&縺上↑繧翫∪縺吶2DBM縺ョ1.8.74莉・蜑阪ョ繝舌シ繧ク繝ァ繝ウ縺ッ繧オ繝昴シ繝医&繧後∪縺帙s縺ョ縺ァ豕ィ諢上@縺ヲ縺上□縺輔>縲

繝薙Ν繝峨→繧、繝ウ繧ケ繝医シ繝ォ

Hyper Estraier縺ョ驟榊ク逕ィ繧「繝シ繧ォ繧、繝悶ヵ繧。繧、繝ォ繧貞ア暮幕縺励◆繧峨∫函謌舌&繧後◆繝繧」繝ャ繧ッ繝医Μ縺ォ蜈・縺」縺ヲ繧、繝ウ繧ケ繝医シ繝ォ菴懈・ュ繧定。後>縺セ縺吶

configure繧ケ繧ッ繝ェ繝励ヨ繧貞ョ溯。後@縺ヲ縲√ン繝ォ繝臥腸蠅繧定ィュ螳壹@縺セ縺吶

./configure

繝励Ο繧ー繝ゥ繝繧偵ン繝ォ繝峨@縺セ縺吶

make

繝励Ο繧ー繝ゥ繝縺ョ閾ェ蟾ア險コ譁ュ繝繧ケ繝医r陦後>縺セ縺吶

make check

繝励Ο繧ー繝ゥ繝繧偵う繝ウ繧ケ繝医シ繝ォ縺励∪縺吶ゆス懈・ュ縺ッroot繝ヲ繝シ繧カ縺ァ陦後>縺セ縺吶

make install

邨先棡

荳騾」縺ョ菴懈・ュ縺檎オゅk縺ィ縲∽サ・荳九ョ繝輔ぃ繧、繝ォ縺後う繝ウ繧ケ繝医シ繝ォ縺輔l縺セ縺吶

/usr/local/include/estraier.h
/usr/local/include/estmtdb.h
/usr/local/include/estnode.h
/usr/local/lib/libestraier.a
/usr/local/lib/libestraier.so.8.38.0
/usr/local/lib/libestraier.so.8
/usr/local/lib/libestraier.so
/usr/local/lib/pkgconfig/hyperestraier.pc
/usr/local/bin/estcmd
/usr/local/bin/estmttest
/usr/local/bin/estmaster
/usr/local/bin/estbutler
/usr/local/bin/estcall
/usr/local/bin/estwaver
/usr/local/bin/estload
/usr/local/bin/estconfig
/usr/local/bin/estwolefind
/usr/local/libexec/estseek.cgi
/usr/local/libexec/estfraud.cgi
/usr/local/libexec/estproxy.cgi
/usr/local/libexec/estscout.cgi
/usr/local/libexec/estsupt.cgi
/usr/local/share/hyperestraier/estseek.conf
/usr/local/share/hyperestraier/estseek.tmpl
/usr/local/share/hyperestraier/estseek.top
/usr/local/share/hyperestraier/estseek.help
/usr/local/share/hyperestraier/estfraud.conf
/usr/local/share/hyperestraier/estproxy.conf
/usr/local/share/hyperestraier/estscout.conf
/usr/local/share/hyperestraier/estsupt.conf
/usr/local/share/hyperestraier/estresult.dtd
/usr/local/share/hyperestraier/estraier.idl
/usr/local/share/hyperestraier/locale/...
/usr/local/share/hyperestraier/filter/...
/usr/local/share/hyperestraier/increm/...
/usr/local/share/hyperestraier/doc/...
/usr/local/man/man1/...
/usr/local/man/man3/...

Mac OS X縺ィHP-UX縺ィWindows

Mac OS X縺ョ蝣エ蜷医√make縲阪ョ莉」繧上j縺ォ縲make mac縲阪√make check縲阪ョ莉」繧上j縺ォ縲make check-mac縲阪√make install縲阪ョ莉」繧上j縺ォ縲make install-mac縲阪r螳溯。後@縺ヲ縺上□縺輔>縲ゅ↑縺翫`ac OS X縺ァ縺ッ蜈ア譛峨Λ繧、繝悶Λ繝ェ縺ョ蜻ス蜷崎ヲ丞援縺檎焚縺ェ繧翫∪縺吶ゅlibestraier.1.0.0.dylib縲阪libestraier.1.dylib縲阪libestraier.dylib縲阪↓縺ェ繧翫∪縺吶

HP-UX縺ョ蝣エ蜷医√make縲阪ョ莉」繧上j縺ォ縲make hpux縲阪√make check縲阪ョ莉」繧上j縺ォ縲make check-hpux縲阪√make install縲阪ョ莉」繧上j縺ォ縲make install-hpux縲阪r螳溯。後@縺ヲ縺上□縺輔>縲ゅ↑縺翫?P-UX縺ァ縺ッ蜈ア譛峨Λ繧、繝悶Λ繝ェ縺ョ蜻ス蜷崎ヲ丞援縺檎焚縺ェ繧翫∪縺吶ゅlibestraier.sl縲阪↓縺ェ繧翫∪縺吶

Windows荳翫〒繝薙Ν繝峨r陦後≧蝣エ蜷医↓縺ッ縲,ygwin縺翫h縺ウMinGW縺ョ髢狗匱迺ー蠅縺悟ソ隕√〒縺吶ゅ∪縺溘】lib縺ィlibiconv縺ィQDBM縺ョMinGW迚医′縺昴l縺槭l繧、繝ウ繧ケ繝医シ繝ォ縺輔l縺ヲ縺繧句ソ隕√′縺ゅj縺セ縺吶ゅ◎縺ョ荳翫〒縲√make win縲阪r螳溯。後@縺ヲ縺上□縺輔>縲8indows逕ィ縺ョ繧、繝ウ繧ケ繝医シ繝ォ繧ウ繝槭Φ繝峨ッ逕ィ諢上&繧後※縺縺セ縺帙s縲8indows迚医ョ繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ繧貞虚菴懊&縺帙k縺ォ縺ッ縲√estraier.dll縲阪□縺代〒縺ェ縺上√mgwz.dll縲阪libiconv-2.dll縲阪regex.dll縲阪qdbm.dll縲阪pthreadGC2.dll縲阪b蠢隕√〒縺吶ゅ↑縺翫仝indows迚医ョ繝舌う繝翫Μ繝代ャ繧ア繝シ繧ク縺ォ縺ッ蠢隕√↑繝ゥ繧、繝悶Λ繝ェ縺悟ィ縺ヲ邏阪a繧峨l縺ヲ縺縺セ縺吶ョ縺ァ縲√◎縺。繧峨r菴ソ縺縺薙→繧偵♀阮ヲ繧√@縺セ縺吶

configure縺ョ繧ェ繝励す繝ァ繝ウ

縲./configure縲阪r螳溯。後☆繧矩圀縺ォ縺ッ縲∽サ・荳九ョ繧ェ繝励す繝ァ繝ウ繧呈欠螳壹☆繧九%縺ィ縺後〒縺阪∪縺吶

  • --enable-debug : 繝繝舌ャ繧ー逕ィ縺ォ繝薙Ν繝峨@縺セ縺吶ゅョ繝舌ャ繧ー繧キ繝ウ繝懊Ν繧呈怏蜉ケ蛹悶@縲∵怙驕ゥ蛹悶r陦後o縺壹髱咏噪縺ォ繝ェ繝ウ繧ッ縺励∪縺吶
  • --enable-devel : 髢狗匱逕ィ縺ォ繝薙Ν繝峨@縺セ縺吶ゅョ繝舌ャ繧ー繧キ繝ウ繝懊Ν繧呈怏蜉ケ蛹悶@縲∵怙驕ゥ蛹悶r陦後>縲∝虚逧縺ォ繝ェ繝ウ繧ッ縺励∪縺吶
  • --enable-mecab : MeCab縺ォ繧医k繧ュ繝シ繝ッ繝シ繝画歓蜃コ繧呈怏蜉ケ縺ォ縺励∪縺吶
  • --disable-zlib : ZLIB縺ォ繧医k霆「鄂ョ繧、繝ウ繝繝繧ッ繧ケ縺ョ繝ャ繧ウ繝シ繝牙悸邵ョ繧堤┌蜉ケ縺ォ縺励∪縺吶
  • --enable-lzo : ZLIB蝨ァ邵ョ縺ョ莉」繧上j縺ォLZO蝨ァ邵ョ繧堤畑縺縺セ縺吶
  • --enable-bzip : ZLIB蝨ァ邵ョ縺ョ莉」繧上j縺ォBZIP2蝨ァ邵ョ繧堤畑縺縺セ縺吶
  • --enable-vista : Villa繝繝シ繧ソ繝吶シ繧ケ縺ョ莉」繧上j縺ォVista繝繝シ繧ソ繝吶シ繧ケ繧堤畑縺縺セ縺吶

MeCab繧堤オ縺ソ霎シ繧蝣エ蜷医`eCab縺ョ繝舌シ繧ク繝ァ繝ウ0.92莉・髯阪→縲`eCab-IPADIC縺ョ2.7.0莉・荳翫r逕ィ縺縲∬セ樊嶌縺ョ譁蟄励さ繝シ繝峨ッEUC-JPシ医ョ繝輔か繝ォ繝茨シ峨↓縺励※縺上□縺輔>縲


讀懃エ「讖溯ス縺ョ驟榊y

Web繧オ繧、繝医ョ讀懃エ「讖溯ス繧剃セ九↓縺ィ縺」縺ヲ縲∵、懃エ「讖溯ス繧貞虚菴懊&縺帙k縺溘a縺ョ謇矩繧定ェャ譏弱@縺セ縺吶よэ螟悶↓邁。蜊倥↓縺ァ縺阪∪縺吶ョ縺ァ縲√●縺イ螳滄圀縺ォ險ュ鄂ョ縺励※縺ソ縺ヲ縺上□縺輔>縲

繧、繝ウ繝繝繧ッ繧ケ邂。逅逕ィ縺ョ繧ウ繝槭Φ繝

Hyper Estraier縺ァ縺ッ縲鬮倬溘↑讀懃エ「繧貞庄閭ス縺ォ縺吶k縺溘a縺ォ縲∬サ「鄂ョ繧、繝ウ繝繝繧ッ繧ケ縺ィ蜻シ縺ー繧後k繝繝シ繧ソ繝吶シ繧ケ繧貞茜逕ィ縺励∪縺吶ゅ▽縺セ繧翫∵、懃エ「繧定。後≧蜑阪↓縲∵、懃エ「蟇セ雎。縺ョ譁譖ク繧堤匳骭イ縺励◆霆「鄂ョ繧、繝ウ繝繝繧ッ繧ケ繧呈ァ狗ッ峨@縺ヲ縺翫¥蠢隕√′縺ゅj縺セ縺吶ゆサ・蠕後ッ霆「鄂ョ繧、繝ウ繝繝繧ッ繧ケ縺ョ縺薙→繧貞腰縺ォ繧、繝ウ繝繝繧ッ繧ケ縺ィ險縺縺セ縺吶

繧、繝ウ繝繝繧ッ繧ケ繧堤ョ。逅縺吶k縺溘a縺ォ縲estcmd縺ィ縺縺繧ウ繝槭Φ繝峨′謠蝉セ帙&繧後∪縺吶estcmd縺ッ繝ュ繝シ繧ォ繝ォ繝帙せ繝医ョ繝輔ぃ繧、繝ォ繧キ繧ケ繝繝荳翫↓縺ゅk蛟九縺ョ繝輔ぃ繧、繝ォ繧呈枚譖ク縺ィ縺励※謇ア縺縺セ縺吶ゅう繝ウ繝繝繧ッ繧ケ縺ォ譁譖ク繧堤匳骭イ縺励◆繧翫√う繝ウ繝繝繧ッ繧ケ蜀縺ョ譁譖ク諠蝣ア繧貞炎髯、縺吶k縺薙→縺後〒縺阪∪縺吶ゅ∪縺溘∫音螳壹ョ繝繧」繝ャ繧ッ繝医Μ縺ョ莉・荳九ョ譁譖ク繧剃ク諡ャ縺励※逋サ骭イ縺吶k縺薙→繧ゅ〒縺阪∪縺吶ょッセ蠢懊@縺ヲ縺繧区枚譖ク縺ョ蠖「蠑上ッ縲√励Ξ繝シ繝ウ繝繧ュ繧ケ繝医→縲?TML縺ィ髮サ蟄舌Γ繝シ繝ォシMIMEシ峨〒縺吶

縺昴ョ莉悶ョ蠖「蠑上ョ譁譖ク繧呈桶縺」縺溘j縲√Μ繝「繝シ繝医帙せ繝医↓縺ゅk繝輔ぃ繧、繝ォ繧呈桶縺」縺溘j縺吶k縺薙→繧ゅ〒縺阪k縺ョ縺ァ縺吶′縲√◎縺ョ譁ケ豕輔↓縺、縺縺ヲ縺ッ蠕後隱ャ譏弱@縺セ縺吶

繧、繝ウ繝繝繧ッ繧ケ縺ョ菴懈

縺ゅ↑縺溘′Web繧オ繧、繝医r驕句霧縺励※縺縺ヲ縲√◎縺ョ繧ウ繝ウ繝繝ウ繝縺後/home/www/public_html縲堺サ・荳九↓鄂ョ縺縺ヲ縺ゅk縺ィ縺励∪縺励g縺縲ゅ◎縺ョ荳九↓縺ゅk蜈ィ縺ヲ縺ョHTML繝輔ぃ繧、繝ォ繧堤匳骭イ縺励◆繧、繝ウ繝繝繧ッ繧ケ繧偵/home/www/casket縲阪→縺励※菴懈舌☆繧九%縺ィ縺ォ縺励∪縺吶ゅ◎繧後↓縺ッ縲∽サ・荳九ョ繧ウ繝槭Φ繝峨r螳溯。後@縺セ縺吶

cd /home/www
estcmd gather -il ja -sd casket /home/www/public_html

/home/www/public_html縲堺サ・荳九ョ譁譖ク繧貞庶髮縺励※縲casket縺ィ縺縺蜷榊燕縺ョ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懊k縺ィ縺縺諢丞袖縺ァ縺吶ゅ-il ja縲阪が繝励す繝ァ繝ウ縺ッ縲∵枚蟄励さ繝シ繝峨ョ蛻、螳壽凾縺ォ譌・譛ャ隱槭r蜆ェ蜈医☆繧九→縺縺諢丞袖縺ァ縺吶ゅ-sd縲阪が繝励す繝ァ繝ウ縺ッ縲√ヵ繧。繧、繝ォ縺ョ菴懈先律譎ゅ→譖エ譁ー譌・譎ゅr繧、繝ウ繝繝繧ッ繧ケ縺ォ險倬鹸縺吶k縺ィ縺縺諢丞袖縺ァ縺吶ょョ溯。後☆繧九→縲騾イ謐礼憾諷九ョ繝ュ繧ー繝。繝繧サ繝シ繧ク縺悟コ縺ヲ縺九i縲casket縺ィ縺縺繝繧」繝ャ繧ッ繝医Μ縺御ス懈舌&繧後∪縺吶ゅ%縺ョ繝繧」繝ャ繧ッ繝医Μ縺後う繝ウ繝繝繧ッ繧ケ縺ァ縺吶ゅう繝ウ繝繝繧ッ繧ケ縺ョ菴懈舌↓蠢隕√↑謇矩縺ッ縺薙l縺縺代〒縺吶

讀懃エ「逕ィCGI繧ケ繧ッ繝ェ繝励ヨ

讀懃エ「縺ッWeb繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縺ァ陦後>縺セ縺吶8eb繝悶Λ繧ヲ繧カ縺ァ讀懃エ「逕ィ繝壹シ繧ク縺ォ繧「繧ッ繧サ繧ケ縺吶k縺薙→縺ァ縲∵、懃エ「繧定。後>縺セ縺吶estseek.cgi縺ッ縺昴ョ縺溘a縺ョCGI繧ケ繧ッ繝ェ繝励ヨ縺ァ縺吶CGI繧ケ繧ッ繝ェ繝励ヨ繧貞虚菴懊&縺帙k縺溘a縺ョWeb繧オ繝シ繝舌ョ險ュ螳壹↓縺、縺縺ヲ縺ッ縲∝推繧オ繝シ繝舌ョ繝槭ル繝・繧「繝ォ繧偵#隕ァ縺上□縺輔>縲

讀懃エ「逕ィ繝壹シ繧ク縺ョ險ュ鄂ョ

CGI繧ケ繧ッ繝ェ繝励ヨ縺ョ險ュ鄂ョ蝣エ謇縺ョURL縺後http://www.estraier.ad.jp/cgi-bin/縲阪〒縲√◎縺ョ繝ュ繝シ繧ォ繝ォ縺ョ繝代せ縺後/home/www/cgi-bin縲阪□縺ィ縺励∪縺励g縺縲ゅ◎縺ョ蝣エ蜷医∽サ・荳九ョ繧ウ繝槭Φ繝峨r螳溯。後@縺セ縺吶

cd /home/www/cgi-bin/
cp /usr/local/libexec/estseek.cgi .
cp /usr/local/share/hyperestraier/estseek.* .

/usr/local/libexec/estseek.cgi縲阪→縲√/usr/local/share/hyperestraier/縲阪↓縺ゅkestseek.conf縺ィestseek.tmpl縺ィestseek.top縺ィestseek.help繧偵√/home/www/cgi-bin/縲阪↓繧ウ繝斐シ縺吶k縺ィ縺縺諢丞袖縺ァ縺吶estseek.cgi縺ッCGI繧ケ繧ッ繝ェ繝励ヨ縺ァ縺吶estseek.conf縺ッ險ュ螳壹ヵ繧。繧、繝ォ縺ァ縺吶estseek.tmpl縺ッ讀懃エ「繝壹シ繧ク縺ョ繝繝ウ繝励Ξ繝シ繝医ヵ繧。繧、繝ォ縺ァ縺吶estseek.top縺ッ讀懃エ「繝壹シ繧ク縺ョ蛻晄悄逕サ髱「縺ョ繝。繝繧サ繝シ繧ク繧定ィ倩ソー縺励◆繝輔ぃ繧、繝ォ縺ァ縺吶estseek.help縺ッ讀懃エ「讖溯ス縺ョ邁。蜊倥↑菴ソ縺譁ケ繧定ィ倩ソー縺励◆繝輔ぃ繧、繝ォ縺ァ縺吶ゅ↑縺翫√◎繧後i繧呈律譛ャ隱槫喧縺励◆繧ゅョ縺後/usr/local/share/hyperestraier/locale/ja/縲阪ョ荳九↓縺ゅj縺セ縺吶ョ縺ァ縲√◎縺。繧峨r蛻ゥ逕ィ縺励※繧ゅh縺縺ァ縺励g縺縲

驕ゥ蠖薙↑繝繧ュ繧ケ繝医お繝繧」繧ソ縺ァ縲∬ィュ鄂ョ縺輔l縺estseek.conf繧帝幕縺縺ヲ邱ィ髮縺励∪縺吶ょ、壹¥縺ョ鬆逶ョ縺ッ縺昴ョ縺セ縺セ縺ァ繧医>縺ョ縺ァ縺吶′縲indexname縺ィreplace縺縺代ッ螟画峩縺吶k蠢隕√′縺ゅj縺セ縺吶ゆサ・荳九ョ繧医≧縺ォ譖ク縺阪∪縺吶

indexname: /home/www/casket
...
replace: file:///home/www/public_html/{{!}}http://www.estraier.ad.jp/
...

indexname縺ッ繧、繝ウ繝繝繧ッ繧ケ縺ョ繝代せ繧呈欠螳壹@縺セ縺吶replace縺ッ繝ュ繝シ繧ォ繝ォ逕ィ縺ョURI繧淡eb繧オ繝シ繝千畑縺ョURI縺ォ螟画鋤縺吶k謖螳壹〒縺吶ゅ{{!}}縲阪ョ蜑榊セ後↓繝ュ繝シ繧ォ繝ォ縺ョ謗・鬆ュ霎槭→Web繧オ繝シ繝千畑縺ョ謗・鬆ュ霎槭r譖ク縺阪∪縺吶

菴ソ縺」縺ヲ縺ソ繧医≧

縺薙l縺ァ貅門y縺ッOK縺ァ縺吶8eb繝悶Λ繧ヲ繧カ縺ァ縲√http://www.estraier.ad.jp/cgi-bin/estseek.cgi縲阪↓繧「繧ッ繧サ繧ケ縺励※縺ソ縺ヲ縺上□縺輔>縲りゥウ縺励>菴ソ縺譁ケ縺ッ縺昴ョ繝壹シ繧ク縺ォ譖ク縺縺ヲ縺ゅj縺セ縺吶

繧、繝ウ繝繝繧ッ繧ケ縺ョ譖エ譁ー

繧オ繧、繝亥縺ョ譁譖ク縺梧峩譁ー縺輔l縺溘j縲∵眠縺励>譁譖ク縺瑚ソス蜉縺輔l縺溘j縺励◆蝣エ蜷医驕ゥ蠖薙↑鬆サ蠎ヲ縺ァ繧、繝ウ繝繝繧ッ繧ケ繧よ峩譁ー縺吶k縺ィ繧医>縺ァ縺励g縺縲ょ商縺繧、繝ウ繝繝繧ッ繧ケ繧貞炎髯、縺励※譁ー縺励¥菴懊j縺ェ縺翫@縺ヲ繧ゅh縺縺ョ縺ァ縺吶′縲?yper Estraier縺ァ縺ッ繧、繝ウ繝繝繧ッ繧ケ縺ョ蟾ョ蛻逋サ骭イ繧偵☆繧九%縺ィ繧ゅ〒縺阪∪縺吶

繧、繝ウ繝繝繧ッ繧ケ繧剃ス懊k髫帙↓縲-sd縲阪が繝励す繝ァ繝ウ繧偵▽縺代※繝輔ぃ繧、繝ォ縺ョ譖エ譁ー譎ょ綾繧定ィ倬鹸縺励※縺縺溘ョ縺ッ縲∝キョ蛻逋サ骭イ縺ョ縺溘a縺ァ縺吶よ峩譁ー譎ょ綾繧定ィ倬鹸縺励◆繧、繝ウ繝繝繧ッ繧ケ縺ォ蟇セ縺励※縺ッ縲√-cl縲阪→縲-sd縲阪→縲-cm縲阪が繝励す繝ァ繝ウ繧偵▽縺代※譖エ譁ー繧定。後≧縺薙→縺ァ縲∝キョ蛻逋サ骭イ繧定。後≧縺薙→縺後〒縺阪∪縺吶

cd /home/www
estcmd gather -cl -il ja -sd -cm casket /home/www/public_html

-cm縲阪が繝励す繝ァ繝ウ繧偵▽縺代k縺ィ縲√∪縺繧、繝ウ繝繝繧ッ繧ケ蜀縺ォ蟄伜惠縺励↑縺縺九∝燕縺ォ逋サ骭イ縺励◆譎ゅh繧頑峩譁ー譎ょ綾縺梧眠縺励>譁譖ク縺ョ縺ソ繧堤匳骭イ縺励∪縺吶ゅ↑縺翫∵里蟄倥ョ譁譖ク縺ィURL縺悟酔縺俶枚譖ク繧堤匳骭イ縺吶k縺ィ荳頑嶌縺阪&繧後∪縺吶ョ縺ァ縲∝商縺譁譖ク縺ッ讀懃エ「縺ォ繝偵ャ繝医@縺ェ縺上↑繧翫∪縺吶ゅ-cl縲阪が繝励す繝ァ繝ウ繧偵▽縺代k縺ィ縲∽ク頑嶌縺阪&繧後◆譁譖ク縺悟性繧薙〒縺縺溯ェ槫唱縺ョ繧、繝ウ繝繝繧ッ繧ケ繧貞肴ァ狗ッ峨@縺セ縺吶よャ。縺ォ譖エ譁ー繧偵☆繧区凾縺ョ縺溘a縺ォ縲-sd縲阪が繝励す繝ァ繝ウ繧ゅ▽縺代※譖エ譁ー譌・譎ゅr險倬鹸縺励※縺縺セ縺吶

蜑企勁譁譖ク縺ョ蜿肴丐

繧オ繧、繝亥縺ョ譁譖ク縺悟炎髯、縺輔l縺溷エ蜷医b縲√◎繧後r繧、繝ウ繝繝繧ッ繧ケ縺ォ蜿肴丐縺励※讀懃エ「縺ォ繝偵ャ繝医@縺ェ縺繧医≧縺ォ縺励∪縺吶ゆサ・荳九ョ繧ウ繝槭Φ繝峨r螳溯。後@縺セ縺吶

cd /home/www
estcmd purge -cl casket

繧、繝ウ繝繝繧ッ繧ケ蜀縺ョ譁譖ク諠蝣ア繧偵せ繧ュ繝」繝ウ縺励※縲∝縺ョ蝣エ謇縺ォ繝輔ぃ繧、繝ォ縺後↑縺繧ゅョ繧貞炎髯、縺励∪縺吶ゅ-cl縲阪が繝励す繝ァ繝ウ縺ッ縲∝炎髯、縺輔l縺滓枚譖ク縺悟性繧薙〒縺縺溯ェ槫唱縺ョ繧、繝ウ繝繝繧ッ繧ケ繧貞肴ァ狗ッ峨☆繧九%縺ィ繧呈欠遉コ縺励∪縺吶

繧、繝ウ繝繝繧ッ繧ケ縺ョ譛驕ゥ蛹

譁譖ク縺ョ逋サ骭イ繧蜑企勁繧堤ケー繧願ソ斐☆縺ィ縲∝ー代@縺壹▽繧、繝ウ繝繝繧ッ繧ケ縺ョ繧オ繧、繧コ縺瑚ぇ螟ァ蛹悶@縺ヲ縺阪∪縺吶ゅョ繝シ繧ソ繝吶シ繧ケ繧呈怙驕ゥ蛹悶☆繧九→縺昴l繧定ァ」豸医@縺ヲ繧オ繧、繧コ繧堤クョ蟆上☆繧九%縺ィ縺後〒縺阪∪縺吶

cd /home/www
estcmd optimize casket

縺ェ縺翫gatherpurge繧貞ョ溯。後☆繧矩圀縺ォ縲-cl縲阪r縺、縺代↑縺九▲縺溷エ蜷医∽ク頑嶌縺阪∪縺溘ッ蜑企勁縺輔l縺滓枚譖ク縺ョ諠蝣ア縺ッ縲∝炎髯、繝槭シ繧ッ縺御サ倥¢繧峨l繧九□縺代〒繧、繝ウ繝繝繧ッ繧ケ蜀縺ォ谿九▲縺ヲ縺縺セ縺吶よ怙驕ゥ蛹悶ッ繧、繝ウ繝繝繧ッ繧ケ繧貞肴ァ狗ッ峨@縺ヲ蜑企勁譁譖ク縺ョ鬆伜沺繧貞ョ悟ィ縺ォ豸亥悉縺吶k蜉ケ譫懊b縺ゅj縺セ縺吶

譖エ譁ー菴懈・ュ縺ョ閾ェ蜍募喧

繧ウ繝槭Φ繝峨r螳壽悄逧縺ォ螳溯。後☆繧cron縺ェ縺ゥ縺ョ讖溯ス繧剃スソ縺」縺ヲ繧、繝ウ繝繝繧ッ繧ケ縺ョ譖エ譁ー菴懈・ュ繧定ェ蜍募喧縺吶k縺ィ讌ス縺ァ縺吶ゅ◎縺ョ髫帙↓縺ッ縲∽サ・荳九ョ繧医≧縺ェ繧ケ繧ッ繝ェ繝励ヨ繧呈嶌縺縺ヲ縺翫¥縺ィ繧医>縺ァ縺励g縺縲

/usr/local/bin/estcmd gather -cl -il ja -sd -cm /home/www/casket /home/www/public_html
/usr/local/bin/estcmd purge -cl /home/www/casket

縺溘□縺励purge縺ッ豈主屓縺ョ譖エ譁ー縺ァ蠢隕√↑繧上¢縺ァ縺ッ縺ゅj縺セ縺帙s縲ゅ◎繧後i縺ッ豈碑シ逧驥阪>蜃ヲ逅縺ェ縺ョ縺ァ縲√◆縺セ縺ォ繧繧九□縺代〒蜈蛻縺ァ縺吶ょ倶ココ縺ョWeb繧オ繧、繝医ョ讀懃エ「繧キ繧ケ繝繝縺ァ縺ゅl縺ー縲gather縺ッ豈取律縲purge縺ッ豈朱ア縺ィ縺縺」縺滄サ蠎ヲ縺ォ縺励※繧ゅh縺縺ァ縺励g縺縲ゅ∪縺溘∵怦縺ォ荳蠎ヲ縺上i縺縺ァoptimize繧定。後▲縺ヲ繧ゅ>縺縺ァ縺励g縺縲

隧ウ縺励>菴ソ縺譁ケ

繧ウ繝槭Φ繝峨dCGI繧ケ繧ッ繝ェ繝励ヨ縺ョ隧ウ縺励>菴ソ縺譁ケ縺ォ髢「縺励※縺ッ繝ヲ繝シ繧カ繧ャ繧、繝繧偵#隕ァ縺上□縺輔>縲API縺ョ隧ウ縺励>菴ソ縺譁ケ縺ォ髢「縺励※縺ッ繝励Ο繧ー繝ゥ繝溘Φ繧ー繧ャ繧、繝繧偵#隕ァ縺上□縺輔>縲

Hyper Estraier縺ョ逵滉セ。縺ッ縲√◎縺ョP2P讖滓ァ九↓縺ゅj縺セ縺吶12P讖滓ァ九r菴ソ繧上↑縺上※繧ゆク闊ャ逧縺ェ蜈ィ譁讀懃エ「繧キ繧ケ繝繝縺ィ縺励※蜊∝縺ォ譛臥畑縺縺ィ縺ッ諤昴>縺セ縺吶′縲√◎繧後↓鬟ス縺阪◆繧峨√●縺イ縺ィ繧12P讖滓ァ九r菴ソ縺」縺ヲ縺ソ縺ヲ縺縺溘□縺阪◆縺縺ィ諤昴>縺セ縺吶ゅ◆縺ィ縺医槭す繝ウ繧1蜿ー縺励°謖√▲縺ヲ縺縺ェ縺上※繧ゅ∵、懃エ「縺ィ譖エ譁ー縺御クヲ蛻励↓陦後∴縺溘j縲∬、謨ー縺ョ繧、繝ウ繝繝繧ッ繧ケ繧呈桶縺医◆繧翫、tom繝輔ぅ繝シ繝峨′驟堺ソ。縺ァ縺阪◆繧翫→縺縺」縺滓ァ倥縺ェ蛻ゥ轤ケ縺悟セ励i繧後∪縺吶12P讖滓ァ九ョ隧ウ縺励>菴ソ縺譁ケ縺ォ髢「縺励※縺ッP2P繧ャ繧、繝繧偵#隕ァ縺上□縺輔>縲

Hyper Estraier縺ォ縺ッWeb繧貞キ。蝗槭@縺ヲ譁譖ク繧帝寔繧√※縺上k繧ッ繝ュ繝シ繝ゥ繧ゆサ伜ア槭@縺ヲ縺縺セ縺吶ゅ◎繧後r菴ソ縺縺ィ迚ケ螳壹ョWeb繧オ繧、繝医d荳咲音螳壼、壽焚縺ョWeb繧オ繧、繝医r蟇セ雎。縺ィ縺励◆繧オ繝シ繝√お繝ウ繧ク繝ウ繧堤ー。蜊倥↓讒狗ッ峨☆繧九%縺ィ縺後〒縺阪∪縺吶りゥウ縺励¥縺ッ繧ッ繝ュ繝シ繝ゥ繧ャ繧、繝繧貞セ。隕ァ縺上□縺輔>縲


陬懆カウ

菴懆縺ョ騾」邨。蜈医↑縺ゥ縺ョ陬懆カウ莠矩繧堤エケ莉九@縺セ縺吶

騾」邨。蜈

Hyper Estraier縺ッ蟷ウ譫怜ケケ髮縺御ス懈舌@縺セ縺励◆縲ゆス懆縺ィ騾」邨。繧偵→繧九↓縺ッ縲〜mikio@users.sourceforge.net' 螳帙↓髮サ蟄舌Γ繝シ繝ォ繧帝√▲縺ヲ縺上□縺輔>縲ゅ◆縺縺励∬ウェ蝠上d繝舌げ繝ャ繝昴シ繝医↑縺ゥ縲∽サ悶ョ繝ヲ繝シ繧カ縺ィ蜈ア譛峨〒縺阪k隧ア鬘後ッ繝。繝シ繝ェ繝ウ繧ー繝ェ繧ケ繝医↓騾√▲縺ヲ縺上□縺輔>縲ゅΓ繝シ繝ェ繝ウ繧ー繝ェ繧ケ繝茨シ域律譛ャ隱橸シ峨ョ蜿ょ刈譁ケ豕輔↓縺、縺縺ヲ縺ッ縲〜http://lists.sourceforge.net/lists/listinfo/hyperestraier-users-ja' 繧貞盾辣ァ縺励※縺上□縺輔>縲

繝ゥ繧、繧サ繝ウ繧ケ

Hyper Estraier縺ッ繝輔Μ繝シ繧ス繝輔ヨ繧ヲ繧ァ繧「縺ァ縺吶ゅ≠縺ェ縺溘ッ縲:ree Software Foundation縺悟ャ陦ィ縺励◆GNU Lesser General Public License縺ョ繝舌シ繧ク繝ァ繝ウ2.1縺ゅk縺縺ッ縺昴l莉・髯阪ョ蜷繝舌シ繧ク繝ァ繝ウ縺ョ荳ュ縺九i縺縺壹l縺九r驕ク謚槭@縲√◎縺ョ繝舌シ繧ク繝ァ繝ウ縺悟ョ壹a繧区擅鬆縺ォ蠕薙▲縺ヲHyper Estraier繧貞埼貞ク縺セ縺溘ッ螟画峩縺吶k縺薙→縺後〒縺阪∪縺吶

Hyper Estraier縺ッ譛臥畑縺ァ縺ゅk縺ィ諤昴o繧後∪縺吶′縲鬆貞ク縺ォ縺ゅ◆縺」縺ヲ縺ッ縲∝クょエ諤ァ蜿翫ウ迚ケ螳夂岼逧驕ゥ蜷域ァ縺ォ縺、縺縺ヲ縺ョ證鈴サ吶ョ菫晁ィシ繧貞性繧√※縲√>縺九↑繧倶ソ晁ィシ繧り。後↑縺縺セ縺帙s縲りゥウ邏ー縺ォ縺、縺縺ヲ縺ッGNU Lesser General Public License繧定ェュ繧薙〒縺上□縺輔>縲

縺ゅ↑縺溘ッ縲?yper Estraier縺ィ荳邱偵↓GNU Lesser General Public License縺ョ蜀吶@繧貞女縺大叙縺」縺ヲ縺繧九ッ縺壹〒縺呻シ`COPYING' 繝輔ぃ繧、繝ォ繧貞盾辣ァ縺励※縺上□縺輔>シ峨ゅ◎縺縺ァ縺ェ縺蝣エ蜷医ッ縲:ree Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 縺ク騾」邨。縺励※縺上□縺輔>縲

隰晁セ

Hyper Estraier縺ッ諠蝣ア蜃ヲ逅謗ィ騾イ讖滓ァ具シIPAシ縺ォ繧医k2004蟷エ蠎ヲ隨ャ2蝗樊悴雕上た繝輔ヨ繧ヲ繧ァ繧「蜑オ騾莠区・ュ縺ョ謾ッ謠エ繧貞女縺代※髢狗匱縺輔l縺セ縺励◆縲ょ酔讖滓ァ九ョ髢「菫ょ推菴阪♀繧医ウ魴憺」シ譁謨襲M縺ォ諢溯ャ昴>縺溘@縺セ縺吶ゅ∪縺溘∵怏逕ィ縺ェ蜉ゥ險繧偵¥繧後◆逧讒倥√◎縺励※縲?yper Estraier縺ョ繝ヲ繝シ繧カ縺ョ逧讒倥↓縺顔、シ繧堤筏縺嶺ク翫£縺セ縺吶


hyperestraier-1.4.13/doc/javanativeapi/000077500000000000000000000000001125261632700200625ustar00rootroot00000000000000hyperestraier-1.4.13/doc/javanativeapi/allclasses-frame.html000066400000000000000000000022171125261632700241700ustar00rootroot00000000000000 All Classes (estraier) All Classes
Cmd
Condition
Database
DatabaseInformer
Document
Result
hyperestraier-1.4.13/doc/javanativeapi/allclasses-noframe.html000066400000000000000000000020271125261632700245240ustar00rootroot00000000000000 All Classes (estraier) All Classes
Cmd
Condition
Database
DatabaseInformer
Document
Result
hyperestraier-1.4.13/doc/javanativeapi/constant-values.html000066400000000000000000000507621125261632700241100ustar00rootroot00000000000000 Constant Field Values (estraier)

Constant Field Values


Contents
estraier.*

estraier.Condition
public static final int AGITO 8
public static final double ECLDIR 101.0d
public static final double ECLFILE 102.0d
public static final double ECLSERV 100.0d
public static final double ECLSIMURL 10.0d
public static final int FAST 4
public static final int ISECT 65536
public static final int NOIDF 16
public static final int ROUGH 2048
public static final int SIMPLE 1024
public static final int SURE 1
public static final int UNION 32768
public static final int USUAL 2

estraier.Database
public static final int DBCHRCAT 2048
public static final int DBCREAT 4
public static final int DBHUGE 4194304
public static final int DBHUGE2 8388608
public static final int DBHUGE3 16777216
public static final int DBLARGE 2097152
public static final int DBLCKNB 32
public static final int DBNOLCK 16
public static final int DBPERFNG 1024
public static final int DBREADER 1
public static final int DBSCASIS 134217728
public static final int DBSCINT 67108864
public static final int DBSCVOID 33554432
public static final int DBSMALL 1048576
public static final int DBTRUNC 8
public static final int DBWRITER 2
public static final int ERRACCES 2
public static final int ERRDB 4
public static final int ERRINVAL 1
public static final int ERRIO 5
public static final int ERRLOCK 3
public static final int ERRMISC 9999
public static final int ERRNOERR 0
public static final int ERRNOITEM 6
public static final int GDNOATTR 1
public static final int GDNOKWD 4
public static final int GDNOTEXT 2
public static final int IDXATTRNUM 2
public static final int IDXATTRSEQ 0
public static final int IDXATTRSTR 1
public static final int MGCLEAN 1
public static final int ODCLEAN 1
public static final int OPTNODBOPT 2
public static final int OPTNOPURGE 1
public static final int PDCLEAN 1
public static final int PDWEIGHT 2



hyperestraier-1.4.13/doc/javanativeapi/estraier/000077500000000000000000000000001125261632700217005ustar00rootroot00000000000000hyperestraier-1.4.13/doc/javanativeapi/estraier/Cmd.html000066400000000000000000000166421125261632700233020ustar00rootroot00000000000000 Cmd (estraier)

estraier
Class Cmd

java.lang.Object
  extended byestraier.Cmd

public class Cmd
extends java.lang.Object

Command line utility for the core API.


Method Summary
static void main(java.lang.String[] args)
          Main routine of the command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

main

public static void main(java.lang.String[] args)
Main routine of the command.

Parameters:
args - command line arguments. The first argument specifies the name of the sub command. "put", "out", "edit", "get", "uriid", "inform", "optimize", "merge", "search" are provided.


hyperestraier-1.4.13/doc/javanativeapi/estraier/Condition.html000066400000000000000000000606031125261632700245210ustar00rootroot00000000000000 Condition (estraier)

estraier
Class Condition

java.lang.Object
  extended byestraier.Condition

public class Condition
extends java.lang.Object

Abstraction of search condition.


Field Summary
static int AGITO
          option: check N-gram keys skipping by three
static double ECLDIR
          eclipse tuning: on directory basis
static double ECLFILE
          eclipse tuning: on file basis
static double ECLSERV
          eclipse tuning: on server basis
static double ECLSIMURL
          eclipse tuning: consider URL
static int FAST
          option: check N-gram keys skipping by two
static int ISECT
          option: with the intersection phrase
static int NOIDF
          option: without TF-IDF tuning
static int ROUGH
          option: with the rough phrase
static int SIMPLE
          option: with the simplified phrase
static int SURE
          option: check every N-gram key
static int UNION
          option: with the union phrase
static int USUAL
          option: check N-gram keys skipping by one
 
Constructor Summary
Condition()
          Create a search condition object.
 
Method Summary
 void add_attr(java.lang.String expr)
          Add an expression for an attribute.
protected  void finalize()
          Release resources.
 void set_auxiliary(int min)
          Set permission to adopt result of the auxiliary index.
 void set_distinct(java.lang.String name)
          Set the attribute distinction filter.
 void set_eclipse(double limit)
          Set the lower limit of similarity eclipse.
 void set_mask(int mask)
          Set the mask of targets of meta search.
 void set_max(int max)
          Set the maximum number of retrieval.
 void set_options(int options)
          Set options of retrieval.
 void set_order(java.lang.String expr)
          Set the order.
 void set_phrase(java.lang.String phrase)
          Set the search phrase.
 void set_skip(int skip)
          Set the number of skipped documents.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AGITO

public static final int AGITO
option: check N-gram keys skipping by three

See Also:
Constant Field Values

ECLDIR

public static final double ECLDIR
eclipse tuning: on directory basis

See Also:
Constant Field Values

ECLFILE

public static final double ECLFILE
eclipse tuning: on file basis

See Also:
Constant Field Values

ECLSERV

public static final double ECLSERV
eclipse tuning: on server basis

See Also:
Constant Field Values

ECLSIMURL

public static final double ECLSIMURL
eclipse tuning: consider URL

See Also:
Constant Field Values

FAST

public static final int FAST
option: check N-gram keys skipping by two

See Also:
Constant Field Values

ISECT

public static final int ISECT
option: with the intersection phrase

See Also:
Constant Field Values

NOIDF

public static final int NOIDF
option: without TF-IDF tuning

See Also:
Constant Field Values

ROUGH

public static final int ROUGH
option: with the rough phrase

See Also:
Constant Field Values

SIMPLE

public static final int SIMPLE
option: with the simplified phrase

See Also:
Constant Field Values

SURE

public static final int SURE
option: check every N-gram key

See Also:
Constant Field Values

UNION

public static final int UNION
option: with the union phrase

See Also:
Constant Field Values

USUAL

public static final int USUAL
option: check N-gram keys skipping by one

See Also:
Constant Field Values
Constructor Detail

Condition

public Condition()
Create a search condition object.

Method Detail

add_attr

public void add_attr(java.lang.String expr)
Add an expression for an attribute.

Parameters:
expr - an expression for an attribute.

finalize

protected void finalize()
Release resources.


set_auxiliary

public void set_auxiliary(int min)
Set permission to adopt result of the auxiliary index.

Parameters:
min - the minimum hits to adopt result of the auxiliary index. If it is not more than 0, the auxiliary index is not used. By default, it is 32.

set_distinct

public void set_distinct(java.lang.String name)
Set the attribute distinction filter.

Parameters:
name - the name of an attribute to be distinct.

set_eclipse

public void set_eclipse(double limit)
Set the lower limit of similarity eclipse.

Parameters:
limit - the lower limit of similarity for documents to be eclipsed. Similarity is between 0.0 and 1.0. If the limit is added by `Condition.ECLSIMURL', similarity is weighted by URL. If the limit is `Condition.ECLSERV', similarity is ignored and documents in the same server are eclipsed. If the limit is `Condition.ECLDIR', similarity is ignored and documents in the same directory are eclipsed. If the limit is `Condition.ECLFILE', similarity is ignored and documents of the same file are eclipsed.

set_mask

public void set_mask(int mask)
Set the mask of targets of meta search.

Parameters:
mask - a masking number. 1 means the first target, 2 means the second target, 4 means the third target and, power values of 2 and their summation compose the mask.

set_max

public void set_max(int max)
Set the maximum number of retrieval.

Parameters:
max - the maximum number of retrieval. By default, the number of retrieval is not limited.

set_options

public void set_options(int options)
Set options of retrieval.

Parameters:
options - options: `Condition.SURE' specifies that it checks every N-gram key, `Condition.USUAL', which is the default, specifies that it checks N-gram keys with skipping one key, `Condition.FAST' skips two keys, `Condition.AGITO' skips three keys, `Condition.NOIDF' specifies not to perform TF-IDF tuning, `Condition.SIMPLE' specifies to use simplified phrase, `Condition.ROUGH' specifies to use rough phrase, `Condition.UNION' specifies to use union phrase, `Condition.ISECT' specifies to use intersection phrase. Each option can be specified at the same time by bitwise or. If keys are skipped, though search speed is improved, the relevance ratio grows less.

set_order

public void set_order(java.lang.String expr)
Set the order.

Parameters:
expr - an expression for the order. By default, the order is by score descending.

set_phrase

public void set_phrase(java.lang.String phrase)
Set the search phrase.

Parameters:
phrase - a search phrase.

set_skip

public void set_skip(int skip)
Set the number of skipped documents.

Parameters:
skip - the number of documents to be skipped in the search result.


hyperestraier-1.4.13/doc/javanativeapi/estraier/Database.html000066400000000000000000001554231125261632700243040ustar00rootroot00000000000000 Database (estraier)

estraier
Class Database

java.lang.Object
  extended byestraier.Database

public class Database
extends java.lang.Object

Abstraction of database


Field Summary
static int DBCHRCAT
          open mode: use character category analyzer
static int DBCREAT
          open mode: a writer creating
static int DBHUGE
          open mode: huge tuning
static int DBHUGE2
          open mode: huge tuning second
static int DBHUGE3
          open mode: huge tuning third
static int DBLARGE
          open mode: large tuning
static int DBLCKNB
          open mode: lock without blocking
static int DBNOLCK
          open mode: open without locking
static int DBPERFNG
          open mode: use perfect N-gram analyzer
static int DBREADER
          open mode: open as a reader
static int DBSCASIS
          open mode: refrain from adjustment of scores
static int DBSCINT
          open mode: store scores as integer
static int DBSCVOID
          open mode: store scores as void
static int DBSMALL
          open mode: small tuning
static int DBTRUNC
          open mode: a writer truncating
static int DBWRITER
          open mode: open as a writer
static int ERRACCES
          error code: access forbidden
static int ERRDB
          error code: database problem
static int ERRINVAL
          error code: invalid argument
static int ERRIO
          error code: I/O problem
static int ERRLOCK
          error code: lock failure
static int ERRMISC
          error code: miscellaneous
static int ERRNOERR
          error code: no error
static int ERRNOITEM
          error code: no item
static int GDNOATTR
          get_doc option: no attributes
static int GDNOKWD
          get_doc option: no keywords
static int GDNOTEXT
          get_doc option: no text
static int IDXATTRNUM
          attribute index type: for narrowing with attributes as numbers
static int IDXATTRSEQ
          attribute index type: for multipurpose sequencial access method
static int IDXATTRSTR
          attribute index type: for narrowing with attributes as strings
static int MGCLEAN
          merge option: clean up dispensable regions
static int ODCLEAN
          out_doc option: clean up dispensable regions
static int OPTNODBOPT
          optimize option: omit optimization of the database files
static int OPTNOPURGE
          optimize option: omit purging dispensable region of deleted
static int PDCLEAN
          put_doc option: clean up dispensable regions
static int PDWEIGHT
          put_doc option: weight scores statically when indexing
static java.lang.String VERSION
          version of Hyper Estraier
 
Constructor Summary
Database()
          Create a database object.
 
Method Summary
 boolean add_attr_index(java.lang.String name, int type)
          Add an index for narrowing or sorting with document attributes.
 boolean add_pseudo_index(java.lang.String path)
          Add a pseudo index directory.
 boolean close()
          Close the database.
 int doc_num()
          Get the number of documents.
 boolean edit_doc(Document doc)
          Edit attributes of a document.
 java.lang.String err_msg(int ecode)
          Get the string of an error code.
 int error()
          Get the last happened error code.
 boolean fatal()
          Check whether the database has a fatal error.
protected  void finalize()
          Release resources.
 boolean flush(int max)
          Flush index words in the cache.
 java.lang.String get_doc_attr(int id, java.lang.String name)
          Retrieve the value of an attribute of a document.
 Document get_doc(int id, int options)
          Retrieve a document.
 boolean merge(java.lang.String name, int options)
          Merge another database.
 java.lang.String name()
          Get the name.
 boolean open(java.lang.String name, int omode)
          Open the database.
 boolean optimize(int options)
          Optimize the database.
 boolean out_doc(int id, int options)
          Remove a document.
 boolean put_doc(Document doc, int options)
          Add a document.
 boolean scan_doc(Document doc, Condition cond)
          Check whether a document object matches the phrase of a search condition object definitely.
static Result search_meta(Database[] dbs, Condition cond)
          Search plural databases for documents corresponding a condition.
 Result search(Condition cond)
          Search for documents corresponding a condition.
 void set_cache_size(double size, int anum, int tnum, int rnum)
          Set the maximum size of the cache memory.
 void set_informer(DatabaseInformer informer)
          Set the callback function to inform of database events.
 void set_wildmax(int num)
          Set the maximum number of expansion of wild cards.
 double size()
          Get the size.
 boolean sync()
          Synchronize updating contents.
 int uri_to_id(java.lang.String uri)
          Get the ID of a document specified by URI.
 int word_num()
          Get the number of unique words.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DBCHRCAT

public static final int DBCHRCAT
open mode: use character category analyzer

See Also:
Constant Field Values

DBCREAT

public static final int DBCREAT
open mode: a writer creating

See Also:
Constant Field Values

DBHUGE

public static final int DBHUGE
open mode: huge tuning

See Also:
Constant Field Values

DBHUGE2

public static final int DBHUGE2
open mode: huge tuning second

See Also:
Constant Field Values

DBHUGE3

public static final int DBHUGE3
open mode: huge tuning third

See Also:
Constant Field Values

DBLARGE

public static final int DBLARGE
open mode: large tuning

See Also:
Constant Field Values

DBLCKNB

public static final int DBLCKNB
open mode: lock without blocking

See Also:
Constant Field Values

DBNOLCK

public static final int DBNOLCK
open mode: open without locking

See Also:
Constant Field Values

DBPERFNG

public static final int DBPERFNG
open mode: use perfect N-gram analyzer

See Also:
Constant Field Values

DBREADER

public static final int DBREADER
open mode: open as a reader

See Also:
Constant Field Values

DBSCASIS

public static final int DBSCASIS
open mode: refrain from adjustment of scores

See Also:
Constant Field Values

DBSCINT

public static final int DBSCINT
open mode: store scores as integer

See Also:
Constant Field Values

DBSCVOID

public static final int DBSCVOID
open mode: store scores as void

See Also:
Constant Field Values

DBSMALL

public static final int DBSMALL
open mode: small tuning

See Also:
Constant Field Values

DBTRUNC

public static final int DBTRUNC
open mode: a writer truncating

See Also:
Constant Field Values

DBWRITER

public static final int DBWRITER
open mode: open as a writer

See Also:
Constant Field Values

ERRACCES

public static final int ERRACCES
error code: access forbidden

See Also:
Constant Field Values

ERRDB

public static final int ERRDB
error code: database problem

See Also:
Constant Field Values

ERRINVAL

public static final int ERRINVAL
error code: invalid argument

See Also:
Constant Field Values

ERRIO

public static final int ERRIO
error code: I/O problem

See Also:
Constant Field Values

ERRLOCK

public static final int ERRLOCK
error code: lock failure

See Also:
Constant Field Values

ERRMISC

public static final int ERRMISC
error code: miscellaneous

See Also:
Constant Field Values

ERRNOERR

public static final int ERRNOERR
error code: no error

See Also:
Constant Field Values

ERRNOITEM

public static final int ERRNOITEM
error code: no item

See Also:
Constant Field Values

GDNOATTR

public static final int GDNOATTR
get_doc option: no attributes

See Also:
Constant Field Values

GDNOKWD

public static final int GDNOKWD
get_doc option: no keywords

See Also:
Constant Field Values

GDNOTEXT

public static final int GDNOTEXT
get_doc option: no text

See Also:
Constant Field Values

IDXATTRNUM

public static final int IDXATTRNUM
attribute index type: for narrowing with attributes as numbers

See Also:
Constant Field Values

IDXATTRSEQ

public static final int IDXATTRSEQ
attribute index type: for multipurpose sequencial access method

See Also:
Constant Field Values

IDXATTRSTR

public static final int IDXATTRSTR
attribute index type: for narrowing with attributes as strings

See Also:
Constant Field Values

MGCLEAN

public static final int MGCLEAN
merge option: clean up dispensable regions

See Also:
Constant Field Values

ODCLEAN

public static final int ODCLEAN
out_doc option: clean up dispensable regions

See Also:
Constant Field Values

OPTNODBOPT

public static final int OPTNODBOPT
optimize option: omit optimization of the database files

See Also:
Constant Field Values

OPTNOPURGE

public static final int OPTNOPURGE
optimize option: omit purging dispensable region of deleted

See Also:
Constant Field Values

PDCLEAN

public static final int PDCLEAN
put_doc option: clean up dispensable regions

See Also:
Constant Field Values

PDWEIGHT

public static final int PDWEIGHT
put_doc option: weight scores statically when indexing

See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION
version of Hyper Estraier

Constructor Detail

Database

public Database()
Create a database object.

Method Detail

add_attr_index

public boolean add_attr_index(java.lang.String name,
                              int type)
Add an index for narrowing or sorting with document attributes.

Parameters:
name - the name of an attribute.
type - the data type of attribute index; `Database.IDXATTRSEQ' for multipurpose sequencial access method, `Database.IDXATTRSTR' for narrowing with attributes as strings, `Database.IDXATTRNUM' for narrowing with attributes as numbers.
Returns:
true if success, else it is false.

add_pseudo_index

public boolean add_pseudo_index(java.lang.String path)
Add a pseudo index directory.

Parameters:
path - the path of a pseudo index directory.
Returns:
true if success, else it is false.

close

public boolean close()
Close the database.

Returns:
true if success, else it is false.

doc_num

public int doc_num()
Get the number of documents.

Returns:
the number of documents in the database.

edit_doc

public boolean edit_doc(Document doc)
Edit attributes of a document.

Parameters:
doc - a document object.
Returns:
true if success, else it is false.

err_msg

public java.lang.String err_msg(int ecode)
Get the string of an error code.

Parameters:
ecode - an error code.
Returns:
the string of the error code.

error

public int error()
Get the last happened error code.

Returns:
the last happened error code.

fatal

public boolean fatal()
Check whether the database has a fatal error.

Returns:
true if the database has fatal erroor, else it is false.

finalize

protected void finalize()
Release resources.


flush

public boolean flush(int max)
Flush index words in the cache.

Parameters:
max - the maximum number of words to be flushed. If it not more than zero, all words are flushed.
Returns:
true if success, else it is false.

get_doc_attr

public java.lang.String get_doc_attr(int id,
                                     java.lang.String name)
Retrieve the value of an attribute of a document.

Parameters:
id - the ID number of a registered document.
name - the name of an attribute.
Returns:
the value of the attribute or `null' if it does not exist.

get_doc

public Document get_doc(int id,
                        int options)
Retrieve a document.

Parameters:
id - the ID number of a registered document.
options - options: `Database.GDNOATTR' to ignore attributes, `Database.GDNOTEXT' to ignore the body text, `Database.GDNOKWD' to ignore keywords. The three can be specified at # the same time by bitwise or.
Returns:
a document object. On error, `null' is returned.

merge

public boolean merge(java.lang.String name,
                     int options)
Merge another database.

Parameters:
name - the name of another database directory.
options - options: `Database.MGCLEAN' to clean up dispensable regions of the deleted document.
Returns:
true if success, else it is false.

name

public java.lang.String name()
Get the name.

Returns:
the name of the database.

open

public boolean open(java.lang.String name,
                    int omode)
Open the database.

Parameters:
name - the name of a database directory.
omode - open modes: `Database.DBWRITER' as a writer, `Database.DBREADER' as a reader. If the mode is `Database.DBWRITER', the following may be added by bitwise or: `Database.DBCREAT', which means it creates a new database if not exist, `Database.DBTRUNC', which means it creates a new database regardless if one exists. Both of `Database.DBREADER' and `Database.DBWRITER' can be added to by bitwise or: `Database.DBNOLCK', which means it opens a database file without file locking, or `Database.DBLCKNB', which means locking is performed without blocking. If `Database.DBNOLCK' is used, the application is responsible for exclusion control. `Database.DBCREAT' can be added to by bitwise or: `Database.DBPERFNG', which means N-gram analysis is performed against European text also, `Database.DBCHACAT', which means character category analysis is performed instead of N-gram analysis, `Database.DBSMALL', which means the index is tuned to register less than 50000 documents, `Database.DBLARGE', which means the index is tuned to register more than 300000 documents, `Database.DBHUGE', which means the index is tuned to register more than 1000000 documents, `Database.DBHUGE2', which means the index is tuned to register more than 5000000 documents, `Database.DBHUGE3', which means the index is tuned to register more than 10000000 documents, `Database.DBSCVOID', which means scores are stored as void, `Database.DBSCINT', which means scores are stored as 32-bit integer, `Database.DBSCASIS', which means scores are stored as-is and marked not to be tuned when search.
Returns:
true if success, else it is false.

optimize

public boolean optimize(int options)
Optimize the database.

Parameters:
options - options: `Database.OPTNOPURGE' to omit purging dispensable region of deleted documents, `Database.OPTNODBOPT' to omit optimization of the database files. The two can be specified at the same time by bitwise or.
Returns:
true if success, else it is false.

out_doc

public boolean out_doc(int id,
                       int options)
Remove a document.

Parameters:
id - the ID number of a registered document.
options - options: `Database.ODCLEAN' to clean up dispensable regions of the deleted document.
Returns:
true if success, else it is false.

put_doc

public boolean put_doc(Document doc,
                       int options)
Add a document.

Parameters:
doc - a document object. The document object should have the URI attribute.
options - options: `Database.PDCLEAN' to clean up dispensable regions of the overwritten document.
Returns:
true if success, else it is false.

scan_doc

public boolean scan_doc(Document doc,
                        Condition cond)
Check whether a document object matches the phrase of a search condition object definitely.

Parameters:
doc - a document object.
cond - a search condition object.
Returns:
true if the document matches the phrase of the condition object definitely, else it is false.

search_meta

public static Result search_meta(Database[] dbs,
                                 Condition cond)
Search plural databases for documents corresponding a condition.

Parameters:
dbs - an array whose elements are database objects.
cond - a condition object.
Returns:
a result object. On error, `null' is returned.

search

public Result search(Condition cond)
Search for documents corresponding a condition.

Parameters:
cond - a condition object.
Returns:
a result object. On error, `null' is returned.

set_cache_size

public void set_cache_size(double size,
                           int anum,
                           int tnum,
                           int rnum)
Set the maximum size of the cache memory.

Parameters:
size - the maximum size of the index cache. By default, it is 64MB. If it is not more than 0, the current size is not changed.
anum - the maximum number of cached records for document attributes. By default, it is 8192. If it is not more than 0, the current size is not changed.
tnum - the maximum number of cached records for document texts. By default, it is 1024. If it is not more than 0, the current size is not changed.
rnum - the maximum number of cached records for occurrence results. By default, it is 256. If it is not more than 0, the current size is not changed.

set_informer

public void set_informer(DatabaseInformer informer)
Set the callback function to inform of database events.

Parameters:
informer - an arbitrary object with a method named as `inform'.

set_wildmax

public void set_wildmax(int num)
Set the maximum number of expansion of wild cards.

Parameters:
num - the maximum number of expansion of wild cards.

size

public double size()
Get the size.

Returns:
the size of the database.

sync

public boolean sync()
Synchronize updating contents.

Returns:
true if success, else it is false.

uri_to_id

public int uri_to_id(java.lang.String uri)
Get the ID of a document specified by URI.

Parameters:
uri - the URI of a registered document.
Returns:
the ID of the document. On error, -1 is returned.

word_num

public int word_num()
Get the number of unique words.

Returns:
the number of unique words in the database.


hyperestraier-1.4.13/doc/javanativeapi/estraier/DatabaseInformer.html000066400000000000000000000157021125261632700260010ustar00rootroot00000000000000 DatabaseInformer (estraier)

estraier
Interface DatabaseInformer


public interface DatabaseInformer

Interface of database informer


Method Summary
 void inform(java.lang.String message)
          Inform of a database event.
 

Method Detail

inform

public void inform(java.lang.String message)
Inform of a database event.

Parameters:
message - a message of each event.


hyperestraier-1.4.13/doc/javanativeapi/estraier/Document.html000066400000000000000000000447541125261632700243620ustar00rootroot00000000000000 Document (estraier)

estraier
Class Document

java.lang.Object
  extended byestraier.Document

public class Document
extends java.lang.Object

Abstraction of document.


Constructor Summary
Document()
          Create a document object.
Document(java.lang.String draft)
          Create a document object made from draft data.
 
Method Summary
 void add_attr(java.lang.String name, java.lang.String value)
          Add an attribute.
 void add_hidden_text(java.lang.String text)
          Add a hidden sentence.
 void add_text(java.lang.String text)
          Add a sentence of text.
 java.util.List attr_names()
          Get a list of attribute names.
 java.lang.String attr(java.lang.String name)
          Get the value of an attribute.
 java.lang.String cat_texts()
          Concatenate sentences of the text.
 java.lang.String dump_draft()
          Dump draft data.
protected  void finalize()
          Release resources.
 int id()
          Get the ID number.
 java.util.Map keywords()
          Get attached keywords.
 java.lang.String make_snippet(java.util.List words, int wwidth, int hwidth, int awidth)
          Make a snippet of the body text.
 int score()
          Get the substitute score.
 void set_keywords(java.util.Map kwords)
          Attach keywords.
 void set_score(int score)
          Set the substitute score.
 java.util.List texts()
          Get a list of sentences of the text.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Document

public Document()
Create a document object.


Document

public Document(java.lang.String draft)
Create a document object made from draft data.

Parameters:
draft - a string of draft data.
Method Detail

add_attr

public void add_attr(java.lang.String name,
                     java.lang.String value)
Add an attribute.

Parameters:
name - the name of an attribute.
value - the value of the attribute. If it is `null', the attribute is removed.

add_hidden_text

public void add_hidden_text(java.lang.String text)
Add a hidden sentence.

Parameters:
text - a hidden sentence.

add_text

public void add_text(java.lang.String text)
Add a sentence of text.

Parameters:
text - sentence of text.

attr_names

public java.util.List attr_names()
Get a list of attribute names.

Returns:
a list object of attribute names.

attr

public java.lang.String attr(java.lang.String name)
Get the value of an attribute.

Parameters:
name - the name of an attribute.
Returns:
the value of the attribute or `null' if it does not exist.

cat_texts

public java.lang.String cat_texts()
Concatenate sentences of the text.

Returns:
concatenated sentences.

dump_draft

public java.lang.String dump_draft()
Dump draft data.

Returns:
draft data.

finalize

protected void finalize()
Release resources.


id

public int id()
Get the ID number.

Returns:
the ID number. If this object has never been registered, -1 is returned.

keywords

public java.util.Map keywords()
Get attached keywords.

Returns:
a map object of keywords and their scores in decimal string. If no keyword is attached, `null' is returned.

make_snippet

public java.lang.String make_snippet(java.util.List words,
                                     int wwidth,
                                     int hwidth,
                                     int awidth)
Make a snippet of the body text.

Parameters:
words - a list object of words to be highlight.
wwidth - whole width of the result.
hwidth - width of strings picked up from the beginning of the text.
awidth - width of strings picked up around each highlighted word.
Returns:
a snippet string of the body text. There are tab separated values. Each line is a string to be shown. Though most lines have only one field, some lines have two fields. If the second field exists, the first field is to be shown with highlighted, and the second field means its normalized form.

score

public int score()
Get the substitute score.

Returns:
the substitute score or -1 if it is not set.

set_keywords

public void set_keywords(java.util.Map kwords)
Attach keywords.

Parameters:
kwords - a map object of keywords. Keys of the map should be keywords of the document and values should be their scores in decimal string.

set_score

public void set_score(int score)
Set the substitute score.

Parameters:
score - the substitute score. It it is negative, the substitute score setting is nullified.

texts

public java.util.List texts()
Get a list of sentences of the text.

Returns:
a list object of sentences of the text.


hyperestraier-1.4.13/doc/javanativeapi/estraier/Result.html000066400000000000000000000276221125261632700240550ustar00rootroot00000000000000 Result (estraier)

estraier
Class Result

java.lang.Object
  extended byestraier.Result

public class Result
extends java.lang.Object

Abstraction of result set from database.


Method Summary
 int doc_num()
          Get the number of documents.
protected  void finalize()
          Release resources.
 int get_dbidx(int index)
          Get the index of the container database of a document.
 int get_doc_id(int index)
          Get the ID number of a document.
 int get_score(int index)
          Get the score of a document.
 int[] get_shadows(int id)
          Get an array of ID numbers of eclipsed docuemnts of a document.
 java.util.List hint_words()
          Get a list of hint words.
 int hint(java.lang.String word)
          Get the value of a hint word.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

doc_num

public int doc_num()
Get the number of documents.

Returns:
the number of documents in the result.

finalize

protected void finalize()
Release resources.


get_dbidx

public int get_dbidx(int index)
Get the index of the container database of a document.

Parameters:
index - the index of a document.
Returns:
the index of the container database of the document or -1 if the index is out of bounds.

get_doc_id

public int get_doc_id(int index)
Get the ID number of a document.

Parameters:
index - the index of a document.
Returns:
the ID number of the document or -1 if the index is out of bounds.

get_score

public int get_score(int index)
Get the score of a document.

Parameters:
index - the index of a document.
Returns:
the score of the document or -1 if the index is out of bounds.

get_shadows

public int[] get_shadows(int id)
Get an array of ID numbers of eclipsed docuemnts of a document.

Parameters:
id - the ID number of a parent document.
Returns:
an array whose elements expresse the ID numbers and their scores alternately.

hint_words

public java.util.List hint_words()
Get a list of hint words.

Returns:
a list of hint words.

hint

public int hint(java.lang.String word)
Get the value of a hint word.

Parameters:
word - a hint word. An empty string means the number of whole result.
Returns:
the number of documents corresponding the hint word. If the word is in a negative condition, the value is negative.


hyperestraier-1.4.13/doc/javanativeapi/estraier/package-frame.html000066400000000000000000000026631125261632700252600ustar00rootroot00000000000000 estraier (estraier) estraier
Interfaces 
DatabaseInformer
Classes 
Cmd
Condition
Database
Document
Result
hyperestraier-1.4.13/doc/javanativeapi/estraier/package-summary.html000066400000000000000000000133731125261632700256630ustar00rootroot00000000000000 estraier (estraier)

Package estraier

Interface Summary
DatabaseInformer Interface of database informer
 

Class Summary
Cmd Command line utility for the core API.
Condition Abstraction of search condition.
Database Abstraction of database
Document Abstraction of document.
Result Abstraction of result set from database.
 



hyperestraier-1.4.13/doc/javanativeapi/estraier/package-tree.html000066400000000000000000000117421125261632700251230ustar00rootroot00000000000000 estraier Class Hierarchy (estraier)

Hierarchy For Package estraier

Class Hierarchy

Interface Hierarchy



hyperestraier-1.4.13/doc/javanativeapi/index-all.html000066400000000000000000001005041125261632700226250ustar00rootroot00000000000000 Index (estraier)
A C D E F G H I K M N O P R S T U V W

A

AGITO - Static variable in class estraier.Condition
option: check N-gram keys skipping by three
add_attr(String) - Method in class estraier.Condition
Add an expression for an attribute.
add_attr(String, String) - Method in class estraier.Document
Add an attribute.
add_attr_index(String, int) - Method in class estraier.Database
Add an index for narrowing or sorting with document attributes.
add_hidden_text(String) - Method in class estraier.Document
Add a hidden sentence.
add_pseudo_index(String) - Method in class estraier.Database
Add a pseudo index directory.
add_text(String) - Method in class estraier.Document
Add a sentence of text.
attr(String) - Method in class estraier.Document
Get the value of an attribute.
attr_names() - Method in class estraier.Document
Get a list of attribute names.

C

Cmd - class estraier.Cmd.
Command line utility for the core API.
Condition - class estraier.Condition.
Abstraction of search condition.
Condition() - Constructor for class estraier.Condition
Create a search condition object.
cat_texts() - Method in class estraier.Document
Concatenate sentences of the text.
close() - Method in class estraier.Database
Close the database.

D

DBCHRCAT - Static variable in class estraier.Database
open mode: use character category analyzer
DBCREAT - Static variable in class estraier.Database
open mode: a writer creating
DBHUGE - Static variable in class estraier.Database
open mode: huge tuning
DBHUGE2 - Static variable in class estraier.Database
open mode: huge tuning second
DBHUGE3 - Static variable in class estraier.Database
open mode: huge tuning third
DBLARGE - Static variable in class estraier.Database
open mode: large tuning
DBLCKNB - Static variable in class estraier.Database
open mode: lock without blocking
DBNOLCK - Static variable in class estraier.Database
open mode: open without locking
DBPERFNG - Static variable in class estraier.Database
open mode: use perfect N-gram analyzer
DBREADER - Static variable in class estraier.Database
open mode: open as a reader
DBSCASIS - Static variable in class estraier.Database
open mode: refrain from adjustment of scores
DBSCINT - Static variable in class estraier.Database
open mode: store scores as integer
DBSCVOID - Static variable in class estraier.Database
open mode: store scores as void
DBSMALL - Static variable in class estraier.Database
open mode: small tuning
DBTRUNC - Static variable in class estraier.Database
open mode: a writer truncating
DBWRITER - Static variable in class estraier.Database
open mode: open as a writer
Database - class estraier.Database.
Abstraction of database
Database() - Constructor for class estraier.Database
Create a database object.
DatabaseInformer - interface estraier.DatabaseInformer.
Interface of database informer
Document - class estraier.Document.
Abstraction of document.
Document() - Constructor for class estraier.Document
Create a document object.
Document(String) - Constructor for class estraier.Document
Create a document object made from draft data.
doc_num() - Method in class estraier.Database
Get the number of documents.
doc_num() - Method in class estraier.Result
Get the number of documents.
dump_draft() - Method in class estraier.Document
Dump draft data.

E

ECLDIR - Static variable in class estraier.Condition
eclipse tuning: on directory basis
ECLFILE - Static variable in class estraier.Condition
eclipse tuning: on file basis
ECLSERV - Static variable in class estraier.Condition
eclipse tuning: on server basis
ECLSIMURL - Static variable in class estraier.Condition
eclipse tuning: consider URL
ERRACCES - Static variable in class estraier.Database
error code: access forbidden
ERRDB - Static variable in class estraier.Database
error code: database problem
ERRINVAL - Static variable in class estraier.Database
error code: invalid argument
ERRIO - Static variable in class estraier.Database
error code: I/O problem
ERRLOCK - Static variable in class estraier.Database
error code: lock failure
ERRMISC - Static variable in class estraier.Database
error code: miscellaneous
ERRNOERR - Static variable in class estraier.Database
error code: no error
ERRNOITEM - Static variable in class estraier.Database
error code: no item
edit_doc(Document) - Method in class estraier.Database
Edit attributes of a document.
err_msg(int) - Method in class estraier.Database
Get the string of an error code.
error() - Method in class estraier.Database
Get the last happened error code.
estraier - package estraier
 

F

FAST - Static variable in class estraier.Condition
option: check N-gram keys skipping by two
fatal() - Method in class estraier.Database
Check whether the database has a fatal error.
finalize() - Method in class estraier.Condition
Release resources.
finalize() - Method in class estraier.Database
Release resources.
finalize() - Method in class estraier.Document
Release resources.
finalize() - Method in class estraier.Result
Release resources.
flush(int) - Method in class estraier.Database
Flush index words in the cache.

G

GDNOATTR - Static variable in class estraier.Database
get_doc option: no attributes
GDNOKWD - Static variable in class estraier.Database
get_doc option: no keywords
GDNOTEXT - Static variable in class estraier.Database
get_doc option: no text
get_dbidx(int) - Method in class estraier.Result
Get the index of the container database of a document.
get_doc(int, int) - Method in class estraier.Database
Retrieve a document.
get_doc_attr(int, String) - Method in class estraier.Database
Retrieve the value of an attribute of a document.
get_doc_id(int) - Method in class estraier.Result
Get the ID number of a document.
get_score(int) - Method in class estraier.Result
Get the score of a document.
get_shadows(int) - Method in class estraier.Result
Get an array of ID numbers of eclipsed docuemnts of a document.

H

hint(String) - Method in class estraier.Result
Get the value of a hint word.
hint_words() - Method in class estraier.Result
Get a list of hint words.

I

IDXATTRNUM - Static variable in class estraier.Database
attribute index type: for narrowing with attributes as numbers
IDXATTRSEQ - Static variable in class estraier.Database
attribute index type: for multipurpose sequencial access method
IDXATTRSTR - Static variable in class estraier.Database
attribute index type: for narrowing with attributes as strings
ISECT - Static variable in class estraier.Condition
option: with the intersection phrase
id() - Method in class estraier.Document
Get the ID number.
inform(String) - Method in interface estraier.DatabaseInformer
Inform of a database event.

K

keywords() - Method in class estraier.Document
Get attached keywords.

M

MGCLEAN - Static variable in class estraier.Database
merge option: clean up dispensable regions
main(String[]) - Static method in class estraier.Cmd
Main routine of the command.
make_snippet(List, int, int, int) - Method in class estraier.Document
Make a snippet of the body text.
merge(String, int) - Method in class estraier.Database
Merge another database.

N

NOIDF - Static variable in class estraier.Condition
option: without TF-IDF tuning
name() - Method in class estraier.Database
Get the name.

O

ODCLEAN - Static variable in class estraier.Database
out_doc option: clean up dispensable regions
OPTNODBOPT - Static variable in class estraier.Database
optimize option: omit optimization of the database files
OPTNOPURGE - Static variable in class estraier.Database
optimize option: omit purging dispensable region of deleted
open(String, int) - Method in class estraier.Database
Open the database.
optimize(int) - Method in class estraier.Database
Optimize the database.
out_doc(int, int) - Method in class estraier.Database
Remove a document.

P

PDCLEAN - Static variable in class estraier.Database
put_doc option: clean up dispensable regions
PDWEIGHT - Static variable in class estraier.Database
put_doc option: weight scores statically when indexing
put_doc(Document, int) - Method in class estraier.Database
Add a document.

R

ROUGH - Static variable in class estraier.Condition
option: with the rough phrase
Result - class estraier.Result.
Abstraction of result set from database.

S

SIMPLE - Static variable in class estraier.Condition
option: with the simplified phrase
SURE - Static variable in class estraier.Condition
option: check every N-gram key
scan_doc(Document, Condition) - Method in class estraier.Database
Check whether a document object matches the phrase of a search condition object definitely.
score() - Method in class estraier.Document
Get the substitute score.
search(Condition) - Method in class estraier.Database
Search for documents corresponding a condition.
search_meta(Database[], Condition) - Static method in class estraier.Database
Search plural databases for documents corresponding a condition.
set_auxiliary(int) - Method in class estraier.Condition
Set permission to adopt result of the auxiliary index.
set_cache_size(double, int, int, int) - Method in class estraier.Database
Set the maximum size of the cache memory.
set_distinct(String) - Method in class estraier.Condition
Set the attribute distinction filter.
set_eclipse(double) - Method in class estraier.Condition
Set the lower limit of similarity eclipse.
set_informer(DatabaseInformer) - Method in class estraier.Database
Set the callback function to inform of database events.
set_keywords(Map) - Method in class estraier.Document
Attach keywords.
set_mask(int) - Method in class estraier.Condition
Set the mask of targets of meta search.
set_max(int) - Method in class estraier.Condition
Set the maximum number of retrieval.
set_options(int) - Method in class estraier.Condition
Set options of retrieval.
set_order(String) - Method in class estraier.Condition
Set the order.
set_phrase(String) - Method in class estraier.Condition
Set the search phrase.
set_score(int) - Method in class estraier.Document
Set the substitute score.
set_skip(int) - Method in class estraier.Condition
Set the number of skipped documents.
set_wildmax(int) - Method in class estraier.Database
Set the maximum number of expansion of wild cards.
size() - Method in class estraier.Database
Get the size.
sync() - Method in class estraier.Database
Synchronize updating contents.

T

texts() - Method in class estraier.Document
Get a list of sentences of the text.

U

UNION - Static variable in class estraier.Condition
option: with the union phrase
USUAL - Static variable in class estraier.Condition
option: check N-gram keys skipping by one
uri_to_id(String) - Method in class estraier.Database
Get the ID of a document specified by URI.

V

VERSION - Static variable in class estraier.Database
version of Hyper Estraier

W

word_num() - Method in class estraier.Database
Get the number of unique words.

A C D E F G H I K M N O P R S T U V W

hyperestraier-1.4.13/doc/javanativeapi/index.html000066400000000000000000000013611125261632700220600ustar00rootroot00000000000000 estraier <H2> Frame Alert</H2> <P> This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. <BR> Link to<A HREF="overview-summary.html">Non-frame version.</A> hyperestraier-1.4.13/doc/javanativeapi/overview-summary.html000066400000000000000000000227071125261632700243210ustar00rootroot00000000000000 Overview (estraier)

Java Binding of Hyper Estraier.

See:
          Description

Packages
estraier  

 

Java Binding of Hyper Estraier.

Hyper Estraier is a full-text search system for communities.

Introduction

This is a package implementing the core API of Hyper Estraier, including native codes based on JNI. As it works on Linux, Mac OS X, Windows, and so on, native libraries for each environment are required to run programs. This package requires JRE 1.4.2 or later versions.

Setting

Install the latest version of Hyper Estraier.

Enter the sub directory `javanative' in the extracted package then perform installation.

cd javanative
./configure
make
su
make install

`estraiernative.jar' should be included in the class path. By default, the JAR file is installed in `/usr/local/lib'.

`estraier.*' should be imported in each source file of application programs.

Some native libraries should be found in the library search path.

  • On Linux and other UNIX systems: set the environment variable LD_LIBRARY_PATH to find libraries; "libestraier.so" and "libjestraier.so".
  • On Mac OS X: set the environment variable DYLD_LIBRARY_PATH to find libraries; "libestraier.dylib" and "libjestraier.dylib".
  • On Windows: set the environment variable PATH to find libraries; "estraier.dll" and "jestraier.dll".

Example of Gatherer

The following is the simplest implementation of a gatherer.

import estraier.*;

public class Example001 {
  public static void main(String[] args){

    // create the database object
    Database db = new Database();

    // open the database
    if(!db.open("casket", Database.DBWRITER | Database.DBCREAT)){
      System.err.println("error: " + db.err_msg(db.error()));
      return;
    }

    // create a document object
    Document doc = new Document();

    // add attributes to the document object
    doc.add_attr("@uri", "http://estraier.gov/example.txt");
    doc.add_attr("@title", "Over the Rainbow");

    // add the body text to the document object
    doc.add_text("Somewhere over the rainbow.  Way up high.");
    doc.add_text("There's a land that I heard of once in a lullaby.");

    // register the document object to the database
    if(!db.put_doc(doc, Database.PDCLEAN))
      System.err.println("error: " + db.err_msg(db.error()));

    // close the database
    if(!db.close())
      System.err.println("error: " + db.err_msg(db.error()));

  }
}

Example of Searcher

The following is the simplest implementation of a searcher.

import estraier.*;
import java.util.*;

public class Example002 {
  public static void main(String[] args){

    // create the database object
    Database db = new Database();

    // open the database
    if(!db.open("casket", Database.DBREADER)){
      System.err.println("error: " + db.err_msg(db.error()));
      return;
    }

    // create a search condition object
    Condition cond = new Condition();

    // set the search phrase to the search condition object
    cond.set_phrase("rainbow AND lullaby");

    // get the result of search
    Result result = db.search(cond);

    // for each document in the result
    for(int i = 0; i < result.doc_num(); i++){
      // retrieve the document object
      Document doc = db.get_doc(result.get_doc_id(i), 0);
      if(doc == null) continue;
      // display attributes
      String uri = doc.attr("@uri");
      if(uri != null) System.out.println("URI: " + uri);
      String title = doc.attr("@title");
      if(title != null) System.out.println("Title: " + title);
      // display the body text
      Iterator it = doc.texts().iterator();
      while(it.hasNext()){
        System.out.println((String)it.next());
      }
    }

    // close the database
    if(!db.close())
      System.err.println("error: " + db.err_msg(db.error()));

  }
}

License

Copyright (C) 2004-2006 Mikio Hirabayashi

The Java binding of Hyper Estraier 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 any later version. The Java binding of Hyper Estraier 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 the Java binding of Hyper Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.



hyperestraier-1.4.13/doc/javanativeapi/overview-tree.html000066400000000000000000000116521125261632700235600ustar00rootroot00000000000000 Class Hierarchy (estraier)

Hierarchy For All Packages

Package Hierarchies:
estraier

Class Hierarchy

Interface Hierarchy



hyperestraier-1.4.13/doc/javanativeapi/package-list000066400000000000000000000000111125261632700223410ustar00rootroot00000000000000estraier hyperestraier-1.4.13/doc/javanativeapi/packages.html000066400000000000000000000014521125261632700225300ustar00rootroot00000000000000 (estraier)


The front page has been relocated.Please see:
          Frame version
          Non-frame version.
hyperestraier-1.4.13/doc/javanativeapi/resources/000077500000000000000000000000001125261632700220745ustar00rootroot00000000000000hyperestraier-1.4.13/doc/javanativeapi/resources/inherit.gif000066400000000000000000000000711125261632700242230ustar00rootroot00000000000000GIF89a,э 。スョDr嗚ヤ;゚Q@岬N;hyperestraier-1.4.13/doc/javanativeapi/serialized-form.html000066400000000000000000000101061125261632700240420ustar00rootroot00000000000000 Serialized Form (estraier)

Serialized Form



hyperestraier-1.4.13/doc/javanativeapi/stylesheet.css000066400000000000000000000022621125261632700227670ustar00rootroot00000000000000/* Javadoc style sheet */ /* Define colors, fonts and other style attributes here to override the defaults */ /* Page background color */ body { background-color: #FFFFFF } /* Headings */ h1 { font-size: 145% } /* Table colors */ .TableHeadingColor { background: #CCCCFF } /* Dark mauve */ .TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ .TableRowColor { background: #FFFFFF } /* White */ /* Font used in left-hand frame lists */ .FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif } .FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } .FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } /* Navigation bar fonts and colors */ .NavBarCell1 { background-color:#EEEEFF;} /* Light mauve */ .NavBarCell1Rev { background-color:#00008B;} /* Dark Blue */ .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} hyperestraier-1.4.13/doc/javapureapi/000077500000000000000000000000001125261632700175475ustar00rootroot00000000000000hyperestraier-1.4.13/doc/javapureapi/allclasses-frame.html000066400000000000000000000023031125261632700236510ustar00rootroot00000000000000 All Classes (estraier.pure) All Classes
Call
Condition
Document
Node
NodeResult
ResultDocument
hyperestraier-1.4.13/doc/javapureapi/allclasses-noframe.html000066400000000000000000000021131125261632700242050ustar00rootroot00000000000000 All Classes (estraier.pure) All Classes
Call
Condition
Document
Node
NodeResult
ResultDocument
hyperestraier-1.4.13/doc/javapureapi/constant-values.html000066400000000000000000000171551125261632700235740ustar00rootroot00000000000000 Constant Field Values (estraier.pure)

Constant Field Values


Contents
estraier.pure.*

estraier.pure.Condition
public static final int AGITO 8
public static final int FAST 4
public static final int ISECT 65536
public static final int NOIDF 16
public static final int ROUGH 2048
public static final int SIMPLE 1024
public static final int SURE 1
public static final int UNION 32768
public static final int USUAL 2



hyperestraier-1.4.13/doc/javapureapi/estraier/000077500000000000000000000000001125261632700213655ustar00rootroot00000000000000hyperestraier-1.4.13/doc/javapureapi/estraier/pure/000077500000000000000000000000001125261632700223405ustar00rootroot00000000000000hyperestraier-1.4.13/doc/javapureapi/estraier/pure/Call.html000066400000000000000000000170551125261632700241110ustar00rootroot00000000000000 Call (estraier.pure)

estraier.pure
Class Call

java.lang.Object
  extended byestraier.pure.Call

public class Call
extends java.lang.Object

Command line utility for the node API.


Method Summary
static void main(java.lang.String[] args)
          Main routine of the command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

main

public static void main(java.lang.String[] args)
Main routine of the command.

Parameters:
args - command line arguments. The first argument specifies the name of the sub command. "put", "out", "edit", "get", "etch", "uriid", "inform", "sync", "optimize", "search", "setuser", and "setlink" are provided.


hyperestraier-1.4.13/doc/javapureapi/estraier/pure/Condition.html000066400000000000000000000513401125261632700251570ustar00rootroot00000000000000 Condition (estraier.pure)

estraier.pure
Class Condition

java.lang.Object
  extended byestraier.pure.Condition

public class Condition
extends java.lang.Object

Abstraction of search condition.


Field Summary
static int AGITO
          option: check N-gram keys skipping by three
static int FAST
          option: check N-gram keys skipping by two
static int ISECT
          option: with the intersection phrase
static int NOIDF
          option: without TF-IDF tuning
static int ROUGH
          option: with the rough phrase
static int SIMPLE
          option: with the simplified phrase
static int SURE
          option: check every N-gram key
static int UNION
          option: with the union phrase
static int USUAL
          option: check N-gram keys skipping by one
 
Constructor Summary
Condition()
          Create a search condition object.
 
Method Summary
 void add_attr(java.lang.String expr)
          Add an expression for an attribute.
 void set_auxiliary(int min)
          Set permission to adopt result of the auxiliary index.
 void set_distinct(java.lang.String name)
          Set the attribute distinction filter.
 void set_mask(int mask)
          Set the mask of targets of meta search.
 void set_max(int max)
          Set the maximum number of retrieval.
 void set_options(int options)
          Set options of retrieval.
 void set_order(java.lang.String expr)
          Set the order.
 void set_phrase(java.lang.String phrase)
          Set the search phrase.
 void set_skip(int skip)
          Set the number of skipped documents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AGITO

public static final int AGITO
option: check N-gram keys skipping by three

See Also:
Constant Field Values

FAST

public static final int FAST
option: check N-gram keys skipping by two

See Also:
Constant Field Values

ISECT

public static final int ISECT
option: with the intersection phrase

See Also:
Constant Field Values

NOIDF

public static final int NOIDF
option: without TF-IDF tuning

See Also:
Constant Field Values

ROUGH

public static final int ROUGH
option: with the rough phrase

See Also:
Constant Field Values

SIMPLE

public static final int SIMPLE
option: with the simplified phrase

See Also:
Constant Field Values

SURE

public static final int SURE
option: check every N-gram key

See Also:
Constant Field Values

UNION

public static final int UNION
option: with the union phrase

See Also:
Constant Field Values

USUAL

public static final int USUAL
option: check N-gram keys skipping by one

See Also:
Constant Field Values
Constructor Detail

Condition

public Condition()
Create a search condition object.

Method Detail

add_attr

public void add_attr(java.lang.String expr)
Add an expression for an attribute.

Parameters:
expr - an expression for an attribute.

set_auxiliary

public void set_auxiliary(int min)
Set permission to adopt result of the auxiliary index.

Parameters:
min - the minimum hits to adopt result of the auxiliary index. If it is not more than 0, the auxiliary index is not used. By default, it is 32.

set_distinct

public void set_distinct(java.lang.String name)
Set the attribute distinction filter.

Parameters:
name - the name of an attribute to be distinct.

set_mask

public void set_mask(int mask)
Set the mask of targets of meta search.

Parameters:
mask - a masking number. 1 means the first target, 2 means the second target, 4 means the third target and, power values of 2 and their summation compose the mask.

set_max

public void set_max(int max)
Set the maximum number of retrieval.

Parameters:
max - the maximum number of retrieval. By default, the number of retrieval is not limited.

set_options

public void set_options(int options)
Set options of retrieval.

Parameters:
options - options: `Condition.SURE' specifies that it checks every N-gram key, `Condition.USUAL', which is the default, specifies that it checks N-gram keys with skipping one key, `Condition.FAST' skips two keys, `Condition.AGITO' skips three keys, `Condition.NOIDF' specifies not to perform TF-IDF tuning, `Condition.SIMPLE' specifies to use simplified phrase, `Condition.ROUGH' specifies to use rough phrase, `Condition.UNION' specifies to use union phrase, `Condition.ISECT' specifies to use intersection phrase. Each option can be specified at the same time by bitwise or. If keys are skipped, though search speed is improved, the relevance ratio grows less.

set_order

public void set_order(java.lang.String expr)
Set the order.

Parameters:
expr - an expression for the order. By default, the order is by score descending.

set_phrase

public void set_phrase(java.lang.String phrase)
Set the search phrase.

Parameters:
phrase - a search phrase.

set_skip

public void set_skip(int skip)
Set the number of skipped documents.

Parameters:
skip - the number of documents to be skipped in the search result.


hyperestraier-1.4.13/doc/javapureapi/estraier/pure/Document.html000066400000000000000000000400661125261632700250120ustar00rootroot00000000000000 Document (estraier.pure)

estraier.pure
Class Document

java.lang.Object
  extended byestraier.pure.Document

public class Document
extends java.lang.Object

Abstraction of document.


Constructor Summary
Document()
          Create a document object.
Document(java.lang.String draft)
          Create a document object made from draft data.
 
Method Summary
 void add_attr(java.lang.String name, java.lang.String value)
          Add an attribute.
 void add_hidden_text(java.lang.String text)
          Add a hidden sentence.
 void add_text(java.lang.String text)
          Add a sentence of text.
 java.util.List attr_names()
          Get a list of attribute names.
 java.lang.String attr(java.lang.String name)
          Get the value of an attribute.
 java.lang.String cat_texts()
          Concatenate sentences of the text.
 java.lang.String dump_draft()
          Dump draft data.
 int id()
          Get the ID number.
 java.util.Map keywords()
          Get attached keywords.
 int score()
          Get the substitute score.
 void set_keywords(java.util.Map kwords)
          Attach keywords.
 java.util.List texts()
          Get a list of sentences of the text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Document

public Document()
Create a document object.


Document

public Document(java.lang.String draft)
Create a document object made from draft data.

Parameters:
draft - a string of draft data.
Method Detail

add_attr

public void add_attr(java.lang.String name,
                     java.lang.String value)
Add an attribute.

Parameters:
name - the name of an attribute.
value - the value of the attribute. If it is `null', the attribute is removed.

add_hidden_text

public void add_hidden_text(java.lang.String text)
Add a hidden sentence.

Parameters:
text - a hidden sentence.

add_text

public void add_text(java.lang.String text)
Add a sentence of text.

Parameters:
text - sentence of text.

attr_names

public java.util.List attr_names()
Get a list of attribute names.

Returns:
a list object of attribute names.

attr

public java.lang.String attr(java.lang.String name)
Get the value of an attribute.

Parameters:
name - the name of an attribute.
Returns:
the value of the attribute or `null' if it does not exist.

cat_texts

public java.lang.String cat_texts()
Concatenate sentences of the text.

Returns:
concatenated sentences.

dump_draft

public java.lang.String dump_draft()
Dump draft data.

Returns:
draft data.

id

public int id()
Get the ID number.

Returns:
the ID number. If this object has never been registered, -1 is returned.

keywords

public java.util.Map keywords()
Get attached keywords.

Returns:
a map object of keywords and their scores in decimal string. If no keyword is attached, `null' is returned.

score

public int score()
Get the substitute score.

Returns:
the substitute score or -1 if it is not set.

set_keywords

public void set_keywords(java.util.Map kwords)
Attach keywords.

Parameters:
kwords - a map object of keywords. Keys of the map should be keywords of the document and values should be their scores in decimal string.

texts

public java.util.List texts()
Get a list of sentences of the text.

Returns:
a list object of sentences of the text.


hyperestraier-1.4.13/doc/javapureapi/estraier/pure/Node.html000066400000000000000000000762741125261632700241330ustar00rootroot00000000000000 Node (estraier.pure)

estraier.pure
Class Node

java.lang.Object
  extended byestraier.pure.Node

public class Node
extends java.lang.Object

Abstraction of connection to P2P node.


Constructor Summary
Node()
          Create a node connection object.
 
Method Summary
 java.util.List admins()
          Get a list of names of administrators.
 double cache_usage()
          Get the usage ratio of the cache.
 int doc_num()
          Get the number of documents.
 boolean edit_doc(Document doc)
          Edit attributes of a document.
 java.util.Map etch_doc_by_uri(java.lang.String uri)
          Extract keywords of a document specified by URI.
 java.util.Map etch_doc(int id)
          Extract keywords of a document.
 java.lang.String get_doc_attr_by_uri(java.lang.String uri, java.lang.String name)
          Retrieve the value of an attribute of a document specified by URI
 java.lang.String get_doc_attr(int id, java.lang.String name)
          Retrieve the value of an attribute of a document.
 Document get_doc_by_uri(java.lang.String uri)
          Retrieve a document specified by URI.
 Document get_doc(int id)
          Retrieve a document.
 java.lang.String label()
          Get the label.
 java.util.List links()
          Get a list of expressions of links.
 java.lang.String name()
          Get the name.
 boolean optimize()
          Optimize the database.
 boolean out_doc_by_uri(java.lang.String uri)
          Remove a document specified by URI.
 boolean out_doc(int id)
          Remove a document.
 boolean put_doc(Document doc)
          Add a document.
 NodeResult search(Condition cond, int depth)
          Search for documents corresponding a condition.
 void set_auth(java.lang.String name, java.lang.String password)
          Set the authentication information.
 boolean set_link(java.lang.String url, java.lang.String label, int credit)
          Manage a link.
 void set_proxy(java.lang.String host, int port)
          Set the proxy information.
 void set_snippet_width(int wwidth, int hwidth, int awidth)
          Set width of snippet in the result.
 void set_timeout(int sec)
          Set timeout.
 void set_url(java.lang.String url)
          Set the URL of a node server.
 boolean set_user(java.lang.String name, int mode)
          Manage a user account.
 double size()
          Get the size of the datbase.
 int status()
          Get the status code of the last request.
 boolean sync()
          Synchronize updating contents of the database.
 int uri_to_id(java.lang.String uri)
          Get the ID of a document specified by URI.
 java.util.List users()
          Get a list of names of users.
 int word_num()
          Get the number of unique words.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Node

public Node()
Create a node connection object.

Method Detail

admins

public java.util.List admins()
Get a list of names of administrators.

Returns:
a list object of names of administrators. On error, `null' is returned.

cache_usage

public double cache_usage()
Get the usage ratio of the cache.

Returns:
the usage ratio of the cache. On error, -1.0 is returned.

doc_num

public int doc_num()
Get the number of documents.

Returns:
the number of documents. On error, -1 is returned.

edit_doc

public boolean edit_doc(Document doc)
Edit attributes of a document.

Parameters:
doc - a document object.
Returns:
true if success, else it is false.

etch_doc_by_uri

public java.util.Map etch_doc_by_uri(java.lang.String uri)
Extract keywords of a document specified by URI.

Parameters:
uri - the URI of a registered document.
Returns:
a map object of keywords and their scores in decimal string or `null' on error.

etch_doc

public java.util.Map etch_doc(int id)
Extract keywords of a document.

Parameters:
id - the ID number of a registered document.
Returns:
a map object of keywords and their scores in decimal string or `null' on error.

get_doc_attr_by_uri

public java.lang.String get_doc_attr_by_uri(java.lang.String uri,
                                            java.lang.String name)
Retrieve the value of an attribute of a document specified by URI

Parameters:
uri - the URI of a registered document.
name - the name of an attribute.
Returns:
the value of the attribute or `null' if it does not exist.

get_doc_attr

public java.lang.String get_doc_attr(int id,
                                     java.lang.String name)
Retrieve the value of an attribute of a document.

Parameters:
id - the ID number of a registered document.
name - the name of an attribute.
Returns:
the value of the attribute or `null' if it does not exist.

get_doc_by_uri

public Document get_doc_by_uri(java.lang.String uri)
Retrieve a document specified by URI.

Parameters:
uri - the URI of a registered document.
Returns:
a document object. On error, `null' is returned.

get_doc

public Document get_doc(int id)
Retrieve a document.

Parameters:
id - the ID number of a registered document.
Returns:
a document object. On error, `null' is returned.

label

public java.lang.String label()
Get the label.

Returns:
the label. On error, `null' is returned.

links

public java.util.List links()
Get a list of expressions of links.

Returns:
a list object of expressions of links. Each element is a TSV string and has three fields of the URL, the label, and the score. On error, `null' is returned.

name

public java.lang.String name()
Get the name.

Returns:
the name. On error, `null' is returned.

optimize

public boolean optimize()
Optimize the database.

Returns:
true if success, else it is false.

out_doc_by_uri

public boolean out_doc_by_uri(java.lang.String uri)
Remove a document specified by URI.

Parameters:
uri - the URI of a registered document.
Returns:
true if success, else it is false.

out_doc

public boolean out_doc(int id)
Remove a document.

Parameters:
id - the ID number of a registered document.
Returns:
true if success, else it is false.

put_doc

public boolean put_doc(Document doc)
Add a document.

Parameters:
doc - a document object to register.
Returns:
true if success, else it is false.

search

public NodeResult search(Condition cond,
                         int depth)
Search for documents corresponding a condition.

Parameters:
cond - a condition object.
depth - the depth of meta search.
Returns:
a node result object. On error, `null' is returned.

set_auth

public void set_auth(java.lang.String name,
                     java.lang.String password)
Set the authentication information.

Parameters:
name - the name of authentication.
password - the password of the authentication.

set_link

public boolean set_link(java.lang.String url,
                        java.lang.String label,
                        int credit)
Manage a link.

Parameters:
url - the URL of the target node of a link.
label - the label of the link.
credit - the credit of the link. If it is negative, the link is removed.
Returns:
true if success, else it is false.

set_proxy

public void set_proxy(java.lang.String host,
                      int port)
Set the proxy information.

Parameters:
host - the host name of a proxy server.
port - the port number of the proxy server.

set_snippet_width

public void set_snippet_width(int wwidth,
                              int hwidth,
                              int awidth)
Set width of snippet in the result.

Parameters:
wwidth - whole width of a snippet. By default, it is 480. If it is 0, no snippet is sent. If it is negative, whole body text is sent instead of snippet.
hwidth - width of strings picked up from the beginning of the text. By default, it is 96. If it is negative 0, the current setting is not changed.
awidth - width of strings picked up around each highlighted word. By default, it is 96. If it is negative, the current setting is not changed.

set_timeout

public void set_timeout(int sec)
Set timeout.

Parameters:
sec - timeout in seconds.

set_url

public void set_url(java.lang.String url)
Set the URL of a node server.

Parameters:
url - the URL of a node server.

set_user

public boolean set_user(java.lang.String name,
                        int mode)
Manage a user account.

Parameters:
name - the name of a user.
mode - the operation mode. 0 means to delete the account. 1 means to set the account as an administrator. 2 means to set the account as a guest.
Returns:
true if success, else it is false.

size

public double size()
Get the size of the datbase.

Returns:
the size of the datbase. On error, -1.0 is returned.

status

public int status()
Get the status code of the last request.

Returns:
the status code of the last request. -1 means failure of connection.

sync

public boolean sync()
Synchronize updating contents of the database.

Returns:
true if success, else it is false.

uri_to_id

public int uri_to_id(java.lang.String uri)
Get the ID of a document specified by URI.

Parameters:
uri - the URI of a registered document.
Returns:
the ID of the document. On error, -1 is returned.

users

public java.util.List users()
Get a list of names of users.

Returns:
a list object of names of users. On error, `null' is returned.

word_num

public int word_num()
Get the number of unique words.

Returns:
the number of unique words. On error, -1 is returned.


hyperestraier-1.4.13/doc/javapureapi/estraier/pure/NodeResult.html000066400000000000000000000223021125261632700253110ustar00rootroot00000000000000 NodeResult (estraier.pure)

estraier.pure
Class NodeResult

java.lang.Object
  extended byestraier.pure.NodeResult

public class NodeResult
extends java.lang.Object

Abstraction of result set from node.


Method Summary
 int doc_num()
          Get the number of documents.
 ResultDocument get_doc(int index)
          Get a result document object
 java.lang.String hint(java.lang.String key)
          Get the value of hint information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

doc_num

public int doc_num()
Get the number of documents.

Returns:
the number of documents.

get_doc

public ResultDocument get_doc(int index)
Get a result document object

Parameters:
index - the index of a document.
Returns:
a result document object or `null' if the index is out of bounds.

hint

public java.lang.String hint(java.lang.String key)
Get the value of hint information.

Parameters:
key - the key of a hint. "VERSION", "NODE", "HIT", "HINT#n", "DOCNUM", "WORDNUM", "TIME", "TIME#n", "LINK#n", and "VIEW" are provided for keys.
Returns:
the value of the hint or `null' if the key does not exist.


hyperestraier-1.4.13/doc/javapureapi/estraier/pure/ResultDocument.html000066400000000000000000000241671125261632700262150ustar00rootroot00000000000000 ResultDocument (estraier.pure)

estraier.pure
Class ResultDocument

java.lang.Object
  extended byestraier.pure.ResultDocument

public class ResultDocument
extends java.lang.Object

Abstraction of document in result set.


Method Summary
 java.util.List attr_names()
          Get a list of attribute names.
 java.lang.String attr(java.lang.String name)
          Get the value of an attribute.
 java.lang.String keywords()
          Get keywords.
 java.lang.String snippet()
          Get the snippet.
 java.lang.String uri()
          Get the URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

attr_names

public java.util.List attr_names()
Get a list of attribute names.

Returns:
a list object of attribute names.

attr

public java.lang.String attr(java.lang.String name)
Get the value of an attribute.

Parameters:
name - the name of an attribute.
Returns:
the value of the attribute or `null' if it does not exist.

keywords

public java.lang.String keywords()
Get keywords.

Returns:
a string of serialized keywords of the result document object. There are tab separated values. Keywords and their scores come alternately.

snippet

public java.lang.String snippet()
Get the snippet.

Returns:
a string of the snippet of the result document object. There are tab separated values. Each line is a string to be shown. Though most lines have only one field, some lines have two fields. If the second field exists, the first field is to be shown with highlighted, and the second field means its normalized form.

uri

public java.lang.String uri()
Get the URI.

Returns:
the URI.


hyperestraier-1.4.13/doc/javapureapi/estraier/pure/package-frame.html000066400000000000000000000024541125261632700257160ustar00rootroot00000000000000 estraier.pure (estraier.pure) estraier.pure
Classes 
Call
Condition
Document
Node
NodeResult
ResultDocument
hyperestraier-1.4.13/doc/javapureapi/estraier/pure/package-summary.html000066400000000000000000000132711125261632700263200ustar00rootroot00000000000000 estraier.pure (estraier.pure)

Package estraier.pure

Class Summary
Call Command line utility for the node API.
Condition Abstraction of search condition.
Document Abstraction of document.
Node Abstraction of connection to P2P node.
NodeResult Abstraction of result set from node.
ResultDocument Abstraction of document in result set.
 



hyperestraier-1.4.13/doc/javapureapi/estraier/pure/package-tree.html000066400000000000000000000121241125261632700255560ustar00rootroot00000000000000 estraier.pure Class Hierarchy (estraier.pure)

Hierarchy For Package estraier.pure

Class Hierarchy



hyperestraier-1.4.13/doc/javapureapi/index-all.html000066400000000000000000000604301125261632700223150ustar00rootroot00000000000000 Index (estraier.pure)
A C D E F G H I K L M N O P R S T U W

A

AGITO - Static variable in class estraier.pure.Condition
option: check N-gram keys skipping by three
add_attr(String) - Method in class estraier.pure.Condition
Add an expression for an attribute.
add_attr(String, String) - Method in class estraier.pure.Document
Add an attribute.
add_hidden_text(String) - Method in class estraier.pure.Document
Add a hidden sentence.
add_text(String) - Method in class estraier.pure.Document
Add a sentence of text.
admins() - Method in class estraier.pure.Node
Get a list of names of administrators.
attr(String) - Method in class estraier.pure.Document
Get the value of an attribute.
attr(String) - Method in class estraier.pure.ResultDocument
Get the value of an attribute.
attr_names() - Method in class estraier.pure.Document
Get a list of attribute names.
attr_names() - Method in class estraier.pure.ResultDocument
Get a list of attribute names.

C

Call - class estraier.pure.Call.
Command line utility for the node API.
Condition - class estraier.pure.Condition.
Abstraction of search condition.
Condition() - Constructor for class estraier.pure.Condition
Create a search condition object.
cache_usage() - Method in class estraier.pure.Node
Get the usage ratio of the cache.
cat_texts() - Method in class estraier.pure.Document
Concatenate sentences of the text.

D

Document - class estraier.pure.Document.
Abstraction of document.
Document() - Constructor for class estraier.pure.Document
Create a document object.
Document(String) - Constructor for class estraier.pure.Document
Create a document object made from draft data.
doc_num() - Method in class estraier.pure.Node
Get the number of documents.
doc_num() - Method in class estraier.pure.NodeResult
Get the number of documents.
dump_draft() - Method in class estraier.pure.Document
Dump draft data.

E

edit_doc(Document) - Method in class estraier.pure.Node
Edit attributes of a document.
estraier.pure - package estraier.pure
 
etch_doc(int) - Method in class estraier.pure.Node
Extract keywords of a document.
etch_doc_by_uri(String) - Method in class estraier.pure.Node
Extract keywords of a document specified by URI.

F

FAST - Static variable in class estraier.pure.Condition
option: check N-gram keys skipping by two

G

get_doc(int) - Method in class estraier.pure.Node
Retrieve a document.
get_doc(int) - Method in class estraier.pure.NodeResult
Get a result document object
get_doc_attr(int, String) - Method in class estraier.pure.Node
Retrieve the value of an attribute of a document.
get_doc_attr_by_uri(String, String) - Method in class estraier.pure.Node
Retrieve the value of an attribute of a document specified by URI
get_doc_by_uri(String) - Method in class estraier.pure.Node
Retrieve a document specified by URI.

H

hint(String) - Method in class estraier.pure.NodeResult
Get the value of hint information.

I

ISECT - Static variable in class estraier.pure.Condition
option: with the intersection phrase
id() - Method in class estraier.pure.Document
Get the ID number.

K

keywords() - Method in class estraier.pure.Document
Get attached keywords.
keywords() - Method in class estraier.pure.ResultDocument
Get keywords.

L

label() - Method in class estraier.pure.Node
Get the label.
links() - Method in class estraier.pure.Node
Get a list of expressions of links.

M

main(String[]) - Static method in class estraier.pure.Call
Main routine of the command.

N

NOIDF - Static variable in class estraier.pure.Condition
option: without TF-IDF tuning
Node - class estraier.pure.Node.
Abstraction of connection to P2P node.
Node() - Constructor for class estraier.pure.Node
Create a node connection object.
NodeResult - class estraier.pure.NodeResult.
Abstraction of result set from node.
name() - Method in class estraier.pure.Node
Get the name.

O

optimize() - Method in class estraier.pure.Node
Optimize the database.
out_doc(int) - Method in class estraier.pure.Node
Remove a document.
out_doc_by_uri(String) - Method in class estraier.pure.Node
Remove a document specified by URI.

P

put_doc(Document) - Method in class estraier.pure.Node
Add a document.

R

ROUGH - Static variable in class estraier.pure.Condition
option: with the rough phrase
ResultDocument - class estraier.pure.ResultDocument.
Abstraction of document in result set.

S

SIMPLE - Static variable in class estraier.pure.Condition
option: with the simplified phrase
SURE - Static variable in class estraier.pure.Condition
option: check every N-gram key
score() - Method in class estraier.pure.Document
Get the substitute score.
search(Condition, int) - Method in class estraier.pure.Node
Search for documents corresponding a condition.
set_auth(String, String) - Method in class estraier.pure.Node
Set the authentication information.
set_auxiliary(int) - Method in class estraier.pure.Condition
Set permission to adopt result of the auxiliary index.
set_distinct(String) - Method in class estraier.pure.Condition
Set the attribute distinction filter.
set_keywords(Map) - Method in class estraier.pure.Document
Attach keywords.
set_link(String, String, int) - Method in class estraier.pure.Node
Manage a link.
set_mask(int) - Method in class estraier.pure.Condition
Set the mask of targets of meta search.
set_max(int) - Method in class estraier.pure.Condition
Set the maximum number of retrieval.
set_options(int) - Method in class estraier.pure.Condition
Set options of retrieval.
set_order(String) - Method in class estraier.pure.Condition
Set the order.
set_phrase(String) - Method in class estraier.pure.Condition
Set the search phrase.
set_proxy(String, int) - Method in class estraier.pure.Node
Set the proxy information.
set_skip(int) - Method in class estraier.pure.Condition
Set the number of skipped documents.
set_snippet_width(int, int, int) - Method in class estraier.pure.Node
Set width of snippet in the result.
set_timeout(int) - Method in class estraier.pure.Node
Set timeout.
set_url(String) - Method in class estraier.pure.Node
Set the URL of a node server.
set_user(String, int) - Method in class estraier.pure.Node
Manage a user account.
size() - Method in class estraier.pure.Node
Get the size of the datbase.
snippet() - Method in class estraier.pure.ResultDocument
Get the snippet.
status() - Method in class estraier.pure.Node
Get the status code of the last request.
sync() - Method in class estraier.pure.Node
Synchronize updating contents of the database.

T

texts() - Method in class estraier.pure.Document
Get a list of sentences of the text.

U

UNION - Static variable in class estraier.pure.Condition
option: with the union phrase
USUAL - Static variable in class estraier.pure.Condition
option: check N-gram keys skipping by one
uri() - Method in class estraier.pure.ResultDocument
Get the URI.
uri_to_id(String) - Method in class estraier.pure.Node
Get the ID of a document specified by URI.
users() - Method in class estraier.pure.Node
Get a list of names of users.

W

word_num() - Method in class estraier.pure.Node
Get the number of unique words.

A C D E F G H I K L M N O P R S T U W

hyperestraier-1.4.13/doc/javapureapi/index.html000066400000000000000000000013661125261632700215520ustar00rootroot00000000000000 estraier.pure <H2> Frame Alert</H2> <P> This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. <BR> Link to<A HREF="overview-summary.html">Non-frame version.</A> hyperestraier-1.4.13/doc/javapureapi/overview-summary.html000066400000000000000000000225751125261632700240110ustar00rootroot00000000000000 Overview (estraier.pure)

Pure Java Interface of Hyper Estraier.

See:
          Description

Packages
estraier.pure  

 

Pure Java Interface of Hyper Estraier.

Hyper Estraier is a full-text search system for communities.

Introduction

This is a package implementing the node API of Hyper Estraier. This is a pure java package though it has not uncertified yet. So, it works on Linux, Mac OS X, Windows, and so on. It does not depend on the core library of Hyper Estraier. Applications are implemented as clients of node servers running on local or remote machines. This package requires JRE 1.4.2 or later versions.

Though Hyper Estraier itself is released under the terms of the GNU LGPL, this package is released under the terms of a BSD-style license.

Setting

Get the package of the latest version of Hyper Estraier.

Enter the sub directory `javapure' in the extracted package then perform installation.

cd javapure
./configure
make
su
make install

`estraier.pure.*' should be imported in each source file of application programs.

Example of Gatherer

The following is the simplest implementation of a gatherer.

import estraier.pure.*;

public class Example001 {
  public static void main(String[] args){

    // create and configure the node connecton object
    Node node = new Node();
    node.set_url("http://localhost:1978/node/test1");
    node.set_auth("admin", "admin");

    // create a document object
    Document doc = new Document();

    // add attributes to the document object
    doc.add_attr("@uri", "http://estraier.gov/example.txt");
    doc.add_attr("@title", "Over the Rainbow");

    // add the body text to the document object
    doc.add_text("Somewhere over the rainbow.  Way up high.");
    doc.add_text("There's a land that I heard of once in a lullaby.");

    // register the document object to the node
    if(!node.put_doc(doc))
      System.err.println("error: " + node.status());

  }
}

Example of Searcher

The following is the simplest implementation of a searcher.

import estraier.pure.*;

public class Example002 {
  public static void main(String[] args){

    // create the node connecton object
    Node node = new Node();
    node.set_url("http://localhost:1978/node/test1");

    // create a search condition object
    Condition cond = new Condition();

    // set the search phrase to the search condition object
    cond.set_phrase("rainbow AND lullaby");

    // get the result of search
    NodeResult nres = node.search(cond, 0);
    if(nres != null){
      // for each document in the result
      for(int i = 0; i < nres.doc_num(); i++){
        // get a result document object
        ResultDocument rdoc = nres.get_doc(i);
        // display attributes
        System.out.println("URI: " + rdoc.attr("@uri"));
        System.out.println("Title: " + rdoc.attr("@title"));
        // display the snippet text
        System.out.print(rdoc.snippet());
      }
    } else {
      System.err.println("error: " + node.status());
    }

  }
}

License

Copyright (C) 2004-2006 Mikio Hirabayashi
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of Mikio Hirabayashi nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.



hyperestraier-1.4.13/doc/javapureapi/overview-tree.html000066400000000000000000000117441125261632700232470ustar00rootroot00000000000000 Class Hierarchy (estraier.pure)

Hierarchy For All Packages

Package Hierarchies:
estraier.pure

Class Hierarchy



hyperestraier-1.4.13/doc/javapureapi/package-list000066400000000000000000000000161125261632700220330ustar00rootroot00000000000000estraier.pure hyperestraier-1.4.13/doc/javapureapi/packages.html000066400000000000000000000014641125261632700222200ustar00rootroot00000000000000 (estraier.pure)


The front page has been relocated.Please see:
          Frame version
          Non-frame version.
hyperestraier-1.4.13/doc/javapureapi/resources/000077500000000000000000000000001125261632700215615ustar00rootroot00000000000000hyperestraier-1.4.13/doc/javapureapi/resources/inherit.gif000066400000000000000000000000711125261632700237100ustar00rootroot00000000000000GIF89a,э 。スョDr嗚ヤ;゚Q@岬N;hyperestraier-1.4.13/doc/javapureapi/stylesheet.css000066400000000000000000000022621125261632700224540ustar00rootroot00000000000000/* Javadoc style sheet */ /* Define colors, fonts and other style attributes here to override the defaults */ /* Page background color */ body { background-color: #FFFFFF } /* Headings */ h1 { font-size: 145% } /* Table colors */ .TableHeadingColor { background: #CCCCFF } /* Dark mauve */ .TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ .TableRowColor { background: #FFFFFF } /* White */ /* Font used in left-hand frame lists */ .FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif } .FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } .FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } /* Navigation bar fonts and colors */ .NavBarCell1 { background-color:#EEEEFF;} /* Light mauve */ .NavBarCell1Rev { background-color:#00008B;} /* Dark Blue */ .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} hyperestraier-1.4.13/doc/logo.png000066400000000000000000000517361125261632700167220ustar00rootroot00000000000000臼NG  IHDR,nェD゙PLTE!7&%;*)?.,C1/E42H76L;`93=I?`:9=M=c><オアqキカkxソンnレ∂tm ツw0Fウ畋1+1|テー,テヌgeX銛-ォ#淙セ芬セノX~y帛[4チ _ニ?イ杖ッ4~Гx゙チャエッmu莚タチZヲメwレFヌ5マhw撲ク8Lヌ迹;ZモスGNヨ痴1フm|テ 8ナヲ畉ワ|ラテF&ヒiキdカ疳d」ロ<詑ヌ赭釈チCヒ8mシ゚mノノ葯ョチ袱〔エラ pマ巣Z偵エワ犢y"n゚?セユャ6セ23>wト訶 K;Yg疳セ@レ C-alヌp ヌ-疸ナ?タ (fヤニ瓩ヲW?ワfロ リWマッa ラ5Z^嶽4トv苻Oホ」97$8ヲ ocーO萃ョツ◆:Nフt yrWHEロn]聟|ンB喪ィ蜆ャe續Z」厭(ォ-モ佳з>)拷オスf{.1Eツ- 彑挟オア7fw艝6L!ョロ!}テn鳰抻T'ァワT覩-ンワンシpョzサンニ1<1iホモX? レミ「#vモュ艪レP|^cヌ列ウネ゙3, サd>ム。>ァ趨'タリp.キナoツ4u*閠^結ス弘#モモ##モxト6=02愨ウ蛾痩馴鷹キゥ∇ !」 ! 「ノqZA%p汾ソ:~フ靨rタカO:瓮エyD精mクト5狼[>マc5qリPヨ)レヌヤユトタリタタpトカk ~イ;2hlz`/ニFGFヌヲ7ホ%4ijソg|黯ヒI Bリ|Eスコワ?璞ソ4>ヤノ 「GK8emjF哀GHe y`ス`狢ァ ByKチis&aヲノヨソ>WM OO劇ケタ`Oッ開|bdzxdzlo勲OソStマq:ヤー詞ソリケ塩 OR砂オテスノIツ憎セ_゚メX~、%J゚GMカゥ ミ暦zカKオ雲1ネ&apぴ-、ァa々@オv「[袙0$ $テモ.ュQUF〕テ醇ァ皀掃ャn京キ ?衆 yユ陵覿S挺6瓢ミv甅郭 9ァEウ{B 恁 コIy獎也チム|0・4jN{s41>xャ;FS,才}ネ騅+ヲュxクムタ」G、ヘ「媚eネ」 ゙ニUニ&ニ睫チl<|mW 9ノエ6オヘマ姥f;x6mルシヲタN,ケp^F嗟Gd7>P)リ敵i*(メV鈔"朮W。!モ<シ|ゥ=シq滂ワウゥ、/俟フZ*Ip、ソzzCA,エト6>Sー4イマ愚テゥ=Cゥタ剴瘢-沿w<0DLテ=jmエyH振tlソEミたネづy震ネkLソ0 クヘ掩ハウロ; *PCツO、+レユユンユラ鯏塗4レヌュォッマサコ」?薩薜>財Y_oW,犢]ァQマ后7 6#F2Zロオハoテア尋ld莊蝕ロサナ9L-ョムxミワ俤 YH8 $ツ5`flキ#S衆)Jカ愨駐bリニ0 ]PラspT$7セ'憖 ヌヌ@:ナ蹇蠏*Hモンンモ-$黎E「|鳰#ミッアKOW$べQセw# `ヘ ロヤ捕チS洲'F~S齧c6J/。ス=餔[8癘ム饐ネ譌フFyナフキアDテ」Hェym幟 スQ,ホミ觴シp\kWNh^シヘ=,>ツ襲。建`「u|ィ!G爆'メ,lE8-AタネD潴ナト聳hャッァッッァqo/hラク'レラユロラユモz^ナzコz{サコ7黐》櫚ラトナpェ カ1ャ演キe\nラツ+haJ糒「驅穩0笂Q好趾桧ム飃x E垈棒Tキ熱ァ潰nmメ|会Aク「蹉 "Ldロ」-5J+ソ/ヱM 炬U'4ヲ笈#キY+ニノVBP |鮹;宅hコP.セ橿ィ!XC哂hョJ#IKルノキ.フ#ゥ;マチpアhONOュ-?セ噤エィ;6YSホヘウjEヤKオNRtsレn*OA 速Zヘλ2ェ鮃裼2H8P4-]aNRソR+セ6ι4ュTヒ 0ワタpホh帛$I 圻コafァ%8整オD%>#齪ょ&H「墜}踞Cオ` ~%nミg "0Rトxkト#8意 ュオメR、+phサC限=Gク。ヤDエキ幟d7┳サOゥロ鶴$ラセマNL\ツソJJタフKケe^qxBチa|L盃 %1ュェ吼.ゥウAヌ→uCマ策O<クメユ蔬リワDヲRケH゚5謠ヤエトd泓-]チ3p8KBノフ< ΖTヘ6凖8)C_tト"ゥ蝓=オlテ「テH。ク.T^;{篌C !拉-獅N!'Щ隔C縊Tワミ't29I8ネ譯レ蠧0I$J vj ヤネ鏥ス#F僭^釁フ」造ルb_堡トRモミrヤ8ト惟ィfeM醴' SgゥuヒTS,萢bヘヤRpI)チi布&4im7墜MBw$w絳&ネg$ー嶐藤ゥ'vサヘw[ワヘ@PEァユB蹕セ_Wコ眥偬vv >殺゚餃9B+eh$!,"|C(。"3蘭h メ.*B尤eョメJ1{ゥ、ソM唐Oヌ&>ユ巵jァ蟒ZnW `欒゙ ゙1湶4j9 漆ト7Bロaミ;g9"7仗lニ0/Uヘ(ゥTrッチz襤ン]ェ&cチt>=淆g鑼レ゚ン螻OHホ典塾dニヌ'?ユ鑒CpテワZ鏗オチYn q J0+qヤ杵:8癧ィィr辺コd}ロf与hエミウォカ+ネ^メ$2ェ浴、R、4Mラ5スQQ~┤ホHヤヘ0Ce勍鄲モモゥ躇:#Kヘコ^┃ヌ顆シルャ^=R^ト$w@@Aャ馴鵁碯蛾サコ癨I糟ト。ウエw醇。ス @"=4ョ/ リノホ?:椽ミタu@L\ソ[゙OォaセNル多}サ ツ|饌ノ:セik ェ(m3モMzEサメエセル68ートネオ屐EIチリ0<カラ秘烏Oユ~Eリ9モ物$4xーコ陜&ィ-M^宀セNヌャ7ヘ2 bX甌ム瓏ウU[ヒ謠?ヘ(蛾姥J>_ョ岼ムPヌ閾ソ-ユェE@Y佩銭ユ6ツ廴サン燃ヲゥ ッユ疏'=x3籌ーミOKヘホMホ>サゥオ6sウロヲツjウ "ル60」%セ9賂マタソ!euHvG~ノPユ1祺ヒトb0泥`]さ~ヘ-_ 婪Nアモ凜ア1コヘ2゙セ| レシヨ弖; ヲ7!ヲ|}"[・},クSap錏UUヘニヤヌネXカメ ,ン4幃Tf^ ヲ。ルじヨヒO%ヌカX)fニ$I沈sロ2Rユ@ー:ウタカ#q%bh0O Ha叺撓]x駢%。J!O3メf`ヱ+絶ヌP梠e$@1髱シヤ ヌュ躔{ナk跡鮟ャ恕サmィi甍D忘ュ ロ、{イ絃4ミ{闕0"jェィ先Pュキa培ァiェソP曰'`鄲浣3pヲ}ァ怙L呪カl鑰y\ ャ┘欲テ.曰スメ&ヒェ*チ@'Щ「ネ合シ。D$.a デT]タ'゚T3ウ3ウウウッo鸞彑ワ&Oメケ i \ツ$ カ9Z蘊顆/モo「マテウ畋カ\]MvE(」ヤK .X 輾ヨ[亢~Xwムレ~ ィ{x)袈フ忸W種TP揮セHュ栴ン シ5鰌遽モ駘Iユキ}サ姿j`竢;c 筈D 呆弱」?%ヘdδAKb4l傘.ーm溂g(@妊゚%リャ跚譌譌.オゥ羣v釡。5、ウ・Bタ/ノキメー~ ウ!` )衛ユロt2}[ット'QPオ;ェー括酩Tクュ>泱,!M暘゚ばmn 'LW`^3P8タLマU ネs"ヘ 蚰d臚ヲ\)ラtンl-h 2ム4痩OL<-奐ラ\クMhxb絆ケぱロトサ崋トM%ハH∋z/ル 3彡]v$ヲt@Q ,スメxヒd ワHM村過nZーHチヨ逆_弗`夜ツ柾+ョ迸2ッ=[カI苺#t)ェ pヒbスョg痙ツヌoク#YFCB0┴bツメヲd)f ,゚オロt苔径kハハJ`eeS]クdxア。-攣キ秕、「H→ヲユv&イ瞹佛ToW8`ワcznサカ!恰~れ餔ラp鮪g」n"gRヤハBafゥpヌr8 W$QSヲァWL亦y」ィlL7abェ朗'^テ#(鯊)ル掻jク略 ッsリT・ZA驗ノ鰔?$ナKx爰0WKョ・ェレヨハ ス_ーU珥"フO糅ZカFユTフ$ーミホツt9蹟i[#aク桴ソタv<艸 」ヘ0YVナ[Mワ6&x漸PE Eチr「ーFテ{ツ。Sモ?1v1ウ$ノ.岨fl:鳥Srb^辰ユ K墫P則q4コヌR'^「、4ネ(ュ qwIv12uヤカ]契M-ュャ/ョmnョタ ル捻ーRDイシR敍j qt\ヌャテ<広?ャツ=-ヤav墸ヤ#畋pxs:]eSNG1svi:ーエヘハ[0ヌP鬣Vキ狢Pgv2ツr ]MSO゚UM+ナ&破ス。tX凛靨a亀ヲ龍側嗇H∃ !ヂ捗啝_゚__゚レ゙PャaルRsレノ7レ!瀑U丸=ウヲトワ あDF{サコウェ-Q4x,[iェケン.ニgzzェdh.ヘ"ミチモエ/UNンkイウaLセセ 土ョw6モ>濕゚ム$4セ;rツル⇒)QMァゥス サrコョセd偏ョ5w^ゥヲ杪収'モqR" a籾!。゚#)1cノハ箝a|ugmmg{ks燗ナ雫0 .I_)!+ョ'mぁツ|!x(・柑ォ霖鋒テシヒ<ネタn=O.・仲ヌT?ネア 軻。n7UヨЗ=s゚r$ ァHvNフd發jvzzlbF笹t・8ッ"ーj?レi.'1セ逡コsタヮ松Uヤレkアキc$}ッ4シリDセ$嵋ゥ_!\?リン,ヲwカヨ7キwキ7wv2u(=チYイチYャoクa%。xモP_タテaヲ:Jマ|J<アイ亥チ>=カQ-d^E匐>!,g豕嘴:"ケ\\カ荘ヒコロR3商 $dS冨棋 ネタ橿c#粭L0Cff賃ヤシ鴃 'ハ*.朖゚hf=C゚q -S.ソ6KbゥDX‥,<灸忠ョメ=「ヒツヤ!ッ1ス_n-疉gh釟?リ?娠&ト/!SF,リ/ゥqPm_シsスイ~オ逆Uニ咒ツウhZuX賍abヌキタ廴ス慫シ韶>ム。;:シヤa黜リ.リqォY|9!2・モマAxュョBM1T0Nユ佯6ッ~頭$ーネEウ-y;1ーヘタモ|>=!%9JヘTO&B臓朗+ 4 ムW゙ヨ;+ェB豈〒a^綴湛5Xツユユ寫ヘヘ溽ァァ「a∞<ムj ムレH,ャアd=eヒシ;dI|<&セzBk ミ毎スe冰ヌU*]テ「坂?亦h O dk*PD」c, チム 1;メ?T「窘'ナ{#OoTVルー`テケサcxs`:践タフQワQ)カr"Uフ0ネ\ヒ滲フ?!サーJ咋。 cルャケp添忙oェ*事>リルーソ畫顏Pゥロヘ#・癧6Wat`,KKG%アレモォ「ータ\YムYr゙Cュ `ロカmウn啌BltフJQム0@:6Bサクァ膺$%Cナ3=ネヤ>IQ)vァツzオ*OK$Ii ツZvラィシ它ソフLタリFX:R)$F(2ヘ86Rノ'8>!テ4ンィg5ルヘ*ロヘ'ケ叛T饐"擾沺悚沺棔栲rョヤェ&マcLBヨク 」:-FDjczコF?Y」r)ヲ+uBNXツ+慂g\喪vキi(hテcb xルoaーヲテj6*,ナキ喞餮莱トロンwササ竕32u]M':ケ崑迷;a゚O$゙ナ.vHnシ響J|ハ衲xvcc耻=QRサ?G<)。\~@メDIシM$縊6W゚@}Cy8リル∈?;リ>Οホ笑緒Aォ?マ..ホゥ XW箜イ'c39eフcヤ゙1;0ェD、}践ッ"モホC嚔。aア ュIモーオラマ涸|ホソ゚%>~セ<ワ^fUッ圜Uォj・ヲユ4ウYッVェォ迢e・Xァ「^UsY%匿ハ、34・夏ォ好|#(贓ツツウ'SウOfgヲf遏チケ{diルツ粐メ粐ハ篦ツ粲ハ踰&カwv`カw>ン樶沾迭ァ~セ8;=ソ8?TノKm 難Fシ6 <ミ}I。チ7ヘTナ$ IDATkzサ~6麭 vヌ隔bNGjS \YクN ^ ムr祉ゥWヒj・Pチ雖蛯ェ+稗餒-葱6シWホ lヲpB萩J{袵瓦d副 チW、ツォャ>~xt頌蓼f~劈囹Z戍ラルゥゥ勦ゥケルゥナル's 3空ウ空+ヒ+マ妨觚ヨVヌララVカカキ6キ6?_ャッlo脉鳬ムi鵑」|酣ナ鱸/涸|9?サ>?ソセネ~サセェ z沢e+O┏袍L祀( $ア「肉{スG嫡スp!$ヌa 麺(C槙ユィ3ケUェ蘆ア、@3)WTJq谷撩、ONRサ焙夙/檣d阯ヌRFネ(5q]_qハcfy」アht類リ罍チ。チチ!l」ワヲヲ&gF'g'3ユオ咬ル9nsウ Sヒs給s桐ヒヒK+ロ給 kk躯岫+[幎リカwVwv亜~釡ロG;ヌGGGホ?悃櫺.ホケ]_`サクセセクv変ラ1*羚#▽_eUCァd悋ミ#Yソソソマ1レ餉ゥuオヺSF薈)゙O)*浚駅碓駅泛~゙=誉Y4ニ%!)5 Hェ麼奮ョQヨ5DCメンユ傍 =zワ;4ヤxtロ猯韋蒻ヤ8(vl3ウウ3O@イ0モメワワメメワツ|8:8:;;>:=rq~∩ワ゚釶ョッoッッ業スo|^Vホツ サ:[トhs胯-bY塲カi YXォ^50z nテ貌〕スーW恭ェ貞ヲ「東FuT養瓧Fcン=ア゙禿(ta`lOr7述魄錘リォ1ーァ'庚哉Fo6ァ ~"3P゚3」PPssウsK h>+請蠏・・ュ螂ュ・袁ュオヘオ擯5D筝pコpt碯)エェ( ャuqvキ躯o_|z貮l,V$8跨1#ヘト」伴窈:ーヤ+ =褞V櫓j"ケ。u1ォ爻q4衝"ン=a臟ナ橄眠斃>:俘gp3DTTキ4チb1煎q,6ルラ;8帰AA匹ヲGァニヌ}kdァ氛&2?75??5;+レjy沫訌蒙!q0x+クepモヨヨホ&ネカエCキソv|pz|zv~t訟ネfツOロナキ[Pゥカp[*YセQォ゙ン゙eェ-e1ヤ&1 s_jFO+Lナヨユ{Sッスン`明隗T:9ノdSミラ''TヤーUソN#lヌBSjゥセ骼1Eンン#秕aユ83C,ウ覗k4#ナ後ヂヌΤム。qハワ ggニキng6鄲I3ワ謠。ニ逞匁WfW銘Zヒ+ナ リ毘踐ホヨ4チム鳬鴦チ3ーヤ鴿倫/ョソ\|。~ハ}サ^シュヷ~[ョTセ鷯マ革Sォユ黽ヲ)コ1ニ$eH゙fレ チー^P5- ーXマ循}2レロ哉Tテ $3/ユカeロセ\ハΤ@燠柞ロ^ レー鰮ュタ6ロtfΟ>|オ゙2ーn6ュ繻ェユj・ェU+楼Uヘ界wpiG.橡忿L戀遏迚棟゙シY艮ョョッ/9ュlュョm痃{ハiskレ~0`チ鮹ム=維(楊シs爰ツユキロ黍゚!x゚ooK゚ ユw席イ口哥ミhタj肝yHXテーコエ=$剥タ"ィE嵌マTiEココ#均ロ碎#9ー$U}#沓仟nMウ今耕K%4Y科リxモォ6ヲ。5Lスa6t=dLス^埒ッ▽w5ュョAメIニo、^ヘg2リ2卅ョイ'?ニ7v>シ_~8<ーsエル゚_6ソ}Jp制&ゥpクロメマ衍jオ{U~ッユェ?kョ5Yユ|タV0#ン槽@u\ハ4ォ坡Hキ。uカォKゥK],麈ル嫺<倍=D?ヘdA$^閠LナVg @N5ォ@オオコ^ッヨU.2テs5ツ5@{ンィ54ュ^ゥテO0 ウ4-テ荳%pj ェ、3巻ンd3鱠I:q:I$Aタc0捶.淒;滲~28LァR餃簽覆VM:Ui犹M'鰆K・ィ9ョルヘヲaV ゥトIb裸テqb~ユノ.u矣!゙J&糲0ァヨェj:出タ8ィヌォ {オ帆ハヲn-;メ4クイヲ曼。y:ャ: シVト蜈ウy|C)エm゚ュォサGャ毘ケ#hハスチJq゚糘ョvソ)*uョエ,ラ峰$ヒM搆Fモ儖迂タラセ|5C嘖ミ縅~レユ;リE(ケワセ//「ヨ&奮1ラmヒ鷽v 緞叮犁0肭ヤ7ニ'g&解'軫ヲ槊>y Q>フ銕$aー シニ・eEモヒォ++ K+ォヒ[p沫ラ`R;ネ攬 ]ミミカ,Sc壌榎vコ0,+|Y゚.オ&セyキハ廟 ツニ顕.2テ サヤ0%゚6@リb@マ彫HL峯サ]]兔1G煩d_(jV靨ロoッzテRタYッ ネ驩ニモwヤ+'ゥフ!図SG鬪jJァ-僥M]克*ヲ゚"K縉眷ミ萠璧フミ靂ヤ顏ワヤI)b睨フ"「ケルルルフ/ツモ棔[ムイ +エ「K+k桐`トWD@ョサ穫タ喩R苅ョ[ ナ矛 耜ンaミナ雍ZFリ@ヨクj7マ8ウeコマzコc}D鰡匱$-;イX_tィユ}ャ゙鑑疸Zj眼ユョィRモ[坿チミ驩ェ 孔%^u アYR王メヤ卒ヲ;rRェ緇"アヌiユ卿<[ヘ件衆f鷄ウ)5kゥム匯I〓Oヲf・F=ホZ\XXシXx。6I轅ユzヒョトW7チLkヒロォ龜イケセケセコスソyYリァ謠ャ l。し2ョ%ゥ瞠2タイ=36投オ\櫂゙a'Y販ャョノa蚫6エw]ル」fエcキ.e鳫w★謬繁ョhェヨTCサ-蜆幣牾IEヒソ3.ロD分^;。sMSェ縫-v)0客ク@ΑTYGル0 $oFXヲソ鮭ルヒdサ51マ゚メBコェv-スシhmeus=qg嚆]タイオュ斛テコー・ヘ^kタ\ヤ翻ャP湫WUレC゙@ァf^00Z*ユキ澄h愽n#畸霧aラユTラCゥロPW糜u=+アtケ庁艨.飭UM第]遭註hセンヒ槲 ユ曹:#'E_ミヘワミ綫zイt俯叺 垰'罐S R:m(ホn#、n.ョ钁」麦コエ0サク|Rョ$ヘッュ,eヲn゚YY「ァスオケ沈ッ蜩」タ罎.ト賺ソャユィ嶇z网vF瑣UQ)  レォテユ,刔AYイE」ムャハ&UНイエモナDテ衛 aヒ0K1シ贅:Eiル^Yイメ{ゥ;f.F}゙モ揖uqゥAoャE:.nvOシlヨイ哨tOj謝シ屮39:4LuΣ?體}2343簇シ4Gッノ籤フ|カヨュー0ソイ2ソシ6ソエ坏VOV\ララV/uヲヒ髱-00ヲミ\マl|リ゙?リル9ハ├dF-c6策5、Fョt#イYs jSbR*jjコ梓:3歎Mヒ6B迹ン崚゙゙>ケゼ゙Xェナゥ間H@ハメwuヌミ祢FココウuテTb、j/ルTXjメロ*{リヘスカヲ<#消ュ&ェMユイ縦ャCCC 'ム惓ニァfヌァfI很w鉗。テ!v 恰ヒ56譁VワZロT゚橘ォヒk+マrjg1タギ・蟠ワ>(upシ8#ゥ>Wッ、トユdIヘ|X;q ,5d;カサ/」ー揃イ愍'*A米。<2ヤC、ユン8Kpァ幕РセH_jE/2イ円ェ6  tソハd$ユ L(ツdス輯w~ォz8#3・aュ孩」ヤヤ翆ゥIナレ^タ Wz6;3゚1] ネ」ンT3ウウウ教 規ウjカ5オ/{ieウh鵯b}eeskッヒェewカキ瀰ト\ェ懦毯>;=マjM^ヒ4エ%アャタe3 &リ4!Td2截齢aKy!"(!xムセXュxX+ ンfM。帝%ナ棠:嵜.ヲナRs啝セッ裡シtヘア曝メlotーハ;・0tMィN」れ e.4ムニヤヤ(L]ムtク禍ニT&ゥニgAャNG2&セg末戝H k+ '奐i*$ ュテRスz^べク動A)wフ眞ルムム駭~ャ栫カpハT!ク8メウj」aオR 0ル,tpコn[\,Gセ6モ-兇),`スォ頓 {vル5erィキgpfナ擽1旧a dNf5C?サ7rj譌(ト惓A7dム8シユサ4綺西_ィ瑶ワウゥAbヘムgE約Wwgf。呎涓ム躬g゚ア・擂オEリシKヘ北ノッッュッッmョャヤッォンュ-カ イ」tr畫{鋩xキモ^Uホ誌A=亊壟ァョさ 默坦g#膏yL洩EOハャ炊SョゥDゥr漣xキハ。iekン坂Fl|0光865コレ-ァmw }EI牋蝮V>v<)Vヤgハ撓zフオf獵tュZJ脯C/モユイ3$ナョモ6ウクノ'鉄飭テnサFi 鐐fvqk複Kl@ウxネミハハ0z投ラU7妨V、ヨw句ワホォテト&セ ^:9リ苓ヘ、フ(ァNマホ褝|Vh`KNウ -ァQワクユ屠」!h%HハHhー;ャ竿bt ;! 、?4゙ヤミ苴,ゥe=h>ッイ,戉RoT)ネqN-?嫁&SYヘNニb猖セャ驍6]i$l|ttjp|イhV]撈尹剱,ハ鷙鰻ヨ泌媽悃[Z\ハ`カ;Raモ1*'+ ョm(R橲リユCミfk轗・Zクウ敲eN誌 Mヌa偏鰮銛χyシ犧M5qq Cサェノ2fKソjリ モメ。、ワNAHォシN、Mイ尻;ZJJウXGォリ-ムヘ雉b] mZNu7┤dA憤Fウ QYSミ抃58\JョZォVハ・壜シZf|9ョムヌ鮗レ賺Rゥ経ルムム。ムルチムクノZ>1>>3;357鐙ネnィ豸QJ,ツツワメうユ・ケ岸ョ~6X[Y^狗鷭M 漉リ゚゚ワヷ゚ルU+ケ繝jョZュテテ Z襁エムナョ2s釋}ケククNホ企ェヲ5 4ァ鐶彎コEIネミ。テ檗コhp k゚C磴bナクツw0ヨ ヌgF鋲ー倏v5;3 ホ悁忱Fgチァヤ.Up勅韭+ユVKラゥルdンPUモ羶?JA,,章セマw波333ウタ槙 7カ圈媼シRヘウ(RgW6^,/2Hニl玩O許Z_ルレbレe[ U>nイvog{#圃8>レ9シャ/甄沺マィj6Kロ_ェN"」f%6壑サー`辱徠dvv3(iCョJ`7Cス!d*F =リ'ニニKFリテヒ=ョル敘M10ソ%J耳Uセ$z梯I竢KヘワN`YaYWヒ<Kdt0ゥ%ヘF゚.,0ワ>d.楕2<7ソーォhpilゥ、ア?+KpWVリ凡TレZ哘 [kyva`コ3 ムチォニウマァヌトeラxV%Fbミtc78チモヌ0、マ*5Wサ24xメ驫 ゥKアォレ]),eヌ)ヨ塲D小罨^A阯(倔ア"u」ロ_Mヘ3L>33過ケ'YC:ツ3iヨョ^%甕uムヂリe扼Aリ@ヘzfv zヤe揣%\メ 汐_>宦鞦X3Sウ\fgヌソodTYlヌ=8オ'+%ホZY[\!d%9クオ喘\yk{7<「ah驛」ャモモ3Q帯喀キ虞5u}}}チr.}テGB憂)履ミjコ~R4 。Vコシ寸怦テKR]Ik圧j。ヤa゚bQ「ィ^ユ+:譫mィ主Iモgヌーフ,(5K~ハkカァgラゥヌ坊2uY荳訃f-。jケテヘ箆ヘュケロnワ%庶ョスf蜆イwトメ 呱配ヌイ?6Rvヤソソ}v{ュ*6ンFm驅ケTノ*「滑9ォ糎L)「b;06掃陟晏?ヤメfノ(<窺=噪オ揆霜拑シゥウc/参ン墓ィZ詛ノKqUニ |呀WJヘヤ剥Aゥ}z<:9:ョィ睫?先.1TタツW%ヨ層レ.u剔]`Mユ簫 ンェ糺オナオ頁オラ振Bf躾9RS sロロ巒q・.ノテ,ニ?淞吟2 ヲLハO?モン;K鉢礼ラノL)}x百鵐I・ヤキッキキoキ'企亰ォレJUKォ`-ンー~fェョモ黜フ>3ワア裴ikネコ<レ9」U4n・ニォヘc%幸5縷澣鉞蘭。AXメウコ。イロ椒ゥS<潴ロq嘯ム|2>ケZ4m潴5チ@ マ)FZノヲ貿「叭ホZ蠧メムヘ橈sェゥ晨x*アqーソエ疉'ュ爵 Zヘハ」ウ」ウ挙p4`L渕%{裘Pュ*_r冲「x}オH&iォ゙BO}ソュ\) S]コ^スェqa嫂フョ甫iアQヤロZ人hv~ K1 韋ナ8ヤミク`qZ((咬'ョ、エクイーカL>`瞿ョhy5+UケuテCC穫?RSミZ」3ラ臚]*0盍W^ヘNメi>ソ4テ~儕%-^フワ簫<$コ6ヤテナナ袗・・ヘ紛4p坂゙6?キvカカ「牾シマqi複悋試Nマ?モル妙]據g%KxRェ謨\&qコWフカm咬ォm疊襠マロ慓nヨウ・毆5ュrッUィ萱ケェ詫G黼ヘAクイラ {トZロヘ2sフJノ覗テBマEP3L。ッ*\N-ョシア末VV貰-礒Z醋m.S=Tヘf」ナ5338:5:>兪)2<ケV=?; l07zA奮。/ラ蠏オテ~=UロTモ+S;巖 vノフlソ:QJルトホヨホチルHヌ6ォゥ」ウ緜ゥウ渠bイ茹:?レミェj !wヌШF5 ニ-U7オォスョラヲ椣尓啌ミケ慍-;m-ョトトー k!D,ヒ膤蟲ヲ@sOXス"ヒ 汕レコ^`eマ籘`カキvv゙ユタカ蓑ー針j!OSW^フ2ヘヘホ_j疔゚フイェ G[\朧ィ。?5ュォo蓬ユ埠ー・゚*n1 セ{cイd,Qlエエ"モ辜」マメ*簾ス,オコクセ8r。ヤquN5コ傴コdオフr;トョ慂00Z谿vWユェw5x椚g4Mォ壜4SUウVォ駱チ盛ワ崔 ;1シ,偐ツ ッc l5N|ェフオク黽q」ェ,,ツヌXYY]アカw 興F%u7>kコjオ .~v6ンォ'Bシ :ミ7Q"ソ<レ逝IDAT2クt-ュ6跛レヨ0ツムw]U>l ヨヌァ c17)0]alイー。^%ラB_ョ衞衞メキ討盒ャサ?ォ?+? 倶ェラu」ョ馭#ュカムa辿サуZ#ルイ*エC|Xャム レユ遁'聹チ色エPYf炯amu&[Z装%夸ュM砲ュナT\zV」SeSEヒーヘ6毬2;婉テョ仄b耗ト <默'U:ミvVU⇔moooョn 忖ラw:忤5c8z Bア;;=~ァ嚴]ノ|>フイルソョッwo0姶\サネン゙2坩ヲ(vキ・ C4F、|_>ラン・受oο0)M"イクエト、緑セヤシウコ#B節f禝ヨ匐/@"&呈况Ξ,.ョ,テ豁ャッ.ッュュゥフ9V3 hキ枡P0O9ケ*ミ゙eノJs Ow@ ワ<職強X=[+ョ,-oュ,ッャnュ-ッ・、e }ツ-ヨァooッm\鵲vG=&v4ォ3シXFg韶マ渮ウE\ミ]:wq 6コヘ_J亶垰 Tハ蝓付ュQノャヨXl_lz-Sム4CVォ属齦L」。5傑nZiオ^Wョォb咤レxイム7%ハY樶ゥ-」繖Aロ'sT,ZX論X2(Z^Й゚|wS7Teγ「ュ}H|Hsノ* タM"ーJ゚マ ホマj 犧~]Mフヒヒ+kヒ$ェta ウケコ"ノ睿ュンUE{,=リLd.U%~ニメbTMy~z]彎|IィuMミ゚XシNΘシ^囚~スRノ(ェr^ソソッヲ 4、曰7f」ャヤ*)ヒミjVCモW卯・゙/遑uxテ3_]硯モ.トivnY,8ネトrDミi @1,ユワHワTLml羇vヨwチ v奸嶇ウョ覆ヨヤBkヤ}" キ*ゥUフ ル+ォK+iモ腟゚m0;溏l*閉。」モウ;'W殴3祀U9d 6TナラLコ修谿禽ツ\キ゚,ェJ8{ケ鎚ヲイРUM女澪dリァVZo襍 XW跌-K」撲f#岶ーッJリ/\綿U|~D:テKoE俐g Y棔]Z^X^梏リュョAI)リqィ盃ョwルンルル?リワ9レルチユCO衆マ緒/ィYVマ/トW觚3J6チミモヲ「喊霪喘t|kM6zP ィQワリ・珮l賑Sチ6%紐Ycu{}檢vq楞=ノ、3ロ"昵蠶キJ。慚應ェ゚ォユtクvッ鈔2戡サ'  ムRコe岶澱>ユlユコゥ蝪輦Wツe峇B1A$シ)U<、pQツ eni}qymqe}yqkU鶤ヨラ6キキrカ7譲w>タs=8;::ロ?>%ネ9:ソ(v卑H]ゥtqqu7]ヨMsケト鳩uチリwTキ=ラャe37Y} SヌE・JヤO2。ァwsw!z:ソzq斫]膃0ヤキメキoタ听チL゚K・j「スオレ=ケHォ Vネナサ「゙`MX5R タミr鴆慓-jィ)Ucヲw k徴A+|%-#ツVBEヌnVKjQQK_KェR(桔+菊・P,JIケハォ\ゥ逸シZハK崖V巴!W,*;ンフ?ハ]ュaヨJ9%邑ヤJオ?粂剳籏\覊ノds8V鵲5ケロノェH・Tタ裙濱ヒZォUQ.(ツUW蝿リ」ZZウワ+ホ、珍ハ輳キB!+萩ォWP2凌コzU(莪s+婉学ZオウY拳マ]fンミqフツラナRュ蠡"K 訛ァ!ンケタ-ホ罅-ウムlhFn弄モl5ッvKキmL確コュp嬖瀘ロヤ=ァ゙ヌMn-ラスヲ ラリ蟾ロ爽w嚴ンhコ産gア$98乘舞uモミフヺtヘヲo偃fヒl9ヲル4,シヒウLキi:-ネニヌ>Bナ`kヒuMロツ藁ロヌョカ l゚jル姪衙zウmキld゙ CヌiS,嶼C7u縫奧?=ヌホN/ヒ鸛i}顋アxL:8 l|,i貧哩ヒラ6\/畷Xァモ獗o*3筒ワーiコヒ[*9メdイx.マオ;.霹;テユ尤ヲ扈V[rサNロアォiZ庚ァノnFモqLノルヲm味Jォ{岫,ホホニ`床?帙Vxコ_t壊セk.^J槃賓Z=゙Eヘm71mヺCwAカ,9 }Cョ)省、届1獪問\:F~ァ撤ノトラw゙'UeO脱?Jヲ球ヒヨ嫖bヘ}ベテx裕怒F ~レテW姜袁奸}ホH&U證椎d2ィ'゚クノ、゚I(& 僣&5匸|ラ|e/8セス裕苧7擣{7o{洛u7漣ェッシO4擾7ノK聽^ワ鬱ャス7覧oヤ゙葹oTaシOニ槌}ス鏑イキ ン5O#メン ラQ3ヲ7rdH}゙トマo7握ン |\ェ!ンメキォ}GU杜 ア%Aト迩Tu」Φソq鄂殤5H塰ク狄ィ淦ッコm?'ノサ鋺ノ+ゥ2斟゙゚椢トー蘋-Tコ゚動oシo9゚OYΡA轗毋鵆|e:鬢xaシt*ュNイ贐モi'ムキンtメH溟クカ淅ル+m^ト沾誰スモ,&ン=キ5苛テ惶カ uホhコヌZzモRヤアZ甌g懺ョ<`?毒悍L(mラッ&ンヨ橸Lr7sOウ{ャV4潮my套vモrJェミK`&ォチhS2^ョ'vP鶫.8N*'Mーヌe' 咨W#ヨ痛エ;#l彷 H#;ォUOz櫟ゥ2ヘッvヒクラェ%[澆%奏ロ盲y_p研[Oざ欲Cy3m緘2Wヌ8オスヲ昌*ノソ0鳰!V人t コoAロシテ リXニツ「棆メツ諮xasJIンキテョメ矣2轆チ勹dニヌ紫Qォr騾濫TュQネ~トt鵜@赦i殘ァ>:>ラトv~$゚m-i6rチxIW゚cス ;8sョ co柄O>ル亠$ ハモリラKr拍 次V?亦B2ヘッヲ顛ラc3拉。V'鉾B゚ 沓:ルNw澡セO鶫 \lケリGG8;・4サh%゙vヘH謫~m橢ォS(J]nxPレ歎elhテナFx[6veカ|LTヌq゚モフクツSナナ箭 ]ケI勢C簽ルN濫モ*3-wTPMソ6ャSテjトァ:ョリP$羝稱キ!d~ヒV惜z9Iロ 「ムKサ{u柆"ヘ1iHョ3WァN 掻v ョvレivャ「値トj騁3G|」琅。iェメシS_ヒHハケ薇S鏤l;ハ^D彦リS0 ネスf゙ヌ3ッ゚pタF\u左m怯@=ソy$縊弛蒡>Nzュ畄禝ロnMq碕IィN」Tワx0Xェ&~f/$ヅシ6縊゚~1ラ盞ヲ平*.9ケ要恍][~{叙&竺ハヒハ峭l璧f纈=W゙シ-uヘマ譖$ラ燠q悛矼ォ琉洛ラ2oメヘ7o~オk譱ンロユ暘嵜 ア邱縵ニ7o=ァ9゙ォ&シユ軒軻ョAJY4:4`發ェゥ珮ニHr゚、oIyMロ捜ヤPメ<ナ艙l樣I。4幗 ヨ dヨエス63シT楳ナ゙ナ  ツ蝙アャ`オ-.鍔 芸タリ[♪QY詼リAロxリニヘ夕イ2A^+pMVネ-7ob」 髟|>元xキ4) Dーx+ネ6oQ#Kcx ョ@r-i ヒnヒ拏・寇ラqツ。E 案=!-ミP腕hオy2ァc?1まモqA3吸PZョX〓輟モRH炭訳仂4.4ーケェu^リ&ゥモf焜ム・7Df矛2>6eB#X碾vx?^G:1*c"ツ\ノケァ*ヌfaロoサエ薫dフメv?シ"オ漕Tカウ .;サ。ydエ撕M.箙・_x終゙{レノoyZシ{3嬰ケッ)ッヌツ-ケaァ6ンタnQazホP遏[ィZ-y吁エ NXvo<ワイ弄$|ケ'];、u;l斐Xテ$pAxハ 恨+レMKヌマセワ。錮0セL6リMト"wneタ(,銃」6/峭iワ端Mレ-ソ]゙レP埆a|キ驗m<・6ヒ房5ネMYd・\@」鏤毆マ据;@クョ゙}ョmPィメツ亊Sーテ、@iソンrgムェ8,)Qaァv)ヶ.舒ラ躁ゥツ。ta~Snk霆R'盂梳_「セ>Qタテシ fフウr|キ釈&」J舎 ケGHョ廷{クZヨセ1Dミネ奘1d}4。ッ+ヒ:ーu|[|2Aハャ餃pa リ?サqm拈/gV刈A(("wコヒロe qfbe+T[Z父 ヤ恆7-ミオc_驀}コョヌリKц0Zeラ、ナスヌ`R嗅裲鐙i朽)<芳キ┻*オmxj扮$.~ 喀ミsNクト'(マブキZゥ~G4;QqZ=f贊」l縋]ー∵rヤ渠:ワル%v12Bヌ゚モaq搶テ濾畉Q6テp"キ^n3カ^ッ9ォ;ェf~F&fネ9タ'?_床ム{hOVYlレ-Elユ%1i雅傾`腱/2vロ`R'zツ`Zナyョy8p! ォィ藍C躰{cхウ僥i週簷ュ~No n袿」ナF ァ匪gァrl0Aル゙シ簍ケ。ハ噸マ靦U戌奬Ne58滯~.翔シソau、=キンウ梓ヨU~ヲ;C韵躋@w%テ &FcJ浪<:DA 諫}wウ}0ェキiB<#6*マ 9]ソ7・*1<{Q沫(徴二ユ・47メCU)zphカ)yOoM;震M.FKA暄キ!c%oqテニ聞・Wxヲ\jr ~_oー カ5┘%ソィIENDョB`hyperestraier-1.4.13/doc/metatree.png000066400000000000000000000560721125261632700175660ustar00rootroot00000000000000臼NG  IHDRミタ:gAMAXヌG cHRMz%u.鸚:oi萋+[ナIDATx彙? Fチ(」`撃Q@c@ Q0 Fチ(」` @」 参0 Fチ(」`ミミhツ撃Q0 Fチ(44レ」`撃Q0 Fヘ@68Fチ(」`撃Q@s@」 参0 Fチ(」`ミミhph壗BE」0 $hniP撃Q0 Fチ(T4ィ8「9」 参0 Fチ(」ミhp`諌「ョ・nャヲVPラィQ0 Fチ(」 oW搖,WΞラ喘\テD・牾要巽8サ.1セ」`撃Q0 h580ユ ラャリVナ+iオ5膳専#ぐユタh餐Kシ/Fチ(」`コ& \コーV眛p8sネウ1ヘ$メ」`撃Q0 F=@ムシチア{ョI逃M8pル5糀クcUΛソb稙欣ョチ\ウQ嵒ク禀=Dル醯#>Gチ(」 h゙爲ェェヨタk$サチ⇒「メ (局鷁0lウウ 1> Fチ(tDGiiYC甚ソ8ヲx゜シbbd九7‥クル廁ンIミメQ0@||たス@サbPエv=%Rル@eマAR,P竚A竇Q@< :膏制陸V\4F痍テ48zKGチタヌヌlン1ム9cb'エ、vD(@ヘ?;GエH0ユ堵#OスンCP#.+FチHタ」」@サb柩8カモ゚%クャ$ナルホミmp A@ホヤ拗kS4ナク債_U謎$ャチヤ而I\+ォFチH」#I慟タェW&;ヌaUF、瓮嚮ヒpソu仄)=ネ6Y モkEウ擒ハQ0x@ "モ(C鍵痼ウ院遂ォヌッ Wス業%ニdャエ侠uトー1 $テ"]NL[淵`P#ヤ」 参0Bタ瑜g!^旗レ抖5dサ<'縢" 、Jタ箜hツネ」`ク‖カテヌヌ[ ノL]DヨphG曝0 ャ i$ム@磴俊@#hc撃ルu  、 +Cチd烱1ハォチヤB、ネs唾B、 Dコ徑{欝9 :@頃参0 Ffk8hラ ゙ニユ狢ェ捶ノnp身/IzGsミミヌ(テ 月p獏Eンzq$486ツA椰xTホA@」#」` 70フヨp疹ャ剞ケクリacト露RサAエ$]x「ワ4)R%U|t7」`クムdスgqI。鯆?淑Uク廨vOヒ k ネ杜ヨ%メ゙ムu敕 FG8Fチ(n`t ヌ(」@醂@」#」` 70:ツ1 Fチ( ミ9sミヌ(テ 鍵」`陷ケhtc撃FG8Fチ(ト:g.」`クム5」`b3@克p撃Q0ワタヌ(」@醂@」#」` 70コc撃Q@ sム参0 」`陷ケhtc撃Fラp撃Q0 tホ\44F8>}t籠'L6}$震ラョケ~Uツ閧'マホ?oタ繧>芟モUOtc゙スウ}ホチ 0I`ア。 陷ケhP術22メLMMδろレ+Z+G兀倆ャ3u」c帥゚ソ+ンョョNHヨ x\ミャhュ齏囹j`堋0]テ1 `:ケp眈ォォ境ァGJzメ`ネ$0SXX+ 3ナ(タ陷ケhP術フ5ラヌヌ{ホレ迸\クH#w旻Wラヨx゙#鵲ハタ罸スm'ァ?y簧ノ゙Yタチ) ニム参@lルアヘ'タwヌノ]!裙'fuミミ9sミ カgδBハ+ホ=ケOy4メリォvッqt[サv -bg`kニ碁pマタイ^=UモPO^Hot ヌ(タy Xyサココ愃sf畝yゎ9k&ヲヲ tネ C@醂@フ#--m9゙イ$荵'沃5キiA[黄宴!エ lmO8⊂タAMMuャセチ石'‘倏妓:艷sA7ツ{Yy$オ={翆MチチヤZT8ィ、ソ裙 ルx8&` Kニレ瞋5」?務~~n髴Xvy}ユ:sA7ツ光 x孵P託=ュdwy9HLLXシe`#ノne試p@GGワ適楪I"レァMY玖陷ケhミ膏477オMnヌモホアwNZZZソユレ'N <<ィリ刔ル、.゚]テ1 `xレ& lp ララ:g.t#タ樂ョシ5=8I`ウq&レEヨニニヺYツ9+傍]」k8ウGラp68(ア ネeLトャ眤d綫テq社X.1ヘチカムZ:g.t#」k8帥 ーDュIコolt?9:ツ1レ燿タヌ6 \F8ホ矍・&散%ヲ,フ 」k8h陷ケh膏鍵 ネ#タセ、Iモ ナ」」3堆紗5ル」k8Fエア  クcイGG8h陷ケhミ膏Dニナタモル(宇5タケラBフhヌ~rtcエチA @ロbF9コホ ムヌM<#h5カxヨvh鍵眤ヒヨ]テ1レ `ロ レワ・BS-3@克p %マーF゙ノ堵$ メセD裹UW男月p%ノ(FG8Fチc1G8Fラpミミ9sミ 痼ュ!セヘKk6%Z!ミ カ5菓エ「1俟ph8キ耕P穫#オD]テ1 稽@ゥ驂0ーGG8h陷ケhミ膏 ェ]*d40n 9Tヨp[卞T#、ニ8VヤムヌhャTgl血LNワ93r蒻Z:g.D#ー5!藁ロ|鈍ヤCTサネゥGq ェ5、錆甞Oナュム5」 チア 堝ヤ9k桍G ;=;cヒ模 フ陷ケhリ姿タヌ Sォ5、=蝌W<コpルNソタノチZ。4 1嗣Dшs茱#」 チア 1cz][#uK'囃迸\ruu!綵チQミ9sミ 癶x=d_テ8_ケヲチナニt)dオニ∴/エクモ@='楕t_惻c6、」k8F& fl翩J`yB瓶jB`#>!9「3@ フ'ヨセ/稚aリn 9ラpィ;ツAラタィ肅FG8Fト"ヌ6珥ノ読チチ†=ュタRコ)槙芍;gW゙UWラHモミアホ ムuラp尅4Xク\訥オ ォ剩ーUツヘbs|xt+ョ迂蕀共]テ1メc丐ッッ?2.kサy0SSSソ蝣e{mフロ瘁"K畉サェ1偃RlRKム5ッ_ソNLMIハJゥkォカム∋f叩キ・、'ンI|mJンア `:1cコォォ ミ%ウWフ aIホ嚼U憺,C((タtnpミヌP"菓・ャレ!a#g ヌp%GG8H `eーh簔wI;テテ#l@Pwl」オオ」ーェ`タC獨#タzaエヘA @@ 「紗5ルDR]爛」k8:嶽a$ッ們{g 頂# t-ミヘEンア在サwE'Gク゚曳:ソマンンktル ユ4:ツ1禰Rマ6;N.4セh馬mz姿"1ユ獸5コホ t#ターヒvxj;7ミ}ヘg[}}エ協タV谺Eウ<{翆M‥T?」k8-蛩wク劍}tヨ+タマ癶[寃瓏 ハヌ∴;Vスxハタムェ:78h0姿チ咀リオ汝47痛) ァモy蒲2アイxヒチ@nリサノヌヌ゙スG謌 { ヌ9シ/ミトアェ┃ヌj/セ;]*is7ツAュPツェ輿セ]テA @@ コ0羯ココZx;7掖fソp02. >}「E ロ演 刔ルッ$甍;'+ヒャ゙スC^H式 HhsZキ9H]?1リ」#エtnpミ 痼`- ャk゚カノ]ォvoァシaO:ソoホレタェランン XP7F9Xサv漉謡AE!0ニOワ9;瀲AリホX、コzz盛n鈷若q量レキ9Ql蒻Z:78h錘p ラッ5キキEEEhャ-22メUーリタ ^ソ~スp`憲囹tTミ 齏 タ村'鍵痼ラRAソ6f?際エケKヲムZ3U@ 参0 F`ト姿ミ.Z術タラp レオ94ヌZ:ラホ4F8Fチ(トτ5゙'附uhヤ賻]テ1 タホオ3@克p撃Q0ワタ盧q羝緒ナI%]ニsト-レカN/ ~',ッッ3g.aァ{ FG8Fチ(V`$ッ]__ト搏Ι_N信フ|ヤms/=;s9w坪黄化w「J8s @」#」` 70bG8ヲヲコwヨチミ#'廷參ロワワDミ_ヤms8q<2.fタN<ケツaWO障}ム:ラホ4:ツ1 Fチー#y ミタ:ノヌヌ{ィワ? tgp0ア酲Rキヘl蜚ラW攤sr0~チォG,s:ラホ4:ツ|*90レ  ァネ#y?x[ubbBPXH][=UエVヨエB6ミ@w樗ィロ譏1cコォァGAI Lvzvミ促ュ :ラホ4:ツ@7ュ$ケθミP?<q邃`モ* エモ(」## 設齎セ}gFF囓旅ニQQ麹MC=?fA゚フ@」#Xタp痼ネ^袴ン+クタp寄ム5#接蹂餞bjJRVハ愀 6レ8xホEfッワカコ}J娑Xヘ=3@克p`テゥA」サWーB6ヲ5:ツ12Im雫エエゥ ァ {R'廰マホXサv ュp:g.眤q?l苅。頡  ァ]テ11m釈ソ.[カエ$0径ノ>x性ァヌラッ#ミ9sミ0フサ倭t N 」##モ覃LLXシe`ス 朖ハJルセ}'ンR:g.眤Yチ[カlス{S件ョロタシoccウツチキ 云ラV?q:莢tホ\4:ツ ァ?ス{ル俟ヌ(タ゚騾醜辱モヲMァs0{@醂@」#Xタネip伍ステ)ニGラpタモ キ =:ツA @醂@」#Xタ0F甫ヤ璧?:ツ1 `W嫩(姿TエV試pPミ9sミ0フェ"チHセ{e8ナ参 ーカ9 #ヂワY-3@克p`テゥ! 鈷ン+テlLktc フ6ヌP]テA @醂@」#Xタmpゥwッ ァ]テ1 0Z寃Fk8瑙bヤ」拊NP-3@克p`テャソKiwッ ァヌム参 キ9h4ツ⌒n H「ケ□゙ム5エtホ\4:ツ ウ鼇 0メ^N1>コc6斎pタ%F=ヲ峻月pミミ9sミ0悴 チルス2フニエFG8F.is痼ヤ惜4qエH;ョソJ<#XE惜ム5エtホ\4:ツ68醒Hク{e8ナ参ロラL キ澆ネcネな- フア \va翫w癶sム,`偖w)テ~ハpjp#hld]ロXUR8ツ1コホ FG8ーaVP サWS件ョチ5ネMカ-0ラp`@]テ183@克p`テゥ。.ョwッ ウ1ュム参ミsct ヌ`tホ\4:ツ68p≪zハp寄ム5」 f ヨq n ト/關nホ FG8ーム%`(゙ス2彙|t ヌ(タ~YモP゚;ュg0啓マシp磬@゙ptホ\4:ツ ウ.チ摂ス2GG8F!k//wホク台-ヒ:リ!sム,`篭?ヨン+テ)ニGラpb0{n>ア}径瀉OY8ンヌヌリH0ホ FG8狡モヲM8qー_t3ミ蕁6Pdt粛={ 箔ーB6ヲ5:ツ1 タ掴ヒヒロフハ"2.&(,xp賃リZ?}4ミ。5<3@克p@ー_lA韋。クォ・・1レイ&`゙ス g`ネス~レ@サモヌ参@<倍タ?hム@ミ0tホ\4:ツ cネ(2ミセ{XタヘノノhG!タpjp」`陷ケhtヨ=:シA-竸Anフ 暸若ヤ]テ1 Fチ( ミ9sミ:hnnべ@@;gX♂' 78マ ヌ蔀 V2 Fチtホ\4:ツk--Puィ」」7:シAEp籠q 0H9モヌ参0 F操ホ FG8ーネJ紗ユT?~沼lpdgァエモ@`858庶p撃Q0 tホ\4:ツシ~レヤヤttxコr゚ ーR_クpIssーR  テゥチ1コc撃Q@$sム`0ヤ#kチp,リァO&N0\B0フF8 ロ哥チ(TタフEマシ @」#」` 70フヨp撃Q0 ム参0 f#」`撃htc撃ル参0 Fチ4:ツ1 Fチp」#」`撃Ahtc撃Fラp撃Q0 !ム参0 」` B@Cc翔峨'Nィiィ所活結゙dbbミウヒ-ノー芍;'レャノワ」` B@ハリ?ーエンxpモ琺w8リ゙タ>}Ek濛[ロタシCFHソサTFチ(テミ`跋{Z%(y <ホ碚5\ラsワス{ヌ'タフン>カ:F'ヌ沌ハ」` B@ハ脣kチチ'<}ヘAツ旌WZYAサ(翩匠ー錐キ恥<コzz接ハ]テ1 Fチ( ンP}゚宴。9I['as」):t,2.jタテvp%ォVュ&5HGG8Fチ(ミ 碾'ーウkaav簧卉ミソツコ訂醵:ハ )yu`鄰テ^ケmuTTI9コc撃Q08@ ョ`リ3了」$ル7"0蝣eラ蔀カヶM^ツt タャ廩ュ皺ェmp薪UD 獅Ahミ膏鍵眤C式∽G@@ オネ53qオ3FBャネヲzャ{液 .ユ桝 刹湾」チ8ツ1烋ハAヒョ#!l-廁テl !@景x固板・ !ト(テッl7千$beH駅9鮟Q@$sクミ>R6レOFッPヒ=」k8[慶4PラU58モye"チ嚔*礬hp針 オトAQミ9ワhミ膏xホwセIメ欺コb&{ク姿 クニwdィァ y 若エ2疏フナナ'ニL嬬%トキ0:匠]$鯆c&I阻/Iュ寝@ミ9htс]エq辿2ヨp・ 鐐q迪。。>I9コcハ1k8 Mネd8 ネ9リP%\=\ョW9ワ:!ヲワ#4クF8~ajjz跟ルチミウdEk、Iモh_yESNー應ェンkBCテI メム参0 (w゙アー0[エ~1含ェキ 触 ーハ禪宇ウn臾8h膏@@~~ヤe3Ijモカォァ0ミ.イlルイ9=;sタテvpイ+ヒgフ朗Rx式」x綫テ6Vヨカ8レホウ舵EミニH翫b\#チヒ8;cGIdr門演テm玉p6、_8張#」`O悠埀癶:ム参0 ノk8~キアアル矜`鑢ノコ鑁 忖ヤ>・mタN;(,萃d漣9dLKタP龜ヨ3N<サwヨ槌フ鐔;ミヌ(テ 鈷葩 t31T>ネ7& イ「p%$yラルル颯ホ。`FヒTソJ%ォVュ&゙春ョhtc撃aFネナΖッI<鑁znZン4v][ト咽繽?fフ偃韋LBl`>4イ゙xpkPXI9tョhtc撃Fヌノ堵祟Ltnp騾啜イ「オrレ4「.2仟 hーアノヒ。s @」#」` +0コcタ筅イjc0捶6*ホ。4@釟 FG8Fチ(n`ト姿ミn チ[:繕「bF8ヌ磴 Nャk8瓔Pィ52メ挂g」`Xム5エ鑒シマホFサ#ステf ヲ゚渦Odリ「膏モモ]]]ィu!タネtョhtc撃Fヨp4ツAェ゙aウχxャネk8裹ンユユIナ;VF&s @」#」` +0コ亞 ネd8\ケF┃G#ママ リk8潼エアャ~+Cヌ楮@リ邪ッ_鉗S U挂g「モーe L+」(9Jメ》vv#トャ瓠ョ/磆.rォ,~葺5エ%"ユ ュ並v覧;Vテミケチ@t」`ミ鍵眤゚wGck 繿1ヌ-4脆4ーh誓テネネ)旬H;瘟f1j拙IY)ZZ[カlヲibi@セ 「y聳スGセGy=ハiッメ:kモ _& b ョZO゚ウトャcタチlk8JXロ@x\UラV゚ユユIノン(」ミケチ@4op撃Q0 F%ヤンヘヌ5諱ニエk8キ ヘヌnhl.nX4レ」` j@|僣 W7ツAヌ.ロサ `Sネ6;zロtnpミhツ撃Q0ィ#、ン組ミヨ`#O`5ラLョセ <ク.ソ」yOxタV'>y811!''洛;DFミケチ@」 参0 Fチ、68ン!9ラp Bラ]*サwrvv1c ホ mp撃Q0 5拶ネk8!マ]*タヲF__ソ粧 ノホ mp撃Q0 5拶Hツ5ヰトz 2ク{NZZZqq ユgX>}権9sSv0ノ3ヲ ツX:78hエチ1 Fチ(ヤコk8!{ョl<#ネ`ヒ模^^゙タ:*醯ソ ホ罟シセ`サgー繊晉t*ゥ、s F」`撃A FラpP ナ\k80チァO滯∀2*`4`kcヌノ]!;N !オ蕭@68Fチ(_&+`;烋qRル@7S^5~ijjzレチ烱籐D姿タx`[。ェェ埔?.ョョ.ッpソノ゙癶ォァIレムケチ@」 参0 Fチト莱タ「ヨネネdタ圖叩7モヨモトトナ[ソO&e・尋玉レオkシシシ醯檬F(u勉W ソOT.^シз?メケチ@」 参0 Fチト莱タ~md\フ-KシッI<鏤嬖hリw1czy}ナ捶;'±wN46賍ロ;||H嫗ヲ・ワ) ァク゚IbO]6鑞篆I@68Fチ(慎&゙ス{ヌ'タト攀゙ラ$コ鏤゚エ翩省ク(xヒl灘Uョス~ZxxDccオQQォvopソ泥4>>`。s F」`撃A H-; マ^1gヌノ=Ζ゚暇コ リ{コ鏤~菲罌ー衰ヨハ保V0チd涅s<USSM_/[カヤルルHT醯?ネhル`籐タリカ嶋:78hエチ1 Fチ(ヤ2ラ99ケタAnヒ+ハ3ケ'Nャ:0p#`攫ヌy}ゥアア)<<糶kU試pPミhツ撃Q0ィ斃トQ0タ 轗|シロロ;フー ケ@ F」`撃A F」F`y^^゙kラョチ*;:ツAu@」 参0 Fチ」 参@;ェェ珥@フ・サ4Zテ。√杪ャlエ9&れ@68Fチ(68Fュチ 鄂シシ組Xh4ツ。》sARLXz!kl悔83@68Fチ(68F}タモ∀-[6Cク4ZテoC」^綽_ポ F」`撃A F」n瑾ラナナ%iiiw゙!8ツゥ!h糅莖 クz*継`Aフk8hエチ1 Fチ(ヤ`エチ1 <鞳肬韋 コ x;ュ=カnM チq Lqフ1!エ F」`撃A F」猊ョョ.禁/&r5rロs4Y部術 54レ」` j0レョ瓠゙oワyンr+mハー_テ@」 参0 Fチ」 参0 ネ5T!k8hエチ1 Fチ(ヤ`エチ1 <ラク5ヌB夙<テc随pミhツ撃Q0ィチhツ  oyョmdS恫]*ネ煦ネ _テ@」 参0 Fチ」 参0 `.ェmp撃Q0 5mp撃」wゥPミhツ撃Q0ィチhツ ム]*4emp撃Q0 5mp撃」#T4レ」` j0レFラpPミhツ撃Q0ィチhツ ネネH峙vチ`キ 棡スbNNN.~、sムヌ(」`Pτヌ(ミモモ_゚モ4ニ-gキカuuuG:g.mp撃Q0 5mp撃ラッ_ 9q鈕充I桀r) 鑞H醂@」 参0 Fチ」 参0Pッッソシセjタヌ-dTホ1$メ9sミhツ撃Q0ィチhツ 8qBPXHロ莪Uサ7,゙イtp眺スm>セ、カ6モ=sミhツ撃Q0ィチhツ ,クp痞kkGTTDd\フ$サコ:℃$テktホ\4レ」` j0レ」Fホ F」`撃A F」`ミミ9sミhツ撃Q0ィチhツ:g.mp撃Q0 5mp撃Q@#@醂@」 参0 Fチ」 参0 h陷ケhエチ1 Fチ(ヤ`エチ1 F3@68Fチ(囹j撃Q0 h刹框 F」`撃Q0 Fチ(9ムヌ(」`撃Q0 hhエチ1 Fチ(」`mp撃Q0 Fチ(」 F」`撃Q0 Fチ(9ムヌ(」`撃Q0 hhエチ1 Fチ(」`mp撃Q0 Fチ(」 F\zレK、2zコ ヘア 専 ャヌンミネm」`撃Q0 pmpフェn1ムケヲDウn赤モd48(7d撃Q0 F Fォ「O4レ P・チA9」`撃Q0 (4レ漾&5p1e!lLA<ハ4廩賭~ソuXホV仁イヲラロK榜(」`mp5f W柔ョz幸庫X 'hAacH Dコ廩_)5 Fチ(」コ F?Rトラ、ェ!ロ 9ソi U凌」 参0 Fチ( g# P ノL]トラpネG曝0Xモメ>>゙トレ(」`  ェ\5針8Lャ Y刀゚mト(テッS 創 マID &駻2ナィ娟F エQ0 Fy F$炉Rユ5「Xオo ル 2,%Rj」6 Fチ( ミhャー.ヨ#。チAキb%メ1」H0n」`@68hトS鰾b錯c&I禺扁ミ.稚盂脚ミ、Hオ琳y鵬ン(」<@」 ,z ョ タ*ヲ ネ?ヲ!Tip灑ル <-'ャm,!Oカ X蓬{5ー<チh闕20 ネ4レ」`F3ラ(」<@」 参0 F `4s高Q0 ネ4レ」`F3ラ(」<@」 参0 F `heョ〇サC、]ク「h斉#ルホ]5@68Fチ($!隼0扣7ヌc戮鎚・穰9ccvPhエチ1 Fチ(  蔑gユレN伶イn斉#ホリmp撃Q0 HC%s4ゥ36イ,|o6 eDN、ノク ヌ?ケ゚:ャァ*ネ6Y モkナ、Q0ネ@68Fチ($!隼:ウ院遂ォヌッ Wス業%ニdャエ侠uトー1 $テ"]N、/Fチミ4レ」`V貭゚マニ%Bシオ;ゥjネvyN"ニDH斧ナeミJ~」 ミhツ ゙スウeヒ詈モヲO8aー'N@ミO>柏ユゥktc撃 陷ケhエチ1 4ZテA|゚s,│゙aウq dDヌ(#ミ9sミhツ姿タ{ユh*3 ネ"ネ禮UR2ツA5倉QG8hJ」#」`3@68FQ燠舫ネ ク8^ラ"ラサネ訥オ蕎5裹U'Nァニソケュ゚ネ 瘟f1j拙」#」`傾@醂@」 参@|ゥォォ栃46イ.蕣菱姿T;;サトヌ'ミ YZZマYサ`C羽5」#」`撃tマ\4レタ-嫋]]fフ朗ーッ賢ヨトモwヌヌ」ヘ2モャnk8pマ8ミ91!゚`#屁嶷ョ]6モA!ー疎oo;cニt&\テ1ルパ ヌ dラ-[6O4m0臀ャ$ミm@R=ャFチ( ミ9;ミhumMCスO/ーOシhb`X 6イgJofav@@珎サwィJOム(ワFチ( 陷hエチロHマホ旒3烋Mbリ娑l カネ ,`M裹紅 鍵 鍵癶 ゙FHレ^シeナ`[M;ャゥ;l9 Fホル F/^TXU0咼牒vッ '。K `Scレ4s(hタヤヤト攀w辿ッ睚ノノ攷bホ`;苜オ 22メ姻總npAiiノ賠モvC"{つBネh ヌ`H$繊7%=:ツ1  ミ9;ミnpイ#yExタ6 青9撚0 ーっワ8ymp撃tホホ4「テo d%11〇ロ2sツt ヌ($:ggム ['{ェZ4H9mR]刔ル ネ>ホ。撃Qャ#D覊エQ?コc svン燿ン Rホ薀.譜ヤ<ツ醯?`9メララ?zL(5 ェ修hタ."C=1zGG8Fチ@:ggム GGgホ>ツAj*ッィメ炬uqqI|ハ(フ ュ i3, F」`攀3@68ャ痼5h」」躅L銭クzク8レ\ 1'4サ0ルネハ陜謄杼078ョ痼,フ9Dヒ宿モ. メUmp撃tホホ4レ ーケlw;ネ=ャイUR>ツ,。,,フF躅Fチ瀰pォタフ嬋 LY*Iマタ:ツ1コc svム5hc歪ネI"xJ(轗δB,-ュサコ:G」ホ`78\m J8咯トャチBc庶p撃tホホ4レ ー~2ヨd ヌ9sスシシキo゚Iモタ」 チ5$藹ャ*G8F」`@攀3@崎1輛?nAー氛ォΛラX Yテtラッゥvx(チ`npケ碗 ZW゙トTCpフcエチ1  ミ9;ミnp'n #ヌ-ミト蛾!。敕9ZエォォshムQ@k04 &畷ムF8Fラp撃tホホ4「ト愿「ワyョュ)<況ヌO_ 、Qネ)試ホ{妻(`78\-エL竃ヌムニE伊ァXヒ\ム参0Pホル FtーサK襄ラi`UCt(フ 紗サTFチ( ミ9;ミnp ソサT 珥チタ^゙'N拌Tケチ1z量($:ggム Cv#ウ0 O?xeレエ∞」F"タ-寞規\==4%衆ィゥゥ]BK;1!:ツ1コc svン燿ン]*エf痼?ントト惧ワラッ_S、ターミエ) ァ8ケg0&{箕スウ&xyyマ?州/ャ`78C:$=:ツ1  ミ9;ミnpイ#クヨp`サwVタ3fL'78。リレ仗bワ適IY)トム(  ヌ参0 Htホホ4「繚。。ケ'WI_HvJzIWィ|ゥッッ゚ユユr Xygfソノ>q ミソ40ラッ_エG*鑁ヒi」``tホホ4「ク獰蜷D轍Bンサ(>>。ェェ嚮j8''w9γト悼ゥ化w"ユァ」?フ  ミムム;萪ァ=礫k]ヲ]闕2ミ9;ミhツ頷ンWn[AvKニ ウジ ク゚IbWエVN8Xチ`npッヲ。セ}Jロァ=籐m峠壙ロh」`tホホ4レ′原ヨ゙6x)0佶 {7xSxフニァO湃ロ;/^シJ、 メopイョュ~エチAu0チウュ_<R A靜尉」`攀3@68@/セォォモユモ」シセXK{ニンLLM 、ハ朧`_k@モ寤ケrV;0 アI逃QV」 ヌw黄)>セ!マ!.コsツ躄0ホル Fャネ醂 O6}p超X族lルRgg 雲ルP皖i癶: クp磬`ネウxH簓Gチ(svムヌ(ヘー466禳穐Aト=刄=コ`ィ48Fチ(3@68F[XヌxヌZムヌ(テミ9sミhツ轌yyc僞」5ィsテ歟>コc@タhツ撃a陷ケhエチ1 ミチラッォェェ聽ン{、ムシン@zzGラpミ68Fチ(6ホ F」;8q篋ォォK__?dFk8摂1ト稽峨]テA 0レ」`リ:g.mp|`ニ碁^^゙サw"8ツゥ!h篳3 v\=~鰭コHA]テA 0レ」`リ:g.mp瑾ラ99ケラL キ-1 8凵フ&8nA:柘5エ」 参0 sムヌ( 9ツニFヨワ !R%#」k8hF」` @醂@」 参@ クyソ q \ュd@ム5エ」 参0 sムヌ( ミsс5u紺癶mp撃Q0l3@68FQ5Xロxヨp !ret =チhツ撃a陷ケhエチ1 芻p珀・&Np 壜ム5F」` @醂@」 参@ uト``尚癶mp撃Q0l3@68FQヤ"メ]テA 0レ」`リ:g.mp「ゥg` Zムヌ(テミ9sミhツヌZムヌ(テミ9sミhツFラpmp撃Q0l3@68FQ p翆ュヂワYイシセjyrテ 68Fチ(6ホ F」(澄;uルフチ0nA<;2.狠rテ 68Fチ(6ホ F」(p翦タsO. ク台ェンkツテ#:リ!mp撃Q0l3@68Fア`y1ΝGマ.ェン|゙ス3ミa6 チhツ撃a陷ケhエチ1 H詞叫hュャiュkォ「Aナ.ッッ mmミミ?s劒嗚撃Q0 h刹框 F」4'三4m籠 4ィリ醯:oi8τフ5 Fチ( ミhツ撃Q@ヘ\」`@68Fチ($ムフ5 Fチ( ミhツ撃Q@ヘ\」`@68Fチ($ムフ5 Fチ( ミhツ撃Q@ヘ\」`@68Fチ($ムフ5 Fチ( ミlp系ワ」FホGチ(テミlp撃Q0 Fチ(」`Pmp撃Q0 Fチ(」 F」`撃Q0 Fチ(9ムヌ(」`撃Q0 hhエチ1 Fチ(」`mp撃Q0 Fチ(」 F」`撃Q0 Fチ(90iF莉ルVIENDョB`hyperestraier-1.4.13/doc/nguide-en.html000066400000000000000000002663211125261632700200130ustar00rootroot00000000000000 P2P Guide of Hyper Estraier Version 1

P2P Guide

Copyright (C) 2004-2007 Mikio Hirabayashi
Last Update: Tue, 06 Mar 2007 12:05:18 +0900

Table of Contents

  1. Introduction
  2. Architecture
  3. Tutorial
  4. Node Master Usage
  5. Protocol
  6. Node API
  7. Command of a Client
  8. Pseudo Node Master
  9. Meta Search Gateway

Introduction

This guide describes Hyper Estraier's client/server (C/S) and peer to peer (P2P) architecture. If you haven't read user's guide yet, now is a good moment to do so.

There was several problems which where motivation for C/S architecture. estseek.cgi is inefficient because it reconnects to database for each search query. Database updates using estcmd prevents searches on same database because estcmd uses locks when doing update. To solve those problems, estmaster server process is provided. This is resident (daemon) process which has control over database and provides services via network.

This approach also leads to following advantages:

  • server and clients can be distributed across different machines
  • multiple clients and servers can work in parallel
  • client crash doesn't leave database in inconsistent state
  • clients implementation isn't specific to any programming language

Protocol between clients and servers is based on HTTP, so normal web browsers can be used as simple clients. Clients can be implemented using any languages which supports HTTP protocol like JavaScript or Flash.

Distributed processing is based on peer to peer (P2P) architecture. This allows horizontal scalability. For example, if you use 10 servers, each with million documents, you can search 10 million documents without much additional effort. Since all servers are equal, search service is provided even if some of servers are unavailable. There is notion of relevance of each index which can improve search results (if some parts of index are more important that others).

This guide describes the node API which can be used by client applications to implement search and update capabilities without using network protocol between client and server. The node API is implemented by not only C language but also Java and Ruby.


Architecture

This section describes the P2P architecture of Hyper Estraier.

Node Master and Node Server

When using multiple indexes, it is highly inefficient to run one server for each index. estmaster is server process (daemon) implemented as single process available on network through HTTP protocol on some hight port that provides services for multiple indexes. This component is called node master. Each index has it's own unique URL which is served by node server. You can think about node server as a virtual servers for each index within one node master.

[framework]

Client application just need to know URL of node server and issue queries to it on any available node masters. Term node corresponds to peer in P2P architecture. Clients can also connect to node masters directly to manage configuration of that master.

Meta Search and Credit

Each node server can have unidirectional links to other node servers. This allows distributed searching called meta search. When client sends query to node server, it will forward that query to all other node servers and merge responses before sending result back to client.

Meta search is performed hierarchically. Loops in links are detected and restrained automatically, so searching is always performed on tree structured network of nodes. This allows infinite scalability just by adding additional nodes.

[tree of meta search]

There is a notion of relevance for each link between nodes called credit. It's used for weighting of scores when merging results from different nodes. Document coming from node with larger credit will have higher rank in search results. Application can set links and credits for them, and this allows improving of search precision by modifying credits of frequently used nodes.

Authentication

Client connections to node master or node server are authenticated using login names and passwords. Users and permissions are defined on node masters and all node servers on that master inherit those permissions. Users are divided into two groups: super users and normal users. Normal users have permission to search index while super users also have permission to create and update indexes. Moreover, for each node, normal users are divided into administrators and guest users.

Example Application

mod_estraier is the most interesting application of the node API of Hyper Estraier. It works as a module of a Web server (Apache) and register contents mediated by its proxy mechanism. Using it as a forward proxy, you can enjoy a search engine whose targets are documents which you (or your comrades) have seen. Using it as a reverse proxy, you can add search feature to any web application as well as BBS and Wiki. That is, the greatest characteristic of the node API is helping you to develop advanced search systems combining various applications.


Tutorial

Concept of P2P seems difficult at first, so it's best to start with a tutorial which will show commands used to setup search network.

Start and Stop

First step is creation of the server root directory which contains configuration files and indexes. Following command will create casket, the server root directory:

estmaster init casket

Next, we need to start node master using:

estmaster start casket

To stop node master you can press Ctrl-C on terminal in which it's running on issue following command:

estmaster stop casket

Administration Interface

After starting node master you can access it's administration interface pointing web browser at http://localhost:1978/master_ui. This will bring HTTP authorization dialog requesting user name and password. Enter "admin" and "admin". You will be presented with administration commands menu.

First option is Manage Master which provides options to shutdown node master and to synchronize databases. However, they are not used for now.

Since you are logged as admin which has super user privileges, we can edit users. We will create new account with super user privileges and switch to it. We will also erase admin user because it has well-known password and it's possible security hole.

Select Manage Users. There are input boxes for user name, password, flags, full name and miscellaneous information at bottom. Enter following data for new user: "clint", "tnilc", "s", "Clint Eastwood" and "Dirty Harry". Flag "s" denotes user with super user privileges. User name is limited to alphanumeric characters only.

You can now delete admin user using DELE link and confirm that by clicking on sure button.

Select Manage Nodes next. Since we just erased admin user, you will be again asked for user name and password. Enter "clint" and "tnilc" to login again. Input boxes at bottom allows you to enter new index name and label. Index name is limited to alphanumeric characters. Enter "test1" as name and "First Node" as description. Create another node with name "test2" and "Second Node" as description.

Register Documents

We'll now register new documents in index. For that, we will again use command-line utilities. Since terminal in which you started estmaster is busy outputting log messages, open another one.

Documents which are about to be registered in index must be in document draft format described in User's Guide. Create file data001.est with following content:

@uri=data001
@title=Material Girl

Living in a material world
And I am a material girl
You know that we are living in a material world
And I am a material girl

We are going to register this document to node test1. Since updating of index needs super user permissions, we will use -auth option to specify user name and password of user that we created in previous step.

estcall put -auth clint tnilc http://localhost:1978/node/test1 data001.est

Document registration will finish shortly, and absence of any error message denotes that it has been successful.

To demonstrate meta search mentioned before, we will register another document to node test2. Create file data002.est with following content:

@uri=data002
@title=Liberian Girl

Liberian girl
You came and you changed My world
A love so brand new

Then, register document using:

estcall put -auth clint tnilc http://localhost:1978/node/test2 data002.est

As you can see, it's possible to register documents from any machine connected to network on which estmaster is running. You can register few additional documents if you want now.

Search for Documents

Next step is to find some of documents we just registered. You can try search by executing:

estcall search http://localhost:1978/node/test1 "material world"

This will produce search result with draft of the document including phrase material world.

We can also create a link between two nodes and try meta search. We need super user, URL of source and destination node, link name and credit.

estcall setlink -auth clint tnilc http://localhost:1978/node/test1 \
  http://localhost:1978/node/test2 TEST02 8000

This command creates link from node test1 to node test2 called TEST02 and assign it credit of 8000.

You can now repeat search and add option -dpt which will activate meta search over both nodes.

estcall search -dpt 1 http://localhost:1978/node/test1 "girl"

Although your search is accessing node test1, we can see merged results from test2. Since nodes can be located on separate machines, meta search enables us to do distributed processing using P2P architecture described before.

We can also influence ranking of results by increasing credit for particular node. If we change it to 12000 and re-run search we will see different ranking of results.

estcall setlink -auth clint tnilc http://localhost:1978/node/test1 \
  http://localhost:1978/node/test2 TEST02 12000

Results can also be returned in XML format which is defined in estresult.dtd.

estcall search -dpt 1 -vx http://localhost:1978/node/test1 "girl"

Each node server also has a web search interface. You can go to http://localhost:1978/node/test1/search_ui and access search interface of node test1.


Node Master Usage

estmaster is provided as a command to manage the node master. This section describes how to use estmaster.

Synopsis and Description

estmaster is an aggregation of sub commands. The name of a sub command is specified by the first argument. Other arguments are parsed according to each sub command. The argument rootdir specifies the server root directory which contains configuration file and so on.

estmaster init [-ex] rootdir
Create the server root directory.
If -ex is specified, some users and some nodes are set for example. By default, only a super user whose name and password are both "admin" is set.
estmaster start [-bg] [-st] rootdir
Start the node master.
If -bg is specified, the server runs in background as a daemon process.
If -ro is specified, the server runs in read-only mode regardless of the configuration.
If -st is specified, the server runs in single thread mode.
estmaster stop rootdir
Stop the running node master.
estmaster unittest rootdir
Perform unit tests.
estmaster crypt key [hash]
Output an encrypted string of a string.
key specifies a target string.
If hash is specified, it checks whether the key and the hash matches.

All sub commands return 0 if the operation is success, else return 1. A running node master finishes with closing the database when it catches the signal 1 (SIGHUP), 2 (SIGINT), 3 (SIGQUIT), or 15 (SIGTERM). Moreover, when a node master running as a daemon catches the signal 1 (SIGHUP), the process is re-start and re-read the configuration files.

A running node server should be finished by valid means by command line or via network. Otherwise, the index may be broken.

Constitution of the Server Root Directory

The server root directory contains the following files and directories.

  • _conf : prime configuration file.
  • _user : user account file.
  • _log : log file.
  • _meta : database file for meta data.
  • _pid : file recording the process ID.
  • _stop : file to stop the node master.
  • _dfdb : document frequency database.
  • _node/ : node directory.
  • _sess/ : session directory.

The prime configuration file can be edit with a text editor. However, the user account file should not be edit during the node master is running.

If you have an index created by estcmd, move it into the node directory and reboot the server. So, the index will work as a node.

Prime Configuration File

The prime configuration file is composed of lines and the name of an variable and the value separated by ":" are in each line. By default, the following configuration is there.

bindaddr: 0.0.0.0
portnum: 1978
publicurl:
runmode: 1
authmode: 2
recvmax: 1024
maxconn: 30
idleflush: 20
idlesync: 300
sessiontimeout: 600
searchtimeout: 15
searchmax: 1000
searchdepth: 5
rateuri: 1
mergemethod: 2
proxyhost:
proxyport:
logfile: _log
loglevel: 2
backupcmd:
scalepred: 2
scoreexpr: 2
attrindex: @mdate{{!}}seq
attrindex: @title{{!}}str
docroot:
indexfile:
trustednode:
denyuntrusted: 0
cachesize: 64
cacheanum: 8192
cachetnum: 1024
cachernum: 256
specialcache:
helpershift: 0.9
wildmax: 256
limittextsize: 128
snipwwidth: 480
sniphwidth: 96
snipawidth: 96
scancheck: 1
smlrvnum: 32
extdelay: 4096
adminemail: magnus@hyperestraier.gov
uireplace: ^file:///home/mikio/public_html/{{!}}http://localhost/
uireplace: /index\.html?${{!}}/
uiextattr: @author|Author
uiextattr: @mdate|Modification Date
uiphraseform: 2
uismlrtune: 16 1024 4096

Meaning of each variable is the following.

  • bindaddr : specifies the binding address of the server. 0.0.0.0 means every address of the host.
  • portnum : specifies the port number of the server.
  • publicurl : specifies the public URL (absolute URL). By default, it is generated with "http://", the hostname, ":", and the port number.
  • runmode : specifies running mode (1:normal, 2:readonly).
  • authmode : specifies authorization mode (1:none, 2:admin, 3:all).
  • recvmax : maximum length of data to receive (in kilobytes).
  • maxconn : specifies the maximum number of connections at the same time.
  • idleflush : specifies idle time to start flushing (in seconds).
  • idlesync : specifies idle time to start synchronizing (in seconds).
  • sessiontimeout : specifies timeout of a session (in seconds).
  • searchtimeout : specifies timeout of search (in seconds).
  • searchmax : specifies the maximum number of documents to send.
  • searchdepth : specifies the maximum depth of meta search.
  • rateuri : specifies whether to rate URI for scoring (0:no, 1:yes).
  • mergemethod : specifies merge method of meta search (1:score, 2:score and rank, 3:rank).
  • proxyhost : specifies the host name of the proxy server.
  • proxyport : specifies the port number of the proxy server.
  • logfile : specifies the path of the log file (relative path or absolute path).
  • loglevel : specifies logging level (1:debug, 2:information, 3:warning, 4:error, 5:none).
  • backupcmd : specifies the command for backup (absolute path of a command).
  • scalepred : specifies scale prediction of each node (1:small, 2:medium, 3:large, 4:huge).
  • scoreexpr : specifies score expression (1:void, 2:char, 3:int, 4:asis).
  • attrindex : specifies the attribute indexes (attribute name and data type). This can be more than once.
  • docroot : specifies document root directory (absolute path of a directory to be public).
  • indexfile : specifies index file (name of directory index files).
  • trustednode : specifies decimal IP addresses of trusted nodes. This can be more than once.
  • denyuntrusted : specifies whether to deny all nodes except for trusted nodes (0:no, 1:yes).
  • cachesize : specifies the maximum size of the index cache (in megabytes).
  • cacheanum : specifies the maximum number of cached records for document attributes.
  • cachetnum : specifies the maximum number of cached records for document texts.
  • cachernum : specifies the maximum number of cached records for occurrence results.
  • specialcache : specifies the name of the attribute of the special cache.
  • helpershift : specifies the lower limit of cache usage size to use the helper.
  • wildmax : specifies the maximum number of expansion of wild cards.
  • limittextsize : specifies the text size limitation of registered documents by kilobytes.
  • snipwwidth : specifies whole width of the snippet of each shown document.
  • sniphwidth : specifies width of strings picked up from the beginning of the text.
  • snipawidth : specifies width of strings picked up around each highlighted word.
  • scancheck : specifies whether to check documents by scanning (0:no, 1:yes).
  • smlrvnum : specifies the number of keywords for similarity search (0 means disabled).
  • extdelay : specifies the number of documents for delay of keyword extraction.
  • adminemail : specifies an e-mail address of the administrator.
  • uireplace : specifies regular expressions and replacement string to convert the URI of each document. Regular expressions and replacement strings are separated by "{{!}}". This can be more than once.
  • uiextattr : specifies an attribute to be shown. The name and the label are separated by "|". This can be more than once.
  • uiphraseform : specifies mode of phrase form (1:usual, 2:simplified, 3:rough, 4:union: 5:intersection)
  • uismlrtune : specifies tuning parameters for similarity search. The number of keywords, the number of documents per keyword, and the number of all candidates are separated by space characters.

User Account File

The user account file is composed of lines and each includes the name, the encrypted password, the flags, the full name, and the miscellaneous information separated by tabs. The character encoding is UTF-8. By default, the following account is there.

admin   21232f297a57a5a743894a0e4a801fc3        s       Carolus Magnus  Administrator

The password is expressed as MD5 hash value. In the flags, "s" is for super users, and "b" is for banned users. Flags, full name, and miscellaneous information can be omitted.

Embedded User Interfaces

By accessing the absolute URL "/master_ui" of the node master with a web browser, you can use the administration interface. It requires authentication as a super user.

By accessing the URL which is the URL of a node server followed by "/search_ui", you can use the search interface. There are some anchors with such labels as "LINK#1" in the result page. They express nodes linked from the current node. If you select one of them, you move to the node and then search with the current conditions are performed.

If you select the link "Atom" or "RSS" in the result page, you get the search result in Atom or RSS format. By registering the URL to an application supporting Atom 1.0 or RSS 1.0, you can monitor the search result periodically. In order to work together with such site as Google, Wikipedia and so on, Hyper Estraier supports OpenSearch 1.1. To get the description for OpenSearch, access the URL of the node server trailing "/opensearch".


Protocol

Communication between nodes and communication between clients and nodes are carried out by a protocol based on HTTP. This section describes the protocol.

Introduction

The node master and node servers implement HTTP/1.0. As for now, such particular features of HTTP/1.1 as keep-alive connection, chunked encoding, and content negotiation are not supported.

While both of GET and POST are allowed for the request method of HTTP, GET is preferred if the command retrieves information, POST is preferred if the command update the node master or a node server. As the character encoding of parameters is UTF-8, meta characters and multi-byte characters should be escaped by URL encoding (application/x-www-form-urlencoded). The maximum length of data sent with the GET method is 8000. Authentication information is passed in the basic authentication mechanism of HTTP.

If an operation is done successfully, the status code 200 or 202 is returned. On error, one of the following status code is returned.

  • 400 : parameters are invalid.
  • 401 : authentication information lacks or is invalid.
  • 403 : the account has not the permission.
  • 404 : the node does not exist.
  • 500 : some errors of due to the server occurred.

The result of operation of search or retrieve is sent as message body of response. As the format of the data is plain text whose encoding is UTF-8, it can be structured with tabs and line feeds. If a client supports deflate encoding, compressed data is sent.

Operation of Node Master

To operate the node master, connect to the path "/master" of the server. For example, if the host name is "skyhigh.estraier.go.jp" and the port number is 8888, connect to "http://skyhigh.estraier.go.jp:8888/master". Only super users are granted to operate the node master. There are some sub commands for operations of the node master. The name of a sub command is specified by the parameter "action". Other parameters vary according to each sub command.

/master ? action=shutdown
Shutdown the node master.
No parameter is used.
On success, the status code 202 is returned.
/master ? action=sync
Synchronize databases of all nodes and the disk.
No parameter is used.
On success, the status code 202 is returned.
/master ? action=backup
Synchronize databases and perform the backup command.
No parameter is used.
On success, the status code 202 is returned.
/master ? action=userlist
Get the list of user accounts.
No parameter is used.
On success, the status code 200 is returned. The entity body of response expresses the list of user accounts whose format is TSV. Each line is information of each user. There is fields of the user name, the encrypted password, the flags, the full name, and the miscellaneous information.
/master ? action=useradd & name=str & passwd=str & flags=str & fname=str & misc=str
Add a user account.
name specifies the name of a new user. It is essential. Only alphanumeric characters are in the name. If the specified name overlaps the name of an existing user, it is treated as an error.
passwd specifies the password. It is essential.
flags specifies the flags. It is optional. "s" is for super users, and "b" is for banned users.
fname specifies the full name. It is optional.
misc specifies the miscellaneous information. It is optional.
On success, the status code 200 is returned.
Because the password is sent, POST method should be used.
/master ? action=userdel & name=str
Delete a user account.
name specifies the name of a user. It is essential.
On success, the status code 200 is returned.
/master ? action=nodelist
Get the list of node servers.
No parameter is used.
On success, the status code 200 is returned. The entity body of response expresses the list of node servers whose format is TSV. Each line is information of each node. There is fields of the node name, the label, the number of documents, the number of unique words, and the size.
/master ? action=nodeadd & name=str & label=str
Add a node server.
name specifies the name of a new node. It is essential. Only alphanumeric characters are in the name. If the specified name overlaps the name of an existing node, it is treated as an error.
label specifies the label. It is optional. If it is omitted, the label is to be same as the name.
On success, the status code 200 is returned.
/master ? action=nodedel & name=str
Delete a node server.
name specifies the name of a node. It is essential.
On success, the status code 200 is returned.
/master ? action=nodeclr & name=str
Clear registered documents in a node server.
name specifies the name of a node. It is essential.
On success, the status code 200 is returned. Information of users and links is still kept.
/master ? action=logrtt
Rotate the log file.
No parameter is used.
On success, the status code 200 is returned. The existing log file is cleared and its content is escaped into a new file whose name is trailed by the date information in the format of "-YYYYMMDDhhmmss".

Operation of Node Server

To operate a node server, connect to a path which begins "/node/" and is followed by the name of the node. For example, if the host name is "skyhigh.estraier.go.jp" and the port number is 8888 and the name of the node is "foo", connect to "http://skyhigh.estraier.go.jp:8888/node/foo". There are some sub commands for operations of node servers. The name of a sub command is specified after the node name. Parameters vary according to each sub command.

/node/name/inform
Get information of a node.
No parameter is used.
On success, the status code 200 is returned. The entity body of response expresses node information whose format is TSV. The first line includes fields of the node name, the label, the number of documents, the number of unique words, and the size. The next line is empty. The succeeding lines to the next empty line are names of administrators. And, the succeeding lines to the next empty line are names of guests. And, the succeeding lines to the end are link information. There are fields of the URL, the label, and the credit.
/node/name/cacheusage
Get the cache usage of a node.
No parameter is used.
On success, the status code 200 is returned. The entity body of response expresses the cache usage in decimal format.
/node/name/search ? phrase=str & attr=str & order=str & max=num & options=num & auxiliary=num & distinct=str & depth=num & wwidth=num & hwidth=num & awidth=num & skip=num & mask=num
Search for documents.
phrase specifies the search phrase. It is optional. The format is as with the one of the core API.
attr specifies an attribute search condition. It is optional. From attr1 to attr9 works as with it. The format is as with the one of the core API.
order specifies the order expression. It is optional. The format is as with the one of the core API.
max specifies the maximum number of shown documents. It is optional. By default, it is 10.
options specifies options of the search condition. It is optional. The value is as with the one of the core API.
auxiliary specifies permission to adopt result of the auxiliary index. It is optional. By default, it is 32.
distinct specifies the attribute distinction filter. It is optional.
depth specifies depth of meta search. It is optional. By default, it is 0.
wwidth specifies whole width of the snippet of each shown document. It is optional. By default, it is due to the server configuration. If it is 0, no snippet is sent. If it is negative, whole body text is sent instead of snippet.
hwidth specifies width of strings picked up from the beginning of the text. It is optional. By default, it is due to the server configuration.
awidth specifies width of strings picked up around each highlighted word. It is optional. By default, it is due to the server configuration.
skip specifies the number of documents to be skipped. It is optional. By default, it is 0.
mask specifies the mask of search targets. It is optional. 1 means the node itself, 2 means the first link, 4 means the second link, 8 means the third link, and power values of 2 and their summation compose the mask. Otherwise, it can be specifies by expressions as from mask0=on to mask9=on.
On success, the status code 200 is returned. The entity body of response expresses the search result. The format is explained later.
/node/name/list ? max=num & prev=str
Retrieve a list of documents.
max specifies the maximum number of shown documents. It is optional. By default, it is 10.
prev specifies the URI of the previous element of iteration. It is optional.
On success, the status code 200 is returned. The entity body of response expresses the retrieval result. The format is explained later.
/node/name/get_doc ? id=num & uri=str
Get information of a document.
id specifies the ID number of a document. It is optional.
uri specifies the URI of a document. It is optional.
On success, the status code 200 is returned. The entity body of response expresses the search result. The format is document draft.
/node/name/get_doc_attr ? id=num & uri=str & attr=str
Get the value of an attribute of a document.
id specifies the ID number of a document. It is optional.
uri specifies the URI of a document. It is optional.
attr specifies the name of an attribute. It is essential.
On success, the status code 200 is returned. The entity body of response expresses the value of the attribute.
/node/name/etch_doc ? id=num & uri=str
Extract keywords of a document.
id specifies the ID number of a document. It is optional.
uri specifies the URI of a document. It is optional.
On success, the status code 200 is returned. The entity body of response expresses keywords and their scores. The format is TSV.
/node/name/uri_to_id ? uri=str
Get the ID number of a document specified by URI.
uri specifies the URI of a document. It is essential.
On success, the status code 200 is returned. The entity body of response expresses the ID number of the document.
/node/name/put_doc ? draft=str
Register a document. It is available by administrators only.
draft specifies content of a document in document draft format. It is essential.
On success, the status code 200 is returned.
/node/name/out_doc ? id=num & uri=str
Remove a document. It is available by administrators only.
id specifies the ID number of a document. It is optional.
uri specifies the URI of a document. It is optional.
On success, the status code 200 is returned.
/node/name/edit_doc ? draft=str
Edit attributes of a document. It is available by administrators only.
draft specifies content of a document in document draft format. It is essential.
On success, the status code 200 is returned.
/node/name/sync
Synchronize updating contents of the database. It is available by administrators only.
No parameter is used.
On success, the status code 200 is returned.
/node/name/optimize
Optimize the database. It is available by administrators only.
No parameter is used.
On success, the status code 200 is returned.
/node/name/_set_user ? name=str & mode=num
Set permission of a user. It is available by administrators only.
name specifies the name of a user. It is essential.
mode specifies operation mode. It is essential. 1 means to set the user as an administrator, 2 means to set the user as a guest, and 0 means to revoke the user account.
On success, the status code 200 is returned.
/node/name/_set_link ? url=str & label=str & credit=num
Set a link to another node. It is available by administrators only.
url specifies the URL of a destination node. It is essential. If the specified URL overlaps the URL of an existing link, the label and the credit is overwritten.
label specifies the label of the link. It is essential.
credit specifies the credit of the link. It is optional. If it is omitted, the link is removed.
On success, the status code 200 is returned.

Note that while super users has permission to administrate all nodes, an administrator of a node may not be a super user. Moreover, setting of guests of each node have meaning only when the authorization mode is 3 (all).

Format of Search Result

The format of the entity body of response of search command is alike to multipart of MIME. The following is an example.

--------[2387AD2E34554FFF]--------
VERSION 1.0
NODE    http://localhost:1978/node/sample1
HIT     2
HINT#1  give    2
DOCNUM  2
WORDNUM 31
TIME    0.006541
TIME#i  0.000058
TIME#0  0.002907
TIME#1  0.001578
LINK#0  http://localhost:1978/node/sample1      Sample1 10000   2       31      2731304 2
LINK#1  http://localhost:1978/node/sample2      Sample2 4000    3       125     8524522 1
VIEW    SNIPPET

--------[2387AD2E34554FFF]--------
#nodelabel=Sample Node One
#nodescore=7823432
#nodeurl=http://localhost:1978/node/sample1
@id=1
@uri=http://localhost/foo.html
%VECTOR give    8502    dispose 7343    griefs  5932    king    2343    void    1232

You may my glories and my state dispose, But not my griefs; still am I king of those. (
Give    give
 it u

p, Yo!
Give    give
 it up, Yo!)

--------[2387AD2E34554FFF]--------
#nodelabel=Sample Node One
#nodescore=5623772
#nodeurl=http://localhost:1978/node/sample1
@id=2
@uri=http://localhost/bar.html
%VECTOR faster  9304    give    7723    griefs  6632    go      5343    you     3289

The faster I go, the behinder I get. (
Give    give
 it up, Yo!
Give    give
 it up, Yo!)

--------[2387AD2E34554FFF]--------:END

Each line feed is a single LF. The first line is definition of the border string. Each parts are delimited by the border string. The last border string is followed by ":END". The first part is the meta section. The other parts are document sections.

The format of the meta section is TSV. Meaning of each string is picked out by the first field. There are the following kinds.

  • VERSION : specifies the version of the protocol.
  • NODE : specifies the URL of the node.
  • HIT : specifies the total number of the corresponding documents.
  • HINT#n : specifies the number of documents corresponding each word. The second field specifies the word. The third field specifies the number.
  • DOCNUM : specifies the total number of documents in target nodes.
  • WORDNUM : specifies the total number of words in target nodes.
  • TIME : specifies total elapsed time in seconds.
  • TIME#n : specifies elapsed time for each node in seconds. "TIME#i" means elapsed time for the local inverted index only.
  • LINK#n : specifies information of each linked node. Fields express the URL, the label, the credit, the number of documents, the number of unique words, the size of the database, and the number of corresponding documents. "LINK#0" means the node it self.
  • VIEW : specifies the format of document parts. As for now, it is constantly "SNIPPET".

Each document part expresses attributes and a snippet of a document. Top lines to the first empty line expresses attributes. Their format is as with the one of document draft. If keywords are attached to the document, they are expressed with the "%VECTOR" control command. If score is specified explicitly, it is expressed with the "%SCORE" control command. The format of the snippet is TSV. There are tab separated values. Each line is a string to be shown. Though most lines have only one field, some lines have two fields. If the second field exists, the first field is to be shown with highlighted, and the second field means its normalized form.

The following pseudo-attributes are added to each result documents of the search command or the get_doc command includes.

  • #nodeurl : specifies the URL of the node into which the document was registered.
  • #nodescore : specifies the node local score of the document.
  • #nodelabel : specifies the label of the node into which the document was registered.

Format of List Retrieval

The format of the entity body of response of list command is in TSV format. The following is an example though some strings follows "..." actually.

181     http://localhost/data/ihaveadream.xml   31e51df5f33131943dda22bd0fd755a0 ...
1       http://localhost/prog/hyperestraier-1.0.2/doc/index.html        45368fa3c...
2       http://localhost/prog/hyperestraier-1.0.2/doc/index.ja.html     0e9edf4ae...
3       http://localhost/prog/hyperestraier-1.0.2/doc/intro-en.html     ec622d19a...
18      http://localhost/prog/hyperestraier-1.0.2/doc/intro-ja.html     96f743fa6...
5       http://localhost/prog/hyperestraier-1.0.2/doc/javanativeapi/allclasses-fr...
25      http://localhost/prog/hyperestraier-1.0.2/doc/javanativeapi/allclasses-no...
26      http://localhost/prog/hyperestraier-1.0.2/doc/javanativeapi/constant-valu...
20      http://localhost/prog/hyperestraier-1.0.2/doc/javanativeapi/estraier/Cmd....
1022    http://localhost/prog/hyperestraier-1.0.2/doc/javanativeapi/estraier/Docu...

Each line feed is a single LF. Each line expresses each document and has 14 fields of system attributes. They are "@id", "@uri", "@digest", "@cdate", "@mdate", "@adate", "@title", "@author", "@type", "@lang", "@genre", "@size", "@weight", and "@misc". Fields of undefined attributes are empty strings.

Special Format for Document Registration

Because URL encoding is not efficient as for large data sent for the put_doc command and edit_doc command, the raw mode is supported. If the value of "Content-Type" is "text/x-estraier-draft", the entity body is treated as a document draft itself. The following is an example.

POST /node/foo/put_doc HTTP/1.0
Content-Type: text/x-estraier-draft
Content-Length: 138

@uri=http://gogo.estraier.go.jp/sample.html
@title=Twinkle Twinkle Little Star

Twinkle, twinkle, little star,
How I wonder what you are.

Node API

As it is a bother to implement HTTP, the node API is useful. This section describes how to use the node API.

Introduction

Using the node API, you can implement clients communicating node severs without considering such low level processing as TCP/IP and HTTP. Though the node API has overhead comparing to the core API, it is important to be able to execute at remote host and to perform parallel processing without discrimination of readers and writers.

In each source of applications of the node API, include `estraier.h', `estnode.h', `cabin.h', and `stdlib.h'.

#include <estraier.h>
#include <estnode.h>
#include <cabin.h>
#include <stdlib.h>

To build an application, perform the following command. It is same as with the core API.

gcc `estconfig --cflags` -o foobar foobar.c `estconfig --ldflags` `estconfig --libs`

Because the node API uses features of the core API also, if you have never read the programming guide, please read it beforehand.

API for Initializing

For preparation to use the node API, initialize the network environment at the beginning of a program. Moreover, the environment should be freed at the end of the program.

The function `est_init_net_env' is used in order to initialize the networking environment.

int est_init_net_env(void);
The return value is true if success, else it is false. As it is allowable to call this function multiple times, it is needed to call the function `est_free_net_env' at the same frequency.

The function `est_free_net_env' is used in order to free the networking environment.

void est_free_net_env(void);
There is no parameter and no return value.

API for Nodes

The type of the structure `ESTNODE' is for abstraction of connection to a node. A node has its own URL. No entity of `ESTNODE' is accessed directly, but it is accessed by the pointer. The term of node connection object means the pointer and its referent. A node connection object is created by the function `est_node_new' and destroyed by `est_node_delete'. Every created node connection object should be destroyed.

The following is a typical use case of node connection object.

ESTNODE *node;

/* create a node connection object */
node = est_node_new("http://estraier.gov:1978/node/foo");

/* set the proxy, the timeout, and the authentication */
est_node_set_proxy(node, "proxy.qdbm.go.jp", 8080);
est_node_set_timeout(node, 5);
est_node_set_auth(node, "mikio", "oikim");

  /* register documents or search for documents here */

/* destroy the object */
est_node_delete(node);

The function `est_node_new' is used in order to create a node connection object.

ESTNODE *est_node_new(const char *url);
`url' specifies the URL of a node. The return value is a node connection object.

The function `est_node_delete' is used in order to destroy a node connection object.

void est_node_delete(ESTNODE *node);
`node' specifies a node connection object.

The function `est_node_set_proxy' is used in order to set the proxy information of a node connection object.

void est_node_set_proxy(ESTNODE *node, const char *host, int port);
`node' specifies a node connection object. `host' specifies the host name of a proxy server. `port' specifies the port number of the proxy server.

The function `est_node_set_timeout' is used in order to set timeout of a connection.

void est_node_set_timeout(ESTNODE *node, int sec);
`node' specifies a node connection object. `sec' specifies timeout of the connection in seconds.

The function `est_node_set_auth' is used in order to set the authentication information of a node connection object.

void est_node_set_auth(ESTNODE *node, const char *name, const char *passwd);
`node' specifies a node connection object. `name' specifies the name of authentication. `passwd' specifies the password of the authentication.

The function `est_node_status' is used in order to get the status code of the last request of a node.

int est_node_status(ESTNODE *node);
`node' specifies a node connection object. The return value is the status code of the last request of the node. -1 means failure of connection.

The function `est_node_sync' is used in order to synchronize updating contents of the database of a node.

int est_node_sync(ESTNODE *node);
`node' specifies a node connection object. The return value is true if success, else it is false.

The function `est_node_optimize' is used in order to optimize the database of a node.

int est_node_optimize(ESTNODE *node);
`node' specifies a node connection object. The return value is true if success, else it is false.

The function `est_node_put_doc' is used in order to add a document to a node.

int est_node_put_doc(ESTNODE *node, ESTDOC *doc);
`node' specifies a node connection object. `doc' specifies a document object. The document object should have the URI attribute. The return value is true if success, else it is false. If the URI attribute is same with an existing document in the node, the existing one is deleted.

The function `est_node_out_doc' is used in order to remove a document from a node.

int est_node_out_doc(ESTNODE *node, int id);
`node' specifies a node connection object. `id' specifies the ID number of a registered document. The return value is true if success, else it is false.

The function `est_node_out_doc_by_uri' is used in order to remove a document specified by URI from a node.

int est_node_out_doc_by_uri(ESTNODE *node, const char *uri);
`node' specifies a node connection object. `uri' specifies the URI of a registered document. The return value is true if success, else it is false.

The function `est_node_edit_doc' is used in order to edit attributes of a document in a node.

int est_node_edit_doc(ESTNODE *node, ESTDOC *doc);
`node' specifies a node connection object. `doc' specifies a document object. The return value is true if success, else it is false. The ID can not be changed. If the URI is changed and it overlaps the URI of another registered document, this function fails.

The function `est_node_get_doc' is used in order to retrieve a document in a node.

ESTDOC *est_node_get_doc(ESTNODE *node, int id);
`node' specifies a node connection object. `id' specifies the ID number of a registered document. The return value is a document object. It should be deleted with `est_doc_delete' if it is no longer in use. On error, `NULL' is returned.

The function `est_node_get_doc_by_uri' is used in order to retrieve a document specified by URI in a node.

ESTDOC *est_node_get_doc_by_uri(ESTNODE *node, const char *uri);
`node' specifies a node connection object. `uri' specifies the URI of a registered document. The return value is a document object. It should be deleted with `est_doc_delete' if it is no longer in use. On error, `NULL' is returned.

The function `est_node_get_doc_attr' is used in order to retrieve the value of an attribute of a document in a node.

char *est_node_get_doc_attr(ESTNODE *node, int id, const char *name);
`node' specifies a node connection object. `id' specifies the ID number of a registered document. `name' specifies the name of an attribute. The return value is the value of the attribute or `NULL' if it does not exist. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use.

The function `est_node_get_doc_attr_by_uri' is used in order to retrieve the value of an attribute of a document specified by URI in a node.

char *est_node_get_doc_attr_by_uri(ESTNODE *node, const char *uri, const char *name);
`node' specifies a node connection object. `uri' specifies the URI of a registered document. `name' specifies the name of an attribute. The return value is the value of the attribute or `NULL' if it does not exist. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use.

The function `est_node_etch_doc' is used in order to extract keywords of a document.

CBMAP *est_node_etch_doc(ESTNODE *node, int id);
`node' specifies a node connection object. `id' specifies the ID number of a registered document. The return value is a new map object of keywords and their scores in decimal string or `NULL' on error. Because the object of the return value is opened with the function `cbmapopen', it should be closed with the function `cbmapclose' if it is no longer in use.

The function `est_node_etch_doc_by_uri' is used in order to extract keywords of a document specified by URI in a node.

CBMAP *est_node_etch_doc_by_uri(ESTNODE *node, const char *uri);
`node' specifies a node connection object. `uri' specifies the URI of a registered document. The return value is a new map object of keywords and their scores in decimal string or `NULL' on error. Because the object of the return value is opened with the function `cbmapopen', it should be closed with the function `cbmapclose' if it is no longer in use.

The function `est_node_uri_to_id' is used in order to get the ID of a document specified by URI.

int est_node_uri_to_id(ESTNODE *node, const char *uri);
`node' specifies a node connection object. `uri' specifies the URI of a registered document. The return value is the ID of the document. On error, -1 is returned.

The function `est_node_name' is used in order to get the name of a node.

const char *est_node_name(ESTNODE *node);
`node' specifies a node connection object. The return value is the name of the node. On error, `NULL' is returned. The life duration of the returned string is synchronous with the one of the node object.

The function `est_node_label' is used in order to get the label of a node.

const char *est_node_label(ESTNODE *node);
`node' specifies a node connection object. The return value is the label of the node. On error, `NULL' is returned. The life duration of the returned string is synchronous with the one of the node object.

The function `est_node_doc_num' is used in order to get the number of documents in a node.

int est_node_doc_num(ESTNODE *node);
`node' specifies a node connection object. The return value is the number of documents in the node. On error, -1 is returned.

The function `est_node_word_num' is used in order to get the number of unique words in a node.

int est_node_word_num(ESTNODE *node);
`node' specifies a node connection object. The return value is the number of unique words in the node. On error, -1 is returned.

The function `est_node_size' is used in order to get the size of the database of a node.

double est_node_size(ESTNODE *node);
`node' specifies a node connection object. The return value is the size of the database of the node. On error, -1.0 is returned.

The function `est_node_cache_usage' is used in order to get the usage ratio of the cache of a node.

double est_node_cache_usage(ESTNODE *node);
`node' specifies a node connection object. The return value is the usage ratio of the cache of the node. On error, -1.0 is returned.

The function `est_node_admins' is used in order to get a list of names of administrators of a node.

const CBLIST *est_node_admins(ESTNODE *node);
`node' specifies a node connection object. The return value is a list object of names of administrators. On error, `NULL' is returned. The life duration of the returned object is synchronous with the one of the node object.

The function `est_node_users' is used in order to get a list of names of users of a node.

const CBLIST *est_node_users(ESTNODE *node);
`node' specifies a node connection object. The return value is a list object of names of users. On error, `NULL' is returned. The life duration of the returned object is synchronous with the one of the node object.

The function `est_node_links' is used in order to get a list of expressions of links of a node.

const CBLIST *est_node_links(ESTNODE *node);
`node' specifies a node connection object. The return value is a list object of expressions of links. Each element is a TSV string and has three fields of the URL, the label, and the score. On error, `NULL' is returned. The life duration of the returned object is synchronous with the one of the node object.

The function `est_node_search' is used in order to search a node for documents corresponding a condition.

ESTNODERES *est_node_search(ESTNODE *node, ESTCOND *cond, int depth);
`node' specifies a node connection object. `cond' specifies a condition object. `depth' specifies the depth of meta search. The return value is a node result object. It should be deleted with `est_noderes_delete' if it is no longer in use. On error, `NULL' is returned.

The function `est_node_set_snippet_width' is used in order to set width of snippet in the result from a node.

void est_node_set_snippet_width(ESTNODE *node, int wwidth, int hwidth, int awidth);
`node' specifies a node connection object. `wwidth' specifies whole width of a snippet. By default, it is 480. If it is 0, no snippet is sent. If it is negative, whole body text is sent instead of snippet. `hwidth' specifies width of strings picked up from the beginning of the text. By default, it is 96. If it is negative 0, the current setting is not changed. `awidth' specifies width of strings picked up around each highlighted word. By default, it is 96. If it is negative, the current setting is not changed.

The function `est_node_set_user' is used in order to manage a user account of a node.

int est_node_set_user(ESTNODE *node, const char *name, int mode);
`node' specifies a node connection object. `name' specifies the name of a user. `mode' specifies the operation mode. 0 means to delete the account. 1 means to set the account as an administrator. 2 means to set the account as a guest. The return value is true if success, else it is false.

The function `est_node_set_link' is used in order to manage a link of a node.

int est_node_set_link(ESTNODE *node, const char *url, const char *label, int credit);
`node' specifies a node connection object. `url' specifies the URL of the target node of a link. `label' specifies the label of the link. `credit' specifies the credit of the link. If it is negative, the link is removed. The return value is true if success, else it is false.

API for Search Results of Nodes

The type of the structure `ESTNODERES' is for abstraction of search result from a node. A result is composed of a list of corresponding documents and information of hints. No entity of `ESTNODERES' is accessed directly, but it is accessed by the pointer. The term of node result object means the pointer and its referent. A node result object is created by the function `est_node_search' and destroyed by `est_noderes_delete'. Every created node connection object should be destroyed.

The type of the structure `ESTRESDOC' is for abstraction of a document in search result. A result document is composed of some attributes and a snippet. No entity of `ESTRESDOC' is accessed directly, but it is accessed by the pointer. The term of result document object means the pointer and its referent. A result document object is gotten by the function `est_noderes_get_doc' but it should not be destroyed because the entity is managed inside the node result object.

The following is a typical use case of node connection object and result document object.

ESTNODERES *nres;
CBMAP *hints;
ESTRESDOC *rdoc;
int i;

/* create a node result object */
nres = est_node_search(node, cond, 1);

/* get hints */
hints = est_noderes_hints(nres);

   /* show the hints here */

/* scan documents in the result */
for(i = 0; i < est_noderes_doc_num(nres); i++){

  /* get a result document object */
  rdoc = est_noderes_get_doc(nres, i);

  /* show the result document object here */

}

/* destroy the node result object */
est_noderes_delete(nres);

The function `est_noderes_delete' is used in order to delete a node result object.

void est_noderes_delete(ESTNODERES *nres);
`nres' specifies a node result object.

The function `est_noderes_hints' is used in order to get a map object for hints of a node result object.

CBMAP *est_noderes_hints(ESTNODERES *nres);
`nres' specifies a node result object. The return value is a map object for hints. Keys of the map are "VERSION", "NODE", "HIT", "HINT#n", "DOCNUM", "WORDNUM", "TIME", "TIME#n", "LINK#n", and "VIEW". The life duration of the returned object is synchronous with the one of the node result object.

The function `est_noderes_eclipse' is used in order to eclipse similar documents of a node result object.

void est_noderes_eclipse(ESTNODERES *nres, int num, double limit);
`nres' specifies a node result object. `num' specifies the number of documents to be shown. If it is not more than 0, eclipse is undone. `limit' specifies the lower limit of similarity for documents to be eclipsed. Similarity is between 0.0 and 1.0.

The function `est_noderes_doc_num' is used in order to get the number of documents in a node result object.

int est_noderes_doc_num(ESTNODERES *nres);
`nres' specifies a node result object. The return value is the number of documents in a node result object.

The function `est_noderes_get_doc' is used in order to refer a result document object in a node result object.

ESTRESDOC *est_noderes_get_doc(ESTNODERES *nres, int index);
`nres' specifies a node result object. `index' specifies the index of a document. The return value is a result document object or `NULL' if `index' is equal to or more than the number of documents. The life duration of the returned object is synchronous with the one of the node result object.

The function `est_resdoc_uri' is used in order to get the URI of a result document object.

const char *est_resdoc_uri(ESTRESDOC *rdoc);
`rdoc' specifies a result document object. The return value is the URI of the result document object. The life duration of the returned string is synchronous with the one of the result document object.

The function `est_resdoc_attr_names' is used in order to get a list of attribute names of a result document object.

CBLIST *est_resdoc_attr_names(ESTRESDOC *rdoc);
`rdoc' specifies a result document object. The return value is a new list object of attribute names of the result document object. Because the object of the return value is opened with the function `cblistopen', it should be closed with the function `cblistclose' if it is no longer in use.

The function `est_resdoc_attr' is used in order to get the value of an attribute of a result document object.

const char *est_resdoc_attr(ESTRESDOC *rdoc, const char *name);
`rdoc' specifies a result document object. `name' specifies the name of an attribute. The return value is the value of the attribute or `NULL' if it does not exist. The life duration of the returned string is synchronous with the one of the result document object.

The function `est_resdoc_snippet' is used in order to get the snippet of a result document object.

const char *est_resdoc_snippet(ESTRESDOC *rdoc);
`rdoc' specifies a result document object. The return value is a string of the snippet of the result document object. There are tab separated values. Each line is a string to be shown. Though most lines have only one field, some lines have two fields. If the second field exists, the first field is to be shown with highlighted, and the second field means its normalized form. The life duration of the returned string is synchronous with the one of the result document object.

The function `est_resdoc_keywords' is used in order to get keywords of a result document object.

const char *est_resdoc_keywords(ESTRESDOC *rdoc);
`rdoc' specifies a result document object. The return value is a string of serialized keywords of the result document object. There are tab separated values. Keywords and their scores come alternately. The life duration of the returned string is synchronous with the one of the result document object.

The function `est_resdoc_shadows' is used in order to get an array of documents eclipsed by a result document object.

ESTRESDOC **est_resdoc_shadows(ESTRESDOC *rdoc, int *np);
`rdoc' specifies a result document object. `np' specifies the pointer to a variable to which the number of elements of the return value is assigned. The return value is an array of eclipsed result document objects. The life duration of the returned array and its elements is synchronous with the one of the result document object.

The function `est_resdoc_similarity' is used in order to get similarity of an eclipsed result document object.

double est_resdoc_similarity(ESTRESDOC *rdoc);
`rdoc' specifies a result document object. The return value is similarity of the result document object to the front document or -1.0 if it is not eclipsed.

Paralleling

Each of node connection objects, node result objects, and result document objects can not be shared by threads. If you use multi threads, make each thread have its own objects. If the precondition is kept, functions of the node API can be treated as thread-safe functions.

Example of Gatherer

The following is the simplest implementation of a gatherer.

#include <estraier.h>
#include <estnode.h>
#include <cabin.h>
#include <stdlib.h>
#include <stdio.h>

int main(int argc, char **argv){
  ESTNODE *node;
  ESTDOC *doc;
  /* initialize the network environment */
  if(!est_init_net_env()){
    fprintf(stderr, "error: network is unavailable\n");
    return 1;
  }
  /* create and configure the node connection object */
  node = est_node_new("http://localhost:1978/node/test1");
  est_node_set_auth(node, "admin", "admin");
  /* create a document object */
  doc = est_doc_new();
  /* add attributes to the document object */
  est_doc_add_attr(doc, "@uri", "http://estraier.gov/example.txt");
  est_doc_add_attr(doc, "@title", "Over the Rainbow");
  /* add the body text to the document object */
  est_doc_add_text(doc, "Somewhere over the rainbow.  Way up high.");
  est_doc_add_text(doc, "There's a land that I heard of once in a lullaby.");
  /* register the document object to the node */
  if(!est_node_put_doc(node, doc))
    fprintf(stderr, "error: %d\n", est_node_status(node));
  /* destroy the document object */
  est_doc_delete(doc);
  /* destroy the node object */
  est_node_delete(node);
  /* free the networking environment */
  est_free_net_env();
  return 0;
}

Example of Searcher

The following is the simplest implementation of a searcher.

#include <estraier.h>
#include <estnode.h>
#include <cabin.h>
#include <stdlib.h>
#include <stdio.h>

int main(int argc, char **argv){
  ESTNODE *node;
  ESTCOND *cond;
  ESTNODERES *nres;
  ESTRESDOC *rdoc;
  int i;
  const char *value;
  /* initialize the network environment */
  if(!est_init_net_env()){
    fprintf(stderr, "error: network is unavailable\n");
    return 1;
  }
  /* create the node connection object */
  node = est_node_new("http://localhost:1978/node/test1");
  /* create a search condition object */
  cond = est_cond_new();
  /* set the search phrase to the search condition object */
  est_cond_set_phrase(cond, "rainbow AND lullaby");
  /* get the result of search */
  nres = est_node_search(node, cond, 0);
  if(nres){
    /* for each document in the result */
    for(i = 0; i < est_noderes_doc_num(nres); i++){
      /* get a result document object */
      rdoc = est_noderes_get_doc(nres, i);
      /* display attributes */
      if((value = est_resdoc_attr(rdoc, "@uri")) != NULL)
        printf("URI: %s\n", value);
      if((value = est_resdoc_attr(rdoc, "@title")) != NULL)
        printf("Title: %s\n", value);
      /* display the snippet text */
      printf("%s", est_resdoc_snippet(rdoc));
    }
    /* delete the node result object */
    est_noderes_delete(nres);
  } else {
    fprintf(stderr, "error: %d\n", est_node_status(node));
  }
  /* destroy the search condition object */
  est_cond_delete(cond);
  /* destroy the node object */
  est_node_delete(node);
  /* free the networking environment */
  est_free_net_env();
  return 0;
}

Command of a Client

estcall is provided as a client command to manage the node server. This section describes how to use estcall.

Synopsis and Description

estcall is an aggregation of sub commands. The name of a sub command is specified by the first argument. Other arguments are parsed according to each sub command. The argument nurl specifies the URL of a node. The option -proxy specifies the host name and the port number of a proxy server. The option -tout specifies timeout in seconds. The option -auth specifies the user name and the password of authentication information.

estcall put [-proxy host port] [-tout num] [-auth user pass] nurl [file]
Register a document of document draft to a node.
file specifies a target file. If it is omitted, the standard input is read.
estcall out [-proxy host port] [-tout num] [-auth user pass] nurl expr
Remove information of a document from a node.
expr specifies the ID number or the URI of a document.
estcall edit [-proxy host port] [-tout num] [-auth user pass] nurl expr name [value]
Edit an attribute of a document in a node.
expr specifies the ID number or the URI of a document.
name specifies the name of an attribute.
value specifies the value of the attribute. If it is omitted, the attribute is removed.
estcall get [-proxy host port] [-tout num] [-auth user pass] nurl expr [attr]
Output document draft of a document in a node.
expr specifies the ID number or the URI of a document.
If attr is specified, only the value of the attribute is output.
estcall etch [-proxy host port] [-tout num] [-auth user pass] nurl expr
Output TSV of keywords and their scores of a document in a node.
expr specifies the ID number or the URI of a document.
estcall uriid [-proxy host port] [-tout num] [-auth user pass] nurl uri
Output the ID number of a document specified by URI.
uri specifies the URI of a document.
estcall inform [-proxy host port] [-tout num] [-auth user pass] [-ia|-iu|-il] nurl
Output the name, the label, the number of documents, the number of unique words, and the cache usage of a node.
If -ia is specified, names of administrators are output.
If -iu is specified, names of users are output.
If -il is specified, expressions of links are output.
estcall sync [-proxy host port] [-tout num] [-auth user pass] nurl
Synchronize updating contents of the database of a node.
estcall optimize [-proxy host port] [-tout num] [-auth user pass] nurl
Optimize the database of a node.
estcall search [-proxy host port] [-tout num] [-auth user pass] [-vu|-vx] [-kw] [-ec rn] [-sf] [-attr expr] [-ord expr] [-max num] [-sk num] [-aux num] [-dis name] [-dpt num] [-mask num] nurl [phrase]
Search a node for documents.
phrase specifies the search phrase.
If -vu is specified, TSV of URI and node information are output.
If -vx is specified, XML including including attributes and snippets is output.
If -kw is specified, keyword vectors are retrieved.
-ec specifies lower limit of similarity eclipse.
If -sf is specified, the phrase is treated as a simplified form.
-attr specifies an attribute search condition. This option can be specified multiple times.
-ord specifies the order expression. By default, it is descending by score.
-max specifies the maximum number of show documents. Negative means unlimited. By default, it is 10.
-sk specifies the number of documents to be skipped. By default, it is 0.
-aux specifies permission to adopt result of the auxiliary index. If it is not more than 0, the auxiliary index is not used. By default, it is 32.
-dis specifies the name of the distinct attribute.
-dpt specifies the depth of meta search. by default it is 0.
-mask specifies the mask of meta search. by default it is 0.
estcall list [-proxy host port] [-tout num] [-auth user pass] nurl
Retriave a list of all documents.
estcall setuser [-proxy host port] [-tout num] [-auth user pass] nurl name mode
Set permission of a user.
name specifies the name of a user.
mode specifies operation mode. 1 means to set the user as an administrator, 2 means to set the user as a guest, and 0 means to revoke the user account.
estcall setlink [-proxy host port] [-tout num] [-auth user pass] nurl url label credit
Set a link to another node.
url specifies the URL of a destination node.
label specifies the label of the link.
credit specifies the credit of the link. If the value is negative, the link is removed.
estcall raw [-proxy host port] [-tout num] [-auth user pass] [-np] [-eh expr] url [file]
Output response of an HTTP request.
url specifies the URL of a target.
If file is specified, the content is sent by POST method. If not, GET method is used. If "-" is specified, the standard input is read.
If -np is specified, output response headers also.
-eh specifies an additional HTTP header. By default, "Host", "Connection", "User-Agent", and "Content-Length" is added.

All sub commands return 0 if the operation is success, else return 1.

Examples

Operations for the node maser itself is not provided as APIs, use the raw sub command for that purpose. For example, the following command is used in order to shutdown the node master.

estcall raw -auth admin admin \
  'http://localhost:1978/master?action=shutdown'

In order to add a user, perform the following command.

estcall raw -auth admin admin \
  'http://localhost:1978/master?action=useradd&name=mikio&passwd=iloveyou'

In order to use POST method, perform the following command.

echo -n 'action=useradd&name=mikio&passwd=iloveyou' |
  estcall raw -auth admin admin \
    -eh 'Content-Type: application/x-www-form-urlencoded' \
    'http://localhost:1978/master' -

Pseudo Node Master

estfraud.cgi is a CGI script working as a node master.

Constitution

Running a node master bothers you to write start-up and shutdown scripts. And, it may be forbidden to run any daemon process on some shared servers. In that case, pseudo node master is useful. You can publish some indexes as node servers, on any environment where a web server runs and CGI scripts are available. Such virtual node server working on a pseudo master is called pseudo node server. Each pseudo node server can be searched with the node API.

Pseudo node master is useful in case that the number of node is enormous. Different from usual node server which regidents with keeping file descriptios, pseudo node server connects the database on demand of each request. So, file descriptors are not exhausted. Actually, the maximum number of node servers running on a usual node master is about 30. However, a pseudo node master can handle one thousand or more pseudo node servers.

To use pseudo node master, deploy a CGI script estfraud.cgi and a configuration file estfraud.conf into a directory where CGI scripts are available.

Configuration File

The configuration file is composed of lines and the name of an variable and the value separated by ":" are in each line. Lines leaded by "#" are ignored as comments. By default, the following configuration is there.

indexdir: .
runmode: 2
pidxsuffix: -pidx
pidxdocmax: 256
pidxdocmin: 0
lockindex: 0
searchmax: 1000
rateuri: 1
mergemethod: 2
scoreexpr: 2
wildmax: 256
snipwwidth: 480
sniphwidth: 96
snipawidth: 96
scancheck: 1
smlrvnum: 32
extdelay: 4096

Means of each variable is the following.

  • indexdir : specifies the path of a directory containing indexes.
  • runmode : specifies running mode (1:normal, 2:readonly).
  • pidxsuffix : specifies the suffix of pseudo indexes.
  • pidxdocmax : specifies the maximum number of documents in each pseudo index.
  • pidxdocmin : specifies the minimum number of documents in each pseudo index.
  • lockindex : specifies whether to perform file locking to the database (0:no, 1:yes).
  • searchmax : specifies the maximum number of documents to send.
  • rateuri : specifies whether to rate URI for scoring (0:no, 1:yes).
  • mergemethod : specifies merge method of meta search (1:score, 2:score and rank, 3:rank).
  • scoreexpr : specifies score expression (1:void, 2:char, 3:int, 4:asis).
  • wildmax : specifies the maximum number of expansion of wild cards.
  • snipwwidth : specifies whole width of the snippet of each shown document.
  • sniphwidth : specifies width of strings picked up from the beginning of the text.
  • snipawidth : specifies width of strings picked up around each highlighted word.
  • scancheck : specifies whether to check documents by scanning (0:no, 1:yes).
  • smlrvnum : specifies the number of keywords for similarity search (0 means disabled).
  • extdelay : specifies the number of documents for delay of keyword extraction.

For example, if the value of indexdir is "/home/mikio/myindex" and the URL of estfraud.cgi is "http://abc.def/ghi/estfraud.cgi", the URL "http://abc.def/ghi/estfraud.cgi/foo" is to access the index "/home/mikio/myindex/foo".

Restrictions

The following conditions must be satisfied for updating indexes by node servers.

  • Running mode of the pseudo node master is normal (set "runmode: 1").
  • Pseudo indexes exist (make directories whose names are the index names trailed by "-pidx".
  • The user executing the CGI script has permission to write indexes and pseudo indexes.

If documents are registered via node server, they are stored in a pseudo index. When the number of files in the pseudo index reaches the number specified by pidxdocmax, content of the pseudo index is merged into the index and the pseudo index become empty. Due to the mechanism, the CGI script which does not resident as daemon can update the index. If pidxdocmax is set larger, faster the updating process performs, but slower the search process performs. To merge the pseudo index into the index explicitly, call the sync method (est_node_sync).

As pseudo node server does not support query relay to other nodes, the depth parameter of search query is ignored. Moreover, pseudo node server does not support changing the URI attribute by document editing (est_node_doc_edit).


Meta Search Gateway

estscout.cgi is a gateway for intersection meta search and estsupt.cgi is a gateway for union meta search.

Constitution

In order to retrieve intersection set of search results from plural indexes by using such identifiers as URI attribute, the intersection meta search gateway is useful. For example, you can search a staff register for records whose name and address match some full-text search conditions, by using URI attribute of staff number as identifier. Moreover, the union meta search gateway is provided in order to get union set of search results from plural intersection meta search gateways.

The two gateways are implemented as CGI scripts and used with parameters specified by URL. No such abstraction interface as API is provided. Because meta search is performed by multi thread or multi process, improvement of scalability for distributed processing is expected.

[gateways]

Intersection Meta Search Gateway

To use the intersection meta search gateway, deploy a CGI script estscout.cgi and a configuration file estscout.conf into a directory where CGI scripts are available.

The configuration file is composed of lines and the name of an variable and the value separated by ":" are in each line. By default, the following configuration is there.

indexname: casket-1
indexname: casket-2
indexname: casket-3
lockindex: 1
condgstep: 2
dotfidf: true
scancheck: 3
phraseform: 2
wildmax: 256
stmode: 0
idattr: @uri
idsuffix:
ordexpr: @uri STRA
dupcheck: 0
union: 0
tmpdir: /tmp
cclife: 300
logfile:
logformat: {time}\t{REMOTE_ADDR}:{REMOTE_PORT}\t{cond}\t{hnum}\n

Means of each variable is the following.

  • indexname : specifies the name of an index. This can be more than once.
  • lockindex : specifies whether to perform file locking to the database (0:no, 1:yes).
  • condgstep : specifies accuracy of N-gram checking.
  • dotfidf : specifies whether to do TF-IDF score tuning (0:no, 1:yes).
  • scancheck : specifies the number of checked documents by scanning.
  • phraseform : specifies the phrase form (1:usual form, 2:simplified form, 3:rough form, 4:union form, 5:intersection form).
  • wildmax : specifies the maximum number of expansion of wild cards.
  • stmode : specifies whether to be single thread mode (0:no, 1:yes).
  • idattr : specifies the name of an attribute used as document identifier. If it is an empty string, score is used.
  • idsuffix : specifies the name of an attribute used as the suffix of document identifier. This can be more than once.
  • ordexpr : specifies an ordering expression used when attribute search.
  • dupcheck : specifies whether to check duplication of identifiers (0:no, 1:yes).
  • union : specifies whether to perform union meta search.
  • score : specifies a scoring method when logical operation (0:sum, 1:max, 2:min, 3:average).
  • tmpdir : specifies the path of the directory for temporary files.
  • cclife : specifies the lifetime of cache files (in seconds). If it is negative, the lifetime is unlimited.
  • logfile : specifies the path of the log file.
  • logformat : specifies the format of each log data.

The intersection meta search gateway receives the following parameters. The order expression is not supported.

  • phrasen : specifies full-text search conditions with n assigned from 1 to 9.
  • attrn : specifies attribute search condition with n assigned from 1 to 9.
  • max : specifies the maximum number of documents to send.
  • distinct : the name of the distinct attribute.
  • fresh : specifies whether to disable cache temporarily (0:no, 1:yes).

In the output, the first line specifies the approximation number of corresponding documents. Each of the subsequent lines specifies identifier and score of a corresponding document. For example, the following is output.

256
file:///home/mikio/tako.html   12561
file:///home/mikio/ika.html    11624
file:///home/mikio/uni.html    9232
file:///home/mikio/kani.html   8293
file:///home/mikio/ebi.html    8312

Union Meta Search Gateway

To use the union meta search gateway, deploy a CGI script estsupt.cgi and a configuration file estsupt.conf into a directory where CGI scripts are available.

The configuration file is composed of lines and the name of an variable and the value separated by ":" are in each line. By default, the following configuration is there.

targeturl: http://searcher1/estscout.cgi
targeturl: http://searcher2/estscout.cgi
stmode: 0
tmpdir: /tmp
cclife: 1800
#shareurl: http://merger1/estsupt.cgi
#shareurl: http://merger2/estsupt.cgi
failfile:
logfile:
logformat: {time}\t{REMOTE_ADDR}:{REMOTE_PORT}\t{cond}\t{hnum}\n

Means of each variable is the following.

  • targeturl : specifies the URL of an intersection meta search gateway. This can be more than once.
  • stmode : specifies whether to be single thread mode (0:no, 1:yes).
  • score : specifies a scoring method when logical operation (0:sum, 1:max, 2:min, 3:average).
  • tmpdir : specifies the path of the directory for temporary files.
  • cclife : specifies the lifetime of cache files (in seconds). If it is negative, the lifetime is unlimited.
  • shareurl : specifies the URL of a union meta search gateway for shared cache. This can be more than once.
  • failfile : specifies the path of the fail rate file.
  • logfile : specifies the path of the log file.
  • logformat : specifies the format of each log data.

The format of output and parameters of the union meta search gateway are same with ones of the intersection meta search gateway.


hyperestraier-1.4.13/doc/nguide-ja.html000066400000000000000000004070171125261632700200020ustar00rootroot00000000000000 P2P Guide of Hyper Estraier Version 1 (Japanese)

P2P繧ャ繧、繝

Copyright (C) 2004-2007 Mikio Hirabayashi
Last Update: Tue, 06 Mar 2007 12:05:18 +0900

逶ョ谺。

  1. 縺ッ縺倥a縺ォ
  2. 繧「繝シ繧ュ繝繧ッ繝√Ε
  3. 繝√Η繝シ繝医Μ繧「繝ォ
  4. 繝弱シ繝峨槭せ繧ソ逕ィ繧ウ繝槭Φ繝
  5. 繝励Ο繝医さ繝ォ
  6. 繝弱シ繝陰PI
  7. 繧ッ繝ゥ繧、繧「繝ウ繝育畑繧ウ繝槭Φ繝
  8. 逍台シシ繝弱シ繝峨槭せ繧ソ
  9. 繝。繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、
  10. 蜉ゥ險

縺ッ縺倥a縺ォ

縺薙ョ繧ャ繧、繝峨〒縺ッ縲?yper Estraier縺ョP2P讖滓ァ九ョ隧ウ邏ー縺ェ菴ソ縺譁ケ繧定ェャ譏弱@縺セ縺吶繝ヲ繝シ繧カ繧ャ繧、繝繧偵∪縺縺願ェュ縺ソ縺ァ縺ェ縺蝣エ蜷医ッ蜈医↓縺昴■繧峨↓逶ョ繧帝壹@縺ヲ縺翫>縺ヲ縺上□縺輔>縲

estseek.cgi縺ァ讀懃エ「繧定。後≧蝣エ蜷医∬オキ蜍輔☆繧句コヲ縺ォ繝繝シ繧ソ繝吶シ繧ケ繧堤ォ九■荳翫£逶エ縺吶ョ縺ァ縲∝ヲ逅蜉ケ邇縺梧が縺縺ァ縺吶ゅ∪縺溘estcmd縺ァ繝繝シ繧ソ繝吶シ繧ケ縺ョ譖エ譁ー菴懈・ュ繧定。後▲縺ヲ縺繧矩俣縺ッ縲√ョ繝シ繧ソ繝吶シ繧ケ縺後Ο繝繧ッ縺輔l縺ヲ縺励∪縺縺ョ縺ァ讀懃エ「縺後〒縺阪∪縺帙s縲ゅ%繧後i縺ョ蝠城。後↓蟇セ蜃ヲ縺吶k縺溘a縺ォ縲?yper Estraier縺ッC/Sシ医け繝ゥ繧、繧「繝ウ繝/繧オ繝シ繝撰シ画婿蠑上ョ繧オ繝シ繝舌励Ο繧ー繝ゥ繝繧呈署萓帙@縺セ縺吶ゅョ繝シ繧ソ繝吶シ繧ケ繧貞蛹縺励◆繝励Ο繧サ繧ケ繧偵す繧ケ繝繝縺ォ蟶ク鬧舌&縺帙※縺翫>縺ヲ縲√◎繧後r繝阪ャ繝医Ρ繝シ繧ッ邨檎罰縺ァ謫堺ス懊☆繧九b縺ョ縺ァ縺吶C/S譁ケ蠑上↓縺ッ莉・荳九ョ蛻ゥ轤ケ縺後≠繧翫∪縺吶

  • 繧オ繝シ繝舌→繧ッ繝ゥ繧、繧「繝ウ繝医r蛻・縲縺ョ繝槭す繝ウ荳翫〒蜍穂ス懊&縺帙k縺薙→縺後〒縺阪∪縺吶
  • 蜊倅ク縺ョ繧オ繝シ繝舌↓蟇セ縺吶k隍謨ー縺ョ繧ッ繝ゥ繧、繧「繝ウ繝医′荳ヲ蛻励↓蜃ヲ逅繧定。後∴縺セ縺吶
  • 繧ッ繝ゥ繧、繧「繝ウ繝医′繧ッ繝ゥ繝繧キ繝・縺励※繧ゅョ繝シ繧ソ繝吶シ繧ケ縺悟」翫l縺セ縺帙s縲
  • 螳溯」險隱槭dAPI縺ォ萓晏ュ倥@縺ェ縺縺ァ繧ッ繝ゥ繧、繧「繝ウ繝医r螳溯」縺ァ縺阪∪縺吶

C/S髢薙ョ繝励Ο繝医さ繝ォ縺ッHTTP繝吶シ繧ケ縺ェ縺ョ縺ァ縲∽ク闊ャ逧縺ェWeb繝悶Λ繧ヲ繧カ繧偵け繝ゥ繧、繧「繝ウ繝医↓縺吶k縺薙→縺悟庄閭ス縺ァ縺吶ゅb縺。繧阪s縲∫峡閾ェ縺ョ繧ッ繝ゥ繧、繧「繝ウ繝医r螳溯」縺励※縺縺溘□縺縺ヲ繧ゅ°縺セ縺縺セ縺帙s縺励仝eb繝悶Λ繧ヲ繧カ縺ォJavaScript繧Ёlash縺ェ縺ゥ縺ョ謚陦薙r邨縺ソ蜷医o縺帙k縺薙→繧ゅ〒縺阪k縺ァ縺励g縺縲

隍謨ー縺ョ繧オ繝シ繝舌′逶ク莠偵↓騾壻ソ。縺吶k縺薙→繧医▲縺ヲ縲 ̄2PシPeer to Peerシ画婿蠑上ョ蛻謨」蜃ヲ逅繧定。後≧縺薙→繧ゅ〒縺阪∪縺吶100荳莉カ縺ョ譁譖ク縺ョ繧、繝ウ繝繝繧ッ繧ケ繧堤ョ。逅縺吶k10蛟九ョ繧オ繝シ繝舌r騾」謳コ縺輔○繧後ー縲1000荳莉カ縺ョ譁譖ク繧呈桶縺讀懃エ「繧キ繧ケ繝繝繧呈ァ狗ッ峨☆繧九%縺ィ縺後〒縺阪k縺ィ縺縺繧上¢縺ァ縺吶ゅし繝シ繝仙酔螢ォ縺ッ蟇セ遲峨ョ髢「菫ゅ〒縺ゅk縺溘a縲√け繝ゥ繧、繧「繝ウ繝医ッ縺ゥ縺ョ繧オ繝シ繝舌↓繧「繧ッ繧サ繧ケ縺励※繧ゅし繝シ繝薙せ繧剃コォ蜿励☆繧九%縺ィ縺後〒縺阪∪縺吶@縲√←繧後°縺ョ繧オ繝シ繝舌′繝繧ヲ繝ウ縺励※繧ゅす繧ケ繝繝蜈ィ菴薙′蛛懈ュ「縺吶k縺薙→縺ッ縺ゅj縺セ縺帙s縲ゅ∪縺溘√し繝シ繝宣俣縺ョ菫。鬆シ蠎ヲ繧貞縺ォ讀懃エ「邊セ蠎ヲ繧貞髄荳翫&縺帙k莉慕オ縺ソ繧ょy繧上▲縺ヲ縺縺セ縺吶

C/S髢薙ョ繝励Ο繝医さ繝ォ繧帝國阡ス縺吶k縲繝弱シ繝陰PI縲阪b謠蝉セ帙&繧後∪縺吶ゅヮ繝シ繝陰PI繧剃スソ縺医ー縲√ロ繝繝医Ρ繝シ繧ッ縺ォ髢「縺吶k隧ウ邏ー縺ェ遏・隴倥′縺ェ縺上※繧ゅ√け繝ゥ繧、繧「繝ウ繝医ョ繝励Ο繧ー繝ゥ繝繧貞ョ溯」縺吶k縺薙→縺後〒縺阪∪縺吶ゅ%縺ョ繧ャ繧、繝峨〒縺ッ縲√ヮ繝シ繝陰PIシC險隱橸シ峨ョ菴ソ縺譁ケ縺ォ縺、縺縺ヲ繧りェャ譏弱@縺セ縺吶ゅヮ繝シ繝陰PI縺ォ縺ッJava迚縺ィRuby迚繧ゅ≠繧翫∪縺吶


繧「繝シ繧ュ繝繧ッ繝√Ε

縺薙%縺ァ縺ッ縲?yper Estraier縺ォ縺翫¢繧輝2P縺ョ繧「繝シ繧ュ繝繧ッ繝√Ε縺ォ縺、縺縺ヲ隱ャ譏弱@縺セ縺吶

繝弱シ繝峨槭せ繧ソ縺ィ繝弱シ繝峨し繝シ繝

螟壽焚縺ョ繧、繝ウ繝繝繧ッ繧ケ繧堤ョ。逅縺吶k縺薙→繧呈Φ螳壹@縺溷エ蜷医√う繝ウ繝繝繧ッ繧ケ豈弱↓繧オ繝シ繝舌r襍キ蜍輔☆繧九ョ縺ッ髱槫柑邇縺ァ縺吶ゅ◎縺薙〒縲∝腰荳縺ョ繝励Ο繧サ繧ケ縺翫h縺ウ蜊倅ク縺ョ繝昴シ繝医〒隍謨ー縺ョ繧、繝ウ繝繝繧ッ繧ケ繧堤ョ。霓縺ァ縺阪k縲繝弱シ繝峨槭せ繧ソ縲阪→縺縺繝励Ο繧ー繝ゥ繝縺梧署萓帙&繧後∪縺吶ゅヮ繝シ繝峨槭せ繧ソ蜀縺ョ蛟九縺ョ繧、繝ウ繝繝繧ッ繧ケ縺ッ迢ャ遶九@縺溘し繝シ繝薙せ繧呈署萓帙☆繧九ョ縺ァ縲√ヮ繝シ繝峨槭せ繧ソ縺ッ隍謨ー縺ョ繧オ繝シ繝舌ョ髮蜷井ス薙→縺ソ縺ェ縺吶%縺ィ繧ゅ〒縺阪∪縺吶ゅ◎縺薙〒縲∝九縺ョ繧、繝ウ繝繝繧ッ繧ケ繧堤ョ。霓縺吶k莉ョ諠ウ逧縺ェ繧オ繝シ繝舌r縲繝弱シ繝峨し繝シ繝縲阪→蜻シ縺カ縺薙→縺ォ縺励∪縺吶ょ推繝弱シ繝峨し繝シ繝舌↓縺ッ蛻・縲縺ョURL縺悟牡繧雁ス薙※繧峨l縺セ縺吶ゅΘ繝シ繧カ縺梧桃菴懊☆繧九い繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ッ繝弱シ繝峨し繝シ繝舌ョ繧ッ繝ゥ繧、繧「繝ウ繝医→縺励※菴咲スョ縺・縺代i繧後∪縺吶′縲∵磁邯壼医ョ繝弱シ繝峨し繝シ繝舌↓縺、縺縺ヲ縺ッURL縺縺醍衍縺」縺ヲ縺繧後ー繧医¥縲√ヮ繝シ繝峨し繝シ繝舌′縺ゥ縺ョ繝弱シ繝峨槭せ繧ソ荳翫↓蟄伜惠縺励※縺繧九°繧偵い繝励Μ繧ア繝シ繧キ繝ァ繝ウ蛛エ縺ァ諢剰ュ倥☆繧句ソ隕√ッ縺ゅj縺セ縺帙s縲

[framework]

繝弱シ繝シnodeシ峨阪→縺縺逕ィ隱槭r縺薙%縺ァ縺ッP2P讖滓ァ九↓縺翫¢繧九繝斐いシpeerシ峨阪→縺サ縺シ蜷後§諢丞袖縺ァ菴ソ縺」縺ヲ縺縺セ縺吶ゅけ繝ゥ繧、繧「繝ウ繝医ッ縲√ヮ繝シ繝峨槭せ繧ソ縺昴ョ繧ゅョ縺ォ謗・邯壹@縺ヲ繝弱シ繝峨ョ邂。逅繧定。後≧縺ィ縺ィ繧ゅ↓縲∝推縲縺ョ繝弱シ繝峨し繝シ繝舌↓謗・邯壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ縺ォ蟇セ縺吶k讀懃エ「繧譁譖ク縺ョ逋サ骭イ縺ェ縺ゥ縺ョ謫堺ス懊r陦後≧縺薙→縺後〒縺阪∪縺吶

繝。繧ソ讀懃エ「縺ィ菫。鬆シ蠎ヲ

繝弱シ繝峨し繝シ繝舌ッ蛻・縺ョ繝弱シ繝峨し繝シ繝舌↓蟇セ縺励※荳譁ケ逧縺ォ繝ェ繝ウ繧ッ繧貞シオ繧九%縺ィ縺後〒縺阪∪縺吶ゅけ繝ゥ繧、繧「繝ウ繝医′繝弱シ繝峨し繝シ繝舌↓讀懃エ「隕∵アゅr蜃コ縺励◆蝣エ蜷医∽セ晞シ繧貞女縺代◆繝弱シ繝峨し繝シ繝舌ッ閾ェ蛻縺後Μ繝ウ繧ッ繧貞シオ縺」縺ヲ縺繧九ヮ繝シ繝峨し繝シ繝舌↓繧ゅけ繧ィ繝ェ繧剃クュ邯吶@縲∬ソ斐&繧後◆邨先棡繧定ェ蛻縺ョ繧、繝ウ繝繝繧ッ繧ケ縺ョ邨先棡縺ィ繝槭シ繧ク縺励※繧ッ繝ゥ繧、繧「繝ウ繝医↓霑斐@縺セ縺吶ゅ▽縺セ繧翫√>繧上f繧九Γ繧ソ讀懃エ「讖溯ス繧貞ィ縺ヲ縺ョ繝弱シ繝峨し繝シ繝舌′謖√▽縺薙→縺ォ繧医▲縺ヲ縲 ̄2P蝙九ョ蛻謨」蜃ヲ逅繧貞ョ溽樟縺励※縺繧九ョ縺ァ縺吶

繝。繧ソ讀懃エ「縺ッ螟夐嚴螻、逧縺ォ陦後o繧後∪縺吶らオ瑚キッ縺ョ蠕ェ迺ー縺ッ閾ェ蜍慕噪縺ォ讀懷コ縺輔l縺ヲ謚第ュ「縺輔l縺セ縺吶ョ縺ァ縲∵、懃エ「譎ゅ↓縺ッ譛ィ讒矩縺ョ繝阪ャ繝医Ρ繝シ繧ッ縺九i繝繝シ繧ソ繧貞庶髮縺励※縺繧九h縺縺ェ謖吝虚縺ォ縺ェ繧翫∪縺吶ゅ%縺ョ讖滓ァ九↓繧医▲縺ヲ縲∵、懃エ「蟇セ雎。縺ィ縺ェ繧九ヮ繝シ繝峨ョ謨ー繧帝圀髯舌↑縺丞「励d縺励※縺縺上%縺ィ縺悟庄閭ス縺ォ縺ェ繧翫∪縺吶

[tree of meta search]

繝弱シ繝蛾俣縺ョ蜷繝ェ繝ウ繧ッ縺ォ縺ッ縲√菫。鬆シ蠎ヲ縲阪→縺縺謨ー蛟、縺悟ョ夂セゥ縺輔l縺セ縺吶ゅヮ繝シ繝峨′繝。繧ソ讀懃エ「縺ョ邨先棡繧偵槭シ繧ク縺吶k髫帙↓縺ッ縲√せ繧ウ繧「縺ョ驥阪∩縺・縺代↓菫。鬆シ蠎ヲ縺悟茜逕ィ縺輔l縺セ縺吶ゆソ。鬆シ蠎ヲ縺碁ォ倥>繝弱シ繝峨ョ邨先棡縺ッ荳贋ス阪↓譚・繧縺吶>縺ィ縺縺縺薙→縺ァ縺吶ゅΜ繝ウ繧ッ菴懈舌d菫。鬆シ蠎ヲ險ュ螳壹ョ謖遉コ縺ッ繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ォ莉サ縺輔l縺セ縺吶′縲√h縺丞茜逕ィ縺輔l繧九ヮ繝シ繝峨ョ菫。鬆シ蠎ヲ繧帝ォ倥a繧九h縺縺ォ謖遉コ縺吶k縺薙→縺ォ繧医▲縺ヲ縲∵、懃エ「縺ョ邊セ蠎ヲ縺碁ォ倥a縺ヲ陦後¥縺薙→縺後〒縺阪∪縺吶

隱崎ィシ

繧ッ繝ゥ繧、繧「繝ウ繝医′繝弱シ繝峨槭せ繧ソ繧繝弱シ繝峨し繝シ繝舌↓謗・邯壹☆繧矩圀縺ォ縺ッ縲√Θ繝シ繧カ蜷阪→繝代せ繝ッ繝シ繝峨r逕ィ縺縺溯ェ崎ィシ縺瑚。後o繧後∪縺吶ゅΘ繝シ繧カ縺ォ縺ッ縲√繧ケ繝シ繝代シ繝ヲ繝シ繧カ縲阪→縲繝弱シ繝槭Ν繝ヲ繝シ繧カ縲阪ョ2遞ョ鬘槭′縺ゅj縺セ縺吶ょ燕閠縺ッ繝弱シ繝峨ョ邂。逅繧繝ヲ繝シ繧カ縺ョ邂。逅繧定。後≧讓ゥ髯舌r謖√▽繝ヲ繝シ繧カ縺ァ縲∝セ瑚縺ッ縺昴l繧峨ョ讓ゥ髯舌r謖√◆縺ェ縺繝ヲ繝シ繧カ縺ァ縺吶ゅ∪縺溘√ヮ繝シ繝峨し繝シ繝舌ョ蜊倅ス阪〒繧よィゥ髯舌ョ莉倅ク弱′陦後o繧後∪縺吶ょ推繝弱シ繝峨↓縺、縺縺ヲ縲√う繝ウ繝繝繧ッ繧ケ縺ョ譖エ譁ー縺悟庄閭ス縺ェ邂。逅閠繝ヲ繝シ繧カ縺ョ繝ェ繧ケ繝医→縲∵、懃エ「縺縺代′蜿ッ閭ス縺ェ繧イ繧ケ繝医Θ繝シ繧カ縺ョ繝ェ繧ケ繝医′邂。逅縺輔l縺セ縺吶ゅ↑縺翫√ヮ繝シ繝峨槭せ繧ソ縺ョ繧ケ繝シ繝代シ繝ヲ繝シ繧カ縺ッ驟堺ク九ョ縺ゥ縺ョ繝弱シ繝峨↓繧らョ。逅閠縺ィ縺励※繧「繧ッ繧サ繧ケ縺ァ縺阪∪縺吶ゅΘ繝シ繧カ縺ョ邂。逅縺ッ繧ッ繝ゥ繧、繧「繝ウ繝医′繝弱シ繝峨槭せ繧ソ縺ォ謖遉コ繧貞コ縺吶%縺ィ縺ァ陦後>縺セ縺吶

繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ萓

Hyper Estraier縺ョ繝弱シ繝陰PI繧剃スソ縺」縺滓怙繧り亥袖豺ア縺繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ィ縺励※縲mod_estraier縺梧嫌縺偵i繧後∪縺吶8eb繧オ繝シ繝撰シApacheシ峨ョ繝「繧ク繝・繝シ繝ォ縺ィ縺励※蜍穂ス懊@縺ヲ縲√励Ο繧ッ繧キ縺ィ縺励※莉イ莉九@縺溘さ繝ウ繝繝ウ繝繧偵う繝ウ繝繝繧ッ繧ケ縺ォ逋サ骭イ縺吶k繧ス繝輔ヨ繧ヲ繧ァ繧「縺ァ縺吶ゅヵ繧ゥ繝ッ繝シ繝峨励Ο繧ッ繧キ縺ィ縺励※菴ソ縺医ー縲∬ェ蛻繧莉イ髢薙′隕九◆縺薙→縺ョ縺ゅk繝壹シ繧ク縺ョ縺ソ繧貞ッセ雎。縺ィ縺励◆讀懃エ「繧ィ繝ウ繧ク繝ウ縺後〒縺阪∪縺吶ゅΜ繝舌シ繧ケ繝励Ο繧ッ繧キ縺ィ縺励※菴ソ縺医ー縲∵軸遉コ譚ソ繧Цiki縺ッ繧ゅ■繧阪s縲√>縺九↑繧妓eb繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ォ繧よ、懃エ「讖溯ス繧堤オ縺ソ霎シ繧√∪縺吶ゅ%縺ョ繧医≧縺ォ縲∵ァ倥縺ェ繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ィ騾」謳コ縺励※鬮伜コヲ縺ェ讀懃エ「繧キ繧ケ繝繝繧堤ー。蜊倥↓菴懊l繧九ョ縺後ヮ繝シ繝陰PI縺ョ譛螟ァ縺ョ迚ケ蠕エ縺ァ縺吶


繝√Η繝シ繝医Μ繧「繝ォ

P2P縺ョ讎ょソオ縺ッ縺ェ縺九↑縺矩屮隗」縺ェ繧ゅョ縺ァ縺吶′縲√∪縺壹ッ繧ウ繝槭Φ繝峨r菴ソ縺」縺ヲ縺ソ縺ェ縺後i髮ー蝗イ豌励r謗エ繧薙〒陦後″縺セ縺励g縺縲

襍キ蜍輔→邨ゆコ

繝弱シ繝峨槭せ繧ソ繧貞虚菴懊&縺帙k貅門y縺ィ縺励※縲√し繝シ繝舌Ν繝シ繝医ョ繧」繝ャ繧ッ繝医Μ繧剃ス懈舌@縺セ縺吶りィュ螳壹ヵ繧。繧、繝ォ繧繧、繝ウ繝繝繧ッ繧ケ縺ェ縺ゥ繧呈シ邏阪☆繧九ョ繧」繝ャ繧ッ繝医Μ縺ァ縺吶ゆサ・荳九ョ繧ウ繝槭Φ繝峨r螳溯。後☆繧九→縲√casket縲阪→縺縺繝繧」繝ャ繧ッ繝医Μ縺御ス懈舌&繧後∪縺吶

estmaster init casket

谺。縺ォ縲√ヮ繝シ繝峨槭せ繧ソ繧定オキ蜍輔@縺セ縺吶ゆサ・荳九ョ繧医≧縺ォ縺励∪縺吶

estmaster start casket

繝弱シ繝峨槭せ繧ソ繧堤オゆコ縺輔○繧句エ蜷医ッ縲√ヮ繝シ繝峨槭せ繧ソ繧貞ョ溯。後@縺ヲ縺繧狗ォッ譛ォ縺ァCtrl-C繧貞・蜉帙☆繧九°縲∝挨縺ョ遶ッ譛ォ縺ァ莉・荳九ョ繧ウ繝槭Φ繝峨r螳溯。後@縺セ縺吶

estmaster stop casket

邂。逅逕ィ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ

繝弱シ繝峨槭せ繧ソ縺瑚オキ蜍輔@縺ヲ縺繧九↑繧峨ー縲√http://localhost:1978/master_ui縲阪→縺縺URL縺ォWeb繝悶Λ繧ヲ繧カ縺ァ繧「繧ッ繧サ繧ケ縺吶k縺薙→縺ァ縲∫ョ。逅逕ィ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ繧剃スソ縺縺薙→縺後〒縺阪∪縺吶ゅい繧ッ繧サ繧ケ縺吶k縺ィ繝ヲ繝シ繧カ蜷阪→繝代せ繝ッ繝シ繝峨r閨槭°繧後k繝繧、繧「繝ュ繧ー縺悟コ縺セ縺吶ョ縺ァ縲√admin縲阪admin縲阪→蜈・蜉帙@縺ヲ縺上□縺輔>縲ゅ☆繧九→縲∫ョ。逅逕ィ縺ョ繝。繝九Η繝シ縺瑚。ィ遉コ縺輔l縺セ縺吶

Manage Master縲阪Γ繝九Η繝シ邨檎罰縺ァ縺ッ繝弱シ繝峨槭せ繧ソ縺ョ邨ゆコ蜃ヲ逅繧蜷梧悄蜃ヲ逅繧呈欠遉コ縺ァ縺阪∪縺吶′縲√◎繧後i縺ッ莉翫ッ謾セ縺」縺ヲ縺翫″縺セ縺励g縺縲

Manage Users縲阪r驕ク繧薙〒縺上□縺輔>縲ゆサ翫ッ縲admin縲阪→縺縺繝ヲ繝シ繧カ縺ァ繝ュ繧ー繧、繝ウ縺励※縺縺セ縺吶′縲∵眠縺励>繝ヲ繝シ繧カ繧剃ス懊▲縺ヲ縺翫″縺セ縺励g縺縲ら判髱「縺ョ荳九ョ譁ケ縺ォ縺ゅk蜈・蜉帙ヵ繧ゥ繝シ繝縺ォ縲∝承縺九i繝ヲ繝シ繧カ蜷阪√ヱ繧ケ繝ッ繝シ繝峨√ヵ繝ゥ繧ー縲∵悽蜷阪√◎縺ョ莉悶ョ諠蝣ア繧貞・蜉帙@縺セ縺吶ゅΘ繝シ繧カ蜷阪→繝代せ繝ッ繝シ繝峨ッ闍ア謨ー蟄励→繝上う繝輔Φ縺ィ繧「繝ウ繝繝シ繧ケ繧ウ繧「縺ィ繝斐Μ繧ェ繝峨〒謖螳壹@縺セ縺吶ゅ→繧翫≠縺医★縺ッ縲√mikio縲阪oikim縲阪s縲阪蟷ウ譫怜ケケ髮縲阪邂。逅逕ィ繝ヲ繝シ繧カ縲阪→縺励※縺ソ縺セ縺励g縺縲ゅヵ繝ゥ繧ー縺ォ縲s縲阪r蜈・蜉帙@縺ヲ縺繧九ョ縺碁崎ヲ√↑縺ィ縺薙m縺ァ縺吶ゅ◎縺ョ繝ヲ繝シ繧カ縺檎ョ。逅閠讓ゥ髯舌r謖√▽縺薙→繧呈欠遉コ縺励※縺縺セ縺吶

繧ゅッ繧縲admin縲阪Θ繝シ繧カ縺ッ荳崎ヲ√〒縺吶ゅそ繧ュ繝・繝ェ繝繧」縺ョ蝠城。後→縺ェ繧九ョ縺ァ縲∵カ医@縺ヲ縺励∪縺縺セ縺励g縺縲ゅadmin縲阪ョ谺縺ォ縺ゅk縲DELE縲阪r驕ク謚槭@縺ヲ縲∫「コ隱阪ョ逕サ髱「縺ァ縲sure縲阪r驕ク謚槭@縺ヲ縺上□縺輔>縲

谺。縺ォ縲√Manage Nodes縲阪r驕ク謚槭@縺ヲ縺上□縺輔>縲ゅb縺縲admin縲阪Θ繝シ繧カ縺梧カ医∴縺ヲ縺励∪縺」縺溘ョ縺ァ縲∝阪ウ繝ヲ繝シ繧カ蜷阪→繝代せ繝ッ繝シ繝峨r閨槭°繧後∪縺吶ょ医⊇縺ゥ縺ョ縲mikio縲阪oikim縲阪r蜈・蜉帙☆繧九→騾イ繧縺薙→縺後〒縺阪∪縺吶ゆサ雁コヲ縺ッ譁ー縺励>繝弱シ繝峨r菴懊j縺セ縺吶ら判髱「縺ョ荳九ョ譁ケ縺ォ縺ゅk蜈・蜉帙ヵ繧ゥ繝シ繝縺ォ繝弱シ繝牙錐縺ィ繝ゥ繝吶Ν繧呈欠螳壹@縺セ縺吶ゅヮ繝シ繝牙錐縺ッ闍ア謨ー蟄励→繝上う繝輔Φ縺ィ繧「繝ウ繝繝シ繧ケ繧ウ繧「縺ィ繝斐Μ繧ェ繝峨〒謖螳壹@縺セ縺吶ゅ→繧翫≠縺医★縺ッ縲√test1縲阪繝繧ケ繝育畑繝弱シ繝峨◎縺ョ螢ア縲阪→縺縺繝弱シ繝峨→縲√test2縲阪繝繧ケ繝育畑繝弱シ繝峨◎縺ョ蠑縲阪→縺縺繝弱シ繝峨r菴懊▲縺ヲ縺上□縺輔>縲

譁譖ク縺ョ逋サ骭イ

莉雁コヲ縺ッ繧ウ繝槭Φ繝峨Λ繧、繝ウ縺ョ謫堺ス懊↓謌サ繧翫∪縺吶らョ。逅逕ィ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縺ョ逕サ髱「縺ッ髢峨§縺ヲ讒九>縺セ縺帙s縲ゅヮ繝シ繝峨槭せ繧ソ繧定オキ蜍輔@縺溽ォッ譛ォ縺ッ縺繧阪>繧阪Ο繧ー縺悟コ縺ヲ蝪槭′繧後※縺繧九〒縺励g縺縺九i縲∝挨縺ョ遶ッ譛ォ繧堤ォ九■荳翫£縺ヲ縺上□縺輔>縲

繝弱シ繝峨ョ繧、繝ウ繝繝繧ッ繧ケ縺ォ譁譖ク繧堤匳骭イ縺励※縺ソ縺セ縺励g縺縲ら匳骭イ蟇セ雎。縺ョ譁譖ク縺ッ譁譖ク繝峨Λ繝輔ヨ蠖「蠑上〒陦ィ迴セ縺吶k蠢隕√′縺ゅj縺セ縺吶ョ縺ァ縲∽コ医a莉・荳九ョ繧医≧縺ェ繝輔ぃ繧、繝ォ繧偵data001.est縲阪→縺縺蜷榊燕縺ァ菴懈舌@縺ヲ縺上□縺輔>縲

@uri=data001
@title=Material Girl

Living in a material world
And I am a material girl
You know that we are living in a material world
And I am a material girl

test1縲阪ヮ繝シ繝峨↓譁譖ク繧堤匳骭イ縺吶k縺ォ縺ッ縲∽サ・荳九ョ繧ウ繝槭Φ繝峨r螳溯。後@縺セ縺吶ゅう繝ウ繝繝繧ッ繧ケ縺ョ譖エ譁ー縺ォ縺ッ邂。逅閠讓ゥ髯舌′蠢隕√↑縺ョ縺ァ縲-auth繧ェ繝励す繝ァ繝ウ縺ァ邂。逅閠縺ョ繝ヲ繝シ繧カ蜷阪→繝代せ繝ッ繝シ繝峨r謖螳壹@縺ヲ縺縺セ縺吶ら匳骭イ蜃ヲ逅縺ッ荳迸ャ縺ァ邨ゅo繧九ョ縺ァ縲∵悽蠖薙↓逋サ骭イ縺輔l縺ヲ縺繧九°逍代>縺溘¥縺ェ繧九°繧ゅ@繧後∪縺帙s縺後∽ス輔b繝。繝繧サ繝シ繧ク縺悟コ縺ェ縺代l縺ー謌仙粥縺ィ縺縺縺薙→縺ァ縺吶

estcall put -auth mikio oikim http://localhost:1978/node/test1 data001.est

繝。繧ソ讀懃エ「縺ョ隱ャ譏弱ョ縺溘a縺ォ縲√test2縲阪ヮ繝シ繝峨↓繧よ枚譖ク繧堤匳骭イ縺励※縺翫″縺セ縺励g縺縲ゆサ・荳九ョ繝輔ぃ繧、繝ォ繧偵data002.est縲阪→縺励※菴懈舌@縺ヲ縺上□縺輔>縲

@uri=data002
@title=Liberian Girl

Liberian girl
You came and you changed My world
A love so brand new

縺昴@縺ヲ縲∽サ・荳九ョ繧ウ繝槭Φ繝峨r螳溯。後@縺ヲ縺上□縺輔>縲

estcall put -auth mikio oikim http://localhost:1978/node/test2 data002.est

譁譖ク繝峨Λ繝輔ヨ蠖「蠑上ョ繝輔ぃ繧、繝ォ縺輔∴菴懊l縺ー縲√Μ繝「繝シ繝医槭す繝ウ縺九i縺ァ繧よ枚譖ク縺ョ逋サ骭イ縺後〒縺阪k縺ョ縺後Α繧ス縺ァ縺吶ょ酔縺倩ヲ鬆倥〒縲√>縺上▽縺九ョ譁譖ク繧堤匳骭イ縺励※縺ソ縺ヲ縺上□縺輔>縲

譁譖ク縺ョ讀懃エ「

縺ァ縺ッ縲∫匳骭イ縺励◆譁譖ク繧貞ッセ雎。縺ィ縺励◆讀懃エ「繧定。後▲縺ヲ縺ソ縺セ縺励g縺縲ゆサ・荳九ョ繧ウ繝槭Φ繝峨r螳溯。後@縺セ縺吶

estcall search http://localhost:1978/node/test1 "material world"

縺吶k縺ィ縲∝医⊇縺ゥ逋サ骭イ縺励◆譁譖ク縺ョ諠蝣ア縺瑚。ィ遉コ縺輔l縺セ縺吶ゅ↑縺翫∵律譛ャ隱橸シUTF-8シ峨′陦ィ遉コ縺ァ縺阪↑縺遶ッ譛ォ縺縺ィ譁蟄怜喧縺代☆繧九°繧ゅ@繧後∪縺帙s縲

繝弱シ繝蛾俣縺ォ繝ェ繝ウ繧ッ繧貞シオ繧九%縺ィ縺ァ縲√Γ繧ソ讀懃エ「繧定。後≧縺薙→縺後〒縺阪k繧医≧縺ォ縺ェ繧翫∪縺吶りゥヲ縺励↓縲√test1縲阪°繧峨test2縲阪↓蟇セ縺励※繝ェ繝ウ繧ッ繧貞シオ縺」縺ヲ縺ソ縺セ縺励g縺縲ゅΜ繝ウ繧ッ蜈縺ョURL縲√Μ繝ウ繧ッ蜈医ョURL縲∬。ィ遉コ逕ィ縺ョ繝ゥ繝吶Ν縲∽ソ。鬆シ蠎ヲ縺ョ鬆縺ァ蠑墓焚繧呈欠螳壹@縺セ縺吶

estcall setlink -auth mikio oikim http://localhost:1978/node/test1 \
  http://localhost:1978/node/test2 TEST02 8000

縺ァ縺ッ縺セ縺滓、懃エ「縺励※縺ソ縺セ縺励g縺縲ゆサ雁コヲ縺ッ-dpt繧ェ繝励す繝ァ繝ウ縺ァ繝。繧ソ讀懃エ「縺ョ豺ア蠎ヲ繧呈欠螳壹@縺セ縺吶

estcall search -dpt 1 http://localhost:1978/node/test1 "girl"

test1縲阪↓蟇セ縺励※讀懃エ「縺励◆縺ョ縺ォ縲√test2縲阪ョ邨先棡繧ゅ槭シ繧ク縺輔l縺ヲ陦ィ遉コ縺輔l縺セ縺吶ゅ%繧後′P2P蝙九ョ繝。繧ソ讀懃エ「縺ァ縺吶ゅtest1縲阪→縲test2縲阪′蛻・縲縺ョ繧ウ繝ウ繝斐Η繝シ繧ソ縺ォ縺ゅl縺ー縲∝謨」蜃ヲ逅縺後〒縺阪k繧上¢縺ァ縺吶

繝ェ繝ウ繧ッ縺ョ菫。鬆シ蠎ヲ繧帝ォ倥¥縺吶k縺ィ縲√Μ繝ウ繧ッ蜈医ョ繝弱シ繝峨′霑斐@縺溽オ先棡縺ョ譁ケ縺瑚。ィ遉コ鬆菴阪′荳翫′繧翫∪縺吶ゆサ・荳九ョ繧ウ繝槭Φ繝峨r螳溯。後@縺ヲ縺九i縲∝医⊇縺ゥ縺ィ蜷後§繧ウ繝槭Φ繝峨〒讀懃エ「縺励※縺ソ縺ヲ縺上□縺輔>縲ゅ■繧繧薙→鬆菴阪′蜈・繧梧崛繧上▲縺ヲ縺縺セ縺吶h縺ュ縲

estcall setlink -auth mikio oikim http://localhost:1978/node/test1 \
  http://localhost:1978/node/test2 TEST02 12000

讀懃エ「邨先棡繧湛ML蠖「蠑上〒蜿門セ励☆繧九%縺ィ繧ゅ〒縺阪∪縺吶ゆサ・荳九ョ繧ウ繝槭Φ繝峨r螳溯。後@縺ヲ縺ソ縺ヲ縺上□縺輔>縲9ML縺ョ隧ウ縺励>譖ク蠑上↓縺、縺縺ヲ縺ッestresult.dtd繧偵#隕ァ縺上□縺輔>縲

estcall search -dpt 1 -vx http://localhost:1978/node/test1 "girl"

繧ウ繝槭Φ繝峨Λ繧、繝ウ縺ァ讀懃エ「縺励※繧ょ、ァ縺励※髱「逋ス縺上↑縺縺ァ縺吶h縺ュ縲ゅ〒繧ゅ√ヮ繝シ繝峨し繝シ繝舌↓縺ッWeb繝悶Λ繧ヲ繧カ縺ァ讀懃エ「縺ァ縺阪k繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ繧ょ阡オ縺輔l縺ヲ縺縺セ縺吶ゅhttp://localhost:1978/node/test1/search_ui縲阪↓繧「繧ッ繧サ繧ケ縺励※縺ソ縺ヲ縺上□縺輔>縲り。ィ遉コ縺輔l縺溽判髱「縺ァ縲√phrase縲阪ョ谺縺ォ讀懃エ「隱槭r蜈・繧後※縺九i縲√search縲阪懊ち繝ウ繧呈款縺帙ー讀懃エ「縺ァ縺阪∪縺吶ゅdepth縲阪ョ謨ー繧貞「励d縺帙ー繝。繧ソ讀懃エ「繧ゅ〒縺阪∪縺吶ょキヲ蛛エ縺ォ陦ィ遉コ縺輔l縺溘Μ繝ウ繧ッ繧帝∈謚槭☆繧九→縲√◎縺ョ繝弱シ繝峨r襍キ轤ケ縺ォ縺励※蜀肴、懃エ「縺瑚。後o繧後∪縺吶

繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ髢狗匱

譁譖ク繝峨Λ繝輔ヨ蠖「蠑上ョ繝繝シ繧ソ繧剃ス懊k縺ョ縺ッ髱「蛟偵¥縺輔>縺励∽サ伜ア槭ョ讀懃エ「逕ィ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ繧ゅ■繧縺」縺ィ貂九>諢溘§縺九b縺励l縺セ縺帙s縲ゅ&縺ヲ縲√%縺薙°繧牙医ッ縺ゅ↑縺溘ョ蜃コ逡ェ縺ァ縺吶estcall繧ウ繝槭Φ繝峨d繝弱シ繝陰PI繧剃スソ縺」縺ヲ蟆冗イ九↑繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ繧剃ス懊▲縺ヲ縺ソ縺ヲ縺上□縺輔>縲ゅ%縺ョ繧ャ繧、繝峨ョ谿九j縺ョ鬆逶ョ縺ァ縺ッ縲√◎縺ョ縺溘a縺ョ繝弱え繝上え縺ォ縺、縺縺ヲ隱ャ譏弱@縺セ縺吶


繝弱シ繝峨槭せ繧ソ逕ィ繧ウ繝槭Φ繝

繝弱シ繝峨槭せ繧ソ繧堤ョ。逅縺吶k縺溘a縺ョ繧ウ繝槭Φ繝峨→縺励※縲estmaster縲阪′謠蝉セ帙&繧後∪縺吶ゅ%縺薙〒縺ッ縺昴ョ莉墓ァ倥r隱ャ譏弱@縺セ縺吶

譖ク蠑

estmaster縺ッ螟壹¥縺ョ繧オ繝悶さ繝槭Φ繝峨ョ髮蜷井ス薙〒縺吶ゅし繝悶さ繝槭Φ繝峨ョ蜷榊燕縺ッ隨ャ1蠑墓焚縺ァ謖螳壹&繧後∪縺吶ゅ◎縺ョ莉悶ョ蠑墓焚縺ッ繧オ繝悶さ繝槭Φ繝峨ョ遞ョ鬘槭↓蠢懊§縺ヲ隗」驥医&繧後∪縺吶rootdir縺ィ縺縺蠑墓焚縺ッ繧オ繝シ繝舌Ν繝シ繝医ョ繧」繝ャ繧ッ繝医Μ縺ョ繝代せ縺ァ縺吶ゅし繝シ繝舌Ν繝シ繝医ョ繧」繝ャ繧ッ繝医Μ縺ィ縺ッ縲√ヮ繝シ繝峨槭せ繧ソ縺ョ蜍穂ス懊↓蠢隕√↑險ュ螳壹ヵ繧。繧、繝ォ縺ェ縺ゥ繧呈シ邏阪☆繧九ョ繧」繝ャ繧ッ繝医Μ繝繝ェ繝シ縺ョ繝医ャ繝励ョ縺薙→縺ァ縺吶

estmaster init [-ex] rootdir
繧オ繝シ繝舌Ν繝シ繝医ョ繧」繝ャ繧ッ繝医Μ繧剃ス懈舌@縺セ縺吶
-ex繧剃サ倥¢繧九→縲√し繝ウ繝励Ν縺ョ繝ヲ繝シ繧カ縺ィ繝弱シ繝峨r菴懈舌@縺セ縺吶ゅョ繝輔か繝ォ繝医〒縺ッ縲√Θ繝シ繧カ蜷阪→繝代せ繝ッ繝シ繝峨′縺ィ繧ゅ↓縲径dmin縲阪〒縺ゅk繧ケ繝シ繝代シ繝ヲ繝シ繧カ縺ョ縺ソ縺御ス懈舌&繧後∪縺吶
estmaster start [-bg] [-ro] [-st] rootdir
繝弱シ繝峨槭せ繧ソ繧定オキ蜍輔@縺セ縺吶
-bg繧偵▽縺代k縺ィ縲√ョ繝シ繝「繝ウ繝励Ο繧サ繧ケ縺ィ縺励※繝舌ャ繧ッ繧ー繝ゥ繧ヲ繝ウ繝峨〒螳溯。後@縺セ縺吶
-ro繧偵▽縺代k縺ィ縲∬ィュ螳壹↓縺九°繧上i縺夊ェュ縺ソ霎シ縺ソ蟆ら畑繝「繝シ繝峨〒蜍穂ス懊@縺セ縺吶
-st繧偵▽縺代k縺ィ縲√槭Ν繝√せ繝ャ繝繝峨r菴ソ繧上★縺ォ繧キ繝ウ繧ー繝ォ繧ケ繝ャ繝繝峨〒蜍穂ス懊@縺セ縺吶
estmaster stop rootdir
襍キ蜍穂クュ縺ョ繝弱シ繝峨槭せ繧ソ繧堤オゆコ縺輔○縺セ縺吶
estmaster unittest rootdir
繝ヲ繝九ャ繝医ユ繧ケ繝医r陦後>縺セ縺吶
estmaster crypt key [hash]
謖螳壹@縺滓枚蟄怜励ョ證怜捷逕ィ繝上ャ繧キ繝・蛟、繧貞コ蜉帙@縺セ縺吶
key縺ッ蜃ヲ逅蟇セ雎。縺ョ譁蟄怜励r謖螳壹@縺セ縺吶
hash繧呈欠螳壹☆繧九→縲√く繝シ縺ィ繝上ャ繧キ繝・縺悟ッセ蠢懊☆繧九°縺ゥ縺縺九r蛻、螳壹@縺セ縺吶

蜈ィ縺ヲ縺ョ繧オ繝悶さ繝槭Φ繝峨ッ縲∝ヲ逅縺梧ュ」蟶ク縺ォ邨ゆコ縺励◆蝣エ蜷医↓縺ッ0繧偵√◎縺縺ァ縺ェ縺蝣エ蜷医ッ1繧堤オゆコ繧ケ繝繝シ繧ソ繧ケ縺ォ縺励∪縺吶りオキ蜍穂クュ縺ョ繝弱シ繝峨槭せ繧ソ縺ォ1シSIGHUPシ峨2シSIGINTシ峨3シSIGQUITシ峨15シSIGTERMシ峨ョ縺ゥ繧後°縺ョ繧キ繧ー繝翫Ν繧帝√k縺薙→縺ォ繧医j縲√ョ繝シ繧ソ繝吶シ繧ケ繧帝哩縺倥※豁」蟶ク邨ゆコ縺輔○繧九%縺ィ縺後〒縺阪∪縺吶ゅョ繝シ繝「繝ウ縺ィ縺励※遞シ蜒堺クュ縺ョ繝弱シ繝峨槭せ繧ソ縺ョ蝣エ蜷医ッ縲√す繧ー繝翫Ν1シSIGHUPシ峨r騾√k縺薙→縺ォ繧医j縲∝崎オキ蜍輔@縺ヲ險ュ螳壹ヵ繧。繧、繝ォ繧定ェュ縺ソ霎シ縺ソ逶エ縺輔○繧九%縺ィ縺後〒縺阪∪縺吶

繝弱シ繝峨槭せ繧ソ繧堤オゆコ縺輔○繧九↓縺ッ繧ウ繝槭Φ繝峨Λ繧、繝ウ縺ォ繧医k譁ケ豕輔d蠕瑚ソー縺ョ繝阪ャ繝医Ρ繝シ繧ッ邨檎罰縺ォ繧医k譁ケ豕輔′縺ゅj縺セ縺吶′縲√>縺壹l縺ォ縺帙h縲∝ソ縺夊ヲ丞ョ壹ョ謇矩縺ァ邨ゆコ縺輔○縺ヲ縺上□縺輔>縲ゅ&繧ゅ↑縺上ー繧、繝ウ繝繝繧ッ繧ケ縺ョ繝繝シ繧ソ縺悟」翫l繧句庄閭ス諤ァ縺後≠繧翫∪縺吶

繧オ繝シ繝舌Ν繝シ繝医ョ繧」繝ャ繧ッ繝医Μ縺ョ讒区

繧オ繝シ繝舌Ν繝シ繝医ョ繧」繝ャ繧ッ繝医Μ縺ッ莉・荳九ョ繝輔ぃ繧、繝ォ繧繝繧」繝ャ繧ッ繝医Μ繧呈シ邏阪@縺ヲ縺縺セ縺吶

  • _conf : 險ュ螳壹ヵ繧。繧、繝ォ縲りゥウ邏ー縺ッ蠕瑚ソー縺励∪縺吶
  • _user : 繝ヲ繝シ繧カ繧「繧ォ繧ヲ繝ウ繝医ヵ繧。繧、繝ォ縲りゥウ邏ー縺ッ蠕瑚ソー縺励∪縺吶
  • _log : 繝ュ繧ー繝輔ぃ繧、繝ォ縲ゅし繝シ繝舌ョ繧、繝吶Φ繝医Ο繧ー繧蜷繧ッ繝ゥ繧、繧「繝ウ繝医ョ繧「繧ッ繧サ繧ケ繝ュ繧ー繧定ィ倬鹸縺励∪縺吶
  • _meta : 繝。繧ソ繝繝シ繧ソ縺ョ繝繝シ繧ソ繝吶シ繧ケ繝輔ぃ繧、繝ォ縲る崎、襍キ蜍暮亟豁「縺ョ繝ュ繝繧ッ讖滓ァ九b蜈シ縺ュ縺セ縺吶
  • _pid : 繝励Ο繧サ繧ケID繝輔ぃ繧、繝ォ縲りオキ蜍穂クュ縺ョ繝弱シ繝峨槭せ繧ソ縺ョ繝励Ο繧サ繧ケID縺梧嶌縺九l縺セ縺吶
  • _stop : 蛛懈ュ「謖遉コ逕ィ繝輔ぃ繧、繝ォ縲ゅ%縺ョ繝輔ぃ繧、繝ォ縺後≠繧九→繝弱シ繝峨槭せ繧ソ縺ッ閾ェ蛻縺ァ蛛懈ュ「縺励h縺縺ィ縺励∪縺吶
  • _dfdb : 譁譖ク鬆サ蠎ヲ繝繝シ繧ソ繝吶シ繧ケ縺ョ繝輔ぃ繧、繝ォ縲ゅ%縺ョ繝輔ぃ繧、繝ォ縺後≠繧後ー譁譖ク鬆サ蠎ヲ縺ョ險育ョ励↓蛻ゥ逕ィ縺輔l縺セ縺吶
  • _node/ : 繝弱シ繝峨ョ繧」繝ャ繧ッ繝医Μ縲ょ推繝弱シ繝峨ョ霆「鄂ョ繧、繝ウ繝繝繧ッ繧ケ繧呈シ邏阪@縺セ縺吶
  • _sess/ : 繧サ繝繧キ繝ァ繝ウ繝繧」繝ャ繧ッ繝医Μ縲ょ推繝ヲ繝シ繧カ縺ョ繧サ繝繧キ繝ァ繝ウ諠蝣ア繧呈シ邏阪@縺セ縺吶ら樟迥カ縺ァ縺ッ譛ェ菴ソ逕ィ縺ァ縺吶

險ュ螳壹ヵ繧。繧、繝ォ繧繝ヲ繝シ繧カ繧「繧ォ繧ヲ繝ウ繝医ッ莉サ諢上ョ繧ィ繝繧」繧ソ縺ァ譖ク縺肴鋤縺医k縺薙→縺後〒縺阪∪縺吶ゅ◆縺縺励√Θ繝シ繧カ繧「繧ォ繧ヲ繝ウ繝医ヵ繧。繧、繝ォ縺ッ襍キ蜍穂クュ縺ョ繝弱シ繝峨槭せ繧ソ縺悟●豁「縺吶k髫帙↓譖エ譁ー縺輔l縺セ縺吶ョ縺ァ縲√Θ繝シ繧カ繧「繧ォ繧ヲ繝ウ繝医ヵ繧。繧、繝ォ縺ョ邱ィ髮縺ッ繝弱シ繝峨槭せ繧ソ繧呈ュ「繧√※縺九i陦後▲縺ヲ縺上□縺輔>縲

estcmd縺ァ菴懈舌@縺溘ョ繝シ繧ソ繝吶シ繧ケ繧偵ヮ繝シ繝峨ョ繧」繝ャ繧ッ繝医Μ縺ォ蜈・繧後※縺九i繝弱シ繝峨槭せ繧ソ繧定オキ蜍輔☆繧九→縲√◎縺ョ繝繝シ繧ソ繝吶シ繧ケ繧偵ヮ繝シ繝峨→縺励※蛻ゥ逕ィ縺吶k縺薙→縺後〒縺阪k繧医≧縺ォ縺ェ繧翫∪縺吶

險ュ螳壹ヵ繧。繧、繝ォ

險ュ螳壹ヵ繧。繧、繝ォ縺ッ縲∝、画焚蜷阪→蛟、繧偵:縲阪〒蛹コ蛻縺」縺溷ス「蠑上ョ陦後r荳ヲ縺ケ縺溘b縺ョ縺ァ縺吶ゅョ繝輔か繝ォ繝医〒縺ッ縲∬ィュ螳壹ヵ繧。繧、繝ォ縺ッ莉・荳九ョ繧医≧縺ェ蜀螳ケ縺ォ縺ェ縺」縺ヲ縺縺セ縺吶

bindaddr: 0.0.0.0
portnum: 1978
publicurl:
runmode: 1
authmode: 2
recvmax: 1024
maxconn: 30
idleflush: 20
idlesync: 300
sessiontimeout: 600
searchtimeout: 15
searchmax: 1000
searchdepth: 5
rateuri: 1
mergemethod: 2
proxyhost:
proxyport:
logfile: _log
loglevel: 2
backupcmd:
scalepred: 2
scoreexpr: 2
attrindex: @mdate{{!}}seq
attrindex: @title{{!}}str
docroot:
indexfile:
trustednode:
denyuntrusted: 0
cachesize: 64
cacheanum: 8192
cachetnum: 1024
cachernum: 256
specialcache:
helpershift: 0.9
wildmax: 256
limittextsize: 128
snipwwidth: 480
sniphwidth: 96
snipawidth: 96
scancheck: 1
smlrvnum: 32
extdelay: 4096
adminemail: magnus@hyperestraier.gov
uireplace: ^file:///home/mikio/public_html/{{!}}http://localhost/
uireplace: /index\.html?${{!}}/
uiextattr: @author|Author
uiextattr: @mdate|Modification Date
uiphraseform: 2
uismlrtune: 16 1024 4096

縺昴l縺槭l縺ョ螟画焚縺ョ讖溯ス繧剃サ・荳九↓遉コ縺励∪縺吶

  • bindaddr : 繧オ繝シ繝舌ョ繧「繝峨Ξ繧ケ繧呈欠螳壹@縺セ縺吶0.0.0.0縺ッ繝帙せ繝医ョ蜈ィ縺ヲ縺ョ繧「繝峨Ξ繧ケ繧呈э蜻ウ縺励∪縺吶
  • portnum : 繧オ繝シ繝舌ョ繝昴シ繝育分蜿キ繧呈欠螳壹@縺セ縺吶
  • publicurl : 繧オ繝シ繝舌ョ蜈ャ髢偽RL繧堤オカ蟇セURL縺ァ謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医〒縺ッ縲"http://"縲√帙せ繝亥錐縲":"縲√昴シ繝育分蜿キ縺九i逕滓舌&繧後∪縺吶
  • runmode : 驕狗畑繝「繝シ繝峨r謖螳壹@縺セ縺吶1縺ッ騾壼クク繝「繝シ繝峨2縺ッ隱ュ縺ソ霎シ縺ソ蟆ら畑繝「繝シ繝峨〒縺吶
  • authmode : 隱崎ィシ繝「繝シ繝峨r謖螳壹@縺セ縺吶1縺ッ隱崎ィシ繧剃ク蛻縺励↑縺繝「繝シ繝峨2縺ッ邂。逅讖溯ス縺ョ縺ソ縺ァ隱崎ィシ繧定。後≧繝「繝シ繝峨3縺ッ蜈ィ縺ヲ縺ョ謫堺ス懊〒隱崎ィシ繧定。後≧繝「繝シ繝峨〒縺吶
  • recvmax : 蜿嶺ソ。縺吶k繝繝シ繧ソ縺ョ譛螟ァ縺ョ髟キ縺輔r繧ュ繝ュ繝舌う繝亥腰菴阪〒謖螳壹@縺セ縺吶
  • maxconn : 譛螟ァ蜷梧凾謗・邯壽焚繧呈欠螳壹@縺セ縺吶
  • idleflush : 繧ュ繝」繝繧キ繝・縺ョ繝輔Λ繝繧キ繝・繧帝幕蟋九☆繧九い繧、繝峨Ν譎る俣繧堤ァ貞腰菴阪〒謖螳壹@縺セ縺吶
  • idlesync : 繝繝シ繧ソ繝吶シ繧ケ縺ィ繝繧」繧ケ繧ッ縺ョ蜷梧悄蜃ヲ逅繧帝幕蟋九☆繧九い繧、繝峨Ν譎る俣繧堤ァ貞腰菴阪〒謖螳壹@縺セ縺吶
  • sessiontimeout : 繧サ繝繧キ繝ァ繝ウ縺ョ繧ソ繧、繝繧「繧ヲ繝医r遘貞腰菴阪〒謖螳壹@縺セ縺吶よ悴螳溯」縺ァ縺吶
  • searchtimeout : 讀懃エ「蜃ヲ逅縺ョ繧ソ繧、繝繧「繧ヲ繝医r遘貞腰菴阪〒謖螳壹@縺セ縺吶
  • searchmax : 騾∽ソ。縺吶k譁譖ク縺ョ譛螟ァ謨ー繧呈欠螳壹@縺セ縺吶
  • searchdepth : 繝。繧ソ讀懃エ「縺ョ譛螟ァ豺ア蠎ヲ繧呈欠螳壹@縺セ縺吶
  • rateuri : 豁」謨ー縺ェ繧峨せ繧ウ繧「繝ェ繝ウ繧ー縺ョ髫帙↓URI繧定ゥ穂セ。縺励∪縺吶
  • mergemethod : 繝。繧ソ讀懃エ「縺ョ邨先棡縺ョ繝槭シ繧ク譁ケ豕輔r謖螳壹@縺セ縺吶1縺ェ繧峨せ繧ウ繧「縺ョ縺ソ繧堤畑縺縲2縺ェ繧峨せ繧ウ繧「縺ィ鬆菴阪r逕ィ縺縲3縺ェ繧蛾菴阪ョ縺ソ繧堤畑縺縺セ縺吶
  • proxyhost : 繝励Ο繧ッ繧キ繧オ繝シ繝舌ョ繝帙せ繝亥錐繧呈欠螳壹@縺セ縺吶
  • proxyport : 繝励Ο繧ッ繧キ繧オ繝シ繝舌ョ繝昴シ繝育分蜿キ繧呈欠螳壹@縺セ縺吶
  • logfile : 繝ュ繧ー繝輔ぃ繧、繝ォ縺ョ蜷榊燕繧呈欠螳壹@縺セ縺吶らオカ蟇セ繝代せ縺狗嶌蟇セ繝代せ縺ァ謖螳壹@縺セ縺吶
  • loglevel : 繝ュ繧ー縺ョ繝ャ繝吶Ν繧呈欠螳壹@縺セ縺吶1縺ェ繧峨ョ繝舌ャ繧ー縲2縺ェ繧蛾壼クク縲3縺ェ繧芽ュヲ蜻翫4縺ェ繧峨お繝ゥ繝シ縲5縺ェ繧臥┌縺励〒縺吶
  • docroot : 騾壼クク縺ョWeb繧オ繝シ繝舌→縺励※蜈ャ髢九☆繧九ョ繧」繝ャ繧ッ繝医Μ縺ョ邨カ蟇セ繝代せ繧呈欠螳壹@縺セ縺吶
  • backupcmd : 繝舌ャ繧ッ繧「繝繝励↓逕ィ縺繧九さ繝槭Φ繝峨ョ邨カ蟇セ繝代せ繧呈欠螳壹@縺セ縺吶
  • scalepred : 蜷繝弱シ繝峨ョ繧、繝ウ繝繝繧ッ繧ケ縺ョ隕乗ィ。縺ォ蟇セ縺吶k莠域クャ繧呈欠螳壹@縺セ縺吶1縺ェ繧50000莉カ譛ェ貅縲2縺ェ繧300000莉カ譛ェ貅縲3縺ェ繧1000000莉カ譛ェ貅縲4縺ェ繧峨◎繧御サ・荳翫〒縺吶
  • scoreexpr : 繧ケ繧ウ繧「縺ョ陦ィ迴セ譁ケ豕輔r謖螳壹@縺セ縺吶1縺ェ繧峨せ繧ウ繧「繧堤エ譽縺励2縺ェ繧8繝薙ャ繝医〒菫晄戟縺励3縺ェ繧32繝薙ャ繝医〒菫晄戟縺励4縺ェ繧画悴隱ソ謨エ縺ァ菫晄戟縺励∪縺吶
  • attrindex : 螻樊ァ繧、繝ウ繝繝繧ッ繧ケ縺ョ螻樊ァ蜷阪→繝繝シ繧ソ蝙九r謖螳壹@縺セ縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • indexfile : 騾壼クク縺ョWeb繧オ繝シ繝舌→縺励※蜈ャ髢九☆繧矩圀縺ョ繝繧」繝ャ繧ッ繝医Μ縺ョ繧、繝ウ繝繝繧ッ繧ケ繝輔ぃ繧、繝ォ縺ョ蜷榊燕繧呈欠螳壹@縺セ縺吶ゆク崎ヲ√↑繧臥ゥコ譁蟄怜励↓縺励∪縺吶
  • trustednode : 隱崎ィシ繧堤怐逡・縺吶k繝弱シ繝会シ医け繝ゥ繧、繧「繝ウ繝茨シ峨ョIP繧「繝峨Ξ繧ケ繧10騾イ謨ー繝峨ャ繝井サ倥″陦ィ險倥〒謖螳壹@縺セ縺吶り、謨ー蝗樊欠螳壼庄閭ス縺ァ縺吶
  • denyuntrusted : 豁」謨ー縺ェ繧我ク願ィ倥ョ繝弱シ繝我サ・螟悶°繧峨ョ繧「繧ッ繧サ繧ケ繧呈拠邨カ縺励∪縺吶
  • cachesize : 繧、繝ウ繝繝繧ッ繧ケ逕ィ繧ュ繝」繝繧キ繝・縺ョ繧オ繧、繧コ繧偵Γ繧ャ繝舌う繝亥腰菴阪〒謖螳壹@縺セ縺吶
  • cacheanum : 譁譖ク縺ョ螻樊ァ逕ィ縺ョ繧ュ繝」繝繧キ繝・縺ョ繝ャ繧ウ繝シ繝画焚繧呈欠螳壹@縺セ縺吶
  • cachetnum : 譁譖ク縺ョ繝繧ュ繧ケ繝育畑縺ョ繧ュ繝」繝繧キ繝・縺ョ繝ャ繧ウ繝シ繝画焚繧呈欠螳壹@縺セ縺吶
  • cachernum : 蜃コ迴セ邨先棡逕ィ縺ョ繧ュ繝」繝繧キ繝・縺ョ繝ャ繧ウ繝シ繝画焚繧呈欠螳壹@縺セ縺吶
  • specialcache : 繧ケ繝壹す繝」繝ォ繧ュ繝」繝繧キ繝・縺ョ螻樊ァ蜷阪r謖螳壹@縺セ縺吶
  • helpershift : 繝倥Ν繝代r逕ィ縺繧倶ク矩剞縺ョ繧ュ繝」繝繧キ繝・菴ソ逕ィ邇繧呈欠螳壹@縺セ縺吶
  • wildmax : 繝ッ繧、繝ォ繝峨き繝シ繝牙ア暮幕縺ョ譛螟ァ隱樊焚繧呈欠螳壹@縺セ縺吶
  • limittextsize : 逋サ骭イ譁譖ク縺ョ繝繧ュ繧ケ繝医ョ繧オ繧、繧コ蛻カ髯舌r繧ュ繝ュ繝舌う繝亥腰菴阪〒謖螳壹@縺セ縺吶
  • snipwwidth : 讀懃エ「邨先棡縺ョ繧ケ繝九壹ャ繝医ョ蜈ィ菴薙ョ蟷繧呈欠遉コ縺励∪縺吶
  • sniphwidth : 讀懃エ「邨先棡縺ョ繧ケ繝九壹ャ繝医r菴懊k髫帙↓譁譖ク縺ョ蜀帝ュ縺九i蜿門セ励☆繧句ケ繧呈欠遉コ縺励∪縺吶
  • snipawidth : 讀懃エ「邨先棡縺ョ繧ケ繝九壹ャ繝医r菴懊k髫帙↓讀懃エ「隱槭ョ蜻ィ霎コ縺九i蜿門セ励☆繧句ケ繧呈欠遉コ縺励∪縺吶
  • scancheck : 豁」謨ー縺ェ繧画枚譖ク縺ョ蜀螳ケ縺ィ讀懃エ「繝輔Ξ繝シ繧コ縺ョ邊セ蟇讀懈渊繧偵@縺セ縺吶
  • smlrvnum : 鬘樔シシ讀懃エ「縺ョ繝吶け繝医Ν縺ョ谺。蜈謨ー繧呈欠螳壹@縺セ縺吶0縺ェ繧蛾。樔シシ讀懃エ「縺檎┌蜉ケ縺ォ縺ェ繧翫∪縺吶
  • extdelay : 鬘樔シシ讀懃エ「縺ョ繝吶け繝医Ν謚ス蜃コ繧帝≦蟒カ縺輔○繧区枚譖ク謨ー繧呈欠螳壹@縺セ縺吶りイ謨ー繧呈欠螳壹☆繧九→縲驕蟒カ縺ェ縺励〒蠖「諷狗エ隗」譫舌r驕ゥ逕ィ縺励∪縺吶
  • adminemail : 繧オ繧、繝育ョ。逅閠縺ョ髮サ蟄舌Γ繝シ繝ォ繧「繝峨Ξ繧ケ繧呈欠螳壹@縺セ縺吶
  • uireplace : 繝ヲ繝シ繧カ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縺ァ陦ィ遉コ縺吶kURI繧貞、画鋤縺吶k縺溘a縺ョ豁」隕剰。ィ迴セ縺ィ鄂ョ謠帶枚蟄怜励r縲{{!}}縲阪〒蛹コ蛻縺」縺ヲ謖螳壹@縺セ縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • uiextattr : 繝ヲ繝シ繧カ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縺ァ陦ィ遉コ縺吶k螻樊ァ縺ョ蜷榊燕縺ィ繝ゥ繝吶Ν繧偵|縲阪〒蛹コ蛻縺」縺ヲ謖遉コ縺励∪縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • uiphraseform : 讀懃エ「譚。莉カ蠑上ョ遞ョ鬘樊欠螳壹@縺セ縺吶1縺ェ繧蛾壼クク譖ク蠑上2縺ェ繧臥ー。萓ソ譖ク蠑上3縺ェ繧臥イ礼払譖ク蠑上4縺ェ繧芽ォ也炊蜥梧嶌蠑上5縺ェ繧芽ォ也炊遨肴嶌蠑上〒縺吶
  • uismlrtune : 繝ヲ繝シ繧カ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縺九i縺ョ鬘樔シシ讀懃エ「縺ョ繝√Η繝シ繝九Φ繧ー繝代Λ繝。繝シ繧ソ繧呈欠螳壹@縺セ縺吶ゅく繝シ繝ッ繝シ繝画焚縺ィ繧ュ繝シ繝ッ繝シ繝画ッ弱ョ譁譖ク謨ー縺ィ蜈ィ菴薙ョ蛟呵」懊ョ謨ー繧堤ゥコ逋ス蛹コ蛻繧翫〒謖螳壹@縺セ縺吶

backupcmd縺ァ謖螳壹@縺溘さ繝槭Φ繝峨ッ縲∝シ墓焚縺ィ縺励※繧オ繝シ繝舌Ν繝シ繝医ョ繧」繝ャ繧ッ繝医Μ縺ョ邨カ蟇セ繝代せ縺梧ク。縺輔l縺ヲ蜻シ縺ウ蜃コ縺輔l縺セ縺吶る壼クク縺ッ繧キ繧ァ繝ォ繧ケ繧ッ繝ェ繝励ヨ繧呈欠螳壹@縲∽ササ諢上ョ譁ケ豕輔〒繧オ繝シ繝舌Ν繝シ繝医ョ繧」繝ャ繧ッ繝医Μ縺ョ繝舌ャ繧ッ繧「繝繝励r蜿悶j縺セ縺吶

gather縺ョ縲-fx縲阪が繝励す繝ァ繝ウ縺ァ謖螳壹@縺溷、夜Κ繧ウ繝槭Φ繝峨ッ縲∫ャャ1蠑墓焚縺ォ蟇セ雎。譁譖ク縺ョ繝代せ縲∫ャャ2蠑墓焚縺ォ蜃コ蜉帛医ョ繝代せ縺梧ク。縺輔l縺ヲ蜻シ縺ウ蜃コ縺輔l縺セ縺吶ゅ☆縺ェ繧上■縲∝、夜Κ繧ウ繝槭Φ繝峨ッ隨ャ1蠑墓焚縺ョ繝輔ぃ繧、繝ォ繧定ァ」譫舌@縺ヲ譁譖ク繝峨Λ繝輔ヨ繧繝励Ξ繝シ繝ウ繝繧ュ繧ケ繝医dHTML繧МIME繧堤函謌舌@縲∫ャャ2蠑墓焚縺ョ繝輔ぃ繧、繝ォ縺ォ譖ク縺崎セシ繧縺ィ縺縺讖溯ス繧呈戟縺、縺薙→縺梧悄蠕縺輔l縺セ縺吶ゅ↑縺翫∝ッセ雎。譁譖ク縺ッ荳譎ゅヵ繧。繧、繝ォ縺ィ縺励※繧ウ繝斐シ縺輔l縺ヲ貂。縺輔l縺セ縺吶ょッセ雎。譁譖ク縺ョ蜈譚・縺ョ繝代せ縺ッ迺ー蠅螟画焚ESTORIGFILE縺ョ蛟、縺ィ縺励※貂。縺輔l縺セ縺吶′縲∵アコ縺励※蜈縺ョ繝輔ぃ繧、繝ォ繧貞、画峩縺励※縺ッ縺縺代∪縺帙s縲ESTORIGFILE繧剃スソ縺蝣エ蜷医ッ繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧蠢隕√ッ縺ゅj縺セ縺帙s縺ョ縺ァ縲√-fo縲阪が繝励す繝ァ繝ウ繧ょ酔譎ゅ↓縺、縺代k縺ィ繧医>縺ァ縺励g縺縲

ui縺ァ蟋九∪繧句錐蜑阪ョ螻樊ァ縺ッ繝ヲ繝シ繧カ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縺ォ縺ョ縺ソ蜿肴丐縺輔l縺セ縺吶API繧剃スソ縺蝣エ蜷医ッ縲uireplace縺ォ繧医▲縺ヲ陦ィ遉コ譎ゅ↓URL繧貞刈蟾・縺吶k縺薙→縺ッ縺ァ縺阪∪縺帙s縺ョ縺ァ縲∫匳骭イ譎ゅ↓螟夜Κ逕ィURI繧貞推譁譖ク縺ョ螻樊ァ縺ィ縺励※縺、縺代k繧医≧縺ォ縺励※縺上□縺輔>縲

繝ヲ繝シ繧カ繧「繧ォ繧ヲ繝ウ繝医ヵ繧。繧、繝ォ

繝ヲ繝シ繧カ繧「繧ォ繧ヲ繝ウ繝医ヵ繧。繧、繝ォ縺ッ縲√Θ繝シ繧カ蜷阪∵囓蜿キ蛹悶&繧後◆繝代せ繝ッ繝シ繝峨√ヵ繝ゥ繧ー縲√ヵ繝ォ繝阪シ繝縲髮大、壹↑諠蝣ア繧偵ち繝門玄蛻繧翫〒荳ヲ縺ケ縺溯。後r荳ヲ縺ケ縺溘b縺ョ縺ァ縺吶よ枚蟄励さ繝シ繝峨ッUTF-8縺ァ縺吶ゅョ繝輔か繝ォ繝医〒縺ッ莉・荳九ョ繧医≧縺ェ蜀螳ケ縺ォ縺ェ縺」縺ヲ縺縺セ縺吶

admin   21232f297a57a5a743894a0e4a801fc3        s       Carolus Magnus  Administrator

繝代せ繝ッ繝シ繝峨ッMD5縺ョ繝上ャ繧キ繝・蛟、縺ァ陦ィ迴セ縺輔l縺セ縺吶ゅヵ繝ゥ繧ー縺ォ縺ッ縲∫ョ。逅閠縺ァ縺ゅk縺薙→繧堤、コ縺吶s縲阪→繧「繧ッ繧サ繧ケ遖∵ュ「閠縺ァ縺ゅk縺薙→繧堤、コ縺吶b縲阪r逕ィ縺繧九%縺ィ縺後〒縺阪∪縺吶ゅヵ繝ゥ繧ー縺ィ繝輔Ν繝阪シ繝縺ィ髮大、壹↑諠蝣ア縺ッ逵∫払蜿ッ閭ス縺ァ縺吶

蜀阡オ繝ヲ繝シ繧カ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ

Web繝悶Λ繧ヲ繧カ縺ァ縲√ヮ繝シ繝峨槭せ繧ソ縺ョ逶ク蟇セURL縲/master_ui縲阪↓繧「繧ッ繧サ繧ケ縺吶k縺ィ縲∫ョ。逅逕ィ縺ョ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ繧剃スソ縺縺薙→縺後〒縺阪∪縺吶らョ。逅逕ィ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ繧剃スソ縺縺ォ縺ッ縲√せ繝シ繝代シ繝ヲ繝シ繧カ縺ョ繧「繧ォ繧ヲ繝ウ繝医〒繝ュ繧ー繧、繝ウ縺吶k蠢隕√′縺ゅj縺セ縺吶

Web繝悶Λ繧ヲ繧カ縺ァ縲√ヮ繝シ繝峨し繝シ繝舌ョURL縺ョ蠕後m縺ォ縲/search_ui縲阪r縺、縺代◆URL縺ォ繧「繧ッ繧サ繧ケ縺吶k縺ィ縲∵、懃エ「逕ィ縺ョ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ繧剃スソ縺縺薙→縺後〒縺阪∪縺吶よ、懃エ「邨先棡縺ョ逕サ髱「縺ァ縲√LINK#1縲阪→縺縺」縺溘Λ繝吶Ν縺ァ陦ィ遉コ縺輔l繧九ョ縺ッ縲∫樟蝨ィ縺ョ繝弱シ繝峨°繧峨Μ繝ウ繧ッ縺輔l縺滉サ悶ョ繝弱シ繝峨〒縺吶ゅΜ繝ウ繧ッ繧帝∈謚槭☆繧九→縲√◎縺ョ繝弱シ繝峨r荳ュ蠢縺ィ縺励※蜀肴、懃エ「縺瑚。後o繧後∪縺吶ゅ%繧後r菴ソ縺」縺ヲ髢「騾」縺励◎縺縺ェ繝弱シ繝峨r谺。縲縺ィ繝悶Λ繧ヲ繧コ縺励※縺縺上%縺ィ縺ァ縲∫岼逧縺ョ譁譖ク繧呈爾縺吶%縺ィ縺後〒縺阪∪縺吶

讀懃エ「邨先棡縺ョ逕サ髱「縺ァ縲√Atom縲阪d縲RSS縲阪→縺縺繝ェ繝ウ繧ッ繧帝∈謚槭☆繧九→縲√◎縺ョ讀懃エ「邨先棡繧帝堺ソ。縺吶k縺溘a縺ョAtom蠖「蠑上∪縺溘ッRSS蠖「蠑上ョ繝繝シ繧ソ縺悟セ励i繧後∪縺吶ゅ%縺ョ繝ェ繝ウ繧ッ縺ョURL繧但tom 1.0縺騎SS 1.0縺ォ蟇セ蠢懊@縺溘い繝励Μ繧ア繝シ繧キ繝ァ繝ウシRSS繝ェ繝シ繝シ峨↓逋サ骭イ縺吶k縺ィ縲∝ョ壽悄逧縺ォ讀懃エ「邨先棡繧堤屮隕悶@縺ヲ縲∝、牙喧縺後≠縺」縺溷エ蜷医↓騾夂衍縺輔○繧九%縺ィ縺後〒縺阪∪縺吶

Google繧Цikipedia縺ェ縺ゥ縺ョ螟壹¥縺ョ繧オ繧、繝医→騾」謳コ縺励◆繝。繧ソ讀懃エ「繧定。後≧縺溘a縺ョOpenSearch縺ィ縺縺隕乗シ縺後≠繧翫∪縺吶ゅヮ繝シ繝峨し繝シ繝舌ッOpenSearch 1.1縺ョ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縺ォ繧ょッセ蠢懊@縺ヲ縺縺セ縺吶8eb繝悶Λ繧ヲ繧カ縺ァ縲√ヮ繝シ繝峨し繝シ繝舌ョURL縺ョ蠕後m縺ォ縲/opensearch縲阪r縺、縺代◆URL縺ォ繧「繧ッ繧サ繧ケ縺吶k縺ィ縲^penSearch Description縺ィ蜻シ縺ー繧後k繝繝シ繧ソ繧貞叙蠕励☆繧九%縺ィ縺後〒縺阪∪縺吶ゅ%繧後rOpenSearch蟇セ蠢懊ョ繧オ繧、繝医d繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ォ隱ュ縺ソ霎シ縺セ縺帙k縺薙→縺ァ縲√◎縺ョ繝弱シ繝峨r繝。繧ソ讀懃エ「縺ョ蟇セ雎。縺ォ蜷ォ繧√k縺薙→縺後〒縺阪∪縺吶


繝励Ο繝医さ繝ォ

繝弱シ繝蛾俣縺翫h縺ウ繧ッ繝ゥ繧、繧「繝ウ繝医サ繝弱シ繝蛾俣縺ョ騾壻ソ。縺ッHTTP繝吶シ繧ケ縺ョ繝励Ο繝医さ繝ォ縺ォ蝓コ縺・縺縺ヲ陦後o繧後∪縺吶ゅ%縺薙〒縺ッ縲√◎縺ョ蜈キ菴鍋噪縺ェ莉墓ァ倥↓縺、縺縺ヲ隕九※陦後″縺セ縺吶

讎りヲ

繝弱シ繝峨槭せ繧ソ縺翫h縺ウ繝弱シ繝峨し繝シ繝舌ッHTTP/1.0繧貞ョ溯」縺励※縺縺セ縺吶ら樟迥カ縺ァ縺ッ縲?TTP/1.1迚ケ譛峨ョ讖溯ス縺ァ縺ゅk繧ュ繝シ繝励い繝ゥ繧、繝匁磁邯壹d繝√Ε繝ウ繧ッ繧ィ繝ウ繧ウ繝シ繝繧」繝ウ繧ー繧蜷遞ョ縺ョ繝阪ざ繧キ繧ィ繝シ繧キ繝ァ繝ウ縺ォ縺ッ蟇セ蠢懊@縺ヲ縺縺セ縺帙s縲

HTTP縺ョ繝。繧ス繝繝峨ッGET縺ァ繧1OST縺ァ繧よァ九>縺セ縺帙s縺後∵ュ蝣ア繧貞叙蠕励☆繧九□縺代ョ蝣エ蜷医ッGET縲√ヮ繝シ繝峨槭せ繧ソ繧繝弱シ繝峨し繝シ繝舌↓譖エ譁ー縺檎匱逕溘☆繧句エ蜷医ッPOST繧剃スソ縺縺薙→縺梧耳螂ィ縺輔l縺セ縺吶ゅヱ繝ゥ繝。繝シ繧ソ縺ョ譁蟄励さ繝シ繝峨ッUTF-8縺ァ縺吶′縲ゞRL縺ォ蜷ォ繧√i繧後↑縺譁蟄励↓縺ッURL繧ィ繝ウ繧ウ繝シ繝会シapplication/x-www-form-urlencodedシ峨r譁ス縺吝ソ隕√′縺ゅj縺セ縺吶GET繝。繧ス繝繝峨〒騾√l繧九ョ繝シ繧ソ縺ョ繧オ繧、繧コ縺ッ8000繝舌う繝医∪縺ァ縺ァ縺吶ゅΘ繝シ繧カ蜷阪→繝代せ繝ッ繝シ繝峨ョ蜿励¢貂。縺励ッHTTP縺ョBasic隱崎ィシ讖滓ァ九r菴ソ縺」縺ヲ陦後o繧後∪縺吶

蜃ヲ逅縺梧仙粥縺励◆蝣エ蜷医ッ蜴溷援逧縺ォ200縺セ縺溘ッ202縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨′霑斐j縺セ縺吶ゅお繝ゥ繝シ縺ョ蝣エ蜷医ッ縲∽サ・荳九ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨′霑斐j縺セ縺吶

  • 400 : 繝代Λ繝。繝シ繧ソ縺御ク肴ュ」縺ァ縺吶
  • 401 : 隱崎ィシ諠蝣ア縺後↑縺縺九髢馴&縺」縺ヲ縺縺セ縺吶
  • 403 : 迴セ蝨ィ縺ョ繧「繧ォ繧ヲ繝ウ繝医↓縺ッ繧「繧ッ繧サ繧ケ讓ゥ髯舌′縺ゅj縺セ縺帙s縲
  • 404 : 謗・邯壼医ョ繝代せ縺悟ュ伜惠縺励∪縺帙s縲
  • 500 : 繧オ繝シ繝舌↓蜴溷屏縺後≠繧九お繝ゥ繝シ縺檎匱逕溘@縺セ縺励◆縲

讀懃エ「遲峨ョ謫堺ス懊〒縺ッ繝。繝繧サ繝シ繧ク繝懊ョ繧」縺ォ邨先棡縺ョ繝繝シ繧ソ縺悟性縺セ繧後∪縺吶ゅョ繝シ繧ソ蠖「蠑上ッUTF-8縺ョ繝繧ュ繧ケ繝医〒縺吶′縲√ち繝悶d謾ケ陦後〒讒矩蛹悶&繧後※縺繧句エ蜷医b縺ゅj縺セ縺吶よ桃菴懊ョ遞ョ鬘槭↓繧医▲縺ヲ邨先棡縺ョ隗」驥域婿豕輔ッ螟峨o繧翫∪縺吶Eeflate繧ィ繝ウ繧ウ繝シ繝繧」繝ウ繧ー縺ォ蟇セ蠢懊@縺ヲ縺繧九け繝ゥ繧、繧「繝ウ繝医↓蟇セ縺励※縺ッ縲∝悸邵ョ縺励◆繝繝シ繧ソ繧帝∽ソ。縺励∪縺吶

繝弱シ繝峨槭せ繧ソ縺ョ謫堺ス

繝弱シ繝峨槭せ繧ソ縺ォ蟇セ縺吶k謫堺ス懊ッ縲/master縲阪→縺縺繝代せ縺ォ謗・邯壹☆繧九%縺ィ縺ァ陦後>縺セ縺吶ゆセ九∴縺ー繝帙せ繝亥錐縺後skyhigh.estraier.go.jp縲阪〒繝昴シ繝医′縲8888縲阪ョ蝣エ蜷医ッ縲√http://skyhigh.estraier.go.jp:8888/master縲阪↓謗・邯壹☆繧九%縺ィ縺ォ縺ェ繧翫∪縺吶ゅヮ繝シ繝峨槭せ繧ソ縺ョ謫堺ス懊ッ繧ケ繝シ繝代シ繝ヲ繝シ繧カ縺ョ縺ソ縺瑚。後∴縺セ縺吶ゅヮ繝シ繝峨槭せ繧ソ縺ョ謫堺ス懊ッ縺縺上▽縺九ョ繧オ繝悶さ繝槭Φ繝峨°繧峨↑繧翫∪縺吶′縲√し繝悶さ繝槭Φ繝峨ョ蜷榊燕縺ッ縲action縲阪ヱ繝ゥ繝。繝シ繧ソ縺ァ謖螳壹@縺セ縺吶ゅ◎縺ョ莉悶ョ繝代Λ繝。繝シ繧ソ縺ッ繧オ繝悶さ繝槭Φ繝峨↓繧医▲縺ヲ螟峨o繧翫∪縺吶ゅヱ繝ゥ繝。繝シ繧ソ縺ョ鬆逡ェ縺ッ莉サ諢上〒縺吶

/master ? action=shutdown
繝弱シ繝峨槭せ繧ソ繧偵す繝」繝繝医ム繧ヲ繝ウ縺励∪縺吶
繝代Λ繝。繝シ繧ソ縺ッ縺ゅj縺セ縺帙s縲
謌仙粥縺吶l縺ー202縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨′霑比ソ。縺輔l縺セ縺吶
/master ? action=sync
蜈ィ縺ヲ繝弱シ繝峨ョ繝繝シ繧ソ繝吶シ繧ケ繧偵ョ繧」繧ケ繧ッ縺ィ蜷梧悄縺輔○縺セ縺吶
繝代Λ繝。繝シ繧ソ縺ッ縺ゅj縺セ縺帙s縲
謌仙粥縺吶l縺ー202縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨′霑比ソ。縺輔l縺セ縺吶
/master ? action=backup
繝繝シ繧ソ繝吶シ繧ケ繧貞酔譛溘&縺帙◆荳翫〒繝舌ャ繧ッ繧「繝繝励さ繝槭Φ繝峨r螳溯。後@縺セ縺吶
繝代Λ繝。繝シ繧ソ縺ッ縺ゅj縺セ縺帙s縲
謌仙粥縺吶l縺ー202縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨′霑比ソ。縺輔l縺セ縺吶
/master ? action=userlist
繝ヲ繝シ繧カ繧「繧ォ繧ヲ繝ウ繝医ョ繝ェ繧ケ繝医r蜿門セ励@縺セ縺吶
繝代Λ繝。繝シ繧ソ縺ッ縺ゅj縺セ縺帙s縲
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨→縺ィ繧ゅ↓TSV蠖「蠑上ョ繝ェ繧ケ繝医′霑比ソ。縺輔l縺セ縺吶ょ推陦後′蜷繝ヲ繝シ繧カ縺ョ諠蝣ア繧定。ィ縺励√Θ繝シ繧カ蜷阪∵囓蜿キ蛹悶&繧後◆繝代せ繝ッ繝シ繝峨√ヵ繝ゥ繧ー縲√ヵ繝ォ繝阪シ繝縲√◎縺ョ莉悶ョ諠蝣ア繧偵ち繝門玄蛻繧翫ョ繝輔ぅ繝シ繝ォ繝峨→縺励※陦ィ迴セ縺励∪縺吶
/master ? action=useradd & name=str & passwd=str & flags=str & fname=str & misc=str
繝ヲ繝シ繧カ繧「繧ォ繧ヲ繝ウ繝医r霑ス蜉縺励∪縺吶
name縺ッ譁ー隕上ョ繝ヲ繝シ繧カ蜷阪r謖螳壹@縺セ縺吶ょソ鬆医〒縺吶ゅΘ繝シ繧カ蜷阪↓蛻ゥ逕ィ縺ァ縺阪k譁蟄励ッUS-ASCII縺ョ闍ア謨ー蟄励→繝上う繝輔Φ縺ィ繧「繝ウ繝繝シ繧ケ繧ウ繧「縺ィ繝斐Μ繧ェ繝峨ョ縺ソ縺ァ縺吶よ里蟄倥ョ繝ヲ繝シ繧カ蜷阪→驥崎、縺励※縺縺溷エ蜷医ッ繧ィ繝ゥ繝シ縺ォ縺ェ繧翫∪縺吶
passwd縺ッ繝代せ繝ッ繝シ繝峨r謖螳壹@縺セ縺吶ょソ鬆医〒縺吶
flags縺ッ繝輔Λ繧ー繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶ゅヵ繝ゥ繧ー縺 "s" 繧貞性繧√ー邂。逅閠繝ヲ繝シ繧カ縺ィ縺ェ繧翫"b" 繧貞性繧√ー遖∵ュ「繝ヲ繝シ繧カ縺ィ縺ェ繧翫∪縺吶
fname縺ッ繝輔Ν繝阪シ繝繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶
misc縺ッ髮大、壹↑諠蝣ア繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨′霑比ソ。縺輔l縺セ縺吶
繝代せ繝ッ繝シ繝峨r騾∽ソ。縺吶k縺薙→縺ォ縺ェ繧九◆繧√√ヱ繝ゥ繝。繝シ繧ソ縺ッPOST繝。繧ス繝繝峨〒騾∽ソ。縺吶∋縺阪〒縺吶
/master ? action=userdel & name=str
繝ヲ繝シ繧カ繧「繧ォ繧ヲ繝ウ繝医r蜑企勁縺励∪縺吶
name縺ッ繝ヲ繝シ繧カ蜷阪r謖螳壹@縺セ縺吶ょソ鬆医〒縺吶
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨′霑比ソ。縺輔l縺セ縺吶
/master ? action=nodelist
繝弱シ繝峨し繝シ繝舌ョ繝ェ繧ケ繝医r蜿門セ励@縺セ縺吶
繝代Λ繝。繝シ繧ソ縺ッ縺ゅj縺セ縺帙s縲
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨→縺ィ繧ゅ↓TSV蠖「蠑上ョ繝ェ繧ケ繝医′霑比ソ。縺輔l縺セ縺吶ょ推陦後′蜷繝弱シ繝峨ョ諠蝣ア繧定。ィ縺励√ヮ繝シ繝牙錐縲√Λ繝吶Ν縲∫匳骭イ譁譖ク謨ー縲∫匳骭イ隱樊焚縲√し繧、繧コ繧偵ち繝門玄蛻繧翫ョ繝輔ぅ繝シ繝ォ繝峨→縺励※陦ィ迴セ縺励∪縺吶
/master ? action=nodeadd & name=str & label=str
繝弱シ繝峨し繝シ繝舌r霑ス蜉縺励∪縺吶
name縺ッ譁ー隕上ョ繝弱シ繝牙錐繧呈欠螳壹@縺セ縺吶ょソ鬆医〒縺吶ゅヮ繝シ繝牙錐縺ォ蛻ゥ逕ィ縺ァ縺阪k譁蟄励ッUS-ASCII縺ョ闍ア謨ー蟄励→繝上う繝輔Φ縺ィ繧「繝ウ繝繝シ繧ケ繧ウ繧「縺ィ繝斐Μ繧ェ繝峨ョ縺ソ縺ァ縺吶よ里蟄倥ョ繝弱シ繝牙錐縺ィ驥崎、縺励※縺縺溷エ蜷医ッ繧ィ繝ゥ繝シ縺ォ縺ェ繧翫∪縺吶
label縺ッ繝ゥ繝吶Ν繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶ら怐逡・縺励◆蝣エ蜷医ッ繝弱シ繝牙錐縺ィ蜷後§繝ゥ繝吶Ν縺御サ倥¢繧峨l縺セ縺吶
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨′霑比ソ。縺輔l縺セ縺吶
/master ? action=nodedel & name=str
繝弱シ繝峨し繝シ繝舌r蜑企勁縺励∪縺吶
name縺ッ繝弱シ繝牙錐繧呈欠螳壹@縺セ縺吶ょソ鬆医〒縺吶
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨′霑比ソ。縺輔l縺セ縺吶
/master ? action=nodeclr & name=str
繝弱シ繝峨し繝シ繝舌↓逋サ骭イ縺輔l縺滓枚譖ク繧貞炎髯、縺励∪縺吶
name縺ッ繝弱シ繝牙錐繧呈欠螳壹@縺セ縺吶ょソ鬆医〒縺吶
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨′霑比ソ。縺輔l縺セ縺吶ゅΘ繝シ繧カ縺ィ繝ェ繝ウ繧ッ縺ョ諠蝣ア縺ッ菫晄戟縺輔l縺セ縺吶
/master ? action=logrtt
繝ュ繧ー繝輔ぃ繧、繝ォ縺ョ繝ュ繝シ繝繝シ繧キ繝ァ繝ウ繧定。後>縺セ縺吶
繝代Λ繝。繝シ繧ソ縺ッ縺ゅj縺セ縺帙s縲
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨′霑比ソ。縺輔l縺セ縺吶よ里蟄倥ョ繝ュ繧ー繝輔ぃ繧、繝ォ縺ッ遨コ縺ォ縺ェ繧翫∝螳ケ縺ッ繝上う繝輔Φ縺ィ縲刑YYYMMDDhhmmss縲榊ス「蠑上ョ譌・莉倩。ィ迴セ繧呈磁蟆セ縺輔○縺溷錐蜑阪ョ繝輔ぃ繧、繝ォ縺ィ縺励※騾驕ソ縺輔l縺セ縺吶

繝弱シ繝峨し繝シ繝舌ョ謫堺ス

蜷繝弱シ繝峨し繝シ繝舌↓蟇セ縺吶k謫堺ス懊ッ縲/node/縲阪ョ蠕後↓繝弱シ繝牙錐繧偵▽縺代◆繝代せ縺ォ謗・邯壹☆繧九%縺ィ縺ァ陦後>縺セ縺吶ゆセ九∴縺ー繝帙せ繝亥錐縺後skyhigh.estraier.go.jp縲阪〒繝昴シ繝医′縲8888縲阪〒繝弱シ繝牙錐縺後foo縲阪ョ蝣エ蜷医ッ縲√http://skyhigh.estraier.go.jp:8888/node/foo縲阪↓謗・邯壹☆繧九%縺ィ縺ォ縺ェ繧翫∪縺吶ゅヮ繝シ繝峨槭せ繧ソ縺ョ謫堺ス懊ッ縺縺上▽縺九ョ繧オ繝悶さ繝槭Φ繝峨°繧峨↑繧翫∪縺吶′縲√し繝悶さ繝槭Φ繝峨ョ蜷榊燕縺ッ繝弱シ繝牙錐縺ョ蠕後↓縲/縲阪r謖溘s縺ァ謖螳壹@縺セ縺吶ゅヱ繝ゥ繝。繝シ繧ソ縺ッ繧オ繝悶さ繝槭Φ繝峨↓繧医▲縺ヲ螟峨o繧翫∪縺吶ゅヱ繝ゥ繝。繝シ繧ソ縺ョ鬆逡ェ縺ッ莉サ諢上〒縺吶ゅヮ繝シ繝峨槭せ繧ソ縺ョ謫堺ス懊ッ讀懃エ「邉サ縺ィ譖エ譁ー邉サ縺ョ莠後▽縺ォ螟ァ蛻・縺ァ縺阪∪縺吶′縲∝燕閠縺ッ縺ゥ縺ョ繝ヲ繝シ繧カ縺ァ繧ょョ溯。後〒縺阪∝セ瑚縺ッ縺昴ョ繝弱シ繝峨ョ邂。逅閠縺ョ縺ソ縺悟ョ溯。後〒縺阪∪縺吶

/node/name/inform
繝弱シ繝峨ョ諠蝣ア繧貞叙蠕励@縺セ縺吶
繝代Λ繝。繝シ繧ソ縺ッ縺ゅj縺セ縺帙s縲
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨→縺ィ繧ゅ↓TSV蠖「蠑上ョ繝繝シ繧ソ縺瑚ソ比ソ。縺輔l縺セ縺吶らャャ1陦檎岼縺ッ縲√ヮ繝シ繝牙錐縲√Λ繝吶Ν縲∫匳骭イ譁譖ク謨ー縲∫匳骭イ隱樊焚縲√し繧、繧コ繧偵ち繝門玄蛻繧翫ョ繝輔ぅ繝シ繝ォ繝峨→縺励※陦ィ迴セ縺励◆繧ゅョ縺ァ縺吶らゥコ陦後r謖溘s縺ァ縲∵ャ。縺ョ遨コ陦後∪縺ァ縺ョ蜷陦後ッ邂。逅閠縺ョ繝ヲ繝シ繧カ蜷阪ョ繝ェ繧ケ繝医〒縺吶らゥコ陦後r謖溘s縺ァ縲∵ャ。縺ョ遨コ陦後∪縺ァ縺ョ蜷陦後ッ繧イ繧ケ繝医ョ繝ヲ繝シ繧カ蜷阪ョ繝ェ繧ケ繝医〒縺吶らゥコ陦後r謖溘s縺ァ縲∽サ・髯阪ッ繝ェ繝ウ繧ッ諠蝣ア縺ョ繝ェ繧ケ繝医〒縺吶ゅΜ繝ウ繧ッ諠蝣ア縺ョ蜷陦後ッURL縺ィ繝ゥ繝吶Ν縺ィ菫。鬆シ蠎ヲ繧偵ち繝門玄蛻繧翫ョ繝輔ぅ繝シ繝ォ繝峨〒陦ィ迴セ縺励◆繧ゅョ縺ァ縺吶
/node/name/cacheusage
繝弱シ繝峨ョ繧ュ繝」繝繧キ繝・菴ソ逕ィ邇繧貞叙蠕励@縺セ縺吶
繝代Λ繝。繝シ繧ソ縺ッ縺ゅj縺セ縺帙s縲
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨→縺ィ繧ゅ↓繧ュ繝」繝繧キ繝・縺ョ菴ソ逕ィ邇繧10騾イ蟆乗焚縺ァ陦ィ迴セ縺励◆繝繝シ繧ソ縺瑚ソ比ソ。縺輔l縺セ縺吶
/node/name/search ? phrase=str & attr=str & order=str & max=num & options=num & auxiliary=num & distinct=str & depth=num & wwidth=num & hwidth=num & awidth=num & skip=num & mask=num
讀懃エ「繧貞ョ溯。後@縺セ縺吶
phrase縺ッ讀懃エ「繝輔Ξ繝シ繧コ繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶よ嶌蠑上ッ繧ウ繧「API縺ョ繧ゅョ縺ィ蜷後§縺ァ縺吶
attr縺ッ螻樊ァ譚。莉カ繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶attr1縺九iattr9繧剃スソ縺」縺ヲ隍謨ー縺ョ螻樊ァ譚。莉カ繧呈欠螳壹☆繧九%縺ィ繧ょ庄閭ス縺ァ縺吶よ嶌蠑上ッ繧ウ繧「API縺ョ繧ゅョ縺ィ蜷後§縺ァ縺吶
order縺ッ繧ス繝シ繝域擅莉カ繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶よ嶌蠑上ッ繧ウ繧「API縺ョ繧ゅョ縺ィ蜷後§縺ァ縺吶
max縺ッ蜿門セ嶺サカ謨ー繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶ゅョ繝輔か繝ォ繝医ッ10縺ァ縺吶
options縺ッ讀懃エ「譚。莉カ縺ョ繧ェ繝励す繝ァ繝ウ繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶ょ、縺ッ繧ウ繧「API縺ョ繧ゅョ縺ィ蜷後§縺ァ縺吶
auxiliary縺ッ陬懷勧繧、繝ウ繝繝繧ッ繧ケ縺ョ邨先棡繧呈治逕ィ縺吶k險ア蜿ッ繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶ゅョ繝輔か繝ォ繝医ッ32縺ァ縺吶
distinct縺ッ螻樊ァ驥崎、髯、蜴サ繝輔ぅ繝ォ繧ソ繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶
depth縺ッ繝。繧ソ讀懃エ「縺ョ豺ア蠎ヲ繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶ゅョ繝輔か繝ォ繝医ッ0縺ァ縺吶
wwidth縺ッ繧ケ繝九壹ャ繝医ョ蜈ィ菴薙ョ蟷繧呈欠遉コ縺励∪縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶ゅョ繝輔か繝ォ繝医ッ繝弱シ繝峨槭せ繧ソ縺ョ險ュ螳壹↓蠕薙>縺セ縺吶0縺ォ縺吶k縺ィ繧ケ繝九壹ャ繝医r騾∽ソ。縺励∪縺帙s縲りイ謨ー縺ォ縺吶k縺ィ繧ケ繝九壹ャ繝医ョ莉」繧上j縺ォ譛ャ譁蜈ィ菴薙r騾∽ソ。縺励∪縺吶
hwidth縺ッ繧ケ繝九壹ャ繝医r菴懊k髫帙↓譁譖ク縺ョ蜀帝ュ縺九i蜿門セ励☆繧句ケ繧呈欠遉コ縺励∪縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶ゅョ繝輔か繝ォ繝医ッ繝弱シ繝峨槭せ繧ソ縺ョ險ュ螳壹↓蠕薙>縺セ縺吶
awidth縺ッ繧ケ繝九壹ャ繝医r菴懊k髫帙↓讀懃エ「隱槭ョ蜻ィ霎コ縺九i蜿門セ励☆繧句ケ繧呈欠遉コ縺励∪縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶ゅョ繝輔か繝ォ繝医ッ繝弱シ繝峨槭せ繧ソ縺ョ險ュ螳壹↓蠕薙>縺セ縺吶
skip縺ッ蜿門セ励r繧ケ繧ュ繝繝励☆繧倶サカ謨ー繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶ゅョ繝輔か繝ォ繝医ッ0莉カ縺ァ縺吶
mask縺ッ讀懃エ「蟇セ雎。縺ョ繝槭せ繧ッ繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶1縺ッ閾ェ蛻閾ェ霄ォ縲2縺ッ1逡ェ逶ョ縺ョ繝ェ繝ウ繧ッ蜈医4縺ッ2逡ェ逶ョ縺ョ繝ェ繝ウ繧ッ蜈医8縺ッ3逡ェ逶ョ縺ョ繝ェ繝ウ繧ッ蜈医→縺縺」縺2縺ョ邏ッ荵励ョ蛟、縺ョ蜷郁ィ医〒讀懃エ「繧呈椛豁「縺吶k蟇セ雎。繧呈欠螳壹@縺セ縺吶ゅ≠繧九>縺ッ縲mask0=on縺九imask9=on縺セ縺ァ縺ョ蠑上〒謖螳壹☆繧九%縺ィ繧ゅ〒縺阪∪縺吶
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨→縺ィ繧ゅ↓讀懃エ「邨先棡縺ョ繝繝シ繧ソ縺瑚ソ比ソ。縺輔l縺セ縺吶りゥウ邏ー縺ッ蠕瑚ソー縺励∪縺吶
/node/name/list ? max=num & prev=str
譁譖ク縺ョ荳隕ァ繧貞叙蠕励@縺セ縺吶
max縺ッ蜿門セ嶺サカ謨ー繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶ゅョ繝輔か繝ォ繝医ッ10縺ァ縺吶
prev縺ッ郢ー繧願ソ斐@縺ォ縺翫¢繧句燕縺ョ隕∫エ縺ョURL繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨→縺ィ繧ゅ↓譁譖ク縺ョ荳隕ァ縺ョ繝繝シ繧ソ縺瑚ソ比ソ。縺輔l縺セ縺吶りゥウ邏ー縺ッ蠕瑚ソー縺励∪縺吶
/node/name/get_doc ? id=num & uri=str
譁譖ク縺ョ諠蝣ア繧貞叙蠕励@縺セ縺吶
id縺ッ蟇セ雎。譁譖ク縺ョID逡ェ蜿キ繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶
uri縺ッ蟇セ雎。譁譖ク縺ョURI繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨→縺ィ繧ゅ↓譁譖ク繝峨Λ繝輔ヨ蠖「蠑上ョ繝繝シ繧ソ縺瑚ソ比ソ。縺輔l縺セ縺吶
/node/name/get_doc_attr ? id=num & uri=str & attr=str
譁譖ク縺ョ螻樊ァ蛟、繧貞叙蠕励@縺セ縺吶
id縺ッ蟇セ雎。譁譖ク縺ョID逡ェ蜿キ繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶
uri縺ッ蟇セ雎。譁譖ク縺ョURI繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶
attr縺ッ螻樊ァ蜷阪r謖螳壹@縺セ縺吶ょソ鬆医〒縺吶
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨→縺ィ繧ゅ↓螻樊ァ蛟、縺ョ繝繝シ繧ソ縺瑚ソ比ソ。縺輔l縺セ縺吶
/node/name/etch_doc ? id=num & uri=str
譁譖ク縺ョ繧ュ繝シ繝ッ繝シ繝峨r謚ス蜃コ縺励∪縺吶
id縺ッ蟇セ雎。譁譖ク縺ョID逡ェ蜿キ繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶
uri縺ッ蟇セ雎。譁譖ク縺ョURI繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨→縺ィ繧ゅ↓繧ュ繝シ繝ッ繝シ繝峨→縺昴ョ繧ケ繧ウ繧「縺ョ繝繝シ繧ソ縺瑚ソ比ソ。縺輔l縺セ縺吶よ嶌蠑上ッTSV縺ァ縺吶
/node/name/uri_to_id ? uri=str
URI縺ォ蟇セ蠢懊☆繧区枚譖ク縺ョID逡ェ蜿キ繧貞叙蠕励@縺セ縺吶
uri縺ッ蟇セ雎。譁譖ク縺ョURI繧呈欠螳壹@縺セ縺吶ょソ鬆医〒縺吶
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨→縺ィ繧ゅ↓隧イ蠖捺枚譖ク縺ョID逡ェ蜿キ縺瑚ソ比ソ。縺輔l縺セ縺吶
/node/name/put_doc ? draft=str
譁譖ク繧堤匳骭イ縺励∪縺吶らョ。逅閠縺ョ縺ソ縺悟茜逕ィ縺ァ縺阪∪縺吶
draft縺ッ蟇セ雎。譁譖ク縺ョ蜀螳ケ繧呈枚譖ク繝峨Λ繝輔ヨ蠖「蠑上〒謖螳壹@縺セ縺吶ょソ鬆医〒縺吶
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨′霑比ソ。縺輔l縺セ縺吶
/node/name/out_doc ? id=num & uri=str
譁譖ク繧貞炎髯、縺励∪縺吶らョ。逅閠縺ョ縺ソ縺悟茜逕ィ縺ァ縺阪∪縺吶
id縺ッ蟇セ雎。譁譖ク縺ョID逡ェ蜿キ繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶
uri縺ッ蟇セ雎。譁譖ク縺ョURI繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨′霑比ソ。縺輔l縺セ縺吶
/node/name/edit_doc ? draft=str
譁譖ク縺ョ螻樊ァ繧堤キィ髮縺励∪縺吶らョ。逅閠縺ョ縺ソ縺悟茜逕ィ縺ァ縺阪∪縺吶
draft縺ッ蟇セ雎。譁譖ク縺ョ蜀螳ケ繧呈枚譖ク繝峨Λ繝輔ヨ蠖「蠑上〒謖螳壹@縺セ縺吶ょソ鬆医〒縺吶
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨′霑比ソ。縺輔l縺セ縺吶
/node/name/sync
繝繝シ繧ソ繝吶シ繧ケ縺ョ譖エ譁ー蜀螳ケ繧貞酔譛溘&縺帙∪縺吶らョ。逅閠縺ョ縺ソ縺悟茜逕ィ縺ァ縺阪∪縺吶
繝代Λ繝。繝シ繧ソ縺ッ縺ゅj縺セ縺帙s縲
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨′霑比ソ。縺輔l縺セ縺吶
/node/name/optimize
繝繝シ繧ソ繝吶シ繧ケ繧呈怙驕ゥ蛹悶@縺セ縺吶らョ。逅閠縺ョ縺ソ縺悟茜逕ィ縺ァ縺阪∪縺吶
繝代Λ繝。繝シ繧ソ縺ッ縺ゅj縺セ縺帙s縲
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨′霑比ソ。縺輔l縺セ縺吶
/node/name/_set_user ? name=str & mode=num
繝ヲ繝シ繧カ縺ョ繧「繧ッ繧サ繧ケ讓ゥ髯舌r險ュ螳壹@縺セ縺吶らョ。逅閠縺ョ縺ソ縺悟茜逕ィ縺ァ縺阪∪縺吶
name縺ッ繝ヲ繝シ繧カ蜷阪r謖螳壹@縺セ縺吶ょソ鬆医〒縺吶
mode縺ッ謫堺ス懷螳ケ繧呈欠螳壹@縺セ縺吶ょソ鬆医〒縺吶0縺ェ繧画欠螳壹@縺溘Θ繝シ繧カ縺ョ繧「繧ッ繧サ繧ケ讓ゥ髯舌r蜑・螂ェ縺励∪縺吶1縺ェ繧画欠螳壹@縺溘Θ繝シ繧カ繧堤ョ。逅閠縺ィ縺励※逋サ骭イ縺励∪縺吶2縺ェ繧画欠螳壹@縺溘Θ繝シ繧カ繧偵ご繧ケ繝医→縺励※逋サ骭イ縺励∪縺吶
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨′霑比ソ。縺輔l縺セ縺吶
/node/name/_set_link ? url=str & label=str & credit=num
莉悶ョ繝弱シ繝峨∈縺ョ繝ェ繝ウ繧ッ繧定ィュ螳壹@縺セ縺吶らョ。逅閠縺ョ縺ソ縺悟茜逕ィ縺ァ縺阪∪縺吶
url縺ッ繝ェ繝ウ繧ッ蜈医ョ繝弱シ繝峨し繝シ繝舌ョURL繧呈欠螳壹@縺セ縺吶ょソ鬆医〒縺吶よ里蟄倥ョ繝ェ繝ウ繧ッ縺ィ驥崎、縺励※縺縺溷エ蜷医ッ繝ゥ繝吶Ν縺ィ菫。鬆シ蠎ヲ縺悟崎ィュ螳壹&繧後∪縺吶
label縺ッ繝ェ繝ウ繧ッ蜈医ョ繝弱シ繝峨し繝シ繝舌ョ繝ゥ繝吶Ν繧呈欠螳壹@縺セ縺吶ょソ鬆医〒縺吶
credit縺ッ繝ェ繝ウ繧ッ縺ョ菫。鬆シ蠎ヲ繧呈欠螳壹@縺セ縺吶ら怐逡・蜿ッ閭ス縺ァ縺吶ら怐逡・縺励◆蝣エ蜷医ッ繝ェ繝ウ繧ッ縺悟炎髯、縺輔l縺セ縺吶
謌仙粥縺吶l縺ー200縺ョ繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨′霑比ソ。縺輔l縺セ縺吶

繝弱シ繝峨槭せ繧ソ縺ョ繧ケ繝シ繝代シ繝ヲ繝シ繧カ縺ッ蜷繝弱シ繝峨ョ邂。逅讓ゥ髯舌r謖√■縺セ縺吶′縲∝推繝弱シ繝峨ョ邂。逅閠縺ッ繝弱シ繝峨槭せ繧ソ縺ョ繧ケ繝シ繝代シ繝ヲ繝シ繧カ縺ィ縺ッ髯舌i縺ェ縺縺ィ縺縺縺薙→縺ォ豕ィ諢上@縺ヲ縺上□縺輔>縲ゅ∪縺溘∝推繝弱シ繝峨ョ繧イ繧ケ繝医ッ縲∬ェ崎ィシ繝「繝シ繝峨r3シallシ峨↓縺励◆蝣エ蜷医↓縺ョ縺ソ諢丞袖繧呈戟縺。縺セ縺吶

讀懃エ「邨先棡縺ョ譖ク蠑

search繧ウ繝槭Φ繝峨ョ蠢懃ュ斐ョ繧ィ繝ウ繝繧」繝繧」繝懊ョ繧」縺ッ縲`IME縺ョ繝槭Ν繝√ヱ繝シ繝医↓莨シ縺溷ス「蠑上r縺ィ繧翫∪縺吶ゆサ・荳九↓萓九r遉コ縺励∪縺吶

--------[2387AD2E34554FFF]--------
VERSION 1.0
NODE    http://localhost:1978/node/sample1
HIT     2
HINT#1  give    2
DOCNUM  2
WORDNUM 31
TIME    0.006541
TIME#i  0.000058
TIME#0  0.002907
TIME#1  0.001578
LINK#0  http://localhost:1978/node/sample1      Sample1 10000   2       31      2731304 2
LINK#1  http://localhost:1978/node/sample2      Sample2 4000    3       125     8524522 1
VIEW    SNIPPET

--------[2387AD2E34554FFF]--------
#nodelabel=Sample Node One
#nodescore=7823432
#nodeurl=http://localhost:1978/node/sample1
@id=1
@uri=http://localhost/foo.html
%VECTOR give    8502    dispose 7343    griefs  5932    king    2343    void    1232

You may my glories and my state dispose, But not my griefs; still am I king of those. (
Give    give
 it u

p, Yo!
Give    give
 it up, Yo!)

--------[2387AD2E34554FFF]--------
#nodelabel=Sample Node One
#nodescore=5623772
#nodeurl=http://localhost:1978/node/sample1
@id=2
@uri=http://localhost/bar.html
%VECTOR faster  9304    give    7723    griefs  6632    go      5343    you     3289

The faster I go, the behinder I get. (
Give    give
 it up, Yo!
Give    give
 it up, Yo!)

--------[2387AD2E34554FFF]--------:END

謾ケ陦後さ繝シ繝峨ッ蜊倅ク縺ョLF縺ァ縺吶らャャ1陦檎岼縺ッ蛹コ蛻繧頑枚蟄怜励ョ螳夂セゥ縺ァ縺吶ゅ%縺薙〒螳夂セゥ縺輔l縺滓枚蟄怜励ョ陦後〒縲√ヱ繝シ繝医′蛹コ蛻繧峨l縺セ縺吶よ怙蠕後ョ蛹コ蛻繧頑枚蟄怜励ョ譛ォ蟆セ縺ォ縺ッ縲:END縲阪→縺縺譁蟄怜励′縺、縺阪∪縺吶よ怙蛻昴ョ繝代シ繝医ッ繝。繧ソ驛ィ縺ァ縺吶ゅ◎繧御サ・髯阪ョ繝代シ繝医ッ譁譖ク驛ィ縺ァ縺吶

繝。繧ソ驛ィ縺ッ縲ゝSV蠖「蠑上r縺ィ繧翫∪縺吶ょ推陦後ョ諢丞袖縺ッ隨ャ1繝輔ぅ繝シ繝ォ繝峨ョ譁蟄怜励〒隴伜挨縺ァ縺阪∪縺吶ゆサ・荳九ョ遞ョ鬘槭′縺ゅj縺セ縺吶

  • VERSION : 繝励Ο繝医さ繝ォ縺ョ繝舌シ繧ク繝ァ繝ウ繧堤、コ縺励∪縺吶
  • NODE : 繝弱シ繝峨ョURL繧堤、コ縺励∪縺吶
  • HIT : 隧イ蠖捺枚譖ク謨ー縺ョ邱剰ィ医r遉コ縺励∪縺吶
  • HINT#n : 蜷讀懃エ「隱槭ョ隧イ蠖捺焚繧堤、コ縺励∪縺吶らャャ2繝輔ぅ繝シ繝ォ繝峨′隱槭〒縲∫ャャ3繝輔ぅ繝シ繝ォ繝峨′隧イ蠖捺焚縺ァ縺吶
  • DOCNUM : 逋サ骭イ譁譖ク謨ー縺ョ邱剰ィ医r遉コ縺励∪縺吶
  • WORDNUM : 逋サ骭イ隱樊焚縺ョ邱剰ィ医r遉コ縺励∪縺吶
  • TIME : 蜈ィ菴薙ョ蜃ヲ逅縺ォ縺九°縺」縺滓凾髢薙r遘貞腰菴阪〒遉コ縺励∪縺吶
  • TIME#n : 蜷繝弱シ繝峨ョ蜃ヲ逅縺ォ縺九°縺」縺滓凾髢薙r遘貞腰菴阪〒遉コ縺励∪縺吶ゅTIME#i縲阪ッ繝ュ繝シ繧ォ繝ォ縺ョ霆「鄂ョ繧、繝ウ繝繝繧ッ繧ケ縺ョ蜃ヲ逅譎る俣繧堤、コ縺励∪縺吶
  • LINK#n : 蜷繝弱シ繝峨ョ諠蝣ア繧堤、コ縺励∪縺吶らャャ2繝輔ぅ繝シ繝ォ繝峨ッURL縲∫ャャ3繝輔ぅ繝シ繝ォ繝峨ッ繝ゥ繝吶Ν縲∫ャャ4繝輔ぅ繝シ繝ォ繝峨ッ菫。鬆シ蠎ヲ縲∫ャャ5繝輔ぅ繝シ繝ォ繝峨ッ逋サ骭イ譁譖ク謨ー縲∫ャャ6繝輔ぅ繝シ繝ォ繝峨ッ逋サ骭イ隱樊焚縲∫ャャ8繝輔ぅ繝シ繝ォ繝峨ッ繝繝シ繧ソ繝吶シ繧ケ縺ョ繧オ繧、繧コ縲∫ャャ8繝輔ぅ繝シ繝ォ繝峨ッ隧イ蠖捺枚譖ク謨ー縺ァ縺吶ゅLINK#0縲阪ッ縺昴ョ繝弱シ繝芽ェ霄ォ縺ョ諠蝣ア繧堤、コ縺励∪縺吶
  • VIEW : 譁譖ク繝代シ繝医ョ蠖「蠑上r遉コ縺励∪縺吶ら樟迥カ縺ァ縺ッ縲SNIPPET縲阪ョ縺ソ縺悟ョ夂セゥ縺輔l縺ヲ縺縺セ縺吶

譁譖ク驛ィ縺ッ縲∬ゥイ蠖捺枚譖ク縺ョ螻樊ァ諠蝣ア縺ィ繧ケ繝九壹ャ繝医r遉コ縺励∪縺吶よ怙蛻昴ョ遨コ陦後∪縺ァ縺悟ア樊ァ諠蝣ア縺ァ縲√◎繧御サ・髯阪′繧ケ繝九壹ャ繝医〒縺吶ょア樊ァ諠蝣ア縺ョ蠖「蠑上ッ譁譖ク繝峨Λ繝輔ヨ縺ィ蜷後§縺ァ縺吶ゅく繝シ繝ッ繝シ繝峨′莉倅ク弱&繧後※縺繧句エ蜷医ッ%VECTOR蛻カ蠕。蜻ス莉、縺ァ陦ィ迴セ縺輔l縲√せ繧ウ繧「縺梧欠螳壹&繧後※縺繧句エ蜷医ッ%SCORE蛻カ蠕。蜻ス莉、縺ァ陦ィ迴セ縺輔l縺セ縺吶ゅせ繝九壹ャ繝医ョ蠖「蠑上ッTSV縺ァ縺吶ゅ◎縺ョ蜷陦後ッ陦ィ遉コ縺吶∋縺肴枚蟄怜励〒縺吶ゅ⊇縺ィ繧薙←縺ョ陦後ッ蜊倅ク縺ョ繝輔ぅ繝シ繝ォ繝峨@縺区戟縺。縺セ縺帙s縺後√>縺上▽縺九ッ莠後▽縺ョ繝輔ぅ繝シ繝ォ繝峨r謖√■縺セ縺吶ゅb縺礼ャャ2繝輔ぅ繝シ繝ォ繝峨′蟄伜惠縺励◆縺ェ繧峨ー縲∫ャャ1繝輔ぅ繝シ繝ォ繝峨ッ繝上う繝ゥ繧、繝医@縺ヲ陦ィ遉コ縺吶∋縺肴枚蟄怜励〒縲∫ャャ2繝輔ぅ繝シ繝ォ繝峨ッ縺昴ョ豁」隕丞喧縺輔l縺滓枚蟄怜励〒縺吶

search繧ウ繝槭Φ繝峨dget_doc繧ウ繝槭Φ繝峨ョ謫堺ス懊r陦後▲縺滄圀縺ォ霑斐&繧後k譁譖ク諠蝣ア縺ォ縺ッ縲∽サ・荳九ョ逍台シシ螻樊ァ縺御サ伜刈縺輔l縺セ縺吶

  • #nodeurl : 縺昴ョ譁譖ク縺檎匳骭イ縺輔l縺ヲ縺繧九ヮ繝シ繝峨ョURL縲
  • #nodescore : 縺昴ョ譁譖ク縺ョ繝弱シ繝峨Ο繝シ繧ォ繝ォ縺ェ繧ケ繧ウ繧「縲
  • #nodelabel : 縺昴ョ譁譖ク縺檎匳骭イ縺輔l縺ヲ縺繧九ヮ繝シ繝峨ョ繝ゥ繝吶Ν縲

譁譖ク荳隕ァ縺ョ譖ク蠑

list繧ウ繝槭Φ繝峨ョ蠢懃ュ斐ョ繧ィ繝ウ繝繧」繝繧」繝懊ョ繧」縺ッ縲ゝSV蠖「蠑上〒縺吶ゆサ・荳九↓萓九r遉コ縺励∪縺吶ょョ滄圀縺ォ縺ッ縲√...縲阪ョ蠕後↓繧よ枚蟄怜励ッ邯壹″縺セ縺吶

181     http://localhost/data/ihaveadream.xml   31e51df5f33131943dda22bd0fd755a0 ...
1       http://localhost/prog/hyperestraier-1.0.2/doc/index.html        45368fa3c...
2       http://localhost/prog/hyperestraier-1.0.2/doc/index.ja.html     0e9edf4ae...
3       http://localhost/prog/hyperestraier-1.0.2/doc/intro-en.html     ec622d19a...
18      http://localhost/prog/hyperestraier-1.0.2/doc/intro-ja.html     96f743fa6...
5       http://localhost/prog/hyperestraier-1.0.2/doc/javanativeapi/allclasses-fr...
25      http://localhost/prog/hyperestraier-1.0.2/doc/javanativeapi/allclasses-no...
26      http://localhost/prog/hyperestraier-1.0.2/doc/javanativeapi/constant-valu...
20      http://localhost/prog/hyperestraier-1.0.2/doc/javanativeapi/estraier/Cmd....
1022    http://localhost/prog/hyperestraier-1.0.2/doc/javanativeapi/estraier/Docu...

謾ケ陦後さ繝シ繝峨ッ蜊倅ク縺ョLF縺ァ縺吶ょ推陦後′蜷譁譖ク縺ョ繝繝シ繧ソ繧定。ィ縺励14蛟九ョ繧キ繧ケ繝繝螻樊ァ繧定。ィ縺吶ヵ繧」繝シ繝ォ繝峨r謖√■縺セ縺吶ょキヲ縺九i縲√@id縲阪@uri縲阪@digest縲阪@cdate縲阪@mdate縲阪@adate縲阪@title縲阪@author縲阪@type縲阪@lang縲阪@genre縲阪@size縲阪@weight縲阪@misc縲阪〒縺吶りゥイ蠖薙ョ螻樊ァ縺悟ョ夂セゥ縺輔l縺ヲ縺縺ェ縺蝣エ蜷医ッ縲√◎縺ョ繝輔ぅ繝シ繝ォ繝峨ッ遨コ譁蟄怜励↓縺ェ繧翫∪縺吶

譁譖ク逋サ骭イ縺ョ迚ケ谿雁ス「蠑

put_doc繧ウ繝槭Φ繝峨→edit_doc繧ウ繝槭Φ繝峨〒縺ッ螟ァ縺阪↑繧オ繧、繧コ縺ョ繝代Λ繝。繝シ繧ソ繧帝√k縺薙→縺悟、壹>縺ァ縺吶′縲√◎繧後rURL繧ィ繝ウ繧ウ繝シ繝峨☆繧九→蜉ケ邇縺梧が縺上↑繧翫∪縺吶1OST繝。繧ス繝繝峨ョContent-Type繝倥ャ繝縺ョ蛟、繧偵荊ext/x-estraier-draft縲阪↓縺吶k縺ィ縲√お繝ウ繝繧」繝繧」繝懊ョ繧」縺ィ縺励※譁譖ク繝峨Λ繝輔ヨ縺昴ョ繧ゅョ繧帝√k縺薙→縺後〒縺阪∪縺吶ゆセ九∴縺ー縲∽サ・荳九ョ繧医≧縺ェ繝ェ繧ッ繧ィ繧ケ繝医r騾∽ソ。縺励∪縺吶

POST /node/foo/put_doc HTTP/1.0
Content-Type: text/x-estraier-draft
Content-Length: 138

@uri=http://gogo.estraier.go.jp/sample.html
@title=Twinkle Twinkle Little Star

Twinkle, twinkle, little star,
How I wonder what you are.

繝弱シ繝陰PI

繝弱シ繝峨し繝シ繝舌r謫堺ス懊☆繧矩圀縺ォHTTP繧帝ァ菴ソ縺吶k縺ョ縺碁擇蛟偵↑蝣エ蜷医ッ繝弱シ繝陰PI繧剃スソ縺縺ィ萓ソ蛻ゥ縺ァ縺吶ゅ%縺薙〒縺ッ縺昴ョ隧ウ邏ー縺ォ縺、縺縺ヲ隱ャ譏弱@縺セ縺吶

讎りヲ

繝弱シ繝陰PI繧剃スソ縺医ー縲ゝCP/IP繧ЗTTP縺ォ縺、縺縺ヲ縺ョ菴弱Ξ繝吶Ν縺ェ蜃ヲ逅繧呈ー励↓縺吶k縺薙→縺ェ縺上√ヮ繝シ繝峨し繝シ繝舌→騾壻ソ。繧定。後≧縺薙→縺後〒縺阪∪縺吶ゅさ繧「API縺ィ豈斐∋繧九→騾壻ソ。縺ョ蛻縺ョ繧ェ繝シ繝舌シ繝倥ャ繝峨′縺九°繧翫∪縺吶′縲√Μ繝「繝シ繝医帙せ繝医°繧牙ョ溯。後〒縺阪◆繧翫√Μ繝シ繝繧繝ゥ繧、繧ソ縺ョ蛹コ蛻・繧呈ー励↓縺帙★縺ォ荳ヲ蛻怜ヲ逅縺後〒縺阪k縺ィ縺縺」縺溷茜轤ケ縺ッ驥崎ヲ√〒縺吶

繝弱シ繝陰PI繧剃スソ縺繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ繧ス繝シ繧ケ繧ウ繝シ繝峨〒縺ッ縲estraier.h縺ィestnode.h縺ィcabin.h縺ィstdlib.h繧偵う繝ウ繧ッ繝ォ繝シ繝峨@縺ヲ縺上□縺輔>縲

#include <estraier.h>
#include <estnode.h>
#include <cabin.h>
#include <stdlib.h>

繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ繧偵ン繝ォ繝峨☆繧矩圀縺ォ縺ッ縲∽サ・荳九h縺縺ェ繧ウ繝槭Φ繝峨r螳溯。後@縺ヲ縺上□縺輔>縲ゅさ繧「API縺ョ繝薙Ν繝画婿豕輔→蜈ィ縺丞酔縺倥〒縺吶

gcc `estconfig --cflags` -o foobar foobar.c `estconfig --ldflags` `estconfig --libs`

繝弱シ繝陰PI繧貞茜逕ィ縺吶k髫帙↓縺ッ縲√さ繧「API縺ァ螳夂セゥ縺輔l縺ヲ縺繧区ゥ溯ス繧ょ茜逕ィ縺吶k縺薙→縺ォ縺ェ繧翫∪縺吶ョ縺ァ縲繝励Ο繧ー繝ゥ繝溘Φ繧ー繧ャ繧、繝繧偵∪縺縺願ェュ縺ソ縺ァ縺ェ縺蝣エ蜷医ッ蜈医↓縺昴■繧峨↓逶ョ繧帝壹@縺ヲ縺翫>縺ヲ縺上□縺輔>縲

蛻晄悄蛹悶ョ縺溘a縺ョAPI

繝弱シ繝陰PI縺ョ繝阪ャ繝医Ρ繝シ繧ッ讖溯ス繧剃スソ縺蜑肴署縺ィ縺励※縲√励Ο繧ー繝ゥ繝縺ョ蜀帝ュ縺ァ繝阪ャ繝医Ρ繝シ繧ッ迺ー蠅繧貞晄悄蛹悶@縺ヲ縺上□縺輔>縲ゅ∪縺溘√励Ο繧ー繝ゥ繝縺檎オゆコ縺吶k髫帙↓縺ッ繝阪ャ繝医Ρ繝シ繧ッ迺ー蠅繧堤エ譽縺励※縺上□縺輔>縲

繝阪ャ繝医Ρ繝シ繧ッ迺ー蠅繧貞晄悄蛹悶☆繧九↓縺ッ縲髢「謨ー `est_init_net_env' 繧堤畑縺縺セ縺吶

int est_init_net_env(void);
謌サ繧雁、縺ッ謌仙粥縺ェ繧臥悄縲√お繝ゥ繝シ縺ェ繧牙⊃縺ァ縺吶ょ酔荳繝励Ο繧ー繝ゥ繝蜀縺ァ縺薙ョ髢「謨ー繧定、謨ー蝗槫ョ溯。後@縺ヲ繧よァ九>縺セ縺帙s縺後∝酔縺伜屓謨ー縺縺 `est_free_net_env' 繧ょョ溯。後@縺ヲ縺上□縺輔>縲

繝阪ャ繝医Ρ繝シ繧ッ迺ー蠅繧堤エ譽縺吶k縺ォ縺ッ縲髢「謨ー `est_free_net_env' 繧堤畑縺縺セ縺吶

void est_free_net_env(void);
繝代Λ繝。繝シ繧ソ繧謌サ繧雁、縺ッ縺ゅj縺セ縺帙s縲

繝弱シ繝峨r謇ア縺API

讒矩菴灘梛 `ESTNODE' 縺ッ縲√ヮ繝シ繝峨→縺ョ謗・邯壹r謚ス雎。蛹悶@縺溘b縺ョ縺ァ縺吶ょ推繝弱シ繝峨ッURL縺ァ隴伜挨縺輔l縺セ縺吶AESTNODE' 縺ョ螳滉ス薙′逶エ謗・蜿らァ縺輔l繧九%縺ィ縺ッ縺ェ縺上∝ソ縺壹昴う繝ウ繧ソ繧剃サ九@縺ヲ髢捺磁蜿らァ縺輔l縺セ縺吶ゅ%縺ョ繝昴う繝ウ繧ソ縺翫h縺ウ縺昴ョ蜿らァ蜈医r邱上§縺ヲ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝縺ィ蜻シ縺ウ縺セ縺吶ゅヮ繝シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医ッ髢「謨ー `est_node_new' 縺ォ繧医▲縺ヲ逕滓舌&繧後〜est_node_delete' 縺ォ繧医▲縺ヲ遐エ譽縺輔l縺セ縺吶ら函謌舌&繧後◆繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医ッ蠢縺夂エ譽縺励※縺上□縺輔>縲

繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医ョ蜈ク蝙狗噪縺ェ繝ゥ繧、繝輔し繧、繧ッ繝ォ繧剃サ・荳九↓遉コ縺励∪縺吶

ESTNODE *node;

/* 逕滓舌☆繧 */
node = est_node_new("http://estraier.gov:1978/node/foo");

/* 繝励Ο繧ッ繧キ縺ィ繧ソ繧、繝繧「繧ヲ繝医→隱崎ィシ諠蝣ア繧定ィュ螳壹☆繧 */
est_node_set_proxy(node, "proxy.qdbm.go.jp", 8080);
est_node_set_timeout(node, 5);
est_node_set_auth(node, "mikio", "oikim");

  /* 縺薙%縺ァ譁譖ク繧堤匳骭イ縺励◆繧翫∵、懃エ「繧定。後▲縺溘j縺吶k */

/* 遐エ譽縺吶k */
est_node_delete(node);

繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r逕滓舌☆繧九↓縺ッ縲髢「謨ー `est_node_new' 繧堤畑縺縺セ縺吶

ESTNODE *est_node_new(const char *url);
`url' 縺ッ繝弱シ繝峨ョURL繧呈欠螳壹@縺セ縺吶よ綾繧雁、縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医〒縺吶

繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r遐エ譽縺吶k縺ォ縺ッ縲髢「謨ー `est_node_delete' 繧堤畑縺縺セ縺吶

void est_node_delete(ESTNODE *node);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶

繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医↓繝励Ο繧ッ繧キ縺ョ諠蝣ア繧定ィュ螳壹☆繧九↓縺ッ縲髢「謨ー `est_node_set_proxy' 繧堤畑縺縺セ縺吶

void est_node_set_proxy(ESTNODE *node, const char *host, int port);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Ahost' 縺ッ繝励Ο繧ッ繧キ繧オ繝シ繝舌ョ繝帙せ繝亥錐繧呈欠螳壹@縺セ縺吶Aport' 縺ッ繝励Ο繧ッ繧キ繧オ繝シ繝舌ョ繝昴シ繝育分蜿キ繧呈欠螳壹@縺セ縺吶

繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医↓繧ソ繧、繝繧「繧ヲ繝医ョ諠蝣ア繧定ィュ螳壹☆繧九↓縺ッ縲髢「謨ー `est_node_set_timeout' 繧堤畑縺縺セ縺吶

void est_node_set_timeout(ESTNODE *node, int sec);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Asec' 縺ッ謗・邯壹ョ繧ソ繧、繝繧「繧ヲ繝域凾髢薙r遘貞腰菴阪〒謖螳壹@縺セ縺吶

繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医↓隱崎ィシ諠蝣ア繧定ィュ螳壹☆繧九↓縺ッ縲髢「謨ー `est_node_set_auth' 繧堤畑縺縺セ縺吶

void est_node_set_auth(ESTNODE *node, const char *name, const char *passwd);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aname' 縺ッ隱崎ィシ諠蝣ア縺ョ繝ヲ繝シ繧カ蜷阪r謖螳壹@縺セ縺吶Apasswd' 縺ッ隱崎ィシ諠蝣ア縺ョ繝代せ繝ッ繝シ繝峨r謖螳壹@縺セ縺吶

繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医〒逶エ蜑阪↓襍キ縺阪◆繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨r蜿門セ励☆繧九↓縺ッ縲髢「謨ー `est_node_status' 繧堤畑縺縺セ縺吶

int est_node_status(ESTNODE *node);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ繝弱シ繝画磁邯壹〒逶エ蜑阪↓襍キ縺阪◆繧ケ繝繝シ繧ソ繧ケ繧ウ繝シ繝峨〒縺吶-1縺ッ謗・邯壹↓螟ア謨励@縺溘%縺ィ繧呈э蜻ウ縺励∪縺吶

繝弱シ繝峨ョ繝繝シ繧ソ繝吶シ繧ケ縺ョ譖エ譁ー蜀螳ケ繧貞酔譛溘&縺帙k縺ォ縺ッ縲髢「謨ー `est_node_sync' 繧堤畑縺縺セ縺吶

int est_node_sync(ESTNODE *node);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ謌仙粥縺ェ繧臥悄縲√お繝ゥ繝シ縺ェ繧牙⊃縺ァ縺吶

繝弱シ繝峨ョ繝繝シ繧ソ繝吶シ繧ケ繧呈怙驕ゥ蛹悶☆繧九↓縺ッ縲髢「謨ー `est_node_optimize' 繧堤畑縺縺セ縺吶

int est_node_optimize(ESTNODE *node);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ謌仙粥縺ェ繧臥悄縲√お繝ゥ繝シ縺ェ繧牙⊃縺ァ縺吶

繝弱シ繝峨↓譁譖ク繧定ソス蜉縺吶k縺ォ縺ッ縲髢「謨ー `est_node_put_doc' 繧堤畑縺繧九

int est_node_put_doc(ESTNODE *node, ESTDOC *doc);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Adoc' 縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ枚譖ク繧ェ繝悶ず繧ァ繧ッ繝医ッURI螻樊ァ繧呈戟縺」縺ヲ縺縺ェ縺代l縺ー縺ェ繧翫∪縺帙s縲よ綾繧雁、縺ッ謌仙粥縺ェ繧臥悄縲√お繝ゥ繝シ縺ェ繧牙⊃縺ァ縺吶よ欠螳壹&繧後◆譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョURI螻樊ァ縺後ヮ繝シ繝牙縺ョ譌「蟄倥ョ譁譖ク縺ィ荳閾エ縺吶k蝣エ蜷医∵里蟄倥ョ譁ケ縺ッ蜑企勁縺輔l縺セ縺吶

繝弱シ繝峨°繧画枚譖ク繧貞炎髯、縺吶k縺ォ縺ッ縲髢「謨ー `est_node_out_doc' 繧堤畑縺縺セ縺吶

int est_node_out_doc(ESTNODE *node, int id);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aid' 縺ッ逋サ骭イ譁譖ク縺ョID逡ェ蜿キ繧呈欠螳壹@縺セ縺吶よ綾繧雁、縺ッ謌仙粥縺ェ繧臥悄縲√お繝ゥ繝シ縺ェ繧牙⊃縺ァ縺吶

繝弱シ繝峨°繧蔚RI縺ァ謖螳壹@縺滓枚譖ク繧貞炎髯、縺吶k縺ォ縺ッ縲髢「謨ー `est_node_out_doc_by_uri' 繧堤畑縺縺セ縺吶

int est_node_out_doc_by_uri(ESTNODE *node, const char *uri);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Auri' 縺ッ逋サ骭イ譁譖ク縺ョURI繧呈欠螳壹@縺セ縺吶よ綾繧雁、縺ッ謌仙粥縺ェ繧臥悄縲√お繝ゥ繝シ縺ェ繧牙⊃縺ァ縺吶

繝弱シ繝牙縺ョ譁譖ク縺ョ螻樊ァ繧堤キィ髮縺吶k縺ォ縺ッ縲髢「謨ー `est_node_edit_doc' 繧堤畑縺縺セ縺吶

int est_node_edit_doc(ESTNODE *node, ESTDOC *doc);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Adoc' 縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ枚譖ク繧ェ繝悶ず繧ァ繧ッ繝医ッURI螻樊ァ繧呈戟縺」縺ヲ縺縺ェ縺代l縺ー縺ェ繧翫∪縺帙s縲よ綾繧雁、縺ッ謌仙粥縺ェ繧臥悄縲√お繝ゥ繝シ縺ェ繧牙⊃縺ァ縺吶ID螻樊ァ繧貞、画峩縺吶k縺薙→縺ッ縺ァ縺阪∪縺帙s縲ょ、画峩縺励◆URI螻樊ァ縺御サ悶ョ逋サ骭イ譁譖ク縺ィ驥阪↑繧句エ蜷医ッ繧ィ繝ゥ繝シ縺ィ縺ェ繧翫∪縺吶

繝弱シ繝峨°繧画枚譖ク繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_node_get_doc' 繧堤畑縺縺セ縺吶

ESTDOC *est_node_get_doc(ESTNODE *node, int id);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aid' 縺ッ逋サ骭イ譁譖ク縺ョID逡ェ蜿キ繧呈欠螳壹@縺セ縺吶よ綾繧雁、縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医°縲√お繝ゥ繝シ縺ェ繧 `NULL' 縺ァ縺吶よ綾繧雁、縺ョ繧ェ繝悶ず繧ァ繧ッ繝医ッ `est_doc_new' 縺ァ逕滓舌&繧後※縺繧九ョ縺ァ縲∽ク崎ヲ√↓縺ェ縺」縺溘i `est_doc_close' 縺ァ遐エ譽縺励※縺上□縺輔>縲

繝弱シ繝峨°繧蔚RI縺ァ謖螳壹@縺滓枚譖ク繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_node_get_doc_by_uri' 繧堤畑縺縺セ縺吶

ESTDOC *est_node_get_doc_by_uri(ESTNODE *node, const char *uri);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Auri' 縺ッ逋サ骭イ譁譖ク縺ョURI繧呈欠螳壹@縺セ縺吶よ綾繧雁、縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医°縲√お繝ゥ繝シ縺ェ繧 `NULL' 縺ァ縺吶よ綾繧雁、縺ョ繧ェ繝悶ず繧ァ繧ッ繝医ッ `est_doc_new' 縺ァ逕滓舌&繧後※縺繧九ョ縺ァ縲∽ク崎ヲ√↓縺ェ縺」縺溘i `est_doc_close' 縺ァ遐エ譽縺励※縺上□縺輔>縲

繝弱シ繝峨°繧画枚譖ク縺ョ螻樊ァ蛟、繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_node_get_doc_attr' 繧堤畑縺縺セ縺吶

char *est_node_get_doc_attr(ESTNODE *node, int id, const char *name);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aid' 縺ッ逋サ骭イ譁譖ク縺ョID逡ェ蜿キ繧呈欠螳壹@縺セ縺吶Aname' 縺ッ螻樊ァ蜷阪r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ隧イ蠖薙ョ螻樊ァ蛟、縺九∫┌縺代l縺ー `NULL' 縺ァ縺吶よ綾繧雁、縺ョ鬆伜沺縺ッ `malloc' 縺ァ逕滓舌&繧後※縺繧九ョ縺ァ縲∽ク崎ヲ√↓縺ェ縺」縺溘i `free' 縺ァ遐エ譽縺励※縺上□縺輔>縲

繝弱シ繝峨°繧蔚RI縺ァ謖螳壹@縺滓枚譖ク縺ョ螻樊ァ蛟、繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_node_get_doc_attr_by_uri' 繧堤畑縺縺セ縺吶

char *est_node_get_doc_attr_by_uri(ESTNODE *node, const char *uri, const char *name);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Auri' 縺ッ逋サ骭イ譁譖ク縺ョURI繧呈欠螳壹@縺セ縺吶Aname' 縺ッ螻樊ァ蜷阪r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ隧イ蠖薙ョ螻樊ァ蛟、縺九∫┌縺代l縺ー `NULL' 縺ァ縺吶よ綾繧雁、縺ョ鬆伜沺縺ッ `malloc' 縺ァ逕滓舌&繧後※縺繧九ョ縺ァ縲∽ク崎ヲ√↓縺ェ縺」縺溘i `free' 縺ァ遐エ譽縺励※縺上□縺輔>縲

繝弱シ繝峨°繧画枚譖ク縺ョ繧ュ繝シ繝ッ繝シ繝峨r蜿門セ励☆繧九↓縺ッ縲髢「謨ー `est_node_etch_doc' 繧堤畑縺縺セ縺吶

CBMAP *est_node_etch_doc(ESTNODE *node, int id);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aid' 縺ッ逋サ骭イ譁譖ク縺ョID逡ェ蜿キ繧呈欠螳壹@縺セ縺吶よ綾繧雁、縺ッ繧ュ繝シ繝ッ繝シ繝峨→縺昴ョ10騾イ謨ー陦ィ迴セ縺ョ繧ケ繧ウ繧「繧呈シ邏阪@縺溘槭ャ繝励が繝悶ず繧ァ繧ッ繝医°縲√お繝ゥ繝シ縺ェ繧 `NULL' 縺ァ縺吶よ綾繧雁、縺ョ鬆伜沺縺ッ `cbmapopen' 縺ァ逕滓舌&繧後※縺繧九ョ縺ァ縲∽ク崎ヲ√↓縺ェ縺」縺溘i `cbmapclose' 縺ァ遐エ譽縺励※縺上□縺輔>縲

繝弱シ繝峨°繧蔚RI縺ァ謖螳壹@縺滓枚譖ク縺ョ繧ュ繝シ繝ッ繝シ繝峨r蜿門セ励☆繧九↓縺ッ縲髢「謨ー `est_node_etch_doc_by_uri' 繧堤畑縺縺セ縺吶

CBMAP *est_node_etch_doc_by_uri(ESTNODE *node, const char *uri);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Auri' 縺ッ逋サ骭イ譁譖ク縺ョURI繧呈欠螳壹@縺セ縺吶よ綾繧雁、縺ッ繧ュ繝シ繝ッ繝シ繝峨→縺昴ョ10騾イ謨ー陦ィ迴セ縺ョ繧ケ繧ウ繧「繧呈シ邏阪@縺溘槭ャ繝励が繝悶ず繧ァ繧ッ繝医°縲√お繝ゥ繝シ縺ェ繧 `NULL' 縺ァ縺吶よ綾繧雁、縺ョ鬆伜沺縺ッ `cbmapopen' 縺ァ逕滓舌&繧後※縺繧九ョ縺ァ縲∽ク崎ヲ√↓縺ェ縺」縺溘i `cbmapclose' 縺ァ遐エ譽縺励※縺上□縺輔>縲

URI縺ォ蟇セ蠢懊☆繧区枚譖ク縺ョID逡ェ蜿キ繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_node_uri_to_id' 繧堤畑縺縺セ縺吶

int est_node_uri_to_id(ESTNODE *node, const char *uri);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Auri' 縺ッ逋サ骭イ譁譖ク縺ョURI繧呈欠螳壹@縺セ縺吶よ綾繧雁、縺ッ譁譖ク縺ョID逡ェ蜿キ縺ァ縺ゅk縺九√お繝ゥ繝シ縺ェ繧-1縺ァ縺吶

繝弱シ繝峨ョ蜷榊燕繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_node_name' 繧堤畑縺縺セ縺吶

const char *est_node_name(ESTNODE *node);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ繝繝シ繧ソ繝吶シ繧ケ縺ョ蜷榊燕縺九√お繝ゥ繝シ縺ェ繧 `NULL' 縺ァ縺吶よ綾繧雁、縺ョ譁蟄怜励ョ蟇ソ蜻ス縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医ョ縺昴l縺ィ蜷梧悄縺励∪縺吶

繝弱シ繝峨ョ繝ゥ繝吶Ν繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_node_label' 繧堤畑縺縺セ縺吶

const char *est_node_label(ESTNODE *node);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ繝繝シ繧ソ繝吶シ繧ケ縺ョ繝ゥ繝吶Ν縺九√お繝ゥ繝シ縺ェ繧 `NULL' 縺ァ縺吶よ綾繧雁、縺ョ譁蟄怜励ョ蟇ソ蜻ス縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医ョ縺昴l縺ィ蜷梧悄縺励∪縺吶

繝弱シ繝峨↓逋サ骭イ縺輔l縺滓枚譖ク縺ョ謨ー繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_node_doc_num' 繧堤畑縺縺セ縺吶

int est_node_doc_num(ESTNODE *node);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ繝繝シ繧ソ繝吶シ繧ケ縺ォ逋サ骭イ縺輔l縺滓枚譖ク縺ョ謨ー縺九√お繝ゥ繝シ縺ェ繧-1縺ァ縺吶

繝弱シ繝峨↓逋サ骭イ縺輔l縺溽焚縺ェ繧願ェ槭ョ謨ー繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_node_word_num' 繧堤畑縺縺セ縺吶

int est_node_word_num(ESTNODE *node);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ繝繝シ繧ソ繝吶シ繧ケ縺ォ逋サ骭イ縺輔l縺溽焚縺ェ繧願ェ槭ョ謨ー縺九√お繝ゥ繝シ縺ェ繧-1縺ァ縺吶

繝弱シ繝峨ョ繝繝シ繧ソ繝吶シ繧ケ縺ョ繧オ繧、繧コ繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_node_size' 繧堤畑縺縺セ縺吶

double est_node_size(ESTNODE *node);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ繝弱シ繝峨ョ繝繝シ繧ソ繝吶シ繧ケ縺ョ繧オ繧、繧コ縺九√お繝ゥ繝シ縺ェ繧-1.0縺ァ縺吶

繝弱シ繝峨ョ繧ュ繝」繝繧キ繝・菴ソ逕ィ邇繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_node_cache_usage' 繧堤畑縺縺セ縺吶

double est_node_cache_usage(ESTNODE *node);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ繝弱シ繝峨ョ繧ュ繝」繝繧キ繝・菴ソ逕ィ邇縺九√お繝ゥ繝シ縺ェ繧-1.0縺ァ縺吶

繝弱シ繝峨ョ邂。逅閠蜷阪ョ繝ェ繧ケ繝医r蜿門セ励☆繧九↓縺ッ縲髢「謨ー `est_node_admins' 繧堤畑縺縺セ縺吶

const CBLIST *est_node_admins(ESTNODE *node);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ繝弱シ繝峨ョ邂。逅閠蜷阪ョ繝ェ繧ケ繝医が繝悶ず繧ァ繧ッ繝医°縲√お繝ゥ繝シ縺ェ繧 `NULL' 縺ァ縺吶よ綾繧雁、縺ョ繧ェ繝悶ず繧ァ繧ッ繝医ョ蟇ソ蜻ス縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医ョ縺昴l縺ィ蜷梧悄縺励∪縺吶

繝弱シ繝峨ョ繝ヲ繝シ繧カ蜷阪ョ繝ェ繧ケ繝医r蜿門セ励☆繧九↓縺ッ縲髢「謨ー `est_node_users' 繧堤畑縺縺セ縺吶

const CBLIST *est_node_users(ESTNODE *node);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ繝弱シ繝峨ョ繝ヲ繝シ繧カ蜷阪ョ繝ェ繧ケ繝医が繝悶ず繧ァ繧ッ繝医°縲√お繝ゥ繝シ縺ェ繧 `NULL' 縺ァ縺吶よ綾繧雁、縺ョ繧ェ繝悶ず繧ァ繧ッ繝医ョ蟇ソ蜻ス縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医ョ縺昴l縺ィ蜷梧悄縺励∪縺吶

繝弱シ繝峨ョ繝ェ繝ウ繧ッ陦ィ迴セ縺ョ繝ェ繧ケ繝医r蜿門セ励☆繧九↓縺ッ縲髢「謨ー `est_node_links' 繧堤畑縺縺セ縺吶

const CBLIST *est_node_links(ESTNODE *node);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ繝弱シ繝峨ョ繝ェ繝ウ繧ッ陦ィ迴セ縺ョ繝ェ繧ケ繝医が繝悶ず繧ァ繧ッ繝医°縲√お繝ゥ繝シ縺ェ繧 `NULL' 縺ァ縺吶よ綾繧雁、縺ョ蜷隕∫エ縺ッTSV縺ョ譁蟄怜励〒縲ゞRL縺ィ繝ゥ繝吶Ν縺ィ繧ケ繧ウ繧「縺ョ3縺、縺ョ繝輔ぅ繝シ繝ォ繝峨r謖√■縺セ縺吶よ綾繧雁、縺ョ繧ェ繝悶ず繧ァ繧ッ繝医ョ蟇ソ蜻ス縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医ョ縺昴l縺ィ蜷梧悄縺励∪縺吶

讀懃エ「譚。莉カ縺ォ隧イ蠖薙☆繧区枚譖ク縺ョ荳隕ァ繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_node_search' 繧堤畑縺縺セ縺吶

ESTNODERES *est_node_search(ESTNODE *node, ESTCOND *cond, int depth);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Acond' 縺ッ讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Adepth' 縺ッ繝。繧ソ讀懃エ「縺ョ豺ア蠎ヲ繧呈欠螳壹@縺セ縺吶よ綾繧雁、縺ッ繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医°縲√お繝ゥ繝シ縺ェ繧 `NULL' 縺ァ縺吶よ綾繧雁、縺ョ繧ェ繝悶ず繧ァ繧ッ繝医ッ荳崎ヲ√↓縺ェ縺」縺溘i `est_noderes_delete' 縺ァ遐エ譽縺励※縺上□縺輔>縲

讀懃エ「邨先棡縺ョ繧ケ繝九壹ャ繝医ョ蟷繧定ィュ螳壹☆繧九↓縺ッ縲髢「謨ー `est_node_set_snippet' 繧堤畑縺縺セ縺吶

void est_node_set_snippet_width(ESTNODE *node, int wwidth, int hwidth, int awidth);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Awwidth' 縺ッ邨先棡蜈ィ菴薙ョ蟷シ遺薗譁蟄玲焚シ峨r謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ480縺ァ縺吶0縺ォ縺吶k縺ィ繧ケ繝九壹ャ繝医r騾∽ソ。縺励∪縺帙s縲りイ謨ー縺ォ縺吶k縺ィ繧ケ繝九壹ャ繝医ョ莉」繧上j縺ォ譛ャ譁蜈ィ菴薙r騾∽ソ。縺励∪縺吶Ahwidth' 縺ッ譛ャ譁縺ョ蜀帝ュ縺九i謚ス蜃コ縺吶k蟷繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ96縺ァ縺吶Aawidth' 縺ッ繝上う繝ゥ繧、繝医&繧後k隱槭ョ蜻ィ霎コ縺九i謚ス蜃コ縺吶k蟷繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ96縺ァ縺吶

繝弱シ繝峨ョ繝ヲ繝シ繧カ繧「繧ォ繧ヲ繝ウ繝医r邂。逅縺吶k縺ォ縺ッ縲髢「謨ー `est_node_set_user' 繧堤畑縺縺セ縺吶

int est_node_set_user(ESTNODE *node, const char *name, int mode);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aname' 縺ッ繝ヲ繝シ繧カ蜷阪r謖螳壹@縺セ縺吶Amode' 縺ッ謫堺ス懊Δ繝シ繝峨r謖螳壹@縺セ縺吶0縺ェ繧峨い繧ォ繧ヲ繝ウ繝医r蜑企勁縺励1縺ェ繧峨い繧ォ繧ヲ繝ウ繝医r邂。逅閠縺ォ縺励2縺ェ繧蛾壼クク繝ヲ繝シ繧カ縺ォ縺励∪縺吶よ綾繧雁、縺ッ謌仙粥縺ェ繧臥悄縲√お繝ゥ繝シ縺ェ繧牙⊃縺ァ縺吶

繝弱シ繝峨ョ繝ェ繝ウ繧ッ繧堤ョ。逅縺吶k縺ォ縺ッ縲髢「謨ー `est_node_set_link' 繧堤畑縺縺セ縺吶

int est_node_set_link(ESTNODE *node, const char *url, const char *label, int credit);
`node' 縺ッ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aurl' 縺ッ繝ェ繝ウ繧ッ蟇セ雎。縺ョ繝弱シ繝峨ョURL繧呈欠螳壹@縺セ縺吶Alabel' 縺ッ繝ェ繝ウ繧ッ縺ョ繝ゥ繝吶Ν繧呈欠螳壹@縺セ縺吶Acredit' 縺ッ繝ェ繝ウ繧ッ縺ョ菫。鬆シ蠎ヲ繧呈欠螳壹@縺セ縺吶りイ謨ー縺ョ蝣エ蜷医ッ隧イ蠖薙ョ繝ェ繝ウ繧ッ繧貞炎髯、縺励∪縺吶よ綾繧雁、縺ッ謌仙粥縺ェ繧臥悄縲√お繝ゥ繝シ縺ェ繧牙⊃縺ァ縺吶

繝弱シ繝峨°繧峨ョ讀懃エ「邨先棡繧呈桶縺API

讒矩菴灘梛 `ESTNODERES' 縺ッ縲√ヮ繝シ繝峨°繧峨ョ讀懃エ「邨先棡繧呈歓雎。蛹悶@縺溘b縺ョ縺ァ縺吶らオ先棡縺ォ縺ッ縲∬ゥイ蠖捺枚譖ク縺ョ諠蝣ア縺ョ繝ェ繧ケ繝医→繝偵Φ繝域ュ蝣ア縺悟性縺セ繧後∪縺吶AESTNODERES' 縺ョ螳滉ス薙′逶エ謗・蜿らァ縺輔l繧九%縺ィ縺ッ縺ェ縺上∝ソ縺壹昴う繝ウ繧ソ繧剃サ九@縺ヲ髢捺磁蜿らァ縺輔l縺セ縺吶ゅ%縺ョ繝昴う繝ウ繧ソ縺翫h縺ウ縺昴ョ蜿らァ蜈医r邱上§縺ヲ繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝縺ィ蜻シ縺ウ縺セ縺吶ゅヮ繝シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医ッ髢「謨ー `est_node_search' 縺ォ繧医▲縺ヲ逕滓舌&繧後〜est_noderes_delete' 縺ォ繧医▲縺ヲ遐エ譽縺輔l縺セ縺吶ら函謌舌&繧後◆繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医ッ蠢縺夂エ譽縺励※縺上□縺輔>縲

讒矩菴灘梛 `ESTRESDOC' 縺ッ縲√ヮ繝シ繝峨°繧峨ョ讀懃エ「邨先棡縺ョ蜷譁譖ク縺ョ諠蝣ア繧呈歓雎。蛹悶@縺溘b縺ョ縺ァ縺吶よ枚譖ク諠蝣ア縺ォ縺ッ縲∬、謨ー縺ョ螻樊ァ縺ィ荳縺、縺ョ繧ケ繝九壹ャ繝医′蜷ォ縺セ繧後∪縺吶AESTRESDOC' 縺ョ螳滉ス薙′逶エ謗・蜿らァ縺輔l繧九%縺ィ縺ッ縺ェ縺上∝ソ縺壹昴う繝ウ繧ソ繧剃サ九@縺ヲ髢捺磁蜿らァ縺輔l縺セ縺吶ゅ%縺ョ繝昴う繝ウ繧ソ縺翫h縺ウ縺昴ョ蜿らァ蜈医r邱上§縺ヲ邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝縺ィ蜻シ縺ウ縺セ縺吶らオ先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ッ髢「謨ー `est_noderes_get_doc' 縺ォ繧医▲縺ヲ蜿らァ縺ァ縺阪∪縺吶′縲∝ョ滉ス薙ッ繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医ョ蜀驛ィ縺ァ邂。逅縺輔l繧九◆繧√∫エ譽縺吶k蠢隕√ッ縺ゅj縺セ縺帙s縲

繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医→邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ蜈ク蝙狗噪縺ェ繝ゥ繧、繝輔し繧、繧ッ繝ォ繧剃サ・荳九↓遉コ縺励∪縺吶

ESTNODERES *nres;
CBMAP *hints;
ESTRESDOC *rdoc;
int i;

/* 繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医r逕滓舌☆繧 */
nres = est_node_search(node, cond, 1);

/* 繝偵Φ繝医r蜿悶j蜃コ縺 */
hints = est_noderes_hints(nres);

   /* 縺薙%縺ァ繝偵Φ繝医r陦ィ遉コ縺吶k */

/* 隧イ蠖捺枚譖ク縺ョ繝ェ繧ケ繝医r襍ー譟サ縺吶k */
for(i = 0; i < est_noderes_doc_num(nres); i++){

  /* 邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r蜿悶j蜃コ縺 */
  rdoc = est_noderes_get_doc(nres, i);

  /* 縺薙%縺ァ譁譖ク諠蝣ア繧定。ィ遉コ縺吶k */

}

/* 繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医r遐エ譽縺吶k */
est_noderes_delete(nres);

繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医r遐エ譽縺吶k縺ォ縺ッ縲髢「謨ー `est_noderes_delete' 繧堤畑縺縺セ縺吶

void est_noderes_delete(ESTNODERES *nres);
`nres' 縺ッ繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶

繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医°繧峨ヲ繝ウ繝医ョ繝槭ャ繝励が繝悶ず繧ァ繧ッ繝医r蜿門セ励☆繧九↓縺ッ縲髢「謨ー `est_noderes_hints' 繧堤畑縺繧九

CBMAP *est_noderes_hints(ESTNODERES *nres);
`nres' 縺ッ繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ繝偵Φ繝医ョ繝槭ャ繝励が繝悶ず繧ァ繧ッ繝医〒縺吶ゅく繝シ縺ォ縺ッ "VERSION"縲"NODE"縲"HIT"縲"HINT#n"縲"DOCNUM"縲"WORDNUM"縲"TIME"縲"TIME#n"縲"LINK#n"縲"VIEW" 縺後≠繧翫∪縺吶よ綾繧雁、縺ョ繧ェ繝悶ず繧ァ繧ッ繝医ョ蟇ソ蜻ス縺ッ繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医ョ縺昴l縺ィ蜷梧悄縺励∪縺吶

繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝亥縺ョ鬘樔シシ縺励◆譁譖ク繧帝國阡ス縺吶k縺ォ縺ッ縲髢「謨ー `est_noderes_eclipse' 繧堤畑縺縺セ縺吶

void est_noderes_eclipse(ESTNODERES *nres, int num, double limit);
`nres' 縺ッ繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Anum' 縺ッ陦ィ遉コ縺吶∋縺肴枚譖ク縺ョ謨ー繧呈欠螳壹@縺セ縺吶0繧定カ翫∴縺ェ縺蛟、繧呈欠螳壹☆繧九→髫阡ス繧定ァ」髯、縺励∪縺吶Alimit' 縺ッ髫阡ス縺輔l繧区枚譖ク縺ョ荳矩剞縺ョ鬘樔シシ蠎ヲ繧0.0縺九i1.0縺セ縺ァ縺ョ蛟、縺ァ謖螳壹@縺セ縺吶

繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医↓蜷ォ縺セ繧後k譁譖ク諠蝣ア縺ョ謨ー繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_noderes_doc_num' 繧堤畑縺縺セ縺吶

int est_noderes_doc_num(ESTNODERES *nres);
`nres' 縺ッ繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医↓蜷ォ縺セ繧後k譁譖ク諠蝣ア縺ョ謨ー縺ァ縺吶

繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医°繧牙九縺ョ邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r蜿門セ励☆繧九↓縺ッ縲髢「謨ー `est_noderes_get_doc' 繧堤畑縺縺セ縺吶

ESTRESDOC *est_noderes_get_doc(ESTNODERES *nres, int index);
`nres' 縺ッ繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aindex' 縺ッ蜿悶j蜃コ縺呵ヲ∫エ縺ョ繧、繝ウ繝繝繧ッ繧ケ繧呈欠螳壹@縺セ縺吶よ綾繧雁、縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医°縲〜index' 縺瑚ヲ∫エ謨ー縺ィ遲峨@縺縺句、ァ縺阪¢繧後ー `NULL' 縺ァ縺吶よ綾繧雁、縺ョ繧ェ繝悶ず繧ァ繧ッ繝医ョ蟇ソ蜻ス縺ッ繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医ョ縺昴l縺ィ蜷梧悄縺励∪縺吶

邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医°繧蔚RI繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_resdoc_uri' 繧堤畑縺縺セ縺吶

const char *est_resdoc_uri(ESTRESDOC *rdoc);
`rdoc' 縺ッ邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョURI縺ァ縺吶よ綾繧雁、縺ョ譁蟄怜励ョ蟇ソ蜻ス縺ッ邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ縺昴l縺ィ蜷梧悄縺励∪縺吶

邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ螻樊ァ蜷阪ョ繝ェ繧ケ繝医r蜿門セ励☆繧九↓縺ッ縲髢「謨ー `est_resdoc_attr_names' 繧堤畑縺縺セ縺吶

CBLIST *est_resdoc_attr_names(ESTRESDOC *rdoc);
`rdoc' 縺ッ邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ螻樊ァ蜷阪ョ繝ェ繧ケ繝医〒縺吶よ綾繧雁、縺ョ繧ェ繝悶ず繧ァ繧ッ繝医ッ `cblistopen' 縺ァ逕滓舌&繧後※縺繧九ョ縺ァ縲∽ク崎ヲ√↓縺ェ縺」縺溘i `cblistclose' 縺ァ遐エ譽縺励※縺上□縺輔>縲

邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ螻樊ァ縺ョ蛟、繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_resdoc_attr' 繧堤畑縺縺セ縺吶

const char *est_resdoc_attr(ESTRESDOC *rdoc, const char *name);
`rdoc' 縺ッ邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aname' 縺ッ螻樊ァ蜷阪r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ螻樊ァ蛟、縺ァ縺吶′縲∬ゥイ蠖薙☆繧句ア樊ァ縺後↑縺蝣エ蜷医ッ `NULL' 縺瑚ソ斐&繧後∪縺吶よ綾繧雁、縺ョ譁蟄怜励ョ蟇ソ蜻ス縺ッ邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ縺昴l縺ィ蜷梧悄縺励∪縺吶

邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ繧ケ繝九壹ャ繝医r蜿門セ励☆繧九↓縺ッ縲髢「謨ー `est_resdoc_snippet' 繧堤畑縺縺セ縺吶

const char *est_resdoc_snippet(ESTRESDOC *rdoc);
`rdoc' 縺ッ邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ繧ケ繝九壹ャ繝医ョ譁蟄怜励〒縺吶ゅ◎縺ョ蠖「蠑上ッ繧ソ繝門玄蛻繧頑枚蟄怜暦シTSVシ峨〒縺吶ゅ◎縺ョ蜷陦後ッ陦ィ遉コ縺吶∋縺肴枚蟄怜励〒縺吶ゅ⊇縺ィ繧薙←縺ョ陦後ッ蜊倅ク縺ョ繝輔ぅ繝シ繝ォ繝峨@縺区戟縺。縺セ縺帙s縺後√>縺上▽縺九ッ莠後▽縺ョ繝輔ぅ繝シ繝ォ繝峨r謖√■縺セ縺吶ゅb縺礼ャャ2繝輔ぅ繝シ繝ォ繝峨′蟄伜惠縺励◆縺ェ繧峨ー縲∫ャャ1繝輔ぅ繝シ繝ォ繝峨ッ繝上う繝ゥ繧、繝医@縺ヲ陦ィ遉コ縺吶∋縺肴枚蟄怜励〒縲∫ャャ2繝輔ぅ繝シ繝ォ繝峨ッ縺昴ョ豁」隕丞喧縺輔l縺滓枚蟄怜励〒縺吶よ綾繧雁、縺ョ譁蟄怜励ョ蟇ソ蜻ス縺ッ邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ縺昴l縺ィ蜷梧悄縺励∪縺吶

讀懃エ「邨先棡繧ェ繝悶ず繧ァ繧ッ繝医ョ繧ュ繝シ繝ッ繝シ繝峨吶け繝医Ν繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_resdoc_keywords' 繧堤畑縺縺セ縺吶

const char *est_resdoc_keywords(ESTRESDOC *rdoc);
`rdoc' 縺ッ邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ繧ュ繝シ繝ッ繝シ繝峨ョ譁蟄怜励〒縺吶ゅ◎縺ョ蠖「蠑上ッ繧ソ繝門玄蛻繧頑枚蟄怜暦シTSVシ峨〒縺吶ょ推繝輔ぅ繝シ繝ォ繝峨↓縺ッ縲√く繝シ繝ッ繝シ繝峨→縺昴ョ繧ケ繧ウ繧「縺御コ、莠偵↓陦ィ繧後∪縺吶よ綾繧雁、縺ョ譁蟄怜励ョ蟇ソ蜻ス縺ッ邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ縺昴l縺ィ蜷梧悄縺励∪縺吶

邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医↓髫阡ス縺輔l縺滓枚譖ク縺ョ驟榊励r蜿門セ励☆繧九↓縺ッ縲髢「謨ー `est_resdoc_shadows' 繧堤畑縺縺セ縺吶

ESTRESDOC **est_resdoc_shadows(ESTRESDOC *rdoc, int *np);
`rdoc' 縺ッ邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Anp' 縺ッ謌サ繧雁、縺ョ驟榊励ョ隕∫エ謨ー繧呈シ邏阪☆繧句、画焚縺ク縺ョ繝昴う繝ウ繧ソ繧呈欠螳壹@縺セ縺吶よ綾繧雁、縺ッ髫阡ス縺輔l縺溽オ先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ驟榊励〒縺吶よ綾繧雁、縺ョ驟榊励→縺昴ョ隕∫エ縺ョ蟇ソ蜻ス縺ッ邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ縺昴l縺ィ蜷梧悄縺励∪縺吶

髫阡ス縺輔l縺滓、懃エ「邨先棡繧ェ繝悶ず繧ァ繧ッ繝医ョ莉」陦ィ譁譖ク縺ィ縺ョ鬘樔シシ蠎ヲ繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_resdoc_similarity' 繧堤畑縺縺セ縺吶

double est_resdoc_similarity(ESTRESDOC *rdoc);
`rdoc' 縺ッ邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ莉」陦ィ譁譖ク縺ィ縺ョ鬘樔シシ蠎ヲ縺ァ縺吶′縲√◎縺ョ邨先棡繧ェ繝悶ず繧ァ繧ッ繝医′髫阡ス縺輔l縺ヲ縺縺ェ縺蝣エ蜷医ッ-1.0縺ァ縺吶

荳ヲ蛻玲ァ

繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医√ヮ繝シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医∫オ先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ縺縺壹l繧ゅ√せ繝ャ繝繝蛾俣縺ァ蜈ア譛峨@縺ヲ縺ッ縺ェ繧翫∪縺帙s縲ゅ槭Ν繝√せ繝ャ繝繝峨r逕ィ縺繧句エ蜷医ッ縲∝推繧ケ繝ャ繝繝峨〒蛻・縲縺ョ繧ェ繝悶ず繧ァ繧ッ繝医r菴ソ縺繧医≧縺ォ縺励※縺上□縺輔>縲ゅ◎縺ョ譚。莉カ縺輔∴螳医l縺ー縲√ヮ繝シ繝陰PI縺ョ蜷髢「謨ー縺ッ繝槭Ν繝√せ繝ャ繝繝峨そ繝シ繝輔↑繧ゅョ縺ィ縺励※謇ア縺医∪縺吶

繧ョ繝」繧カ繝ゥ縺ョ繧オ繝ウ繝励Ν

譛繧ょ腰邏斐↑繧ョ繝」繧カ繝ゥ縺ョ螳溯」繧剃サ・荳九↓遉コ縺励∪縺吶ゅさ繧「API縺ョ繧ョ繝」繧カ繝ゥ縺ィ縺ョ驕輔>縺ッ縲√ロ繝繝医Ρ繝シ繧ッ迺ー蠅縺ョ蛻晄悄蛹悶′蠢隕√↑縺薙→縺ィ縲√ョ繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医ョ莉」繧上j縺ォ繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r菴ソ縺縺薙→縺ァ縺吶

#include <estraier.h>
#include <estnode.h>
#include <cabin.h>
#include <stdlib.h>
#include <stdio.h>

int main(int argc, char **argv){
  ESTNODE *node;
  ESTDOC *doc;
  /* 繝阪ャ繝医Ρ繝シ繧ッ迺ー蠅繧貞晄悄蛹悶☆繧 */
  if(!est_init_net_env()){
    fprintf(stderr, "error: network is unavailable\n");
    return 1;
  }
  /* 繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r逕滓舌@縺ヲ險ュ螳壹☆繧 */
  node = est_node_new("http://localhost:1978/node/test1");
  est_node_set_auth(node, "admin", "admin");
  /* 譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r逕滓舌☆繧 */
  doc = est_doc_new();
  /* 譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医↓螻樊ァ繧定ソス蜉縺吶k */
  est_doc_add_attr(doc, "@uri", "http://estraier.gov/example.txt");
  est_doc_add_attr(doc, "@title", "Over the Rainbow");
  /* 譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医↓譛ャ譁繧定ソス蜉縺吶k */
  est_doc_add_text(doc, "Somewhere over the rainbow.  Way up high.");
  est_doc_add_text(doc, "There's a land that I heard of once in a lullaby.");
  /* 譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r繝弱シ繝峨↓逋サ骭イ縺吶k */
  if(!est_node_put_doc(node, doc))
    fprintf(stderr, "error: %d\n", est_node_status(node));
  /* 譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r遐エ譽縺吶k */
  est_doc_delete(doc);
  /* 繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r遐エ譽縺吶k */
  est_node_delete(node);
  /* 繝阪ャ繝医Ρ繝シ繧ッ迺ー蠅繧堤エ譽縺吶k */
  est_free_net_env();
  return 0;
}

繧オ繝シ繝√Ε縺ョ繧オ繝ウ繝励Ν

譛繧ょ腰邏斐↑繧オ繝シ繝√Ε縺ョ螳溯」繧剃サ・荳九↓遉コ縺励∪縺吶ゅさ繧「API縺ァ縺ッ讀懃エ「邨先棡縺九i譁譖ク繧ェ繝悶ず繧ァ繧ッ繝茨シESTDOCシ峨r蜿門セ励@縺ヲ縺縺セ縺励◆縺後√%縺薙〒縺ッ邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝茨シESTRESDOCシ峨r蜿門セ励@縺ヲ縺繧九%縺ィ縺ォ豕ィ諢上@縺ヲ縺上□縺輔>縲

#include <estraier.h>
#include <estnode.h>
#include <cabin.h>
#include <stdlib.h>
#include <stdio.h>

int main(int argc, char **argv){
  ESTNODE *node;
  ESTCOND *cond;
  ESTNODERES *nres;
  ESTRESDOC *rdoc;
  int i;
  const char *value;
  /* 繝阪ャ繝医Ρ繝シ繧ッ迺ー蠅繧貞晄悄蛹悶☆繧 */
  if(!est_init_net_env()){
    fprintf(stderr, "error: network is unavailable\n");
    return 1;
  }
  /* 繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r逕滓舌☆繧 */
  node = est_node_new("http://localhost:1978/node/test1");
  /* 讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r逕滓舌☆繧 */
  cond = est_cond_new();
  /* 讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医↓讀懃エ「蠑上r險ュ螳壹☆繧 */
  est_cond_set_phrase(cond, "rainbow AND lullaby");
  /* 繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医r蜿門セ励☆繧 */
  nres = est_node_search(node, cond, 0);
  if(nres){
    /* 蜷譁譖ク繧貞叙蠕励@縺ヲ陦ィ遉コ縺吶k */
    for(i = 0; i < est_noderes_doc_num(nres); i++){
      /* 邨先棡譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r蜿門セ励☆繧 */
      rdoc = est_noderes_get_doc(nres, i);
      /* 螻樊ァ繧定。ィ遉コ縺吶k */
      if((value = est_resdoc_attr(rdoc, "@uri")) != NULL)
        printf("URI: %s\n", value);
      if((value = est_resdoc_attr(rdoc, "@title")) != NULL)
        printf("Title: %s\n", value);
      /* 繧ケ繝九壹ャ繝医r陦ィ遉コ縺吶k */
      printf("%s", est_resdoc_snippet(rdoc));
    }
    /* 繝弱シ繝臥オ先棡繧ェ繝悶ず繧ァ繧ッ繝医r遐エ譽縺吶k */
    est_noderes_delete(nres);
  } else {
    fprintf(stderr, "error: %d\n", est_node_status(node));
  }
  /* 讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r遐エ譽縺吶k */
  est_cond_delete(cond);
  /* 繝弱シ繝画磁邯壹が繝悶ず繧ァ繧ッ繝医r遐エ譽縺吶k */
  est_node_delete(node);
  /* 繝阪ャ繝医Ρ繝シ繧ッ迺ー蠅繧堤エ譽縺吶k */
  est_free_net_env();
  return 0;
}

繧ッ繝ゥ繧、繧「繝ウ繝育畑繧ウ繝槭Φ繝

縺薙%縺ァ縺ッ縲√ヮ繝シ繝臥ョ。逅逕ィ繧ウ繝槭Φ繝峨estcall縲阪ョ隧ウ邏ー縺ェ莉墓ァ倥r隱ャ譏弱@縺セ縺吶よ、懃エ「繧ゅ〒縺阪k縺ョ縺ァ縲estcall繧偵せ繧ッ繝ェ繝励ヨ險隱槭°繧牙他縺ウ蜃コ縺帙ー縺昴l縺ェ繧翫ョ繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺檎ー。蜊倥↓菴懊l縺セ縺吶

譖ク蠑

estcall縺ッ螟壹¥縺ョ繧オ繝悶さ繝槭Φ繝峨ョ髮蜷井ス薙〒縺吶ゅし繝悶さ繝槭Φ繝峨ョ蜷榊燕縺ッ隨ャ1蠑墓焚縺ァ謖螳壹&繧後∪縺吶ゅ◎縺ョ莉悶ョ蠑墓焚縺ッ繧オ繝悶さ繝槭Φ繝峨ョ遞ョ鬘槭↓蠢懊§縺ヲ隗」驥医&繧後∪縺吶nurl縺ィ縺縺蠑墓焚縺ッ謫堺ス懷ッセ雎。縺ョ繝弱シ繝峨ョURL縺ァ縺吶-proxy繧ェ繝励す繝ァ繝ウ縺ッ繝励Ο繧ッ繧キ縺ョ繝帙せ繝亥錐縺ィ繝昴シ繝育分蜿キ繧呈欠螳壹@縺セ縺吶-tout縺ッ繧ソ繧、繝繧「繧ヲ繝医ョ譎る俣繧堤ァ貞腰菴阪〒謖螳壹@縺セ縺吶-auth縺ッ隱崎ィシ縺ョ繝ヲ繝シ繧カ蜷阪→繝代せ繝ッ繝シ繝峨r謖螳壹@縺セ縺吶

estcall put [-proxy host port] [-tout num] [-auth user pass] nurl [file]
譁譖ク繝峨Λ繝輔ヨ蠖「蠑上ョ繝輔ぃ繧、繝ォ繧堤匳骭イ縺励∪縺吶
file縺ッ蟇セ雎。縺ョ繝輔ぃ繧、繝ォ繧呈欠螳壹@縺セ縺吶′縲∫怐逡・縺励◆蝣エ蜷医ッ讓呎コ門・蜉帙′隱ュ縺ソ霎シ縺セ繧後∪縺吶
estcall out [-proxy host port] [-tout num] [-auth user pass] nurl expr
迚ケ螳壹ョ譁譖ク縺ョ諠蝣ア繧偵う繝ウ繝繝繧ッ繧ケ縺九i蜑企勁縺励∪縺吶
expr縺ッ蟇セ雎。縺ョID逡ェ蜿キ縺偽RI繧呈欠螳壹@縺セ縺吶
estcall edit [-proxy host port] [-tout num] [-auth user pass] nurl expr name [value]
迚ケ螳壹ョ譁譖ク縺ョ螻樊ァ繧呈峩譁ー縺励∪縺吶
expr縺ッ蟇セ雎。縺ョID逡ェ蜿キ縺偽RI繧呈欠螳壹@縺セ縺吶
name縺ッ螻樊ァ縺ョ蜷榊燕繧呈欠螳壹@縺セ縺吶
value縺ッ螻樊ァ縺ョ蛟、繧呈欠螳壹@縺セ縺吶ら怐逡・縺励◆蝣エ蜷医◎縺ョ螻樊ァ縺ッ蜑企勁縺輔l縺セ縺吶
estcall get [-proxy host port] [-tout num] [-auth user pass] nurl expr [attr]
迚ケ螳壹ョ譁譖ク縺ョ諠蝣ア繧呈枚譖ク繝峨Λ繝輔ヨ蠖「蠑上〒蜃コ蜉帙@縺セ縺吶
expr縺ッ蟇セ雎。縺ョID逡ェ蜿キ縺偽RI繧呈欠螳壹@縺セ縺吶
attr繧剃サ倥¢繧九→縲√◎縺ョ螻樊ァ縺ョ蛟、縺ョ縺ソ繧貞コ蜉帙@縺セ縺吶
estcall etch [-proxy host port] [-tout num] [-auth user pass] nurl expr
迚ケ螳壹ョ譁譖ク縺ョ繧ュ繝シ繝ッ繝シ繝峨→繧ケ繧ウ繧「繧探SV蠖「蠑上〒蜃コ蜉帙@縺セ縺吶
expr縺ッ蟇セ雎。縺ョID逡ェ蜿キ縺偽RI繧呈欠螳壹@縺セ縺吶
estcall uriid [-proxy host port] [-tout num] [-auth user pass] nurl uri
謖螳壹@縺欟RI縺ョ譁譖ク縺ョID逡ェ蜿キ繧貞コ蜉帙@縺セ縺吶
uri縺ッ蟇セ雎。縺ョURI繧呈欠螳壹@縺セ縺吶
estcall inform [-proxy host port] [-tout num] [-auth user pass] [-ia|-iu|-il] nurl
繝弱シ繝峨ョ蜷榊燕縺ィ繝ゥ繝吶Ν縺ィ逋サ骭イ譁譖ク謨ー縺ィ逋サ骭イ隱樊焚縺ィ繧ュ繝」繝繧キ繝・菴ソ逕ィ邇繧貞コ蜉帙@縺セ縺吶
-ia繧剃サ倥¢繧九→縲∫ョ。逅閠蜷阪ョ繝ェ繧ケ繝医r蜃コ蜉帙@縺セ縺吶
-iu繧剃サ倥¢繧九→縲√Θ繝シ繧カ蜷阪ョ繝ェ繧ケ繝医r蜃コ蜉帙@縺セ縺吶
-il繧剃サ倥¢繧九→縲√Μ繝ウ繧ッ陦ィ迴セ縺ョ繝ェ繧ケ繝医r蜃コ蜉帙@縺セ縺吶
estcall sync [-proxy host port] [-tout num] [-auth user pass] nurl
繝弱シ繝峨ョ繝繝シ繧ソ繝吶シ繧ケ縺ョ譖エ譁ー蜀螳ケ繧貞酔譛溘&縺帙∪縺吶
estcall optimize [-proxy host port] [-tout num] [-auth user pass] nurl
繝弱シ繝峨ョ繝繝シ繧ソ繝吶シ繧ケ繧呈怙驕ゥ蛹悶@縺セ縺吶
estcall search [-proxy host port] [-tout num] [-auth user pass] [-vu|-vx] [-kw] [-ec rn] [-sf] [-attr expr] [-ord expr] [-max num] [-sk num] [-aux num] [-dis name] [-dpt num] [-mask num] nurl [phrase]
繝弱シ繝峨↓逋サ骭イ縺輔l縺滓枚譖ク繧呈、懃エ「縺励∪縺吶
phrase縺ッ蜈ィ譁讀懃エ「縺ョ讀懃エ「蠑上r謖螳壹@縺セ縺吶
-vu繧剃サ倥¢繧九→縲ゞRI縺ィ繝弱シ繝峨ョ諠蝣ア繧偵ち繝門玄蛻繧翫↓縺励◆蠖「蠑上〒邨先棡繧貞コ蜉帙@縺セ縺吶
-vx繧剃サ倥¢繧九→縲々ML蠖「蠑上↓縺励※邨先棡繧貞コ蜉帙@縺セ縺吶
-kw繧剃サ倥¢繧九→縲√く繝シ繝ッ繝シ繝峨吶け繝医Ν繧貞叙蠕励@縺セ縺吶
-ec縺ッ鬘樔シシ髫阡ス縺ョ荳矩剞鬘樔シシ蠎ヲ繧0.0縺九i1.0縺セ縺ァ縺ョ螳滓焚縺ァ謖螳壹@縺セ縺吶
-sf繧剃サ倥¢繧九→縲∵、懃エ「蠑上r邁。萓ソ譖ク蠑上→縺励※謇ア縺縺セ縺吶
-attr縺ッ邨槭j霎シ縺ソ縺ョ螻樊ァ譚。莉カ繧呈欠螳壹@縺セ縺吶り、謨ー謖螳壼庄閭ス縺ァ縺吶
-ord縺ッ繧ス繝シ繝域擅莉カ繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ繧ケ繧ウ繧「縺ョ髯埼縺ァ縺吶
-max縺ッ譛螟ァ陦ィ遉コ莉カ謨ー繧呈欠螳壹@縺セ縺吶りイ謨ー縺ォ縺吶k縺ィ辟。蛻カ髯舌↓縺ェ繧翫∪縺吶ゅョ繝輔か繝ォ繝医ッ10莉カ縺ァ縺吶
-sk縺ッ蜿門セ励r繧ケ繧ュ繝繝励☆繧倶サカ謨ー繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ0莉カ縺ァ縺吶
-aux縺ッ陬懷勧繧、繝ウ繝繝繧ッ繧ケ縺ョ邨先棡繧呈治逕ィ縺吶k險ア蜿ッ繧呈欠螳壹@縺セ縺吶0繧定カ翫∴縺ェ縺蛟、繧呈欠螳壹☆繧九→陬懷勧繧、繝ウ繝繝繧ッ繧ケ縺ッ菴ソ繧上l縺セ縺帙s縲ゅョ繝輔か繝ォ繝医ッ32莉カ縺ァ縺吶
-dis縺ッ驥崎、蝗樣∩螻樊ァ縺ョ蜷榊燕繧呈欠螳壹@縺セ縺吶
-dpt縺ッ繝。繧ソ讀懃エ「縺ョ豺ア蠎ヲ繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ0縺ァ縺吶
-mask縺ッ繝。繧ソ讀懃エ「縺ョ繝槭せ繧ッ繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ0縺ァ縺吶
estcall list [-proxy host port] [-tout num] [-auth user pass] nurl
繝弱シ繝峨↓逋サ骭イ縺輔l縺溷ィ縺ヲ縺ョ譁譖ク縺ョ荳隕ァ繧貞叙蠕励@縺セ縺吶
estcall setuser [-proxy host port] [-tout num] [-auth user pass] nurl name mode
繝ヲ繝シ繧カ讓ゥ髯舌r險ュ螳壹@縺セ縺吶
name縺ッ繝ヲ繝シ繧カ蜷阪r謖螳壹@縺セ縺吶
mode縺1縺ェ繧峨◎縺ョ繝ヲ繝シ繧カ繧堤ョ。逅閠縺ォ縺励2縺ェ繧峨◎縺ョ繝ヲ繝シ繧カ繧帝壼クク繝ヲ繝シ繧カ縺ォ縺励0縺ェ繧峨Θ繝シ繧カ讓ゥ髯舌r蜑企勁縺励∪縺吶
estcall setlink [-proxy host port] [-tout num] [-auth user pass] nurl url label credit
繝ェ繝ウ繧ッ繧定ィュ螳壹@縺セ縺吶
url縺ッ繝ェ繝ウ繧ッ蜈医ョ繝弱シ繝峨ョURL繧呈欠螳壹@縺セ縺吶
label縺ッ繝ゥ繝吶Ν繧呈欠螳壹@縺セ縺吶
credit縺ッ菫。鬆シ蠎ヲ繧呈欠螳壹@縺セ縺吶ょ、縺瑚イ謨ー縺ョ蝣エ蜷医ッ縺昴ョ繝ェ繝ウ繧ッ繧貞炎髯、縺励∪縺吶
estcall raw [-proxy host port] [-tout num] [-auth user pass] [-np] [-eh expr] url [file]
HTTP繝ェ繧ッ繧ィ繧ケ繝医r逶エ謗・蛻カ蠕。縺励※繝ャ繧ケ繝昴Φ繧ケ繧貞コ蜉帙@縺セ縺吶
url縺ッ謫堺ス懷ッセ雎。縺ョURL繧呈欠螳壹@縺セ縺吶
file縺梧欠螳壹&繧後◆蝣エ蜷医ッ縺昴ョ蜀螳ケ繧単OST繝。繧ス繝繝峨〒騾∽ソ。縺励∪縺吶よ欠螳壹&繧後↑縺九▲縺溷エ蜷医ッGET繝。繧ス繝繝峨r逕ィ縺縺セ縺吶"-" 繧呈欠螳壹☆繧九→讓呎コ門・蜉帙r隱ュ縺ソ霎シ縺ソ縺セ縺吶
-np繧剃サ倥¢繧九→縲√Ξ繧ケ繝昴Φ繧ケ繝倥ャ繝繧ょ性繧√※蜃コ蜉帙@縺セ縺吶
-eh縺ッ霑ス蜉縺吶kHTTP繝倥ャ繝繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医〒縺ッHost縺ィConnection縺ィUser-AgentContent-Length縺御サ伜刈縺輔l縺セ縺吶

蜈ィ縺ヲ縺ョ繧オ繝悶さ繝槭Φ繝峨ッ縲∝ヲ逅縺梧ュ」蟶ク縺ォ邨ゆコ縺励◆蝣エ蜷医↓縺ッ0繧偵√◎縺縺ァ縺ェ縺蝣エ蜷医ッ1繧堤オゆコ繧ケ繝繝シ繧ソ繧ケ縺ォ縺励∪縺吶

蠢懃畑萓具シ壹ヮ繝シ繝峨槭せ繧ソ縺ョ謫堺ス

繝弱シ繝峨槭せ繧ソ閾ェ菴薙ョ謫堺ス懊ッAPI縺ォ縺ッ縺ゅj縺セ縺帙s縺ョ縺ァ縲〉aw繧オ繝悶さ繝槭Φ繝峨r逕ィ縺縺ヲ縺上□縺輔>縲ゆセ九∴縺ー縲√ヮ繝シ繝峨槭せ繧ソ繧偵す繝」繝繝医ム繧ヲ繝ウ縺吶k縺ォ縺ッ縲∽サ・荳九ョ繧医≧縺ェ繧ウ繝槭Φ繝峨r螳溯。後@縺セ縺吶

estcall raw -auth admin admin \
  'http://localhost:1978/master?action=shutdown'

繝ヲ繝シ繧カ繧定ソス蜉縺吶k縺ォ縺ッ縲∽サ・荳九ョ繧医≧縺ェ繧ウ繝槭Φ繝峨r螳溯。後@縺セ縺吶

estcall raw -auth admin admin \
  'http://localhost:1978/master?action=useradd&name=mikio&passwd=iloveyou'

POST繝。繧ス繝繝峨r菴ソ縺縺ォ縺ッ縲∽サ・荳九ョ繧医≧縺ォ縺励∪縺吶

echo -n 'action=useradd&name=mikio&passwd=iloveyou' |
  estcall raw -auth admin admin \
    -eh 'Content-Type: application/x-www-form-urlencoded' \
    'http://localhost:1978/master' -

逍台シシ繝弱シ繝峨槭せ繧ソ

縺薙%縺ァ縺ッ縲∫桝莨シ繝弱シ繝峨槭せ繧ソestfraud.cgi縺ョ隧ウ邏ー縺ェ莉墓ァ倥r隱ャ譏弱@縺セ縺吶

讒区

繝繝シ繝「繝ウ繝励Ο繧サ繧ケ縺ァ縺ゅk繝弱シ繝峨槭せ繧ソ繧貞ョ滄圀縺ォ驕狗畑縺吶k縺ォ縺ッ縲∬オキ蜍輔♀繧医ウ邨ゆコ縺ョ蜃ヲ逅繧定。後≧繧ケ繧ッ繝ェ繝励ヨ繧堤畑諢上☆繧九↑縺ゥ縺ョ謇矩俣縺後°縺九j縺セ縺吶ゅ∪縺溘∝ア逕ィ繧オ繝シ繝舌↑縺ゥ縺ァ繝繝シ繝「繝ウ繝励Ο繧サ繧ケ縺ョ蛻ゥ逕ィ縺檎ヲ∵ュ「縺輔l縺ヲ縺繧九%縺ィ繧ゅ≠繧翫∪縺吶ゅ◎縺ョ繧医≧縺ェ蝣エ蜷医↓縺ッ縲√ヮ繝シ繝峨し繝シ繝舌ョ繝励Ο繝医さ繝ォ繧呈ィ。蛟」縺吶kCGI繧ケ繧ッ繝ェ繝励ヨ縺ァ縺ゅk逍台シシ繝弱シ繝峨槭せ繧ソ縺悟スケ縺ォ遶九▽縺九b縺励l縺セ縺帙s縲8eb繧オ繝シ繝舌′蜍輔>縺ヲ縺縺ヲ縲,GI繧ケ繧ッ繝ェ繝励ヨ縺悟茜逕ィ縺ァ縺阪k迺ー蠅縺ァ縺ゅl縺ー縲騾壼クク縺ョ繧、繝ウ繝繝繧ッ繧ケ繧偵ヮ繝シ繝峨し繝シ繝舌↓隕狗ォ九※縺ヲ縲√ヮ繝シ繝陰PI繧剃スソ縺」縺ヲ繝ェ繝「繝シ繝医°繧画、懃エ「繧定。後≧縺薙→縺後〒縺阪∪縺吶ら桝莨シ繝弱シ繝峨槭せ繧ソ縺ョ荳翫〒蜍輔¥莉ョ諠ウ逧縺ェ繝弱シ繝峨し繝シ繝舌r逍台シシ繝弱シ繝峨し繝シ繝縺ィ蜻シ縺ウ縺セ縺吶

逍台シシ繝弱シ繝峨槭せ繧ソ縺ッ繝弱シ繝峨ョ謨ー縺碁撼蟶ク縺ォ螟壹>蝣エ蜷医↓繧ょスケ遶九■縺セ縺吶ゅヵ繧。繧、繝ォ繝繧」繧ケ繧ッ繝ェ繝励ち繧帝幕縺縺溘∪縺セ蟶ク鬧舌☆繧矩壼クク縺ョ繝弱シ繝峨し繝シ繝舌→驕輔>縲∫桝莨シ繝弱シ繝峨し繝シ繝舌ッ繝ェ繧ッ繧ィ繧ケ繝域ッ弱↓繝励Ο繧サ繧ケ繧堤函謌舌@縺ヲ繝繝シ繧ソ繝吶シ繧ケ縺ォ謗・邯壹☆繧九ョ縺ァ縲√ヵ繧。繧、繝ォ繝繧」繧ケ繧ッ繝ェ繝励ち縺ョ譫ッ貂繧貞ソ驟阪☆繧句ソ隕√ッ縺ゅj縺セ縺帙s縲る壼クク縺ョ繝弱シ繝峨槭せ繧ソ縺ョ荳翫〒蜍輔°縺帙k繝弱シ繝峨し繝シ繝舌ッ螳溽畑逧縺ォ縺ッ30蛟狗ィ句コヲ縺御ク企剞縺ァ縺吶′縲∫桝莨シ繝弱シ繝峨槭せ繧ソ縺ョ荳翫〒縺ッ1000蛟倶サ・荳翫ョ逍台シシ繝弱シ繝峨し繝シ繝舌r蜍輔°縺励※繧ょ撫鬘後ッ縺ゅj縺セ縺帙s縲

逍台シシ繝弱シ繝峨し繝シ繝舌r蛻ゥ逕ィ縺吶k縺ォ縺ッ縲,GI繧ケ繧ッ繝ェ繝励ヨestfraud.cgi縺ィ縺昴ョ險ュ螳壹ヵ繧。繧、繝ォestfraud.conf繧辰GI繧ケ繧ッ繝ェ繝励ヨ縺悟茜逕ィ縺ァ縺阪k蝣エ謇縺ォ險ュ鄂ョ縺励※縺上□縺輔>縲

險ュ螳壹ヵ繧。繧、繝ォ

險ュ螳壹ヵ繧。繧、繝ォ縺ッ縲∝、画焚蜷阪→蛟、繧偵:縲阪〒蛹コ蛻縺」縺溷ス「蠑上ョ陦後r荳ヲ縺ケ縺溘b縺ョ縺ァ縺吶ゅョ繝輔か繝ォ繝医〒縺ッ縲∬ィュ螳壹ヵ繧。繧、繝ォ縺ッ莉・荳九ョ繧医≧縺ェ蜀螳ケ縺ォ縺ェ縺」縺ヲ縺縺セ縺吶

indexdir: .
runmode: 2
pidxsuffix: -pidx
pidxdocmax: 256
pidxdocmin: 0
lockindex: 0
searchmax: 1000
rateuri: 1
mergemethod: 2
scoreexpr: 2
wildmax: 256
snipwwidth: 480
sniphwidth: 96
snipawidth: 96
scancheck: 1
smlrvnum: 32
extdelay: 4096

縺昴l縺槭l縺ョ螟画焚縺ョ讖溯ス繧剃サ・荳九↓遉コ縺励∪縺吶

  • indexdir : 繧、繝ウ繝繝繧ッ繧ケ繧堤スョ縺縺溘ョ繧」繝ャ繧ッ繝医Μ縺ョ繝代せ繧呈欠螳壹@縺セ縺吶
  • runmode : 驕狗畑繝「繝シ繝峨r謖螳壹@縺セ縺吶1縺ッ騾壼クク繝「繝シ繝峨2縺ッ隱ュ縺ソ霎シ縺ソ蟆ら畑繝「繝シ繝峨〒縺吶
  • pidxsuffix : 逍台シシ繧、繝ウ繝繝繧ッ繧ケ縺ョ謗・蟆セ霎槭r謖螳壹@縺セ縺吶
  • pidxdocmax : 逍台シシ繧、繝ウ繝繝繧ッ繧ケ蜀縺ョ譁譖ク縺ョ譛螟ァ謨ー繧呈欠螳壹@縺セ縺吶
  • pidxdocmin : 逍台シシ繧、繝ウ繝繝繧ッ繧ケ蜀縺ョ譁譖ク縺ョ譛蟆乗焚繧呈欠螳壹@縺セ縺吶
  • lockindex : 豁」謨ー縺ェ繧峨う繝ウ繝繝繧ッ繧ケ縺ォ繝輔ぃ繧、繝ォ繝ュ繝繧ッ繧偵°縺代∪縺吶
  • searchmax : 騾∽ソ。縺吶k譁譖ク縺ョ譛螟ァ謨ー繧呈欠螳壹@縺セ縺吶
  • rateuri : 豁」謨ー縺ェ繧峨せ繧ウ繧「繝ェ繝ウ繧ー縺ョ髫帙↓URI繧定ゥ穂セ。縺励∪縺吶
  • mergemethod : 繝。繧ソ讀懃エ「縺ョ邨先棡縺ョ繝槭シ繧ク譁ケ豕輔r謖螳壹@縺セ縺吶1縺ェ繧峨せ繧ウ繧「縺ョ縺ソ繧堤畑縺縲2縺ェ繧峨せ繧ウ繧「縺ィ鬆菴阪r逕ィ縺縲3縺ェ繧蛾菴阪ョ縺ソ繧堤畑縺縺セ縺吶
  • scoreexpr : 繧ケ繧ウ繧「縺ョ陦ィ迴セ譁ケ豕輔r謖螳壹@縺セ縺吶1縺ェ繧峨せ繧ウ繧「繧堤エ譽縺励2縺ェ繧8繝薙ャ繝医〒菫晄戟縺励3縺ェ繧32繝薙ャ繝医〒菫晄戟縺励4縺ェ繧画悴隱ソ謨エ縺ァ菫晄戟縺励∪縺吶
  • wildmax : 繝ッ繧、繝ォ繝峨き繝シ繝牙ア暮幕縺ョ譛螟ァ隱樊焚繧呈欠螳壹@縺セ縺吶
  • snipwwidth : 讀懃エ「邨先棡縺ョ繧ケ繝九壹ャ繝医ョ蜈ィ菴薙ョ蟷繧呈欠遉コ縺励∪縺吶
  • sniphwidth : 讀懃エ「邨先棡縺ョ繧ケ繝九壹ャ繝医r菴懊k髫帙↓譁譖ク縺ョ蜀帝ュ縺九i蜿門セ励☆繧句ケ繧呈欠遉コ縺励∪縺吶
  • snipawidth : 讀懃エ「邨先棡縺ョ繧ケ繝九壹ャ繝医r菴懊k髫帙↓讀懃エ「隱槭ョ蜻ィ霎コ縺九i蜿門セ励☆繧句ケ繧呈欠遉コ縺励∪縺吶
  • scancheck : 豁」謨ー縺ェ繧画枚譖ク縺ョ蜀螳ケ縺ィ讀懃エ「繝輔Ξ繝シ繧コ縺ョ邊セ蟇讀懈渊繧偵@縺セ縺吶
  • smlrvnum : 鬘樔シシ讀懃エ「縺ョ繝吶け繝医Ν縺ョ谺。蜈謨ー繧呈欠螳壹@縺セ縺吶0縺ェ繧蛾。樔シシ讀懃エ「縺檎┌蜉ケ縺ォ縺ェ繧翫∪縺吶
  • extdelay : 鬘樔シシ讀懃エ「縺ョ繝吶け繝医Ν謚ス蜃コ繧帝≦蟒カ縺輔○繧区枚譖ク謨ー繧呈欠螳壹@縺セ縺吶りイ謨ー繧呈欠螳壹☆繧九→縲驕蟒カ縺ェ縺励〒蠖「諷狗エ隗」譫舌r驕ゥ逕ィ縺励∪縺吶

逍台シシ繝弱シ繝峨し繝シ繝舌↓繧医▲縺ヲ謇ア縺縺溘>繧、繝ウ繝繝繧ッ繧ケ繧偵/home/mikio/myindex縲阪ョ荳九↓鄂ョ縺丞エ蜷医indexdir縺ョ蛟、縺ォ縺ッ縲/home/mikio/myindex縲阪r謖螳壹@縺セ縺吶ゅ%縺ョ繝繧」繝ャ繧ッ繝医Μ縺ョ荳ュ縺ォ鄂ョ縺縺溘う繝ウ繝繝繧ッ繧ケ縺ッ縲∝ィ縺ヲ讀懃エ「蟇セ雎。縺ィ縺励※蜈ャ髢九&繧後k縺薙→縺ォ縺ェ繧翫∪縺吶estfraud.cgi縺後http://abc.def/ghi/estfraud.cgi縲阪→縺励※繧「繧ッ繧サ繧ケ縺ァ縺阪k縺ェ繧峨ー縲√/home/mikio/myindex/foo縲阪ッ縲http://abc.def/ghi/estfraud.cgi/foo縲阪→縺縺URL縺ョ逍台シシ繝弱シ繝峨し繝シ繝舌→縺励※蜈ャ髢九&繧後∪縺吶

蛻カ髯

逍台シシ繝弱シ繝峨し繝シ繝舌↓繧医▲縺ヲ繧、繝ウ繝繝繧ッ繧ケ縺ョ譖エ譁ー繧定。後≧蝣エ蜷医∽サ・荳九ョ譚。莉カ繧呈コ縺溘☆蠢隕√′縺ゅj縺セ縺吶

  • 逍台シシ繝弱シ繝峨槭せ繧ソ縺ョ驕狗畑繝「繝シ繝峨′騾壼クク繝「繝シ繝峨〒縺ゅk縺薙→シ医runmode: 1縲阪↓縺吶kシ峨
  • 逍台シシ繧、繝ウ繝繝繧ッ繧ケ縺悟ュ伜惠縺吶k縺薙→シ医う繝ウ繝繝繧ッ繧ケ蜷阪ョ蠕後↓縲-pidx縲阪r縺、縺代◆繝繧」繝ャ繧ッ繝医Μ繧剃ス懊kシ峨
  • CGI繧ケ繧ッ繝ェ繝励ヨ縺ョ螳溯。後Θ繝シ繧カ縺後う繝ウ繝繝繧ッ繧ケ縺翫h縺ウ逍台シシ繧、繝ウ繝繝繧ッ繧ケ縺ョ譖ク縺崎セシ縺ソ讓ゥ髯舌r謖√▲縺ヲ縺繧九%縺ィ縲

逍台シシ繝弱シ繝峨し繝シ繝千オ檎罰縺ァ譁譖ク逋サ骭イ繧定。後▲縺溷エ蜷医√◎縺ョ譁譖ク縺ョ繝繝シ繧ソ縺ッ譁譖ク繝峨Λ繝輔ヨ縺ィ縺励※逍台シシ繧、繝ウ繝繝繧ッ繧ケ縺ォ譬シ邏阪&繧後∪縺吶ら桝莨シ繧、繝ウ繝繝繧ッ繧ケ蜀縺ョ繝輔ぃ繧、繝ォ謨ー縺pidxdocmax縺ァ謖螳壹@縺滓焚縺ォ驕斐@縺滓凾轤ケ縺ァ縲∫桝莨シ繧、繝ウ繝繝繧ッ繧ケ縺ョ蜀螳ケ縺後う繝ウ繝繝繧ッ繧ケ縺ォ繝槭シ繧ク縺輔l縲∫桝莨シ繧、繝ウ繝繝繧ッ繧ケ縺ッ遨コ縺ォ縺輔l縺セ縺吶ゅ%縺ョ莉慕オ縺ソ縺ォ繧医▲縺ヲ縲∝クク鬧舌@縺ェ縺ГGI繧ケ繧ッ繝ェ繝励ヨ縺ョ繝励Ο繧サ繧ケ縺ァ繧ょ柑邇逧縺ォ繧、繝ウ繝繝繧ッ繧ケ縺ョ譖エ譁ー繧定。後≧縺薙→縺後〒縺阪∪縺吶pidxdocmax縺ョ蛟、繧貞、ァ縺阪¥縺吶k縺サ縺ゥ譖エ譁ー諤ァ閭ス縺ッ荳翫′繧翫∪縺吶′縲∵、懃エ「諤ァ閭ス縺ッ荳九′繧翫∪縺吶ら桝莨シ繧、繝ウ繝繝繧ッ繧ケ縺ョ繝槭シ繧ク繧呈守、コ逧縺ォ陦後≧縺ォ縺ッ縲√う繝ウ繝繝繧ッ繧ケ縺ョ蜷梧悄シest_node_syncシ峨r陦後▲縺ヲ縺上□縺輔>縲

逍台シシ繝弱シ繝峨し繝シ繝舌ッ縲∽サ悶ョ繝弱シ繝峨し繝シ繝舌∈縺ョ繧ッ繧ィ繝ェ縺ョ繝ェ繝ャ繝シ繧偵し繝昴シ繝医@縺セ縺帙s縲ゅ▽縺セ繧翫∫桝莨シ繝弱シ繝峨し繝シ繝舌↓蟇セ縺吶k讀懃エ「繧ッ繧ィ繝ェ縺ァ縺ッ縲depth繝代Λ繝。繝シ繧ソ縺ッ辟。隕悶&繧後∪縺吶ゅ∪縺溘∫桝莨シ繝弱シ繝峨し繝シ繝舌ッ逋サ骭イ譁譖ク縺ョ邱ィ髮シest_node_edit_docシ峨↓繧医kURI螻樊ァ縺ョ螟画峩繧偵し繝昴シ繝医@縺セ縺帙s縲


繝。繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、

縺薙%縺ァ縺ッ縲∬ォ也炊遨阪Γ繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、estscout.cgi縺翫h縺ウ隲也炊蜥後Γ繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、estsupt.cgi縺ョ隧ウ邏ー縺ェ莉墓ァ倥r隱ャ譏弱@縺セ縺吶

讒区

隍謨ー縺ョ繧、繝ウ繝繝繧ッ繧ケ縺ォ蟇セ縺吶k蜈ィ譁讀懃エ「縺ョ邨先棡繧定ヲ∫エ縺ィ縺吶k縲ゞRI螻樊ァ遲峨r隴伜挨蟄舌↓縺励◆隲也炊遨搾シ育ゥ埼寔蜷茨シ峨r蜿門セ励☆繧九↓縺ッ縲∬ォ也炊遨阪Γ繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、繧剃スソ縺縺ィ萓ソ蛻ゥ縺ァ縺吶ゆセ九∴縺ー遉セ蜩。蜷咲ーソ縺九i蜷榊燕縺ィ菴乗園縺ョ荳。譁ケ縺ァ邨槭j縺薙蝣エ蜷医∝錐蜑阪r譛ャ譁縺ィ縺励※遉セ蜩。逡ェ蜿キ繧旦RI縺ォ縺励◆譁譖ク鄒、縺ョ繧、繝ウ繝繝繧ッ繧ケ縺ィ縲∽ス乗園繧呈悽譁縺ィ縺励※遉セ蜩。逡ェ蜿キ繧旦RI縺ォ縺励◆譁譖ク鄒、縺ョ繧、繝ウ繝繝繧ッ繧ケ縺ォ蟇セ縺励※隲也炊遨阪Γ繧ソ讀懃エ「繧定。後>縲∽ク。譁ケ縺ォ蜷ォ縺セ繧後k遉セ蜩。逡ェ蜿キ縺ョ繝ェ繧ケ繝医r蠕励k縺薙→縺後〒縺阪∪縺吶ゅ&繧峨↓縲∬、謨ー蝗槭ョ隲也炊遨阪Γ繧ソ讀懃エ「縺ョ邨先棡縺ョ隲也炊蜥鯉シ亥柱髮蜷茨シ峨r蠕励k縺溘a縺ョ隲也炊蜥後Γ繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、繧よ署萓帙&繧後∪縺吶

隲也炊遨阪Γ繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、縺翫h縺ウ隲也炊蜥後Γ繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、縺ッCGI繧ケ繧ッ繝ェ繝励ヨ縺ィ縺励※螳溯」縺輔l縲;ET繝。繧ス繝繝峨ョURL縺ァ繝代Λ繝。繝シ繧ソ繧呈欠螳壹@縺ヲ蛻ゥ逕ィ縺輔l縺セ縺吶API縺ェ縺ゥ縺ョ謚ス雎。蛹悶&繧後◆繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縺ッ謠蝉セ帙&繧後∪縺帙s縲ゅΓ繧ソ讀懃エ「縺ッ繝槭Ν繝√せ繝ャ繝繝峨♀繧医ウ繝槭Ν繝√励Ο繧サ繧ケ縺ァ陦後o繧九ョ縺ァ縲∝謨」蜃ヲ逅縺ォ繧医k繧ケ繧ア繝シ繝ゥ繝薙Μ繝繧」縺ョ蜷台ク翫′譛溷セ縺ァ縺阪∪縺吶

[gateways]

隲也炊遨阪Γ繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、

隲也炊遨阪Γ繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、繧貞茜逕ィ縺吶k縺ォ縺ッ縲,GI繧ケ繧ッ繝ェ繝励ヨestscout.cgi縺ィ縺昴ョ險ュ螳壹ヵ繧。繧、繝ォestscout.conf繧辰GI繧ケ繧ッ繝ェ繝励ヨ縺悟茜逕ィ縺ァ縺阪k蝣エ謇縺ォ險ュ鄂ョ縺励※縺上□縺輔>縲

險ュ螳壹ヵ繧。繧、繝ォ縺ッ縲∝、画焚蜷阪→蛟、繧偵:縲阪〒蛹コ蛻縺」縺溷ス「蠑上ョ陦後r荳ヲ縺ケ縺溘b縺ョ縺ァ縺吶ゅョ繝輔か繝ォ繝医〒縺ッ縲∬ィュ螳壹ヵ繧。繧、繝ォ縺ッ莉・荳九ョ繧医≧縺ェ蜀螳ケ縺ォ縺ェ縺」縺ヲ縺縺セ縺吶

indexname: casket-1
indexname: casket-2
indexname: casket-3
lockindex: 1
condgstep: 2
dotfidf: true
scancheck: 3
phraseform: 2
wildmax: 256
stmode: 0
idattr: @uri
idsuffix:
ordexpr: @uri STRA
dupcheck: 0
union: 0
score: 0
tmpdir: /tmp
cclife: 300
logfile:
logformat: {time}\t{REMOTE_ADDR}:{REMOTE_PORT}\t{cond}\t{hnum}\n

縺昴l縺槭l縺ョ螟画焚縺ョ讖溯ス繧剃サ・荳九↓遉コ縺励∪縺吶

  • indexname : 繧、繝ウ繝繝繧ッ繧ケ縺ョ繝代せ繧呈欠螳壹@縺セ縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • lockindex : 豁」謨ー縺ェ繧峨う繝ウ繝繝繧ッ繧ケ縺ォ繝輔ぃ繧、繝ォ繝ュ繝繧ッ繧偵°縺代∪縺吶
  • condgstep : N-gram縺ョ讀懈渊邊セ蠎ヲ繧呈欠螳壹@縺セ縺吶ゅ1縲阪□縺ィ蜈ィ縺ヲ縺ョ隱槭r隱ソ縺ケ縲√2縲阪□縺ィ1蛟狗スョ縺阪√3縲阪□縺ィ2蛟狗スョ縺阪√4縲阪□縺ィ3蛟狗スョ縺阪↓隱ソ縺ケ縺セ縺吶
  • dotfidf : TF-IDF豕輔r驕ゥ逕ィ縺吶k縺九←縺縺九r謖螳壹@縺セ縺吶ゅtrue縲阪°縲false縲阪〒縺吶
  • scancheck : 譁譖ク縺ョ蜀螳ケ縺ィ讀懃エ「繝輔Ξ繝シ繧コ縺ョ邊セ蟇讀懈渊繧偵☆繧区焚繧呈欠螳壹@縺セ縺吶
  • phraseform : 讀懃エ「譚。莉カ蠑上ョ遞ョ鬘樊欠螳壹@縺セ縺吶ゅ1縲阪□縺ィ騾壼クク譖ク蠑上〒縲√2縲阪□縺ィ邁。萓ソ譖ク蠑上〒縲√3縲阪□縺ィ邊礼払譖ク蠑上〒縲√4縲阪□縺ィ隲也炊蜥梧嶌蠑上〒縲√5縲阪□縺ィ隲也炊遨肴嶌蠑上〒縺吶
  • wildmax : 繝ッ繧、繝ォ繝峨き繝シ繝牙ア暮幕縺ョ譛螟ァ隱樊焚繧呈欠螳壹@縺セ縺吶
  • stmode : 豁」謨ー縺ェ繧峨す繝ウ繧ー繝ォ繧ケ繝ャ繝繝峨Δ繝シ繝峨↓縺ェ繧翫∪縺吶
  • idattr : 譁譖ク縺ョ隴伜挨蟄舌→縺励※逕ィ縺繧句ア樊ァ蜷阪r謖螳壹@縺セ縺吶らゥコ譁蟄怜励ョ蝣エ蜷医ッ繧ケ繧ウ繧「縺瑚ュ伜挨蟄舌→縺励※逕ィ縺繧峨l縺セ縺吶
  • idsuffix : 譁譖ク縺ョ隴伜挨蟄舌ョ謗・蟆セ霎槭→縺励※逕ィ縺繧峨l繧句ア樊ァ蜷阪r謖螳壹@縺セ縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • ordexpr : 螻樊ァ讀懃エ「縺ョ髫帙↓逕ィ縺繧峨l繧矩蠎乗欠螳壼シ上r謖螳壹@縺セ縺吶ゅ∪縺溘ッ縲√$縲阪↓邯壹¢縺ヲ螻樊ァ蜷阪r譖ク縺上→蟶ク縺ォ縺昴ョ螻樊ァ蛟、縺ョ髯埼縺ァ繧ス繝シ繝医&繧後∪縺吶
  • dupcheck : 豁」謨ー縺ェ繧芽ュ伜挨蟄舌ョ驥崎、讀懈渊繧定。後>縺セ縺吶
  • union : 豁」謨ー縺ェ繧芽ォ也炊蜥後Γ繧ソ讀懃エ「繧定。後>縺セ縺吶
  • score : 隲也炊貍皮ョ玲凾縺ョ繧ケ繧ウ繧「縺ョ貍皮ョ玲婿豕輔r謖螳壹@縺セ縺吶ゅ0縲阪□縺ィ蜷郁ィ亥、縲√1縲阪□縺ィ譛螟ァ蛟、縲√2縲阪□縺ィ譛蟆丞、縲√3縲阪□縺ィ蟷ウ蝮蛟、繧呈治逕ィ縺励∪縺吶
  • tmpdir : 荳譎ゅヵ繧。繧、繝ォ繧呈シ邏阪☆繧九ョ繧」繝ャ繧ッ繝医Μ縺ョ繝代せ繧呈欠螳壹@縺セ縺吶
  • cclife : 繧ュ繝」繝繧キ繝・繝輔ぃ繧、繝ォ縺ョ蟇ソ蜻ス繧堤ァ呈焚縺ァ謖螳壹@縺セ縺吶りイ謨ー縺ェ繧臥┌譛滄剞縺ァ縺吶
  • logfile : 繝ュ繧ー繝輔ぃ繧、繝ォ縺ョ繝代せ繧呈欠螳壹@縺セ縺吶
  • logformat : 繝ュ繧ー縺ョ譖ク蠑上r謖螳壹@縺セ縺吶ゅ{time}縲阪ッ迴セ蝨ィ譎ょ綾縺ォ螟画鋤縺輔l縲√{cond}縲阪ッ讀懃エ「譚。莉カ縺ォ鄂ョ謠帙&繧後√{hnum}縲阪ッ讀懃エ「縺ョ隧イ蠖謎サカ謨ー縺ォ鄂ョ謠帙&繧後√◎繧御サ・螟悶〒縲{}縲阪〒諡ャ縺」縺溘b縺ョ縺ッ縺昴ョ蜷榊燕縺ョ迺ー蠅螟画焚縺ョ蛟、縺ォ鄂ョ謠帙&繧後∪縺吶ゅ\t縲阪ッ繧ソ繝悶↓縲√\n縲阪ッ謾ケ陦後↓鄂ョ謠帙&繧後∪縺吶

隲也炊遨阪Γ繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、縺ッ莉・荳九ョ繝代Λ繝。繝シ繧ソ繧貞女縺台サ倥¢縺セ縺吶る蠎乗欠螳壹ッ縺ァ縺阪∪縺帙s縲

  • phrasen : n縺ォ縺ッ1縺九i9縺セ縺ァ縺ョ謨ー蟄励r縺ィ繧翫∝ッセ蠢懊☆繧九う繝ウ繝繝繧ッ繧ケ縺ォ蟇セ縺吶k蜈ィ譁讀懃エ「譚。莉カ繧呈欠螳壹@縺セ縺吶
  • attrn : n縺ォ縺ッ1縺九i9縺セ縺ァ縺ョ謨ー蟄励r縺ィ繧翫∵怙蛻昴ョ繧、繝ウ繝繝繧ッ繧ケ縺ォ蟇セ縺吶k螻樊ァ讀懃エ「譚。莉カ繧呈欠螳壹@縺セ縺吶
  • max : 邨先棡縺ョ陦ィ遉コ莉カ謨ー繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ10莉カ縺ァ縺吶
  • distinct : 驥崎、蝗樣∩螻樊ァ縺ョ蜷榊燕繧呈欠螳壹@縺セ縺吶
  • fresh : 豁」謨ー縺ェ繧峨ー縲√◎縺ョ繧ッ繧ィ繝ェ縺ォ縺ッ繧ュ繝」繝繧キ繝・繧剃スソ縺縺セ縺帙s縲

萓九∴縺ー縲√http://localhost/estscout.cgi縲阪→縺励※險ュ鄂ョ縺励◆隲也炊遨阪Γ繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、縺ォ蟇セ縺励※縲1逡ェ逶ョ縺ョ繧、繝ウ繝繝繧ッ繧ケ縺ォ縺翫>縺ヲ譛ャ譁縺ォ縲mikio縲阪r蜷ォ縺ソ縲2逡ェ逶ョ縺ョ繧、繝ウ繝繝繧ッ繧ケ縺ォ縺翫>縺ヲ譛ャ譁縺ォ縲tokyo縲阪r蜷ォ縺ソ縲1逡ェ逶ョ縺ョ繧、繝ウ繝繝繧ッ繧ケ縺ォ縺翫>縺ヲURI螻樊ァ縺ォ縲123縲阪r蜷ォ繧繧ゅョ繧貞叙蠕励☆繧九↓縺ッ縲∽サ・荳九ョURL縺ョHTTP繝ェ繧ッ繧ィ繧ケ繝医r逋コ陦後@縺セ縺吶

http://localhost/estscout.cgi?phrase1=mikio&phrase2=tokyo&attr1=%40title%20STRINC%20123

蜃コ蜉帙ョ譛蛻昴ョ陦後↓縺ッ隧イ蠖捺焚縺ョ讎らョ励′蜃コ蜉帙&繧後∪縺吶ゅ◎繧御サ・髯阪ョ陦後ッ縲∬ゥイ蠖捺枚譖ク縺ョ隴伜挨蟄舌→繧ケ繧ウ繧「縺後ち繝門玄蛻繧翫〒蜃コ蜉帙&繧後∪縺吶ゆセ九∴縺ー莉・荳九ョ繧医≧縺ォ縺ェ繧翫∪縺吶

256
file:///home/mikio/tako.html   12561
file:///home/mikio/ika.html    11624
file:///home/mikio/uni.html    9232
file:///home/mikio/kani.html   8293
file:///home/mikio/ebi.html    8312

隲也炊蜥後Γ繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、

隲也炊蜥後Γ繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、繧貞茜逕ィ縺吶k縺ォ縺ッ縲,GI繧ケ繧ッ繝ェ繝励ヨestsupt.cgi縺ィ縺昴ョ險ュ螳壹ヵ繧。繧、繝ォestsupt.conf繧辰GI繧ケ繧ッ繝ェ繝励ヨ縺悟茜逕ィ縺ァ縺阪k蝣エ謇縺ォ險ュ鄂ョ縺励※縺上□縺輔>縲

險ュ螳壹ヵ繧。繧、繝ォ縺ッ縲∝、画焚蜷阪→蛟、繧偵:縲阪〒蛹コ蛻縺」縺溷ス「蠑上ョ陦後r荳ヲ縺ケ縺溘b縺ョ縺ァ縺吶ゅョ繝輔か繝ォ繝医〒縺ッ縲∬ィュ螳壹ヵ繧。繧、繝ォ縺ッ莉・荳九ョ繧医≧縺ェ蜀螳ケ縺ォ縺ェ縺」縺ヲ縺縺セ縺吶

targeturl: http://searcher1/estscout.cgi
targeturl: http://searcher2/estscout.cgi
stmode: 0
tmpdir: /tmp
cclife: 1800
#shareurl: http://merger1/estsupt.cgi
#shareurl: http://merger2/estsupt.cgi
failfile:
logfile:
logformat: {time}\t{REMOTE_ADDR}:{REMOTE_PORT}\t{cond}\t{hnum}\n

縺昴l縺槭l縺ョ螟画焚縺ョ讖溯ス繧剃サ・荳九↓遉コ縺励∪縺吶

  • targeturl : 隲也炊遨阪Γ繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、縺ョURL繧呈欠螳壹@縺セ縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • stmode : 豁」謨ー縺ェ繧峨す繝ウ繧ー繝ォ繧ケ繝ャ繝繝峨Δ繝シ繝峨↓縺ェ繧翫∪縺吶
  • score : 隲也炊貍皮ョ玲凾縺ョ繧ケ繧ウ繧「縺ョ貍皮ョ玲婿豕輔r謖螳壹@縺セ縺吶ゅ0縲阪□縺ィ蜷郁ィ亥、縲√1縲阪□縺ィ譛螟ァ蛟、縲√2縲阪□縺ィ譛蟆丞、縲√3縲阪□縺ィ蟷ウ蝮蛟、繧呈治逕ィ縺励∪縺吶
  • tmpdir : 荳譎ゅヵ繧。繧、繝ォ繧呈シ邏阪☆繧九ョ繧」繝ャ繧ッ繝医Μ縺ョ繝代せ繧呈欠螳壹@縺セ縺吶
  • cclife : 繧ュ繝」繝繧キ繝・繝輔ぃ繧、繝ォ縺ョ蟇ソ蜻ス繧堤ァ呈焚縺ァ謖螳壹@縺セ縺吶りイ謨ー縺ェ繧臥┌譛滄剞縺ァ縺吶
  • shareurl : 蜈ア譛峨く繝」繝繧キ繝・逕ィ縺ョ隲也炊蜥後Γ繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、縺ョURL繧呈欠螳壹@縺セ縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • failfile : 螟ア謨礼「コ邇繝輔ぃ繧、繝ォ縺ョ繝代せ繧呈欠螳壹@縺セ縺吶
  • logfile : 繝ュ繧ー繝輔ぃ繧、繝ォ縺ョ繝代せ繧呈欠螳壹@縺セ縺吶
  • logformat : 繝ュ繧ー縺ョ譖ク蠑上r謖螳壹@縺セ縺吶ゅ{time}縲阪ッ迴セ蝨ィ譎ょ綾縺ォ螟画鋤縺輔l縲√{cond}縲阪ッ讀懃エ「譚。莉カ縺ォ鄂ョ謠帙&繧後√{hnum}縲阪ッ讀懃エ「縺ョ隧イ蠖謎サカ謨ー縺ォ鄂ョ謠帙&繧後√◎繧御サ・螟悶〒縲{}縲阪〒諡ャ縺」縺溘b縺ョ縺ッ縺昴ョ蜷榊燕縺ョ迺ー蠅螟画焚縺ョ蛟、縺ォ鄂ョ謠帙&繧後∪縺吶ゅ\t縲阪ッ繧ソ繝悶↓縲√\n縲阪ッ謾ケ陦後↓鄂ョ謠帙&繧後∪縺吶

隲也炊蜥後Γ繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、縺ョ繝代Λ繝。繝シ繧ソ縺翫h縺ウ蜃コ蜉帙ョ蠖「蠑上ッ隲也炊遨阪Γ繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、縺ョ繧ゅョ縺ィ蜈ィ縺丞酔縺倥〒縺吶

隲也炊蜥後Γ繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、縺ッ繝ェ繝「繝シ繝医↓險ュ鄂ョ縺励◆隲也炊遨阪Γ繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、縺ョ讀懃エ「邨先棡繧貞庶髮縺吶k縺薙→縺後〒縺阪∪縺吶ゅ@縺溘′縺」縺ヲ縲∬ォ也炊遨阪Γ繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、繧定、謨ー縺ョ繝槭す繝ウ縺ォ險ュ鄂ョ縺吶k縺薙→縺ァ蛻謨」蜃ヲ逅縺悟庄閭ス縺ィ縺ェ繧翫∪縺吶

螟ア謨礼「コ邇繝輔ぃ繧、繝ォ縺ッ0.0縺九i1.0縺セ縺ァ縺ョ蟆乗焚蠑上r蜀螳ケ縺ィ縺吶k繝輔ぃ繧、繝ォ縺ァ縲√◎縺ョ蛟、縺ョ遒コ邇縺ァ讀懃エ「蜃ヲ逅繧貞、ア謨励&縺帙k縺溘a縺ォ縺ゅj縺セ縺吶ゅす繧ケ繝繝縺ョ雋闕キ縺碁ォ倥☆縺弱k蝣エ蜷医↓縺ッ縺薙ョ繝輔ぃ繧、繝ォ縺ョ蜀螳ケ繧定ェソ謨エ縺励※縲√ち繧、繝繧「繧ヲ繝医↓繧医k霈サ霈ウ繧帝∩縺代※驕狗畑縺吶k縺薙→縺後〒縺阪∪縺吶


蜉ゥ險

縺薙%縺ァ縺ッ縲?yper Estraier縺ョP2P讖滓ァ九r豢サ逕ィ縺吶k縺溘a縺ョ繧ウ繝繧偵>縺上▽縺狗エケ莉九@縺セ縺吶

繝代Λ繝。繝シ繧ソ縺ョ隧ウ邏ー

繝。繧ソ讀懃エ「縺ョ豺ア蠎ヲ縺ッ0縺瑚オキ轤ケ縺ァ縺吶よキア蠎ヲ縺0縺ェ繧芽ェ蜑阪ョ繧、繝ウ繝繝繧ッ繧ケ縺ョ縺ソ繧貞ッセ雎。縺ィ縺励1縺ェ繧峨Μ繝ウ繧ッ蜈医ョ繝弱シ繝峨b蟇セ雎。縺ィ縺励2縺ェ繧峨◎縺ョ蜈医b蟇セ雎。縺ィ縺励3縺ェ繧峨&繧峨↓縺昴ョ蜈医b蟇セ雎。縺ィ縺励∪縺吶ゅ◎繧御サ・荳翫ョ蛟、繧よ欠螳壹〒縺阪∪縺吶ゅけ繝ゥ繧、繧「繝ウ繝医′謖螳壹@縺滓キア蠎ヲ縺後ヮ繝シ繝峨槭せ繧ソ縺ョ險ュ螳壹ヵ繧。繧、繝ォ縺ァ謖螳壹@縺滓キア蠎ヲ繧医j螟ァ縺阪>蝣エ蜷医ッ縲√ヮ繝シ繝峨槭せ繧ソ縺ァ謖螳壹@縺滓婿縺ォ謚代∴繧峨l縺セ縺吶

險ュ螳壹ヵ繧。繧、繝ォ縺ァrateuri縺ョ蛟、繧呈ュ」謨ー縺ォ縺励◆蝣エ蜷医ッ縲∝推譁譖ク縺ョURI螻樊ァ縺ォ蜷ォ縺セ繧後k繝繧」繝ャ繧ッ繝医Μ髫主ア、縺ョ豺ア縺輔′繧ケ繧ウ繧「縺ォ蜿肴丐縺輔l縺セ縺吶る嚴螻、縺梧オ縺菴咲スョ縺ォ縺ゅk縺サ縺ゥ驥崎ヲ√↑譁譖ク縺ァ縲∵キア縺菴咲スョ縺ォ縺ゅk縺サ縺ゥ迹」譛ォ縺ェ譁譖ク縺縺ィ縺縺閠縺域婿縺ォ蝓コ縺・縺縺ヲ縺縺セ縺吶ょキ蜷育噪縺ォ縺ッ縲∽サ・荳九ョ蛟、繧定ィ育ョ励@縺セ縺吶

  • score * (8 / (4 + depth))

萓九∴縺ー縲√敬ttp://foo.go.jp/bar/baz.html縲阪ョ髫主ア、縺ョ豺ア縺輔ッ2縺ァ縺吶ョ縺ァ縲∝譚・縺ョ繧ケ繧ウ繧「縺ォ1.333縺梧寺縺代i繧後∪縺吶ゅ敬ttp://abc.gov/def/ghi/jkl/mno/pqr.html縲阪ョ髫主ア、縺ョ豺ア縺輔ッ5縺ァ縺吶ョ縺ァ縲∝譚・縺ョ繧ケ繧ウ繧「縺ォ0.888縺梧寺縺代i繧後∪縺吶

繝ェ繝ウ繧ッ縺ョ菫。鬆シ蠎ヲ縺ッ讀懃エ「邨先棡縺ョ蜷譁譖ク縺ョ鬆菴阪r豎コ螳壹☆繧矩圀縺ォ蛻ゥ逕ィ縺輔l縺セ縺吶ょ推繝弱シ繝峨°繧牙庶髮縺励◆邨先棡繧偵槭シ繧ク縺吶k髫帙↓縺ッ縲∝推譁譖ク縺ォ縺、縺縺ヲ莉・荳九ョ蛟、縺瑚ィ育ョ励&繧後√◎繧後′螟ァ縺阪>繧ゅョ縺九i謠千、コ縺輔l縺セ縺吶Tcore縺ッ蜷譁譖ク縺ョ繝弱シ繝峨↓縺翫¢繧九せ繧ウ繧「縺ァ縺吶Nax縺ッ陦ィ遉コ莉カ謨ー縺ァ縺吶Sank縺ッ繝弱シ繝牙縺ョ陦ィ遉コ鬆菴阪〒縺吶Dredit縺ッ蜷繝弱シ繝峨ョ菫。鬆シ蠎ヲ繧10000縺ァ蜑イ縺」縺溘b縺ョ縺ァ縺吶

  • score * (max * 2 - rank) * credit

萓九∴縺ー縲∽ソ。鬆シ蠎ヲ15000縺ョ繝弱シ繝峨↓蟇セ縺励※10莉カ縺ョ譁譖ク繧貞撫縺蜷医o縺帙◆邨先棡縺ョ4菴阪ョ譁譖ク縺ョ繧ケ繧ウ繧「縺1000縺縺」縺溷エ蜷医∬ェソ謨エ蠕後ョ繧ケ繧ウ繧「縺ッ縲1000 * (10 * 2 - 4) * (15000 / 10000)縲阪〒24000縺ォ縺ェ繧翫∪縺吶ゅ↑縺翫∬ィュ螳壹ヵ繧。繧、繝ォ縺ァmergemethod縺ョ蛟、繧1縺ォ縺励◆蝣エ蜷医ッ縲茎core * credit縲阪→縺縺蠑上′逕ィ縺繧峨l縲3縺ォ縺励◆蝣エ蜷医ッ縲(max - rank) * credit縲阪→縺縺蠑上′逕ィ縺繧峨l縺セ縺吶ゅ◆縺縺励scoreexpr縺4シasisシ峨ョ蝣エ蜷医ッ繧ケ繧ウ繧「縺ョ隱ソ謨エ縺ッ荳蛻陦後o繧後∪縺帙s縲

蜷譁譖ク縺ォ縺翫>縺ヲ@weight縺ィ縺縺螻樊ァ縺悟ョ夂セゥ縺輔l縺ヲ縺縺溷エ蜷医√◎縺ョ蛟、縺瑚ェソ謨エ蠕後ョ繧ケ繧ウ繧「縺ォ謗帙¢繧峨l縺セ縺吶ゅ%繧後↓繧医▲縺ヲ迚ケ螳壹ョ譁譖ク縺ォ驥阪∩縺・縺代r陦後≧縺薙→縺後〒縺阪∪縺吶ょ、縺ッ蟆乗焚縺ァ謖螳壹〒縺阪∪縺吶ゆセ九∴縺ー隱ソ謨エ蠕後ョ繧ケ繧ウ繧「縺24000縺ァ@weight縺1.5縺ョ蝣エ蜷医ッ36000縺ォ縺ェ繧翫∪縺吶

閾ェ蜑阪ョ繧、繝ウ繝繝繧ッ繧ケ縺ョ菫。鬆シ蠎ヲ縺ッ10000縺ァ蝗コ螳壹〒縺吶ゅ@縺溘′縺」縺ヲ縲∽サ悶ョ繝弱シ繝峨∈縺ョ繝ェ繝ウ繧ッ縺ョ菫。鬆シ蠎ヲ縺ッ縲√◎縺ョ邨先棡繧定ェ蜑阪ョ繧、繝ウ繝繝繧ッ繧ケ縺ョ邨先棡繧医j荳贋ス阪↓縺励◆縺蝣エ蜷医ッ10000繧医j螟ァ縺阪¥縺励∽ク倶ス阪↓縺励◆縺蝣エ蜷医ッ10000繧医j蟆上&縺上☆繧九→繧医>縺ァ縺励g縺縲

隱崎ィシ讖滓ァ九ョ隧ウ邏ー

隱崎ィシ讖滓ァ九ョ繝「繝シ繝峨ッ3遞ョ鬘槭≠繧翫∬ィュ螳壹ヵ繧。繧、繝ォ縺ァ謖螳壹&繧後∪縺吶ゅョ繝輔か繝ォ繝医ッ2縺ァ縺吶ゆサ・荳九ョ陦ィ縺ァ縺ッ縲∝推遞ョ縺ョ謫堺ス懊↓蟇セ縺励※蛹ソ蜷阪r險ア蜿ッ縺吶k蝣エ蜷医ッ縲娯雷縲阪∬ェ崎ィシ繧定。後≧蝣エ蜷医ッ縲古励阪r遉コ縺励∪縺吶ゅヮ繝シ繝峨し繝シ繝舌ョ邂。逅謫堺ス懊→縺ッ縲put_docout_doc_set_user_set_link縺ョ縺薙→縺ァ縺吶ゅヮ繝シ繝峨し繝シ繝舌↓蟇セ縺吶k縺昴l莉・螟悶ョ謫堺ス懊ッ騾壼クク謫堺ス懊〒縺吶

1シnoneシ 2シadminシ 3シallシ
繝弱シ繝峨槭せ繧ソ縺ョ謫堺ス
繝弱シ繝峨し繝シ繝舌ョ邂。逅謫堺ス
繝弱シ繝峨し繝シ繝舌ョ騾壼クク謫堺ス

隱崎ィシ讖滓ァ九′縺ゅ▲縺ヲ繧ょケウ譁繧偵ロ繝繝医Ρ繝シ繧ッ荳翫↓豬√☆縺ョ縺ァ縺ッ繧サ繧ュ繝・繝ェ繝繧」縺ィ縺励※縺ッ荳榊香蛻縺ァ縺吶ら音縺ォHTTP縺ョ蝓コ譛ャ隱崎ィシ縺ョ繧サ繧ュ繝・繝ェ繝繧」縺ッ菴弱¥縲驍ェ謔ェ縺ェ莠コ驕斐↓縺ッ蜈ィ縺冗┌蜉帙→險縺」縺ヲ繧る℃險縺ァ縺ッ縺ゅj縺セ縺帙s縲ゅ@縺溘′縺」縺ヲ縲驥崎ヲ√↑繝繝シ繧ソ繧呈桶縺髫帙↓縺ッ縲騾壻ソ。繧呈囓蜿キ蛹悶☆繧九%縺ィ繧偵♀阮ヲ繧√@縺セ縺吶ゅ◆縺縺励?yper Estraier閾ェ菴薙ッ證怜捷騾壻ソ。縺ョ讖溯ス繧呈署萓帙@縺セ縺帙s縺ョ縺ァ縲、pache遲峨r繝ェ繝舌シ繧ケ繝励Ο繧ッ繧キ縺ィ縺励※蛻ゥ逕ィ縺励※縺上□縺輔>縲ょ酔譎よ磁邯壽焚縺悟、壹>蝣エ蜷医ッ蟶りイゥ縺ョSSL繧「繧ッ繧サ繝ゥ繝ャ繝シ繧ソ繧貞茜逕ィ縺吶k縺ィ繧医>縺ァ縺励g縺縲

縺薙ョ繧医≧縺ェ隱崎ィシ讖滓ァ九′豌励↓蜈・繧峨↑縺蝣エ蜷医ッ縲√ヵ繝ュ繝ウ繝医お繝ウ繝峨ョ繧ッ繝ゥ繧、繧「繝ウ繝医r螳溯」縺励※縲√◎縺薙〒繧「繧ォ繧ヲ繝ウ繝育ョ。逅縺ィ隱崎ィシ繧定。後▲縺ヲ縺上□縺輔>縲ゅヵ繝ュ繝ウ繝医お繝ウ繝峨′繝舌ャ繧ッ繧ィ繝ウ繝峨〒縺ゅk繝弱シ繝峨槭せ繧ソ繧繝弱シ繝峨し繝シ繝舌↓繧「繧ッ繧サ繧ケ縺吶k髫帙↓縺ッ蟶ク縺ォ繧ケ繝シ繝代シ繝ヲ繝シ繧カ繧堤畑縺繧九→繧医>縺ァ縺励g縺縲Apache繧偵ヵ繝ュ繝ウ繝医お繝ウ繝峨↓縺吶l縺ー縲[od_auth_ldap繧剃スソ縺」縺ヲLDAP縺ォ繧医k隱崎ィシ繧定。後▲縺溘j縲[od_auth_radius繧剃スソ縺」縺ヲRADIUS縺ォ繧医k隱崎ィシ繧定。後▲縺溘j縺ァ縺阪∪縺吶Location繝繧」繝ャ繧ッ繝繧」繝悶↑縺ゥ繧帝ァ菴ソ縺吶l縺ー蜷繝。繧ス繝繝峨ョ繧「繧ッ繧サ繧ケ讓ゥ髯舌r隧ウ邏ー縺ォ險ュ螳壹☆繧九%縺ィ繧ゅ〒縺阪∪縺吶

鬘樔シシ讀懃エ「

險ュ螳壹ヵ繧。繧、繝ォ縺ョsmlrvnum縺ョ蛟、繧1莉・荳翫↓縺吶k縺ィ縲鬘樔シシ讀懃エ「縺梧怏蜉ケ縺ォ縺ェ繧翫∪縺吶ゅ%縺ョ迥カ諷九〒繝弱シ繝峨し繝シ繝舌↓譁譖ク繧堤匳骭イ縺吶k縺ィ縲鬘樔シシ讀懃エ「逕ィ縺ョ繧ュ繝シ繝ッ繝シ繝峨′謚ス蜃コ縺輔l縺ヲ蜀驛ィ縺ァ邂。逅縺輔l繧九h縺縺ォ縺ェ繧翫∪縺吶

繧ュ繝シ繝ッ繝シ繝峨ョ驕ク螳壹↓縺ッTF-IDF豕輔r逕ィ縺縺セ縺吶′縲√ョ繝輔か繝ォ繝医〒縺ッ縲∵枚譖ク鬆サ蠎ヲシDFシ峨ョ邂怜コ縺ォ縺ッ縺昴ョ繝弱シ繝峨ョ譌「蟄倥ョ逋サ骭イ譁譖ク繧堤畑縺縺セ縺吶ゅ@縺溘′縺」縺ヲ縲√ッ縺倥a縺ョ譁ケ縺ォ逋サ骭イ縺励◆譁譖ク縺ィ蠕後ョ譁ケ縺ォ逋サ骭イ縺励◆譁譖ク縺ィ縺ァ縺ッTF-IDF豕輔ョ蠑キ縺輔↓蟾ョ縺悟コ縺ヲ縺阪∪縺吶ゅ%繧後r蝗樣∩縺吶k縺溘a縺ォ縲∽コ医a逕滓舌@縺滓枚譖ク鬆サ蠎ヲ縺ョ繝繝シ繧ソ繝吶シ繧ケ繧堤畑縺繧九%縺ィ縺後〒縺阪∪縺吶estcmd words繧ウ繝槭Φ繝峨〒逕滓舌@縺溘ョ繝シ繧ソ繝吶シ繧ケ繧偵し繝シ繝舌Ν繝シ繝医ョ繧」繝ャ繧ッ繝医Μ縺ョ逶エ荳九↓縲_dfdb縲阪→縺縺繝輔ぃ繧、繝ォ蜷阪〒鄂ョ縺縺ヲ縺上□縺輔>縲

騾壼クク縺ョWeb讖溯ス

繝弱シ繝峨槭せ繧ソ縺ッ騾壼クク縺ョWeb繧オ繝シ繝舌→縺励※縺ョ讖溯ス繧ょy縺医※縺縺セ縺吶ゅ%縺ョ讖溯ス縺ッ讀懃エ「蟇セ雎。譁譖ク縺ョ螳滉ス薙r蜈ャ髢九☆繧句エ蜷医↓萓ソ蛻ゥ縺ァ縺励g縺縲ゆセ九∴縺ー縲√/home/www/public_html縲堺サ・荳九r蜈ャ髢九@縺溘>蝣エ蜷医ッ縲∬ィュ螳壹ヵ繧。繧、繝ォ縺ォ莉・荳九ョ繧医≧縺ォ譖ク縺阪∪縺吶

docroot: /home/www/public_html
indexfile: index.html

繝舌ャ繧ッ繧「繝繝

險ュ螳壹ヵ繧。繧、繝ォ縺ョbackupcmd縺ォ莉サ諢上ョ繧ウ繝槭Φ繝峨r謖螳壹☆繧九%縺ィ縺ォ繧医j縲√ヮ繝シ繝峨槭せ繧ソ縺ョ遞シ蜒堺クュ縺ォ繝繝シ繧ソ繝吶シ繧ケ縺ョ繝舌ャ繧ッ繧「繝繝励r蜿悶k縺薙→縺後〒縺阪∪縺吶ゅヮ繝シ繝峨槭せ繧ソ邨縺ソ霎シ縺ソ縺ョ繝ヲ繝シ繧カ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縺九i縲沓ACKUP縲阪r螳溯。後☆繧九→縲∝ィ縺ヲ縺ョ繝弱シ繝峨ョ繝繝シ繧ソ繝吶シ繧ケ繧偵ョ繝舌う繧ケ縺ォ蜷梧悄縺輔○縺滉ク翫〒縲backupcmd縺ァ謖螳壹@縺溘ヰ繝繧ッ繧「繝繝励さ繝槭Φ繝峨′蜻シ縺ウ蜃コ縺輔l縺セ縺吶ゅヰ繝繧ッ繧「繝繝励さ繝槭Φ繝峨ョ隨ャ1蠑墓焚縺ォ縺ッ繧オ繝シ繝舌Ν繝シ繝医ョ繧」繝ャ繧ッ繝医Μ縺ョ邨カ蟇セ繝代せ縺梧欠螳壹&繧後∪縺吶る壼クク縺ッ縲∽サ・荳九ョ繧医≧縺ェ繧キ繧ァ繝ォ繧ケ繧ッ繝ェ繝励ヨ繧堤畑諢上@縺ヲ縲√◎縺ョ繝代せ繧呈欠螳壹☆繧九→繧医>縺ァ縺励g縺縲

#! /bin/sh
cd "$1"
name=`printf '%s' ${PWD##*/}`
cd ..
find "./$name" -depth | grep -v './_pid' |
cpio -o > "$name.`date -I`.cpio"

_pid繝輔ぃ繧、繝ォ縺ッ荳崎ヲ√〒縺吶ョ縺ァ縲√い繝シ繧ォ繧、繝悶↓蜷ォ繧√↑縺繧医≧縺ォ縺吶k縺九√い繝シ繧ォ繧、繝悶r螻暮幕縺励◆蠕後↓蜑企勁縺吶k繧医≧縺ォ縺励※縺上□縺輔>縲ゅ↑縺翫,PIO蠖「蠑上ョ繝輔ぃ繧、繝ォ縺ッ縲慶pio -idv < casket.xxx.cpio縲阪↑縺ゥ縺ィ縺吶k縺ィ螻暮幕縺ァ縺阪∪縺吶

雋闕キ繝繧ケ繝育畑繧ウ繝槭Φ繝

蜷遞ョ縺ョWeb繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ォ蟇セ縺吶k雋闕キ繝繧ケ繝医ョ縺溘a縺ョ繝ヲ繝シ繝繧」繝ェ繝繧」縺ィ縺励※縲estload繧ウ繝槭Φ繝峨′謠蝉セ帙&繧後∪縺吶ゆサ・荳九ョ譖ク蠑上r謖√■縺セ縺吶

estload [-t num] [-l num] [-i num] [-p] [-q] [file|url]
file繧呈欠螳壹@縺溷エ蜷医√◎縺ョ繝輔ぃ繧、繝ォ縺ョ蜷陦後↓蜷ォ縺セ繧後kURL縺ョ繝ェ繧ッ繧ィ繧ケ繝医r逋コ陦後@縺セ縺吶url繧呈欠螳壹@縺溷エ蜷医√◎縺ョURL縺ョ繝ェ繧ッ繧ィ繧ケ繝医r逋コ陦後@縺セ縺吶ゆス輔b謖螳壹@縺ェ縺九▲縺溷エ蜷医∵ィ呎コ門・蜉帙ョ蜷陦後↓蜷ォ縺セ繧後kURL縺ョ繝ェ繧ッ繧ィ繧ケ繝医r逋コ陦後@縺セ縺吶
-t縺ッ荳ヲ陦後@縺ヲ蜍輔°縺吶せ繝ャ繝繝峨ョ謨ー繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ1縺ァ縺吶
-l縺ッ繝ェ繧ケ繝医r郢ー繧願ソ斐☆蝗樊焚繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ1縺ァ縺吶
-i縺ッ繝ェ繧ッ繧ィ繧ケ繝医r逋コ陦後@縺ヲ縺九i繧ケ繝ェ繝シ繝励☆繧区凾髢薙r繝溘Μ遘貞腰菴阪〒謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ0縺ァ縺吶
-p繧呈欠螳壹☆繧九→縲√Ξ繧ケ繝昴Φ繧ケ繧定。ィ遉コ縺励∪縺吶
-q繧呈欠螳壹☆繧九→縲騾イ謐礼憾諷九r陦ィ遉コ縺励∪縺帙s縲

蛻晄悄蟆主・縺ョ蜉ケ邇蛹

螟ァ隕乗ィ。縺ェ繧オ繧、繝医ョ遶九■荳翫£繧堤エ譌ゥ縺剰。後>縺溘>蝣エ蜷医estcmd繧貞茜逕ィ縺吶k縺九い繝励Μ繧ア繝シ繧キ繝ァ繝ウ繧剃ス懈舌☆繧九°縺励※縲√さ繧「API縺ョ繝ャ繝吶Ν縺ァ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懊▲縺滓婿縺後h縺縺ァ縺励g縺縲ゅ◎縺縺励※菴懊▲縺溘う繝ウ繝繝繧ッ繧ケ縺ッ縲√ヮ繝シ繝峨ョ繧」繝ャ繧ッ繝医Μ縺ォ鄂ョ縺上%縺ィ縺ァ繝弱シ繝峨し繝シ繝舌→縺励※蛻ゥ逕ィ縺吶k縺薙→縺後〒縺阪∪縺吶ゆセ九∴縺ー縲√/home/mikio縲堺サ・荳九ョ譁譖ク繧堤匳骭イ縺励◆縲∝錐蜑阪′縲mikio縲阪〒繝ゥ繝吶Ν縺後Mikio Hirabayashi縲阪ョ繝弱シ繝峨し繝シ繝舌r險ュ鄂ョ縺吶k縺ォ縺ッ縲∽サ・荳九ョ繧医≧縺ォ縺励∪縺吶

estmaster init casket
estcmd gather -sd -il ja casket/_node/mikio /home/mikio
estcmd meta casket/_node/mikio label "Mikio Hirabayashi"

鬘樔シシ讀懃エ「繧呈怏蜉ケ縺ォ縺吶k蝣エ蜷医ッ縲∽サ・荳九ョ繧ウ繝槭Φ繝峨b螳溯。後@縺ヲ繧ュ繝シ繝ッ繝シ繝峨ョ繝シ繧ソ繝吶シ繧ケ繧剃ス懊▲縺ヲ縺上□縺輔>縲

estcmd extkeys casket/_node/mikio

繝ヲ繝シ繧カ繧繝ェ繝ウ繧ッ縺ョ險ュ螳壹ッ縲√ヮ繝シ繝峨槭せ繧ソ繧定オキ蜍輔&縺帙◆荳翫〒縲√ヮ繝シ繝陰PI繧estcall繧ウ繝槭Φ繝峨r菴ソ縺」縺ヲ陦後▲縺ヲ縺上□縺輔>縲ゅ↑縺翫estcall縺ォ縺ッestcmd gather縺ョ繧医≧縺ェ繧ョ繝」繧カ繝ゥ逕ィ縺ョ繧オ繝悶さ繝槭Φ繝峨ッ逕ィ諢上&繧後※縺縺セ縺帙s縲findestcmd draft縺ェ縺ゥ繧堤オ縺ソ蜷医o縺帙l縺ー蜷檎ュ峨ョ縺薙→縺ッ蜿ッ閭ス縺ァ縺吶よ怙繧らー。蜊倥↓縺ッ縲∽サ・荳九ョ繧医≧縺ォ縺励∪縺吶

find /home/mikio/public_html -type f -name '*.html' |
while read file ; do
  estcmd draft -fh -il ja "$file" |
  estcall put -auth admin admin http://localhost:1978/node/test1
done

Windows繧オ繝シ繝薙せ

Windows迚医ョ繝舌う繝翫Μ繝代ャ繧ア繝シ繧ク縺ォ縺ッ縲√ヮ繝シ繝峨槭せ繧ソ縺ョWindows繧オ繝シ繝薙せ迚医b蜷梧「ア縺輔l縺セ縺吶ゅΟ繧ー繧ェ繝ウ縺励※縺縺ェ縺迥カ諷九〒繧ゅヮ繝シ繝峨槭せ繧ソ繧貞虚縺九@縺溘>蝣エ蜷医↓縺ッWindows繧オ繝シ繝薙せ縺悟スケ遶九■縺セ縺吶ゅ%縺薙〒縺ッ縲√C:\hyperestraier縲阪ョ荳ュ縺ォHyper Estraier縺ョ繧ウ繝槭Φ繝峨dDLL縺ョ荳蠑上r鄂ョ縺縺ヲ縲√◎縺薙↓繝代せ繧帝壹@縺ヲ縺ゅk縺薙→繧貞燕謠舌↓縲仝indows繧オ繝シ繝薙せ迚医ョ蟆主・謇矩繧定ェャ譏弱@縺セ縺吶

縺セ縺壹√し繝シ繝舌Ν繝シ繝医ョ繧」繝ャ繧ッ繝医Μ繧剃ス懈舌@縺セ縺吶ゅさ繝槭Φ繝峨励Ο繝ウ繝励ヨ縺ァ莉・荳九r螳溯。後@縺セ縺吶

estmaster init C:\hyperestraier\casket

繝弱シ繝峨槭せ繧ソ縺ョ繧オ繝シ繝薙せ繧堤匳骭イ縺励∪縺吶ゅさ繝槭Φ繝峨励Ο繝ウ繝励ヨ縺ァ莉・荳九r螳溯。後@縺セ縺吶ゅ↑縺翫∬。梧忰縺ョ縲^縲阪ッ繧ウ繝槭Φ繝峨励Ο繝ウ繝励ヨ縺ョ繧ィ繧ケ繧ア繝シ繝玲枚蟄励〒縺吶

scmutil install estraier ESTRAIER ^
  C:\hyperestraier\estmaster-sv.exe C:\hyperestraier\casket

縲後さ繝ウ繝医Ο繝シ繝ォ繝代ロ繝ォ縲阪ョ縲檎ョ。逅繝繝シ繝ォ縲阪ョ縲後し繝シ繝薙せ縲阪r髢九¥縺ィ縲√estraier縲阪→縺縺繧オ繝シ繝薙せ縺檎匳骭イ縺輔l縺ヲ縺繧九ッ縺壹〒縺吶ゅ◎繧後r髢句ァ九☆繧後ー縲√ヮ繝シ繝峨槭せ繧ソ縺瑚オキ蜍輔@縺セ縺吶ゅ≠縺ィ縺ッ縲騾壼クク縺ョWindows繧オ繝シ繝薙せ縺ィ蜷梧ァ倥↓謇ア縺縺薙→縺後〒縺阪∪縺吶ゅΟ繧ー繧ェ繝輔@縺ヲ繧ゅヮ繝シ繝峨槭せ繧ソ縺ッ蜍穂ス懊@邯壹¢縺セ縺吶@縲√す繝」繝繝医ム繧ヲ繝ウ縺ョ髫帙↓縺ッ豁」蟶ク邨ゆコ縺励∪縺吶ゅす繧ケ繝繝襍キ蜍墓凾縺ォ繝弱シ繝峨槭せ繧ソ繧りェ蜍戊オキ蜍輔☆繧九h縺縺ォ險ュ螳壹☆繧九%縺ィ繧ゅ〒縺阪∪縺吶

scmutil縺ッWindows繧オ繝シ繝薙せ縺ョ繧、繝ウ繧ケ繝医シ繝ォ縺ィ繧「繝ウ繧、繝ウ繧ケ繝医シ繝ォ縺ョ縺溘a縺ョ繧ウ繝槭Φ繝峨〒縺吶ゆサ・荳九ョ譖ク蠑上r謖√■縺セ縺吶

scmutil install name label command ...
繧オ繝シ繝薙せ繧偵う繝ウ繧ケ繝医シ繝ォ縺励∪縺吶
name縺ッ繧オ繝シ繝薙せ縺ョ蜷榊燕繧呈欠螳壹@縺セ縺吶
label縺ッ繧オ繝シ繝薙せ縺ョ繝ゥ繝吶Ν繧呈欠螳壹@縺セ縺吶
command縺ッ繧オ繝シ繝薙せ縺ョ襍キ蜍輔さ繝槭Φ繝峨r謖螳壹@縺セ縺吶ゅさ繝槭Φ繝峨d繝輔ぃ繧、繝ォ縺ョ繝代せ縺ォ縺ッ邨カ蟇セ繝代せ繧堤畑縺縺セ縺吶
scmutil uninstall name
繧オ繝シ繝薙せ繧偵い繝ウ繧、繝ウ繧ケ繝医シ繝ォ縺励∪縺吶
name縺ッ繧オ繝シ繝薙せ縺ョ蜷榊燕繧呈欠螳壹@縺セ縺吶

estmaster-sv.exe縺ッ繧オ繝シ繝薙せ蟆ら畑縺ョ繧ウ繝槭Φ繝峨〒縺吶りオキ蜍墓凾縺ョ隨ャ1蠑墓焚縺ァ繧オ繝シ繝舌Ν繝シ繝医ョ繧」繝ャ繧ッ繝医Μ繧呈欠螳壹@縺セ縺吶


hyperestraier-1.4.13/doc/nodeframe.png000066400000000000000000000306651125261632700177200ustar00rootroot00000000000000臼NG  IHDRミ^巒リgAMAXヌG cHRMz%u.鸚:oi萋+PLTE痘菻菲クノ糢~フハフッゥイル裨旧メ矼ノヨリケトス蔟葮レルz{xトノ>><矇サソコqpk総|リミウリトルノa__JII鳬333悃、.4IDATx彙」`bh撃Q@M@」 z +@」 z +@」 z +@」 z +@」 z +@」 z +@」 z +@」 z +@」 z +@#!Aヒーイ20H獅!DXYeネ獲 Z皿D@lL」`ネ6P$(ツ&Gz|ミ0Oミャ窒,lフ」`H6>)IVRc uv租鏐&IKiホ 哂jエpM潟、H癪e%:2F5Ζ, ム@テ6A叱6 `停%>゙hク&hnIニ℃Q@-タHB゚ iよ鍠ヤ奪林4<エh<シ#ムh ZFdエ<フ$4,4テ顏ニー D酌ミpLミrR4RトヘーミpLミ"テu>=>Q@テ0A゚p,ヒa丐G L註T)/」!0>LM1ァUGK鞦 IミDT"、i゙&fS/A0ZB_@L b4$ヒg$8>Mミテモ bエ ハg d」F=ZB_@L @D("コ恤裸`,r@aB衙ク 喧ミテ蕩%Rト隆!M鋩。$ヲW孟L,,T淇ga。 ,"ヤv「 5]80?L "蝿H゚テXトAiヤhD/。%・$Dゥ $・ゥuOネ"Tv。ィ、粕シ6ト3|+EmII DbレミDI>,・)鏥HJEァ!%4\"pハb-ヌゥ1差珸ァ、ニ儁l3 Bエp?ソヴ 5レc@、M DbJh"B霧2シス,洲」`yhロヒckSS#A)。YEトiトDY)M,"Rツ4t!ソーナg ウJムミB"Rク遭 @D%hュeXi #穂ク0]Kh&APb。QルニツR6;$%h>~!I S4(ヌムヤ債クS41  +。ア産`/zレヲニ玲ムフ・i ヘ(Hモツ )Jム"4w!?e)z`遭64@塑B*擅%4セメ呀%エ?才 f0_6)倫2Z樺v4(iF怐HL @荼。蜑kC(ト鰄f"サネ P2叩メT抵ツDb4@苔枚キ。 屍ハテF9鐓B メコチ$):ク)ネsざ#Bナク遭 @荼。ムニ捍?嶋iXBウ 端\ネd ノo t モ イG9mid2HテZJ蝿イA^橙E妃萃(Hトウシ<裹ル=W)>"フ9然7aDbJh"ウ 剤芳ヲ)テ4,。泳氓繧B@v寃偬)5\ネ/E,@"1  (,。ゥ iXB えT鏖苑屏E$餤?r Dよ礎7Db4@Qリヲ.ヲe >G wHYァ" タ&eK!イエ、拿ネ/Bス<!遭64@鵠」ス2萌襪ヒh !ct1TsノNミタV>z}‖キ<埒pa`娃ケ只裁^ニD~、ー薑チ鐫ィ覲PBmh鹵孟 ;d且。) M%?f 「ハ4=\HA =タ?LSBck/cヌZFねyyフイI:mh繋r!vC$7」ヨHbィn、(Acエ粒cー蕷5靜睇礇ェオ。h、エ。I*\振ノテEミ ク1 a@R M 餤Bモ 永Cミ)。ア窃澀メミコ 香栄CCメZ尹vmhNドカChモ イロミワlnlfD ヘOBVワQク8Khjサ%4遭 @苺ミl梯yImCモ Sッ M3Lス64ュ0  ネiCsイHrP ク$ムマc「g M+@ス喃z%4ュmh"ァ跂<9$ラタオ。iゥラヲヲ^啖 ネhCウIR'=pp \啖`エ┬ A%エ+オ4 輊FロミLA 2レミTKマ}K夊テ/ ムロミツ探q1`oC縄B6エ0uツ慰iCユロミ Z""泥Oミ 3ケYhヨfc'hdN-ヤ「ィ%+4.リ?pr|"z -I旆ミ<Iミ$クzタ#ス像 @4/。 %hvNnIy)囎ミlもxCkC糾RゥlチlCウ{Jト'`ラ 」 ヘ/H%ア點M ムロミ「「ヤ Cqajオ。按640ケBメ+'X(序ヘホ-鼡モャ ヘ鶉s`."ヤ+トPO<ニク絨Jr%エZX核.G$ムメ5アコヨヤ @孟T e!x[wよ桑 r#ナ@R+1ュ ェマiモ$w オ -,Iオ:D\オ -H・ミレミ綴鼇@:mh「ー 工ノjど)ф-エ推chGA+\ィリ@ナ(\腦/蕀ミKh5P ュ&ム 2メ1ノNミDi 5ACモ.<#フhM.P懲eXムロミ綴堯規ス Nメ$%>F64(ASヒ"ィ鉋ロミdケス Nミヤq」ルリ$h「ク 坤ЁIセx4ミL`懲eZ4鵐酊倭HH.ト>ハAモ咼r@\H@トtゥ hRB#ァd(+Aοd畝] ヘD・cb1#ムwヒ2A\(Eソ6エ$y.D芭h「N1ハ!2ハAD亰t/\:厘艢Db4@災オエmC靺& 64@災オク y<< ツネ メサ┬Y モSB噸密 M2 ォ -O\mhメYmhyカ。h隰6フ。 0ニCヤlCSォp′]Bネ|Mク&テКh「8タ?d@m、 ツ@zイルt。・+豢$aリ゚_)ォ<゚2t0僊r/To ヨャ.xンネミXュコ/t'C#讌ァg:シヲ糢knlghヤ+剪キIウコ瑾ケ } 。メF、ayiシ 壺64(&苟YP賢、!ヲЁNx41%4.$「&ニ偉トオ。hィ頒ネ,ュ 0ャ -/G臑5 緞 ム&>AnC#ワ$鞘^qHYUチ64ム 圷64ロuョ:йmh*mh-叉M葡ヤ雕響(。It瓠頒ヤD"4@楚Bs R/AKイ曾Bテク4レミ鐺8゙序64R _ァ占64z"執!「 MIkC」%トクニ昏ラ "禰刈枸'ナEオ-ネEZZスィニヤ.。ナゥヨF01 3%4A[Bp"3qmh"B $J ヘノA・罍yxリDPM紋#摺蕾G;ーコ褒mhp=Iフムmh w&・ -ュネ 偲ロ&漾2レミ漾т・8ツンXPッ @D(瘰BiCウsQ腋~0絶B+クyプ」dRJhy4>F&\B/。9phャ "禰 r。肇ワRlヤHホ@c8ムZ鋩\ハテリエiC刀F4Mq%[ヒAニZ"&AK。殺S泛$@DJュ|訶タ屏Τ& 鍵カ#案エ。ヘ&v ;'・ 嚶ンLN)6鞄3uラrt-qx@ラrゥラ b4クF-」i9、(Mフ 0ZBcゃRB蕩葵ヘ+ネヘ運朿rKR囗A`0カ。」。ゥメ 「4ィムA刹* 紗.%41mh".AKsHムク梧ニ7dG mC嬢64@寥クミ}・"趙荐(#q%エユ aレ頒bエ<9鵜't 蕩郁rQVRmオ 'ヨ、%(。Pハ?>ェ |ヤiCK「#@ナウ@椥Fヘ>j。8オレミDBEマKRоユ3ホZオ討ホルヒナ0ケ Zg>ェhナソ、儂」U%エ。J-ラチp片ツィーt。Rルzn& 慧!)観ニ`qI1TソKq宣DAaTソRュ枋A;察$ヲa裏q頒R|ィ・ソ5QI!エ6肝ヤツ(叔0uホヌCソテDH占鳶ムjク3Eア"1  ]とQBウ 「タ2ZJR燃 叡dsアロOLrAヲ茅()V73深ヘ,ェ"j{ 蕩hリ%h%4z#TR Sツb閹吊窶カ9ミLcワr` Dbレミ44囮A ュ」 ヲ オ`エi)ネrタ@、G篶rト頒44ョ>7オ禀リ、ロ@)"サM4焉HLa裏q片}t`JJ? `側}'ノBムe、>ニ案$hv g ヘフ*ye)u +EゥYヨe4ー櫑 Y1嶝Tツク遭64@ サ砂ff?hUカ羽;,R 4s3HQV>テ素nト案頒44セ^勁 稔ッゥЕ),タMPP」ラO ニ HQ.迂ミ44i0IAy)Ib *蟀凋AMJP辛{IぶIホ 0P?L ]G# ,トA「UR0Xーm/ ツ=拭#bノ<@ サヘJュtuモ驤ヤ DIVツ@テ.AR2 、茫gヨ e"b6ミーKミイTK│ロF吃 UQPpミーKミメ"D゚VF(qAスメeミ=ムヤ*b魯~~ 嚶筍Vワ キi擁TkCウ」Kヨ鍬@ン@$&AQ Z潟ヨ3ウu!@オ64#5ヒ桝 タユj9bレミDLG茲y JムぶhtPo買eエヲP5)。-ナA9ィQDSoXコ幻)菰ャ蛻IミDL宴ハヒメヘ-Hqrヲ84ヒhM9f 蕩%lRト竜タT ニ竦tN@ソ )wTf-)ヤ DbレミDI籟チd緑`(I CB%4 跣・ィW1I メト欝<#(O8)。%"XハS 8チ)揉、^ク<、フFネνo(ン\"ッタ孟健3 ツツTBツツ RrT)уナィD1aaAAェタ()/I」@嚮/迂ミDP」$キ怜ムh,マ皐罟X[ゥM艮fMーメ 」粕0剤トツRT8;斡 C~` 9<迄 @D%hl]Xルψ#a、s8F3独%エ、ユ > &E1dL 4u!ソィ ・)ム>q_aFL ネ,。ルア諒(レヲニ^BcmWモカ。]ルナ"櫨hFAaレコ柔@X幹 D!曄$ヲ 祀h,3aフ価キゥ鰄謳「ワ HQtレコ ユヲ蓮个モYB8遭 @荼。蜑kCJ+。h^カロ RIムワ}@フGチュ、タ@、}Db4@苔枚キ。チma$:衢」ノヒヒsH彁h(H.撃エm截%yn遭64@苔Fwニ1L"、a M浚_ゆ"%J瓷.ィ魅q"1%4@胎FnK#モ蚤孟|奪 D("$ノ>泅45\(L・案$h)%4x<訓ル Jヒr 賤ヒS。 $wu礎72`ケ蕩溢qhZ`孟D hヌBフ5\ネ/I4@"1mh「ー┬.、e -YヨAハP?BCハ?ャ\fC(~ネh$jョケ 4L賛_ル%Cン q!ト/ネbh蝓ケ紘A1エイfpケ)\Pン DH]セH趙DbJh「ー M]Lテ」リ睡=萌跿# 」ィツCd'h)Zケ澄=ミ?L然Bcエ=ムCCハ~xY"+ソQ藁Zエ(柳2> )ロミ"%ケ造采^ニ。i^bF/漱(Hミ4RレミX \ZCkKクj\ 渦ゥ・ ゥZBモ5永Cミ)。ア)瑯ク<シ靴/瀉(覲蔓億C!w3zD\р裁ニ苑ヒqyリシ<「"Fュ64@財64&「mQクト頒Tq!mKhZ"1  FL 梱 MハJI幻mh肋ーイホヌ2+ウムナhワケVツ鞳Apキ !c 4@胎f辮、pーq h啖z%4ヘJhZ レミDV ヘJ賞`錫ネ64ュ0レミ4テヤkCモ SPB9mh6)n*VIlCモ 喧ミT$h"」謦筵Fz2圉mhZaオ。iゥラヲヲ Amh>*・gnゥム64喧ミ@A ネ(。9ゥ腹yケ鏃BモゥlmCSSPB駑hV)ェ・gカム64 喧ミ@A メKh6I%h>ム64 幻。 @、キ。ゥ屏Gロミ00ZB#mh1%4斂毛6450%4@退ヲrmCCチh $h1%4カrA2タ:ェカ。)t。(リGZカ。ゥ慰lCミネmC J臼|著gムQア筈ミ「"R達韆Rア┬o モSB」-「鍛粐bqI垠。ナ、(v c徃Jス64()w」xエ。h、カ。EトゥミカRッヲ ミマ ・Z M@$&AユKhy戦6頸ー囎f%4エ6エ(ゥP卯H「カ痃A JP鑪hQQクXFK「ーMェ ムロミ漾、%ゥユ ェキ。ムエs Rc p片ィヌサ炎Rュp。I -$H5乾?Jュ夭?L Nミメr窒R,エb調$aT」C-DィV欧カ}ノNミ"ィ蝓ハ?Aヤカ/ル ZP ナ` Rォ"uレミD|6)6r/6」ヲQO ュ&7Aウ6#ゥリF;レ点着L'メ0Q+P?L PクJhヤゥSカH「搶マ@nGC+GDゥS 」沛/=)ヤカ88ゥ瓰qエ3カ、ーレOLa裏q頒|暢 ソー(裹 竹dヲ侯柔TR偐3「Eミ/Y!サ。] 「G モa裏q頒撃Bィ(スP:}//ナ'jヲ ム鈔」)Q4ウュ2マ EAエウ。A」尖BFノ鯤fQ%Eミ+)。hリ%h%4ウ$レ54荅hr。9 ヒ t 蕩hリ%h%40ケ鰯」誘ヤヌb、Hr。ケノ縲"テw 蕩hリ%h\%43レ(M冒ュh-"j怐HL ]とUB33稀メシl。$オ @aレコ柔@*斡.」q"1%4@ サ叉F}TbR櫨gffVA_-*ネJ。2迂ミ44 "エk渇Rヤ゙)Aケ4FNQ{斡 C~?La裏ヲ*IA)QaZQ)A :[HMP^&Nd${F X モa裏ルフ2H メPヨD健4q「$・ュ @d!b@ サヘMi;v Z ツM8hリ%h^ヤ」`IVツ@テ.AヒQ。゚3 '#4エエeュ」`ミFbv5ミKミヤ檮A44h#zb墟メ4エフh#zxF)"「 _と;W8 . ェナ! @テ0A庶s O Eトエ4@ テ=レ-摩クZ c-「!`$ェ癢 ョCウhX&靦~皺l|DF=@ マ-#ノ4ミ10 ィ $イ ZZNrt|bミ@@テ4AK事ムテ0沾・hク&hiYノムチサaH9ヒ mv匁mv タ(Bワ4ミ0NミメワR 」Izィ)"カゥ ホ ZZA確4Iaタネ ナ@ミーNミメメr,R張ナミャ 坦ト。 y^)yII>Q0洟、シセ峇q xYケ:皆)尓愼 42(1 F(V F(V F(V F(V F(V F(V F(V F(V F(V F(V F(V タu髄キヌ衿IENDョB`hyperestraier-1.4.13/doc/perlnativeapi/000077500000000000000000000000001125261632700201035ustar00rootroot00000000000000hyperestraier-1.4.13/doc/perlnativeapi/index.html000066400000000000000000001036701125261632700221070ustar00rootroot00000000000000 estraier


NAME

Perl Binding of Hyper Estraier


SYNOPSYS

  use Estraier;


INTRODUCTION

Hyper Estraier is a full-text search system for communities.

This is a package implementing the core API of Hyper Estraier ( http://hyperestraier.sourceforge.net/ ), including native codes written in C with XS macros. As it works on Linux, Mac OS X, Windows, and so on, native libraries for each environment are required to run programs. This package requires Perl 5.8.8 or later versions.

Setting

Install the latest version of Hyper Estraier.

Enter the sub directory `perlnative' in the extracted package then perform installation.

  cd perlnative
  ./configure
  make
  su
  make install

On Linux and other UNIX systems: set the environment variable LD_LIBRARY_PATH to find libraries; ``libestraier.so''. On Mac OS X: set the environment variable DYLD_LIBRARY_PATH to find libraries; ``libestraier.dylib''. On Windows: set the environment variable PATH to find libraries; ``estraier.dll''.

The package `Estraier' should be loaded in each source file of application programs.

  use Estraier;

If you want to enable runtime assertion, set the variable `$Estraier::DEBUG' to be true.

  $Estraier::DEBUG = 1;


DESCRIPTION

Class Document

$doc = new Document(draft)

Create a document object. `draft' specifies a string of draft data. If it is omitted, an empty document object is created.

$doc->add_attr(name, value)

Add an attribute. `name' specifies the name of an attribute. `value' specifies the value of the attribute. If it is `undef', the attribute is removed. The return value is always `undef'.

$doc->add_text(text)

Add a sentence of text. `text' specifies a sentence of text. The return value is always `undef'.

$doc->add_hidden_text(text)

Add a hidden sentence. `text' specifies a hidden sentence. The return value is always `undef'.

$doc->set_keywords(kwords)

Attach keywords. `kwords' specifies the reference of a hash object of keywords. Keys of the hash should be keywords of the document and values should be their scores in decimal string. The return value is always `undef'.

$doc->set_score(score)

Set the substitute score. `score' specifies the substitute score. It should be zero or positive. The return value is always `undef'.

$doc->id()

Get the ID number. The return value is the ID number of the document object. If the object has never been registered, -1 is returned.

$doc->attr_names()

Get an array of attribute names of a document object. The return value is a reference of an array object of attribute names.

$doc->attr()

Get the value of an attribute. `name' specifies the name of an attribute. The return value is the value of the attribute or `undef' if it does not exist.

$doc->texts()

Get an array of sentences of the text. The return value is a reference of an array object of sentences of the text.

$doc->cat_texts()

Concatenate sentences of the text of a document object. The return value is concatenated sentences.

$doc->keywords()

Get attached keywords. The return value is a reference of a hash object of keywords and their scores in decimal string. If no keyword is attached, `undef' is returned.

$doc->score()

Get the substitute score. The return value is the substitute score or -1 if it is not set.

$doc->dump_draft()

Dump draft data of a document object. The return value is draft data.

$doc->make_snippet(words, wwidth, hwidth, awidth)

Make a snippet of the body text. `words' specifies a reference of an array object of words to be highlight. `wwidth' specifies whole width of the result. `hwidth' specifies width of strings picked up from the beginning of the text. `awidth' width of strings picked up around each highlighted word. The return value is a snippet string of the body text. There are tab separated values. Each line is a string to be shown. Though most lines have only one field, some lines have two fields. If the second field exists, the first field is to be shown with highlighted, and the second field means its normalized form.

Class Condition

Condition::SURE = 1 << 0

option: check every N-gram key

Condition::USUAL = 1 << 1

option: check N-gram keys skipping by one

Condition::FAST = 1 << 2

option: check N-gram keys skipping by two

Condition::AGITO = 1 << 3

option: check N-gram keys skipping by three

Condition::NOIDF = 1 << 4

option: without TF-IDF tuning

Condition::SIMPLE = 1 << 10

option: with the simplified phrase

Condition::ROUGH = 1 << 11

option: with the rough phrase

Condition::UNION = 1 << 15

option: with the union phrase

Condition::ISECT = 1 << 16

option: with the intersection phrase

Condition::ECLSIMURL = 10.0

eclipse tuning: consider URL

Condition::ECLSERV = 100.0

eclipse tuning: on server basis

Condition::ECLDIR = 101.0

eclipse tuning: on directory basis

Condition::ECLFILE = 102.0

eclipse tuning: on file basis

$cond = new Condition()

Create a search condition object.

$cond->set_phrase(phrase)

Set the search phrase. `phrase' specifies a search phrase. The return value is always `undef'.

$cond->add_attr(expr)

Add an expression for an attribute. `expr' specifies an expression for an attribute. The return value is always `undef'.

$cond->set_order(expr)

Set the order of a condition object. `expr' specifies an expression for the order. By default, the order is by score descending. The return value is always `undef'.

$cond->set_max(max)

Set the maximum number of retrieval. `max' specifies the maximum number of retrieval. By default, the number of retrieval is not limited.

$cond->set_skip(skip)

Set the number of skipped documents. `skip' specifies the number of documents to be skipped in the search result. The return value is always `undef'.

$cond->set_options(options)

Set options of retrieval. `options' specifies options: `Condition::SURE' specifies that it checks every N-gram key, `Condition::USU', which is the default, specifies that it checks N-gram keys with skipping one key, `Condition::FAST' skips two keys, `Condition::AGITO' skips three keys, `Condition::NOIDF' specifies not to perform TF-IDF tuning, `Condition::SIMPLE' specifies to use simplified phrase, `Condition::ROUGH' specifies to use rough phrase, `Condition::UNION' specifies to use union phrase, `Condition::ISECT' specifies to use intersection phrase. Each option can be specified at the same time by bitwise or. If keys are skipped, though search speed is improved, the relevance ratio grows less. The return value is always `undef'.

$cond->set_auxiliary(min)

Set permission to adopt result of the auxiliary index. `min' specifies the minimum hits to adopt result of the auxiliary index. If it is not more than 0, the auxiliary index is not used. By default, it is 32.

$cond->set_eclipse(limit)

Set the lower limit of similarity eclipse. `limit' specifies the lower limit of similarity for documents to be eclipsed. Similarity is between 0.0 and 1.0. If the limit is added by `Condition::ECLSIMURL', similarity is weighted by URL. If the limit is `Condition::ECLSERV', similarity is ignored and documents in the same server are eclipsed. If the limit is `Condition::ECLDIR', similarity is ignored and documents in the same directory are eclipsed. If the limit is `Condition::ECLFILE', similarity is ignored and documents of the same file are eclipsed.

$cond->set_distinct(name)

Set the attribute distinction filter. `name' specifies the name of an attribute to be distinct. The return value is always `undef'.

Class Result

$result->doc_num()

Get the number of documents. The return value is the number of documents in the result.

$result->get_doc_id(index)

Get the ID number of a document. `index' specifies the index of a document. The return value is the ID number of the document or -1 if the index is out of bounds.

$result->get_dbidx(index)

Get the index of the container database of a document. `index' specifies the index of a document. The return value is the index of the container database of the document or -1 if the index is out of bounds.

$result->hint_words()

Get an array of hint words. The return value is a reference of an array of hint words.

$result->hint(word)

Get the value of a hint word. `word' specifies a hint word. An empty string means the number of whole result. The return value is the number of documents corresponding the hint word. If the word is in a negative condition, the value is negative.

$result->get_score(index)

Get the score of a document. `index' specifies the index of a document. The return value is the score of the document or -1 if the index is out of bounds.

$result->get_shadows(id)

Get an array of ID numbers of eclipsed docuemnts of a document. `id' specifies the ID number of a parent document. The return value is a reference of an array whose elements expresse the ID numbers and their scores alternately.

Class Database

Database::VERSION = ``0.0.0''

version of Hyper Estraier

Database::ERRNOERR = 0

error code: no error

Database::ERRINVAL = 1

error code: invalid argument

Database::ERRACCES = 2

error code: access forbidden

Database::ERRLOCK = 3

error code: lock failure

Database::ERRDB = 4

error code: database problem

Database::ERRIO = 5

error code: I/O problem

Database::ERRNOITEM = 6

error code: no item

Database::ERRMISC = 9999

error code: miscellaneous

Database::DBREADER = 1 << 0

open mode: open as a reader

Database::DBWRITER = 1 << 1

open mode: open as a writer

Database::DBCREAT = 1 << 2

open mode: a writer creating

Database::DBTRUNC = 1 << 3

open mode: a writer truncating

Database::DBNOLCK = 1 << 4

open mode: open without locking

Database::DBLCKNB = 1 << 5

open mode: lock without blocking

Database::DBPERFNG = 1 << 10

open mode: use perfect N-gram analyzer

Database::DBCHRCAT = 1 << 11

open mode: use character category analyzer

Database::DBSMALL= 1 << 20

open mode: small tuning

Database::DBLARGE = 1 << 21

open mode: large tuning

Database::DBHUGE = 1 << 22

open mode: huge tuning

Database::DBHUGE2 = 1 << 23

open mode: huge tuning second

Database::DBHUGE3 = 1 << 24

open mode: huge tuning third

Database::DBSCVOID = 1 << 25

open mode: store scores as void

Database::DBSCINT = 1 << 26

open mode: store scores as integer

Database::DBSCASIS = 1 << 27

open mode: refrain from adjustment of scores

Database::IDXATTRSEQ = 0

attribute index type: for multipurpose sequencial access method

Database::IDXATTRSTR = 1

attribute index type: for narrowing with attributes as strings

Database::IDXATTRNUM = 2

attribute index type: for narrowing with attributes as numbers

Database::OPTNOPURGE = 1 << 0

optimize option: omit purging dispensable region of deleted

Database::OPTNODBOPT = 1 << 1

optimize option: omit optimization of the database files

Database::MGCLEAN = 1 << 0

merge option: clean up dispensable regions

Database::PDCLEAN = 1 << 0

put_doc option: clean up dispensable regions

Database::PDWEIGHT = 1 << 1

put_doc option: weight scores statically when indexing

Database::ODCLEAN = 1 << 0

out_doc option: clean up dispensable regions

Database::GDNOATTR = 1 << 0

get_doc option: no attributes

Database::GDNOTEXT = 1 << 1

get_doc option: no text

Database::GDNOKWD = 1 << 2

get_doc option: no keywords

$db = new Database()

Create a database object.

Database::search_meta(dbs, cond)

Search plural databases for documents corresponding a condition. `dbs' specifies a reference of an array whose elements are database objects. `cond' specifies a condition object. The return value is a result object. On error, `undef' is returned.

$db->err_msg(ecode)

Get the string of an error code. `ecode' specifies an error code. The return value is the string of the error code.

$db->open(name, omode)

Open a database. `name' specifies the name of a database directory. `omode' specifies open modes: `Database::DBWRITER' as a writer, `Database::DBREADER' as a reader. If the mode is `Database::DBWRITER', the following may be added by bitwise or: `Database::DBCREAT', which means it creates a new database if not exist, `Database::DBTRUNC', which means it creates a new database regardless if one exists. Both of `Database::DBREADER' and `Database::DBWRITER' can be added to by bitwise or: `Database::DBNOLCK', which means it opens a database file without file locking, or `Database::DBLCKNB', which means locking is performed without blocking. If `Database::DBNOLCK' is used, the application is responsible for exclusion control. `Database::DBCREAT' can be added to by bitwise or: `Database::DBPERFNG', which means N-gram analysis is performed against European text also, `Database::DBCHACAT', which means character category analysis is performed instead of N-gram analysis, `Database::DBSMALL', which means the index is tuned to register less than 50000 documents, `Database::DBLARGE', which means the index is tuned to register more than 300000 documents, `Database::DBHUGE', which means the index is tuned to register more than 1000000 documents, `Database::DBHUGE2', which means the index is tuned to register more than 5000000 documents, `Database::DBHUGE3', which means the index is tuned to register more than 10000000 documents, `Database::DBSCVOID', which means scores are stored as void, `Database::DBSCINT', which means scores are stored as 32-bit integer, `Database::DBSCASIS', which means scores are stored as-is and marked not to be tuned when search. The return value is true if success, else it is false.

$db->close()

Close the database. The return value is true if success, else it is false.

$db->error()

Get the last happened error code. The return value is the last happened error code.

$db->fatal()

Check whether the database has a fatal error. The return value is true if the database has fatal erroor, else it is false.

$db->add_attr_index(name, type)

Add an index for narrowing or sorting with document attributes. `name' specifies the name of an attribute. `type' specifies the data type of attribute index; `Database::IDXATTRSEQ' for multipurpose sequencial access method, `Database::IDXATTRSTR' for narrowing with attributes as strings, `Database::IDXATTRNUM' for narrowing with attributes as numbers. The return value is true if success, else it is false.

$db->flush(max)

Flush index words in the cache. `max' specifies the maximum number of words to be flushed. If it not more than zero, all words are flushed. The return value is true if success, else it is false.

$db->sync()

Synchronize updating contents. The return value is true if success, else it is false.

$db->optimize(options)

Optimize the database. `options' specifies options: `Database::OPTNOPURGE' to omit purging dispensable region of deleted documents, `Database::OPTNODBOPT' to omit optimization of the database files. The two can be specified at the same time by bitwise or. The return value is true if success, else it is false.

$db->merge(name, options)

Merge another database. `name' specifies the name of another database directory. `options' specifies options: `Database::MGCLEAN' to clean up dispensable regions of the deleted document. The return value is true if success, else it is false.

$db->put_doc(doc, options)

Add a document. `doc' specifies a document object. The document object should have the URI attribute. `options' specifies options: `Database::PDCLEAN' to clean up dispensable regions of the overwritten document. The return value is true if success, else it is false.

$db->out_doc(id, options)

Remove a document. `id' specifies the ID number of a registered document. `options' specifies options: `Database::ODCLEAN' to clean up dispensable regions of the deleted document. The return value is true if success, else it is false.

$db->edit_doc(doc)

Edit attributes of a document. `doc' specifies a document object. The return value is true if success, else it is false.

$db->get_doc(id, options)

Retrieve a document. `id' specifies the ID number of a registered document. `options' specifies options: `Database::GDNOATTR' to ignore attributes, `Database::GDNOTEXT' to ignore the body text, `Database::GDNOKWD' to ignore keywords. The three can be specified at the same time by bitwise or. The return value is a document object. On error, `undef' is returned.

$db->get_doc_attr(id, name)

Retrieve the value of an attribute of a document. `id' specifies the ID number of a registered document. `name' specifies the name of an attribute. The return value is the value of the attribute or `undef' if it does not exist.

$db->uri_to_id(uri)

Get the ID of a document specified by URI. `uri' specifies the URI of a registered document. The return value is the ID of the document. On error, -1 is returned.

$db->name()

Get the name. The return value is the name of the database.

$db->doc_num()

Get the number of documents. The return value is the number of documents in the database.

$db->word_num()

Get the number of unique words. The return value is the number of unique words in the database.

$db->size()

Get the size. The return value is the size of the database.

$db->search(cond)

Search for documents corresponding a condition. `cond' specifies a condition object. The return value is a result object. On error, `undef' is returned.

$db->scan_doc(doc, cond)

Check whether a document object matches the phrase of a search condition object definitely. `doc' specifies a document object. `cond' specifies a search condition object. The return value is true if the document matches the phrase of the condition object definitely, else it is false.

$db->set_cache_size(size, anum, tnum, rnum)

Set the maximum size of the cache memory. `size' specifies the maximum size of the index cache. By default, it is 64MB. If it is not more than 0, the current size is not changed. `anum' specifies the maximum number of cached records for document attributes. By default, it is 8192. If it is not more than 0, the current size is not changed. `tnum' specifies the maximum number of cached records for document texts. By default, it is 1024. If it is not more than 0, the current size is not changed. `rnum' specifies the maximum number of cached records for occurrence results. By default, it is 256. If it is not more than 0, the current size is not changed. The return value is always `undef'.

$db->add_pseudo_index(path)

Add a pseudo index directory. `path' specifies the path of a pseudo index directory. The return value is true if success, else it is false.

$db->set_wildmax(num)

Set the maximum number of expansion of wild cards. `num' specifies the maximum number of expansion of wild cards. The return value is always `undef'.

$db->set_informer(informer)

Set the callback function to inform of database events. `informer' specifies the name of an arbitrary function. The function should have one parameter for a string of a message of each event. The return value is always `undef'.


EXAMPLE

Gatherer

The following is the simplest implementation of a gatherer.

  use strict;
  use warnings;
  use Estraier;
  $Estraier::DEBUG = 1;
  # create the database object
  my $db = new Database();
  # open the database
  unless($db->open("casket", Database::DBWRITER | Database::DBCREAT)){
      printf("error: %s\n", $db->err_msg($db->error()));
      exit;
  }
  # create a document object
  my $doc = new Document();
  # add attributes to the document object
  $doc->add_attr('@uri', "https://estraier.gov/example.txt");
  $doc->add_attr('@title', "Over the Rainbow");
  # add the body text to the document object
  $doc->add_text("Somewhere over the rainbow.  Way up high.");
  $doc->add_text("There's a land that I heard of once in a lullaby.");
  # register the document object to the database
  unless($db->put_doc($doc, Database::PDCLEAN)){
      printf("error: %s\n", $db->err_msg($db->error()));
  }
  # close the database
  unless($db->close()){
      printf("error: %s\n", $db->err_msg($db->error()));
  }

Searcher

The following is the simplest implementation of a searcher.

  use strict;
  use warnings;
  use Estraier;
  $Estraier::DEBUG = 1;
  # create the database object
  my $db = new Database();
  # open the database
  unless($db->open("casket", Database::DBREADER)){
      printf("error: %s\n", $db->err_msg($db->error()));
      exit;
  }
  # create a search condition object
  my $cond = new Condition();
  # set the search phrase to the search condition object
  $cond->set_phrase("rainbow AND lullaby");
  # get the result of search
  my $result = $db->search($cond);
  # for each document in the result
  my $dnum = $result->doc_num();
  foreach my $i (0..$dnum-1){
      # retrieve the document object
      my $doc = $db->get_doc($result->get_doc_id($i), 0);
      next unless(defined($doc));
      # display attributes
      my $uri = $doc->attr('@uri');
      printf("URI: %s\n", $uri) if defined($uri);
      my $title = $doc->attr('@title');
      printf("Title: %s\n", $title) if defined($title);
      # display the body text
      my $texts = $doc->texts();
      foreach my $text (@$texts){
          printf("%s\n", $text);
      }
  }
  # close the database
  unless($db.close()){
      printf("error: %s\n", $db->err_msg($db->error()));
  }


LICENSE

 Copyright (C) 2004-2007 Mikio Hirabayashi
 All rights reserved.

Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

hyperestraier-1.4.13/doc/pguide-en.html000066400000000000000000001267031125261632700200140ustar00rootroot00000000000000 Programming Guide of Hyper Estraier Version 1

Programming Guide

Copyright (C) 2004-2007 Mikio Hirabayashi
Last Update: Tue, 06 Mar 2007 12:05:18 +0900

Table of Contents

  1. Introduction
  2. Architecture
  3. Building
  4. API for Documents
  5. API for Search Conditions
  6. API for Database
  7. Example of Gatherer
  8. Example of Searcher
  9. Paralleling

Introduction

This guide describes how to use the API of Hyper Estraier. If you have never read the user's guide yet, please do it beforehand.

The API enables to realize many requirements which is impossible with estcmd and estsearch.cgi only. While estcmd can handle documents as files, it is possible to make an application to handle records in a relational database as a document by using the library. While estseek.cgi is accessed with a web browser, it is possible to make an application with a GUI based on the native OS.

The core API of Hyper Estraier provides some functions to manage the inverted index only. That is, processes of retrieving documents and calculating them are assigned to an application. Also, processes to display the search result is assigned to the application. Consequently, Hyper Estraier does not depend on any document repository, any file format, nor any user interface. They can be selected by the author of the application.

Hyper Estraier handles Unicode (UCS-2) and present it as UTF-8. That is, most languages in the current world is available. Moreover, because keys of search are extracted from the body text by N-gram method, Hyper Estraier does not depend on any vocabulary.

One of characteristics of Hyper Estraier is high scalability. So, the author of the application does not need to consider the scalability as long as using the API of Hyper Estraier.

As this guide describes the core API, APIs to call the core API from Java, Ruby, and Perl are also provided. Moreover, Hyper Estraier provides the node API based on P2P architecture. Refer to the P2P Guide for the node API.


Architecture

This section describes the architecture of the core API of Hyper Estraier.

Gatherer and Filter

The term gatherer means functions to register documents to the index. A gatherer is to be implemented in an application. For example, estcmd has functions to collect documents by scanning the file system. There are the following procedures.

  • To specify the name of the index and the entry point of scanning, by parsing the command line arguments.
  • To open the index.
  • To scan the file system and specify the paths of the target files.
  • For each file of the list above --
    • To discriminate the file format by suffix of the name.
    • To read the file if the format is supported.
    • To call the filter function corresponding to the format and create a document object.
    • To register the document object into the index.
  • To close the index.

The term filter means functions to extract attributes and body text from a file. A filter is implemented in the application. While it can be an own implementation of the application, it can be realized by using some existing library. Moreover, it can be realized by calling an outer command.

Searcher

The term searcher means functions to search the index for some documents corresponding to conditions specified by users. A searcher is implemented in the application. For example, estseek.cgi has functions to display the search result as HTML, called as a CGI script by the web server. There is the following procedures.

  • To read such configurations as the name of the index from the configuration file.
  • To parse the parameters of CGI and get the search condition specified by the user.
  • To open the index.
  • To create a search condition object composed of a search phrase, some attribute expressions, an order expression.
  • To give the search condition object to the index and get a list of IDs of documents corresponding the conditions.
  • For each document of the list above --
    • To retrieve the document object from the index.
    • To display attributes and the snippet.
  • To close the index.

Snippet of the body text is useful for the result to be straightforward. While a function is provided to create snippet by the API, the application can implement its own function.

Typical Architecture

The following is illustration of a typical architecture of the application of Hyper Estraier. As it is no more than a concept, you can design your own architecture.

[framework]

Building

As Hyper Estraier provides the API for the C language, an application is implemented in C or C++. This section describes how to build the application with the library of Hyper Estraier.

Including Headers

In each source of applications of the core API, include `estraier.h', `cabin.h', and `stdlib.h'. `estraier.h' is a header file of Hyper Estraier. `cabin.h' is a header file of QDBM. See the document of QDBM for the functions provided by `cabin.h'.

#include <estraier.h>
#include <cabin.h>
#include <stdlib.h>

Compilation and Linking

By default, headers of Hyper Estraier are installed in "/usr/local/include", and libraries are installed in "/usr/local/lib". Other underlying libraries except for `-lestraier' are `-lresolv', `-lnsl', `-lpthread', `-lqdbm', `-lz' `-liconv', `-lm', and `-lc'. That is, perform the following command to build an application.

gcc -I/usr/local/include -o foobar foobar.c \
  -L/usr/local/lib -lestraier -lresolv -lnsl -lpthread -lqdbm -lz -liconv -lm -lc

However, the above does not works if the destination of installation is different. It is suggested to use estconfig in order to improve maintainability, as the following.

gcc `estconfig --cflags` -o foobar foobar.c `estconfig --ldflags` `estconfig --libs`

Command for Integration

estconfig is useful for integration of an application or a system using Hyper Estraier. It outputs setting and configurations of Hyper Estraier.

estconfig --version
to output version information.
estconfig --prefix
to output the prefix of the destination of installation.
estconfig --execprefix
to output the prefix of the files depending on the platform.
estconfig --headdir
to output the prefix of the headers.
estconfig --libdir
to output the prefix of the libraries.
estconfig --bindir
to output the prefix of the commands.
estconfig --libexecdir
to output the prefix of the CGI script.
estconfig --datadir
to output the prefix of the configuration files.
estconfig --cflags
to output the compiler options to be specified when building.
estconfig --ldflags
to output the linker options to be specified when building.
estconfig --libs
to output the libraries to be specified when building.
estconfig --mtlibs
to output the libraries for applications with multi thread.

estconfig always returns 0 as the exit status.


API for Documents

The API for documents aims to handle documents which were registered into the index.

Description

The type of the structure `ESTDOC' is for abstraction of a document. A document is composed of some attributes and some text sentences. No entity of `ESTDOC' is accessed directly, but it is accessed by the pointer. The term of document object means the pointer and its referent. A document object is created by the function `est_doc_new' and destroyed by `est_doc_delete'. Every created document object should be destroyed.

Target documents of search are to be registered in the database beforehand. The ID is assigned to each registered document. When search, they can be retrieved from the database by their ID. The encoding of attributes and text sentences should be UTF-8.

The following is a typical use case of document object.

ESTDOC *doc;

/* create a document object */
doc = est_doc_new();

/* add the URI and the title as attributes */
est_doc_add_attr(doc, "@uri", "http://foo.bar/baz.txt");
est_doc_add_attr(doc, "@title", "Now Scream");

/* add text sentences */
est_doc_add_text(doc, "Give it up, Yo!  Give it up, Yo!");
est_doc_add_text(doc, "Check it out, come on!");

  /* register the object or display it here */

/* destroy the object */
est_doc_delete(doc);

API

The function `est_doc_new' is used in order to create a document object.

ESTDOC *est_doc_new(void);
The return value is an object of a document.

The function `est_doc_new_from_draft' is used in order to create a document object made from draft data.

ESTDOC *est_doc_new_from_draft(const char *draft);
`draft' specifies a string of draft data. The return value is an object of a document.

The function `est_doc_delete' is used in order to destroy a document object.

void est_doc_delete(ESTDOC *doc);
`doc' specifies a document object.

The function `est_doc_add_attr' is used in order to add an attribute to a document object.

void est_doc_add_attr(ESTDOC *doc, const char *name, const char *value);
`doc' specifies a document object. `name' specifies the name of an attribute. `value' specifies the value of the attribute. If it is `NULL', the attribute is removed.

The function `est_doc_add_text' is used in order to add a sentence of text to a document object.

void est_doc_add_text(ESTDOC *doc, const char *text);
`doc' specifies a document object. `text' specifies a sentence of text.

The function `est_doc_add_hidden_text' is used in order to add a hidden sentence to a document object.

void est_doc_add_hidden_text(ESTDOC *doc, const char *text);
`doc' specifies a document object. `text' specifies a hidden sentence.

The function `est_doc_set_keywords' is used in order to attach keywords to a document object.

void est_doc_set_keywords(ESTDOC *doc, CBMAP *kwords);
`doc' specifies a document object. `kwords' specifies a map object of keywords. Keys of the map should be keywords of the document and values should be their scores in decimal string. The map object is copied internally.

The function `est_doc_set_score' is used in order to set the substitute score of a document object.

void est_doc_set_score(ESTDOC *doc, int score);
`doc' specifies a document object. `score' specifies the substitute score. It it is negative, the substitute score setting is nullified.

The function `est_doc_id' is used in order to get the ID number of a document object.

int est_doc_id(ESTDOC *doc);
`doc' specifies a document object. The return value is the ID number of the document object. If the object has not been registered, -1 is returned.

The function `est_doc_attr_names' is used in order to get a list of attribute names of a document object.

CBLIST *est_doc_attr_names(ESTDOC *doc);
`doc' specifies a document object. The return value is a new list object of attribute names of the document object. Because the object of the return value is opened with the function `cblistopen', it should be closed with the function `cblistclose' if it is no longer in use.

The function `est_doc_attr' is used in order to get the value of an attribute of a document object.

const char *est_doc_attr(ESTDOC *doc, const char *name);
`doc' specifies a document object. `name' specifies the name of an attribute. The return value is the value of the attribute or `NULL' if it does not exist. The life duration of the returned string is synchronous with the one of the document object.

The function `est_doc_texts' is used in order to get a list of sentences of the text of a document object.

const CBLIST *est_doc_texts(ESTDOC *doc);
`doc' specifies a document object. The return value is a list object of sentences of the text of the document object. The life duration of the returned object is synchronous with the one of the document object.

The function `est_doc_cat_texts' is used in order to concatenate sentences of the text of a document object.

char *est_doc_cat_texts(ESTDOC *doc);
`doc' specifies a document object. The return value is concatenated sentences of the document object. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use.

The function `est_doc_keywords' is used in order to get attached keywords of a document object.

CBMAP *est_doc_keywords(ESTDOC *doc);
`doc' specifies a document object. The return value is a map object of keywords and their scores in decimal string. If no keyword is attached, `NULL' is returned. The life duration of the returned object is synchronous with the one of the document object.

The function `est_doc_dump_draft' is used in order to dump draft data of a document object.

char *est_doc_dump_draft(ESTDOC *doc);
`doc' specifies a document object. The return value is draft data of the document object. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use.

The function `est_doc_make_snippet' is used in order to make a snippet of the body text of a document object.

char *est_doc_make_snippet(ESTDOC *doc, const CBLIST *words, int wwidth, int hwidth, int awidth);
`doc' specifies a document object. `word' specifies a list object of words to be highlight. `wwidth' specifies whole width of the result. `hwidth' specifies width of strings picked up from the beginning of the text. `awidth' specifies width of strings picked up around each highlighted word. The return value is a snippet string of the body text of the document object. There are tab separated values. Each line is a string to be shown. Though most lines have only one field, some lines have two fields. If the second field exists, the first field is to be shown with highlighted, and the second field means its normalized form. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use.

API for Search Conditions

The API for search conditions aims to specify search conditions given to the index.

Description

The type of the structure `ESTCOND' is for abstraction of search conditions. A unit of search conditions is composed of one search phrase, some attribute expressions, and one order expression. No entity of `ESTCOND' is accessed directly, but it is accessed by the pointer. The term of condition object means the pointer and its referent. A condition object is created by the function `est_cond_new' and destroyed by `est_cond_delete'. Every created condition object should be destroyed.

Condition objects are used as a parameter to search for documents registered in the database so that a list of IDs of corresponding documents are returned. See the manual for the formats of expressions. The encoding of conditional expressions should be UTF-8.

The following is a typical use case of condition object.

ESTCOND *cond;

/* create a condition object */
cond = est_cond_new();

/* set the search phrase */
est_cond_set_phrase(cond, "check AND out");

/* set the attribute expression */
est_cond_add_attr(cond, "@uri ISTREW .txt");

  /* search the database here */

/* destroy the object */
est_cond_delete(cond);

API

The function `est_cond_new' is used in order to create a condition object.

ESTCOND *est_cond_new(void);
The return value is an object of search conditions.

The function `est_cond_delete' is used in order to destroy a condition object.

void est_cond_delete(ESTCOND *cond);
`cond' specifies a condition object.

The function `est_cond_set_phrase' is used in order to set the search phrase to a condition object.

void est_cond_set_phrase(ESTCOND *cond, const char *phrase);
`cond' specifies a condition object. `phrase' specifies a search phrase.

The function `est_cond_add_attr' is used in order to add an expression for an attribute to a condition object.

void est_cond_add_attr(ESTCOND *cond, const char *expr);
`cond' specifies a condition object. `expr' specifies an expression for an attribute.

The function `est_cond_set_order' is used in order to set the order of a condition object.

void est_cond_set_order(ESTCOND *cond, const char *expr);
`cond' specifies a condition object. `expr' specifies an expression for the order. By default, the order is by score descending.

The function `est_cond_set_max' is used in order to set the maximum number of retrieval of a condition object.

void est_cond_set_max(ESTCOND *cond, int max);
`cond' specifies a condition object. `max' specifies the maximum number of retrieval. By default, the number of retrieval is not limited.

The function `est_cond_set_skip' is used in order to set the number of skipped documents of a condition object.

void est_cond_set_skip(ESTCOND *cond, int skip);
`cond' specifies a condition object. `skip' specifies the number of documents to be skipped in the search result.

The function `est_cond_set_options' is used in order to set options of retrieval of a condition object.

void est_cond_set_options(ESTCOND *cond, int options);
`cond' specifies a condition object. `options' specifies options: `ESTCONDSURE' specifies that it checks every N-gram key, `ESTCONDUSUAL', which is the default, specifies that it checks N-gram keys with skipping one key, `ESTCONDFAST' skips two keys, `ESTCONDAGITO' skips three keys, `ESTCONDNOIDF' specifies not to perform TF-IDF tuning, `ESTCONDSIMPLE' specifies to use simplified phrase, `ESTCONDROUGH' specifies to use rough phrase, `ESTCONDUNION' specifies to use union phrase, `ESTCONDISECT' specifies to use intersection phrase, `ESTCONDSCFB' specifies to feed back scores (only for debugging). Each option can be specified at the same time by bitwise or. If keys are skipped, though search speed is improved, the relevance ratio grows less.

The function `est_cond_set_auxiliary' is used in order to set permission to adopt result of the auxiliary index.

void est_cond_set_auxiliary(ESTCOND *cond, int min);
`cond' specifies a condition object. `min' specifies the minimum hits to adopt result of the auxiliary index. If it is not more than 0, the auxiliary index is not used. By default, it is 32.

The function `est_cond_set_eclipse' is used in order to set the lower limit of similarity eclipse.

void est_cond_set_eclipse(ESTCOND *cond, double limit);
`cond' specifies a condition object. `limit' specifies the lower limit of similarity for documents to be eclipsed. Similarity is between 0.0 and 1.0. If the limit is added by `ESTECLSIMURL', similarity is weighted by URL. If the limit is `ESTECLSERV', similarity is ignored and documents in the same server are eclipsed. If the limit is `ESTECLDIR', similarity is ignored and documents in the same directory are eclipsed. If the limit is `ESTECLFILE', similarity is ignored and documents of the same file are eclipsed.

The function `est_cond_set_distinct' is used in order to set the attribute distinction filter.

void est_cond_set_distinct(ESTCOND *cond, const char *name);
`cond' specifies a condition object. `name' specifies the name of an attribute to be distinct. If this filter is set, candidates which have same value of the attribute is omitted.

The function `est_set_cond_mask' is used in order to set the mask of targets of meta search.

void est_cond_set_mask(ESTCOND *cond, int mask);
`cond' specifies a condition object. `mask' specifies a masking number. 1 means the first target, 2 means the second target, 4 means the third target, and power values of 2 and their summation compose the mask.

API for Database

The API for database aims to handle the database of the index.

Description

The type of the structure `ESTDB' is for abstraction of access methods to database. A database has inverted index, document data, and meta data. One of writer or reader is selected when the connection is established. No entity of `ESTDB' is accessed directly, but it is accessed by the pointer. The term of database object means the pointer and its referent. A database object is created by the function `est_db_open' and destroyed by `est_db_close'. Every created database object should be destroyed.

Errors with some operations are informed to by the function `est_db_error'. The meaning of each error code can be gotten as a string by the function `est_err_msg'.

The following is a typical use case of database object.

ESTDB *db
int ecode;

/* create a database object as a write */
if(!(db = est_db_open("casket", ESTDBWRITER | ESTDBCREAT, &ecode))){
  /* if failure, return after displaying the error message */
  fprintf(stderr, "error: %s\n", est_err_msg(ecode));
  return -1;
}

  /* register documents or search for documents here */

/* destroy the object */
if(!est_db_close(db, &ecode)){
  /* if failure, return after displaying the error message */
  fprintf(stderr, "error: %s\n", est_err_msg(ecode));
  return -1;
}

API

The following constant are defined for error codes.

  • ESTENOERR : no error.
  • ESTEINVAL : invalid argument.
  • ESTEACCES : access forbidden.
  • ESTELOCK : lock failure.
  • ESTEDB : database problem.
  • ESTEIO : I/O problem.
  • ESTENOITEM : no item.
  • ESTEMISC : miscellaneous.

The function `est_err_msg' is used in order to get the string of an error code.

const char *est_err_msg(int ecode);
`ecode' specifies an error code. The return value is the string of the error code.

The function `est_db_open' is used in order to open a database.

ESTDB *est_db_open(const char *name, int omode, int *ecp);
`name' specifies the name of a database directory. `omode' specifies open modes: `ESTDBWRITER' as a writer, `ESTDBREADER' as a reader. If the mode is `ESTDBWRITER', the following may be added by bitwise or: `ESTDBCREAT', which means it creates a new database if not exist, `ESTDBTRUNC', which means it creates a new database regardless if one exists. Both of `ESTDBREADER' and `ESTDBWRITER' can be added to by bitwise or: `ESTDBNOLCK', which means it opens a database file without file locking, or `ESTDBLCKNB', which means locking is performed without blocking. If `ESTDBNOLCK' is used, the application is responsible for exclusion control. `ESTDBCREAT' can be added to by bitwise or: `ESTDBPERFNG', which means N-gram analysis is performed against European text also, `ESTDBCHRCAT', which means character category analysis is performed instead of N-gram analysis, `ESTDBSMALL', which means the index is tuned to register less than 50000 documents, `ESTDBLARGE', which means the index is tuned to register more than 300000 documents, `ESTDBHUGE', which means the index is tuned to register more than 1000000 documents, `ESTDBHUGE2', which means the index is tuned to register more than 5000000 documents, `ESTDBHUGE3', which means the index is tuned to register more than 10000000 documents, `ESTDBSCVOID', which means scores are stored as void, `ESTDBSCINT', which means scores are stored as 32-bit integer, `ESTDBSCASIS', which means scores are stored as-is and marked not to be tuned when search. `ecp' specifies the pointer to a variable to which the error code is assigned. The return value is a database object of the database or `NULL' if failure.

The function `est_db_close' is used in order to close a database.

int est_db_close(ESTDB *db, int *ecp);
`db' specifies a database object. `ecp' specifies the pointer to a variable to which the error code is assigned. The return value is true if success, else it is false.

The function `est_db_error' is used in order to get the last happened error code of a database.

int est_db_error(ESTDB *db);
`db' specifies a database object. The return value is the last happened error code of the database.

The function `est_db_fatal' is used in order to check whether a database has a fatal error.

int est_db_fatal(ESTDB *db);
`db' specifies a database object. The return value is true if the database has fatal error, else it is false.

The function `est_db_add_attr_index' is used in order to add an index for narrowing or sorting with document attributes.

int est_db_add_attr_index(ESTDB *db, const char *name, int type);
`db' specifies a database object connected as a writer. `name' specifies the name of an attribute. `type' specifies the data type of attribute index; `ESTIDXATTRSEQ' for multipurpose sequencial access method, `ESTIDXATTRSTR' for narrowing with attributes as strings, `ESTIDXATTRNUM' for narrowing with attributes as numbers. The return value is true if success, else it is false. Note that this function should be called before the first document is registered.

The function `est_db_flush' is used in order to flush index words in the cache of a database.

int est_db_flush(ESTDB *db, int max);
`db' specifies a database object connected as a writer. `max' specifies the maximum number of words to be flushed. If it not more than zero, all words are flushed. The return value is true if success, else it is false.

The function `est_db_sync' is used in order to synchronize updating contents of a database.

int est_db_sync(ESTDB *db);
`db' specifies a database object connected as a writer. The return value is true if success, else it is false.

The function `est_db_optimize' is used in order to optimize a database.

int est_db_optimize(ESTDB *db, int options);
`db' specifies a database object connected as a writer. `options' specifies options: `ESTOPTNOPURGE' to omit purging dispensable region of deleted documents, `ESTOPTNODBOPT' to omit optimization of the database files. The two can be specified at the same time by bitwise or. The return value is true if success, else it is false.

The function `est_db_merge' is used in order to merge another database.

int est_db_merge(ESTDB *db, const char *name, int options);
`db' specifies a database object connected as a writer. `name' specifies the name of another database directory. `options' specifies options: `ESTMGCLEAN' to clean up dispensable regions of the deleted document. The return value is true if success, else it is false. Creation options of the two databases should be same entirely. ID numbers of imported documents are changed within the sequence of the desitination database. If URIs of imported documents conflict ones of exsisting documents, existing documents are removed.

The function `est_db_put_doc' is used in order to add a document to a database.

int est_db_put_doc(ESTDB *db, ESTDOC *doc, int options);
`db' specifies a database object connected as a writer. `doc' specifies a document object. The document object should have the URI attribute. `options' specifies options: `ESTPDCLEAN' to clean up dispensable regions of the overwritten document, `ESTPDWEIGHT' to weight scores statically with score weighting attribute. The return value is true if success, else it is false. If the URI attribute is same with an existing document in the database, the existing one is deleted.

The function `est_db_out_doc' is used in order to remove a document from a database.

int est_db_out_doc(ESTDB *db, int id, int options);
`db' specifies a database object connected as a writer. `id' specifies the ID number of a registered document. `options' specifies options: `ESTODCLEAN' to clean up dispensable regions of the deleted document. The return value is true if success, else it is false.

The function `est_db_edit_doc' is used in order to edit attributes of a document in a database.

int est_db_edit_doc(ESTDB *db, ESTDOC *doc);
`db' specifies a database object connected as a writer. `doc' specifies a document object. The return value is true if success, else it is false. The ID can not be changed. If the URI is changed and it overlaps the URI of another registered document, this function fails.

The function `est_db_get_doc' is used in order to retrieve a document in a database.

ESTDOC *est_db_get_doc(ESTDB *db, int id, int options);
`db' specifies a database object. `id' specifies the ID number of a registered document. `options' specifies options: `ESTGDNOATTR' to ignore attributes, `ESTGDNOTEXT' to ignore the body text, `ESTGDNOKWD' to ignore keywords. The three can be specified at the same time by bitwise or. The return value is a document object. It should be deleted with `est_doc_delete' if it is no longer in use. On error, `NULL' is returned.

The function `est_db_get_doc_attr' is used in order to retrieve the value of an attribute of a document in a database.

char *est_db_get_doc_attr(ESTDB *db, int id, const char *name);
`db' specifies a database object. `id' specifies the ID number of a registered document. `name' specifies the name of an attribute. The return value is the value of the attribute or `NULL' if it does not exist. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use.

The function `est_db_uri_to_id' is used in order to get the ID of a document specified by URI.

int est_db_uri_to_id(ESTDB *db, const char *uri);
`db' specifies a database object. `uri' specifies the URI of a registered document. The return value is the ID of the document. On error, -1 is returned.

The function `est_db_name' is used in order to get the name of a database.

const char *est_db_name(ESTDB *db);
`db' specifies a database object. The return value is the name of the database. The life duration of the returned string is synchronous with the one of the database object.

The function `est_db_doc_num' is used in order to get the number of documents in a database.

int est_db_doc_num(ESTDB *db);
`db' specifies a database object. The return value is the number of documents in the database.

The function `est_db_word_num' is used in order to get the number of unique words in a database.

int est_db_word_num(ESTDB *db);
`db' specifies a database object. The return value is the number of unique words in the database.

The function `est_db_size' is used in order to get the size of a database.

double est_db_size(ESTDB *db);
`db' specifies a database object. The return value is the size of the database.

The function `est_db_search' is used in order to search a database for documents corresponding a condition.

int *est_db_search(ESTDB *db, ESTCOND *cond, int *nump, CBMAP *hints);
`db' specifies a database object. `cond' specifies a condition object. `nump' specifies the pointer to a variable to which the number of elements in the result is assigned. `hints' specifies a map object into which the number of documents corresponding to each word is stored. If a word is in a negative condition, the number is negative. The element whose key is an empty string specifies the number of whole result. If it is `NULL', it is not used. The return value is an array whose elements are ID numbers of corresponding documents. This function does never fail. Even if no document corresponds or an error occurs, an empty array is returned. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use.

The function `est_db_search_meta' is used in order to search plural databases for documents corresponding a condition.

int *est_db_search_meta(ESTDB **dbs, int dbnum, ESTCOND *cond, int *nump, CBMAP *hints);
`dbs' specifies an array whose elements are database objects. `dbnum' specifies the number of elements of the array. `cond' specifies a condition object. `nump' specifies the pointer to a variable to which the number of elements in the result is assigned. `hints' specifies a map object into which the number of documents corresponding to each word is stored. If a word is in a negative condition, the number is negative. The element whose key is an empty string specifies the number of whole result. If it is `NULL', it is not used. The return value is an array whose elements are indexes of container databases and ID numbers of in each database alternately. This function does never fail. Even if no document corresponds or an error occurs, an empty array is returned. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use.

The function `est_db_scan_doc' is used in order to check whether a document object matches the phrase of a search condition object definitely.

int est_db_scan_doc(ESTDB *db, ESTDOC *doc, ESTCOND *cond);
`db' specifies a database object. `doc' specifies a document object. `cond' specifies a search condition object. The return value is true if the document matches the phrase of the condition object definitely, else it is false.

The function `est_db_set_cache_size' is used in order to set the maximum size of the cache memory of a database.

void est_db_set_cache_size(ESTDB *db, size_t size, int anum, int tnum, int rnum);
`db' specifies a database object. `size' specifies the maximum size of the index cache. By default, it is 64MB. If it is negative, the current size is not changed. `anum' specifies the maximum number of cached records for document attributes. By default, it is 8192. If it is negative, the current size is not changed. `tnum' specifies the maximum number of cached records for document texts. By default, it is 1024. If it is negative, the current size is not changed. `rnum' specifies the maximum number of cached records for occurrence results. By default, it is 256. If it is negative, the current size is not changed.

Example of Gatherer

The following is the simplest implementation of a gatherer.

#include <estraier.h>
#include <cabin.h>
#include <stdlib.h>
#include <stdio.h>

int main(int argc, char **argv){
  ESTDB *db;
  ESTDOC *doc;
  int ecode;

  /* open the database */
  if(!(db = est_db_open("casket", ESTDBWRITER | ESTDBCREAT, &ecode))){
    fprintf(stderr, "error: %s\n", est_err_msg(ecode));
    return 1;
  }

  /* create a document object */
  doc = est_doc_new();

  /* add attributes to the document object */
  est_doc_add_attr(doc, "@uri", "http://estraier.gov/example.txt");
  est_doc_add_attr(doc, "@title", "Over the Rainbow");

  /* add the body text to the document object */
  est_doc_add_text(doc, "Somewhere over the rainbow.  Way up high.");
  est_doc_add_text(doc, "There's a land that I heard of once in a lullaby.");

  /* register the document object to the database */
  if(!est_db_put_doc(db, doc, ESTPDCLEAN))
    fprintf(stderr, "error: %s\n", est_err_msg(est_db_error(db)));

  /* destroy the document object */
  est_doc_delete(doc);

  /* close the database */
  if(!est_db_close(db, &ecode)){
    fprintf(stderr, "error: %s\n", est_err_msg(ecode));
    return 1;
  }

  return 0;
}

Example of Searcher

The following is the simplest implementation of a searcher.

#include <estraier.h>
#include <cabin.h>
#include <stdlib.h>
#include <stdio.h>

int main(int argc, char **argv){
  ESTDB *db;
  ESTCOND *cond;
  ESTDOC *doc;
  const CBLIST *texts;
  int ecode, *result, resnum, i, j;
  const char *value;

  /* open the database */
  if(!(db = est_db_open("casket", ESTDBREADER, &ecode))){
    fprintf(stderr, "error: %s\n", est_err_msg(ecode));
    return 1;
  }

  /* create a search condition object */
  cond = est_cond_new();

  /* set the search phrase to the search condition object */
  est_cond_set_phrase(cond, "rainbow AND lullaby");

  /* get the result of search */
  result = est_db_search(db, cond, &resnum, NULL);

  /* for each document in the result */
  for(i = 0; i < resnum; i++){

    /* retrieve the document object */
    if(!(doc = est_db_get_doc(db, result[i], 0))) continue;

    /* display attributes */
    if((value = est_doc_attr(doc, "@uri")) != NULL)
      printf("URI: %s\n", value);
    if((value = est_doc_attr(doc, "@title")) != NULL)
      printf("Title: %s\n", value);

    /* display the body text */
    texts = est_doc_texts(doc);
    for(j = 0; j < cblistnum(texts); j++){
      value = cblistval(texts, j, NULL);
      printf("%s\n", value);
    }

    /* destroy the document object */
    est_doc_delete(doc);

  }

  /* free the result of search */
  free(result);

  /* destroy the search condition object */
  est_cond_delete(cond);

  /* close the database */
  if(!est_db_close(db, &ecode)){
    fprintf(stderr, "error: %s\n", est_err_msg(ecode));
    return 1;
  }

  return 0;
}

Paralleling

Databases of Hyper Estraier are protected by file locking. While a writer is connected to a database, neither readers nor writers can be connected. While a reader is connected to a database, other readers can be connect, but writers can not.

If you use multi thread, it is suggested to use the MT-safe API of Hyper Estraier. It is a wrapper to make the core API thread-safe. As the MT-safe API provides the same functions as with the core API, the following is different.

  • Include not only `estraier.h' but also `estmtdb.h'.
  • Use pointers to `ESTMTDB' instead of `ESTDB' as database objects.
  • The names of functions begin with "est_mtdb_" instead of "est_db_".

If QDBM was built with `--enable-pthread', mutex protection is performed for each connection, not in global. So, it is recommended when you use the MT-safe API.


hyperestraier-1.4.13/doc/pguide-ja.html000066400000000000000000002035221125261632700177770ustar00rootroot00000000000000 Programming Guide of Hyper Estraier Version 1 (Japanese)

繝励Ο繧ー繝ゥ繝溘Φ繧ー繧ャ繧、繝

Copyright (C) 2004-2007 Mikio Hirabayashi
Last Update: Tue, 06 Mar 2007 12:05:18 +0900

逶ョ谺。

  1. 縺ッ縺倥a縺ォ
  2. 繧「繝シ繧ュ繝繧ッ繝√Ε
  3. 繝薙Ν繝
  4. 譁譖ク繧呈桶縺API
  5. 讀懃エ「譚。莉カ繧呈桶縺API
  6. 繝繝シ繧ソ繝吶シ繧ケ繧呈桶縺API
  7. 繧ョ繝」繧カ繝ゥ縺ョ繧オ繝ウ繝励Ν
  8. 繧オ繝シ繝√Ε縺ョ繧オ繝ウ繝励Ν
  9. 荳ヲ蛻玲ァ
  10. 蜉ゥ險

縺ッ縺倥a縺ォ

縺薙ョ繧ャ繧、繝峨〒縺ッ縲?yper Estraier縺ョAPI縺ョ隧ウ邏ー縺ェ菴ソ縺譁ケ繧定ェャ譏弱@縺セ縺吶繝ヲ繝シ繧カ繧ャ繧、繝繧偵∪縺縺願ェュ縺ソ縺ァ縺ェ縺蝣エ蜷医ッ蜈医↓縺昴■繧峨↓逶ョ繧帝壹@縺ヲ縺翫>縺ヲ縺上□縺輔>縲

蜈ィ譁讀懃エ「繧キ繧ケ繝繝縺ョ讖溯ス隕∽サカ縺ッ讒倥縺ァ縺吶′縲∽サ」陦ィ逧縺ェ繧ゅョ繧呈嫌縺偵※縺ソ縺セ縺励g縺縲

繝ェ繝昴ず繝医Μ縺ク縺ョ隕∵ア
繝輔ぃ繧、繝ォ繧キ繧ケ繝繝縲√Γ繝シ繝ォ繝懊ャ繧ッ繧ケ縲仝eb縲仝iki縲ヽDBMS縲∝推遉セ縺ョ譁譖ク邂。逅繧キ繧ケ繝繝縺ェ縺ゥ縺ク縺ョ蟇セ蠢懊
譁譖ク蠖「蠑上∈縺ョ隕∵ア
繝励Ξ繝シ繝ウ繝繧ュ繧ケ繝医?TML縲`IME縲 ̄DF縲ヽTF縲`S-Word縲`P3縲∝推遞ョ縺ョ逕サ蜒擾シOCRシ峨↑縺ゥ縺ク縺ョ蟇セ蠢懊
險隱槭d隱槫ス吶∈縺ョ隕∵ア
譌・譛ャ隱槭∬恭隱槭∽クュ蝗ス隱槭↑縺ゥ縺ョ蜷遞ョ險隱槫ッセ蠢懊る。樒セゥ隱槭ョ豁」隕丞喧縲り。ィ險俶昭繧後ョ豁」隕丞喧縲
繝ヲ繝シ繧カ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縺ク縺ョ隕∵ア
讀懃エ「譚。莉カ縺ョ謖螳壽婿豕輔らオ先棡縺ョ陦ィ遉コ譁ケ豕輔ゅけ繝ゥ繧、繧「繝ウ繝医ョ遞ョ鬘槭ょソ懃ュ疲凾髢薙ょ酔譎よ磁邯壽焚縲
邂。逅讖溯ス縺ク縺ョ隕∵ア
蟇セ雎。譁譖ク縺ョ隕乗ィ。縲よ枚譖ク縺ョ蟾ョ蛻逋サ骭イ縲ら┌蛛懈ュ「驕狗畑縲ゅヰ繝繧ッ繧「繝繝励らァサ讀肴ァ縲

閠縺亥セ励k蜈ィ縺ヲ縺ョ隕∵アゅ↓蠢懊∴繧九%縺ィ縺ッ縺ァ縺阪∪縺帙s縺後estcmdestseek.cgi繧剃スソ縺縺縺代〒縺ッ荳榊庄閭ス縺縺」縺溷、壹¥縺ョ縺薙→縺後√Λ繧、繝悶Λ繝ェ繧堤オ縺ソ霎シ繧薙□繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ繧剃ス懊k縺薙→縺ァ蜿ッ閭ス縺ォ縺ェ繧翫∪縺吶estcmd縺ァ縺ッ繝輔ぃ繧、繝ォ縺ィ縺励※蟄伜惠縺励※縺繧区枚譖ク縺励°謇ア縺医∪縺帙s縺ァ縺励◆縺後√Λ繧、繝悶Λ繝ェ繧剃スソ縺医ー縲√Μ繝ャ繝シ繧キ繝ァ繝翫Ν繝繝シ繧ソ繝吶シ繧ケ縺ォ譬シ邏阪&繧後◆繝ャ繧ウ繝シ繝峨r譁譖ク縺ィ縺励※謇ア縺繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ繧剃ス懊k縺薙→繧ゅ〒縺阪∪縺吶estseek.cgi縺ッWeb繝悶Λ繧ヲ繧カ縺ァ菴ソ縺繧ゅョ縺ァ縺励◆縺後√Λ繧、繝悶Λ繝ェ繧剃スソ縺医ー縲√ロ繧、繝繧」繝飽S縺ョGUI繧貞y縺医◆讀懃エ「繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ繧剃ス懊k縺薙→繧ゅ〒縺阪∪縺吶

Hyper Estraier縺梧署萓帙☆繧九繧ウ繧「API縲阪ッ縲∬サ「鄂ョ繧、繝ウ繝繝繧ッ繧ケ縺ィ縺縺繝繝シ繧ソ讒矩繧貞ョ溽樟縺吶k讖溯ス繧呈署萓帙☆繧九□縺代〒縺吶ゅ▽縺セ繧翫∵枚譖ク繧貞叙蠕励@縺溘j隗」驥医@縺溘j縺吶k蜃ヲ逅縺ッ繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ォ莉サ縺輔l縺セ縺吶よ、懃エ「邨先棡繧定。ィ遉コ縺吶k縺溘a縺ョ蜃ヲ逅繧ゅい繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ォ莉サ縺輔l縺セ縺吶らケー繧願ソ斐@縺ォ縺ェ繧翫∪縺吶′縲?yper Estraier縺ッ繝ェ繝昴ず繝医Μシ亥ッセ雎。譁譖ク縺ョ譬シ邏榊エ謇シ峨ョ遞ョ鬘槭↓縺ッ萓晏ュ倥@縺セ縺帙s縺励∵枚譖ク蠖「蠑上↓繧ゆセ晏ュ倥@縺セ縺帙s縺励√Θ繝シ繧カ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縺ォ繧ゆセ晏ュ倥@縺セ縺帙s縲ゅ◎繧後i縺ッ繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ菴懆縺悟・ス縺阪↑繧医≧縺ォ險ュ險医サ螳溯」縺吶k縺薙→縺後〒縺阪∪縺吶

Hyper Estraier縺ッUnicodeシUCS-2シ峨ョ譁蟄励そ繝繝医r謇ア縺縲ゞTF-8縺ァ陦ィ迴セ縺励∪縺吶ゅ@縺溘′縺」縺ヲ縲∫樟蝨ィ荳也阜縺ァ譌・蟶ク逧縺ォ菴ソ繧上l縺ヲ縺繧九⊇縺ィ繧薙←縺ョ險隱槭ョ譁蟄励′蛻ゥ逕ィ縺ァ縺阪∪縺吶ゅ∪縺溘√ユ繧ュ繧ケ繝医°繧画、懃エ「繧ュ繝シ繧貞繧雁コ縺吶↓縺ゅ◆縺」縺ヲN-gram豕輔r逕ィ縺繧九ョ縺ァ縲∬ィ隱槭ョ隱槫ス吶↓萓晏ュ倥@縺セ縺帙s縲

繧ケ繧ア繝シ繝ゥ繝薙Μ繝繧」シ亥、ァ隕乗ィ。縺ェ譁譖ク鄒、繧呈桶縺閭ス蜉幢シ峨′鬮倥>縺薙→縺ッ縲?yper Estraier縺ョ迚ケ蠕エ縺ョ荳縺、縺ァ縺吶ゅせ繧ア繝シ繝ゥ繝薙Μ繝繧」繧貞髄荳翫☆繧九◆繧√ョ蟾・螟ォ縺ッ繧ウ繧「API縺ョ蜀驛ィ縺ァ繧縺」縺ヲ縺上l繧九ョ縺ァ縲√い繝励Μ繧ア繝シ繧キ繝ァ繝ウ菴懆縺ッ譁譖ク隕乗ィ。縺ョ縺薙→繧偵◎繧後⊇縺ゥ豌励↓縺励↑縺縺ァ貂医∩縺セ縺吶

縺薙ョ繧ャ繧、繝峨〒縺ッC險隱樒沿縺ョ繧ウ繧「API縺ォ縺、縺縺ヲ隱ャ譏弱@縺セ縺吶′縲√さ繧「API繧JavaRubyPerl縺九i蜻シ縺ウ蜃コ縺吶◆繧√ョ繝舌う繝ウ繝繧」繝ウ繧ー繧ゅ≠繧翫∪縺吶ゅ∪縺溘?yper Estraier縺ッP2P繧「繝シ繧ュ繝繧ッ繝√Ε縺ォ蝓コ縺・縺上繝弱シ繝陰PI縲阪b謠蝉セ帙@縺ヲ縺縺セ縺吶ゅヮ繝シ繝陰PI縺ォ縺、縺縺ヲ縺ッP2P繧ャ繧、繝繧偵#隕ァ縺上□縺輔>縲


繧「繝シ繧ュ繝繧ッ繝√Ε

縺薙%縺ァ縺ッ縲?yper Estraier縺ョ繧ウ繧「API縺ョ繧「繝シ繧ュ繝繧ッ繝√Ε縺ォ縺、縺縺ヲ隱ャ譏弱@縺セ縺吶

繧ョ繝」繧カ繝ゥ縺ィ繝輔ぅ繝ォ繧ソ

讀懃エ「蟇セ雎。縺ョ譁譖ク縺ョ繝繝シ繧ソ繧偵う繝ウ繝繝繧ッ繧ケ縺ォ逋サ骭イ縺吶k讖溯ス繧偵繧ョ繝」繧カ繝ゥシgathererシ峨阪→蜻シ縺カ縺薙→縺ォ縺励∪縺吶ゅぐ繝」繧カ繝ゥ縺ッ繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺悟ョ溯」縺励∪縺吶ゆセ九∴縺ー縲estcmd縺ォ縺ッ繝輔ぃ繧、繝ォ繧キ繧ケ繝繝繧呈爾邏「縺励※譁譖ク縺ョ繝繝シ繧ソ繧帝寔繧√※縺上k讖溯ス縺後≠繧翫∪縺吶′縲√◎縺薙〒縺ッ莉・荳九ョ繧医≧縺ェ蜃ヲ逅繧偵@縺ヲ縺縺セ縺吶

  • 繧ウ繝槭Φ繝峨Λ繧、繝ウ蠑墓焚繧定ァ」譫舌@縺ヲ縲√う繝ウ繝繝繧ッ繧ケ縺ョ蜷榊燕繧謗「邏「縺ョ髢句ァ狗せ繧貞叙蠕励@縺セ縺吶
  • 繧、繝ウ繝繝繧ッ繧ケ繧帝幕縺阪∪縺吶
  • 繝輔ぃ繧、繝ォ繧キ繧ケ繝繝繧呈爾邏「縺励※縲∫匳骭イ蟇セ雎。縺ョ繝輔ぃ繧、繝ォ縺ョ繝代せ繧堤音螳壹@縺セ縺吶
  • 荳願ィ倥〒繝ェ繧ケ繝医い繝繝励@縺溷九縺ョ繝輔ぃ繧、繝ォ縺ォ蟇セ縺励※窶・窶・
    • 繝輔ぃ繧、繝ォ蜷阪ョ謗・蟆セ霎槭↓繧医▲縺ヲ譁譖ク縺ョ遞ョ鬘槭r蛻、蛻・縺励∪縺吶
    • 繧オ繝昴シ繝医@縺ヲ縺繧狗ィョ鬘槭〒縺ゅl縺ー縲√ヵ繧。繧、繝ォ繧定ェュ縺ソ霎シ縺ソ縺セ縺吶
    • 譁譖ク縺ョ遞ョ鬘槭↓蠢懊§縺溘ヵ繧」繝ォ繧ソ讖溯ス繧貞他繧薙〒譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r菴懈舌@縺セ縺吶
    • 譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r繧、繝ウ繝繝繧ッ繧ケ縺ォ逋サ骭イ縺励∪縺吶
  • 繧、繝ウ繝繝繧ッ繧ケ繧帝哩縺倥∪縺吶

繝輔ぃ繧、繝ォ縺ェ縺ゥ縺九i譁譖ク縺ョ螻樊ァ縺ィ譛ャ譁繧貞叙繧雁コ縺呎ゥ溯ス繧偵繝輔ぅ繝ォ繧ソシfilterシ峨阪→蜻シ縺ウ縺セ縺吶ゅヵ繧」繝ォ繧ソ縺ッ繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺悟ョ溯」縺励∪縺吶ゅい繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺檎峡閾ェ縺ョ隗」譫仙ヲ逅繧貞ョ溯」縺励※繧ゅ>縺縺ァ縺吶@縲∝キキ縺ォ霆「縺後▲縺ヲ縺繧九Λ繧、繝悶Λ繝ェ繧剃スソ縺」縺ヲ繧ゅ>縺縺ァ縺励g縺縲ゅ≠繧九>縺ッ縲∝、夜Κ縺ョ繧ウ繝槭Φ繝峨r蜻シ縺ウ蜃コ縺励※縺昴ョ蜃コ蜉帙r蜉蟾・縺励※繧ゅ>縺縺ァ縺励g縺縲

繧オ繝シ繝√Ε

繧、繝ウ繝繝繧ッ繧ケ縺ォ讀懃エ「繧偵°縺代※隧イ蠖薙☆繧区枚譖ク縺ョ諠蝣ア繧貞叙蠕励@縲√◎繧後r陦ィ遉コ縺吶k讖溯ス繧偵繧オ繝シ繝√Εシsearcherシ峨阪→蜻シ縺ウ縺セ縺吶ゅし繝シ繝√Ε縺ッ繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺悟ョ溯」縺励∪縺吶ゆセ九∴縺ー縲estseek.cgi縺ッWeb繧オ繝シ繝蝉ク翫°繧韻GI縺ァ蜻シ縺ウ蜃コ縺輔l縺ヲ讀懃エ「邨先棡繧辿TML縺ィ縺励※逕滓舌☆繧区ゥ溯ス繧呈戟縺。縺セ縺吶′縲√◎繧後ッ莉・荳九ョ繧医≧縺ェ蜃ヲ逅繧偵@縺ヲ縺縺セ縺吶

  • 繧、繝ウ繝繝繧ッ繧ケ縺ョ蜷榊燕繧蜷遞ョ縺ョ陦ィ遉コ險ュ螳壹r險ュ螳壹ヵ繧。繧、繝ォ縺九i隱ュ縺ソ霎シ縺ソ縺セ縺吶
  • CGI縺ョ繝代Λ繝。繝シ繧ソ繧定ァ」譫舌@縺ヲ縲√Θ繝シ繧カ縺悟・蜉帙@縺滓、懃エ「譚。莉カ繧貞叙蠕励@縺セ縺吶
  • 繧、繝ウ繝繝繧ッ繧ケ繧帝幕縺阪∪縺吶
  • 蜈ィ譁讀懃エ「縺ョ讀懃エ「蠑上∝ア樊ァ譚。莉カ蠑上鬆蠎乗欠螳壹r謖√◆縺帙◆讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r逕滓舌@縺セ縺吶
  • 繧、繝ウ繝繝繧ッ繧ケ縺ォ讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r貂。縺励※縲∬ゥイ蠖薙☆繧区枚譖クID縺ョ繝ェ繧ケ繝医r蜿門セ励@縺セ縺吶
  • 荳願ィ倥〒繝ェ繧ケ繝医い繝繝励@縺溷九縺ョ譁譖クID縺ォ蟇セ縺励※窶・窶・
    • 繧、繝ウ繝繝繧ッ繧ケ縺ォ譁譖クID繧呈ク。縺励※譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r蜿門セ励@縺セ縺吶
    • 譁譖ク縺ョ螻樊ァ繧繧ケ繝九壹ャ繝医rHTML縺ォ蜉蟾・縺励※縺九i蜃コ蜉帙@縺セ縺吶
  • 繧、繝ウ繝繝繧ッ繧ケ繧帝哩縺倥∪縺吶

讀懃エ「邨先棡繧偵o縺九j繧縺吶¥縺吶k縺溘a縺ォ縲∝推譁譖ク縺ョ繧ケ繝九壹ャ繝茨シ育エケ莉区枚シ峨r陦ィ遉コ縺励◆譁ケ縺後>縺縺ァ縺励g縺縲よ悽譁縺九i讀懃エ「隱槭ョ蜻ィ霎コ繧呈栢縺榊コ縺励◆繧ケ繝九壹ャ繝医r菴懊k讖溯ス縺後さ繧「API縺ォ繧医▲縺ヲ謠蝉セ帙&繧後∪縺吶′縲√い繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺檎峡閾ェ縺ォ螳溯」縺励※繧ゅ°縺セ縺縺セ縺帙s縲りェ辟カ險隱槫ヲ逅繧定。後▲縺ヲ蜀螳ケ縺ョ隕∫エ繧偵@縺ヲ繧ゅ>縺縺ァ縺励g縺縲よ悽譁荳ュ縺ョ鬆サ蜃コ隱槭r繧ュ繝シ繝ッ繝シ繝峨→縺励※陦ィ遉コ縺励※繧ゅ>縺縺ァ縺励g縺縲

蜈ク蝙狗噪縺ェ繧キ繧ケ繝繝讒区

繧キ繧ケ繝繝讒区舌ョ蜈ク蝙倶セ九r莉・荳九↓蝗ウ遉コ縺励∪縺吶ゅ%繧後ッ縺ゅ¥縺セ縺ァ讎ょソオ逧縺ェ繧ゅョ縺ァ縲∝ョ滄圀縺ョ繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ァ縺ッ繧オ繝シ繝√Ε縺ィ繧ョ繝」繧カ繝ゥ繧剃ク縺、縺ョ繝「繧ク繝・繝シ繝ォ縺ァ螳溽樟縺励※繧ゅ>縺縺ァ縺吶@縲√Μ繝昴ず繝医Μ縺ォ繧ョ繝」繧カ繝ゥ繧繧オ繝シ繝√Ε繧堤オ縺ソ霎シ繧薙〒繧ゅ>縺縺ァ縺励g縺縲

[framework]

繝薙Ν繝

Hyper Estraier縺ョ繧ウ繧「API縺ッC險隱槭ョAPI縺ァ縺吶ョ縺ァ縲√い繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ螳溯」險隱槭ッC縺セ縺溘ッC++縺ォ縺ェ繧翫∪縺吶ゅ◆縺縺励∽サ悶ョ險隱橸シJava縺セ縺溘ッRubyシ峨ョ繝舌う繝ウ繝繧」繝ウ繧ー繧よ署萓帙&繧後※縺縺セ縺吶ゅ%縺薙〒縺ッ縲,險隱槭ョ繝ゥ繧、繝悶Λ繝ェ繧剃スソ縺」縺溘い繝励Μ繧ア繝シ繧キ繝ァ繝ウ繧偵ン繝ォ繝峨☆繧区婿豕輔r隱ャ譏弱@縺セ縺吶

繝倥ャ繝縺ョ蜿悶j霎シ縺ソ

繧ウ繧「API繧剃スソ縺繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ繧ス繝シ繧ケ繧ウ繝シ繝峨〒縺ッ縲estraier.h縺ィcabin.h縺ィstdlib.h繧偵う繝ウ繧ッ繝ォ繝シ繝峨@縺ヲ縺上□縺輔>縲estraier.h縺ッHyper Estraier縺ョ繝倥ャ繝繝輔ぃ繧、繝ォ縺ァ縲cabin.h縺ッQDBM縺ョ繝倥ャ繝繝輔ぃ繧、繝ォ縺ァ縺吶cabin.h縺梧署萓帙☆繧区ゥ溯ス縺ォ縺、縺縺ヲ縺ッQDBM縺ョ譁譖ク繧偵#隕ァ縺上□縺輔>縲

#include <estraier.h>
#include <cabin.h>
#include <stdlib.h>

繧ウ繝ウ繝代う繝ォ縺ィ繝ェ繝ウ繧ッ

繝繝輔か繝ォ繝医〒縺ッHyper Estraier縺ョ繝倥ャ繝縺ッ縲/usr/local/include縲阪ョ荳ュ縲√Λ繧、繝悶Λ繝ェ縺ッ縲/usr/local/lib縲阪ョ荳ュ縺ォ繧、繝ウ繧ケ繝医シ繝ォ縺輔l縲-lestraier縺ョ莉悶↓蜑肴署縺ィ縺ェ繧九Λ繧、繝悶Λ繝ェ縺ィ縺励※-lqdbm-lresolv-lnsl-lpthread-lz-liconv-lm-lc繧貞茜逕ィ縺励∪縺吶ゅ@縺溘′縺」縺ヲ縲?yper Estraier繧堤オ縺ソ霎シ繧薙□繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ繧偵ン繝ォ繝峨☆繧九↓縺ッ縲∽サ・荳九ョ繧医≧縺ェ繧ウ繝槭Φ繝峨r螳溯。後☆繧後ー繧医>縺薙→縺ォ縺ェ繧翫∪縺吶

gcc -I/usr/local/include -o foobar foobar.c \
  -L/usr/local/lib -lestraier -lresolv -lnsl -lpthread -lqdbm -lz -liconv -lm -lc

縺励°縺励∽ク願ィ倥ッHyper Estraier縺ョ繧、繝ウ繧ケ繝医シ繝ォ蜈医r螟峨∴縺溷エ蜷医↓縺ッ縺縺セ縺丞虚縺阪∪縺帙s縲ゅう繝ウ繝繧ー繝ャ繝シ繧キ繝ァ繝ウ繧定ェ蜍募喧縺吶k蝣エ蜷医↓縺ッ縲estconfig繧ウ繝槭Φ繝峨ョ蜃コ蜉帙r蝓九a霎シ繧繧医≧縺ォ縺励※縲∽ソ晏ョ域ァ繧貞髄荳翫&縺帙∪縺励g縺縲ゆサ・荳九ョ繧医≧縺ォ縺励∪縺吶

gcc `estconfig --cflags` -o foobar foobar.c `estconfig --ldflags` `estconfig --libs`

繧、繝ウ繝繧ー繝ャ繝シ繧キ繝ァ繝ウ逕ィ繧ウ繝槭Φ繝

estconfig縺ッ縲?yper Estraier繧剃スソ縺」縺溘す繧ケ繝繝繧繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ繧、繝ウ繝繧ー繝ャ繝シ繧キ繝ァ繝ウ繧定。後≧髫帙↓蠖ケ遶九▽繝ヲ繝シ繝繧」繝ェ繝繧」繧ウ繝槭Φ繝峨〒縺吶Hyper Estraier縺ョ繝薙Ν繝画凾縺ョ險ュ螳壹r蠕後〒蜿らァ縺吶k縺溘a縺ォ菴ソ縺縺セ縺吶

estconfig --version
繝舌シ繧ク繝ァ繝ウ諠蝣ア繧貞コ蜉帙@縺セ縺吶
estconfig --prefix
蜈ィ菴薙ョ繧、繝ウ繧ケ繝医シ繝ォ蜈医ョ謗・鬆ュ霎槭r蜃コ蜉帙@縺セ縺吶
estconfig --execprefix
繝励Λ繝繝医ヵ繧ゥ繝シ繝萓晏ュ倥ヵ繧。繧、繝ォ縺ョ繧、繝ウ繧ケ繝医シ繝ォ蜈医ョ謗・鬆ュ霎槭r蜃コ蜉帙@縺セ縺吶
estconfig --headdir
繝倥ャ繝繝輔ぃ繧、繝ォ縺ョ繧、繝ウ繧ケ繝医シ繝ォ蜈医ョ謗・鬆ュ霎槭r蜃コ蜉帙@縺セ縺吶
estconfig --libdir
繝ゥ繧、繝悶Λ繝ェ縺ョ繧、繝ウ繧ケ繝医シ繝ォ蜈医ョ謗・鬆ュ霎槭r蜃コ蜉帙@縺セ縺吶
estconfig --bindir
繧ウ繝槭Φ繝峨ョ繧、繝ウ繧ケ繝医シ繝ォ蜈医ョ謗・鬆ュ霎槭r蜃コ蜉帙@縺セ縺吶
estconfig --libexecdir
CGI繧ケ繧ッ繝ェ繝励ヨ縺ョ繧、繝ウ繧ケ繝医シ繝ォ蜈医ョ謗・鬆ュ霎槭r蜃コ蜉帙@縺セ縺吶
estconfig --datadir
蜷遞ョ險ュ螳壹ヵ繧。繧、繝ォ縺ョ繧、繝ウ繧ケ繝医シ繝ォ蜈医ョ謗・鬆ュ霎槭r蜃コ蜉帙@縺セ縺吶
estconfig --cflags
繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ繝薙Ν繝画凾縺ォ謖螳壹☆縺ケ縺阪さ繝ウ繝代う繝ゥ繧ェ繝励す繝ァ繝ウ繧貞コ蜉帙@縺セ縺吶
estconfig --ldflags
繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ繝薙Ν繝画凾縺ォ謖螳壹☆縺ケ縺阪Μ繝ウ繧ォ繧ェ繝励す繝ァ繝ウ繧貞コ蜉帙@縺セ縺吶
estconfig --libs
繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ繝薙Ν繝画凾縺ォ謖螳壹☆縺ケ縺阪Λ繧、繝悶Λ繝ェ繧貞コ蜉帙@縺セ縺吶

estconfig縺ッ蟶ク縺ォ0繧堤オゆコ繧ケ繝繝シ繧ソ繧ケ縺ォ縺励∪縺吶


譁譖ク繧呈桶縺API

縺薙%縺ァ縺ッ縲∵、懃エ「蟇セ雎。縺ョ譁譖ク繧呈桶縺縺溘a縺ョAPI縺ォ縺、縺縺ヲ隱ャ譏弱@縺セ縺吶

讖溯ス

讒矩菴灘梛 `ESTDOC' 縺ッ縲∵枚譖ク繧呈歓雎。蛹悶@縺溘b縺ョ縺ァ縺吶ゆク縺、縺ョ譁譖ク縺ッ縲∬、謨ー縺ョ螻樊ァ縺ィ隍謨ー縺ョ譛ャ譁縺ョ髮蜷医〒縺吶AESTDOC' 縺ョ螳滉ス薙′逶エ謗・蜿らァ縺輔l繧九%縺ィ縺ッ縺ェ縺上∝ソ縺壹昴う繝ウ繧ソ繧剃サ九@縺ヲ髢捺磁蜿らァ縺輔l縺セ縺吶ゅ%縺ョ繝昴う繝ウ繧ソ縺翫h縺ウ縺昴ョ蜿らァ蜈医r邱上§縺ヲ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝縺ィ蜻シ縺ウ縺セ縺吶よ枚譖ク繧ェ繝悶ず繧ァ繧ッ繝医ッ髢「謨ー `est_doc_new' 縺ォ繧医▲縺ヲ逕滓舌&繧後〜est_doc_delete' 縺ォ繧医▲縺ヲ遐エ譽縺輔l縺セ縺吶ら函謌舌&繧後◆譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ッ蠢縺夂エ譽縺励※縺上□縺輔>縲

讀懃エ「蟇セ雎。縺ィ縺ェ繧区枚譖ク縺ッ縲∵枚譖ク繧ェ繝悶ず繧ァ繧ッ繝医→縺励※陦ィ迴セ縺励◆荳翫〒縲∽コ医a繝繝シ繧ソ繝吶シ繧ケ縺ォ逋サ骭イ縺励※縺翫″縺セ縺吶ら匳骭イ貂医∩縺ョ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医↓縺ッID縺悟牡繧雁ス薙※繧峨l縺セ縺吶よ、懃エ「譎ゅ↓縺ッ縺昴ョID繧貞縺ォ繝繝シ繧ソ繝吶シ繧ケ縺ォ蝠上>蜷医o縺帙※縲∫匳骭イ縺励※縺ゅk譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r蜿悶j蜃コ縺吶%縺ィ縺ォ縺ェ繧翫∪縺吶ゅ↑縺翫∵枚譖ク繧ェ繝悶ず繧ァ繧ッ繝医↓莉伜刈縺吶k螻樊ァ繧譛ャ譁縺ョ譁蟄励さ繝シ繝峨ッUTF-8縺ォ縺励※縺上□縺輔>縲

譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ蜈ク蝙狗噪縺ェ繝ゥ繧、繝輔し繧、繧ッ繝ォ繧剃サ・荳九↓遉コ縺励∪縺吶

ESTDOC *doc;

/* 逕滓舌☆繧 */
doc = est_doc_new();

/* URI縺ィ繧ソ繧、繝医Ν繧貞ア樊ァ縺ィ縺励※莉伜刈縺吶k */
est_doc_add_attr(doc, "@uri", "http://foo.bar/baz.txt");
est_doc_add_attr(doc, "@title", "Now Scream");

/* 譛ャ譁繧剃サ伜刈縺吶k */
est_doc_add_text(doc, "Give it up, Yo!  Give it up, Yo!");
est_doc_add_text(doc, "Check it out, come on!");

  /* 縺薙%縺ァ繝繝シ繧ソ繝吶シ繧ケ縺ォ逋サ骭イ縺励◆繧翫∫判髱「縺ォ陦ィ遉コ縺励◆繧翫☆繧 */

/* 遐エ譽縺吶k */
est_doc_delete(doc);

API

譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r逕滓舌☆繧九↓縺ッ縲髢「謨ー `est_doc_new' 繧堤畑縺縺セ縺吶

ESTDOC *est_doc_new(void);
謌サ繧雁、縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医〒縺吶

譁譖ク繝峨Λ繝輔ヨ縺ョ繝繝シ繧ソ縺九i譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r逕滓舌☆繧九↓縺ッ縲髢「謨ー `est_doc_new_from_draft' 繧堤畑縺縺セ縺吶

ESTDOC *est_doc_new_from_draft(const char *draft);
`draft' 縺ッ譁譖ク繝峨Λ繝輔ヨ縺ョ譁蟄怜励r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医〒縺吶

譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r遐エ譽縺吶k縺ォ縺ッ縲髢「謨ー `est_doc_delete' 繧堤畑縺縺セ縺吶

void est_doc_delete(ESTDOC *doc);
`doc' 縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶

譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医↓螻樊ァ繧定ソス蜉縺吶k縺ォ縺ッ縲髢「謨ー `est_doc_add_attr' 繧堤畑縺縺セ縺吶

void est_doc_add_attr(ESTDOC *doc, const char *name, const char *value);
`doc' 縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aname' 縺ッ螻樊ァ蜷阪r謖螳壹@縺セ縺吶Avalue' 縺ッ螻樊ァ蛟、繧呈欠螳壹@縺セ縺吶′縲〜NULL' 縺ョ蝣エ蜷医ッ螻樊ァ繧貞炎髯、縺励∪縺吶

譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医↓譛ャ譁縺ョ荳譁繧定ソス蜉縺吶k縺ォ縺ッ縲髢「謨ー `est_doc_add_text' 繧堤畑縺縺セ縺吶

void est_doc_add_text(ESTDOC *doc, const char *text);
`doc' 縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Atext' 縺ッ譛ャ譁縺ョ荳譁繧呈欠螳壹@縺セ縺吶

譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医↓髫縺励ユ繧ュ繧ケ繝医ョ荳譁繧定ソス蜉縺吶k縺ォ縺ッ縲髢「謨ー `est_doc_add_hidden_text' 繧堤畑縺縺セ縺吶

void est_doc_add_hidden_text(ESTDOC *doc, const char *text);
`doc' 縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Atext' 縺ッ髫縺励ユ繧ュ繧ケ繝医ョ荳譁繧呈欠螳壹@縺セ縺吶

譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医↓繧ュ繝シ繝ッ繝シ繝峨r豺サ莉倥☆繧九↓縺ッ縲髢「謨ー `est_doc_set_keywords' 繧堤畑縺縺セ縺吶

void est_doc_set_keywords(ESTDOC *doc, CBMAP *kwords);
`doc' 縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Akwords' 縺ッ繧ュ繝シ繝ッ繝シ繝峨ョ繝槭ャ繝励が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶ゅ槭ャ繝励ョ繧ュ繝シ縺ッ繧ュ繝シ繝ッ繝シ繝峨ョ譁蟄怜励〒縲∝、縺ッ縺昴ョ繧ケ繧ウ繧「縺ョ10騾イ謨ー陦ィ迴セ縺ァ縺吶ゅ槭ャ繝励が繝悶ず繧ァ繧ッ繝医ッ蜀驛ィ逧縺ォ繧ウ繝斐シ縺輔l縺セ縺吶

譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医↓莉」譖ソ繧ケ繧ウ繧「繧定ィュ螳壹☆繧九↓縺ッ縲髢「謨ー `est_doc_set_score' 繧堤畑縺縺セ縺吶

void est_doc_set_score(ESTDOC *doc, int score);
`doc' 縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Ascore' 縺ッ莉」譖ソ繧ケ繧ウ繧「繧呈欠螳壹@縺セ縺吶りイ謨ー縺ョ蝣エ蜷医ッ莉」譖ソ繧ケ繧ウ繧「縺ョ譌「蟄倥ョ險ュ螳壹′辟。蜉ケ蛹悶&繧後∪縺吶

譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョID逡ェ蜿キ繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_doc_id' 繧堤畑縺縺セ縺吶

int est_doc_id(ESTDOC *doc);
`doc' 縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョID逡ェ蜿キ縺ァ縺吶ゅb縺励◎縺ョ繧ェ繝悶ず繧ァ繧ッ繝医′縺セ縺逋サ骭イ縺輔l縺ヲ縺縺ェ縺蝣エ蜷医-1縺瑚ソ斐&繧後∪縺吶

譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ螻樊ァ蜷阪ョ繝ェ繧ケ繝医r蜿門セ励☆繧九↓縺ッ縲髢「謨ー `est_doc_attr_names' 繧堤畑縺縺セ縺吶

CBLIST *est_doc_attr_names(ESTDOC *doc);
`doc' 縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ螻樊ァ蜷阪ョ繝ェ繧ケ繝医〒縺吶よ綾繧雁、縺ョ繧ェ繝悶ず繧ァ繧ッ繝医ッ `cblistopen' 縺ァ逕滓舌&繧後※縺繧九ョ縺ァ縲∽ク崎ヲ√↓縺ェ縺」縺溘i `cblistclose' 縺ァ遐エ譽縺励※縺上□縺輔>縲

譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ螻樊ァ縺ョ蛟、繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_doc_attr' 繧堤畑縺縺セ縺吶

const char *est_doc_attr(ESTDOC *doc, const char *name);
`doc' 縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aname' 縺ッ螻樊ァ蜷阪r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ螻樊ァ蛟、縺ァ縺吶′縲∬ゥイ蠖薙☆繧句ア樊ァ縺後↑縺蝣エ蜷医ッ `NULL' 縺瑚ソ斐&繧後∪縺吶よ綾繧雁、縺ョ譁蟄怜励ョ蟇ソ蜻ス縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ縺昴l縺ィ蜷梧悄縺励∪縺吶

譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ譛ャ譁縺ョ繝ェ繧ケ繝医r蜿門セ励☆繧九↓縺ッ縲髢「謨ー `est_doc_texts' 繧堤畑縺縺セ縺吶

const CBLIST *est_doc_texts(ESTDOC *doc);
`doc' 縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ譛ャ譁縺ョ繝ェ繧ケ繝医が繝悶ず繧ァ繧ッ繝医〒縺吶よ綾繧雁、縺ョ繧ェ繝悶ず繧ァ繧ッ繝医ョ蟇ソ蜻ス縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ縺昴l縺ィ蜷梧悄縺励∪縺吶

譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ譛ャ譁繧帝」邨舌@縺滓枚蟄怜励r蜿門セ励☆繧九↓縺ッ縲髢「謨ー `est_doc_cat_texts' 繧堤畑縺縺セ縺吶

char *est_doc_cat_texts(ESTDOC *doc);
`doc' 縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ譛ャ譁繧帝」邨舌@縺滓枚蟄怜励ョ繝繝シ繧ソ縺ァ縺吶よ綾繧雁、縺ョ鬆伜沺縺ッ `malloc' 縺ァ逕滓舌&繧後※縺繧九ョ縺ァ縲∽ク崎ヲ√↓縺ェ縺」縺溘i `free' 縺ァ遐エ譽縺励※縺上□縺輔>縲

譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医↓豺サ莉倥&繧後◆繧ュ繝シ繝ッ繝シ繝峨r蜿門セ励☆繧九↓縺ッ縲髢「謨ー `est_doc_keywords' 繧堤畑縺縺セ縺吶

CBMAP *est_doc_keywords(ESTDOC *doc);
`doc' 縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ繧ュ繝シ繝ッ繝シ繝峨ョ繝槭ャ繝励が繝悶ず繧ァ繧ッ繝医〒縺吶ゅ槭ャ繝励ョ繧ュ繝シ縺ッ繧ュ繝シ繝ッ繝シ繝峨ョ譁蟄怜励〒縲∝、縺ッ縺昴ョ繧ケ繧ウ繧「縺ョ10騾イ謨ー陦ィ迴セ縺ァ縺吶よ綾繧雁、縺ョ繧ェ繝悶ず繧ァ繧ッ繝医ョ蟇ソ蜻ス縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ縺昴l縺ィ蜷梧悄縺励∪縺吶

譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医°繧画枚譖ク繝峨Λ繝輔ヨ繧堤函謌舌☆繧九↓縺ッ縲髢「謨ー `est_doc_dump_draft' 繧堤畑縺縺セ縺吶

char *est_doc_dump_draft(ESTDOC *doc);
`doc' 縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ譁譖ク繝峨Λ繝輔ヨ縺ョ繝繝シ繧ソ縺ァ縺吶よ綾繧雁、縺ョ鬆伜沺縺ッ `malloc' 縺ァ逕滓舌&繧後※縺繧九ョ縺ァ縲∽ク崎ヲ√↓縺ェ縺」縺溘i `free' 縺ァ遐エ譽縺励※縺上□縺輔>縲

譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ譛ャ譁縺ョ繧ケ繝九壹ャ繝医r逕滓舌☆繧九↓縺ッ縲髢「謨ー `est_doc_make_snippet' 繧堤畑縺縺セ縺吶

char *est_doc_make_snippet(ESTDOC *doc, const CBLIST *words, int wwidth, int hwidth, int awidth);
`doc' 縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Awords' 縺ッ繝上う繝ゥ繧、繝医☆縺ケ縺崎ェ槫唱縺ョ繝ェ繧ケ繝医が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Awwidth' 縺ッ邨先棡蜈ィ菴薙ョ蟷シ遺薗譁蟄玲焚シ峨r謖螳壹@縺セ縺吶Ahwidth' 縺ッ譛ャ譁縺ョ蜀帝ュ縺九i謚ス蜃コ縺吶k蟷繧呈欠螳壹@縺セ縺吶Aawidth' 縺ッ繝上う繝ゥ繧、繝医&繧後k隱槭ョ蜻ィ霎コ縺九i謚ス蜃コ縺吶k蟷繧呈欠螳壹@縺セ縺吶よ綾繧雁、縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョ繧ケ繝九壹ャ繝医ョ譁蟄怜励〒縺吶ゅ◎縺ョ蠖「蠑上ッ繧ソ繝門玄蛻繧頑枚蟄怜暦シTSVシ峨〒縺吶ゅ◎縺ョ蜷陦後ッ陦ィ遉コ縺吶∋縺肴枚蟄怜励〒縺吶ゅ⊇縺ィ繧薙←縺ョ陦後ッ蜊倅ク縺ョ繝輔ぅ繝シ繝ォ繝峨@縺区戟縺。縺セ縺帙s縺後√>縺上▽縺九ッ莠後▽縺ョ繝輔ぅ繝シ繝ォ繝峨r謖√■縺セ縺吶ゅb縺礼ャャ2繝輔ぅ繝シ繝ォ繝峨′蟄伜惠縺励◆縺ェ繧峨ー縲∫ャャ1繝輔ぅ繝シ繝ォ繝峨ッ繝上う繝ゥ繧、繝医@縺ヲ陦ィ遉コ縺吶∋縺肴枚蟄怜励〒縲∫ャャ2繝輔ぅ繝シ繝ォ繝峨ッ縺昴ョ豁」隕丞喧縺輔l縺滓枚蟄怜励〒縺吶よ綾繧雁、縺ョ鬆伜沺縺ッ `malloc' 縺ァ逕滓舌&繧後※縺繧九ョ縺ァ縲∽ク崎ヲ√↓縺ェ縺」縺溘i `free' 縺ァ遐エ譽縺励※縺上□縺輔>縲

讀懃エ「譚。莉カ繧呈桶縺API

縺薙%縺ァ縺ッ縲∵、懃エ「譚。莉カ繧呈桶縺縺溘a縺ョAPI縺ォ縺、縺縺ヲ隱ャ譏弱@縺セ縺吶

讖溯ス

讒矩菴灘梛 `ESTCOND' 縺ッ縲∵、懃エ「譚。莉カ繧呈歓雎。蛹悶@縺溘b縺ョ縺ァ縺吶ゆク縺、縺ョ讀懃エ「譚。莉カ縺ッ縲∽ク縺、縺ョ讀懃エ「繝輔Ξ繝シ繧コ縺ィ隍謨ー縺ョ螻樊ァ讀懃エ「譚。莉カ縺ィ荳縺、縺ョ鬆蠎乗欠螳壹ョ髮蜷医〒縺吶AESTCOND' 縺ョ螳滉ス薙′逶エ謗・蜿らァ縺輔l繧九%縺ィ縺ッ縺ェ縺上∝ソ縺壹昴う繝ウ繧ソ繧剃サ九@縺ヲ髢捺磁蜿らァ縺輔l縺セ縺吶ゅ%縺ョ繝昴う繝ウ繧ソ縺翫h縺ウ縺昴ョ蜿らァ蜈医r邱上§縺ヲ讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝縺ィ蜻シ縺ウ縺セ縺吶よ、懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医ッ髢「謨ー `est_cond_new' 縺ォ繧医▲縺ヲ逕滓舌&繧後〜est_cond_delete' 縺ォ繧医▲縺ヲ遐エ譽縺輔l縺セ縺吶ら函謌舌&繧後◆讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医ッ蠢縺夂エ譽縺励※縺上□縺輔>縲

讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r繝繝シ繧ソ繝吶シ繧ケ縺ォ貂。縺吶%縺ィ縺ォ繧医j縲√◎縺ョ譚。莉カ縺ォ隧イ蠖薙☆繧区枚譖クID縺ョ繝ェ繧ケ繝医r蜿門セ励☆繧九%縺ィ縺後〒縺阪∪縺吶ょ推遞ョ縺ョ譚。莉カ蠑上ョ譖ク蠑上↓縺、縺縺ヲ縺ッ繝ヲ繝シ繧カ繧ャ繧、繝峨ョ讀懃エ「譚。莉カ蠑上ョ鬆逶ョ繧貞盾辣ァ縺励※縺上□縺輔>縲ゅ↑縺翫∝推遞ョ縺ョ譚。莉カ蠑上ョ譁蟄励さ繝シ繝峨ッUTF-8縺ォ縺励※縺上□縺輔>縲

讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医ョ蜈ク蝙狗噪縺ェ繝ゥ繧、繝輔し繧、繧ッ繝ォ繧剃サ・荳九↓遉コ縺励∪縺吶

ESTCOND *cond;

/* 逕滓舌☆繧 */
cond = est_cond_new();

/* 譛ャ譁縺ォ縲慶heck縲阪→縲経ut縲阪r蜷ォ繧縺ィ謖螳壹☆繧 */
est_cond_set_phrase(cond, "check AND out");

/* URI縺後.txt縲阪〒邨ゅo繧九→謖螳壹☆繧 */
est_cond_add_attr(cond, "@uri ISTREW .txt");

  /* 縺薙%縺ァ繝繝シ繧ソ繝吶シ繧ケ縺ォ蝠上>蜷医o縺帙r陦後≧ */

/* 遐エ譽縺吶k */
est_cond_delete(cond);

API

讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r逕滓舌☆繧九↓縺ッ縲髢「謨ー `est_cond_new' 繧堤畑縺縺セ縺吶

ESTCOND *est_cond_new(void);
謌サ繧雁、縺ッ讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医〒縺吶

讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r遐エ譽縺吶k縺ォ縺ッ縲髢「謨ー `est_cond_delete' 繧堤畑縺縺セ縺吶

void est_cond_delete(ESTCOND *cond);
`cond' 縺ッ讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶

讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医↓讀懃エ「繝輔Ξ繝シ繧コ繧定ィュ螳壹☆繧九↓縺ッ縲髢「謨ー `est_cond_set_phrase' 繧堤畑縺縺セ縺吶

void est_cond_set_phrase(ESTCOND *cond, const char *phrase);
`cond' 縺ッ讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aphrase' 縺ッ讀懃エ「繝輔Ξ繝シ繧コ繧呈欠螳壹@縺セ縺吶

讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医↓螻樊ァ讀懃エ「譚。莉カ繧定ソス蜉縺吶k縺ォ縺ッ縲髢「謨ー `est_cond_add_attr' 繧堤畑縺縺セ縺吶

void est_cond_add_attr(ESTCOND *cond, const char *expr);
`cond' 縺ッ讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aexpr' 縺ッ螻樊ァ讀懃エ「譚。莉カ縺ョ蠑上r謖螳壹@縺セ縺吶

讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医↓鬆蠎乗欠螳壹r險ュ螳壹☆繧九↓縺ッ縲髢「謨ー `est_cond_set_order' 繧堤畑縺縺セ縺吶

void est_cond_set_order(ESTCOND *cond, const char *expr);
`cond' 縺ッ讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aexpr' 鬆蠎乗欠螳壹ョ蠑上r謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医〒縺ッ縲鬆蠎上ッ繧ケ繧ウ繧「縺ョ髯埼縺ァ縺吶

讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医↓蜿門セ玲枚譖ク謨ー縺ョ譛螟ァ謨ー繧定ィュ螳壹☆繧九↓縺ッ縲髢「謨ー `est_cond_set_max' 繧堤畑縺縺セ縺吶

void est_cond_set_max(ESTCOND *cond, int max);
`cond' 縺ッ讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Amax' 縺ッ蜿門セ玲枚譖ク謨ー縺ョ譛螟ァ謨ー繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医〒縺ッ縲∝叙蠕玲枚譖ク謨ー縺ッ辟。蛻カ髯舌〒縺吶

讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医↓讀懃エ「邨先棡縺九i繧ケ繧ュ繝繝励☆繧区枚譖ク謨ー繧定ィュ螳壹☆繧九↓縺ッ縲髢「謨ー `est_cond_set_skip' 繧堤畑縺縺セ縺吶

void est_cond_set_skip(ESTCOND *cond, int skip);
`cond' 縺ッ讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Askip' 縺ッ讀懃エ「邨先棡縺九i繧ケ繧ュ繝繝励☆繧区枚譖ク謨ー繧呈欠螳壹@縺セ縺吶

讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医↓讀懃エ「繧ェ繝励す繝ァ繝ウ繧定ィュ螳壹☆繧九↓縺ッ縲髢「謨ー `est_cond_set_options' 繧堤畑縺縺セ縺吶

void est_cond_set_options(ESTCOND *cond, int options);
`cond' 縺ッ讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aoptions' 縺ッ繧ェ繝励す繝ァ繝ウ繧呈欠螳壹@縺セ縺吶AESTCONDSURE' 縺縺ィ蜈ィ縺ヲ縺ョN-gram繧ュ繝シ繧呈、懃エ「縺励∪縺吶AESTCONDUSUAL' 縺ッ繝繝輔か繝ォ繝医〒縺吶′縲¨-gram縺ョ繧ュ繝シ繧1蛟狗スョ縺阪〒讀懈渊縺励∪縺吶AESTCONDFAST' 縺縺ィN-gram縺ョ繧ュ繝シ繧2蛟狗スョ縺阪〜ESTCONDAGITO' 縺縺ィ3蛟狗スョ縺阪〒讀懈渊縺励∪縺吶AESTCONDNOIDF' 縺縺ィTF-IDF豕輔↓繧医k驥阪∩縺・縺代r逵∫払縺励∪縺吶AESTCONDSIMPLE' 縺縺ィ讀懃エ「繝輔Ξ繝シ繧コ繧堤ー。萓ソ譖ク蠑上ョ繧ゅョ縺ィ縺励※謇ア縺縺セ縺吶AESTCONDROUGH' 縺縺ィ讀懃エ「繝輔Ξ繝シ繧コ繧堤イ礼払譖ク蠑上ョ繧ゅョ縺ィ縺励※謇ア縺縺セ縺吶AESTCONDUNION' 縺縺ィ讀懃エ「繝輔Ξ繝シ繧コ繧定ォ也炊蜥梧嶌蠑擾シOR邨仙粋シ峨ョ繧ゅョ縺ィ縺励※謇ア縺縺セ縺吶AESTCONDISECT' 縺縺ィ讀懃エ「繝輔Ξ繝シ繧コ繧定ォ也炊遨肴嶌蠑擾シAND邨仙粋シ峨ョ繧ゅョ縺ィ縺励※謇ア縺縺セ縺吶AESTCONDSCFB' 縺縺ィ繧ケ繧ウ繧「繧偵ヵ繧」繝シ繝峨ヰ繝繧ッ縺励∪縺呻シ医ョ繝舌ャ繧ー蟆ら畑シ峨ゅ◎繧後◇繧後ョ繧ェ繝励す繝ァ繝ウ縺ッ繝薙ャ繝亥柱縺ァ蜷梧凾縺ォ謖螳壹〒縺阪∪縺吶N-gram縺ョ繧ュ繝シ縺ョ讀懈渊縺檎怐逡・縺輔l繧後ー縺輔l繧九⊇縺ゥ縲∵、懃エ「騾溷コヲ縺ッ蜷台ク翫@縺セ縺吶′縲∵、懃エ「邊セ蠎ヲ縺ッ菴惹ク九@縺セ縺吶

讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医↓陬懷勧繧、繝ウ繝繝繧ッ繧ケ縺ョ邨先棡繧呈治逕ィ縺吶k險ア蜿ッ繧定ィュ螳壹☆繧九↓縺ッ縲髢「謨ー `est_cond_set_auxiliary' 繧堤畑縺縺セ縺吶

void est_cond_set_auxiliary(ESTCOND *cond, int min);
`cond' 縺ッ讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Amin' 縺ッ陬懷勧繧、繝ウ繝繝繧ッ繧ケ縺瑚ソ斐☆邨先棡繧呈治逕ィ縺吶k縺溘a縺ョ荳矩剞隧イ蠖謎サカ謨ー繧呈欠螳壹@縺セ縺吶0繧定カ翫∴縺ェ縺蛟、繧呈欠螳壹☆繧九→縲∬」懷勧繧、繝ウ繝繝繧ッ繧ケ縺ッ菴ソ繧上l縺セ縺帙s縲ゅョ繝輔か繝ォ繝医ッ32莉カ縺ァ縺吶

讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医↓鬘樔シシ髫阡ス縺ォ縺翫¢繧倶ク矩剞鬘樔シシ蠎ヲ繧定ィュ螳壹☆繧九↓縺ッ縲髢「謨ー `est_cond_set_eclipse' 繧堤畑縺縺セ縺吶

void est_cond_set_eclipse(ESTCOND *cond, double limit);
`cond' 縺ッ讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Alimit' 縺ッ髫阡ス縺輔l繧区枚譖ク縺ョ荳矩剞縺ョ鬘樔シシ蠎ヲ繧0.0縺九i1.0縺セ縺ァ縺ョ蛟、縺ァ謖螳壹@縺セ縺吶′縲〜ESTECLSIMURL' 繧貞刈邂励☆繧九→URL繧帝阪∩莉倥¢縺ォ菴ソ縺繧医≧縺ォ縺ェ繧翫∪縺吶AESTECLSERV' 繧呈欠螳壹☆繧九→鬘樔シシ蠎ヲ繧堤┌隕悶@縺ヲ蜷後§繧オ繝シ繝舌ョ譁譖ク繧帝國阡ス縺励∪縺吶AESTECLDIR' 繧呈欠螳壹☆繧九→鬘樔シシ蠎ヲ繧堤┌隕悶@縺ヲ蜷後§繝繧」繝ャ繧ッ繝医Μ縺ョ譁譖ク繧帝國阡ス縺励∪縺吶AESTECLSERV' 繧呈欠螳壹☆繧九→鬘樔シシ蠎ヲ繧堤┌隕悶@縺ヲ蜷後§繝輔ぃ繧、繝ォ縺ョ譁譖ク繧帝國阡ス縺励∪縺吶

讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医↓螻樊ァ驥崎、髯、蜴サ繝輔ぅ繝ォ繧ソ繧定ィュ螳壹☆繧九↓縺ッ縲髢「謨ー `est_cond_set_distinct' 繧堤畑縺縺セ縺吶

void est_cond_set_distinct(ESTCOND *cond, const char *name);
`cond' 縺ッ讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aname' 縺ッ蛟、縺碁崎、縺励※縺ッ縺ェ繧峨↑縺螻樊ァ縺ョ蜷榊燕繧呈欠螳壹@縺セ縺吶ゅ%縺ョ繝輔ぅ繝ォ繧ソ縺瑚ィュ螳壹&繧後◆蝣エ蜷医∵、懃エ「邨先棡縺ョ蛟呵」懊ョ荳ュ縺ァ驥崎、縺吶k螻樊ァ蛟、繧呈戟縺、繧ゅョ縺ッ髯、螟悶&繧後∪縺吶

讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医↓繝。繧ソ讀懃エ「縺ョ蟇セ雎。縺ョ繝槭せ繧ッ繧定ィュ螳壹☆繧九↓縺ッ縲髢「謨ー `est_cond_set_mask' 繧堤畑縺縺セ縺吶

void est_cond_set_mask(ESTCOND *cond, int mask);
`cond' 縺ッ讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Amask' 縺ッ讀懃エ「蟇セ雎。縺ョ繝槭せ繧ッ繧呈欠螳壹@縺セ縺吶1縺ッ1逡ェ逶ョ縺ョ蟇セ雎。縲2縺ッ2逡ェ逶ョ縺ョ蟇セ雎。縲4縺ッ3逡ェ逶ョ縺ョ蟇セ雎。縺ィ縺縺」縺2縺ョ邏ッ荵励ョ蛟、縺ョ蜷郁ィ医〒讀懃エ「繧呈椛豁「縺吶k蟇セ雎。繧呈欠螳壹@縺セ縺吶

繝繝シ繧ソ繝吶シ繧ケ繧呈桶縺API

縺薙%縺ァ縺ッ縲√ョ繝シ繧ソ繝吶シ繧ケ繧呈桶縺縺溘a縺ョAPI縺ォ縺、縺縺ヲ隱ャ譏弱@縺セ縺吶

讖溯ス

讒矩菴灘梛 `ESTDB' 縺ッ縲√ョ繝シ繧ソ繝吶シ繧ケ縺ョ蜿らァ謇区ョオ繧呈歓雎。蛹悶@縺溘b縺ョ縺ァ縺吶ゅョ繝シ繧ソ繝吶シ繧ケ縺ッ縲∬サ「鄂ョ繧、繝ウ繝繝繧ッ繧ケ縺ィ譖ク隱梧ュ蝣ア縺ィ繝。繧ソ繝繝シ繧ソ繧剃ソ晄戟縺励∪縺吶ゅョ繝シ繧ソ繝吶シ繧ケ縺ォ謗・邯壹☆繧矩圀縺ォ縺ッ縲√Μ繝シ繝シ郁ェュ縺ソ霎シ縺ソ蟆ら畑シ峨°繝ゥ繧、繧ソシ郁ェュ縺ソ譖ク縺堺ク。逕ィシ峨ョ2縺、縺ョ繝「繝シ繝峨ョ縺ゥ縺。繧峨°繧帝∈謚槭@縺セ縺吶AESTDB' 縺ョ螳滉ス薙′逶エ謗・蜿らァ縺輔l繧九%縺ィ縺ッ縺ェ縺上∝ソ縺壹昴う繝ウ繧ソ繧剃サ九@縺ヲ髢捺磁蜿らァ縺輔l縺セ縺吶ゅ%縺ョ繝昴う繝ウ繧ソ縺翫h縺ウ縺昴ョ蜿らァ蜈医r邱上§縺ヲ繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝縺ィ蜻シ縺ウ縺セ縺吶ゅョ繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医ッ髢「謨ー `est_db_open' 縺ォ繧医▲縺ヲ逕滓舌&繧後〜est_db_close' 縺ォ繧医▲縺ヲ遐エ譽縺輔l縺セ縺吶ら函謌舌&繧後◆繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医ッ蠢縺夂エ譽縺励※縺上□縺輔>縲

蜷遞ョ縺ョ謫堺ス懊↓繧医▲縺ヲ繝繝シ繧ソ繝吶シ繧ケ縺ォ襍キ縺阪◆繧ィ繝ゥ繝シ縺ッ縲髢「謨ー `est_db_error' 縺ォ繧医▲縺ヲ蜿門セ励☆繧九%縺ィ縺後〒縺阪∪縺吶ょ推繧ィ繝ゥ繝シ繧ウ繝シ繝峨ョ諢丞袖縺ッ縲√お繝ゥ繝シ繧ウ繝シ繝峨r髢「謨ー `est_err_msg' 縺ォ貂。縺励※遏・繧九%縺ィ繧ゅ〒縺阪∪縺吶

繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医ョ蜈ク蝙狗噪縺ェ繝ゥ繧、繝輔し繧、繧ッ繝ォ繧剃サ・荳九↓遉コ縺励∪縺吶

ESTDB *db
int ecode;

/* 繝ゥ繧、繧ソ縺ィ縺励※髢九¥ */
if(!(db = est_db_open("casket", ESTDBWRITER | ESTDBCREAT, &ecode))){
  /* 螟ア謨励@縺溷エ蜷医√お繝ゥ繝シ繝。繝繧サ繝シ繧ク繧貞コ縺励※邨ゆコ縺吶k */
  fprintf(stderr, "error: %s\n", est_err_msg(ecode));
  return -1;
}

  /* 縺薙%縺ァ譁譖ク繧堤匳骭イ縺励◆繧翫∵、懃エ「繧定。後▲縺溘j縺吶k */

/* 繝繝シ繧ソ繝吶シ繧ケ繧帝哩縺倥k */
if(!est_db_close(db, &ecode)){
  /* 螟ア謨励@縺溷エ蜷医√お繝ゥ繝シ繝。繝繧サ繝シ繧ク繧貞コ縺励※邨ゆコ縺吶k */
  fprintf(stderr, "error: %s\n", est_err_msg(ecode));
  return -1;
}

API

繧ィ繝ゥ繝シ繧ウ繝シ繝峨ョ蛟、縺ィ縺励※莉・荳九ョ螳壽焚縺悟ョ夂セゥ縺輔l縺ヲ縺縺セ縺吶

  • ESTENOERR : 繧ィ繝ゥ繝シ縺瑚オキ縺阪※縺縺ェ縺縲
  • ESTEINVAL : 蠑墓焚縺悟ヲ・蠖薙〒縺ェ縺縲
  • ESTEACCES : 繧「繧ッ繧サ繧ケ縺檎ヲ∵ュ「縺輔l縺ヲ縺繧九
  • ESTELOCK : 繝ュ繝繧ッ縺ォ螟ア謨励@縺溘
  • ESTEDB : 繝繝シ繧ソ繝吶シ繧ケ縺ォ蝠城。後′縺ゅk縲
  • ESTEIO : 蜈・蜃コ蜉帙↓螟ア謨励@縺溘
  • ESTENOITEM : 隧イ蠖薙ョ繧「繧、繝繝縺後↑縺縲
  • ESTEMISC : 縺昴ョ莉悶ョ繧ィ繝ゥ繝シ縲

繧ィ繝ゥ繝シ繧ウ繝シ繝峨↓蟇セ蠢懊@縺滓枚蟄怜励r蜿門セ励☆繧九↓縺ッ縲髢「謨ー `est_err_msg' 繧堤畑縺縺セ縺吶

const char *est_err_msg(int ecode);
`ecode' 縺ッ繧ィ繝ゥ繝シ繧ウ繝シ繝峨r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ繧ィ繝ゥ繝シ繧ウ繝シ繝峨↓蟇セ蠢懊@縺滓枚蟄怜励〒縺吶

繝繝シ繧ソ繝吶シ繧ケ繧帝幕縺縺ヲ繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r逕滓舌☆繧九↓縺ッ縲髢「謨ー `est_db_open' 繧堤畑縺縺セ縺吶

ESTDB *est_db_open(const char *name, int omode, int *ecp);
`name' 縺ッ繝繝シ繧ソ繝吶シ繧ケ縺ョ繝繧」繝ャ繧ッ繝医Μ蜷阪r謖螳壹@縺セ縺吶Aomode' 縺ッ繧ェ繝シ繝励Φ繝「繝シ繝峨r謖螳壹@縺セ縺吶AESTDBWRITER' 縺ェ繧峨Λ繧、繧ソシ域嶌縺崎セシ縺ソ繝「繝シ繝会シ峨〒縲〜ESTDBREADER' 縺ェ繧峨Μ繝シ繝シ郁ェュ縺ソ霎シ縺ソ繝「繝シ繝会シ峨〒縺吶ゅΛ繧、繧ソ縺ョ蝣エ蜷医√ン繝繝亥柱縺ァ谺。縺ョ繧ゅョ繧呈欠螳壹〒縺阪∪縺吶AESTDBCREAT' 縺ェ繧峨ョ繝シ繧ソ繝吶シ繧ケ縺悟ュ伜惠縺励↑縺蝣エ蜷医↓譁ー隕上↓菴懈舌☆繧九%縺ィ繧呈欠遉コ縺励〜ESTDBTRUNC' 縺ェ繧峨ョ繝シ繧ソ繝吶シ繧ケ縺梧里蟄倥□縺」縺溷エ蜷医↓繧よ眠隕上↓菴懊j縺ェ縺翫☆縺薙→繧呈欠遉コ縺励∪縺吶ゅΜ繝シ繝縺ァ繧ゅΛ繧、繧ソ縺ァ繧 `ESTDBNOLCK' 縺セ縺溘ッ `ESTDBLCKNB' 繧偵ン繝繝亥柱縺ァ謖螳壹☆繧九%縺ィ縺後〒縺阪∪縺吶′縲∝燕閠縺ッ繝輔ぃ繧、繝ォ繝ュ繝繧ッ繧偵°縺代↑縺縺ァ繝繝シ繧ソ繝吶シ繧ケ繧帝幕縺上%縺ィ繧呈欠遉コ縺励∝セ瑚縺ッ繝悶Ο繝繧ッ縺帙★縺ォ繝ュ繝繧ッ繧偵°縺代k縺薙→繧呈欠遉コ縺励∪縺吶ゅ◎縺ョ蝣エ蜷医ッ謗剃サ門宛蠕。縺ョ雋ャ莉サ縺ッ繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺瑚イ縺縺セ縺吶AESTDBCREAT' 縺ォ `ESTDBPERFNG' 繧偵ン繝繝亥柱縺ァ蜉縺医※繝繝シ繧ソ繝吶シ繧ケ繧剃ス懈舌☆繧九→縲∵ャァ譁繧ょョ悟ィ縺ェN-gram豕輔〒蜃ヲ逅縺輔l繧九h縺縺ォ縺ェ繧翫∪縺吶AESTDBCREAT' 縺ォ `ESTDBCHRCAT' 繧偵ン繝繝亥柱縺ァ蜉縺医※繝繝シ繧ソ繝吶シ繧ケ繧剃ス懈舌☆繧九→縲¨-gram豕輔ョ莉」繧上j縺ォ譁蟄怜鬘樊ウ輔′隗」譫舌↓逕ィ縺繧峨l縺セ縺吶AESTDBCREAT' 縺ォ `ESTDBSMALL' 繧偵ン繝繝亥柱縺ァ蜉縺医※繝繝シ繧ソ繝吶シ繧ケ繧剃ス懈舌☆繧九→50000莉カ譛ェ貅縺ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ縺後メ繝・繝シ繝九Φ繧ー縺輔l縲〜ESTDBLARGE' 繧偵ン繝繝亥柱縺ァ蜉縺医※繝繝シ繧ソ繝吶シ繧ケ繧剃ス懈舌☆繧九→300000莉カ莉・荳翫ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ縺後メ繝・繝シ繝九Φ繧ー縺輔l縲〜ESTDBHUGE' 繧偵ン繝繝亥柱縺ァ蜉縺医※繝繝シ繧ソ繝吶シ繧ケ繧剃ス懈舌☆繧九→1000000莉カ莉・荳翫ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ縺後メ繝・繝シ繝九Φ繧ー縺輔l縲〜ESTDBHUGE2' 繧偵ン繝繝亥柱縺ァ蜉縺医※繝繝シ繧ソ繝吶シ繧ケ繧剃ス懈舌☆繧九→5000000莉カ莉・荳翫ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ縺後メ繝・繝シ繝九Φ繧ー縺輔l縲〜ESTDBHUGE3' 繧偵ン繝繝亥柱縺ァ蜉縺医※繝繝シ繧ソ繝吶シ繧ケ繧剃ス懈舌☆繧九→10000000莉カ莉・荳翫ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ縺後メ繝・繝シ繝九Φ繧ー縺輔l縲〜ESTDBSCVOID' 繧偵ン繝繝亥柱縺ァ蜉縺医※繝繝シ繧ソ繝吶シ繧ケ繧剃ス懈舌☆繧九→繧ケ繧ウ繧「諠蝣ア繧堤エ譽縺吶k繧医≧縺ォ縺ェ繧翫〜ESTDBSCINT' 繧偵ン繝繝亥柱縺ァ蜉縺医※繝繝シ繧ソ繝吶シ繧ケ繧剃ス懈舌☆繧九→繧ケ繧ウ繧「諠蝣ア繧32繝薙ャ繝医ョ謨ー蛟、縺ィ縺励※險倬鹸縺吶k繧医≧縺ォ縺ェ繧翫〜ESTDBSCASIS' 繧偵ン繝繝亥柱縺ァ蜉縺医※繝繝シ繧ソ繝吶シ繧ケ繧剃ス懈舌☆繧九→繧ケ繧ウ繧「諠蝣ア繧偵◎縺ョ縺セ縺セ菫晏ュ倥@縺滉ク翫〒讀懃エ「譎ゅ↓隱ソ謨エ縺輔l縺ェ縺繧医≧縺ォ繝槭シ繧ッ縺励∪縺吶Aecp' 縺ッ繧ィ繝ゥ繝シ繧ウ繝シ繝峨r譬シ邏阪☆繧句、画焚縺ク縺ョ繝昴う繝ウ繧ソ繧呈欠螳壹@縺セ縺吶よ綾繧雁、縺ッ繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医°縲√お繝ゥ繝シ縺ョ蝣エ蜷医ッ `NULL' 縺ァ縺吶

繝繝シ繧ソ繝吶シ繧ケ繧帝哩縺倥※繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r遐エ譽縺吶k縺ォ縺ッ縲髢「謨ー `est_db_close' 繧堤畑縺縺セ縺吶

int est_db_close(ESTDB *db, int *ecp);
`db' 縺ッ繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aecp' 縺ッ繧ィ繝ゥ繝シ繧ウ繝シ繝峨r譬シ邏阪☆繧句、画焚縺ク縺ョ繝昴う繝ウ繧ソ繧呈欠螳壹@縺セ縺吶よ綾繧雁、縺ッ謌仙粥縺ェ繧臥悄縲√お繝ゥ繝シ縺ェ繧牙⊃縺ァ縺吶

繝繝シ繧ソ繝吶シ繧ケ縺ォ逶エ蜑阪↓襍キ縺阪◆繧ィ繝ゥ繝シ繧ウ繝シ繝峨r蜿門セ励☆繧九↓縺ッ縲髢「謨ー `est_db_error' 繧堤畑縺縺セ縺吶

int est_db_error(ESTDB *db);
`db' 縺ッ繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ繝繝シ繧ソ繝吶シ繧ケ縺ォ逶エ蜑阪↓襍キ縺阪◆繧ィ繝ゥ繝シ繧ウ繝シ繝峨〒縺吶

繝繝シ繧ソ繝吶シ繧ケ縺ォ閾エ蜻ス逧繧ィ繝ゥ繝シ縺後≠縺」縺溘°縺ゥ縺縺区、懈渊縺吶k縺ォ縺ッ縲髢「謨ー `est_db_fatal' 繧堤畑縺縺セ縺吶

int est_db_fatal(ESTDB *db);
`db' 縺ッ繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ繝繝シ繧ソ繝吶シ繧ケ縺ォ閾エ蜻ス逧繧ィ繝ゥ繝シ縺後≠繧後ー逵溘√◎縺縺ァ縺ェ縺代l縺ー蛛ス縺ァ縺吶

繝繝シ繧ソ繝吶シ繧ケ縺ォ螻樊ァ縺ョ邨槭j霎シ縺ソ逕ィ縺セ縺溘ッ繧ス繝シ繝育畑縺ョ繧、繝ウ繝繝繧ッ繧ケ繧貞刈縺医k縺ォ縺ッ縲髢「謨ー `est_db_add_attr_index' 繧堤畑縺繧九

int est_db_add_attr_index(ESTDB *db, const char *name, int type);
`db' 縺ッ繝ゥ繧、繧ソ縺ィ縺励※謗・邯壹@縺溘ョ繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aname' 縺ッ蟇セ雎。縺ィ縺ェ繧句ア樊ァ縺ョ蜷榊燕繧呈欠螳壹@縺セ縺吶Atype' 縺ッ繧、繝ウ繝繝繧ッ繧ケ縺ョ繝繝シ繧ソ蝙九r謖螳壹@縺セ縺吶AESTIDXATTRSEQ' 縺ェ繧牙、夂岼逧縺ョ繧キ繝シ繧ア繝ウ繧キ繝」繝ォ繧「繧ッ繧サ繧ケ逕ィ縺ォ縺ェ繧翫〜ESTIDXATTRSTR' 縺ェ繧画枚蟄怜励ョ邨槭j霎シ縺ソ逕ィ縺ォ縺ェ繧翫〜ESTIDXATTRNUM' 縺ェ繧画焚蛟、蝙九ョ邨槭j霎シ縺ソ逕ィ縺ォ縺ェ繧翫∪縺吶よ綾繧雁、縺ッ謌仙粥縺ェ繧臥悄縲√お繝ゥ繝シ縺ェ繧牙⊃縺ァ縺吶ゅ%縺ョ髢「謨ー縺ッ縺ゥ縺ョ譁譖ク繧堤匳骭イ縺吶k繧医j繧ょ燕縺ォ蜻シ縺カ蠢隕√′縺ゅj縺セ縺吶

繝繝シ繧ソ繝吶シ繧ケ縺ョ繧ュ繝」繝繧キ繝・蜀縺ョ邏「蠑戊ェ槭r繝輔Λ繝繧キ繝・縺吶k縺ォ縺ッ縲髢「謨ー `est_db_flush' 繧堤畑縺縺セ縺吶

int est_db_flush(ESTDB *db, int max);
`db' 縺ッ繝ゥ繧、繧ソ縺ィ縺励※謗・邯壹@縺溘ョ繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Amax' 縺ッ繝輔Λ繝繧キ繝・縺吶k隱槭ョ譛螟ァ謨ー繧呈欠螳壹@縺セ縺吶′縲0莉・荳九↑繧峨ー蜈ィ縺ヲ縺ョ邏「蠑戊ェ槭′繝輔Λ繝繧キ繝・縺輔l縺セ縺吶よ綾繧雁、縺ッ謌仙粥縺ェ繧臥悄縲√お繝ゥ繝シ縺ェ繧牙⊃縺ァ縺吶

繝繝シ繧ソ繝吶シ繧ケ縺ョ譖エ譁ー蜀螳ケ繧貞酔譛溘&縺帙k縺ォ縺ッ縲髢「謨ー `est_db_sync' 繧堤畑縺縺セ縺吶

int est_db_sync(ESTDB *db);
`db' 縺ッ繝ゥ繧、繧ソ縺ィ縺励※謗・邯壹@縺溘ョ繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ謌仙粥縺ェ繧臥悄縲√お繝ゥ繝シ縺ェ繧牙⊃縺ァ縺吶

繝繝シ繧ソ繝吶シ繧ケ繧呈怙驕ゥ蛹悶☆繧九↓縺ッ縲髢「謨ー `est_db_optimize' 繧堤畑縺縺セ縺吶

int est_db_optimize(ESTDB *db, int options);
`db' 縺ッ繝ゥ繧、繧ソ縺ィ縺励※謗・邯壹@縺溘ョ繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aoptions' 縺ッ繧ェ繝励す繝ァ繝ウ繧呈欠螳壹@縺セ縺吶AESTOPTNOPURGE' 縺ッ蜑企勁縺輔l縺滓枚譖ク縺ョ諠蝣ア繧呈カ亥悉縺吶k蜃ヲ逅繧堤怐逡・縺吶k縺薙→繧呈欠遉コ縺励〜ESTOPTNODBOPT' 縺ッ繝繝シ繧ソ繝吶シ繧ケ繝輔ぃ繧、繝ォ縺ョ譛驕ゥ蛹悶r逵∫払縺吶k縺薙→繧呈欠遉コ縺励∪縺吶ゅが繝励す繝ァ繝ウ縺ッ繝薙ャ繝亥柱縺ァ蜷梧凾縺ォ謖螳壹〒縺阪∪縺吶よ綾繧雁、縺ッ謌仙粥縺ェ繧臥悄縲√お繝ゥ繝シ縺ェ繧牙⊃縺ァ縺吶

蛻・縺ョ繝繝シ繧ソ繝吶シ繧ケ繧偵槭シ繧ク縺吶k縺ォ縺ッ縲髢「謨ー `est_db_merge' 繧堤畑縺縺セ縺吶

int est_db_merge(ESTDB *db, const char *name, int options);
`db' 縺ッ繝ゥ繧、繧ソ縺ィ縺励※謗・邯壹@縺溘ョ繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aname' 縺ッ蛻・縺ョ繝繝シ繧ソ繝吶シ繧ケ縺ョ繝繧」繝ャ繧ッ繝医Μ蜷阪r謖螳壹@縺セ縺吶Aoptions' 縺ッ繧ェ繝励す繝ァ繝ウ繧呈欠螳壹@縺セ縺吶AESTODCLEAN' 縺ッ蜑企勁縺輔l縺滓枚譖ク縺ョ鬆伜沺繧呈紛逅縺吶k縺薙→繧呈欠遉コ縺励∪縺吶よ綾繧雁、縺ッ謌仙粥縺ェ繧臥悄縲√お繝ゥ繝シ縺ェ繧牙⊃縺ァ縺吶ょ曙譁ケ縺ョ繝繝シ繧ソ繝吶シ繧ケ繧剃ス懈舌@縺滄圀縺ョ繧ェ繝励す繝ァ繝ウ縺ッ螳悟ィ縺ォ蜷御ク縺ァ縺ゅk蠢隕√′縺ゅj縺セ縺吶ょ叙繧願セシ繧薙□譁譖ク縺ョURL縺梧里蟄倥ョ譁譖ク縺ョURL縺ィ蜷後§蝣エ蜷医ッ縲∵里蟄倥ョ譁譖ク縺ッ蜑企勁縺輔l縺セ縺吶

繝繝シ繧ソ繝吶シ繧ケ縺ォ譁譖ク繧定ソス蜉縺吶k縺ォ縺ッ縲髢「謨ー `est_db_put_doc' 繧堤畑縺縺セ縺吶

int est_db_put_doc(ESTDB *db, ESTDOC *doc, int options);
`db' 縺ッ繝ゥ繧、繧ソ縺ィ縺励※謗・邯壹@縺溘ョ繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Adoc' 縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ枚譖ク繧ェ繝悶ず繧ァ繧ッ繝医ッURI螻樊ァ繧呈戟縺」縺ヲ縺縺ェ縺代l縺ー縺ェ繧翫∪縺帙s縲Aoptions' 縺ッ繧ェ繝励す繝ァ繝ウ繧呈欠螳壹@縺セ縺吶AESTPDCLEAN' 縺ッ荳頑嶌縺阪&繧後◆譁譖ク縺ョ鬆伜沺繧呈紛逅縺吶k縺薙→繧呈欠遉コ縺励〜ESTPDWEIGHT' 縺ッ繧、繝ウ繝繧ッ繧キ繝ウ繧ー縺ョ髫帙↓驥阪∩莉倥¢螻樊ァ繧帝撕逧縺ォ驕ゥ逕ィ縺吶k縺薙→繧呈欠遉コ縺励∪縺吶よ綾繧雁、縺ッ謌仙粥縺ェ繧臥悄縲√お繝ゥ繝シ縺ェ繧牙⊃縺ァ縺吶よ欠螳壹&繧後◆譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ョURI螻樊ァ縺後ョ繝シ繧ソ繝吶シ繧ケ蜀縺ョ譌「蟄倥ョ譁譖ク縺ィ荳閾エ縺吶k蝣エ蜷医∵里蟄倥ョ譁ケ縺ッ蜑企勁縺輔l縺セ縺吶

繝繝シ繧ソ繝吶シ繧ケ縺九i譁譖ク繧貞炎髯、縺吶k縺ォ縺ッ縲髢「謨ー `est_db_out_doc' 繧堤畑縺縺セ縺吶

int est_db_out_doc(ESTDB *db, int id, int options);
`db' 縺ッ繝ゥ繧、繧ソ縺ィ縺励※謗・邯壹@縺溘ョ繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aid' 縺ッ逋サ骭イ譁譖ク縺ョID逡ェ蜿キ繧呈欠螳壹@縺セ縺吶Aoptions' 縺ッ繧ェ繝励す繝ァ繝ウ繧呈欠螳壹@縺セ縺吶AESTODCLEAN' 縺ッ蜑企勁縺輔l縺滓枚譖ク縺ョ鬆伜沺繧呈紛逅縺吶k縺薙→繧呈欠遉コ縺励∪縺吶よ綾繧雁、縺ッ謌仙粥縺ェ繧臥悄縲√お繝ゥ繝シ縺ェ繧牙⊃縺ァ縺吶

繝繝シ繧ソ繝吶シ繧ケ蜀縺ョ譁譖ク縺ョ螻樊ァ繧堤キィ髮縺吶k縺ォ縺ッ縲髢「謨ー `est_db_edit_doc' 繧堤畑縺縺セ縺吶

int est_db_edit_doc(ESTDB *db, ESTDOC *doc);
`db' 縺ッ繝ゥ繧、繧ソ縺ィ縺励※謗・邯壹@縺溘ョ繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aid' 縺ッ逋サ骭イ譁譖ク縺ョID逡ェ蜿キ繧呈欠螳壹@縺セ縺吶Adoc' 縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ謌仙粥縺ェ繧臥悄縲√お繝ゥ繝シ縺ェ繧牙⊃縺ァ縺吶ID螻樊ァ繧貞、画峩縺吶k縺薙→縺ッ縺ァ縺阪∪縺帙s縲ょ、画峩縺励◆URI螻樊ァ縺御サ悶ョ逋サ骭イ譁譖ク縺ィ驥阪↑繧句エ蜷医ッ繧ィ繝ゥ繝シ縺ィ縺ェ繧翫∪縺吶

繝繝シ繧ソ繝吶シ繧ケ縺九i譁譖ク繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_db_get_doc' 繧堤畑縺縺セ縺吶

ESTDOC *est_db_get_doc(ESTDB *db, int id, int options);
`db' 縺ッ繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aid' 縺ッ逋サ骭イ譁譖ク縺ョID逡ェ蜿キ繧呈欠螳壹@縺セ縺吶Aoptions' 縺ッ繧ェ繝励す繝ァ繝ウ繧呈欠螳壹@縺セ縺吶AESTGDNOATTR' 縺ッ螻樊ァ繧貞叙蠕励@縺ェ縺縺薙→繧呈欠遉コ縺励〜ESTGDNOTEXT' 縺ッ譛ャ譁繧貞叙蠕励@縺ェ縺縺薙→繧呈欠遉コ縺励〜ESTGDNOKWD' 縺ッ繧ュ繝シ繝ッ繝シ繝峨r蜿門セ励@縺ェ縺縺薙→繧呈欠遉コ縺励∪縺吶ゅが繝励す繝ァ繝ウ縺ッ繝薙ャ繝亥柱縺ァ蜷梧凾縺ォ謖螳壹〒縺阪∪縺吶よ綾繧雁、縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医°縲√お繝ゥ繝シ縺ェ繧 `NULL' 縺ァ縺吶よ綾繧雁、縺ョ繧ェ繝悶ず繧ァ繧ッ繝医ッ `est_doc_new' 縺ァ逕滓舌&繧後※縺繧九ョ縺ァ縲∽ク崎ヲ√↓縺ェ縺」縺溘i `est_doc_delete' 縺ァ遐エ譽縺励※縺上□縺輔>縲

繝繝シ繧ソ繝吶シ繧ケ縺九i譁譖ク縺ョ螻樊ァ繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_db_get_doc_attr' 繧堤畑縺縺セ縺吶

char *est_db_get_doc_attr(ESTDB *db, int id, const char *name);
`db' 縺ッ繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Aid' 縺ッ逋サ骭イ譁譖ク縺ョID逡ェ蜿キ繧呈欠螳壹@縺セ縺吶Aname' 縺ッ螻樊ァ蜷阪r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ螻樊ァ蛟、縺ァ縺吶′縲∬ゥイ蠖薙☆繧区枚譖ク縺句ア樊ァ縺後↑縺蝣エ蜷医ッ `NULL' 縺瑚ソ斐&繧後∪縺吶よ綾繧雁、縺ョ鬆伜沺縺ッ `malloc' 縺ァ逕滓舌&繧後※縺繧九ョ縺ァ縲∽ク崎ヲ√↓縺ェ縺」縺溘i `free' 縺ァ遐エ譽縺励※縺上□縺輔>縲

URI縺ォ蟇セ蠢懊☆繧区枚譖ク縺ョID逡ェ蜿キ繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_db_uri_to_id' 繧堤畑縺縺セ縺吶

int est_db_uri_to_id(ESTDB *db, const char *uri);
`db' 縺ッ繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Auri' 縺ッ逋サ骭イ譁譖ク縺ョURI繧呈欠螳壹@縺セ縺吶よ綾繧雁、縺ッ譁譖ク縺ョID逡ェ蜿キ縺ァ縺ゅk縺九√お繝ゥ繝シ縺ェ繧-1縺ァ縺吶

繝繝シ繧ソ繝吶シ繧ケ縺ョ蜷榊燕繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_db_name' 繧堤畑縺縺セ縺吶

const char *est_db_name(ESTDB *db);
`db' 縺ッ繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ繝繝シ繧ソ繝吶シ繧ケ縺ョ蜷榊燕縺ァ縺吶よ綾繧雁、縺ョ譁蟄怜励ョ蟇ソ蜻ス縺ッ繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医ョ縺昴l縺ィ蜷梧悄縺励∪縺吶

繝繝シ繧ソ繝吶シ繧ケ縺ォ逋サ骭イ縺輔l縺滓枚譖ク縺ョ謨ー繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_db_doc_num' 繧堤畑縺縺セ縺吶

int est_db_doc_num(ESTDB *db);
`db' 縺ッ繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ繝繝シ繧ソ繝吶シ繧ケ縺ォ逋サ骭イ縺輔l縺滓枚譖ク縺ョ謨ー縺ァ縺吶

繝繝シ繧ソ繝吶シ繧ケ縺ォ逋サ骭イ縺輔l縺溽焚縺ェ繧願ェ槭ョ謨ー繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_db_word_num' 繧堤畑縺縺セ縺吶

int est_db_word_num(ESTDB *db);
`db' 縺ッ繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ繝繝シ繧ソ繝吶シ繧ケ縺ォ逋サ骭イ縺輔l縺溽焚縺ェ繧願ェ槭ョ謨ー縺ァ縺吶

繝繝シ繧ソ繝吶シ繧ケ縺ョ繧オ繧、繧コ繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_db_size' 繧堤畑縺縺セ縺吶

double est_db_size(ESTDB *db);
`db' 縺ッ繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ繝繝シ繧ソ繝吶シ繧ケ縺ョ繧オ繧、繧コ縺ァ縺吶

讀懃エ「譚。莉カ縺ォ隧イ蠖薙☆繧区枚譖ク縺ョ荳隕ァ繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_db_search' 繧堤畑縺縺セ縺吶

int *est_db_search(ESTDB *db, ESTCOND *cond, int *nump, CBMAP *hints);
`db' 縺ッ繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Acond' 縺ッ讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Anump' 縺ッ謌サ繧雁、縺ョ驟榊励ョ隕∫エ謨ー繧呈シ邏阪☆繧句、画焚縺ク縺ョ繝昴う繝ウ繧ソ縺ァ縺吶Ahints' 縺ッ蜷讀懃エ「隱槭↓隧イ蠖薙☆繧区枚譖ク謨ー繧呈シ邏阪☆繧九槭ャ繝励が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶′縲〜NULL' 縺ェ繧臥┌隕悶&繧後∪縺吶ょ凄螳壽擅莉カ縺ョ荳ュ縺ョ隱槭ョ隧イ蠖捺焚縺ッ雋謨ー縺ォ縺ェ繧翫∪縺吶ゅ槭ャ繝怜縺ョ遨コ譁蟄怜励ョ繧ュ繝シ縺ォ縺ッ蜈ィ菴薙ョ隧イ蠖捺焚縺碁未騾」縺・縺代i繧後∪縺吶よ綾繧雁、縺ッ隧イ蠖薙@縺滓枚譖ク縺ョID繧呈シ邏阪@縺滄榊励〒縺吶ゅ%縺ョ髢「謨ー縺ッ豎コ縺励※繧ィ繝ゥ繝シ縺ォ縺ェ繧翫∪縺帙s縲ゅb縺苓ゥイ蠖薙☆繧区枚譖ク縺後↑縺蝣エ蜷医↓繧ゅ∫ゥコ縺ョ驟榊励′霑斐&繧後∪縺吶よ綾繧雁、縺ョ鬆伜沺縺ッ `malloc' 縺ァ逕滓舌&繧後※縺繧九ョ縺ァ縲∽ク崎ヲ√↓縺ェ縺」縺溘i `free' 縺ァ遐エ譽縺励※縺上□縺輔>縲

隍謨ー縺ョ繝繝シ繧ソ繝吶シ繧ケ繧呈、懃エ「縺励※讀懃エ「譚。莉カ縺ォ隧イ蠖薙☆繧区枚譖ク縺ョ荳隕ァ繧貞叙蠕励☆繧九↓縺ッ縲髢「謨ー `est_db_search_meta' 繧堤畑縺縺セ縺吶

int *est_db_search_meta(ESTDB **dbs, int dbnum, ESTCOND *cond, int *nump, CBMAP *hints);
`dbs' 縺ッ繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r隕∫エ縺ィ縺励◆驟榊励r謖螳壹@縺セ縺吶Adbnum' 縺ッ縺昴ョ驟榊励ョ隕∫エ謨ー繧呈欠螳壹@縺セ縺吶Acond' 縺ッ讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Anump' 縺ッ謌サ繧雁、縺ョ驟榊励ョ隕∫エ謨ー繧呈シ邏阪☆繧句、画焚縺ク縺ョ繝昴う繝ウ繧ソ縺ァ縺吶Ahints' 縺ッ蜷讀懃エ「隱槭↓隧イ蠖薙☆繧区枚譖ク謨ー繧呈シ邏阪☆繧九槭ャ繝励が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶′縲〜NULL' 縺ェ繧臥┌隕悶&繧後∪縺吶ょ凄螳壽擅莉カ縺ョ荳ュ縺ョ隱槭ョ隧イ蠖捺焚縺ッ雋謨ー縺ォ縺ェ繧翫∪縺吶ゅ槭ャ繝怜縺ョ遨コ譁蟄怜励ョ繧ュ繝シ縺ォ縺ッ蜈ィ菴薙ョ隧イ蠖捺焚縺碁未騾」縺・縺代i繧後∪縺吶よ綾繧雁、縺ッ隧イ蠖薙@縺滓枚譖ク繧呈シ邏阪@縺溘ョ繝シ繧ソ繝吶シ繧ケ縺ョ繧、繝ウ繝繝繧ッ繧ケ縺ィ譁譖クID繧剃コ、莠偵↓隕∫エ縺ィ縺吶k驟榊励〒縺吶ゅ%縺ョ髢「謨ー縺ッ豎コ縺励※繧ィ繝ゥ繝シ縺ォ縺ェ繧翫∪縺帙s縲ゅb縺苓ゥイ蠖薙☆繧区枚譖ク縺後↑縺蝣エ蜷医↓繧ゅ∫ゥコ縺ョ驟榊励′霑斐&繧後∪縺吶よ綾繧雁、縺ョ鬆伜沺縺ッ `malloc' 縺ァ逕滓舌&繧後※縺繧九ョ縺ァ縲∽ク崎ヲ√↓縺ェ縺」縺溘i `free' 縺ァ遐エ譽縺励※縺上□縺輔>縲

譁譖ク縺梧、懃エ「譚。莉カ縺ョ繝輔Ξ繝シ繧コ縺ォ螳悟ィ縺ォ荳閾エ縺吶k縺玖ェソ縺ケ繧九↓縺ッ縲髢「謨ー `est_db_scan_doc' 繧堤畑縺縺セ縺吶

int est_db_scan_doc(ESTDB *db, ESTDOC *doc, ESTCOND *cond);
`db' 縺ッ繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Adoc' 縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Acond' 縺ッ讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶よ綾繧雁、縺ッ縲∵枚譖ク縺梧、懃エ「譚。莉カ縺ョ繝輔Ξ繝シ繧コ縺ォ螳悟ィ縺ォ荳閾エ縺吶k縺ェ繧臥悄縲√◎縺縺ァ縺ェ縺代l縺ー蛛ス縺ァ縺吶

繝繝シ繧ソ繝吶シ繧ケ縺ョ繧ュ繝」繝繧キ繝・繝。繝「繝ェ縺ョ譛螟ァ繧オ繧、繧コ繧呈欠螳壹☆繧九↓縺ッ縲髢「謨ー `est_db_set_cache_size' 繧堤畑縺縺セ縺吶

void est_db_set_cache_size(ESTDB *db, size_t size, int anum, int tnum, int rnum);
`db' 縺ッ繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r謖螳壹@縺セ縺吶Asize' 縺ッ繧、繝ウ繝繝繧ッ繧ケ逕ィ縺ョ繧ュ繝」繝繧キ繝・繝。繝「繝ェ縺ョ譛螟ァ繧オ繧、繧コ繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ64MB縺ァ縺吶りイ謨ー繧呈欠螳壹☆繧九→縲∫樟迥カ縺ョ險ュ螳壹r螟画峩縺励∪縺帙s縲Aanum' 縺ッ譁譖ク縺ョ螻樊ァ逕ィ縺ョ繧ュ繝」繝繧キ繝・縺ョ繝ャ繧ウ繝シ繝画焚繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ8192蛟九〒縺吶りイ謨ー繧呈欠螳壹☆繧九→縲∫樟迥カ縺ョ險ュ螳壹r螟画峩縺励∪縺帙s縲Atnum' 縺ッ譁譖ク縺ョ繝繧ュ繧ケ繝育畑縺ョ繧ュ繝」繝繧キ繝・縺ョ繝ャ繧ウ繝シ繝画焚繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ1024蛟九〒縺吶りイ謨ー繧呈欠螳壹☆繧九→縲∫樟迥カ縺ョ險ュ螳壹r螟画峩縺励∪縺帙s縲Arnum' 縺ッ蜃コ迴セ邨先棡逕ィ縺ョ繧ュ繝」繝繧キ繝・縺ョ繝ャ繧ウ繝シ繝画焚繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ256蛟九〒縺吶りイ謨ー繧呈欠螳壹☆繧九→縲∫樟迥カ縺ョ險ュ螳壹r螟画峩縺励∪縺帙s縲

繧ョ繝」繧カ繝ゥ縺ョ繧オ繝ウ繝励Ν

譛繧ょ腰邏斐↑繧ョ繝」繧カ繝ゥ縺ョ螳溯」繧剃サ・荳九↓遉コ縺励∪縺吶ょィ譁讀懃エ「繧キ繧ケ繝繝縺後%繧薙↑縺ォ遏ュ縺繧ウ繝シ繝峨〒螳溽樟縺ァ縺阪k縺ェ繧薙※縲∽セソ蛻ゥ縺ェ荳悶ョ荳ュ縺ォ縺ェ縺」縺溘b縺ョ縺ァ縺吶

#include <estraier.h>
#include <cabin.h>
#include <stdlib.h>
#include <stdio.h>

int main(int argc, char **argv){
  ESTDB *db;
  ESTDOC *doc;
  int ecode;

  /* 繝繝シ繧ソ繝吶シ繧ケ繧帝幕縺 */
  if(!(db = est_db_open("casket", ESTDBWRITER | ESTDBCREAT, &ecode))){
    fprintf(stderr, "error: %s\n", est_err_msg(ecode));
    return 1;
  }

  /* 譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r逕滓舌☆繧 */
  doc = est_doc_new();

  /* 譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医↓螻樊ァ繧定ソス蜉縺吶k */
  est_doc_add_attr(doc, "@uri", "http://estraier.gov/example.txt");
  est_doc_add_attr(doc, "@title", "Over the Rainbow");

  /* 譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医↓譛ャ譁繧定ソス蜉縺吶k */
  est_doc_add_text(doc, "Somewhere over the rainbow.  Way up high.");
  est_doc_add_text(doc, "There's a land that I heard of once in a lullaby.");

  /* 譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r繝繝シ繧ソ繝吶シ繧ケ縺ォ逋サ骭イ縺吶k */
  if(!est_db_put_doc(db, doc, ESTPDCLEAN))
    fprintf(stderr, "error: %s\n", est_err_msg(est_db_error(db)));

  /* 譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r遐エ譽縺吶k */
  est_doc_delete(doc);

  /* 繝繝シ繧ソ繝吶シ繧ケ繧帝哩縺倥k */
  if(!est_db_close(db, &ecode)){
    fprintf(stderr, "error: %s\n", est_err_msg(ecode));
    return 1;
  }

  return 0;
}

繧ウ繧「API縺ァ縺ッ縲√ョ繝シ繧ソ繝吶シ繧ケ縺ョ讎ょソオ縺碁崎ヲ√↓縺ェ繧翫∪縺吶りサ「鄂ョ繧、繝ウ繝繝繧ッ繧ケ繧逋サ骭イ譁譖ク縺ェ縺ゥ縺ョ繝繝シ繧ソ繧貞盾辣ァ縺吶k縺溘a縺ョ謇区ョオ繧呈歓雎。蛹悶@縺溘b縺ョ縺ァ縺吶ゅョ繝シ繧ソ繝吶シ繧ケ繧帝幕縺城圀縺ォ縺ッ縲∬ェュ縺ソ霎シ縺ソ繝「繝シ繝峨°譖ク縺崎セシ縺ソ繝「繝シ繝峨r謖螳壹@縺セ縺吶ゅ>縺壹l縺ォ縺励※繧ゅ髢九>縺溘ョ繝シ繧ソ繝吶シ繧ケ縺ッ蠢縺夐哩縺倥※縺上□縺輔>縲ら音縺ォ譖ク縺崎セシ縺ソ繝「繝シ繝峨ョ蝣エ蜷医驕ゥ蛻縺ォ繝繝シ繧ソ繝吶シ繧ケ繧帝哩縺倥↑縺縺ィ繝繝シ繧ソ繝吶シ繧ケ縺悟」翫l縺ヲ縺励∪縺縺セ縺吶

繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医↓髯舌i縺壹?yper Estraier縺ォ縺翫¢繧句、ァ謚オ縺ョ繧ェ繝悶ず繧ァ繧ッ繝医ッ縲∫函謌舌☆繧九◆繧√ョ髢「謨ー縺ィ遐エ譽縺吶k縺溘a縺ョ髢「謨ー繧貞y縺医※縺縺セ縺吶ら函謌舌@縺溘が繝悶ず繧ァ繧ッ繝医ッ蠢縺夂エ譽縺励※縺上□縺輔>縲ゅ◎縺縺励↑縺縺ィ繝。繝「繝ェ繝ェ繝シ繧ッ縺ォ縺ェ繧翫∪縺吶

est_db_open縺ッ繝繝シ繧ソ繝吶シ繧ケ繧帝幕縺城未謨ー縺ァ縺吶らャャ1蠑墓焚縺ッ繝繝シ繧ソ繝吶シ繧ケ縺ョ蜷榊燕繧呈欠螳壹@縺ヲ縺縺セ縺吶らャャ2蠑墓焚縺ッ繧ェ繝シ繝励Φ繝「繝シ繝峨〒縺吶ESTDBWRITER縺ッ譖ク縺崎セシ縺ソ繝「繝シ繝峨〒縺ゅk縺薙→繧呈э蜻ウ縺励ESTDBCREAT縺ッ繝繝シ繧ソ繝吶シ繧ケ縺悟ュ伜惠縺励↑縺蝣エ蜷医↓譁ー縺励¥菴懈舌☆繧九%縺ィ繧呈э蜻ウ縺励∪縺吶らャャ3蠑墓焚縺ッ繧ィ繝ゥ繝シ繧ウ繝シ繝峨r蜿励¢蜿悶k螟画焚縺ク縺ョ繝昴う繝ウ繧ソ繧呈欠螳壹@縺セ縺吶よ綾繧雁、縺ッ繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医〒縺吶′縲√お繝ゥ繝シ縺後≠縺」縺溷エ蜷医ッNULL縺ァ縺吶ゅョ繝シ繧ソ繝吶シ繧ケ繧帝哩縺倥k縺ォ縺ッ縲est_db_close髢「謨ー繧剃スソ縺縺セ縺吶

縺薙ョ萓九〒縺ッ縲√お繝ゥ繝シ縺瑚オキ縺阪◆髫帙↓縺ッ繧ィ繝ゥ繝シ繝。繝繧サ繝シ繧ク繧貞コ蜉帙@縺ヲ縺縺セ縺吶ゅョ繝シ繧ソ繝吶シ繧ケ繧帝幕縺縺溘j髢峨§縺溘j縺吶k髢「謨ー縺ァ縺ッ繧ィ繝ゥ繝シ繧ウ繝シ繝峨r蜿励¢蜿悶k螟画焚縺ク縺ョ繝昴う繝ウ繧ソ繧貞シ墓焚縺ァ謖螳壹@縲√◎縺ョ莉悶ョ髢「謨ー縺ァ繧ィ繝ゥ繝シ縺瑚オキ縺阪◆蝣エ蜷医↓縺ッ繝繝シ繧ソ繝吶シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医ョ荳ュ縺ォ繧ィ繝ゥ繝シ繧ウ繝シ繝峨′繧サ繝繝医&繧後∪縺吶ゅ◎縺ョ蛟、縺ッest_db_error縺ィ縺縺髢「謨ー繧剃スソ縺」縺ヲ蜿門セ励〒縺阪∪縺吶est_err_msg縺ィ縺縺髢「謨ー繧剃スソ縺縺ィ繧ィ繝ゥ繝シ繧ウ繝シ繝峨↓蟇セ蠢懊☆繧区枚蟄怜励r蜿門セ励〒縺阪∪縺吶

譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医ッ縲∝推遞ョ縺ョ譁譖ク繧呈歓雎。蛹悶@縺溘b縺ョ縺ァ縺吶よ枚譖ク繧ェ繝悶ず繧ァ繧ッ繝医↓縺ッ螻樊ァ縺ィ譛ャ譁繧堤匳骭イ縺ァ縺阪∪縺吶ゅ%縺ョ萓九〒縺ッ縺昴l繧峨r譁蟄怜怜ョ壽焚縺ァ謖螳壹@縺ヲ縺縺セ縺吶′縲∝ョ滄圀縺ョ繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ァ縺ッ縲√ヵ繧。繧、繝ォ繧定ェュ繧縺ェ縺ゥ縺励※蜿門セ励@縺溘ョ繝シ繧ソ繧呈欠螳壹☆繧九%縺ィ縺ァ縺励g縺縲est_doc_new縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r菴懊j縲est_doc_add_attr縺ッ螻樊ァ繧定ソス蜉縺励est_doc_add_text縺ッ譛ャ譁繧定ソス蜉縺励est_doc_delete縺ッ譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r遐エ譽縺吶k髢「謨ー縺ァ縺吶よ枚譖ク縺ョ螻樊ァ縲∵悽譁縺ィ繧よ枚蟄励さ繝シ繝峨ッUTF-8縺ォ縺励※縺上□縺輔>縲

譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r菴懊▲縺溘i縲√◎繧後rest_db_put_doc髢「謨ー縺ォ貂。縺励※逋サ骭イ縺励∪縺吶ら匳骭イ縺吶k譁譖ク縺ッ蠢縺啅RI螻樊ァシ"@uri"シ峨r蛯吶∴縺ヲ縺繧句ソ隕√′縺ゅj縺セ縺吶ゅ◎縺縺ァ縺ェ縺蝣エ蜷医ッ繧ィ繝ゥ繝シ縺ォ縺ェ繧翫∪縺吶ゅ∪縺溘∵里縺ォ逋サ骭イ縺励※縺ゅk譁譖ク縺ョURI縺ィ驥崎、縺励◆蝣エ蜷医ッ縲∽ク頑嶌縺搾シ域里蟄倥ョ譁譖ク縺悟炎髯、シ峨&繧後∪縺吶ゅ%縺薙〒縺ッ縲∝炎髯、縺輔l縺滄伜沺繧呈紛逅縺吶k縺溘a縺ォ縲√が繝励す繝ァ繝ウ縺ァESTPDCLEAN繧呈欠遉コ縺励※縺縺セ縺吶


繧オ繝シ繝√Ε縺ョ繧オ繝ウ繝励Ν

譛繧ょ腰邏斐↑繧オ繝シ繝√Ε縺ョ螳溯」繧剃サ・荳九↓遉コ縺励∪縺吶ゅし繝シ繝√Ε縺ッ繧ョ繝」繧カ繝ゥ縺ォ豈斐∋繧九→蟆代@髟キ縺縺ァ縺吶′縲√d縺」縺ヲ縺繧九%縺ィ縺ッ縺昴l縺サ縺ゥ髮」縺励¥縺ッ縺ゅj縺セ縺帙s縲

#include <estraier.h>
#include <cabin.h>
#include <stdlib.h>
#include <stdio.h>

int main(int argc, char **argv){
  ESTDB *db;
  ESTCOND *cond;
  ESTDOC *doc;
  const CBLIST *texts;
  int ecode, *result, resnum, i, j;
  const char *value;

  /* 繝繝シ繧ソ繝吶シ繧ケ繧帝幕縺 */
  if(!(db = est_db_open("casket", ESTDBREADER, &ecode))){
    fprintf(stderr, "error: %s\n", est_err_msg(ecode));
    return 1;
  }

  /* 讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r逕滓舌☆繧 */
  cond = est_cond_new();

  /* 讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医↓讀懃エ「蠑上r險ュ螳壹☆繧 */
  est_cond_set_phrase(cond, "rainbow AND lullaby");

  /* 繝繝シ繧ソ繝吶シ繧ケ縺九i讀懃エ「邨先棡繧貞セ励k */
  result = est_db_search(db, cond, &resnum, NULL);

  /* 蜷隧イ蠖捺枚譖ク繧貞叙蠕励@縺ヲ陦ィ遉コ縺吶k */
  for(i = 0; i < resnum; i++){

    /* 譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r蜿門セ励☆繧 */
    if(!(doc = est_db_get_doc(db, result[i], 0))) continue;

    /* 螻樊ァ繧定。ィ遉コ縺吶k */
    if((value = est_doc_attr(doc, "@uri")) != NULL)
      printf("URI: %s\n", value);
    if((value = est_doc_attr(doc, "@title")) != NULL)
      printf("Title: %s\n", value);

    /* 譛ャ譁繧定。ィ遉コ縺吶k */
    texts = est_doc_texts(doc);
    for(j = 0; j < cblistnum(texts); j++){
      value = cblistval(texts, j, NULL);
      printf("%s\n", value);
    }

    /* 譁譖ク繧ェ繝悶ず繧ァ繧ッ繝医r遐エ譽縺吶k */
    est_doc_delete(doc);

  }

  /* 讀懃エ「邨先棡繧堤エ譽縺吶k */
  free(result);

  /* 讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r遐エ譽縺吶k */
  est_cond_delete(cond);

  /* 繝繝シ繧ソ繝吶シ繧ケ繧帝哩縺倥k */
  if(!est_db_close(db, &ecode)){
    fprintf(stderr, "error: %s\n", est_err_msg(ecode));
    return 1;
  }

  return 0;
}

繝倥ャ繝縺ョ繧、繝ウ繧ッ繝ォ繝シ繝峨d繝繝シ繧ソ繝吶シ繧ケ縺ョ髢矩哩縺ォ縺、縺縺ヲ縺ッ繧ョ繝」繧カ繝ゥ縺ィ蜷後§縺ァ縺吶ゅ◆縺縺励√し繝シ繝√Ε縺ョ蝣エ蜷医√ョ繝シ繧ソ繝吶シ繧ケ縺ッ隱ュ縺ソ霎シ縺ソ繝「繝シ繝峨〒髢九″縺セ縺吶よ嶌縺崎セシ縺ソ繝「繝シ繝峨〒繧よ、懃エ「縺ッ縺ァ縺阪k縺ョ縺ァ縺吶′縲∬ェュ縺ソ霎シ縺ソ繝「繝シ繝峨ョ蝣エ蜷医ッ縲√励Ο繧サ繧ケ縺後け繝ゥ繝繧キ繝・縺励※繧ゅョ繝シ繧ソ繝吶シ繧ケ縺悟」翫l縺ェ縺縺ィ縺縺蛻ゥ轤ケ縺ィ縲∬、謨ー縺ョ繝励Ο繧サ繧ケ縺悟酔譎ゅ↓繝繝シ繧ソ繝吶シ繧ケ繧帝幕縺代k縺ィ縺縺蛻ゥ轤ケ縺後≠繧翫∪縺吶

讀懃エ「繧定。後≧蜑阪↓縲∵、懃エ「譚。莉カ繧呈歓雎。蛹悶@縺滓、懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r貅門y縺励∪縺吶est_cond_new縺ァ逕滓舌@縺ヲ縲est_cond_set_phrase縺ァ讀懃エ「蠑上r謖螳壹@縺ヲ縲∽スソ縺縺翫o縺」縺溘iest_cond_delete縺ァ遐エ譽縺励∪縺吶

讀懃エ「譚。莉カ繧ェ繝悶ず繧ァ繧ッ繝医r貂。縺励※est_db_search髢「謨ー繧貞他縺カ縺薙→縺ァ縲∵擅莉カ縺ォ隧イ蠖薙☆繧区枚譖ク縺ョID縺ョ驟榊励r蠕励k縺薙→縺後〒縺阪∪縺吶る榊励ョ隕∫エ謨ー縺ッ隨ャ3蠑墓焚縺ョ繝昴う繝ウ繧ソ縺梧欠縺吝、画焚縺ォ譬シ邏阪&繧後∪縺吶らャャ4蠑墓焚縺ッ莉翫ッ豌励↓縺励↑縺縺ァ縺上□縺輔>縲

讀懃エ「邨先棡縺悟セ励i繧後◆繧峨√≠縺ィ縺ッ縺昴l縺ォ蜷ォ縺セ繧後k蛟九縺ョ譁譖ク繧貞叙繧雁コ縺励※縺九i陦ィ遉コ縺励∪縺吶est_db_get_doc縺ッID縺ォ蟇セ蠢懊@縺滓枚譖ク繧ェ繝悶ず繧ァ繧ッ繝医r蜿悶j蜃コ縺咎未謨ー縺ァ縺吶よ里縺ォ蜑企勁縺励◆譁譖ク縺後ヲ繝繝医☆繧九%縺ィ繧ゅ≠繧九ョ縺ァ縲√◎縺ョ蝣エ蜷医↓縺ッNULL縺瑚ソ斐&繧後∪縺吶NULL縺ョ蝣エ蜷医ッ蜊倥↓辟。隕悶@縺ヲ谺。縺ョ蜻ィ蝗槭↓騾イ縺ソ縺セ縺吶est_doc_get_attr縺ッ螻樊ァ繧貞叙蠕励☆繧矩未謨ー縺ァ縺吶est_doc_get_texts縺ッ譛ャ譁縺ョ繝ェ繧ケ繝医r蜿門セ励☆繧矩未謨ー縺ァ縺吶ゅ%縺ョ髢「謨ー縺ョ謌サ繧雁、縺ッ縲_DBM縺ョcabin.h縺梧署萓帙☆繧九Μ繧ケ繝医が繝悶ず繧ァ繧ッ繝医〒縺吶cblistnum髢「謨ー縺ァ隕∫エ縺ョ謨ー繧貞セ励◆繧翫cblistval髢「謨ー縺ァ迚ケ螳壹ョ逡ェ蜿キ縺ョ隕∫エ繧貞叙繧雁コ縺吶%縺ィ縺後〒縺阪∪縺吶ゅ%縺ョ萓九〒縺ッ縲∝叙繧雁コ縺励◆螻樊ァ繧譛ャ譁縺ョ蛟、繧偵◎縺ョ縺セ縺セ逕サ髱「縺ォ蜃コ蜉帙@縺ヲ縺縺セ縺吶


荳ヲ蛻玲ァ

Hyper Estraier縺ョ繝繝シ繧ソ繝吶シ繧ケ縺ッ縲√ヵ繧。繧、繝ォ繝ュ繝繧ッ縺ォ繧医▲縺ヲ菫晁ュキ縺輔l縺セ縺吶りェュ縺ソ霎シ縺ソ繝「繝シ繝峨〒謗・邯壹&繧後◆蝣エ蜷医ッ蜈ア譛峨Ο繝繧ッ縺後°縺九j縲∵嶌縺崎セシ縺ソ繝「繝シ繝峨〒謗・邯壹&繧後◆蝣エ蜷医ッ謗剃サ悶Ο繝繧ッ縺後°縺九j縺セ縺吶ゅ@縺溘′縺」縺ヲ縲∬ェュ縺ソ霎シ縺ソ繝「繝シ繝牙酔螢ォ縺ァ縺ゅl縺ー隍謨ー縺ョ繝励Ο繧サ繧ケ縺悟酔縺倥ョ繝シ繧ソ繝吶シ繧ケ繧貞酔譎ゅ↓髢九¥縺薙→縺後〒縺阪∪縺吶′縲∵嶌縺崎セシ縺ソ繝「繝シ繝峨〒謗・邯壹〒縺阪k縺ョ縺ッ荳縺、縺ョ繝繝シ繧ソ繝吶シ繧ケ縺ォ蟇セ縺励※荳縺、縺ョ繝励Ο繧サ繧ケ縺縺代〒縺吶りェュ縺ソ霎シ縺ソ繝「繝シ繝峨ョ蝣エ蜷医∬、謨ー縺ョ繝励Ο繧サ繧ケ縺悟酔荳縺ョ繝繝シ繧ソ繝吶シ繧ケ繧帝幕縺上□縺代〒縺ェ縺上∬ェュ縺ソ霎シ縺ソ繝「繝シ繝峨〒繝繝シ繧ソ繝吶シ繧ケ繧帝幕縺縺溘励Ο繧サ繧ケ繧fork縺輔○繧九%縺ィ繧ゅ〒縺阪∪縺吶

譖ク縺崎セシ縺ソ繝「繝シ繝峨〒縺ゅ▲縺ヲ繧りェュ縺ソ霎シ縺ソ繝「繝シ繝峨〒縺ゅ▲縺ヲ繧ゅ∝酔荳繝励Ο繧サ繧ケ蜀縺ァ蜷御ク縺ョ繝繝シ繧ソ繝吶シ繧ケ縺ォ蟇セ縺吶k隍謨ー縺ョ繧ウ繝阪け繧キ繝ァ繝ウ繧堤函謌舌☆繧九%縺ィ縺ッ縺ァ縺阪∪縺帙s縲ゅ槭Ν繝√せ繝ャ繝繝峨ョ繝励Ο繧ー繝ゥ繝縺ォ縺翫>縺ヲ隍謨ー縺ョ繧ケ繝ャ繝繝峨〒繝繝シ繧ソ繝吶シ繧ケ繧貞ヲ逅縺励◆縺蝣エ蜷医ッ縲√せ繝ャ繝繝蛾俣縺ァ繧ウ繝阪け繧キ繝ァ繝ウ繧貞ア譛峨☆繧九h縺縺ォ縺励※縺上□縺輔>縲ゅ↑縺翫√さ繧「API縺ョ蜷髢「謨ー縺ッ繝ェ繧ィ繝ウ繝医Λ繝ウ繝医〒縺吶′縲√さ繝阪け繧キ繝ァ繝ウ縺ッ繝槭Ν繝√せ繝ャ繝繝峨そ繝シ繝輔〒縺ッ縺ゅj縺セ縺帙s縺ョ縺ァ縲[utex縺ァ蜷繧ウ繝阪け繧キ繝ァ繝ウ繧剃ソ晁ュキ縺吶k繧医≧縺ォ縺励※縺上□縺輔>縲

繧ウ繝阪け繧キ繝ァ繝ウ繧定ェ蛻縺ァ菫晁ュキ縺吶k縺ョ縺碁擇蛟偵↑蝣エ蜷医ッ縲?yper Estraier縺ョ繧ケ繝ャ繝繝陰PI繧剃スソ縺縺ィ繧医>縺ァ縺励g縺縲ゅさ繧「API縺ョ繝繝シ繧ソ繝吶シ繧ケ邂。逅讖溯ス繧偵槭Ν繝√せ繝ャ繝繝峨そ繝シ繝輔↓縺励◆繧ゅョ縺ァ縺吶ゅせ繝ャ繝繝陰PI縺ッ繧ウ繧「API縺ィ蜈ィ縺丞酔縺俶ゥ溯ス繧呈署萓帙@縺セ縺吶′縲∽サ・荳九ョ轤ケ縺檎焚縺ェ繧翫∪縺吶ゅ↑縺翫√ョ繝シ繧ソ繝吶シ繧ケ髢「騾」莉・螟悶ョ讖溯スシESTDOC縺ィESTCONDシ峨ッ繧ウ繧「API縺ィ繧ケ繝ャ繝繝陰PI縺ァ蜈ア騾壹〒縺吶

  • estraier.h縺縺代〒縺ェ縺銃stmtdb.h繧ゅう繝ウ繧ッ繝ォ繝シ繝峨☆繧九
  • `ESTDB' 縺ク縺ョ繝昴う繝ウ繧ソ縺ァ縺ッ縺ェ縺 `ESTMTDB' 縺ク縺ョ繝昴う繝ウ繧ソ繧偵さ繝阪け繧キ繝ァ繝ウ縺ィ縺励※蛻ゥ逕ィ縺吶k縲
  • 髢「謨ー蜷阪ョ謗・鬆ュ霎槭′縲憩st_db_縲阪〒縺ェ縺上憩st_mtdb_縲阪〒縺ゅk縲

蝓コ譛ャ逧縺ォ縺ッ繧ケ繝ャ繝繝陰PI縺ッ繧ウ繝阪け繧キ繝ァ繝ウ縺ォ蟇セ縺吶k謗剃サ門宛蠕。繧偵げ繝ュ繝シ繝舌Ν縺ォ陦後>縺セ縺吶′縲_DBM繧偵ン繝ォ繝峨☆繧矩圀縺ォ縲--enable-pthread縲阪r縺、縺代※繧ケ繝ャ繝繝牙ッセ蠢懊↓縺輔○縺ヲ縺縺溷エ蜷医ッ縲√さ繝阪け繧キ繝ァ繝ウ蜊倅ス阪〒謗剃サ門宛蠕。縺瑚。後o繧後∪縺吶ゅ←縺。繧峨〒繧ょ虚菴懊↓謾ッ髫懊ッ縺ゅj縺セ縺帙s縺後_DBM縺後せ繝ャ繝繝牙ッセ蠢懊@縺ヲ縺繧区婿縺御クヲ蛻玲ァ縺ッ螟ァ蟷縺ォ蜷台ク翫@縺セ縺吶


蜉ゥ險

縺薙%縺ァ縺ッ縲√Λ繧、繝悶Λ繝ェ縺ィ縺励※縺ョHyper Estraier繧呈エサ逕ィ縺吶k縺溘a縺ョ繧ウ繝繧偵>縺上▽縺狗エケ莉九@縺セ縺吶

CGI繧ケ繧ッ繝ェ繝励ヨ縺ァ縺ョ蛻ゥ逕ィ

Web繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縺ョ讀懃エ「繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ繧辰GI繧ケ繧ッ繝ェ繝励ヨ縺ィ縺励※螳溯」縺吶k縺薙→繧ょ、壹>縺九→諤昴>縺セ縺吶ゅ◎縺薙〒豕ィ諢上@縺ヲ縺サ縺励>縺ョ縺ッ縲∵嶌縺崎セシ縺ソ繝「繝シ繝峨〒繝繝シ繧ソ繝吶シ繧ケ繧帝幕縺縺ヲ縺ッ縺ェ繧峨↑縺縺ィ縺縺縺薙→縺ァ縺吶

CGI縺ョ繝励Ο繧サ繧ケ縺ッ縲∝他縺ウ蜃コ縺怜エ縺ョ繧オ繝シ繝舌↓繧医▲縺ヲ縺縺、谿コ縺輔l繧九°繧上°繧翫∪縺帙s縲ゅョ繝シ繧ソ縺ョ霆「騾∽クュ縺ォ繝阪ャ繝医Ρ繝シ繧ッ縺悟譁ュ縺輔l縺溷エ蜷茨シ医Θ繝シ繧カ縺悟●豁「繝懊ち繝ウ繧呈款縺励◆蝣エ蜷茨シ峨↓縺ッ縲ヾIGPIPE縺ォ繧医▲縺ヲ谿コ縺輔l繧句庄閭ス諤ァ縺後≠繧翫∪縺吶ゅし繝シ繝舌′蛛懈ュ「縺セ縺溘ッ蜀崎オキ蜍輔☆繧句エ蜷医ヾIGTERM縺ォ繧医▲縺ヲ谿コ縺輔l繧句庄閭ス諤ァ縺後≠繧翫∪縺吶ゅ励Ο繧サ繧ケ繧オ繧、繧コ縺ョ蛻カ髯舌d螳溯。梧凾髢薙ョ蛻カ髯舌↓隗ヲ繧後◆縺薙→繧医▲縺ヲSIGKILL縺ァ谿コ縺輔l繧句庄閭ス諤ァ繧ゅ≠繧翫∪縺吶

縺昴ョ繧医≧縺ェ荳肴ョ縺ョ蛛懈ュ「縺ョ髫帙↓譖ク縺崎セシ縺ソ繝「繝シ繝峨〒繝繝シ繧ソ繝吶シ繧ケ繧帝幕縺縺ヲ縺縺溷エ蜷医√ョ繝シ繧ソ繝吶シ繧ケ縺悟」翫l縺ヲ縺励∪縺縺セ縺吶ゅ@縺溘′縺」縺ヲ縲,GI繧ケ繧ッ繝ェ繝励ヨ縺ッ譖エ譁ー蜃ヲ逅縺ォ縺ッ荳榊髄縺阪〒縺吶ゅ◎繧後〒繧よ覆縺医※CGI縺ァ譖エ譁ー菴懈・ュ繧定。後≧縺ェ繧峨ー縲∝ソ縺壹ヰ繝繧ッ繧「繝繝励r蜿悶j縺ェ縺後i驕狗畑縺吶k繧医≧縺ォ縺励※縺上□縺輔>縲

讀懃エ「繧オ繝シ繝

繧ウ繝槭Φ繝峨Λ繧、繝ウ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縺ァ繧8eb繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縺ァ繧ゅ∵、懃エ「隕∵アゅr蜃ヲ逅縺吶k蠎ヲ縺ォ繝繝シ繧ソ繝吶シ繧ケ繧帝幕縺縺溘j髢峨§縺溘j縺吶k縺ョ縺ッ髱槫柑邇縺ァ縺呻シestcmdestseek.cgi縺ァ縺ッ縺昴≧縺励※縺縺セ縺吶′シ峨ゅョ繝シ繧ソ繝吶シ繧ケ縺ォ謗・邯壹☆繧矩圀縺ォ縺ッ縺昴l縺ェ繧翫ョ繧ェ繝シ繝舌シ繝倥ャ繝峨′縺九°繧九ョ縺ァ縲∝酔譎よ磁邯壽焚縺悟「励∴繧九→雋闕キ縺碁ォ倥∪繧翫√イ縺縺ヲ縺ッ讀懃エ「騾溷コヲ縺ョ菴惹ク九r諡帙″縺セ縺吶ゅ@縺溘′縺」縺ヲ縲√↑繧九∋縺上↑繧峨∝クク鬧仙梛縺ョ繝励Ο繧サ繧ケ繧貞ョ溯」縺励※縲√ョ繝シ繧ソ繝吶シ繧ケ縺ョ繧ウ繝阪け繧キ繝ァ繝ウ繧剃スソ縺縺セ繧上☆繧医≧縺ォ縺励※縺上□縺輔>縲ゅ◎繧後′髱「蛟偵↑繧峨ー縲√ヮ繝シ繝陰PI縺ョ蛻ゥ逕ィ繧呈、懆ィ弱@縺ヲ縺ソ繧九ョ繧ゅh縺縺ァ縺励g縺縲

陬就PI

螳溘ッ縲√%縺ョ繧ャ繧、繝峨〒邏ケ莉九@縺滉サ・螟悶↓繧る未謨ー縺後◆縺上&繧捺署萓帙&繧後※縺縺セ縺吶ゅ◎繧後i縺ッ縺。繧縺」縺ィ菴ソ縺譁ケ縺碁屮縺励>縲√>繧上ー繝上ャ繧ォ繝シ逕ィ縺ョAPI縺ァ縺吶り亥袖繧呈戟縺溘l縺滓婿縺ッ縲estraier.h繧定ヲ励>縺ヲ縺ソ縺ヲ縺上□縺輔>縲

繝溘ル繝ゥ繧、繝悶Λ繝ェ

libestraier.a縺ッPOSIX繧ケ繝ャ繝繝峨↓萓晏ュ倥☆繧区ァ区舌↓縺ェ縺」縺ヲ縺縺セ縺吶ゆク譁ケ縺ァ縲∫オ縺ソ霎シ縺ソ邉サ縺ァ縺ッPOSIX繧ケ繝ャ繝繝峨′螳溯」縺輔l縺ヲ縺縺ェ縺縺薙→繧ゅ≠繧翫∪縺吶ゅさ繧「API縺ッ繧ケ繝ャ繝繝峨ョ讖溯ス繧剃ク蛻菴ソ縺」縺ヲ縺縺セ縺帙s縺ョ縺ァ縲√◎縺縺縺」縺溽腸蠅縺ォ繧らァサ讀阪☆繧九%縺ィ縺後〒縺阪∪縺吶ゅmake corelib縲阪r螳溯。後☆繧九→縲√さ繧「API縺ョ繧ェ繝悶ず繧ァ繧ッ繝医ヵ繧。繧、繝ォシestraier.o縺ィmyconf.oシ峨ョ縺ソ繧貞性繧薙□繝ゥ繧、繝悶Λ繝ェ縺ァ縺ゅklibestcore.a縺檎函謌舌&繧後∪縺吶libestcore.a縺ッlibiconv.a縺ィlibz.a縺ィlibm.a縺ィlibc.a縺ォ萓晏ュ倥☆繧九ョ縺ソ縺ァ縺吶ョ縺ァ縲∝、壹¥縺ョ迺ー蠅縺ァ蛻ゥ逕ィ縺吶k縺薙→縺後〒縺阪k縺ァ縺励g縺縲

險隱槭ヰ繧、繝ウ繝繧」繝ウ繧ー

C險隱樔サ・螟悶ョ繝励Ο繧ー繝ゥ繝溘Φ繧ー險隱槭°繧羽yper Estraier繧剃スソ縺縺溘a縺ョ繝舌う繝ウ繝繧」繝ウ繧ー繧剃ス懊k繝励Ο繧ク繧ァ繧ッ繝医b騾イ陦御クュ縺ァ縺吶ゅ≠縺ェ縺溘′譁ー縺溘↑險隱槭ョ繝舌う繝ウ繝繧」繝ウ繧ー繧剃ス懊▲縺ヲ縺上l繧九ョ繧よュ楢ソ弱@縺セ縺吶ゅ◎縺ョ髫帙↓縺ッ縲estraier.idl繝輔ぃ繧、繝ォ縺ォ險倩ソー縺励※縺ゅk繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ繧貞盾閠縺ォ縺励※縺上□縺輔>縲ょ推遞ョ縺ョ繝舌う繝ウ繝繧」繝ウ繧ー縺ョ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縺ッ縺ェ繧九∋縺丈シシ縺ヲ縺繧区婿縺瑚ヲ壹∴繧縺吶>縺ァ縺吶h縺ュ縲

迴セ迥カ縺ァ縺ッHyper Estraier縺ョ繧ス繝シ繧ケ繝代ャ繧ア繝シ繧ク縺ォ縺ッJava縺ィRuby縺ィPerl縺ョ險隱槭ヰ繧、繝ウ繝繧」繝ウ繧ー縺悟庶骭イ縺輔l縺ヲ縺縺セ縺吶′縲√◎繧後i縺ッC險隱槭ョ繧ケ繝ャ繝繝陰PI繧偵吶シ繧ケ縺ィ縺励※螳溯」縺輔l縺ヲ縺縺セ縺吶ゅ@縺溘′縺」縺ヲ縲∽クヲ蛻玲ァ縺ョ諤ァ雉ェ縺ッ繧ケ繝ャ繝繝陰PI縺ィ蜷梧ァ倥↓縺ェ繧翫∪縺吶


hyperestraier-1.4.13/doc/rubynativeapi/000077500000000000000000000000001125261632700201225ustar00rootroot00000000000000hyperestraier-1.4.13/doc/rubynativeapi/classes/000077500000000000000000000000001125261632700215575ustar00rootroot00000000000000hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier.html000066400000000000000000000051671125261632700242340ustar00rootroot00000000000000 Module: Estraier
Module Estraier
In: estraier-doc.rb

Module for the namespace of Hyper Estraier

Classes and Modules

Class Estraier::Condition
Class Estraier::Database
Class Estraier::Document
Class Estraier::Result
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/000077500000000000000000000000001125261632700233355ustar00rootroot00000000000000hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Condition.html000066400000000000000000000370541125261632700261620ustar00rootroot00000000000000 Class: Estraier::Condition
Class Estraier::Condition
In: estraier-doc.rb
Parent: Object

Abstraction of search condition.

Constants

SURE = 1 << 0   option: check every N-gram key
USUAL = 1 << 1   option: check N-gram keys skipping by one
FAST = 1 << 2   option: check N-gram keys skipping by two
AGITO = 1 << 3   option: check N-gram keys skipping by three
NOIDF = 1 << 4   option: without TF-IDF tuning
SIMPLE = 1 << 10   option: with the simplified phrase
ROUGH = 1 << 11   option: with the rough phrase
UNION = 1 << 15   option: with the union phrase
ISECT = 1 << 16   option: with the intersection phrase
ECLSIMURL = 10.0   eclipse tuning: consider URL
ECLSERV = 100.0   eclipse tuning: on server basis
ECLDIR = 101.0   eclipse tuning: on directory basis
ECLFILE = 102.0   eclipse tuning: on file basis

Public Class methods

Create a search condition object.

Public Instance methods

Add an expression for an attribute. `expr’ specifies an expression for an attribute. The return value is always `nil’.

Set permission to adopt result of the auxiliary index. `min’ specifies the minimum hits to adopt result of the auxiliary index. If it is not more than 0, the auxiliary index is not used. By default, it is 32. The return value is always `nil’.

Set the attribute distinction filter. `name’ specifies the name of an attribute to be distinct. The return value is always `nil’.

Set the lower limit of similarity eclipse. `limit’ specifies the lower limit of similarity for documents to be eclipsed. Similarity is between 0.0 and 1.0. If the limit is added by `Condition::ECLSIMURL’, similarity is weighted by URL. If the limit is `Condition::ECLSERV’, similarity is ignored and documents in the same server are eclipsed. If the limit is `Condition::ECLDIR’, similarity is ignored and documents in the same directory are eclipsed. If the limit is `Condition::ECLFILE’, similarity is ignored and documents of the same file are eclipsed. The return value is always `nil’.

Set the mask of targets of meta search. `mask’ specifies a masking number. 1 means the first target, 2 means the second target, 4 means the third target, and power values of 2 and their summation compose the mask. The return value is always `nil’.

Set the maximum number of retrieval. `max’ specifies the maximum number of retrieval. By default, the number of retrieval is not limited. The return value is always `nil’.

Set options of retrieval. `options’ specifies options: `Condition::SURE’ specifies that it checks every N-gram key, `Condition::USU’, which is the default, specifies that it checks N-gram keys with skipping one key, `Condition::FAST’ skips two keys, `Condition::AGITO’ skips three keys, `Condition::NOIDF’ specifies not to perform TF-IDF tuning, `Condition::SIMPLE’ specifies to use simplified phrase, `Condition::ROUGH’ specifies to use rough phrase, `Condition::UNION’ specifies to use union phrase, `Condition::ISECT’ specifies to use intersection phrase. Each option can be specified at the same time by bitwise or. If keys are skipped, though search speed is improved, the relevance ratio grows less. The return value is always `nil’.

Set the order of a condition object. `expr’ specifies an expression for the order. By default, the order is by score descending. The return value is always `nil’.

Set the search phrase. `phrase’ specifies a search phrase. The return value is always `nil’.

Set the number of skipped documents. `skip’ specifies the number of documents to be skipped in the search result. The return value is always `nil’.

hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Condition.src/000077500000000000000000000000001125261632700260515ustar00rootroot00000000000000hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Condition.src/M000037.html000066400000000000000000000014321125261632700276050ustar00rootroot00000000000000 set_phrase (Estraier::Condition)
# File estraier-doc.rb, line 170
    def set_phrase(phrase)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Condition.src/M000038.html000066400000000000000000000014241125261632700276070ustar00rootroot00000000000000 add_attr (Estraier::Condition)
# File estraier-doc.rb, line 176
    def add_attr(expr)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Condition.src/M000039.html000066400000000000000000000014261125261632700276120ustar00rootroot00000000000000 set_order (Estraier::Condition)
# File estraier-doc.rb, line 182
    def set_order(expr)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Condition.src/M000040.html000066400000000000000000000014211125261632700275750ustar00rootroot00000000000000 set_max (Estraier::Condition)
# File estraier-doc.rb, line 189
    def set_max(max)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Condition.src/M000041.html000066400000000000000000000014241125261632700276010ustar00rootroot00000000000000 set_skip (Estraier::Condition)
# File estraier-doc.rb, line 195
    def set_skip(skip)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Condition.src/M000042.html000066400000000000000000000014351125261632700276040ustar00rootroot00000000000000 set_options (Estraier::Condition)
# File estraier-doc.rb, line 208
    def set_options(options)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Condition.src/M000043.html000066400000000000000000000014351125261632700276050ustar00rootroot00000000000000 set_auxiliary (Estraier::Condition)
# File estraier-doc.rb, line 215
    def set_auxiliary(min)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Condition.src/M000044.html000066400000000000000000000014331125261632700276040ustar00rootroot00000000000000 set_eclipse (Estraier::Condition)
# File estraier-doc.rb, line 226
    def set_eclipse(limit)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Condition.src/M000045.html000066400000000000000000000013361125261632700276070ustar00rootroot00000000000000 set_distinct (Estraier::Condition)
# File estraier-doc.rb, line 232
    def set_distinct(name)
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Condition.src/M000046.html000066400000000000000000000014241125261632700276060ustar00rootroot00000000000000 set_mask (Estraier::Condition)
# File estraier-doc.rb, line 238
    def set_mask(mask)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Condition.src/M000047.html000066400000000000000000000013501125261632700276050ustar00rootroot00000000000000 new (Estraier::Condition)
# File estraier-doc.rb, line 246
    def initialize()
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.html000066400000000000000000001113371125261632700257350ustar00rootroot00000000000000 Class: Estraier::Database
Class Estraier::Database
In: estraier-doc.rb
Parent: Object

Abstraction of database.

Methods

Constants

VERSION = "0.0.0"   version of Hyper Estraier
ERRNOERR = 0   error code: no error
ERRINVAL = 1   error code: invalid argument
ERRACCES = 2   error code: access forbidden
ERRLOCK = 3   error code: lock failure
ERRDB = 4   error code: database problem
ERRIO = 5   error code: I/O problem
ERRNOITEM = 6   error code: no item
ERRMISC = 9999   error code: miscellaneous
DBREADER = 1 << 0   open mode: open as a reader
DBWRITER = 1 << 1   open mode: open as a writer
DBCREAT = 1 << 2   open mode: a writer creating
DBTRUNC = 1 << 3   open mode: a writer truncating
DBNOLCK = 1 << 4   open mode: open without locking
DBLCKNB = 1 << 5   open mode: lock without blocking
DBPERFNG = 1 << 10   open mode: use perfect N-gram analyzer
DBCHRCAT = 1 << 11   open mode: use character category analyzer
DBSMALL = 1 << 20   open mode: small tuning
DBLARGE = 1 << 21   open mode: large tuning
DBHUGE = 1 << 22   open mode: huge tuning
DBHUGE2 = 1 << 23   open mode: huge tuning second
DBHUGE3 = 1 << 24   open mode: huge tuning third
DBSCVOID = 1 << 25   open mode: store scores as void
DBSCINT = 1 << 26   open mode: store scores as integer
DBSCASIS = 1 << 27   open mode: refrain from adjustment of scores
IDXATTRSEQ = 0   attribute index type: for multipurpose sequencial access method
IDXATTRSTR = 1   attribute index type: for narrowing with attributes as strings
IDXATTRNUM = 2   attribute index type: for narrowing with attributes as numbers
OPTNOPURGE = 1 << 0   optimize option: omit purging dispensable region of deleted
OPTNODBOPT = 1 << 1   optimize option: omit optimization of the database files
MGCLEAN = 1 << 0   merge option: clean up dispensable regions
PDCLEAN = 1 << 0   put_doc option: clean up dispensable regions
PDWEIGHT = 1 << 1   put_doc option: weight scores statically when indexing
ODCLEAN = 1 << 0   out_doc option: clean up dispensable regions
GDNOATTR = 1 << 0   get_doc option: no attributes
GDNOTEXT = 1 << 1   get_doc option: no text
GDNOKWD = 1 << 2   get_doc option: no keywords

Public Class methods

Create a database object.

Search plural databases for documents corresponding a condition. `dbs’ specifies an array whose elements are database objects. `cond’ specifies a condition object. The return value is a result object. On error, `nil’ is returned.

Public Instance methods

Add an index for narrowing or sorting with document attributes. `name’ specifies the name of an attribute. `type’ specifies the data type of attribute index; `Database::IDXATTRSEQ’ for multipurpose sequencial access method, `Database::IDXATTRSTR’ for narrowing with attributes as strings, `Database::IDXATTRNUM’ for narrowing with attributes as numbers. The return value is true if success, else it is false.

Add a pseudo index directory. `path’ specifies the path of a pseudo index directory. The return value is true if success, else it is false.

Close the database. The return value is true if success, else it is false.

Get the number of documents. The return value is the number of documents in the database.

Edit attributes of a document. `doc’ specifies a document object. The return value is true if success, else it is false.

Get the string of an error code. `ecode’ specifies an error code. The return value is the string of the error code.

Get the last happened error code. The return value is the last happened error code.

Check whether the database has a fatal error. The return value is true if the database has fatal erroor, else it is false.

Flush index words in the cache. `max’ specifies the maximum number of words to be flushed. If it not more than zero, all words are flushed. The return value is true if success, else it is false.

Retrieve a document. `id’ specifies the ID number of a registered document. `options’ specifies options: `Database::GDNOATTR’ to ignore attributes, `Database::GDNOTEXT’ to ignore the body text, `Database::GDNOKWD’ to ignore keywords. The three can be specified at the same time by bitwise or. The return value is a document object. On error, `nil’ is returned.

Retrieve the value of an attribute of a document. `id’ specifies the ID number of a registered document. `name’ specifies the name of an attribute. The return value is the value of the attribute or `nil’ if it does not exist.

Merge another database. `name’ specifies the name of another database directory. `options’ specifies options: `Database::MGCLEAN’ to clean up dispensable regions of the deleted document. The return value is true if success, else it is false.

Get the name. The return value is the name of the database.

Open a database. `name’ specifies the name of a database directory. `omode’ specifies open modes: `Database::DBWRITER’ as a writer, `Database::DBREADER’ as a reader. If the mode is `Database::DBWRITER’, the following may be added by bitwise or: `Database::DBCREAT’, which means it creates a new database if not exist, `Database::DBTRUNC’, which means it creates a new database regardless if one exists. Both of `Database::DBREADER’ and `Database::DBWRITER’ can be added to by bitwise or: `Database::DBNOLCK’, which means it opens a database file without file locking, or `Database::DBLCKNB’, which means locking is performed without blocking. If `Database::DBNOLCK’ is used, the application is responsible for exclusion control. `Database::DBCREAT’ can be added to by bitwise or: `Database::DBPERFNG’, which means N-gram analysis is performed against European text also, `Database::DBCHACAT’, which means character category analysis is performed instead of N-gram analysis, `Database::DBSMALL’, which means the index is tuned to register less than 50000 documents, `Database::DBLARGE’, which means the index is tuned to register more than 300000 documents, `Database::DBHUGE’, which means the index is tuned to register more than 1000000 documents, `Database::DBHUGE2’, which means the index is tuned to register more than 5000000 documents, `Database::DBHUGE3’, which means the index is tuned to register more than 10000000 documents, `Database::DBSCVOID’, which means scores are stored as void, `Database::DBSCINT’, which means scores are stored as 32-bit integer, `Database::DBSCASIS’, which means scores are stored as-is and marked not to be tuned when search. The return value is true if success, else it is false.

Optimize the database. `options’ specifies options: `Database::OPTNOPURGE’ to omit purging dispensable region of deleted documents, `Database::OPTNODBOPT’ to omit optimization of the database files. The two can be specified at the same time by bitwise or. The return value is true if success, else it is false.

Remove a document. `id’ specifies the ID number of a registered document. `options’ specifies options: `Database::ODCLEAN’ to clean up dispensable regions of the deleted document. The return value is true if success, else it is false.

Add a document. `doc’ specifies a document object. The document object should have the URI attribute. `options’ specifies options: `Database::PDCLEAN’ to clean up dispensable regions of the overwritten document. The return value is true if success, else it is false.

Check whether a document object matches the phrase of a search condition object definitely. `doc’ specifies a document object. `cond’ specifies a search condition object. The return value is true if the document matches the phrase of the condition object definitely, else it is false.

Search for documents corresponding a condition. `cond’ specifies a condition object. The return value is a result object. On error, `nil’ is returned.

Set the maximum size of the cache memory. `size’ specifies the maximum size of the index cache. By default, it is 64MB. If it is not more than 0, the current size is not changed. `anum’ specifies the maximum number of cached records for document attributes. By default, it is 8192. If it is not more than 0, the current size is not changed. `tnum’ specifies the maximum number of cached records for document texts. By default, it is 1024. If it is not more than 0, the current size is not changed. `rnum’ specifies the maximum number of cached records for occurrence results. By default, it is 256. If it is not more than 0, the current size is not changed. The return value is always `nil’.

Set the callback function to inform of database events. `informer’ specifies an arbitrary object with a method named as `inform’. The method should have one parameter for a string of a message of each event. The return value is always `nil’.

Set the maximum number of expansion of wild cards. `num’ specifies the maximum number of expansion of wild cards. The return value is always `nil’.

Get the size. The return value is the size of the database.

Synchronize updating contents. The return value is true if success, else it is false.

Get the ID of a document specified by URI. `uri’ specifies the URI of a registered document. The return value is the ID of the document. On error, -1 is returned.

Get the number of unique words. The return value is the number of unique words in the database.

hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/000077500000000000000000000000001125261632700256275ustar00rootroot00000000000000hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000001.html000066400000000000000000000015551125261632700273600ustar00rootroot00000000000000 search_meta (Estraier::Database)
# File estraier-doc.rb, line 400
    def self.search_meta(dbs, cond)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000002.html000066400000000000000000000014221125261632700273520ustar00rootroot00000000000000 err_msg (Estraier::Database)
# File estraier-doc.rb, line 410
    def err_msg(ecode)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000003.html000066400000000000000000000014671125261632700273640ustar00rootroot00000000000000 open (Estraier::Database)
# File estraier-doc.rb, line 435
    def open(name, omode)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000004.html000066400000000000000000000013441125261632700273570ustar00rootroot00000000000000 close (Estraier::Database)
# File estraier-doc.rb, line 440
    def close()
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000005.html000066400000000000000000000013441125261632700273600ustar00rootroot00000000000000 error (Estraier::Database)
# File estraier-doc.rb, line 445
    def error()
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000006.html000066400000000000000000000013441125261632700273610ustar00rootroot00000000000000 fatal (Estraier::Database)
# File estraier-doc.rb, line 450
    def fatal()
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000007.html000066400000000000000000000015121125261632700273570ustar00rootroot00000000000000 add_attr_index (Estraier::Database)
# File estraier-doc.rb, line 459
    def add_attr_index(name, type)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000008.html000066400000000000000000000014141125261632700273610ustar00rootroot00000000000000 flush (Estraier::Database)
# File estraier-doc.rb, line 466
    def flush(max)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000009.html000066400000000000000000000013421125261632700273620ustar00rootroot00000000000000 sync (Estraier::Database)
# File estraier-doc.rb, line 471
    def sync()
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000010.html000066400000000000000000000014261125261632700273550ustar00rootroot00000000000000 optimize (Estraier::Database)
# File estraier-doc.rb, line 479
    def optimize(options)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000011.html000066400000000000000000000014731125261632700273600ustar00rootroot00000000000000 merge (Estraier::Database)
# File estraier-doc.rb, line 487
    def merge(name, options)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000012.html000066400000000000000000000014761125261632700273640ustar00rootroot00000000000000 put_doc (Estraier::Database)
# File estraier-doc.rb, line 495
    def put_doc(doc, options)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000013.html000066400000000000000000000014751125261632700273640ustar00rootroot00000000000000 out_doc (Estraier::Database)
# File estraier-doc.rb, line 503
    def out_doc(id, options)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000014.html000066400000000000000000000014221125261632700273550ustar00rootroot00000000000000 edit_doc (Estraier::Database)
# File estraier-doc.rb, line 509
    def edit_doc(doc)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000015.html000066400000000000000000000014751125261632700273660ustar00rootroot00000000000000 get_doc (Estraier::Database)
# File estraier-doc.rb, line 518
    def get_doc(id, options)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000016.html000066400000000000000000000015041125261632700273600ustar00rootroot00000000000000 get_doc_attr (Estraier::Database)
# File estraier-doc.rb, line 525
    def get_doc_attr(id, name)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000017.html000066400000000000000000000014241125261632700273620ustar00rootroot00000000000000 uri_to_id (Estraier::Database)
# File estraier-doc.rb, line 531
    def uri_to_id(uri)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000018.html000066400000000000000000000013421125261632700273620ustar00rootroot00000000000000 name (Estraier::Database)
# File estraier-doc.rb, line 536
    def name()
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000019.html000066400000000000000000000013501125261632700273620ustar00rootroot00000000000000 doc_num (Estraier::Database)
# File estraier-doc.rb, line 541
    def doc_num()
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000020.html000066400000000000000000000013521125261632700273540ustar00rootroot00000000000000 word_num (Estraier::Database)
# File estraier-doc.rb, line 546
    def word_num()
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000021.html000066400000000000000000000013421125261632700273540ustar00rootroot00000000000000 size (Estraier::Database)
# File estraier-doc.rb, line 551
    def size()
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000022.html000066400000000000000000000014171125261632700273600ustar00rootroot00000000000000 search (Estraier::Database)
# File estraier-doc.rb, line 557
    def search(cond)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000023.html000066400000000000000000000014751125261632700273650ustar00rootroot00000000000000 scan_doc (Estraier::Database)
# File estraier-doc.rb, line 565
    def scan_doc(doc, cond)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000024.html000066400000000000000000000016401125261632700273600ustar00rootroot00000000000000 set_cache_size (Estraier::Database)
# File estraier-doc.rb, line 578
    def set_cache_size(size, anum, tnum, rnum)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000025.html000066400000000000000000000014431125261632700273620ustar00rootroot00000000000000 add_pseudo_index (Estraier::Database)
# File estraier-doc.rb, line 584
    def add_pseudo_index(path)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000026.html000066400000000000000000000014301125261632700273570ustar00rootroot00000000000000 set_wildmax (Estraier::Database)
# File estraier-doc.rb, line 590
    def set_wildmax(num)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000027.html000066400000000000000000000014371125261632700273670ustar00rootroot00000000000000 set_informer (Estraier::Database)
# File estraier-doc.rb, line 597
    def set_informer(informer)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Database.src/M000028.html000066400000000000000000000013471125261632700273700ustar00rootroot00000000000000 new (Estraier::Database)
# File estraier-doc.rb, line 605
    def initialize()
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Document.html000066400000000000000000000321101125261632700257760ustar00rootroot00000000000000 Class: Estraier::Document
Class Estraier::Document
In: estraier-doc.rb
Parent: Object

Abstraction of document.

Methods

Public Class methods

Create a document object. `draft’ specifies a string of draft data.

Public Instance methods

Add an attribute. `name’ specifies the name of an attribute. `value’ specifies the value of the attribute. If it is `nil’, the attribute is removed. The return value is always `nil’.

Add a hidden sentence. `text’ specifies a hidden sentence. The return value is always `nil’.

Add a sentence of text. `text’ specifies a sentence of text. The return value is always `nil’.

Get the value of an attribute. `name’ specifies the name of an attribute. The return value is the value of the attribute or `nil’ if it does not exist.

Get an array of attribute names of a document object. The return value is an array object of attribute names.

Concatenate sentences of the text of a document object. The return value is concatenated sentences.

Dump draft data of a document object. The return value is draft data.

Get the ID number. The return value is the ID number of the document object. If the object has never been registered, -1 is returned.

Get attached keywords. The return value is a hash object of keywords and their scores in decimal string. If no keyword is attached, `nil’ is returned.

Make a snippet of the body text. `words’ specifies an array object of words to be highlight. `wwidth’ specifies whole width of the result. `hwidth’ specifies width of strings picked up from the beginning of the text. `awidth’ width of strings picked up around each highlighted word. The return value is a snippet string of the body text. There are tab separated values. Each line is a string to be shown. Though most lines have only one field, some lines have two fields. If the second field exists, the first field is to be shown with highlighted, and the second field means its normalized form.

Get the substitute score. The return value is the substitute score or -1 if it is not set.

Attach keywords. `kwords’ specifies a hash object of keywords. Keys of the hash should be keywords of the document and values should be their scores in decimal string. The return value is always `nil’.

Set the substitute score. `score’ specifies the substitute score. It it is negative, the substitute score setting is nullified. The return value is always `nil’.

Get an array of sentences of the text. The return value is an array object of sentences of the text.

hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Document.src/000077500000000000000000000000001125261632700257015ustar00rootroot00000000000000hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Document.src/M000048.html000066400000000000000000000014761125261632700274470ustar00rootroot00000000000000 add_attr (Estraier::Document)
# File estraier-doc.rb, line 35
    def add_attr(name, value)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Document.src/M000049.html000066400000000000000000000014221125261632700274370ustar00rootroot00000000000000 add_text (Estraier::Document)
# File estraier-doc.rb, line 41
    def add_text(text)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Document.src/M000050.html000066400000000000000000000014401125261632700274270ustar00rootroot00000000000000 add_hidden_text (Estraier::Document)
# File estraier-doc.rb, line 47
    def add_hidden_text(text)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Document.src/M000051.html000066400000000000000000000014341125261632700274330ustar00rootroot00000000000000 set_keywords (Estraier::Document)
# File estraier-doc.rb, line 54
    def set_keywords(kwords)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Document.src/M000052.html000066400000000000000000000014251125261632700274340ustar00rootroot00000000000000 set_score (Estraier::Document)
# File estraier-doc.rb, line 61
    def set_score(score)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Document.src/M000053.html000066400000000000000000000013351125261632700274350ustar00rootroot00000000000000 id (Estraier::Document)
# File estraier-doc.rb, line 67
    def id()
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Document.src/M000054.html000066400000000000000000000013551125261632700274400ustar00rootroot00000000000000 attr_names (Estraier::Document)
# File estraier-doc.rb, line 72
    def attr_names()
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Document.src/M000055.html000066400000000000000000000014121125261632700274330ustar00rootroot00000000000000 attr (Estraier::Document)
# File estraier-doc.rb, line 78
    def attr(name)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Document.src/M000056.html000066400000000000000000000013431125261632700274370ustar00rootroot00000000000000 texts (Estraier::Document)
# File estraier-doc.rb, line 83
    def texts()
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Document.src/M000057.html000066400000000000000000000013531125261632700274410ustar00rootroot00000000000000 cat_texts (Estraier::Document)
# File estraier-doc.rb, line 88
    def cat_texts()
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Document.src/M000058.html000066400000000000000000000013511125261632700274400ustar00rootroot00000000000000 keywords (Estraier::Document)
# File estraier-doc.rb, line 94
    def keywords()
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Document.src/M000059.html000066400000000000000000000013431125261632700274420ustar00rootroot00000000000000 score (Estraier::Document)
# File estraier-doc.rb, line 99
    def score()
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Document.src/M000060.html000066400000000000000000000013561125261632700274360ustar00rootroot00000000000000 dump_draft (Estraier::Document)
# File estraier-doc.rb, line 104
    def dump_draft()
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Document.src/M000061.html000066400000000000000000000016431125261632700274360ustar00rootroot00000000000000 make_snippet (Estraier::Document)
# File estraier-doc.rb, line 116
    def make_snippet(words, wwidth, hwidth, awidth)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Document.src/M000062.html000066400000000000000000000015041125261632700274330ustar00rootroot00000000000000 new (Estraier::Document)
# File estraier-doc.rb, line 125
    def initialize(draft = "")
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Result.html000066400000000000000000000200641125261632700255030ustar00rootroot00000000000000 Class: Estraier::Result
Class Estraier::Result
In: estraier-doc.rb
Parent: Object

Abstraction of result set from database.

Methods

Public Class methods

Create a result set object.

Public Instance methods

Get the number of documents. The return value is the number of documents in the result.

Get the index of the container database of a document. `index’ specifies the index of a document. The return value is the index of the container database of the document or -1 if the index is out of bounds.

Get the ID number of a document. `index’ specifies the index of a document. The return value is the ID number of the document or -1 if the index is out of bounds.

Get the score of a document. `index’ specifies the index of a document. The return value is the score of the document or -1 if the index is out of bounds.

Get an array of ID numbers of eclipsed docuemnts of a document. `id’ specifies the ID number of a parent document. The return value is an array whose elements expresse the ID numbers and their scores alternately.

Get the value of a hint word. `word’ specifies a hint word. An empty string means the number of whole result. The return value is the number of documents corresponding the hint word. If the word is in a negative condition, the value is negative.

Get an array of hint words. The return value is an array of hint words.

hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Result.src/000077500000000000000000000000001125261632700254015ustar00rootroot00000000000000hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Result.src/M000029.html000066400000000000000000000013461125261632700271420ustar00rootroot00000000000000 doc_num (Estraier::Result)
# File estraier-doc.rb, line 260
    def doc_num()
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Result.src/M000030.html000066400000000000000000000014261125261632700271310ustar00rootroot00000000000000 get_doc_id (Estraier::Result)
# File estraier-doc.rb, line 266
    def get_doc_id(index)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Result.src/M000031.html000066400000000000000000000014241125261632700271300ustar00rootroot00000000000000 get_dbidx (Estraier::Result)
# File estraier-doc.rb, line 273
    def get_dbidx(index)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Result.src/M000032.html000066400000000000000000000013541125261632700271330ustar00rootroot00000000000000 hint_words (Estraier::Result)
# File estraier-doc.rb, line 278
    def hint_words()
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Result.src/M000033.html000066400000000000000000000014111125261632700271260ustar00rootroot00000000000000 hint (Estraier::Result)
# File estraier-doc.rb, line 285
    def hint(word)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Result.src/M000034.html000066400000000000000000000014241125261632700271330ustar00rootroot00000000000000 get_score (Estraier::Result)
# File estraier-doc.rb, line 291
    def get_score(index)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Result.src/M000035.html000066400000000000000000000014251125261632700271350ustar00rootroot00000000000000 get_shadows (Estraier::Result)
# File estraier-doc.rb, line 298
    def get_shadows(id)
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/classes/Estraier/Result.src/M000036.html000066400000000000000000000013451125261632700271370ustar00rootroot00000000000000 new (Estraier::Result)
# File estraier-doc.rb, line 306
    def initialize()
      # native code ...
    end
hyperestraier-1.4.13/doc/rubynativeapi/created.rid000066400000000000000000000000351125261632700222270ustar00rootroot00000000000000Tue Dec 25 10:53:40 JST 2007 hyperestraier-1.4.13/doc/rubynativeapi/files/000077500000000000000000000000001125261632700212245ustar00rootroot00000000000000hyperestraier-1.4.13/doc/rubynativeapi/files/estraier-doc_rb.html000066400000000000000000000140431125261632700251600ustar00rootroot00000000000000 File: estraier-doc.rb

estraier-doc.rb

Path: estraier-doc.rb
Last Update: Thu Apr 12 10:52:50 JST 2007

Ruby Binding of Hyper Estraier

Hyper Estraier is a full-text search system for communities.

Introduction

This is a package implementing the core API of Hyper Estraier, including native codes written in C. As it works on Linux, Mac OS X, Windows, and so on, native libraries for each environment are required to run programs. This package requires Ruby 1.8.4 or later versions.

Setting

Install the latest version of Hyper Estraier.

Enter the sub directory `rubynative’ in the extracted package then perform installation.

 cd rubynative
 ./configure
 make
 su
 make install

The package `estraier’ should be required in each source file of application programs and include the module `Estraier’ at pleasure.

Example of Gatherer

The following is the simplest implementation of a gatherer.

 require "estraier"
 include Estraier

 # create the database object
 db = Database::new

 # open the database
 unless db.open("casket", Database::DBWRITER | Database::DBCREAT)
   printf("error: %s\n", db.err_msg(db.error))
   exit
 end

 # create a document object
 doc = Document::new

 # add attributes to the document object
 doc.add_attr("@uri", "http://estraier.gov/example.txt")
 doc.add_attr("@title", "Over the Rainbow")

 # add the body text to the document object
 doc.add_text("Somewhere over the rainbow.  Way up high.")
 doc.add_text("There's a land that I heard of once in a lullaby.")

 # register the document object to the database
 unless db.put_doc(doc, Database::PDCLEAN)
   printf("error: %s\n", db.err_msg(db.error))
 end

 # close the database
 unless db.close
   printf("error: %s\n", db.err_msg(db.error))
 end

Example of Searcher

The following is the simplest implementation of a searcher.

 require "estraier"
 include Estraier

 # create the database object
 db = Database::new

 # open the database
 unless db.open("casket", Database::DBREADER)
   printf("error: %s\n", db.err_msg(db.error))
   exit
 end

 # create a search condition object
 cond = Condition::new

 # set the search phrase to the search condition object
 cond.set_phrase("rainbow AND lullaby")

 # get the result of search
 result = db.search(cond)

 # for each document in the result
 dnum = result.doc_num
 for i in 0...dnum
   # retrieve the document object
   doc = db.get_doc(result.get_doc_id(i), 0)
   next unless doc
   # display attributes
   uri = doc.attr("@uri")
   printf("URI: %s\n", uri) if uri
   title = doc.attr("@title")
   printf("Title: %s\n", title) if title
   # display the body text
   doc.texts.each do |text|
     printf("%s\n", text)
   end
 end

 # close the database
 unless db.close
   printf("error: %s\n", db.err_msg(db.error))
 end

License

 Copyright (C) 2004-2006 Mikio Hirabayashi
 All rights reserved.

Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

hyperestraier-1.4.13/doc/rubynativeapi/fr_class_index.html000066400000000000000000000016701125261632700237770ustar00rootroot00000000000000 Classes hyperestraier-1.4.13/doc/rubynativeapi/fr_file_index.html000066400000000000000000000012301125261632700236010ustar00rootroot00000000000000 Files hyperestraier-1.4.13/doc/rubynativeapi/fr_method_index.html000066400000000000000000000143321125261632700241510ustar00rootroot00000000000000 Methods

Methods

add_attr (Estraier::Condition)
add_attr (Estraier::Document)
add_attr_index (Estraier::Database)
add_hidden_text (Estraier::Document)
add_pseudo_index (Estraier::Database)
add_text (Estraier::Document)
attr (Estraier::Document)
attr_names (Estraier::Document)
cat_texts (Estraier::Document)
close (Estraier::Database)
doc_num (Estraier::Database)
doc_num (Estraier::Result)
dump_draft (Estraier::Document)
edit_doc (Estraier::Database)
err_msg (Estraier::Database)
error (Estraier::Database)
fatal (Estraier::Database)
flush (Estraier::Database)
get_dbidx (Estraier::Result)
get_doc (Estraier::Database)
get_doc_attr (Estraier::Database)
get_doc_id (Estraier::Result)
get_score (Estraier::Result)
get_shadows (Estraier::Result)
hint (Estraier::Result)
hint_words (Estraier::Result)
id (Estraier::Document)
keywords (Estraier::Document)
make_snippet (Estraier::Document)
merge (Estraier::Database)
name (Estraier::Database)
new (Estraier::Condition)
new (Estraier::Database)
new (Estraier::Result)
new (Estraier::Document)
open (Estraier::Database)
optimize (Estraier::Database)
out_doc (Estraier::Database)
put_doc (Estraier::Database)
scan_doc (Estraier::Database)
score (Estraier::Document)
search (Estraier::Database)
search_meta (Estraier::Database)
set_auxiliary (Estraier::Condition)
set_cache_size (Estraier::Database)
set_distinct (Estraier::Condition)
set_eclipse (Estraier::Condition)
set_informer (Estraier::Database)
set_keywords (Estraier::Document)
set_mask (Estraier::Condition)
set_max (Estraier::Condition)
set_options (Estraier::Condition)
set_order (Estraier::Condition)
set_phrase (Estraier::Condition)
set_score (Estraier::Document)
set_skip (Estraier::Condition)
set_wildmax (Estraier::Database)
size (Estraier::Database)
sync (Estraier::Database)
texts (Estraier::Document)
uri_to_id (Estraier::Database)
word_num (Estraier::Database)
hyperestraier-1.4.13/doc/rubynativeapi/index.html000066400000000000000000000013331125261632700221170ustar00rootroot00000000000000 estraier hyperestraier-1.4.13/doc/rubynativeapi/rdoc-style.css000066400000000000000000000103321125261632700227200ustar00rootroot00000000000000 body { font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 90%; margin: 0; margin-left: 40px; padding: 0; background: white; } h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; } h1 { font-size: 150%; } h2,h3,h4 { margin-top: 1em; } a { background: #eef; color: #039; text-decoration: none; } a:hover { background: #039; color: #eef; } /* Override the base stylesheet's Anchor inside a table cell */ td > a { background: transparent; color: #039; text-decoration: none; } /* and inside a section title */ .section-title > a { background: transparent; color: #eee; text-decoration: none; } /* === Structural elements =================================== */ div#index { margin: 0; margin-left: -40px; padding: 0; font-size: 90%; } div#index a { margin-left: 0.7em; } div#index .section-bar { margin-left: 0px; padding-left: 0.7em; background: #ccc; font-size: small; } div#classHeader, div#fileHeader { width: auto; color: white; padding: 0.5em 1.5em 0.5em 1.5em; margin: 0; margin-left: -40px; border-bottom: 3px solid #006; } div#classHeader a, div#fileHeader a { background: inherit; color: white; } div#classHeader td, div#fileHeader td { background: inherit; color: white; } div#fileHeader { background: #057; } div#classHeader { background: #048; } .class-name-in-header { font-size: 180%; font-weight: bold; } div#bodyContent { padding: 0 1.5em 0 1.5em; } div#description { padding: 0.5em 1.5em; background: #efefef; border: 1px dotted #999; } div#description h1,h2,h3,h4,h5,h6 { color: #125;; background: transparent; } div#validator-badges { text-align: center; } div#validator-badges img { border: 0; } div#copyright { color: #333; background: #efefef; font: 0.75em sans-serif; margin-top: 5em; margin-bottom: 0; padding: 0.5em 2em; } /* === Classes =================================== */ table.header-table { color: white; font-size: small; } .type-note { font-size: small; color: #DEDEDE; } .xxsection-bar { background: #eee; color: #333; padding: 3px; } .section-bar { color: #333; border-bottom: 1px solid #999; margin-left: -20px; } .section-title { background: #79a; color: #eee; padding: 3px; margin-top: 2em; margin-left: -30px; border: 1px solid #999; } .top-aligned-row { vertical-align: top } .bottom-aligned-row { vertical-align: bottom } /* --- Context section classes ----------------------- */ .context-row { } .context-item-name { font-family: monospace; font-weight: bold; color: black; } .context-item-value { font-size: small; color: #448; } .context-item-desc { color: #333; padding-left: 2em; } /* --- Method classes -------------------------- */ .method-detail { background: #efefef; padding: 0; margin-top: 0.5em; margin-bottom: 1em; border: 1px dotted #ccc; } .method-heading { color: black; background: #ccc; border-bottom: 1px solid #666; padding: 0.2em 0.5em 0 0.5em; } .method-signature { color: black; background: inherit; } .method-name { font-weight: bold; } .method-args { font-style: italic; } .method-description { padding: 0 0.5em 0 0.5em; } /* --- Source code sections -------------------- */ a.source-toggle { font-size: 90%; } div.method-source-code { background: #262626; color: #ffdead; margin: 1em; padding: 0.5em; border: 1px dashed #999; overflow: hidden; } div.method-source-code pre { color: #ffdead; overflow: hidden; } /* --- Ruby keyword styles --------------------- */ .standalone-code { background: #221111; color: #ffdead; overflow: hidden; } .ruby-constant { color: #7fffd4; background: transparent; } .ruby-keyword { color: #00ffff; background: transparent; } .ruby-ivar { color: #eedd82; background: transparent; } .ruby-operator { color: #00ffee; background: transparent; } .ruby-identifier { color: #ffdead; background: transparent; } .ruby-node { color: #ffa07a; background: transparent; } .ruby-comment { color: #b22222; font-weight: bold; background: transparent; } .ruby-regexp { color: #ffa07a; background: transparent; } .ruby-value { color: #7fffd4; background: transparent; }hyperestraier-1.4.13/doc/rubypureapi/000077500000000000000000000000001125261632700176075ustar00rootroot00000000000000hyperestraier-1.4.13/doc/rubypureapi/classes/000077500000000000000000000000001125261632700212445ustar00rootroot00000000000000hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/000077500000000000000000000000001125261632700236565ustar00rootroot00000000000000hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Condition.html000066400000000000000000000454121125261632700265000ustar00rootroot00000000000000 Class: EstraierPure::Condition
Class EstraierPure::Condition
In: estraierpure.rb
Parent: Object

Abstraction of search condition.

Methods

add_attr   attrs   auxiliary   distinct   mask   max   new   options   order   phrase   set_auxiliary   set_distinct   set_mask   set_max   set_options   set_order   set_phrase   set_skip   skip  

Constants

SURE = 1 << 0   option: check every N-gram key
USUAL = 1 << 1   option: check N-gram keys skipping by one
FAST = 1 << 2   option: check N-gram keys skipping by two
AGITO = 1 << 3   option: check N-gram keys skipping by three
NOIDF = 1 << 4   option: without TF-IDF tuning
SIMPLE = 1 << 10   option: with the simplified phrase
ROUGH = 1 << 11   option: with the rough phrase
UNION = 1 << 15   option: with the union phrase
ISECT = 1 << 16   option: with the intersection phrase

Public Class methods

Create a search condition object.

Public Instance methods

Add an expression for an attribute. `expr’ specifies an expression for an attribute. The return value is always `nil’.

Get expressions for attributes. The return value is expressions for attributes.

Get permission to adopt result of the auxiliary index. The return value is permission to adopt result of the auxiliary index.

Get the attribute distinction filter. The return value is the name of the distinct attribute.

Get the mask of targets of meta search. The return value is the mask of targets of meta search.

Get the maximum number of retrieval. The return value is the maximum number of retrieval.

Get options of retrieval. The return value is options by bitwise or.

Get the order expression. The return value is the order expression.

Get the search phrase. The return value is the search phrase.

Set permission to adopt result of the auxiliary index. `min’ specifies the minimum hits to adopt result of the auxiliary index. If it is not more than 0, the auxiliary index is not used. By default, it is 32. The return value is always `nil’.

Set the attribute distinction filter. `name’ specifies the name of an attribute to be distinct. The return value is always `nil’.

Set the mask of targets of meta search. `mask’ specifies a masking number. 1 means the first target, 2 means the second target, 4 means the third target, and power values of 2 and their summation compose the mask. The return value is always `nil’.

Set the maximum number of retrieval. `max’ specifies the maximum number of retrieval. By default, the number of retrieval is not limited. The return value is always `nil’.

Set options of retrieval. `options’ specifies options: `Condition::SURE’ specifies that it checks every N-gram key, `Condition::USU’, which is the default, specifies that it checks N-gram keys with skipping one key, `Condition::FAST’ skips two keys, `Condition::AGITO’ skips three keys, `Condition::NOIDF’ specifies not to perform TF-IDF tuning, `Condition::SIMPLE’ specifies to use simplified phrase, `Condition::ROUGH’ specifies to use rough phrase, `Condition.UNION’ specifies to use union phrase, `Condition.ISECT’ specifies to use intersection phrase. Each option can be specified at the same time by bitwise or. If keys are skipped, though search speed is improved, the relevance ratio grows less. The return value is always `nil’.

Set the order of a condition object. `expr’ specifies an expression for the order. By default, the order is by score descending. The return value is always `nil’.

Set the search phrase. `phrase’ specifies a search phrase. The return value is always `nil’.

Set the number of skipped documents. `skip’ specifies the number of documents to be skipped in the search result. The return value is always `nil’.

Get the number of skipped documents. The return value is the number of documents to be skipped in the search result.

hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Condition.src/000077500000000000000000000000001125261632700263725ustar00rootroot00000000000000hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Condition.src/M000043.html000066400000000000000000000032441125261632700301260ustar00rootroot00000000000000 set_phrase (EstraierPure::Condition)
# File estraierpure.rb, line 261
    def set_phrase(phrase)
      Utility::check_types({ phrase=>String }) if $DEBUG
      phrase = phrase.gsub(/[ \t\r\n\v\f]+/, " ")
      phrase = phrase.strip.squeeze(" ")
      @phrase = phrase
      nil
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Condition.src/M000044.html000066400000000000000000000032721125261632700301300ustar00rootroot00000000000000 add_attr (EstraierPure::Condition)
# File estraierpure.rb, line 271
    def add_attr(expr)
      Utility::check_types({ expr=>String }) if $DEBUG
      expr = expr.gsub(/[ \t\r\n\v\f]+/, " ")
      expr = expr.strip.squeeze(" ")
      @attrs.push(expr)
      nil
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Condition.src/M000045.html000066400000000000000000000032231125261632700301250ustar00rootroot00000000000000 set_order (EstraierPure::Condition)
# File estraierpure.rb, line 281
    def set_order(expr)
      Utility::check_types({ expr=>String }) if $DEBUG
      expr = expr.gsub(/[ \t\r\n\v\f]+/, " ")
      expr = expr.strip.squeeze(" ")
      @order = expr
      nil
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Condition.src/M000046.html000066400000000000000000000025211125261632700301260ustar00rootroot00000000000000 set_max (EstraierPure::Condition)
# File estraierpure.rb, line 292
    def set_max(max)
      Utility::check_types({ max=>Integer }) if $DEBUG
      @max = max if max >= 0
      nil
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Condition.src/M000047.html000066400000000000000000000025301125261632700301270ustar00rootroot00000000000000 set_skip (EstraierPure::Condition)
# File estraierpure.rb, line 300
    def set_skip(skip)
      Utility::check_types({ skip=>Integer }) if $DEBUG
      @skip = skip if skip >= 0
      nil
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Condition.src/M000048.html000066400000000000000000000023611125261632700301320ustar00rootroot00000000000000 set_options (EstraierPure::Condition)
# File estraierpure.rb, line 315
    def set_options(options)
      Utility::check_types({ options=>Integer }) if $DEBUG
      @options |= options
      nil
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Condition.src/M000049.html000066400000000000000000000023071125261632700301330ustar00rootroot00000000000000 set_auxiliary (EstraierPure::Condition)
# File estraierpure.rb, line 324
    def set_auxiliary(min)
      Utility::check_types({ min=>Integer }) if $DEBUG
      @auxiliary = min
      nil
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Condition.src/M000050.html000066400000000000000000000032341125261632700301230ustar00rootroot00000000000000 set_distinct (EstraierPure::Condition)
# File estraierpure.rb, line 332
    def set_distinct(name)
      Utility::check_types({ name=>String }) if $DEBUG
      name = name.gsub(/[ \t\r\n\v\f]+/, " ")
      name = name.strip.squeeze(" ")
      @distinct = name
      nil
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Condition.src/M000051.html000066400000000000000000000022731125261632700301260ustar00rootroot00000000000000 set_mask (EstraierPure::Condition)
# File estraierpure.rb, line 343
    def set_mask(mask)
      Utility::check_types({ mask=>Integer }) if $DEBUG
      @mask = mask
      nil
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Condition.src/M000052.html000066400000000000000000000013321125261632700301220ustar00rootroot00000000000000 phrase (EstraierPure::Condition)
# File estraierpure.rb, line 350
    def phrase()
      @phrase
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Condition.src/M000053.html000066400000000000000000000013271125261632700301270ustar00rootroot00000000000000 attrs (EstraierPure::Condition)
# File estraierpure.rb, line 355
    def attrs()
      @attrs
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Condition.src/M000054.html000066400000000000000000000013271125261632700301300ustar00rootroot00000000000000 order (EstraierPure::Condition)
# File estraierpure.rb, line 360
    def order()
      @order
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Condition.src/M000055.html000066400000000000000000000013211125261632700301230ustar00rootroot00000000000000 max (EstraierPure::Condition)
# File estraierpure.rb, line 365
    def max()
      @max
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Condition.src/M000056.html000066400000000000000000000013241125261632700301270ustar00rootroot00000000000000 skip (EstraierPure::Condition)
# File estraierpure.rb, line 370
    def skip()
      @skip
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Condition.src/M000057.html000066400000000000000000000013351125261632700301320ustar00rootroot00000000000000 options (EstraierPure::Condition)
# File estraierpure.rb, line 375
    def options()
      @options
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Condition.src/M000058.html000066400000000000000000000013431125261632700301320ustar00rootroot00000000000000 auxiliary (EstraierPure::Condition)
# File estraierpure.rb, line 380
    def auxiliary()
      @auxiliary
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Condition.src/M000059.html000066400000000000000000000013401125261632700301300ustar00rootroot00000000000000 distinct (EstraierPure::Condition)
# File estraierpure.rb, line 385
    def distinct()
      @distinct
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Condition.src/M000060.html000066400000000000000000000013241125261632700301220ustar00rootroot00000000000000 mask (EstraierPure::Condition)
# File estraierpure.rb, line 390
    def mask()
      @mask
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Condition.src/M000061.html000066400000000000000000000025741125261632700301330ustar00rootroot00000000000000 new (EstraierPure::Condition)
# File estraierpure.rb, line 398
    def initialize()
      @phrase = nil
      @attrs = []
      @order = nil
      @max = -1
      @skip = 0
      @options = 0
      @auxiliary = 32
      @distinct = nil
      @mask = 0
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Document.html000066400000000000000000000276301125261632700263320ustar00rootroot00000000000000 Class: EstraierPure::Document
Class EstraierPure::Document
In: estraierpure.rb
Parent: Object

Abstraction of document.

Methods

Public Class methods

Create a document object. `draft’ specifies a string of draft data.

Public Instance methods

Add an attribute. `name’ specifies the name of an attribute. `value’ specifies the value of the attribute. If it is `nil’, the attribute is removed. The return value is always `nil’.

Add a hidden sentence. `text’ specifies a hidden sentence. The return value is always `nil’.

Add a sentence of text. `text’ specifies a sentence of text. The return value is always `nil’.

Get the value of an attribute. `name’ specifies the name of an attribute. The return value is the value of the attribute or `nil’ if it does not exist.

Get an array of attribute names of a document object. The return value is an array object of attribute names.

Concatenate sentences of the text of a document object. The return value is concatenated sentences.

Dump draft data of a document object. The return value is draft data.

Get the ID number. The return value is the ID number of the document object. If the object has never been registered, -1 is returned.

Get attached keywords. The return value is a map object of keywords and their scores in decimal string. If no keyword is attached, `nil’ is returned.

Get the substitute score. The return value is the substitute score or -1 if it is not set.

Attach keywords. `kwords’ specifies a map object of keywords. Keys of the map should be keywords of the document and values should be their scores in decimal string. The return value is always `nil’.

Set the substitute score. `score’ specifies the substitute score. It it is negative, the substitute score setting is nullified. The return value is always `nil’.

Get an array of sentences of the text. The return value is an array object of sentences of the text.

hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Document.src/000077500000000000000000000000001125261632700262225ustar00rootroot00000000000000hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Document.src/M000062.html000066400000000000000000000044761125261632700277670ustar00rootroot00000000000000 add_attr (EstraierPure::Document)
# File estraierpure.rb, line 54
    def add_attr(name, value)
      Utility::check_types({ name=>String, value=>String }) if $DEBUG
      name = name.gsub(/[ \t\r\n\v\f]+/, " ")
      name = name.strip.squeeze(" ")
      value = value.gsub(/[ \t\r\n\v\f]+/, " ")
      value = value.strip.squeeze(" ")
      @attrs[name] = value
      nil
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Document.src/M000063.html000066400000000000000000000034671125261632700277670ustar00rootroot00000000000000 add_text (EstraierPure::Document)
# File estraierpure.rb, line 66
    def add_text(text)
      Utility::check_types({ text=>String }) if $DEBUG
      text = text.gsub(/[ \t\r\n\v\f]+/, " ")
      text = text.strip.squeeze(" ")
      @dtexts.push(text) if text.length
      nil
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Document.src/M000064.html000066400000000000000000000035051125261632700277610ustar00rootroot00000000000000 add_hidden_text (EstraierPure::Document)
# File estraierpure.rb, line 76
    def add_hidden_text(text)
      Utility::check_types({ text=>String }) if $DEBUG
      text = text.gsub(/[ \t\r\n\v\f]+/, " ")
      text = text.strip.squeeze(" ")
      @htexts.push(text) if text.length
      nil
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Document.src/M000065.html000066400000000000000000000023061125261632700277600ustar00rootroot00000000000000 set_keywords (EstraierPure::Document)
# File estraierpure.rb, line 87
    def set_keywords(kwords)
      Utility::check_types({ kwords=>Hash }) if $DEBUG
      @kwords = kwords
      nil
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Document.src/M000066.html000066400000000000000000000022771125261632700277700ustar00rootroot00000000000000 set_score (EstraierPure::Document)
# File estraierpure.rb, line 96
    def set_score(score)
      Utility::check_types({ score=>Integer }) if $DEBUG
      @score = score
      nil
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Document.src/M000067.html000066400000000000000000000013151125261632700277610ustar00rootroot00000000000000 id (EstraierPure::Document)
# File estraierpure.rb, line 104
    def id()
      @id
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Document.src/M000068.html000066400000000000000000000014641125261632700277670ustar00rootroot00000000000000 attr_names (EstraierPure::Document)
# File estraierpure.rb, line 109
    def attr_names()
      @attrs.keys.sort
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Document.src/M000069.html000066400000000000000000000022021125261632700277570ustar00rootroot00000000000000 attr (EstraierPure::Document)
# File estraierpure.rb, line 115
    def attr(name)
      Utility::check_types({ name=>String }) if $DEBUG
      @attrs[name]
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Document.src/M000070.html000066400000000000000000000013271125261632700277560ustar00rootroot00000000000000 texts (EstraierPure::Document)
# File estraierpure.rb, line 121
    def texts()
      @dtexts
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Document.src/M000071.html000066400000000000000000000033221125261632700277540ustar00rootroot00000000000000 cat_texts (EstraierPure::Document)
# File estraierpure.rb, line 126
    def cat_texts()
      buf = StringIO::new
      for i in 0...@dtexts.length
        buf.write(" ") if i > 0
        buf.write(@dtexts[i])
      end
      buf.string
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Document.src/M000072.html000066400000000000000000000104751125261632700277640ustar00rootroot00000000000000 dump_draft (EstraierPure::Document)
# File estraierpure.rb, line 136
    def dump_draft()
      buf = StringIO::new
      keys = @attrs.keys.sort
      for i in 0...keys.length
        buf.printf("%s=%s\n", keys[i], @attrs[keys[i]])
      end
      if @kwords
        buf.printf("%%VECTOR")
        @kwords.each() do |key, value|
          buf.printf("\t%s\t%s", key, value)
        end
        buf.printf("\n")
      end
      buf.printf("%%SCORE\t%d\n", @score) if @score >= 0
      buf.printf("\n")
      for i in 0...@dtexts.length
        buf.printf("%s\n", @dtexts[i])
      end
      for i in 0...@htexts.length
        buf.printf("\t%s\n", @htexts[i])
      end
      buf.string
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Document.src/M000073.html000066400000000000000000000013351125261632700277600ustar00rootroot00000000000000 keywords (EstraierPure::Document)
# File estraierpure.rb, line 162
    def keywords()
      @kwords
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Document.src/M000074.html000066400000000000000000000017041125261632700277610ustar00rootroot00000000000000 score (EstraierPure::Document)
# File estraierpure.rb, line 167
    def score()
      return -1 if(@score < 0)
      @score
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Document.src/M000075.html000066400000000000000000000177751125261632700300010ustar00rootroot00000000000000 new (EstraierPure::Document)
# File estraierpure.rb, line 177
    def initialize(draft = "")
      Utility::check_types({ draft=>String }) if $DEBUG
      @id = -1
      @attrs = {}
      @dtexts = []
      @htexts = []
      @kwords = nil
      @score = -1
      if draft.length
        lines = draft.split(/\n/, -1)
        num = 0
        while num < lines.length
          line = lines[num]
          num += 1
          break if line.length < 1
          if line =~ /^%/
            if line =~ /^%VECTOR\t/
              @kwords = {} unless @kwords
              fields = line.split(/\t/)
              i = 1
              while i < fields.length - 1
                @kwords[fields[i]] = fields[i+1]
                i += 2
              end
            elsif line =~ /^%SCORE\t/
              fields = line.split(/\t/)
              @score = fields[1].to_i;
            end
            next
          end
          line = line.gsub(/[ \t\r\n\v\f]+/, " ")
          line = line.strip.squeeze(" ")
          if idx = line.index("=")
            key = line[0...idx]
            value = line[idx+1...line.length]
            @attrs[key] = value
          end
        end
        while num < lines.length
          line = lines[num]
          num += 1
          next unless line.length > 0
          if line[0] == 0x9
            @htexts.push(line[1...line.length]) if line.length > 1
          else
            @dtexts.push(line)
          end
        end
      end
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.html000066400000000000000000000614601125261632700254400ustar00rootroot00000000000000 Class: EstraierPure::Node
Class EstraierPure::Node
In: estraierpure.rb
Parent: Object

Abstraction of connection to P2P node.

Public Class methods

Create a node connection object.

Public Instance methods

Get an array of names of administrators. The return value is an array object of names of administrators. On error, `nil’ is returned.

Get the usage ratio of the cache. The return value is the usage ratio of the cache. On error, -1.0 is returned.

Get the number of documents. The return value is the number of documents. On error, -1 is returned.

Edit attributes of a document. `doc’ specifies a document object. The return value is true if success, else it is false.

Extract keywords of a document. `id’ specifies the ID number of a registered document. The return value is a hash object of keywords and their scores in decimal string or `nil’ on error.

Extract keywords of a document specified by URI. `uri’ specifies the URI of a registered document. The return value is a hash object of keywords and their scores in decimal string or `nil’ on error.

Retrieve a document. `id’ specifies the ID number of a registered document. The return value is a document object. On error, `nil’ is returned.

Retrieve the value of an attribute of a document. `id’ specifies the ID number of a registered document. `name’ specifies the name of an attribute. The return value is the value of the attribute or `nil’ if it does not exist.

Retrieve the value of an attribute of a document specified by URI. `uri’ specifies the URI of a registered document. `name’ specifies the name of an attribute. The return value is the value of the attribute or `nil’ if it does not exist.

Retrieve a document. `uri’ specifies the URI of a registered document. The return value is a document object. On error, `nil’ is returned.

Get the label. The return value is the label. On error, `nil’ is returned.

Get an array of expressions of links. The return value is an array object of expressions of links. Each element is a TSV string and has three fields of the URL, the label, and the score. On error, `nil’ is returned.

Get the name. The return value is the name. On error, `nil’ is returned.

Optimize the database. The return value is true if success, else it is false.

Remove a document. `id’ specifies the ID number of a registered document. The return value is true if success, else it is false.

 Remove a document specified by URI.

`uri’ specifies the URI of a registered document. The return value is true if success, else it is false.

Add a document. `doc’ specifies a document object. The document object should have the URI attribute. The return value is true if success, else it is false.

Search for documents corresponding a condition. `cond’ specifies a condition object. `depth’ specifies the depth of meta search. The return value is a node result object. On error, `nil’ is returned.

Set the authentication information. `name’ specifies the name of authentication. `passwd’ specifies the password of the authentication. The return value is always `nil’.

Manage a link of a node. `url’ specifies the URL of the target node of a link. `label’ specifies the label of the link. `credit’ specifies the credit of the link. If it is negative, the link is removed. The return value is true if success, else it is false.

Set the proxy information. `host’ specifies the host name of a proxy server. `port’ specifies the port number of the proxy server. The return value is always `nil’.

Set width of snippet in the result. `wwidth’ specifies whole width of a snippet. By default, it is 480. If it is 0, no snippet is sent. If it is negative, whole body text is sent instead of snippet. `hwidth’ specifies width of strings picked up from the beginning of the text. By default, it is 96. If it is negative 0, the current setting is not changed. `awidth’ specifies width of strings picked up around each highlighted word. By default, it is 96. If it is negative, the current setting is not changed.

Set timeout of a connection. `sec’ specifies timeout of the connection in seconds. The return value is always `nil’.

Set the URL of a node server. `url’ specifies the URL of a node. The return value is always `nil’.

Manage a user account of a node. `name’ specifies the name of a user. `mode’ specifies the operation mode. 0 means to delete the account. 1 means to set the account as an administrator. 2 means to set the account as a guest. The return value is true if success, else it is false.

Get the size of the datbase. The return value is the size of the datbase. On error, -1.0 is returned.

Get the status code of the last request. The return value is the status code of the last request. -1 means failure of connection.

Synchronize updating contents of the database. The return value is true if success, else it is false.

Get the ID of a document specified by URI. `uri’ specifies the URI of a registered document. The return value is the ID of the document. On error, -1 is returned.

Get an array of names of users. The return value is an array object of names of users. On error, `nil’ is returned.

Get the number of unique words. The return value is the number of unique words. On error, -1 is returned.

hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/000077500000000000000000000000001125261632700253315ustar00rootroot00000000000000hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000001.html000066400000000000000000000022571125261632700270620ustar00rootroot00000000000000 set_url (EstraierPure::Node)
# File estraierpure.rb, line 512
    def set_url(url)
      Utility::check_types({ url=>String }) if $DEBUG
      @url = url
      nil
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000002.html000066400000000000000000000026721125261632700270640ustar00rootroot00000000000000 set_proxy (EstraierPure::Node)
# File estraierpure.rb, line 521
    def set_proxy(host, port)
      Utility::check_types({ host=>String, port=>Integer }) if $DEBUG
      @pxhost = host
      @pxport = port
      nil
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000003.html000066400000000000000000000022741125261632700270630ustar00rootroot00000000000000 set_timeout (EstraierPure::Node)
# File estraierpure.rb, line 530
    def set_timeout(sec)
      Utility::check_types({ sec=>Integer }) if $DEBUG
      @timeout = sec
      nil
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000004.html000066400000000000000000000030161125261632700270570ustar00rootroot00000000000000 set_auth (EstraierPure::Node)
# File estraierpure.rb, line 539
    def set_auth(name, password)
      Utility::check_types({ name=>String, password=>String }) if $DEBUG
      @auth = name + ":" + password
      nil
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000005.html000066400000000000000000000013251125261632700270610ustar00rootroot00000000000000 status (EstraierPure::Node)
# File estraierpure.rb, line 546
    def status()
      @status
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000006.html000066400000000000000000000046031125261632700270640ustar00rootroot00000000000000 sync (EstraierPure::Node)
# File estraierpure.rb, line 551
    def sync()
      @status = -1
      return false unless @url
      turl = @url + "/sync"
      reqheads = [ "Content-Type: application/x-www-form-urlencoded" ]
      reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth
      rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, "", nil, nil)
      @status = rv
      rv == 200
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000007.html000066400000000000000000000046171125261632700270720ustar00rootroot00000000000000 optimize (EstraierPure::Node)
# File estraierpure.rb, line 563
    def optimize()
      @status = -1
      return false unless @url
      turl = @url + "/optimize"
      reqheads = [ "Content-Type: application/x-www-form-urlencoded" ]
      reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth
      rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, "", nil, nil)
      @status = rv
      rv == 200
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000008.html000066400000000000000000000056151125261632700270720ustar00rootroot00000000000000 put_doc (EstraierPure::Node)
# File estraierpure.rb, line 576
    def put_doc(doc)
      Utility::check_types({ doc=>Document }) if $DEBUG
      @status = -1
      return false unless @url
      turl = @url + "/put_doc"
      reqheads = [ "Content-Type: text/x-estraier-draft" ]
      reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth
      reqbody = doc.dump_draft
      rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, nil)
      @status = rv
      rv == 200
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000009.html000066400000000000000000000057501125261632700270730ustar00rootroot00000000000000 out_doc (EstraierPure::Node)
# File estraierpure.rb, line 591
    def out_doc(id)
      Utility::check_types({ id=>Integer }) if $DEBUG
      @status = -1
      return false unless @url
      turl = @url + "/out_doc"
      reqheads = [ "Content-Type: application/x-www-form-urlencoded" ]
      reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth
      reqbody = "id=" + id.to_s
      rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, nil)
      @status = rv
      rv == 200
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000010.html000066400000000000000000000061071125261632700270600ustar00rootroot00000000000000 out_doc_by_uri (EstraierPure::Node)
# File estraierpure.rb, line 606
    def out_doc_by_uri(uri)
      Utility::check_types({ uri=>String }) if $DEBUG
      @status = -1
      return false unless @url
      turl = @url + "/out_doc"
      reqheads = [ "Content-Type: application/x-www-form-urlencoded" ]
      reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth
      reqbody = "uri=" + CGI::escape(uri)
      rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, nil)
      @status = rv
      rv == 200
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000011.html000066400000000000000000000056201125261632700270600ustar00rootroot00000000000000 edit_doc (EstraierPure::Node)
# File estraierpure.rb, line 621
    def edit_doc(doc)
      Utility::check_types({ doc=>Document }) if $DEBUG
      @status = -1
      return false unless @url
      turl = @url + "/edit_doc"
      reqheads = [ "Content-Type: text/x-estraier-draft" ]
      reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth
      reqbody = doc.dump_draft
      rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, nil)
      @status = rv
      rv == 200
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000012.html000066400000000000000000000067561125261632700270740ustar00rootroot00000000000000 get_doc (EstraierPure::Node)
# File estraierpure.rb, line 636
    def get_doc(id)
      Utility::check_types({ id=>Integer }) if $DEBUG
      @status = -1
      return nil unless @url
      turl = @url + "/get_doc"
      reqheads = [ "Content-Type: application/x-www-form-urlencoded" ]
      reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth
      reqbody = "id=" + id.to_s
      resbody = StringIO::new
      rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, resbody)
      @status = rv
      return nil if rv != 200
      Document::new(resbody.string)
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000013.html000066400000000000000000000071151125261632700270630ustar00rootroot00000000000000 get_doc_by_uri (EstraierPure::Node)
# File estraierpure.rb, line 653
    def get_doc_by_uri(uri)
      Utility::check_types({ uri=>String }) if $DEBUG
      @status = -1
      return nil unless @url
      turl = @url + "/get_doc"
      reqheads = [ "Content-Type: application/x-www-form-urlencoded" ]
      reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth
      reqbody = "uri=" + CGI::escape(uri)
      resbody = StringIO::new
      rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, resbody)
      @status = rv
      return nil if rv != 200
      Document::new(resbody.string)
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000014.html000066400000000000000000000075741125261632700270750ustar00rootroot00000000000000 get_doc_attr (EstraierPure::Node)
# File estraierpure.rb, line 671
    def get_doc_attr(id, name)
      Utility::check_types({ id=>Integer, name=>String }) if $DEBUG
      @status = -1
      return nil unless @url
      turl = @url + "/get_doc_attr"
      reqheads = [ "Content-Type: application/x-www-form-urlencoded" ]
      reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth
      reqbody = "id=" + id.to_s + "&attr=" + CGI::escape(name)
      resbody = StringIO::new
      rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, resbody)
      @status = rv
      return nil if rv != 200
      resbody.string.chomp
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000015.html000066400000000000000000000077331125261632700270730ustar00rootroot00000000000000 get_doc_attr_by_uri (EstraierPure::Node)
# File estraierpure.rb, line 689
    def get_doc_attr_by_uri(uri, name)
      Utility::check_types({ uri=>String, name=>String }) if $DEBUG
      @status = -1
      return nil unless @url
      turl = @url + "/get_doc_attr"
      reqheads = [ "Content-Type: application/x-www-form-urlencoded" ]
      reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth
      reqbody = "uri=" + CGI::escape(uri) + "&attr=" + CGI::escape(name)
      resbody = StringIO::new
      rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, resbody)
      @status = rv
      return nil if rv != 200
      resbody.string.chomp
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000016.html000066400000000000000000000111701125261632700270620ustar00rootroot00000000000000 etch_doc (EstraierPure::Node)
# File estraierpure.rb, line 707
    def etch_doc(id)
      Utility::check_types({ id=>Integer }) if $DEBUG
      @status = -1
      return nil unless @url
      turl = @url + "/etch_doc"
      reqheads = [ "Content-Type: application/x-www-form-urlencoded" ]
      reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth
      reqbody = "id=" + id.to_s
      resbody = StringIO::new
      rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, resbody)
      @status = rv
      return nil if rv != 200
      kwords = {}
      lines = resbody.string.split(/\n/, -1)
      for i in 0...lines.length
        pair = lines[i].split(/\t/)
        next if pair.length < 2
        kwords[pair[0]] = pair[1]
      end
      kwords
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000017.html000066400000000000000000000113271125261632700270670ustar00rootroot00000000000000 etch_doc_by_uri (EstraierPure::Node)
# File estraierpure.rb, line 732
    def etch_doc_by_uri(uri)
      Utility::check_types({ uri=>String }) if $DEBUG
      @status = -1
      return nil unless @url
      turl = @url + "/etch_doc"
      reqheads = [ "Content-Type: application/x-www-form-urlencoded" ]
      reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth
      reqbody = "uri=" + CGI::escape(uri)
      resbody = StringIO::new
      rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, resbody)
      @status = rv
      return nil if rv != 200
      kwords = {}
      lines = resbody.string.split(/\n/, -1)
      for i in 0...lines.length
        pair = lines[i].split(/\t/)
        next if pair.length < 2
        kwords[pair[0]] = pair[1]
      end
      kwords
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000018.html000066400000000000000000000067601125261632700270750ustar00rootroot00000000000000 uri_to_id (EstraierPure::Node)
# File estraierpure.rb, line 756
    def uri_to_id(uri)
      Utility::check_types({ uri=>String }) if $DEBUG
      @status = -1
      return -1 unless @url
      turl = @url + "/uri_to_id"
      reqheads = [ "Content-Type: application/x-www-form-urlencoded" ]
      reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth
      reqbody = "uri=" + CGI::escape(uri)
      resbody = StringIO::new
      rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, resbody)
      @status = rv
      return nil if rv != 200
      resbody.string.chomp
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000019.html000066400000000000000000000015641125261632700270730ustar00rootroot00000000000000 name (EstraierPure::Node)
# File estraierpure.rb, line 772
    def name()
      set_info if !@name
      @name
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000020.html000066400000000000000000000015701125261632700270600ustar00rootroot00000000000000 label (EstraierPure::Node)
# File estraierpure.rb, line 778
    def label()
      set_info if !@label
      @label
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000021.html000066400000000000000000000016401125261632700270570ustar00rootroot00000000000000 doc_num (EstraierPure::Node)
# File estraierpure.rb, line 784
    def doc_num()
      set_info if @dnum < 0
      @dnum
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000022.html000066400000000000000000000016421125261632700270620ustar00rootroot00000000000000 word_num (EstraierPure::Node)
# File estraierpure.rb, line 790
    def word_num()
      set_info if @wnum < 0
      @wnum
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000023.html000066400000000000000000000016741125261632700270700ustar00rootroot00000000000000 size (EstraierPure::Node)
# File estraierpure.rb, line 796
    def size()
      set_info if @size < 0.0
      @size
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000024.html000066400000000000000000000054631125261632700270710ustar00rootroot00000000000000 cache_usage (EstraierPure::Node)
# File estraierpure.rb, line 802
    def cache_usage()
      @status = -1
      return -1.0 unless @url
      turl = @url + "/cacheusage"
      reqheads = []
      reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth
      resbody = StringIO::new
      rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, nil, nil, resbody)
      @status = rv
      return -1.0 if rv != 200
      return resbody.string.strip.to_f
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000025.html000066400000000000000000000015341125261632700270650ustar00rootroot00000000000000 admins (EstraierPure::Node)
# File estraierpure.rb, line 817
    def admins()
      set_info unless @admins
      @admins
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000026.html000066400000000000000000000015301125261632700270620ustar00rootroot00000000000000 users (EstraierPure::Node)
# File estraierpure.rb, line 823
    def users()
      set_info unless @users
      @users
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000027.html000066400000000000000000000015301125261632700270630ustar00rootroot00000000000000 links (EstraierPure::Node)
# File estraierpure.rb, line 830
    def links()
      set_info unless @links
      @links
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000028.html000066400000000000000000000355101125261632700270710ustar00rootroot00000000000000 search (EstraierPure::Node)
# File estraierpure.rb, line 838
    def search(cond, depth)
      Utility::check_types({ cond=>Condition, depth=>Integer }) if $DEBUG
      @status = -1
      return nil unless @url
      turl = @url + "/search"
      reqheads = [ "Content-Type: application/x-www-form-urlencoded" ]
      reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth
      reqbody = Utility::cond_to_query(cond, depth, @wwidth, @hwidth, @awidth)
      resbody = StringIO::new
      rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, resbody)
      @status = rv
      return nil if rv != 200
      lines = resbody.string.split(/\n/, -1)
      return nil if lines.length < 1
      docs = []
      hints = {}
      nres = NodeResult::new(docs, hints)
      border = lines[0]
      isend = false
      lnum = 1
      while lnum < lines.length
        line = lines[lnum]
        lnum += 1
        if line.length >= border.length && line.index(border) == 0
          isend = true if line[border.length...line.length] == ":END"
          break
        end
        lidx = line.index("\t")
        if lidx
          key = line[0...lidx]
          value = line[(lidx+1)...line.length]
          hints[key] = value
        end
      end
      snum = lnum
      while !isend && lnum < lines.length
        line = lines[lnum]
        lnum += 1
        if line.length >= border.length && line.index(border) == 0
          if lnum > snum
            rdattrs = {}
            sb = StringIO::new
            rdvector = ""
            rlnum = snum
            while rlnum < lnum - 1
              rdline = lines[rlnum].strip
              rlnum += 1
              break if rdline.length < 1
              if rdline =~ /^%/
                lidx = rdline.index("\t")
                rdvector = rdline[(lidx+1)...rdline.length] if rdline =~ /%VECTOR/ && lidx
              else
                lidx = rdline.index("=")
                if lidx
                  key = rdline[0...lidx]
                  value = rdline[(lidx+1)...rdline.length]
                  rdattrs[key] = value
                end
              end
            end
            while rlnum < lnum - 1
              rdline = lines[rlnum]
              rlnum += 1
              sb.printf("%s\n", rdline)
            end
            rduri = rdattrs["@uri"]
            rdsnippet = sb.string
            if rduri
              rdoc = ResultDocument::new(rduri, rdattrs, rdsnippet, rdvector)
              docs.push(rdoc)
            end
          end
          snum = lnum
          isend = true if line[border.length...line.length] == ":END"
        end
      end
      return nil if !isend
      return nres
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000029.html000066400000000000000000000026221125261632700270700ustar00rootroot00000000000000 set_snippet_width (EstraierPure::Node)
# File estraierpure.rb, line 924
    def set_snippet_width(wwidth, hwidth, awidth)
      @wwidth = wwidth
      @hwidth = hwidth if hwidth >= 0
      @awidth = awidth if awidth >= 0
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000030.html000066400000000000000000000067021125261632700270630ustar00rootroot00000000000000 set_user (EstraierPure::Node)
# File estraierpure.rb, line 934
    def set_user(name, mode)
      Utility::check_types({ name=>String, mode=>Integer }) if $DEBUG
      @status = -1
      return false unless @url
      turl = @url + "/_set_user"
      reqheads = [ "Content-Type: application/x-www-form-urlencoded" ]
      reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth
      reqbody = "name=" + CGI::escape(name) + "&mode=" + mode.to_s
      rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, nil)
      @status = rv
      rv == 200
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000031.html000066400000000000000000000077631125261632700270740ustar00rootroot00000000000000 set_link (EstraierPure::Node)
# File estraierpure.rb, line 951
    def set_link(url, label, credit)
      Utility::check_types({ url=>String, label=>String, credit=>Integer }) if $DEBUG
      @status = -1
      return false unless @url
      turl = @url + "/_set_link"
      reqheads = [ "Content-Type: application/x-www-form-urlencoded" ]
      reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth
      reqbody = "url=" + CGI::escape(url) + "&label=" + label
      reqbody += "&credit=" + credit.to_s if credit >= 0
      rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, nil)
      @status = rv
      rv == 200
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/Node.src/M000032.html000066400000000000000000000040771125261632700270700ustar00rootroot00000000000000 new (EstraierPure::Node)
# File estraierpure.rb, line 969
    def initialize()
      @url = nil
      @pxhost = nil
      @pxport = -1
      @timeout = -1
      @auth = nil
      @name = nil
      @label = nil
      @dnum = -1
      @wnum = -1
      @size = -1.0
      @admins = nil
      @users = nil
      @links = nil
      @wwidth = 480
      @hwidth = 96
      @awidth = 96
      @status = -1
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/NodeResult.html000066400000000000000000000125571125261632700266420ustar00rootroot00000000000000 Class: EstraierPure::NodeResult
Class EstraierPure::NodeResult
In: estraierpure.rb
Parent: Object

Abstraction of result set from node.

Methods

doc_num   get_doc   hint   new  

Public Class methods

Create a node result object.

Public Instance methods

Get the number of documents. The return value is the number of documents.

Get the value of hint information. The return value is a result document object or `nil’ if the index is out of bounds.

Get the value of hint information. `key’ specifies the key of a hint. "VERSION", "NODE", "HIT", "HINT#n", "DOCNUM", "WORDNUM", "TIME", "TIME#n", "LINK#n", and "VIEW" are provided for keys. The return value is the hint or `nil’ if the key does not exist.

hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/NodeResult.src/000077500000000000000000000000001125261632700265305ustar00rootroot00000000000000hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/NodeResult.src/M000033.html000066400000000000000000000014071125261632700302620ustar00rootroot00000000000000 doc_num (EstraierPure::NodeResult)
# File estraierpure.rb, line 472
    def doc_num()
      @docs.length
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/NodeResult.src/M000034.html000066400000000000000000000031201125261632700302550ustar00rootroot00000000000000 get_doc (EstraierPure::NodeResult)
# File estraierpure.rb, line 477
    def get_doc(index)
      Utility::check_types({ index=>Integer }) if $DEBUG
      return nil if index < 0 || index >= @docs.length
      @docs[index]
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/NodeResult.src/M000035.html000066400000000000000000000022011125261632700302550ustar00rootroot00000000000000 hint (EstraierPure::NodeResult)
# File estraierpure.rb, line 486
    def hint(key)
      Utility::check_types({ key=>String }) if $DEBUG
      @hints[key]
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/NodeResult.src/M000036.html000066400000000000000000000026101125261632700302620ustar00rootroot00000000000000 new (EstraierPure::NodeResult)
# File estraierpure.rb, line 495
    def initialize(docs, hints)
      Utility::check_types({ docs=>Array, hints=>Hash }) if $DEBUG
      @docs = docs
      @hints = hints
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/ResultDocument.html000066400000000000000000000154131125261632700275250ustar00rootroot00000000000000 Class: EstraierPure::ResultDocument
Class EstraierPure::ResultDocument
In: estraierpure.rb
Parent: Object

Abstraction of document in result set.

Methods

attr   attr_names   keywords   new   snippet   uri  

Public Class methods

Create a result document object.

Public Instance methods

Get the value of an attribute. The return value is the value of the attribute or `nil’ if it does not exist.

Get an array of attribute names. The return value is an array object of attribute names.

Get keywords. The return value is a string of serialized keywords of the result document object. There are tab separated values. Keywords and their scores come alternately.

Get the snippet of a result document object. The return value is a string of the snippet of the result document object. There are tab separated values. Each line is a string to be shown. Though most lines have only one field, some lines have two fields. If the second field exists, the first field is to be shown with highlighted, and the second field means its normalized form.

Get the URI. The return value is the URI of the result document object.

hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/ResultDocument.src/000077500000000000000000000000001125261632700274215ustar00rootroot00000000000000hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/ResultDocument.src/M000037.html000066400000000000000000000013261125261632700311570ustar00rootroot00000000000000 uri (EstraierPure::ResultDocument)
# File estraierpure.rb, line 420
    def uri()
      @uri
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/ResultDocument.src/M000038.html000066400000000000000000000014721125261632700311620ustar00rootroot00000000000000 attr_names (EstraierPure::ResultDocument)
# File estraierpure.rb, line 425
    def attr_names()
      @attrs.keys.sort
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/ResultDocument.src/M000039.html000066400000000000000000000022101125261632700311520ustar00rootroot00000000000000 attr (EstraierPure::ResultDocument)
# File estraierpure.rb, line 430
    def attr(name)
      Utility::check_types({ name=>String }) if $DEBUG
      @attrs[name]
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/ResultDocument.src/M000040.html000066400000000000000000000013421125261632700311470ustar00rootroot00000000000000 snippet (EstraierPure::ResultDocument)
# File estraierpure.rb, line 439
    def snippet()
      @snippet
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/ResultDocument.src/M000041.html000066400000000000000000000013451125261632700311530ustar00rootroot00000000000000 keywords (EstraierPure::ResultDocument)
# File estraierpure.rb, line 445
    def keywords()
      @keywords
    end
hyperestraier-1.4.13/doc/rubypureapi/classes/EstraierPure/ResultDocument.src/M000042.html000066400000000000000000000036761125261632700311650ustar00rootroot00000000000000 new (EstraierPure::ResultDocument)
# File estraierpure.rb, line 453
    def initialize(uri, attrs, snippet, keywords)
      Utility::check_types({ uri=>String, attrs=>Hash,
                             snippet=>String, keywords=>String }) if $DEBUG
      @uri = uri
      @attrs = attrs
      @snippet = snippet
      @keywords = keywords
    end
hyperestraier-1.4.13/doc/rubypureapi/created.rid000066400000000000000000000000351125261632700217140ustar00rootroot00000000000000Tue Dec 25 10:53:42 JST 2007 hyperestraier-1.4.13/doc/rubypureapi/files/000077500000000000000000000000001125261632700207115ustar00rootroot00000000000000hyperestraier-1.4.13/doc/rubypureapi/files/estraierpure_rb.html000066400000000000000000000153451125261632700250040ustar00rootroot00000000000000 File: estraierpure.rb

estraierpure.rb

Path: estraierpure.rb
Last Update: Thu Apr 12 10:52:50 JST 2007

Pure Ruby Interface of Hyper Estraier

Hyper Estraier is a full-text search system for communities.

Introduction

This is a package implementing the node API of Hyper Estraier. This is a pure ruby package. So, it works on Linux, Mac OS X, Windows, and so on. It does not depend on the core library of Hyper Estraier. Applications are implemented as clients of node servers running on local or remote machines. This package requires Ruby 1.8.4 or later versions.

Though Hyper Estraier itself is released under the terms of the GNU LGPL, this package is released under the terms of a BSD-style license.

Setting

Get the package of the latest version of Hyper Estraier.

Extract the package and enter the sub directory `rubypure’ and perform installation.

 cd rubypure
 ./configure
 make
 su
 make install

The package `estraierpure’ should be required in each source file of application programs and include the module `EstraierPure’ at pleasure.

Example of Gatherer

The following is the simplest implementation of a gatherer.

 require "estraierpure"
 include EstraierPure

 # create and configure the node connecton object
 node = Node::new
 node.set_url("http://localhost:1978/node/test1")
 node.set_auth("admin", "admin")

 # create a document object
 doc = Document::new

 # add attributes to the document object
 doc.add_attr("@uri", "http://estraier.gov/example.txt")
 doc.add_attr("@title", "Over the Rainbow")

 # add the body text to the document object
 doc.add_text("Somewhere over the rainbow.  Way up high.")
 doc.add_text("There's a land that I heard of once in a lullaby.")

 # register the document object to the node
 unless node.put_doc(doc)
   STDERR.printf("error: %d\n", node.status)
 end

Example of Searcher

The following is the simplest implementation of a searcher.

 require "estraierpure"
 include EstraierPure

 # create and configure the node connecton object
 node = Node::new
 node.set_url("http://localhost:1978/node/test1")

 # create a search condition object
 cond = Condition::new

 # set the search phrase to the search condition object
 cond.set_phrase("rainbow AND lullaby")

 # get the result of search
 nres = node.search(cond, 0);
 if nres
   # for each document in the result
   for i in 0...nres.doc_num
     # get a result document object
     rdoc = nres.get_doc(i)
     # display attributes
     value = rdoc.attr("@uri")
     printf("URI: %s\n", value) if value
     value = rdoc.attr("@title")
     printf("Title: %s\n", value) if value
     # display the snippet text */
     printf("%s", rdoc.snippet)
   end
 else
   STDERR.printf("error: %d\n", node.status)
 end

License

 Copyright (C) 2004-2006 Mikio Hirabayashi
 All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of Mikio Hirabayashi nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Required files

uri   cgi   socket   stringio  
hyperestraier-1.4.13/doc/rubypureapi/fr_class_index.html000066400000000000000000000017771125261632700234740ustar00rootroot00000000000000 Classes hyperestraier-1.4.13/doc/rubypureapi/fr_file_index.html000066400000000000000000000012301125261632700232660ustar00rootroot00000000000000 Files hyperestraier-1.4.13/doc/rubypureapi/fr_method_index.html000066400000000000000000000175261125261632700236460ustar00rootroot00000000000000 Methods

Methods

add_attr (EstraierPure::Condition)
add_attr (EstraierPure::Document)
add_hidden_text (EstraierPure::Document)
add_text (EstraierPure::Document)
admins (EstraierPure::Node)
attr (EstraierPure::ResultDocument)
attr (EstraierPure::Document)
attr_names (EstraierPure::Document)
attr_names (EstraierPure::ResultDocument)
attrs (EstraierPure::Condition)
auxiliary (EstraierPure::Condition)
cache_usage (EstraierPure::Node)
cat_texts (EstraierPure::Document)
distinct (EstraierPure::Condition)
doc_num (EstraierPure::NodeResult)
doc_num (EstraierPure::Node)
dump_draft (EstraierPure::Document)
edit_doc (EstraierPure::Node)
etch_doc (EstraierPure::Node)
etch_doc_by_uri (EstraierPure::Node)
get_doc (EstraierPure::Node)
get_doc (EstraierPure::NodeResult)
get_doc_attr (EstraierPure::Node)
get_doc_attr_by_uri (EstraierPure::Node)
get_doc_by_uri (EstraierPure::Node)
hint (EstraierPure::NodeResult)
id (EstraierPure::Document)
keywords (EstraierPure::ResultDocument)
keywords (EstraierPure::Document)
label (EstraierPure::Node)
links (EstraierPure::Node)
mask (EstraierPure::Condition)
max (EstraierPure::Condition)
name (EstraierPure::Node)
new (EstraierPure::Node)
new (EstraierPure::NodeResult)
new (EstraierPure::Condition)
new (EstraierPure::ResultDocument)
new (EstraierPure::Document)
optimize (EstraierPure::Node)
options (EstraierPure::Condition)
order (EstraierPure::Condition)
out_doc (EstraierPure::Node)
out_doc_by_uri (EstraierPure::Node)
phrase (EstraierPure::Condition)
put_doc (EstraierPure::Node)
score (EstraierPure::Document)
search (EstraierPure::Node)
set_auth (EstraierPure::Node)
set_auxiliary (EstraierPure::Condition)
set_distinct (EstraierPure::Condition)
set_keywords (EstraierPure::Document)
set_link (EstraierPure::Node)
set_mask (EstraierPure::Condition)
set_max (EstraierPure::Condition)
set_options (EstraierPure::Condition)
set_order (EstraierPure::Condition)
set_phrase (EstraierPure::Condition)
set_proxy (EstraierPure::Node)
set_score (EstraierPure::Document)
set_skip (EstraierPure::Condition)
set_snippet_width (EstraierPure::Node)
set_timeout (EstraierPure::Node)
set_url (EstraierPure::Node)
set_user (EstraierPure::Node)
size (EstraierPure::Node)
skip (EstraierPure::Condition)
snippet (EstraierPure::ResultDocument)
status (EstraierPure::Node)
sync (EstraierPure::Node)
texts (EstraierPure::Document)
uri (EstraierPure::ResultDocument)
uri_to_id (EstraierPure::Node)
users (EstraierPure::Node)
word_num (EstraierPure::Node)
hyperestraier-1.4.13/doc/rubypureapi/index.html000066400000000000000000000013431125261632700216050ustar00rootroot00000000000000 estraierpure hyperestraier-1.4.13/doc/rubypureapi/rdoc-style.css000066400000000000000000000103321125261632700224050ustar00rootroot00000000000000 body { font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 90%; margin: 0; margin-left: 40px; padding: 0; background: white; } h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; } h1 { font-size: 150%; } h2,h3,h4 { margin-top: 1em; } a { background: #eef; color: #039; text-decoration: none; } a:hover { background: #039; color: #eef; } /* Override the base stylesheet's Anchor inside a table cell */ td > a { background: transparent; color: #039; text-decoration: none; } /* and inside a section title */ .section-title > a { background: transparent; color: #eee; text-decoration: none; } /* === Structural elements =================================== */ div#index { margin: 0; margin-left: -40px; padding: 0; font-size: 90%; } div#index a { margin-left: 0.7em; } div#index .section-bar { margin-left: 0px; padding-left: 0.7em; background: #ccc; font-size: small; } div#classHeader, div#fileHeader { width: auto; color: white; padding: 0.5em 1.5em 0.5em 1.5em; margin: 0; margin-left: -40px; border-bottom: 3px solid #006; } div#classHeader a, div#fileHeader a { background: inherit; color: white; } div#classHeader td, div#fileHeader td { background: inherit; color: white; } div#fileHeader { background: #057; } div#classHeader { background: #048; } .class-name-in-header { font-size: 180%; font-weight: bold; } div#bodyContent { padding: 0 1.5em 0 1.5em; } div#description { padding: 0.5em 1.5em; background: #efefef; border: 1px dotted #999; } div#description h1,h2,h3,h4,h5,h6 { color: #125;; background: transparent; } div#validator-badges { text-align: center; } div#validator-badges img { border: 0; } div#copyright { color: #333; background: #efefef; font: 0.75em sans-serif; margin-top: 5em; margin-bottom: 0; padding: 0.5em 2em; } /* === Classes =================================== */ table.header-table { color: white; font-size: small; } .type-note { font-size: small; color: #DEDEDE; } .xxsection-bar { background: #eee; color: #333; padding: 3px; } .section-bar { color: #333; border-bottom: 1px solid #999; margin-left: -20px; } .section-title { background: #79a; color: #eee; padding: 3px; margin-top: 2em; margin-left: -30px; border: 1px solid #999; } .top-aligned-row { vertical-align: top } .bottom-aligned-row { vertical-align: bottom } /* --- Context section classes ----------------------- */ .context-row { } .context-item-name { font-family: monospace; font-weight: bold; color: black; } .context-item-value { font-size: small; color: #448; } .context-item-desc { color: #333; padding-left: 2em; } /* --- Method classes -------------------------- */ .method-detail { background: #efefef; padding: 0; margin-top: 0.5em; margin-bottom: 1em; border: 1px dotted #ccc; } .method-heading { color: black; background: #ccc; border-bottom: 1px solid #666; padding: 0.2em 0.5em 0 0.5em; } .method-signature { color: black; background: inherit; } .method-name { font-weight: bold; } .method-args { font-style: italic; } .method-description { padding: 0 0.5em 0 0.5em; } /* --- Source code sections -------------------- */ a.source-toggle { font-size: 90%; } div.method-source-code { background: #262626; color: #ffdead; margin: 1em; padding: 0.5em; border: 1px dashed #999; overflow: hidden; } div.method-source-code pre { color: #ffdead; overflow: hidden; } /* --- Ruby keyword styles --------------------- */ .standalone-code { background: #221111; color: #ffdead; overflow: hidden; } .ruby-constant { color: #7fffd4; background: transparent; } .ruby-keyword { color: #00ffff; background: transparent; } .ruby-ivar { color: #eedd82; background: transparent; } .ruby-operator { color: #00ffee; background: transparent; } .ruby-identifier { color: #ffdead; background: transparent; } .ruby-node { color: #ffa07a; background: transparent; } .ruby-comment { color: #b22222; font-weight: bold; background: transparent; } .ruby-regexp { color: #ffa07a; background: transparent; } .ruby-value { color: #7fffd4; background: transparent; }hyperestraier-1.4.13/doc/uguide-en.html000066400000000000000000001527441125261632700200250ustar00rootroot00000000000000 User's Guide of Hyper Estraier Version 1

User's Guide

Copyright (C) 2004-2007 Mikio Hirabayashi
Last Update: Tue, 06 Mar 2007 12:05:18 +0900

Table of Contents

  1. Introduction
  2. Attributes
  3. File Formats
  4. Search Conditions
  5. Administration Command
  6. CGI Script for Search
  7. CGI Script for Highlight

Introduction

This guide describes detail of how to use applications of Hyper Estraier. If you have never read the introduction document, please read it beforehand.

Hyper Estraier is a full-text search system using index database. So, before search, it is needed to prepare an index into which target documents have been registered. Hyper Estraier provides the administration command `estcmd' and the CGI script `estsearch.cgi' for search. The former is used in order to administrate the index by command line interface. The latter is used in order to search the index for documents with a web browser.

estcmd can handle various file formats and features various operations to administrate index. How to use it is described in this guide.

Hyper Estraier supports such various methods for search as combining some search phrase and search with attributes of documents. Moreover, it is possible to customize presentation according to the configuration of estseek.cgi. How to do it is described in this guide.


Attributes

Not only information of the body text but also such attributes as the title, the modification date, and so on can be added to documents handled by Hyper Estraier. Attributes are used for such various purposes as search with attributes and determination of difference updating.

Attribute Name

Any attribute has a name. As the name can be determined arbitrarily, some names are reserved for being used as system attributes. Names of system attributes begin with "@". There are the following system attributes.

  • @id : the ID number determined automatically when the document is registered.
  • @uri : the location of a document which any document should have.
  • @digest : the message digest calculated automatically when the document is registered.
  • @cdate : the creation date.
  • @mdate : the last modification date.
  • @adate : the last access date.
  • @title : the title used as a headline in the search result.
  • @author : the author.
  • @type : the media type.
  • @lang : the language.
  • @genre : the genre.
  • @size : the size.
  • @weight : the scoring weight.
  • @misc : miscellaneous information.

The other attributes except for system attributes are called user-defined attributes. They can be defined by document draft said later. Meta attributes in HTML and headers of MIME are also treated as user-defined attributes. Any attribute name should not begin with "%".

Attribute Type

There are two data types for attributes; string and number. Data of the string type are arbitrary strings. There are such operations as full matching, forward matching, backward matching, partial matching. Data of the number type are numbers or date information. A string of the number type is converted into the number and calculated according to the following formats. If the format is for date, the value is computed based on the UNIX epoch (1 Jan 1970).

  • If all characters are digits, it is computed as a decimal number.
  • If it begins with "0x", it is computed as a hexadecimal number.
  • If it conforms to W3CDTF (e.g. 1978-02-11T18:05:32+09:00), it is computed as a date.
  • If it conforms to RFC822 (e.g. Sat, 11 Feb 1978 18:05:32 +0900), it is computed as a date.
  • If it is in YYYY/MM/DD format (e.g. 1978/02/11 18:05:32), it is computed as a date.
  • Else, it is computed as -1.

The data type is not determined when registration. It is determined when search. Length of the value of an attribute is not limited.

Attributes and the body text of a document should be expressed in UTF-8 encoding. If another encoding is used, it should be converted into UTF-8. By the way, estcmd detect the encoding automatically if it is not clearly specified.

estcmd defines the URI attribute begins with "file://" for each document. However, if a document defines its own URI, it comes first. The URI of the local file system is defined as an attribute whose name is "_lpath". The absolute path on the local file system is defined as an attribute whose name is "_lreal". The file name is normalized to UTF-8 is defined as an attribute whose name is "_lfile". The encoding of the value of each attribute is normalized as UTF-8. Attributes whose name begins with "_" are hidden in detail display by estseek.cgi.


File Formats

estcmd handles four file formats. This section describes how the four are processed.

Plain Text

A document of plain-text is composed of strings with no structure. By default, files whose names end with ".txt", ".text", or ".asc" are treated as plain-text.

  • The character encoding is detected automatically.
  • "text/plain" is recorded as the "@type" attribute.
  • The file size is recorded as the "@size" attribute.

HTML

As we all know, a document of HTML is used as a hyper-text on the Web. By default, files whose names end with ".html", ".htm", "xhtml", or ".xht" are treated as HTML.

  • The character encoding is detected automatically. But, if the encoding is specified by a "meta" attribute, it comes first.
  • If there is a "title" attribute, its content is recorded as the "@title" attribute.
  • If the "name" attribute of a "meta" element specifies "author", the value of the "content" attribute is recorded as the "@author" attribute.
  • If the "html" element has the "lang" or "xml:lang" attribute, the value is recorded as the "@lang" attribute.
  • "text/html" is recorded as the "@type" attribute.
  • The file size is recorded as the "@size" attribute.
  • If the "name" or the "http-equiv" is specified in a "meta" element, the value of the "content" attribute is recorded as an attribute whose name is converted from the value of them into lower cases.
  • The value of the attribute "@title" is treated as a hidden text.

MIME (e-mail)

MIME is used for communication by e-mail based on RFC822 and so on. By default, files whose names end with ".eml", ".mime", ".mht", or ".mhtml" are treated as HTML.

  • The character encoding is detected automatically. But, if the encoding is specified by the "Content-Type" header, it comes first.
  • If the "Subject" header is, the value is recorded as the "@title" attribute.
  • If the "From" header is, the value is recorded as the "@author" attribute.
  • If the "Date" header is, the value is recorded as the "@cdate" attribute and the "@mdate" attribute.
  • "message/rfc822" is recorded as the "@type" attribute.
  • The file size is recorded as the "@size" attribute.
  • The value of each header is recorded as an attribute whose name is converted from the header name into lower cases.
  • The value of the attribute "@title" is treated as a hidden text.

If the content of each part of multipart is "text/plain", "text/html", or "message/rfc822", the content is treated as a part of the body text so that web archive can be supported.

Document Draft

Document draft is a original format of Hyper Estraier. It is possible to handle various formats in the integrative way by using document draft as intermediate format. By default, files whose names end with ".est" are treated as document draft.

Though format of document draft is similar to RFC822, detail points differ. The delimiter for headers is not ":" but "=". Moreover, no space character is needed after "=". The following is an example data to handle a MIDI document.

@uri=http://www.music-estraier.com/mididb/t/tw/twinkle.kar
@title=Twinkle Twinkle Little Star
@author=Jane Taylor
@cdate=2004-11-01T23:11:18+09:00
@mdate=2005-03-21T08:07:45+09:00
category=chorus,dance

Twinkle, twinkle, little star,
How I wonder what you are.
Up above the world so high,
Like a diamond in the sky.
Twinkle, twinkle, little star,
How I wonder what you are!
        Twinkle Twinkle Little Star
        Jane Taylor

The following specifications are required for document draft.

  • It is composed of valid UTF-8 strings.
  • Line feeds are one of UNIX style (LF) or DOS style (CR+LF).
  • There are the attribute section and the text section and they are separated by the first empty line.
  • Each line in the attribute section specifies an attribute. The name and the value is separated by the first "=".
  • Each line in the text section specifies a sentence of the body text. If a line begins with a tab character, the line is treated as a hidden text.

In the attribute section, lines which begin with "%" are regarded as control commands and are ignored. Lines which begin with "%VECTOR" trailed by a tab express keyword vectors. The format of the keyword vector is TSV. Keywords and their scores come alternately. Lines which begin with "%SCORE" trailed by a tab express the substitute score.

A hidden text is the same as normal text except not displayed in the snippet of the result. It is useful to search with some attributes.


Search Conditions

Two kinds of search conditions are supported. One is for full-text search and the other is for attribute search. If both are specified at the same time, documents corresponding to the both are searched for. Moreover, usual form, simplified form and so on are supported for full-text search condition.

Full-text Search Conditions

The purpose of full-text search expression is to search for documents including some specified words. For example, if you search for documents including a word "computer", specify "computer" in the search phrase as it is.

You can specify two or more words. For example, if you specify "United Nations", documents including "united" followed by "nations" are searched for. In case of simplified form, specify the following.

"united nations"

Intersection operation is supported by the "AND" operator. For example, if you specify "internet AND security", documents including both of "internet" and "security" are searched for. In case of simplified form, specify the following.

internet security

Difference operation is supported by the "ANDNOT" operator. For example, if you specify "hacker ANDNOT cracker", documents including "hacker" but not including "cracker" are searched for. In case of simplified form, specify the following.

hacker ! cracker

Union operation is supported by the "OR" operator. For example, if you specify "proxy OR firewall", documents including one or both of "proxy" and "firewall" are searched for. In case of simplified form, specify the following.

proxy | firewall

Note that the priority of "OR" is higher than ones of "AND" and "ANDNOT". For example, if you specify "F1 OR F-1 OR Formula One AND Champion OR Victory", documents including one or both of "f1", "f-1", and "formula one", and including one or both of "champion" and "victory". In case of simplified form, specify the following.

F1 | F-1 | "Formula One" Champion | Victory

Search words are case insensitive. However, operators are case sensitive. If you want to search for documents including "AND", specify "and" instead.

Wild card is also supported. It can be used for forward match search and backward match search. For example, "[BW] euro" matches words which begin with "euro". "[EW] shere" matches words which end with "sphere". Moreover, regular expression is also supported. For example, "[RX] ^inter.*al$" matches words which begin with "inter" and end with "al". In case of simplified form, "euro*", "*sphere", and "*^inter.*al$*" are used instead.

Attribute Search Conditions

The purpose of attribute search expression is to search for documents whose attributes are corresponding to the specified expression. An expression of attribute search is composed of an attribute name, an operator, and a value. They are separated with space characters. For example, if you specify "@title STRINC IMPORTANT", documents whose title includes "IMPORTANT". The following operators for attribute search are supported.

  • STREQ : is equal to the string
  • STRNE : is not equal to the string
  • STRINC : includes the string
  • STRBW : begins with the string
  • STREW : ends with the string
  • STRAND : includes all tokens in the string
  • STROR : includes at least one token in the string
  • STROREQ : is equal to at least one token in the string
  • STRRX : matches regular expressions of the string
  • NUMEQ : is equal to the number or date
  • NUMNE : is not equal to the number or date
  • NUMGT : is greater than the number or date
  • NUMGE : is greater than or equal to the number or date
  • NUMLT : is less than the number or date
  • NUMLE : is less than or equal to the number or date
  • NUMBT : is between the two numbers or dates

If an operator is leaded by "!", the meaning is inverted. If an operator is leaded by "I", case of the value is ignored. If no operator is specified, all documents with the attribute correspond regardless of the value. STRAND, STROR, STROREQ, and NUMBT take plural parameters separated by space. Range of NUMBT is inclusive of border values. Two or more attribute names can be listed with separated by "," to mean logical addition.

Order of the Result

You can specify the order of the result by an expression. An ordering expression is composed of an attribute name and an operator. For example, if you specify "@size NUMA", documents in the result are in ascending order of the size. The following operators for ordering are supported.

  • STRA : ascending by string
  • STRD : descending by string
  • NUMA : ascending by number or date
  • NUMD : descending by number or date

By default, the order of the result is descending by score. The score is calculated by the number of specified words in each document.

Other Faculties

estseek.cgi provides other faculties also. "[...] per page" in the form is to specify the number of shown documents per page. If documents over one page correspond, you can move to another page via anchors of "PREV" and "NEXT" at the bottom of the page. "clip by [...]" in the form is to specify strength of clipping similar documents. It is useful if too similar documents occupy the page. Each of "[detail]" links in the result is to show detail information. Each of "[similar]" links in the result is to search for similar documents. Each of "[include]" links in the result is to include clipped documents.

Search phrase has other kinds of formats; rough form, union form, and intersection form. Though rough form is similar to simplified form, negative conditions are specified by tokens leaded by "-". Union form specifies only union conditions by tokens. Intersection form specifies only intersection conditions by tokens. These forms do not support wild card nor other special operators.


Administration Command

This section describes specification of estcmd. estcmd can do not only indexing but also search.

Synopsis and Description

estcmd is an aggregation of sub commands. The name of a sub command is specified by the first argument. Other arguments are parsed according to each sub command. The argument db specifies the path of an index.

estcmd create [-tr] [-apn|-acc] [-xs|-xl|-xh|-xh2|-xh3] [-sv|-si|-sa] [-attr name type] db
Create an index.
If -tr is specified, a new index is created regardless if one exists.
If -apn is specified, N-gram analysis is performed against European text also.
If -acc is specified, character category analysis is performed instead of N-gram analysis.
If -xs is specified, the index is tuned to register less than 50000 documents.
If -xl is specified, the index is tuned to register more than 300000 documents.
If -xh is specified, the index is tuned to register more than 1000000 documents.
If -xh2 is specified, the index is tuned to register more than 5000000 documents.
If -xh3 is specified, the index is tuned to register more than 10000000 documents.
If -sv is specified, scores are stored as void.
If -si is specified, scores are stored as 32-bit integer.
If -sa is specified, scores are stored as-is and marked not to be tuned when search.
-attr specifies an attribute index and its data type. This option can be specified multiple times.
estcmd put [-tr] [-cl] [-ws] [-apn|-acc] [-xs|-xl|-xh|-xh2|-xh3] [-sv|-si|-sa] db [file]
Register a document of document draft to an index.
file specifies a target file. If it is omitted, the standard input is read.
If -tr is specified, a new index is created regardless if one exists.
If -cl is specified, regions of a overwritten document are cleaned up.
If -ws is specified, scores are weighted statically with score weighting attribute.
If -apn is specified, N-gram analysis is performed against European text also.
If -acc is specified, character category analysis is performed instead of N-gram analysis.
If -xs is specified, the index is tuned to register less than 50000 documents.
If -xl is specified, the index is tuned to register more than 300000 documents.
If -xh is specified, the index is tuned to register more than 1000000 documents.
If -xh2 is specified, the index is tuned to register more than 5000000 documents.
If -xh3 is specified, the index is tuned to register more than 10000000 documents.
If -sv is specified, scores are stored as void.
If -si is specified, scores are stored as 32-bit integer.
If -sa is specified, scores are stored as-is and marked not to be tuned when search.
estcmd out [-cl] [-pc enc] db expr
Remove information of a document from an index.
expr specifies the ID number, the URI, or the local path of a document.
If -cl is specified, regions of the document are cleaned up.
-pc specifies the encoding of file paths. By default, it is ISO-8859-1.
estcmd edit [-pc enc] db expr name [value]
Edit an attribute of a document in an index.
expr specifies the ID number, the URI, or the local path of a document.
name specifies the name of an attribute.
value specifies the value of the attribute. If it is omitted, the attribute is removed.
-pc specifies the encoding of the file path and the attribute value. By default, it is ISO-8859-1.
estcmd get [-nl|-nb] [-pidx path] [-pc enc] db expr [attr]
Output document draft of a document in an index.
expr specifies the ID number, the URI, or the local path of a document.
If attr is specified, only the value of the attribute is output.
If -nl is specified, the index is opened without file locking.
If -nb is specified, file locking is performed without blocking.
-pidx specifies the path of a pseudo index. This option can be specified multiple times.
-pc specifies the encoding of file paths. By default, it is ISO-8859-1.
estcmd list [-nl|-nb] [-lp] db
Output a list of all document in an index.
If -nl is specified, the index is opened without file locking.
If -nb is specified, file locking is performed without blocking.
If -lp is specified, local path equivalent to URL of "file://" is output.
estcmd uriid [-pidx path] [-nl|-nb] [-pc enc] db expr
Output the ID number of a document specified by URI.
expr specifies the URI or the local path of a document.
If -nl is specified, the index is opened without file locking.
If -nb is specified, file locking is performed without blocking.
-pidx specifies the path of a pseudo index. This option can be specified multiple times.
-pc specifies the encoding of file paths. By default, it is ISO-8859-1.
estcmd meta db [name [value]]
Handle meta data.
name specifies the name of a piece of meta data. If it is omitted, a list of all names is output.
value specifies the value of the meta data to be recorded. If it is omitted, the current value is output. If it is an empty string, the meta data is removed.
estcmd inform [-nl|-nb] db
Output the number of documents and the number of unique words in an index.
If -nl is specified, the index is opened without file locking.
If -nb is specified, file locking is performed without blocking.
estcmd optimize [-onp] [-ond] db
Optimize an index and clean up dispensable regions.
If -onp is specified, it is omitted to clean up dispensable regions.
If -ond is specified, it is omitted to optimize the database files.
estcmd merge [-cl] db target
Merge another index.
target specifies the path of another index.
If -cl is specified, regions of overwritten documents are cleaned up.
estcmd repair [-rst|-rsh] db
Repair a broken index.
If -rst is specified, strict consistency check is performed.
If -rsh is specified, consistency check is omitted.
estcmd search [-nl|-nb] [-pidx path] [-ic enc] [-vu|-va|-vf|-vs|-vh|-vx|-dd] [-sn wnum hnum anum] [-kn num] [-ec rn] [-gs|-gf|-ga] [-cd] [-ni] [-sf|-sfr|-sfu|-sfi] [-hs] [-attr expr] [-ord expr] [-max num] [-sk num] [-aux num] [-dis name] [-sim id] db [phrase]
Search an index for documents.
phrase specifies the search phrase.
If -nl is specified, the index is opened without file locking.
If -nb is specified, file locking is performed without blocking.
-pidx specifies the path of a pseudo index. This option can be specified multiple times.
-ic specifies the input encoding. By default, it is UTF-8.
If -vu is specified, TSV of ID number and URI are output.
If -va is specified, multipart format including attributes is output.
If -vf is specified, multipart format including document draft is output.
If -vs is specified, multipart format including attributes and snippets is output.
If -vh is specified, human readable format including attributes and snippets is output.
If -vx is specified, XML including including attributes and snippets is output.
If -dd is specified, document draft data are dumped and saved into separated files.
-sn specifies the number of whole width of snippet and width of strings picked up from the beginning of the text and width of strings picked up around each highlighted word.
-kn specifies the number of keywords to be extracted. By default, keyword extraction is not performed.
If -um is specified, morphological analyzers are used for keyword extraction.
-ec specifies lower limit of similarity eclipse. If it is negative, similarity is weighted by URL. "serv" specifies server basis. "dir" specifies directory basis. "file" specifies file basis.
If -gs is specified, every key of N-gram is checked. By default, it is alternately.
If -gf is specified, keys of N-gram are checked every three.
If -ga is specified, keys of N-gram are checked every four.
If -cd is specified, whether documents match the search phrase definitely is checked.
If -ni is specified, TF-IDF tuning is omitted.
If -sf is specified, the phrase is treated as a simplified form.
If -sfr is specified, the phrase is treated as a rough form.
If -sfu is specified, the phrase is treated as a union form.
If -sfi is specified, the phrase is treated as an intersection form.
If -hs is specified, score information is output as an attribute.
-attr specifies an attribute search condition. This option can be specified multiple times.
-ord specifies the order expression. By default, it is descending by score.
-max specifies the maximum number of shown documents. Negative means unlimited. By default, it is 10.
-sk specifies the number of documents to be skipped. By default, it is 0.
-aux specifies permission to adopt result of the auxiliary index. If it is not more than 0, the auxiliary index is not used. By default, it is 32.
-dis specifies the name of the distinct attribute.
-sim specifies the ID number of the seed document for similarity search.
estcmd gather [-tr] [-cl] [-ws] [-no] [-fe|-ft|-fh|-fm] [-fx sufs cmd] [-fz] [-fo] [-rm sufs] [-ic enc] [-il lang] [-bc] [-lt num] [-lf num] [-pc enc] [-px name] [-aa name value] [-apn|-acc] [-xs|-xl|-xh|-xh2|-xh3] [-sv|-si|-sa] [-ss name] [-sd] [-cm] [-cs num] [-ncm] [-kn num] [-um] db [file|dir]
Scan the local file system and register documents into an index.
If the third argument is the name of a file, a list of paths of target documents are read from it. If it is "-", the standard input is specified.
If the third argument is the name of a directory. All files under the directory are treated as target documents.
If -tr is specified, a new index is created regardless if one exists.
If -cl is specified, regions of overwritten documents are cleaned up.
If -ws is specified, scores are weighted statically with score weighting attribute.
If -no is specified, operations are printed but not executed actually.
If -fe is specified, target files are treated as document draft. By default, the format is detected by the suffix of each document.
If -ft is specified, target files are treated as plain text.
If -fh is specified, target files are treated as HTML.
If -fm is specified, target files are treated as MIME.
If -fx is specified, target files with the specified suffixes are processed by the specified outer command. "*" matches any file. If the command is leaded by "T@", the output of the command is treated as plain text. If the command is leaded by "H@", the output of the command is treated as HTML. If the command is leaded by "M@", the output of the command is treated as MIME. Else, the output is treated as document draft. This option can be specified multiple times.
If -fz is specified, documents which do not corresponding to the condition of -fx are ignored.
If -fo is specified, target files are not read. It is useful for efficient process of the outer command.
If -rm is specified, target files with the specified suffixes are removed. "*" matches any file. This option can be specified multiple times.
-ic specifies the input encoding. By default, it is detected automatically.
-il specifies the preferred input language. By default, English is preferred.
If -bc is specified, binary files are detected and ignored.
-lt specifies the text size limitation by kilobytes. By default, it is 128KB. If it is negative, the size is unlimited.
-lf specifies the file size limitation by megabytes. By default, it is 32MB. If it is negative, the size is unlimited.
-pc specifies the encoding of file paths. By default, it is ISO-8859-1.
-px specifies the name of an attribute read from the list of paths. As the list of paths can be in TSV format, the first field is treated as the path of a target document, the second field and the followers are definitions of attribute values. -px specifies the name of each values of the second field and the followers. This option can be specified multiple times.
-aa specifies the name and the value of an additional attribute. This option can be specified multiple times.
If -apn is specified, N-gram analysis is performed against European text also.
If -acc is specified, character category analysis is performed instead of N-gram analysis.
If -xs is specified, the index is tuned to register less than 50000 documents.
If -xl is specified, the index is tuned to register more than 300000 documents.
If -xh is specified, the index is tuned to register more than 1000000 documents.
If -xh2 is specified, the index is tuned to register more than 5000000 documents.
If -xh3 is specified, the index is tuned to register more than 10000000 documents.
If -sv is specified, scores are stored as void.
If -si is specified, scores are stored as 32-bit integer.
If -sa is specified, scores are stored as-is and marked not to be tuned when search.
-ss specifies the name of an attribute for substitute score.
If -sd is specified, the modification date of each file is recorded as an attribute.
If -cm is specified, documents whose modification date has not changed are ignored.
-cs specifies the size of cache memory by megabytes. By default, it is 64MB.
If -ncm is specified, checking availability of the virtual memory is omitted.
-kn specifies the number of keywords to be extracted. By default, keyword extraction is not performed.
If -um is specified, morphological analyzers are used for keyword extraction.
estcmd purge [-cl] [-no] [-fc] [-pc enc] [-attr expr] db [prefix]
Purge information of documents which do not exist on the file system.
If prefix is specified, only documents whose URIs are begins with it. It can be specified by the local path of a directory.
If -cl is specified, regions of the deleted documents are cleaned up.
If -no is specified, operations are printed but not executed actually.
If -fc is specified, information of all target documents are deleted.
-pc specifies the encoding of file paths. By default, it is ISO-8859-1.
-attr specifies an attribute search condition. This option can be specified multiple times.
estcmd extkeys [-no] [-fc] [-dfdb file] [-ncm] [-ni] [-kn num] [-um] [-attr expr] db [prefix]
Create a database of keywords extracted from documents.
If prefix is specified, only documents whose URIs are begins with it.
If -no is specified, operations are printed but not executed actually.
If -fc is specified, all target documents are processed whichever they have existing records or not.
-dfdb specifies an outher database of document frequency. By default, document frequency is calculated dynamically according to the index.
If -ncm is specified, checking availability of the virtual memory is omitted.
If -ni is specified, TF-IDF tuning is omitted.
-kn specifies the number of keywords to be extracted. By default, it is 32.
If -um is specified, morphological analyzers are used for keyword extraction.
-attr specifies an attribute search condition. This option can be specified multiple times.
estcmd words [-nl|-nb] [-dfdb file] [-kw] db
Output a list of all unique words and each record size which is treated as docuemnt frequency.
If -nl is specified, the index is opened without file locking.
If -nb is specified, file locking is performed without blocking.
-dfdb specifies an outer database where the result is stored. By default, the result is output to the standard output as TSV. If the outer database already exists, the value of each record is incremented.
If -kw is specified, keywords and numbers of corresponding documents are output.
If -kt is specified, keywords and their related terms are output.
estcmd draft [-ft|-fh|-fm] [-ic enc] [-il lang] [-bc] [-lt num] [-kn num] [-um] [file]
For test and debug.
estcmd break [-ic enc] [-il lang] [-apn|-acc] [-wt] [file]
For test and debug.
estcmd iconv [-ic enc] [-il lang] [-oc enc] [file]
For test and debug.
estcmd regex [-inv] [-repl str] expr [file]
For test and debug.
estcmd scandir [-tf|-td] [-pa|-pu] [dir]
For test and debug.
estcmd multi [-db db] [-nl|-nb] [-ic enc] [-gs|-gf|-ga] [-cd] [-ni] [-sf|-sfr|-sfu|-sfi] [-hs] [-hu] [-attr expr] [-ord expr] [-max num] [-sk num] [-aux num] [-dis name] [phrase]
For test and debug.
estcmd randput [-ren|-rla|-reu|-ror|-rjp|-rch] [-cs num] db dnum
For test and debug.
estcmd wicked db dnum
For test and debug.
estcmd regression db
For test and debug.
estcmd version
Show the version information.

All sub commands return 0 if the operation is success, else return 1. As for put, out, gather, purge, randput, wicked, and regression, they finish with closing the database when they catch the signal 1 (SIGHUP), 2 (SIGINT), 3 (SIGQUIT), 13 (SIGPIPE), or 15 (SIGTERM).

The data type of attribute indexes specified by -attr option of create sub command should be "seq" for sequencial type, "str" for string type, or "num" for number type.

Each pseudo index specified by -pidx option of search sub command and so on is a directory containing files of document draft. If you search a main index with pseudo indexes, meta search of the main index and pseudo indexes is performed.

The encoding name specified by -ic option should be such name registered to IETF as UTF-8, ISO-8859-1, and so on. The language name specified by -il option should be one of "en" (English), "ja" (Japanese), "zh" (Chinese), "ko" (Korean).

The outer command specified by -fx option of gather receives the path of the target document by the first argument and the path for output by the second argument. The original path of the target document is given as the value of the environment variable `ESTORIGFILE'.

Note that similarity search is very slow, by default. To improve the performance of similarity search, running "estcmd extkeys" beforehand is strongly recommended.

Examples

The following is to register mail files of mh format.

find /home/mikio/Mail -type f | egrep 'inbox/(business|friends)/[0-9]+$' |
  estcmd gather -cl -fm -cm casket -

The following is to register MS-Office files. estfxmsotohtml requires wvWare and xlhtml.

PATH=$PATH:/usr/local/share/hyperestraier/filter ; export PATH
estcmd gather -cl -fx ".doc,.xls,.ppt" "H@estfxmsotohtml" -fz -sd -cm casket .

The following is to register PDF files. estfxpdftohtml requires pdftotext.

PATH=$PATH:/usr/local/share/hyperestraier/filter ; export PATH
estcmd gather -cl -fx ".pdf" "H@estfxpdftohtml" -fz -sd -cm casket .

The following is to register cache files of WWWOFFLE, a proxy server. estwolefind requires WWWOFFLE.

estwolefind /var/spool/wwwoffle |
  estcmd gather -cl -fm -bc -px @uri -px _lfile -sd -cm casket -

The following is to output the search result as XML.

estcmd search -vx -max 8 casket 'socket AND shutdown'

CGI Script for Search

This section describes specification of estseek.cgi. The subject matter is to write configuration files.

Composition

estseek.cgi needs three configuration files; the prime configuration file, the template file, the top page file, and the help file. Their default names are `estseek.cgi', `estseek.tmpl', `estseek.top', and `estseek.help'.

The name of the prime configuration file is determined by changing the suffix of the CGI script to ".conf". If you change the name of `estseek.cgi' to `estsearch.cgi', `estsearch.conf' is read. Names of the other files are specified in the prime configuration file. So, you can install some sets of search scripts in one directory.

As estseek.cgi is installed as `/usr/local/libexec/estseek.cgi', copy it to a directory for CGI scripts. Moreover, as samples of configurations are installed in `/usr/local/share/hyperestraier/', copy and modify them.

Prime Configuration File

The prime configuration file is composed of lines and the name of an variable and the value separated by ":" are in each line. Lines leaded by "#" are ignored as comments. By default, the following configuration is there.

indexname: casket
tmplfile: estseek.tmpl
topfile: estseek.top
helpfile: estseek.help
lockindex: true
pseudoindex:
replace: ^file:///home/mikio/public_html/{{!}}http://localhost/
replace: /index\.html?${{!}}/
showlreal: false
deftitle: Hyper Estraier: a full-text search system for communities
formtype: normal
perpage: 10 100 10
attrselect: false
#genrecheck: private{{!}}private
#genrecheck: business{{!}}business
#genrecheck: misc{{!}}miscellaneous
attrwidth: 80
showscore: true
extattr: author|Author
extattr: from|From
extattr: to|To
extattr: cc|Cc
extattr: date|Date
snipwwidth: 480
sniphwidth: 96
snipawidth: 96
condgstep: 2
dotfidf: true
scancheck: 3
phraseform: 2
dispproxy:
candetail: true
candir: false
auxmin: 32
smlrvnum: 32
smlrtune: 16 1024 4096
clipview: 2
clipweight: none
relkeynum: 0
spcache:
wildmax: 256
qxpndcmd:
logfile:
logformat: {time}\t{REMOTE_ADDR}:{REMOTE_PORT}\t{cond}\n

Means of each variable is the following.

  • indexname : specifies the name of the index.
  • tmplfile : specifies the path of the template file.
  • topfile : specifies the path the top page file.
  • helpfile : specifies the path the help file.
  • lockindex : specifies whether to perform file locking to the database. "true" or "false".
  • pseudoindex : specifies the path of a pseudo index. This can be more than once.
  • replace : specifies regular expressions and replacement string to convert the URI of each document. Regular expressions and replacement strings are separated by "{{!}}". Each "&" in a replacement string is evolved to the matched string. Special escapes "\1" through "\9" referring to the corresponding matching sub-expressions are also supported. This can be more than once.
  • showlreal : specifies whether to show the absolute path instead of the URI. "true" or "false".
  • deftitle : specifies the default title of the page.
  • formtype : specifies the type of the input form. "normal" for generic purpose, "web", for web site, "file" for file system, or "mail" for mail box.
  • perpage : specifies parameters of the perpage select box; the minimum number, the maximum number, and the step of increment.
  • attrselect : specifies whether to use select boxes for attribute conditions.
  • genrecheck : specifies a check box to narrow by genre attribute. A condition value and a label are separated by "{{!}}". This can be more than once.
  • attrwidth : specifies mamximum width of each shown attribute.
  • showscore : specifies whether to show scores.
  • extattr : specifies an attribute to be shown. The name and the label are separated by "|". This can be more than once.
  • snipwwidth : specifies whole width of the snippet of each shown document.
  • sniphwidth : specifies width of strings picked up from the beginning of the text.
  • snipawidth : specifies width of strings picked up around each highlighted word.
  • condgstep : specifies accuracy of N-gram checking. "1" is to check every key. "2" is to check keys of N-gram are checked every two. "3" is every three. "4" is every four.
  • dotfidf : specifies whether to do TF-IDF score tuning. "true" or "false".
  • scancheck : specifies the number of checked documents by scanning.
  • phraseform : specifies the phrase form. "1" is usual form. "2" is simplified form. "3" is rough form. "4" is union form. "5" is intersection form.
  • dispproxy : specifies the URL of estproxy.cgi to display original pages with highlighted words. "[URI]" is replaced by the URI of each document.
  • candetail : specifies whether to enable detail display of a document. "true" or "false".
  • candir : specifies whether to enable directory display of a document. "true" or "false".
  • auxmin : specifies the minimum hits to adopt result of the auxiliary index. If it is less than 1, the auxiliary index is not used.
  • smlrvnum : specifies the number of keywords for similarity search. If it is less than 1, similarity search is disabled.
  • smlrtune : specifies tuning parameters for similarity search; the number of keywords, the number of documents per keyword, and the number of all candidates are separated by space characters.
  • clipview : specifies the number of clipped documents to be shown. If it is negative, similarity eclipse is disabled.
  • clipweight : specifies weighting algorithm of documents clipping. "none" or "url".
  • relkeynum : specifies the number of related terms to be shown.
  • spcache : specifies the name of an attribute of the special cache.
  • wildmax : specifies the maximum number of expansion of wild cards.
  • qxpndcmd : specifies a command line for query expansion. If it is an empty string, query expansion is disabled.
  • logfile : specifies the path of the log file.
  • logformat : specifies the format of each log data.

Template File

The template file is to determine appearance of the page. It describes HTML and the data is shown as it is. However, "<!--ESTTITLE-->" is replaced by the page title. "<!--ESTFORM-->" is replaced by the form to input search conditions. "<!--ESTRESULT-->" is replaced by the search result. "<!--ESTINFO-->" is replaced by information of the index.

Top Page File

When a user access the CGI script first or if no configuration is input, the content of the top page file is displayed instead of the search result. By default, the banner of Hyper Estraier is described there.

Help File

When a user select the "help" link near the input form, the content of the help file is displayed instead of the search result. By default, usage of the CGI script is described there.

Search Form

If you want set the search form in another page, write the following HTML.

<form method="get" action="estseek.cgi">
<div>
<input type="text" name="phrase" value="" size="32" />
<input type="submit" value="Search" />
<input type="hidden" name="enc" value="UTF-8" />
</div>
</form>

Change "estseek.cgi" to the URI of setseek.cgi. Change "UTF-8" to the encoding name of the page.

Query Expansion

If you want query expansion, enable an outer command by editing qxpndcmd in estseek.conf. It specifies the absolute path of an arbitrary command which output synonyms of a word specified by the environment variable `ESTWORD'.

Make qxpndcmd specify "/usr/local/share/hyperestraier/filter/estwnetxpnd" in order to enable query expansion with WordNet, English thesaurus. It requires WordNet installed on your system.


CGI Script for Highlight

This section describes specification of estproxy.cgi. It features search word highlighting view of corresponding documents.

Composition and Features

estproxy.cgi needs the configuration file estproxy.conf. The name of the configuration file is determined by changing the suffix of the CGI script to ".conf".

As estsproxy.cgi is installed as `/usr/local/libexec/estproxy.cgi', copy it to a directory for CGI scripts. Moreover, as samples of the configuration is installed as `/usr/local/share/hyperestraier/estproxy.conf', copy and modify it.

estproxy.cgi works like a proxy server though it is implemented as a CGI script. So, you can browse arbitrary documents on the Web via the script, by giving their URLs with the `url' parameter. Any data format except for HTML is converted into HTML. Moreover, words specified by such parameters as from `word1' to `word32' are highlighted.

Supported protocols are HTTP and FILE. If a URL beginning with "http://" is specified, the document is fetched by HTTP (as for now, HTTPS is not supported). If a URL beginning with "file://" is specified, the document is readed directly from the local file system of the server.

Supported file formats by built-in filters are plain text (text/plain), HTML (text/html), and MIME (message/rfc822). Other formats can handled with arbitrary outer commands.

Configuration

The configuration file is composed of lines and the name of an variable and the value separated by ":" are in each line. Lines leaded by "#" are ignored as comments. By default, the following configuration is there.

#replace: ^http://localhost/{{!}}file:///home/mikio/public_html/
allowrx: ^http://
#allowrx: ^file://
denyrx: /\.
passaddr: 1
limitsize: 32
urlrule: \.est${{!}}text/x-estraier-draft
urlrule: \.(eml|mime|mht|mhtml)${{!}}message/rfc822
typerule: ^text/x-estraier-draft${{!}}[DRAFT]
typerule: ^text/plain${{!}}[TEXT]
typerule: ^(text/html|application/xhtml+xml)${{!}}[HTML]
typerule: ^message/rfc822${{!}}[MIME]
language: 0
shownavi: 1

Means of each variable is the following.

  • replace : specifies regular expressions and replacement string to convert the URL of the target document. Regular expressions and replacement strings are separated by "{{!}}". Each "&" in a replacement string is evolved to the matched string. Special escapes "\1" through "\9" referring to the corresponding matching sub-expressions are also supported. This can be more than once.
  • allowrx : specifies allowing regular expressions of URLs to be visited. This can be more than once.
  • denyrx : specifies denying regular expressions of URLs to be visited. This can be more than once.
  • passaddr : specifies whether to pass the IP adresses of the clients to remote servers (0:no, 1:yes).
  • limitsize : specifies the maximum size of downloading data (in mega bytes).
  • urlrule : specifies URL rules (regular expressions and media types). This can be more than once.
  • typerule : specifies media type rules (regular expressions and filter commands). This can be more than once.
  • language : specifies the preferred language (0:English, 1:Japanese, 2:Chinese, 3:Korean, 4:misc).
  • shownavi : specifies whether to show the navigation bar (0:no, 1:yes).

allowrx and denyrx are evaluated in the order of description. Alphabetical characters are case-insensitive.


hyperestraier-1.4.13/doc/uguide-ja.html000066400000000000000000005031211125261632700200020ustar00rootroot00000000000000 User's Guide of Hyper Estraier Version 1 (Japanese)

繝ヲ繝シ繧カ繧ャ繧、繝

Copyright (C) 2004-2007 Mikio Hirabayashi
Last Update: Tue, 06 Mar 2007 12:05:18 +0900

逶ョ谺。

  1. 縺ッ縺倥a縺ォ
  2. 譁譖ク縺ョ螻樊ァ
  3. 繝輔ぃ繧、繝ォ蠖「蠑
  4. 讀懃エ「譚。莉カ蠑
  5. 讀懃エ「隱槭ョ謚ス蜃コ
  6. 邂。逅逕ィ繧ウ繝槭Φ繝
  7. 讀懃エ「逕ィCGI繧ケ繧ッ繝ェ繝励ヨ
  8. 陦ィ遉コ逕ィCGI繧ケ繧ッ繝ェ繝励ヨ
  9. 繧、繝ウ繝繝繧ッ繧ケ縺ョ讒矩
  10. 蜉ゥ險
  11. 繧医¥閨槭°繧後k雉ェ蝠

縺ッ縺倥a縺ォ

縺薙ョ繧ャ繧、繝峨〒縺ッ縲?yper Estraier縺ョ繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ隧ウ邏ー縺ェ菴ソ縺譁ケ繧定ェャ譏弱@縺セ縺吶繧、繝ウ繝医Ο繝繧ッ繧キ繝ァ繝ウ繧偵∪縺縺願ェュ縺ソ縺ァ縺ェ縺蝣エ蜷医ッ縲∝医↓縺昴■繧峨↓逶ョ繧帝壹@縺ヲ縺翫>縺ヲ縺上□縺輔>縲

Hyper Estraier縺ッ縲√>繧上f繧九う繝ウ繝繝繧ッ繧ケ蝙九ョ讀懃エ「繧キ繧ケ繝繝縺ァ縺吶よ、懃エ「繧定。後≧蜑阪↓縲∝ッセ雎。譁譖ク縺ョ諠蝣ア繧堤匳骭イ縺励◆繧、繝ウ繝繝繧ッ繧ケ繧呈コ門y縺励※縺翫¥蠢隕√′縺ゅj縺セ縺吶ゅ◎縺ョ謇矩俣縺後°縺九k縺九o繧翫↓縲√→縺ヲ繧るォ倬溘↓讀懃エ「繧定。後≧縺薙→縺後〒縺阪∪縺吶Hyper Estraier縺ッ繧、繝ウ繝繝繧ッ繧ケ繧堤ョ。逅縺吶k繧ウ繝槭Φ繝峨estcmd縲阪→繧、繝ウ繝繝繧ッ繧ケ繧剃スソ縺」縺ヲ讀懃エ「繧定。後≧CGI繧ケ繧ッ繝ェ繝励ヨ縲estseek.cgi縲阪°繧峨↑繧翫∪縺吶ゅ▽縺セ繧翫√さ繝槭Φ繝峨Λ繧、繝ウ縺ァ繧、繝ウ繝繝繧ッ繧ケ縺ョ邂。逅菴懈・ュ繧定。後>縲仝eb繝悶Λ繧ヲ繧カ縺ァ讀懃エ「繧定。後≧縺薙→縺ォ縺ェ繧翫∪縺吶

estcmd縺ッ讒倥縺ェ蠖「蠑上ョ譁譖ク繧呈桶縺縺薙→縺後〒縺阪√∪縺溘う繝ウ繝繝繧ッ繧ケ縺ォ蟇セ縺吶k螟壽ァ倥↑邂。逅謫堺ス懊r陦後≧縺薙→縺後〒縺阪∪縺吶ゅ%縺ョ繧ャ繧、繝峨〒縺ッ縲∵枚譖ク縺ョ謇ア繧上l譁ケ繧繧、繝ウ繝繝繧ッ繧ケ縺ョ邂。逅譁ケ豕輔↓縺、縺縺ヲ隧ウ邏ー縺ォ隱ャ譏弱@縺セ縺吶

Hyper Estraier縺ッ讒倥縺ェ讀懃エ「譁ケ豕輔r繧オ繝昴シ繝医@縺セ縺吶り、謨ー縺ョ讀懃エ「隱槭r邨縺ソ蜷医o縺帙◆繧翫∵枚譖ク縺ョ螻樊ァ繧剃スソ縺」縺ヲ讀懃エ「縺励◆繧翫☆繧九%縺ィ縺後〒縺阪∪縺吶ゅ∪縺溘estseek.cgi縺ョ險ュ螳壹↓繧医j縲∬。ィ遉コ譁ケ豕輔r繧ォ繧ケ繧ソ繝槭う繧コ縺吶k縺薙→縺後〒縺阪∪縺吶ゅ%縺ョ繧ャ繧、繝峨〒縺ッ縺昴l繧峨ョ譁ケ豕輔↓縺、縺縺ヲ繧りェャ譏弱@縺セ縺吶


譁譖ク縺ョ螻樊ァ

Hyper Estraier縺梧桶縺譁譖ク縺ォ縺ッ縲∵悽譁縺ョ諠蝣ア縺縺代〒縺ェ縺上√ち繧、繝医Ν縺ェ縺ゥ縺ョ螻樊ァ諠蝣ア繧偵▽縺代k縺薙→縺後〒縺阪∪縺吶ょア樊ァ縺ッ讒倥縺ェ蠢懃畑縺後〒縺阪∪縺吶ょア樊ァ繧剃スソ縺」縺滓、懃エ「繧ゅ〒縺阪∪縺吶@縲∵峩譁ー譌・譎ゅョ螻樊ァ縺ッ蟾ョ蛻譖エ譁ー縺ョ蛻、譁ュ縺ォ繧ゆスソ繧上l縺セ縺吶

螻樊ァ蜷

螻樊ァ縺ォ縺ッ蜷榊燕縺後▽縺代i繧後∪縺吶ょア樊ァ蜷阪ッ閾ェ逕ア縺ォ縺、縺代k縺薙→縺後〒縺阪k縺ョ縺ァ縺吶′縲?yper Estraier縺梧ィ呎コ也噪縺ォ菴ソ縺螻樊ァ縺ッ繧キ繧ケ繝繝螻樊ァ縺ィ縺励※莠医a螳夂セゥ縺輔l縺ヲ縺縺セ縺吶ゅす繧ケ繝繝螻樊ァ縺ョ蜷榊燕縺ォ縺ッ縲@縲阪′蜈磯ュ縺ォ縺、縺阪∪縺吶ゅす繧ケ繝繝螻樊ァ縺ッ莉・荳九ョ繧ゅョ縺後≠繧翫∪縺吶

  • @id : 譁譖ク繧偵う繝ウ繝繝繧ッ繧ケ縺ォ逋サ骭イ縺励◆髫帙↓閾ェ蜍慕噪縺ォ謖ッ繧峨l縺セ縺吶
  • @uri : 譁譖ク縺ョ蜿らァ譁ケ豕輔r遉コ縺励∪縺吶ょィ縺ヲ縺ョ譁譖ク縺ォ蠢鬆医〒縺吶
  • @digest : 譁譖ク縺ョ繝。繝繧サ繝シ繧ク繝繧、繧ク繧ァ繧ケ繝医r遉コ縺励∪縺吶ら匳骭イ譎ゅ↓閾ェ蜍慕ョ怜コ縺輔l縺セ縺吶
  • @cdate : 譁譖ク縺ョ菴懈先律譎ゅr遉コ縺励∪縺吶
  • @mdate : 譁譖ク縺ョ譛邨よ峩譁ー譌・譎ゅr遉コ縺励∪縺吶ょキョ蛻譖エ譁ー縺ォ菴ソ繧上l縺セ縺吶
  • @adate : 譁譖ク縺ョ譛邨ょ盾辣ァ譌・譎ゅr遉コ縺励∪縺吶
  • @title : 譁譖ク縺ョ繧ソ繧、繝医Ν縺ァ縺吶よ、懃エ「邨先棡縺ァ隕句コ縺励→縺励※謇ア繧上l縺セ縺吶
  • @author : 譁譖ク縺ョ闡苓縺ァ縺吶
  • @type : 譁譖ク縺ョ繝。繝繧」繧「繧ソ繧、繝励〒縺吶
  • @lang : 譁譖ク縺ョ險隱槭〒縺吶
  • @genre : 譁譖ク縺ョ讒伜シ上〒縺吶
  • @size : 譁譖ク縺ョ繧オ繧、繧コ縺ァ縺吶
  • @weight : 譁譖ク縺ョ繧ケ繧ウ繧「繝ェ繝ウ繧ー縺ョ驥阪∩莉倥¢縺ァ縺吶
  • @misc : 譁譖ク縺ョ髮大、壹↑諠蝣ア縺ァ縺吶

繧キ繧ケ繝繝螻樊ァ莉・螟悶ョ螻樊ァ縺ッ繝ヲ繝シ繧カ螳夂セゥ螻樊ァ縺ィ蜻シ縺ー繧後∪縺吶ょセ瑚ソー縺ョ譁譖ク繝峨Λ繝輔ヨ蠖「蠑上r菴ソ縺縺ィ縲∽ササ諢上ョ繧キ繧ケ繝繝螻樊ァ縺ィ繝ヲ繝シ繧カ螳夂セゥ螻樊ァ繧偵▽縺代k縺薙→縺後〒縺阪∪縺吶HTML縺ョmeta隕∫エ繧МIME縺ョ繝倥ャ繝繧ゅΘ繝シ繧カ螻樊ァ縺ィ縺励※謇ア繧上l縺セ縺吶ょア樊ァ蜷阪ッ縲%縲阪〒蟋九∪縺」縺ヲ縺ッ縺縺代∪縺帙s縲

螻樊ァ縺ョ蝙

螻樊ァ縺ォ縺ッ2遞ョ鬘槭ョ蝙九′縺ゅj縺セ縺吶譁蟄怜怜梛縺ィ謨ー蛟、蝙縺ァ縺吶よ枚蟄怜怜梛縺ッ縲∽ササ諢上ョ譁蟄怜励〒縺吶よ枚蟄怜怜梛縺ョ蛟、縺ォ縺ッ縲∝ョ悟ィ荳閾エ縲∝燕譁ケ荳閾エ縲∝セ梧婿荳閾エ縲驛ィ蛻荳閾エ縺ョ蛻、螳壹′縺ァ縺阪∪縺吶よ焚蛟、蝙九ッ縲∵焚蛟、縺セ縺溘ッ譌・莉倥ョ諠蝣ア繧定。ィ縺励◆繧ゅョ縺ァ縺吶よ焚蛟、蝙九ッ譁蟄怜励r謨ー蛟、縺ォ逶エ縺励◆荳翫〒縲∝、ァ蟆上ョ蛻、螳壹′陦後o繧後∪縺吶よ焚蛟、蝙九ョ蛟、縺ッ蠖「蠑上↓繧医▲縺ヲ謇ア繧上l譁ケ縺碁&縺縺セ縺吶よ律莉倥→縺励※隗」驥医&繧後k蝣エ蜷医ゞNIX邏蜈シ1970蟷エ1譛1譌・0譎0蛻0遘抵シ峨°繧峨ョ邨碁℃遘呈焚縺悟愛螳壹↓菴ソ繧上l縺セ縺吶

  • 蜈ィ縺ヲ縺梧焚蟄 竊 10騾イ謨ー縺ィ縺励※隗」驥医&繧後k縲
  • 蜈磯ュ縺0x 竊 16騾イ謨ー縺ィ縺励※隗」驥医&繧後k縲
  • W3CDTFシ井セ具シ1978-02-11T18:05:32+09:00シ 竊 譌・莉倥→縺励※隗」驥医&繧後k縲
  • RFC822シ井セ具シ售at, 11 Feb 1978 18:05:32 +0900シ 竊 譌・莉倥→縺励※隗」驥医&繧後k縲
  • YYYY/MM/DD蠖「蠑擾シ1978/02/11 18:05:32シ 竊 譌・莉倥→縺励※隗」驥医&繧後k縲
  • 荳願ィ倅サ・螟 竊 -1縺ィ縺励※隗」驥医&繧後k縲

螻樊ァ縺後←縺ョ蝙九〒縺ゅk縺九ッ逋サ骭イ譎ゅ↓縺ッ豎コ螳壹&繧後∪縺帙s縲よ、懃エ「譎ゅ↓螻樊ァ繧偵←縺。繧峨ョ蝙九→縺励※隗」驥医☆繧九°謖螳壹&繧後∪縺吶ょア樊ァ縺ョ髟キ縺輔↓蛻カ髯舌ッ縺ゅj縺セ縺帙s縲

譁譖ク縺ョ螻樊ァ繧譛ャ譁縺ォ謖螳壹☆繧区枚蟄怜励ッUTF-8縺ァ陦ィ迴セ縺輔l縺ヲ縺繧句ソ隕√′縺ゅj縺セ縺吶ゅユ繧ュ繧ケ繝医ヵ繧。繧、繝ォ繧ЗTML縺ェ縺ゥ縺ァ縺昴l莉・螟悶ョ譁蟄励さ繝シ繝峨r菴ソ縺」縺ヲ縺繧句エ蜷医ッ縲ゞTF-8縺ォ螟画鋤縺励※縺上□縺輔>縲ゅ↑縺翫estcmd縺ッ譁蟄励さ繝シ繝峨r閾ェ蜍募愛螳壹@縺ヲ螟画鋤蜃ヲ逅繧定。後>縺セ縺吶

繧キ繧ケ繝繝螻樊ァ縺ァ繧ゅΘ繝シ繧カ螻樊ァ縺ァ繧ゅ∝ョ滄圀縺ォ縺ゥ縺ョ繧医≧縺ェ蛟、繧貞・繧後k縺九ッ繝ヲ繝シ繧カ繧繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ォ莉サ縺輔l縺セ縺吶よ欠螳壹☆繧句エ縺ィ隗」驥医☆繧句エ縺ァ蜷域э縺悟叙繧後※縺繧後ー蝠城。後↑縺繧上¢縺ァ縺吶′縲ヽFC縺ェ縺ゥ縺ァ髢「騾」縺吶k隕丞ョ壹′縺ゅk蝣エ蜷医ッ縺昴l縺ォ蠕薙≧縺ョ縺後h縺縺ァ縺励g縺縲ゆセ九∴縺ー縲√@type縲阪↓縺ッRFC2045縺ョ繝。繝繧」繧「繧ソ繧、繝励ョ譖ク蠑上r逕ィ縺縲√@lang縲阪↓縺ッISO639縺ョ險隱槭さ繝シ繝会シ医桂a縲阪憩n縲阪↑縺ゥシ峨r逕ィ縺繧九→繧医>縺ァ縺励g縺縲ゅΘ繝シ繧カ螳夂セゥ螻樊ァ縺ョ莉墓ァ倥r豎コ繧√k髫帙↓縺ッDublin Core縺ョ隕乗シ繧貞盾閠縺ォ縺吶k縺ィ縺縺縺九b縺励l縺セ縺帙s縲

URI螻樊ァ

URIシUniform Resource Identifierシ峨ッ縲∵枚譖ク繧定ュ伜挨縺吶k縺溘a縺ョ譁蟄怜励〒縺吶HTTP繧ЁTP繧ЛDAP縺ョURLシUniform Resource Locatorシ峨ッURI縺ョ荳遞ョ縺ァ縺吶ゅう繝ウ繝繝繧ッ繧ケ縺ォ逋サ骭イ縺吶k蜈ィ縺ヲ縺ョ譁譖ク縺ォ縺ッURI螻樊ァ縺後▽縺縺ヲ縺繧句ソ隕√′縺ゅj縺セ縺吶

螟夜Κシ医う繝ウ繧ソ繝シ繝阪ャ繝茨シ峨↓蜈ャ髢九&繧後kURI縺ッ縲∽ク也阜荳ュ縺ョ縺ゥ縺ョ繝ヲ繝シ繧カ縺九i繧ゆク諢上↓隴伜挨縺ァ縺阪k蠢隕√′縺ゅj縺セ縺吶ゅ@縺溘′縺」縺ヲ縲√Ο繝シ繧ォ繝ォ繝帙せ繝医〒縺励°騾夂畑縺励↑縺縲file://縲阪ョURL縺ッ螟夜Κ縺ォ蜈ャ髢九☆縺ケ縺阪〒縺ッ縺ゅj縺セ縺帙s縲Fstseek.cgi縺ッ縲file://縲阪ョURL繧偵http://縲阪d縲ftp://縲阪↑縺ゥ縺ォ鄂ョ謠帙☆繧区ゥ溯ス繧貞y縺医※縺縺セ縺吶ョ縺ァ縲√◎繧後r豢サ逕ィ縺励※縺上□縺輔>縲

URI縺ッ繝輔ぃ繧、繝ォ繧定ュ伜挨縺吶k縺縺代ョ繧ゅョ縺ァ縺ッ縺ゅj縺セ縺帙s縲よ嶌邀阪ョISBN縺ェ縺ゥ縺ョURNシUniform Resource Nameシ峨bURI縺ョ荳遞ョ縺ァ縺吶ゅ∪縺溘ゞRI縺ョ繧ケ繧ュ繝シ繝槭ッ迢ャ閾ェ縺ォ螳夂セゥ縺吶k縺薙→繧ゅ〒縺阪∪縺吶ゆセ九∴縺ー縲々YZ遉セ縺ョ遉セ蜩。蜷咲ーソ縺ョ蜈ィ譁讀懃エ「繧キ繧ケ繝繝縺ァ縺ゅl縺ー縲∫、セ蜩。逡ェ蜿キ繧貞性繧√◆縲xyz:empno:12345縲阪ョ繧医≧縺ェURI螻樊ァ繧堤函謌舌☆繧九ョ繧ゅh縺縺ァ縺励g縺縲

URI縺ォ譌・譛ャ隱槭↑縺ゥ縺ョ繝槭Ν繝√ヰ繧、繝域枚蟄励r縺昴ョ縺セ縺セ菴ソ縺」縺ヲ縺ッ縺縺代∪縺帙s縲ゅ◎縺ョ蝣エ蜷医∽ク闊ャ縺ォURL繧ィ繝ウ繧ウ繝シ繝峨→蜻シ縺ー繧後k繧ィ繧ケ繧ア繝シ繝怜ヲ逅縺悟ソ隕√→縺ェ繧翫∪縺吶6RI縺ョ莉墓ァ倥↓縺、縺縺ヲ縺ッRFC3986繧貞盾辣ァ縺励※縺上□縺輔>縲

estcmd縺ッ縲√file://縲阪〒蟋九∪繧九Ο繝シ繧ォ繝ォ繝輔ぃ繧、繝ォ繧キ繧ケ繝繝縺ョURL繧旦RI螻樊ァ縺ィ縺励※閾ェ蜍慕噪縺ォ縺、縺代※縺上l縺セ縺吶ゅ◆縺縺励∝ッセ雎。譁譖ク縺袈RI螻樊ァ繧堤峡閾ェ縺ォ螳夂セゥ縺励※縺繧句エ蜷医ッ縺昴■繧峨r蜆ェ蜈医@縺セ縺吶ゅΟ繝シ繧ォ繝ォ繝輔ぃ繧、繝ォ繧キ繧ケ繝繝縺ョURL縺ッ縲_lpath縲阪→縺縺螻樊ァ縺ィ縺励※繧りィ倬鹸縺輔l縺セ縺吶ゅΟ繝シ繧ォ繝ォ繝輔ぃ繧、繝ォ繧キ繧ケ繝繝縺ョ邨カ蟇セ繝代せ縺ッ縲_lreal縲阪→縺縺螻樊ァ縺ィ縺励※險倬鹸縺輔l縲√ヵ繧。繧、繝ォ蜷阪ッ縲_lfile縲阪→縺縺螻樊ァ縺ィ縺励※險倬鹸縺輔l縺セ縺吶ょ推螻樊ァ蛟、縺ョ譁蟄励さ繝シ繝峨ッUTF-8縺ォ豁」隕丞喧縺輔l縺セ縺吶ゅ_縲阪〒蟋九∪繧句錐蜑阪ョ螻樊ァ縺ッ縲estseek.cgi 縺ョ隧ウ邏ー陦ィ遉コ讖溯ス縺ァ陦ィ遉コ縺輔l縺セ縺帙s縲

繝繧、繧ク繧ァ繧ケ繝亥ア樊ァ

繝繧、繧ク繧ァ繧ケ繝医→縺ッ縲2縺、縺ョ繝繝シ繧ソ縺悟酔縺倥b縺ョ縺九←縺縺九r蜉ケ邇逧縺ォ蛻、螳壹☆繧九◆繧√↓縲√ョ繝シ繧ソ縺昴ョ繧ゅョ縺ョ莉」繧上j縺ォ菴ソ繧上l繧狗洒縺繝繝シ繧ソ縺ァ縺吶ゅΓ繝繧サ繝シ繧ク繝繧、繧ク繧ァ繧ケ繝医→繧りィ縺縺セ縺吶ゅう繝ウ繝繝繧ッ繧ケ縺ォ逋サ骭イ縺吶k蜈ィ縺ヲ縺ョ譁譖ク縺ォ縺ッ縲繝繧、繧ク繧ァ繧ケ繝亥ア樊ァ縺御サ伜刈縺輔l縺セ縺吶

譁譖ク縺後ム繧、繧ク繧ァ繧ケ繝亥ア樊ァ繧呈守、コ逧縺ォ謖螳壹@縺ヲ縺縺ェ縺蝣エ蜷医ッ縲∵悽譁縺ョMD5シMessage Digest 5シ峨r蛟、縺ィ縺吶k繝繧、繧ク繧ァ繧ケ繝亥ア樊ァ縺梧囓鮟咏噪縺ォ莉伜刈縺輔l縺セ縺吶よ守、コ逧縺ォ謖螳壹☆繧句エ蜷医`D5莉・螟悶ョ繧「繝ォ繧エ繝ェ繧コ繝繧剃スソ縺」縺ヲ繧よァ九>縺セ縺帙s縺励∵悽譁莉・螟悶ョ繝繝シ繧ソシ医ヵ繧。繧、繝ォ縺昴ョ繧ゅョ縺ェ縺ゥシ峨r蟇セ雎。縺ィ縺励※繝繧、繧ク繧ァ繧ケ繝医r險育ョ励@縺ヲ繧よァ九>縺セ縺帙s縲よ悽譁縺ォ譖エ譁ー縺後≠縺」縺溘↑繧峨ー繝繧、繧ク繧ァ繧ケ繝医b螟牙喧縺吶k縺ィ縺縺縺薙→縺悟髪荳縺ョ隕∽サカ縺ァ縺吶

驥阪∩莉倥¢螻樊ァ

迚ケ螳壹ョ譁譖ク繧呈、懃エ「邨先棡縺ョ荳贋ス阪↓陦ィ遉コ縺輔l繧縺吶>繧医≧縺ォ縺吶k縺ォ縺ッ縲驥阪∩莉倥¢螻樊ァ繧剃スソ縺縺ィ萓ソ蛻ゥ縺ァ縺吶ゆセ九∴縺ー蜈縺ョ繧ケ繧ウ繧「縺100縺ァ驥阪∩莉倥¢縺1.5縺ョ蝣エ蜷医驥阪∩莉倥¢縺輔l縺溘せ繧ウ繧「縺ッ150縺ォ縺ェ繧翫∪縺吶ゅョ繝輔か繝ォ繝医〒縺ッ縲驥阪∩莉倥¢縺ッP2P縺ョ繝弱シ繝陰PIシ医ヮ繝シ繝峨し繝シ繝撰シ峨r蛻ゥ逕ィ縺励◆蝣エ蜷医↓縺ョ縺ソ陦後o繧後√う繝ウ繝繧ッ繧キ繝ウ繧ー縺ョ髫帙↓縺ァ縺ッ縺ェ縺上∵、懃エ「縺ョ髫帙↓陦後o繧後∪縺吶ゅ@縺溘′縺」縺ヲ縲√ヮ繝シ繝峨し繝シ繝舌↓縺翫>縺ヲ縺ッ縲∵枚譖ク縺ョ螻樊ァ繧堤キィ髮縺吶k縺薙→縺ォ繧医▲縺ヲ蜍慕噪縺ォ驥阪∩莉倥¢繧貞、画峩縺ァ縺阪∪縺吶estcmd繧繧ウ繧「API縺ァ繧ェ繝励す繝ァ繝ウ繧呈欠螳壹☆繧後ー縲√う繝ウ繝繧ッ繧キ繝ウ繧ー譎ゅ↓髱咏噪縺ォ驥阪∩莉倥¢繧定。後≧縺薙→繧ゅ〒縺阪∪縺吶


繝輔ぃ繧、繝ォ蠖「蠑

estcmd縺梧桶縺4遞ョ鬘槭ョ繝輔ぃ繧、繝ォ蠖「蠑上ョ縺昴l縺槭l縺後←縺ョ繧医≧縺ォ謇ア繧上l繧九°繧定ェャ譏弱@縺セ縺吶ゅ◎縺ョ莉悶ョ蠖「蠑上r謇ア縺縺溘a縺ョ繝輔ぅ繝ォ繧ソ縺ォ縺、縺縺ヲ縺ッ蠕瑚ソー縺励∪縺吶

繝励Ξ繝シ繝ウ繝繧ュ繧ケ繝

迚ケ縺ォ讒矩縺ョ縺ェ縺譁蟄怜励〒縺吶ゅョ繝輔か繝ォ繝医〒縺ッ縲√ヵ繧。繧、繝ォ蜷阪ョ謗・蟆セ霎槭′縲.txt縲阪.text縲阪.asc縲阪ョ蝣エ蜷医↓繝励Ξ繝シ繝ウ繝繧ュ繧ケ繝医→縺励※謇ア繧上l縺セ縺吶

  • 譁蟄励さ繝シ繝峨ッ閾ェ蜍募愛螳壹&繧後∪縺吶
  • @type螻樊ァ縺ィ縺励※縲荊ext/plain縲阪′險倬鹸縺輔l縺セ縺吶
  • @size螻樊ァ縺ィ縺励※繝輔ぃ繧、繝ォ繧オ繧、繧コ縺瑚ィ倬鹸縺輔l縺セ縺吶

HTML

險繧上★繧ゅ′縺ェ縲仝eb縺ァ菴ソ繧上l繧九ワ繧、繝代シ繝繧ュ繧ケ繝医〒縺吶ゅョ繝輔か繝ォ繝医〒縺ッ縲√ヵ繧。繧、繝ォ蜷阪ョ謗・蟆セ霎槭′縲.html縲阪.htm縲阪.xhtml縲阪.xht縲阪ョ蝣エ蜷医↓HTML縺ィ縺励※謇ア繧上l縺セ縺吶

  • 譁蟄励さ繝シ繝峨ッ閾ェ蜍募愛螳壹&繧後∪縺吶′縲[eta隕∫エ縺ァ譁蟄励さ繝シ繝峨′謖螳壹&繧後◆蝣エ蜷医ッ縺昴■繧峨′蜆ェ蜈医&繧後∪縺吶
  • title隕∫エ縺後≠繧後ー縲√◎縺ョ蜀螳ケ縺掘title螻樊ァ縺ィ縺励※險倬鹸縺輔l縺セ縺吶
  • meta隕∫エ縺ョname螻樊ァ縺ァauthor縺梧欠螳壹&繧後※縺繧後ー縲√◎縺ョcontent隕∫エ縺ョ蛟、縺掘author螻樊ァ縺ィ縺励※險倬鹸縺輔l縺セ縺吶
  • html隕∫エ縺ォlang螻樊ァ繧ゅ@縺上ッxml:lang螻樊ァ縺後≠繧後ー縲√◎縺ョ蛟、縺掘lang螻樊ァ縺ィ縺励※險倬鹸縺輔l縺セ縺吶
  • @type螻樊ァ縺ィ縺励※縲荊ext/html縲阪′險倬鹸縺輔l縺セ縺吶
  • @size螻樊ァ縺ィ縺励※繝輔ぃ繧、繝ォ繧オ繧、繧コ縺瑚ィ倬鹸縺輔l縺セ縺吶
  • meta隕∫エ縺ョname螻樊ァ縺セ縺溘ッhttp-equiv螻樊ァ縺梧欠螳壹&繧後※縺繧後ー縲√◎縺ョ螻樊ァ蛟、繧貞ー乗枚蟄励↓螟画鋤縺励◆蜷榊燕縺ョ繝ヲ繝シ繧カ螻樊ァ縺ィ縺励※縲…ontent隕∫エ縺ョ蛟、繧定ィ倬鹸縺励∪縺吶
  • @title螻樊ァ縺ョ蛟、縺ッ髫縺励ユ繧ュ繧ケ繝医→縺励※謇ア繧上l縺セ縺吶

髫縺励ユ繧ュ繧ケ繝医↓縺、縺縺ヲ縺ッ蠕瑚ソー縺励∪縺吶

MIMEシ磯崕蟄舌Γ繝シ繝ォシ

RFC822縺ォ蝓コ縺・縺上Γ繝繧サ繝シ繧ク莠、謠帙ョ縺溘a縺ョ繝繝シ繧ソ蠖「蠑上〒縺吶ゅョ繝輔か繝ォ繝医〒縺ッ縲√ヵ繧。繧、繝ォ蜷阪ョ謗・蟆セ霎槭′縲.eml縲阪.mime縲阪.mht縲阪.mhtml縲阪ョ蝣エ蜷医↓MIME縺ィ縺励※謇ア繧上l縺セ縺吶

  • 譁蟄励さ繝シ繝峨ッ閾ェ蜍募愛螳壹&繧後∪縺吶′縲,ontent-Type繝倥ャ繝縺ァ譁蟄励さ繝シ繝峨′謖螳壹&繧後◆蝣エ蜷医ッ縺昴■繧峨′蜆ェ蜈医&繧後∪縺吶
  • Subject繝倥ャ繝縺後≠繧後ー縲√◎縺ョ蜀螳ケ縺掘title螻樊ァ縺ィ縺励※險倬鹸縺輔l縺セ縺吶
  • From繝倥ャ繝縺後≠繧後ー縲√◎縺ョ蜀螳ケ縺掘author螻樊ァ縺ィ縺励※險倬鹸縺輔l縺セ縺吶
  • Date繝倥ャ繝縺後≠繧後ー縲√◎縺ョ蜀螳ケ縺掘cdate螻樊ァ縺翫h縺ウ@mdate螻樊ァ縺ィ縺励※險倬鹸縺輔l縺セ縺吶
  • @type螻樊ァ縺ィ縺励※縲稽essage/rfc822縲阪′險倬鹸縺輔l縺セ縺吶
  • @size螻樊ァ縺ィ縺励※繝輔ぃ繧、繝ォ繧オ繧、繧コ縺瑚ィ倬鹸縺輔l縺セ縺吶
  • 蜈ィ縺ヲ縺ョ繝倥ャ繝縺ョ蛟、縺ッ縲√倥ャ繝蜷阪r蟆乗枚蟄励↓螟画鋤縺励◆蜷榊燕縺ョ繝ヲ繝シ繧カ螻樊ァ縺ィ縺励※謖螳壹&繧後∪縺吶
  • @title螻樊ァ縺ョ蛟、縺ッ髫縺励ユ繧ュ繧ケ繝医→縺励※謇ア繧上l縺セ縺吶

繝槭Ν繝√ヱ繝シ繝医ョ蜷繝代シ繝医ョ荳ュ霄ォ縺後荊ext/plain縲阪°縲荊ext/html縲阪°縲稽essage/rfc822縲阪ョ蝣エ蜷医↓縺ッ縲√◎縺ョ蜀螳ケ繧呈悽譁縺ィ縺励※謇ア縺縺セ縺吶ゅ%繧後↓繧医▲縺ヲ縲仝eb繧「繝シ繧ォ繧、繝厄シMHTMLシ峨b驕ゥ蛻縺ォ謇ア縺縺薙→縺後〒縺阪∪縺吶ゅ倥ャ繝縺ョ蛟、縺勲IME繧ィ繝ウ繧ウ繝シ繝峨&繧後※縺縺溷エ蜷医ッ縺昴l繧偵ョ繧ウ繝シ繝峨@縺ヲ謇ア縺縺セ縺吶ゅお繝ウ繝繧」繝繧」縺沓ase64繧бuoted-printable縺ァ繧ィ繝ウ繧ウ繝シ繝峨&繧後※縺縺溷エ蜷医ッ縺昴l繧偵ョ繧ウ繝シ繝峨@縺ヲ謇ア縺縺セ縺吶

譁譖ク繝峨Λ繝輔ヨ

譁譖ク繝峨Λ繝輔ヨ縺ッ縲?yper Estraier迢ャ閾ェ縺ョ繝繝シ繧ソ蠖「蠑上〒縺吶よ枚譖ク繝峨Λ繝輔ヨ繧剃クュ髢薙ヵ繧ゥ繝シ繝槭ャ繝医→縺励※菴ソ縺縺薙→縺ァ縲∵ァ倥縺ェ蠖「蠑上ョ譁譖ク繧堤オア蜷育噪縺ォ謇ア縺縺薙→縺後〒縺阪∪縺吶ゅョ繝輔か繝ォ繝医〒縺ッ縲√ヵ繧。繧、繝ォ蜷阪ョ謗・蟆セ霎槭′縲.est縲阪ョ蝣エ蜷医↓譁譖ク繝峨Λ繝輔ヨ縺ィ縺励※謇ア繧上l縺セ縺吶

譁譖ク繝峨Λ繝輔ヨ縺ョ蠖「蠑上ッRFC822縺ォ莨シ縺ヲ縺縺セ縺吶′縲∫エー縺九>驕輔>縺後≠繧翫∪縺吶ゅ倥ャ繝縺ョ蛹コ蛻繧頑枚蟄励ッ縲:縲阪〒縺ェ縺上=縲阪〒縺吶ゅ∪縺溘√=縲阪ョ蠕後↓遨コ逋ス繧堤スョ縺丞ソ隕√ッ縺ゅj縺セ縺帙s縲ゆセ九∴縺ー縲`IDI縺ョ豁瑚ゥ槭ョ繝シ繧ソ繧堤匳骭イ縺吶k髫帙↓縺ッ縲∽サ・荳九ョ繧医≧縺ェ繝繝シ繧ソ縺ォ縺ェ繧九〒縺励g縺縲

@uri=http://www.music-estraier.com/mididb/w/wa/wakamonotachi.kar
@title=闍・閠縺溘■
@author=菴占陸蜍,阯、逕ー謨城寇
@cdate=2004-11-01T23:11:18+09:00
@mdate=2005-03-21T08:07:45+09:00
category=chorus,j-pop

蜷帙ョ陦後¥驕薙ッ 譫懊※縺励↑縺城□縺
縺縺ョ縺ォ縺ェ縺 豁ッ繧偵¥縺縺励ー繧
蜷帙ッ陦後¥縺ョ縺 縺昴s縺ェ縺ォ縺励※縺セ縺ァ
        闍・閠縺溘■
        菴占陸蜍,阯、逕ー謨城寇

譁譖ク繝峨Λ繝輔ヨ縺ッ莉・荳九ョ莉墓ァ倥r貅縺溘☆蠢隕√′縺ゅj縺セ縺吶

  • 豁」蟶ク縺ェUTF-8繧ィ繝ウ繧ウ繝シ繝峨ョ繝繧ュ繧ケ繝医°繧画ァ区舌&繧後∪縺吶
  • 謾ケ陦悟ス「蠑上ッUNIX蠖「蠑擾シLFシ峨°MS-DOS蠖「蠑擾シCR+LFシ峨ョ縺ゥ縺。繧峨°縺ァ縺吶
  • 螻樊ァ驛ィ縺ィ繝繧ュ繧ケ繝磯Κ縺九i縺ェ繧翫∽ク。閠縺ッ譛蛻昴↓蜃コ迴セ縺励◆遨コ陦後〒蛹コ蛻繧峨l縺セ縺吶
  • 螻樊ァ驛ィ縺ォ縺翫>縺ヲ縲∝推陦後ッ螻樊ァ縺ョ謖螳壹→縺励※謇ア繧上l縺セ縺吶ょア樊ァ蜷阪→蛟、縺ッ譛蛻昴↓蜃コ迴セ縺励◆縲=縲阪〒蛹コ蛻繧峨l縺セ縺吶
  • 繝繧ュ繧ケ繝磯Κ縺ォ縺翫>縺ヲ縲∝推陦後ッ譛ャ譁縺ョ譁蟄怜励→縺励※謇ア繧上l縺セ縺吶り。碁ュ縺後ち繝匁枚蟄励〒蟋九∪縺」縺ヲ縺繧句エ蜷医√◎縺ョ陦後ッ髫縺励ユ繧ュ繧ケ繝医→縺励※謇ア繧上l縺セ縺吶

螻樊ァ驛ィ縺ォ縺翫>縺ヲ縲√%縲阪〒蟋九∪繧玖。後ッ蛻カ蠕。蜻ス莉、縺ィ縺ソ縺ェ縺輔l縺ヲ辟。隕悶&繧後∪縺吶よ枚譖ク繝峨Λ繝輔ヨ縺ォ蛻・縺ョ逶ョ逧縺ョ繝繝シ繧ソ繧呈キキ蜈・縺輔○縺溘>蝣エ蜷医ッ縺薙ョ讖溯ス繧貞茜逕ィ縺励※縺上□縺輔>縲ゅ◆縺縺励√%VECTOR縲阪→縺昴l縺ォ邯壹¥繧ソ繝悶〒蟋九∪繧玖。後′縺ゅk蝣エ蜷医√◎繧後ッ譁譖ク縺ョ繧ュ繝シ繝ッ繝シ繝峨吶け繝医Ν繧堤、コ縺励∪縺吶ゅく繝シ繝ッ繝シ繝峨吶け繝医Ν縺ョ蠖「蠑上ッTSV縺ァ縺吶ょ推繝輔ぅ繝シ繝ォ繝峨↓縺ッ縲√く繝シ繝ッ繝シ繝峨→縺昴ョ繧ケ繧ウ繧「縺御コ、莠偵↓陦ィ繧後∪縺吶ゅ%SCORE縲阪→縺昴l縺ォ邯壹¥繧ソ繝悶〒蟋九∪繧玖。後′縺ゅk蝣エ蜷医√◎繧後ッ譁譖ク縺ョ莉」譖ソ繧ケ繧ウ繧「繧堤、コ縺励∪縺吶

髫縺励ユ繧ュ繧ケ繝医ッ縲騾壼クク縺ョ譛ャ譁縺ィ蜷梧ァ倥↓讀懃エ「隱槭′謚ス蜃コ縺輔l縺セ縺吶′縲∵、懃エ「邨先棡縺ョ繧ケ繝九壹ャ繝医〒縺ッ陦ィ遉コ縺輔l縺ェ縺縺薙→縺檎音蠕エ縺ァ縺吶ゅち繧、繝医Ν繧闡苓縺ォ蜷ォ縺セ繧後k隱槭b蜈ィ譁讀懃エ「縺ョ蟇セ雎。縺ォ縺励◆縺蝣エ蜷医↓縺ッ縲√ち繧、繝医Ν繧闡苓縺ィ蜷後§譁蟄怜励r髫縺励ユ繧ュ繧ケ繝医→縺励※繧よ欠螳壹☆繧九→繧医>縺ァ縺励g縺縲

譁譖ク繝峨Λ繝輔ヨ縺ョ譛螟ァ縺ョ迚ケ蠕エ縺ッ縲ゞRI螻樊ァ繧呈欠螳壹〒縺阪k縺薙→縺ァ縺吶ゅ▽縺セ繧翫∵枚譖ク繝峨Λ繝輔ヨ閾ェ菴薙ョURI縺ァ縺ッ縺ェ縺上∝挨縺ョ繝輔ぃ繧、繝ォ縺ョURI繧偵う繝ウ繝繝繧ッ繧ケ縺ォ險倬鹸縺吶k縺薙→縺後〒縺阪k縺ョ縺ァ縺吶8eb縺九iHTML繝繝シ繧ソ繧貞庶髮縺励※譁譖ク繝峨Λ繝輔ヨ蠖「蠑上〒菫晏ュ倥☆繧九励Ο繧ー繝ゥ繝繧剃ス懊l縺ー縲∫ー。譏鍋噪縺ェWeb讀懃エ「繧ィ繝ウ繧ク繝ウ繧堤ー。蜊倥↓螳溽樟縺吶k縺薙→縺後〒縺阪∪縺呻シ井サ倬鹸縺ョestwaver繧ウ繝槭Φ繝峨r菴ソ縺医ー繧ゅ▲縺ィ邁。蜊倥〒縺吶′シ峨よ枚譖ク繝峨Λ繝輔ヨ繧剃ソ晏ュ倥☆繧九が繝シ繝舌シ繝倥ャ繝峨r縺九¢縺溘¥縺ェ縺蝣エ蜷医ッ縲√>繧医>繧API繧剃スソ縺縺薙→縺ォ縺ェ繧翫∪縺吶

譁譖ク繝峨Λ繝輔ヨ繧淡eb邨檎罰縺ァ驟埼√☆繧矩圀縺ォ縺ッ縲`IME繧ソ繧、繝励r縲text/x-estraier-draft縲阪↓縺吶k縺薙→繧呈耳螂ィ縺励∪縺吶ゅΘ繝シ繧カ繧ィ繝シ繧ク繧ァ繝ウ繝医′譁譖ク繝峨Λ繝輔ヨ繧帝←蛻縺ォ讀懷コ縺吶l縺ー縲√◎縺ョ縺セ縺セ繧、繝ウ繝繝繧ッ繧ケ縺ォ逋サ骭イ縺励◆繧翫驕ゥ蛻縺ェ繝薙Η繝シ繝ッ縺ァ陦ィ遉コ縺励◆繧翫〒縺阪k繧医≧縺ォ縺ェ繧翫∪縺吶


讀懃エ「譚。莉カ蠑

讀懃エ「譚。莉カ縺ォ縺ッ縲∝ィ譁讀懃エ「譚。莉カ縺ィ螻樊ァ讀懃エ「譚。莉カ縺ョ2遞ョ鬘槭′縺ゅj縺セ縺吶ゆク。譁ケ繧貞酔譎ゅ↓謖螳壹☆繧九%縺ィ繧ゅ〒縺阪√◎縺ョ蝣エ蜷医ッ荳。譁ケ繧呈コ縺溘@縺滓枚譖ク縺瑚ゥイ蠖薙→縺ソ縺ェ縺輔l縺セ縺吶ゅ&繧峨↓縲∝ィ譁讀懃エ「縺ョ譚。莉カ蠑上↓縺ッ縲騾壼クク譖ク蠑上d邁。萓ソ譖ク蠑上↑縺ゥ縺ョ遞ョ鬘槭≠繧翫∪縺吶ら畑騾斐↓蠢懊§縺ヲ菴ソ縺蛻縺代※縺上□縺輔>縲

蜈ィ譁讀懃エ「譚。莉カ縺ョ騾壼クク譖ク蠑

蜈ィ譁讀懃エ「譚。莉カ蠑縺ッ縲∵欠螳壹@縺溯ェ槫唱縺梧悽譁縺ォ蜷ォ縺セ繧後k譁譖ク繧呈、懃エ「縺吶k縺溘a縺ョ繧ゅョ縺ァ縺吶ゆセ九∴縺ー縲√繧ウ繝ウ繝斐Η繝シ繧ソ縲阪→縺縺譁蟄怜励r蜷ォ繧譁譖ク繧呈爾縺励◆縺縺ェ繧峨∵、懃エ「蠑上↓縲繧ウ繝ウ繝斐Η繝シ繧ソ縲阪→縺昴ョ縺セ縺セ謖螳壹@縺ヲ縺上□縺輔>縲

隍謨ー縺ョ讀懃エ「隱槭r遨コ逋ス縺ァ蛹コ蛻縺」縺ヲ縺ェ繧峨∋繧九%縺ィ繧ゅ〒縺阪∪縺吶ゆセ九∴縺ー縲√United Nations縲阪→謖螳壹☆繧九→縲√United縲阪ョ逶エ蠕後↓縲Nations縲阪′譚・繧区枚譖ク繧呈、懃エ「縺励∪縺吶

讀懃エ「隱槭r縲AND縲阪〒謖溘s縺ァ荳ヲ縺ケ繧九→縲、ND讀懃エ「縺後〒縺阪∪縺吶ゆセ九∴縺ー縲√繧、繝ウ繧ソ繝シ繝阪ャ繝 AND 繧サ繧ュ繝・繝ェ繝繧」縲阪→謖螳壹☆繧九→縲√繧、繝ウ繧ソ繝シ繝阪ャ繝縲阪→縲繧サ繧ュ繝・繝ェ繝繧」縲阪ョ荳。譁ケ繧貞性繧譁譖ク繧呈、懃エ「縺励∪縺吶

讀懃エ「隱槭r縲ANDNOT縲阪〒謖溘s縺ァ荳ヲ縺ケ繧九→縲、NDNOT讀懃エ「縺後〒縺阪∪縺吶ゆセ九∴縺ー縲√繧ケ繧ュ繝シ ANDNOT 繧ケ繝弱懊シ縲阪→謖螳壹☆繧九→縲√繧ケ繧ュ繝シ縲阪r蜷ォ繧縺後繧ケ繝弱懊シ縲阪ッ蜷ォ縺セ縺ェ縺譁譖ク繧呈、懃エ「縺励∪縺吶ANDNOT讀懃エ「縺ッ縲∵爾縺励◆縺隱槭′莉悶ョ隱槭ョ荳驛ィ縺ォ蜷ォ縺セ繧後※縺縺セ縺乗、懃エ「縺ァ縺阪↑縺蝣エ蜷医↓繧ゆセソ蛻ゥ縺ァ縺吶ゅ繝輔ぃ繧、繝ォ縲阪〒讀懃エ「縺吶k縺ィ縲繝励Ο繝輔ぃ繧、繝ォ縲阪′繝偵ャ繝医@縺ヲ鬯ア髯カ縺励>蝣エ蜷医↓縺ッ縲√繝輔ぃ繧、繝ォ ANDNOT 繝励Ο繝輔ぃ繧、繝ォ縲阪→縺吶k縺ィ繧医>縺ァ縺励g縺縲

讀懃エ「隱槭r縲OR縲阪〒謖溘s縺ァ荳ヲ縺ケ繧九→縲^R讀懃エ「縺後〒縺阪∪縺吶ゆセ九∴縺ー縲√繝ャ繝「繝ウ OR 繝ゥ繧、繝縲阪→謖螳壹☆繧九→縲√繝ャ繝「繝ウ縲阪→縲繝ゥ繧、繝縲阪ョ迚譁ケ縺セ縺溘ッ荳。譁ケ繧貞性繧譁譖ク繧呈、懃エ「縺励∪縺吶0R讀懃エ「縺ッ縲鬘樒セゥ隱槭d陦ィ險倥ョ謠コ繧後↓蟇セ蠢懊@縺滓、懃エ「繧偵☆繧九ョ縺ォ萓ソ蛻ゥ縺ァ縺吶ゅwoman OR women縲阪↑縺ゥ縺ィ縺励※闍ア蜊倩ェ槭ョ豢サ逕ィ繧貞精蜿弱@縺溘j縲√鮴埼ヲャ OR 遶憺ヲャ縲阪↑縺ゥ縺ィ縺励※貍「蟄苓。ィ險倥ョ謠コ繧後r蜷ク蜿弱@縺溘j縺吶k縺ィ繧医>縺ァ縺励g縺縲

OR縲阪ッ縲AND縲阪d縲ANDNOT縲阪h繧翫b蜆ェ蜈磯菴阪′鬮倥>縺薙→縺ォ豕ィ諢上@縺ヲ縺上□縺輔>縲ゆセ九∴縺ー縲√F1 OR F-1 OR Formula One AND 蜆ェ蜍 OR 繝√Ε繝ウ繝斐が繝ウ縲阪→蜈・蜉帙@縺溷エ蜷医√F1縲阪°縲F-1縲阪°縲Formula One縲阪ョ縺ゥ繧後°繧貞性繧薙〒縲√°縺、縲蜆ェ蜍縲阪°縲繝√Ε繝ウ繝斐が繝ウ縲阪ョ縺ゥ縺。繧峨°繧貞性繧譁譖ク繧呈爾縺励∪縺吶

Hyper Estraier縺ッ縲∵律譛ャ隱槭□縺代〒縺ェ縺上∬恭隱槭√ラ繧、繝隱槭√ヵ繝ゥ繝ウ繧ケ隱槭∽クュ蝗ス隱槭↑縺ゥ縲∝、ァ謚オ縺ョ險隱槭r謇ア縺縺薙→縺後〒縺阪∪縺吶り恭蟄励ョ螟ァ譁蟄励→蟆乗枚蟄励ョ驕輔>縺ッ辟。隕悶&繧後∪縺吶ゅJapan縲阪japan縲阪JAPAN縲阪jaPaN縲阪ッ蜈ィ縺ヲ蜷後§縺ァ縺吶ゅム繧、繧「繧ッ繝ェ繝繧」繧ォ繝ォ繝槭シ繧ッ莉倥″縺ョ繝ゥ繝繝ウ譁蟄励d縲√ぐ繝ェ繧キ繧「譁蟄励√く繝ェ繝ォ譁蟄励〒繧ょ酔讒倥〒縺吶

AND縲阪ANDNOT縲阪OR縲阪ッ貍皮ョ怜ュ舌〒縺吶ョ縺ァ縲∝、ァ譁蟄励〒譖ク縺九↑縺代l縺ー縺ェ繧翫∪縺帙s縲ゅ∪縺溘∝燕蠕後↓遨コ逋ス縺悟ソ隕√〒縺吶ゅAND縲阪→縺縺譁蟄怜励r蜷ォ繧譁譖ク繧呈爾縺励◆縺蝣エ蜷医ッ縲√and縲阪→謖螳壹@縺ヲ縺上□縺輔>縲ゅANDNOT縲阪d縲OR縲阪〒繧ょ酔讒倥〒縺吶

蜈ィ縺ヲ縺ョ譁譖ク縺ォ隧イ蠖薙☆繧九Ρ繧、繝ォ繝峨き繝シ繝峨→縺励※縲√[UVSET]縲阪→縺縺螳壽焚縺後≠繧翫∪縺吶ゅ%繧後r菴ソ縺縺ィ縲∫エ皮イ九↑NOT讀懃エ「縺後〒縺阪∪縺吶ゆセ九∴縺ー縲√[UVSET] ANDNOT 繝輔ぃ繧、繝ォ縲阪→縺吶k縺ィ縲√繝輔ぃ繧、繝ォ縲阪r蜷ォ縺セ縺ェ縺蜈ィ縺ヲ縺ョ譁譖ク繧呈、懃エ「縺励∪縺吶ゅ◆縺縺励√%縺ョ蜃ヲ逅縺ッ驕縺縺ァ縺吶

谺ァ邀ウ縺ォ隕九i繧後k遨コ逋ス縺ァ隱槭r蛹コ蛻繧玖ィ隱槭ョ蜊倩ェ槭↓蟇セ縺励※縺ッ縲∝燕譁ケ荳閾エ縲∝セ梧婿荳閾エ縲∵ュ」隕剰。ィ迴セ縺ョ譚。莉カ繧呈欠螳壹@縺ヲ讀懃エ「繧定。後≧縺薙→縺後〒縺阪∪縺呻シ域律譛ャ隱槭↓縺ッ蜉ケ譫懊′縺ゅj縺セ縺帙sシ峨ょ燕譁ケ荳閾エ縺ョ蝣エ蜷医ッ譁蟄怜励ョ蜑阪↓遨コ逋ス繧呈検繧薙〒縲[BW]縲阪r鄂ョ縺阪∝セ梧婿荳閾エ縺ョ蝣エ蜷医ッ譁蟄怜励ョ蜑阪↓遨コ逋ス繧呈検繧薙〒縲[EW]縲阪r鄂ョ縺阪∵ュ」隕剰。ィ迴セ縺ョ蝣エ蜷医ッ譁蟄怜励ョ蜑阪↓遨コ逋ス繧呈検繧薙〒縲[RX]縲阪r鄂ョ縺阪∪縺吶ゆセ九∴縺ー縲√[BW] euro縲阪□縺ィ縲euro縲阪〒蟋九∪繧句腰隱槭r蜷ォ繧譁譖ク繧呈、懃エ「縺励∪縺吶ゅ[EW] sphere縲阪□縺ィ縲sphere縲阪〒邨ゅo繧句腰隱槭r蜷ォ繧譁譖ク繧呈、懃エ「縺励∪縺吶ゅ[RX] ^inter.*al$縲阪□縺ィ縲inter縲阪〒蟋九∪縺」縺ヲ縲al縲阪〒邨ゅo繧句腰隱槭r蜷ォ繧譁譖ク繧呈、懃エ「縺励∪縺吶

蜈ィ譁讀懃エ「譚。莉カ縺ョ邁。萓ソ譖ク蠑

Google縺ェ縺ゥ縺ョ讀懃エ「繧ィ繝ウ繧ク繝ウ縺ァ縺ッ縲∫ゥコ逋ス縺ァ蛹コ蛻繧九%縺ィ縺ァAND譚。莉カ繧呈欠螳壹〒縺阪∪縺吶ゅ◎縺ョ繧医≧縺ェ謖吝虚縺ョ譁ケ縺梧悍縺セ縺励>蝣エ蜷医ッ縲∫ー。萓ソ譖ク蠑上r菴ソ縺縺薙→縺後〒縺阪∪縺吶らー。萓ソ譖ク蠑上r菴ソ縺縺九←縺縺九ッ縲√い繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ繧ウ繝槭Φ繝峨Λ繧、繝ウ縺ョ繧ェ繝励す繝ァ繝ウ繧險ュ螳壹ヵ繧。繧、繝ォ縺ァ謖螳壹@縺セ縺吶estseek.cgi縺ョ繝繝輔か繝ォ繝医ョ險ュ螳壹〒縺ッ縲∫ー。萓ソ譖ク蠑上′菴ソ繧上l繧九h縺縺ォ縺ェ縺」縺ヲ縺縺セ縺吶

邁。萓ソ譖ク蠑上〒縺ッ縲∫ゥコ逋ス縺セ縺溘ッ縲&縲阪〒蛹コ蛻繧九→AND譚。莉カ縺ォ縺ェ繧翫∪縺吶ゆセ九∴縺ー縲√繧、繝ウ繧ソ繝シ繝阪ャ繝 繧サ繧ュ繝・繝ェ繝繧」縲阪→蜈・蜉帙☆繧九→縲√繧、繝ウ繧ソ繝シ繝阪ャ繝縲阪→縲繧サ繧ュ繝・繝ェ繝繧」縲阪ョ荳。譁ケ繧貞性繧譁譖ク繧呈、懃エ「縺励∪縺吶

隍謨ー縺ョ讀懃エ「隱槭r縲""縲阪〒諡ャ繧九→縲√ヵ繝ャ繝シ繧コ讀懃エ「縺後〒縺阪∪縺吶ゆセ九∴縺ー縲√"United Nations"縲阪→蜈・蜉帙☆繧九→縲√United縲阪ョ逶エ蠕後↓縲Nations縲阪′蜃コ迴セ縺吶k譁譖ク繧呈、懃エ「縺励∪縺吶

!縲阪r菴ソ縺縺ィNOT讀懃エ「縺後〒縺阪∪縺吶ゆセ九∴縺ー縲√繧ケ繧ュ繝シ ! 繧ケ繝弱懊シ縲阪→蜈・蜉帙☆繧九→縲√繧ケ繧ュ繝シ縲阪r蜷ォ繧縺後繧ケ繝弱懊シ縲阪r蜷ォ縺セ縺ェ縺譁譖ク繧呈、懃エ「縺励∪縺吶

|縲阪r菴ソ縺縺ィOR讀懃エ「縺後〒縺阪∪縺吶ゆセ九∴縺ー縲√繝ャ繝「繝ウ | 繝ゥ繧、繝縲阪→蜈・蜉帙☆繧九→縲√繝ャ繝「繝ウ縲阪°縲繝ゥ繧、繝縲阪ョ迚譁ケ縺セ縺溘ッ荳。譁ケ繧貞性繧譁譖ク繧呈、懃エ「縺励∪縺吶

|縲阪ョ蜆ェ蜈磯菴阪′縲&縲阪d縲!縲阪h繧企ォ倥>縺ョ縺ッ騾壼クク譖ク蠑上→蜷後§縺ァ縺吶

邁。萓ソ譖ク蠑上↓縺翫>縺ヲ縺ッ縲√Ρ繧、繝ォ繝峨き繝シ繝峨↓繧医▲縺ヲ蜑肴婿荳閾エ繧蠕梧婿荳閾エ繧豁」隕剰。ィ迴セ縺ョ譚。莉カ繧呈欠螳壹☆繧九%縺ィ縺後〒縺阪∪縺呻シ域律譛ャ隱槭↓縺ッ蜉ケ譫懊′縺ゅj縺セ縺帙sシ峨ょ燕譁ケ荳閾エ縺ョ蝣エ蜷医ッ譁蟄怜励ョ蠕後↓縲*縲阪r鄂ョ縺阪∝セ梧婿荳閾エ縺ョ蝣エ蜷医ッ譁蟄怜励ョ蜑阪↓縲*縲阪r鄂ョ縺阪∵ュ」隕剰。ィ迴セ縺ョ蝣エ蜷医ッ譁蟄怜励ョ蜑榊セ後↓縲*縲阪r鄂ョ縺阪∪縺吶ゆセ九∴縺ー縲√euro*縲阪□縺ィ縲euro縲阪〒蟋九∪繧句腰隱槭r蜷ォ繧譁譖ク繧呈、懃エ「縺励∪縺吶ゅ*sphere縲阪□縺ィ縲sphere縲阪〒邨ゅo繧句腰隱槭r蜷ォ繧譁譖ク繧呈、懃エ「縺励∪縺吶ゅ*^inter.*al$*縲阪□縺ィ縲inter縲阪〒蟋九∪縺」縺ヲ縲al縲阪〒邨ゅo繧句腰隱槭r蜷ォ繧譁譖ク繧呈、懃エ「縺励∪縺吶

遨コ逋ス繧縲&縲阪!縲阪芸縲阪*縲阪r讀懃エ「隱槭◎縺ョ繧ゅョ縺ィ縺励※謖螳壹@縺溘>蝣エ蜷医ッ縲√ヵ繝ャ繝シ繧コ讀懃エ「繧貞ソ懃畑縺励※縺上□縺輔>縲ゆセ九∴縺ー縲窟T&T縲阪r讀懃エ「縺励◆縺蝣エ蜷医ッ縲√"AT&T"縲阪→縺励∪縺吶

蜈ィ譁讀懃エ「譚。莉カ縺ョ縺昴ョ莉悶ョ譖ク蠑

邊礼払譖ク蠑上ッ縲∫ー。萓ソ譖ク蠑上h繧翫b縺輔i縺ォ蜊倡エ斐↑譖ク蠑上〒縺吶らゥコ逋ス縺ァ蛹コ蛻繧九→AND譚。莉カ縺ォ縺ェ繧翫√|縲阪〒蛹コ蛻繧九→OR譚。莉カ縺ォ縺ェ繧翫√""縲阪〒謖溘縺ィ繝輔Ξ繝シ繧コ讀懃エ「縺ォ縺ェ繧九→縺薙m縺ッ邁。萓ソ譖ク蠑上→蜷後§縺ァ縺吶ゅ◆縺縺励√&縲阪ッ騾壼クク縺ョ譁蟄励→縺励※謇ア繧上l縺セ縺吶ゅ∪縺溘^R譚。莉カ繧呈欠螳壹☆繧九↓縺ッ縲∵、懃エ「隱槭ョ蜑阪↓縲-縲阪r縺、縺代※縲√unix -linux縲阪↑縺ゥ縺ィ縺励※陦ィ迴セ縺励∪縺吶らイ礼払譖ク蠑上〒縺ッ縲√Ρ繧、繝ォ繝峨き繝シ繝峨↑縺ゥ縺ョ迚ケ谿頑ゥ溯ス縺ッ蜈ィ縺ヲ辟。蜉ケ縺ォ縺ェ繧翫∪縺吶

隲也炊蜥梧嶌蠑上ッ縲∫ゥコ逋ス縺ァ蛹コ蛻縺」縺溷推繝医シ繧ッ繝ウ縺ョOR譚。莉カ繧呈欠螳壹☆繧九b縺ョ縺ァ縺吶りォ也炊遨肴嶌蠑上ッ縲∫ゥコ逋ス縺ァ蛹コ蛻縺」縺溷推繝医シ繧ッ繝ウ縺ョAND譚。莉カ繧呈欠螳壹☆繧九b縺ョ縺ァ縺吶りォ也炊蜥梧嶌蠑上d隲也炊遨肴嶌蠑上↓縺翫>縺ヲ繧ゅ√Ρ繧、繝ォ繝峨き繝シ繝峨↑縺ゥ縺ョ迚ケ谿頑ゥ溯ス縺ッ蜈ィ縺ヲ辟。蜉ケ縺ォ縺ェ繧翫∪縺吶

螻樊ァ讀懃エ「譚。莉カ

螻樊ァ讀懃エ「譚。莉カ蠑縺ッ縲∝推譁譖ク縺梧戟縺、螻樊ァ縺ォ蟇セ縺励※貍皮ョ怜ュ舌r驕ゥ逕ィ縺励※縲∬ゥイ蠖薙☆繧区枚譖ク繧呈、懃エ「縺吶k縺溘a縺ョ繧ゅョ縺ァ縺吶ょア樊ァ譚。莉カ蠑上ッ螻樊ァ蜷阪→貍皮ョ怜ュ舌→蛟、繧堤ゥコ逋ス縺ァ蛹コ蛻縺」縺ヲ荳ヲ縺ケ縺溘b縺ョ縺ァ縺吶ゆセ九∴縺ー縲√@title STRINC 驥崎ヲ縲阪→謖螳壹☆繧九→縲√ち繧、繝医Ν縺ォ縲驥崎ヲ縲阪→縺縺譁蟄怜励r蜷ォ繧譁譖ク縺縺代↓邨槭j霎シ縺ソ縺セ縺吶ゅSTRINC縲阪ッ貍皮ョ怜ュ舌〒縺吶ょア樊ァ讀懃エ「逕ィ縺ョ貍皮ョ怜ュ舌↓縺ッ莉・荳九ョ繧ゅョ縺後≠繧翫∪縺吶

  • STREQ : 謖螳壹@縺滓枚蟄怜励→荳閾エ縺吶k縲
  • STRNE : 謖螳壹@縺滓枚蟄怜励→荳閾エ縺励↑縺縲
  • STRINC : 謖螳壹@縺滓枚蟄怜励r蜷ォ繧縲
  • STRBW : 謖螳壹@縺滓枚蟄怜励〒蟋九∪繧九
  • STREW : 謖螳壹@縺滓枚蟄怜励〒邨ゅo繧九
  • STRAND : 謖螳壹@縺滓枚蟄怜励ョ蜈ィ縺ヲ縺ョ繝医シ繧ッ繝ウ繧貞性繧縲
  • STROR : 謖螳壹@縺滓枚蟄怜励ョ荳縺、莉・荳翫ョ繝医シ繧ッ繝ウ繧貞性繧縲
  • STROREQ : 謖螳壹@縺滓枚蟄怜励ョ荳縺、莉・荳翫ョ繝医シ繧ッ繝ウ縺ィ荳閾エ縺吶k縲
  • STRRX : 謖螳壹@縺滓枚蟄怜励ョ豁」隕剰。ィ迴セ縺ォ蜷郁エ縺吶k縲
  • NUMEQ : 謨ー蛟、繧譌・莉倥′謖螳壹@縺溘b縺ョ縺ィ遲峨@縺縲
  • NUMNE : 謨ー蛟、繧譌・莉倥′謖螳壹@縺溘b縺ョ縺ィ遲峨@縺上↑縺縲
  • NUMGT : 謨ー蛟、繧譌・莉倥′謖螳壹@縺溘b縺ョ繧医j螟ァ縺阪>縲
  • NUMGE : 謨ー蛟、繧譌・莉倥′謖螳壹@縺溘b縺ョ縺ィ蜷後§縺九h繧雁、ァ縺阪>縲
  • NUMLT : 謨ー蛟、繧譌・莉倥′謖螳壹@縺溘b縺ョ繧医j蟆上&縺縲
  • NUMLE : 謨ー蛟、繧譌・莉倥′謖螳壹@縺溘b縺ョ縺ィ蜷後§縺九h繧雁ー上&縺縲
  • NUMBT : 謨ー蛟、繧譌・莉倥′謖螳壹@縺溘b縺ョ縺ョ髢薙〒縺ゅk縲

貍皮ョ怜ュ舌ョ蜑阪↓縲!縲阪r鄂ョ縺縺ヲ縲!STREQ縲阪↑縺ゥ縺ィ縺吶k縺ィ縲∵擅莉カ縺ォ蠖薙※縺ッ縺セ繧峨↑縺繧ゅョ縺ォ邨槭j霎シ縺ソ縺セ縺吶ゆセ九∴縺ー縲√@title !STRBW 窶サ譛ェ謇ソ隲セ蠎蜻縲阪↑縺ゥ縺ィ縺励∪縺吶よ枚蟄怜励ョ貍皮ョ怜ュ舌ョ蜑阪↓縲I縲阪r鄂ョ縺縺ヲ縲ISTREQ縲阪↑縺ゥ縺ィ縺吶k縺ィ縲∵枚蟄怜励ョ螟ァ譁蟄励→蟆乗枚蟄励ョ驕輔>繧堤┌隕悶@縺セ縺吶ゅ!縲阪→縲I縲阪r荳。譁ケ謖螳壹☆繧句エ蜷医√!ISTREQ縲阪↑縺ゥ縺ィ縺励∪縺吶よシ皮ョ怜ュ舌r逵∫払縺励※螻樊ァ蜷阪ョ縺ソ繧呈欠螳壹@縺溷エ蜷医∝、縺ッ蝠上o縺壹↓縲√◎縺ョ螻樊ァ繧貞y縺医k譁譖ク繧定ゥイ蠖薙→縺ソ縺ェ縺励∪縺吶STRAND縺ィSTROR縺ィSTROREQ縺ィNUMBT縺ッ遨コ逋ス縺ァ蛹コ蛻縺」縺溯、謨ー縺ョ譁蟄怜励r蠑墓焚縺ォ蜿悶j縺セ縺吶ゅNUMBT 51 100縲阪ッ縲√51縺九i100縺セ縺ァ縲阪→縺縺諢丞袖縺ァ縺ゅj縲∝「逡悟、繧らッ蝗イ縺ォ蜷ォ縺ソ縺セ縺吶

螻樊ァ蜷阪r縲,縲阪〒蛹コ蛻縺」縺ヲ荳ヲ縺ケ繧九→縲∽クヲ縺ケ縺溷ア樊ァ縺ョ縺縺壹l縺九→縺縺諢丞袖縺ォ縺ェ繧翫∪縺吶ゆセ九∴縺ー縲from,to,cc STRINC mikio縲阪ッ縲√掲rom縺逆o縺議c縺ョ縺ゥ繧後°縺ォmikio繧貞性繧縲阪→縺縺諢丞袖縺ォ縺ェ繧翫∪縺吶ゅ,縲阪ョ蜑榊セ後↓遨コ逋ス繧貞・繧後※縺ッ縺縺代∪縺帙s縲

螻樊ァ譚。莉カ縺ッ隍謨ー謖螳壹☆繧九%縺ィ縺後〒縺阪∪縺吶ゅ◎縺ョ蝣エ蜷医∵欠螳壹&繧後◆蜈ィ縺ヲ縺ョ譚。莉カ繧呈コ縺溘☆譁譖ク縺瑚ゥイ蠖薙→縺ソ縺ェ縺輔l縺セ縺吶ゅ↑縺翫∝ア樊ァ讀懃エ「繧定。後≧縺ィ蛟呵」懊ョ蜈ィ縺ヲ縺ョ譁譖ク縺ョ諠蝣ア繧貞盾辣ァ縺吶k縺溘a縲∵、懃エ「騾溷コヲ縺悟、壼ー鷹≦縺上↑繧翫∪縺吶ょセ瑚ソー縺ョ螻樊ァ繧、繝ウ繝繝繧ッ繧ケ繧剃スソ縺縺ィ螻樊ァ讀懃エ「繧帝ォ倬溷喧縺吶k縺薙→縺後〒縺阪∪縺吶

鬆蠎乗欠螳

鬆蠎乗欠螳壼シ縺ォ繧医▲縺ヲ縲∫オ先棡縺ョ陦ィ遉コ鬆蠎上r謖螳壹☆繧九%縺ィ繧ゅ〒縺阪∪縺吶る蠎乗欠螳壼シ上ッ螻樊ァ蜷阪→貍皮ョ怜ュ舌r遨コ逋ス縺ァ蛹コ蛻縺」縺ヲ荳ヲ縺ケ縺溘b縺ョ縺ァ縺吶ゆセ九∴縺ー縲√@size NUMA縲阪→謖螳壹☆繧九→縲√し繧、繧コ縺悟ー上&縺譁譖ク縺九i荳ヲ縺ケ繧峨l縺セ縺吶ゅNUMA縲阪ッ貍皮ョ怜ュ舌〒縺吶る蠎乗欠螳夂畑縺ョ貍皮ョ怜ュ舌↓縺ッ莉・荳九ョ繧ゅョ縺後≠繧翫∪縺吶よシ皮ョ怜ュ舌r逵∫払縺励◆蝣エ蜷医ッ縲√STRA縲阪′謖螳壹&繧後◆縺ィ縺ソ縺ェ縺励∪縺吶

  • STRA : 譁蟄怜暦シ郁セ樊嶌鬆シ峨ョ譏鬆縲
  • STRD : 譁蟄怜暦シ郁セ樊嶌鬆シ峨ョ髯埼縲
  • NUMA : 謨ー蛟、縺セ縺溘ッ譌・莉倥ョ譏鬆縲
  • NUMD : 謨ー蛟、縺セ縺溘ッ譌・莉倥ョ髯埼縲

鬆蠎乗欠螳壹r陦後o縺ェ縺九▲縺溷エ蜷医ッ縲√せ繧ウ繧「縺ョ髯埼縺ォ縺ェ繧翫∪縺吶ゅせ繧ウ繧「縺ィ縺ッ縲∝推譁譖ク縺ォ謖螳壹@縺滓、懃エ「隱槭′縺ゥ縺ョ縺上i縺蜷ォ縺セ繧後k縺九→縺縺謖讓吶〒縺吶AND讀懃エ「繧ОR讀懃エ「縺ァ隍謨ー縺ョ隱槭′謖螳壹&繧後◆蝣エ蜷医ゝF-IDF豕輔↓蝓コ縺・縺縺ヲ繧ケ繧ウ繧「縺ョ隱ソ謨エ縺瑚。後o繧後∪縺吶ゅthe縲阪d縲縺吶k縲阪→縺縺」縺滄サ蜃コ隱槭h繧翫b縲√hippopotamus縲阪d縲蜥蝴シ縲阪→縺縺」縺溽音蠕エ逧縺ェ隱槫唱縺ォ鬮倥>繧ケ繧ウ繧「繧偵▽縺代k縺ィ縺縺縺薙→縺ァ縺吶ゅ∪縺溘∵、懃エ「隱槭′蜷梧焚遞句コヲ蜷ォ縺セ繧後k縺ェ繧峨ー縲∫キ剰ェ樊焚縺ョ螟壹>譁譖ク繧医j繧らキ剰ェ樊焚縺ョ蟆代↑縺譁譖ク縺ョ譁ケ縺後せ繧ウ繧「縺碁ォ倥¥縺ェ繧翫∪縺吶ゅせ繧ウ繧「縺ョ譏鬆縺ォ荳ヲ縺ケ縺溘>蝣エ蜷医ッ縲∝ア樊ァ蜷阪r逵√>縺ヲ蜊倥↓縲[SCA]縲阪→謖螳壹@縺ヲ縺上□縺輔>縲

鬆蠎乗欠螳壼シ上ッ荳縺、縺励°謖螳壹〒縺阪∪縺帙s縲ゅ↑縺翫鬆蠎乗欠螳壹r陦後≧縺ィ蛟呵」懊ョ蜈ィ縺ヲ縺ョ譁譖ク縺ョ諠蝣ア繧貞盾辣ァ縺吶k縺溘a縲∵、懃エ「騾溷コヲ縺悟、壼ー鷹≦縺上↑繧翫∪縺吶

鬘樔シシ讀懃エ「

縺ゅk譁譖ク縺ォ莨シ縺滓枚譖ク繧呈爾縺吶鬘樔シシ讀懃エ「蠑繧ゅし繝昴シ繝医&繧後∪縺吶る未騾」譁譖ク讀懃エ「縺ィ繧ょ他縺ー繧後k縺薙→繧ゅ≠繧翫∪縺吶る。樔シシ讀懃エ「縺ョ蛻ゥ逕ィ譁ケ豕輔ッ繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ォ繧医▲縺ヲ讒倥縺ァ縺吶′縲∝ク蝙狗噪縺ォ縺ッ縲∵、懃エ「邨先棡縺ォ遉コ縺輔l繧区枚譖ク縺ョ縺イ縺ィ縺、繧偵Θ繝シ繧カ縺梧欠螳壹@縺ヲ縲√◎繧後↓莨シ縺滓枚譖ク繧貞肴、懃エ「縺吶k縺溘a縺ォ菴ソ繧上l縺セ縺吶estseek.cgi縺ョ蝣エ蜷医√[similar]縲阪→縺縺繝ェ繝ウ繧ッ繧帝∈謚槭☆繧九→鬘樔シシ讀懃エ「繧定。後≧縺薙→縺後〒縺阪∪縺吶る。樔シシ讀懃エ「縺ョ邨先棡縺ッ鬘樔シシ蠎ヲ縺ョ髯埼縺ォ荳ヲ縺ケ繧峨l縺セ縺吶る。樔シシ蠎ヲ縺ッ繝吶け繝医Ν遨コ髢薙Δ繝繝ォ縺ィ縺縺閠縺域婿縺ォ蝓コ縺・縺縺ヲ邂怜コ縺輔l縺セ縺吶よ枚譖ク縺九i繧ュ繝シ繝ッ繝シ繝峨r蜿悶j蜃コ縺励※繝吶け繝医Ν縺ィ縺励※陦ィ迴セ縺励√吶け繝医Ν蜷悟」ォ縺ョ縺ェ縺呵ァ偵ョ菴吝シヲ繧帝。樔シシ蠎ヲ縺ィ縺吶k繧ゅョ縺ァ縺吶ゅ■繧縺」縺ィ髮」縺励>險縺譁ケ縺ォ縺ェ繧翫∪縺励◆縺後∬ヲ√☆繧九↓縲∬ェ槫ス吶′莨シ騾壹▲縺滓枚譖ク縺ッ鬘樔シシ蠎ヲ縺碁ォ倥¥縺ェ繧九→縺縺縺薙→縺ァ縺吶ゅく繝シ繝ッ繝シ繝峨→縺励※縺ッ縲∵枚譖ク蜀縺ョ鬆サ蠎ヲ縺ォTF-IDF豕輔〒驥阪∩縺・縺代r陦後▲縺溽オ先棡縺御ク贋ス阪ョ隱槫唱縺碁∈謚槭&繧後∪縺吶

鬘樔シシ讀懃エ「蠑上r繝ヲ繝シ繧カ縺悟・蜉帙☆繧句ソ隕√ッ縺ゅj縺セ縺帙s縺後√い繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ォ鬘樔シシ讀懃エ「讖溯ス繧偵▽縺代k縺溘a縺ォ縺ッ譖ク蠑上r遏・縺」縺ヲ縺翫¥蠢隕√′縺ゅj縺セ縺吶よ、懃エ「繝輔Ξ繝シ繧コ縺後[SIMILAR]縲阪→縺縺貍皮ョ怜ュ舌〒蟋九∪縺」縺ヲ縺繧句エ蜷医↓鬘樔シシ讀懃エ「縺瑚。後o繧後∪縺吶ゅ[SIMILAR]縲阪ョ蠕後m縺ォ縺ッ縲∫ィョ譁譖クシ磯。樔シシ蛻、螳壹ョ蜈縺ィ縺ェ繧区枚譖クシ峨ョ繝吶け繝医Ν縺ョ隕∫エ繧貞玲嫌縺励∪縺吶ょ推隕∫エ縺ッ縲WITH縲肴シ皮ョ怜ュ舌〒蟋九∪繧翫√せ繧ウ繧「縺ョ謨ー蛟、縺ィ繧ュ繝シ繝ッ繝シ繝峨ョ譁蟄怜励r遨コ逋ス縺ァ蛹コ蛻縺」縺ヲ謖螳壹@縺セ縺吶ゆセ九∴縺ー縲300縺ョ縲譌・譛ャ縲阪→250縺ョ縲japan縲阪→100縺ョ縲譚ア莠ャ縲阪r蜷ォ繧譁譖ク繧剃サョ諠ウ縺ョ遞ョ譁譖ク縺ィ縺吶k蝣エ蜷医ッ縲√[SIMILAR] WITH 300 譌・譛ャ WITH 250 japan WITH 100 譚ア莠ャ縲阪→謖螳壹@縺セ縺吶

[SIMILAR] 24 2048 8192 WITH 300 譌・譛ャ WITH 250 japan縲阪ョ繧医≧縺ォ縲∵シ皮ョ怜ュ舌ョ蠕後↓遨コ逋ス縺ァ蛹コ蛻縺」縺ヲ3縺、縺ョ謨ー蛟、繧呈欠螳壹☆繧九%縺ィ縺後〒縺阪∪縺吶ゅ%縺ョ萓九ョ蝣エ蜷医√く繝シ繝ッ繝シ繝峨ョ荳贋ス24隱槭ョ蜷縲縺ォ隧イ蠖薙☆繧区枚譖ク繧2048莉カ縺壹▽蜿悶j蜃コ縺励√◎縺ョ蜥碁寔蜷医°繧峨せ繧ウ繧「縺御ク贋ス阪ョ8192莉カ縺ョ譁譖ク繧帝。樔シシ蠎ヲ蛻、螳壹ョ蛟呵」懊→縺励※驕ク縺カ縺ィ縺縺縺薙→繧呈э蜻ウ縺励∪縺吶ゅョ繝輔か繝ォ繝医〒縺ッ荳贋ス16隱槭°繧牙推縲1024莉カ繧貞叙繧雁コ縺励※荳贋ス4096莉カ繧貞呵」懊→縺励∪縺吶

髢「騾」譁譖ク讀懃エ「縺ィ鬆蠎乗欠螳壼シ上r蜷梧凾縺ォ謖螳壹@縺溷エ蜷医鬘樔シシ蠎ヲ縺0.5莉・荳翫ョ譁譖ク縺ォ邨槭j霎シ繧薙□荳翫〒縲鬆蠎乗欠螳壼シ上↓蝓コ縺・縺縺ヲ荳ヲ縺ケ繧峨l縺セ縺吶ゅ↑縺翫髢「騾」譁譖ク讀懃エ「縺ョ讀懃エ「騾溷コヲ縺ッ縺ィ縺ヲ繧る≦縺縺ァ縺吶ょセ瑚ソー縺ョ繧ュ繝シ繝ッ繝シ繝峨ョ繝シ繧ソ繝吶シ繧ケ繧剃スソ縺縺ィ鬘樔シシ讀懃エ「繧帝ォ倬溷喧縺吶k縺薙→縺後〒縺阪∪縺吶

鬘樔シシ髫阡ス

讀懃エ「邨先棡縺ォ莨シ縺溘h縺縺ェ譁譖ク縺ー縺九j縺御クヲ繧薙〒鬯ア髯カ縺励>蝣エ蜷医ッ縲鬘樔シシ髫阡ス讖溯ス繧貞茜逕ィ縺励※縺上□縺輔>縲る。樔シシ髫阡ス讖溯ス縺ョ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縺ッ繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ォ繧医▲縺ヲ逡ー縺ェ繧翫∪縺吶′縲0.0縺九i1.0縺セ縺ァ縺ョ鬘樔シシ蠎ヲ繧呈欠螳壹@縺セ縺吶ゅ☆繧九→縲∵、懃エ「邨先棡縺ョ蜷縲縺ョ譁譖ク縺ォ蟇セ縺励※縲∵欠螳壹@縺溷、繧定カ翫∴繧矩。樔シシ蠎ヲ繧呈戟縺、莉悶ョ譁譖ク繧帝阪ュ繧句ヲ逅繧定。後>縺セ縺吶る阪↑縺」縺滓枚譖ク鄒、縺ョ荳ュ縺ァ陦ィ遉コ縺輔l繧九ョ縺ッ譛繧る菴阪ョ鬮倥>繧ゅョ縺縺代〒縺吶る。樔シシ蠎ヲ縺ョ謖螳壹ッ0.7縺九i0.9縺セ縺ァ縺ョ髢薙↓縺吶k縺ィ菴ソ縺繧縺吶>縺ァ縺励g縺縲

鬘樔シシ蠎ヲ縺ォ縲file縲阪r謖螳壹@縺溷エ蜷医∝酔縺倥ヵ繧。繧、繝ォ縺ォ蟇セ縺吶k逡ー縺ェ繧偽RLシCGI遲峨ョ繧ッ繧ィ繝ェ譁蟄怜励↑縺ゥシ峨ョ譁譖ク繧帝國阡ス縺励∪縺吶ゅdir縲阪r謖螳壹@縺溷エ蜷医∝酔縺倥ョ繧」繝ャ繧ッ繝医Μ蜀縺ォ縺ゅk譁譖ク繧帝國阡ス縺励∪縺吶ゅserv縲阪r謖螳壹@縺溷エ蜷医∝酔縺倥し繝シ繝仙縺ォ縺ゅk譁譖ク繧帝國阡ス縺励∪縺吶

ID讀懃エ「縺ィURI讀懃エ「

讀懃エ「繝輔Ξ繝シ繧コ縺後[ID]縲阪〒蟋九∪縺」縺ヲ縺繧句エ蜷医↓縺ッID讀懃エ「縺瑚。後o繧後∪縺吶よ欠螳壹@縺櫑D逡ェ蜿キ縺ョ譁譖ク縺ョ縺ソ縺瑚ゥイ蠖薙@縺セ縺吶ゆセ九∴縺ー縲√[ID] 5縲阪ョ繧医≧縺ォ縺励∪縺吶よ、懃エ「繝輔Ξ繝シ繧コ縺後[URI]縲阪〒蟋九∪縺」縺ヲ縺繧句エ蜷医↓縺ッURI讀懃エ「縺瑚。後o繧後∪縺吶よ欠螳壹@縺欟RI縺ョ譁譖ク縺ョ縺ソ縺瑚ゥイ蠖薙@縺セ縺吶ゆセ九∴縺ー縲√[URI] http://estraier.gov/foo.html縲阪ョ繧医≧縺ォ縺励∪縺吶ゅ%繧後i縺ォ繧医▲縺ヲ縲∵、懃エ「繧ウ繝槭Φ繝会シestcmd searchシ峨r蜿門セ励さ繝槭Φ繝会シestcmd getシ峨ョ莉」逕ィ縺ィ縺励※菴ソ縺縺薙→縺後〒縺阪∪縺吶


讀懃エ「隱槭ョ謚ス蜃コ

譁譖ク縺ョ譛ャ譁繧讀懃エ「繝輔Ξ繝シ繧コ縺ョ譁蟄怜励°繧画、懃エ「隱槭r謚ス蜃コ縺吶k髫帙↓縺ッ縲√>縺上▽縺九ョ繝ォ繝シ繝ォ縺後≠繧翫∪縺吶ゅ%縺薙〒縺ッ縲√◎縺ョ繝ォ繝シ繝ォ縺、縺縺ヲ隧ウ縺励¥隱ャ譏弱@縺セ縺吶

讀懃エ「隱槭ョ謚ス蜃コ

闍ア隱槭d縺昴ョ莉悶ョ繝ィ繝シ繝ュ繝繝代ョ險隱槭↓縺ョ繧医≧縺ォ遨コ逋ス縺ァ隱槭′蛹コ蛻繧後k蝣エ蜷医∫ゥコ逋ス縺ァ蛹コ蛻縺」縺滓枚蟄怜励r讀懃エ「隱槭→縺励※逋サ骭イ縺励∪縺吶ゅIt is fine today.縲阪→縺縺譁蟄怜励°繧峨ッ縲√it縲阪is縲阪fine縲阪today縲阪.縲阪ョ5蛟九ョ讀懃エ「隱槭′謚ス蜃コ縺輔l縺セ縺吶

譌・譛ャ隱槭r縺ッ縺倥a縺ィ縺吶k縲∬ェ槭r遨コ逋ス縺ァ蛹コ蛻繧後↑縺險隱槭ョ蝣エ蜷医ッ縲¨-gram縺ィ縺縺謇区ウ輔〒讀懃エ「隱槭′謚ス蜃コ縺輔l縺セ縺吶る」邯壹☆繧起譁蟄励r隱槭→縺励※縲1譁蟄励★縺、縺壹i縺励↑縺後i隱槭r謚ス蜃コ縺吶k謇区ウ輔〒縺吶Hyper Estraier縺ァ縺ッ2譁蟄励r隱槭→縺吶k縺ョ縺ァ2-gramシbi-gramシ峨→蜻シ縺ー繧後k縺薙→繧ゅ≠繧翫∪縺吶ゆセ九∴縺ー縲梧悽譌・縺ッ譎エ螟ゥ縺ェ繧翫ゅ阪→縺縺譁蟄怜励°繧峨ッ縲√譛ャ譌・縲阪譌・縺ッ縲阪縺ッ譎エ縲阪譎エ螟ゥ縲阪螟ゥ縺ェ縲阪縺ェ繧縲阪繧翫縲阪ョ7蛟九ョ讀懃エ「隱槭′謚ス蜃コ縺輔l縺セ縺吶

2-gram譁ケ蠑上□縺ィ1譁蟄励ョ讀懃エ「隱槭ッ縺ゥ縺ョ讀懃エ「繧ュ繝シ縺ォ繧ゆク閾エ縺励↑縺縺薙→縺ォ縺ェ繧翫∪縺吶′縲√◎繧後〒繧よ、懃エ「縺ッ蜿ッ閭ス縺ァ縺吶1譁蟄励ョ讀懃エ「隱槭′謖螳壹&繧後◆蝣エ蜷医√◎縺ョ譁蟄励r蜷ォ繧蜈ィ縺ヲ縺ョ繧ュ繝シ縺ョOR讀懃エ「縺悟驛ィ逧縺ォ陦後o繧後∪縺吶ゅ◆縺縺励∬ェソ縺ケ繧九く繝シ縺ョ謨ー縺悟、壹>縺ョ縺ァ縲∵、懃エ「騾溷コヲ縺ッ蟆代@驕縺上↑繧翫∪縺吶

讀懈渊縺ョ逵∫払縺ォ繧医k鬮倬溷喧

繝帙Φ繝槭げ繝ュ縲阪→縺縺讀懃エ「隱槭′謖螳壹&繧後◆蝣エ蜷医繝帙Φ縲阪繝ウ繝縲阪繝槭げ縲阪繧ー繝ュ縲阪r蜷ォ縺ソ縲√°縺、縺昴l縺槭l縺碁團繧雁粋縺」縺ヲ縺繧矩Κ蛻縺後≠繧区枚譖ク繧定ゥイ蠖薙→縺ソ縺ェ縺帙ー繧医>縺薙→縺ォ縺ェ繧翫∪縺吶ゅ@縺九@縲√ョ繝輔か繝ォ繝医〒縺ッ蜈ィ縺ヲ縺ョ隱槭r縺ョ讀懈渊繧偵○縺壹√繝帙Φ縲阪→縲繝槭げ縲阪□縺代r隱ソ縺ケ縺セ縺吶ゅ後帙Φ縲阪ョ1縺、鬟帙ー縺励◆髫」縺ォ縲繝槭げ縲阪′縺ゅk縺ェ繧峨ー縲√繝ウ繝縲阪r隱ソ縺ケ繧句ソ隕√ッ縺ェ縺縺九i縺ァ縺吶ゅ∪縺溘∝推讀懃エ「隱槭ッ蠕後m縺ォ縺ェ縺ォ縺梧擂繧九°縺ィ縺縺諠蝣ア繧呈戟縺」縺ヲ縺繧九ョ縺ァ縲√繝槭げ縲阪r隱ソ縺ケ繧九→縲繧ー繝ュ縲阪ョ蟄伜惠繧ゅo縺九j縺セ縺吶ゅ%縺ョ繧医≧縺ェ蟾・螟ォ繧偵@縺ヲ縺ェ繧九∋縺乗、懈渊繧堤怐逡・縺励◆譁ケ縺後∝ソ懃ュ疲凾髢薙′遏ュ縺上↑縺」縺ヲ蠢ォ驕ゥ縺ァ縺吶

縺溘□縺励√せ繧ウ繧「縺ョ險育ョ励ッ縲∬ェソ縺ケ縺滓、懃エ「隱槭′蜷隧イ蠖捺枚譖ク縺ョ荳ュ縺ァ蜃コ迴セ縺吶k謨ー繧貞渕貅悶↓陦後≧縺ョ縺ァ縲∝ィ縺ヲ縺ョ隱槭r隱ソ縺ケ縺滓婿縺檎イセ蠎ヲ縺碁ォ倥∪繧九%縺ィ縺悟、壹>縺ァ縺吶ゅ▽縺セ繧翫騾溷コヲ縺ィ邊セ蠎ヲ縺ョ繝医Ξ繝シ繝峨が繝輔ョ髢「菫ゅ↓縺ェ繧翫∪縺吶ゅ←縺。繧峨r蜆ェ蜈医☆繧九°縺ッ繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ繧ウ繝槭Φ繝峨Λ繧、繝ウ繧ェ繝励す繝ァ繝ウ繧險ュ螳壹ヵ繧。繧、繝ォ縺ァ謖螳壹@縺セ縺吶estseek.cgi縺ョ繝繝輔か繝ォ繝医ョ險ュ螳壹〒縺ッ1蛟矩」帙ー縺励〒讀懈渊縺吶k繧医≧縺ォ縺ェ縺」縺ヲ縺縺セ縺吶

邊セ蠎ヲ縺ョ蛻カ髯舌↓繧医k鬮倬溷喧

Hyper Estraier縺ァ縺ッ縲¨-gram縺ョ騾」謗・蛻、螳壹ョ邊セ蠎ヲ繧定誠縺ィ縺吶%縺ィ縺ォ繧医▲縺ヲ蜃ヲ逅騾溷コヲ繧剃ク翫£繧句キ・螟ォ縺後↑縺輔l縺ヲ縺縺セ縺吶よ、懃エ「繧繧、繝ウ繝繝繧ッ繧ケ譖エ譁ー縺ョ蜃ヲ逅縺碁ォ倬溘↑蜿埼擇縲√∪繧後↓讀懃エ「隱槭′蜷ォ縺セ繧後↑縺譁譖ク縺瑚ゥイ蠖薙→縺ソ縺ェ縺輔l繧九%縺ィ縺後≠繧翫∪縺吶よ、懃エ「隱槭ョ蠕後m2隱槭∪縺ァシ域律譛ャ隱槭↑繧3譁蟄怜シ峨ョ騾」謗・蛻、螳壹@縺九@縺セ縺帙s縺ョ縺ァ縲√繧キ繝溘Η繝ャ繝シ繧キ繝ァ繝ウ縲阪〒讀懃エ「縺励◆蝣エ蜷医√繧キ繝溘Η繝ャ縲阪繝溘Η繝ャ繝シ縲阪繝・繝ャ繝シ繧キ縲阪繝ャ繝シ繧キ繝ァ縲阪繝シ繧キ繝ァ繝ウ縲阪ョ蜈ィ縺ヲ繧貞性繧譁譖ク縺ッ縲√◆縺ィ縺医繧キ繝溘Η繝ャ繝シ繧キ繝ァ繝ウ縲阪′縺ェ縺上※繧りゥイ蠖薙@縺ヲ縺励∪縺縺セ縺吶ゅ∪縺溘騾」謗・蛻、螳壹↓縺ッ繝上ャ繧キ繝・髢「謨ー繧堤畑縺縺セ縺吶ョ縺ァ縲√∪繧鯉シ251蛻縺ョ1縺ョ遒コ邇シ峨↓邊セ蠎ヲ縺3隱槫繧剃ク句屓繧九%縺ィ縺後≠繧翫∪縺吶

縺溘□縺励√せ繝九壹ャ繝医r菴懊k髫帙↓縺ッ譁蟄怜励ョ騾先ャ。謗「邏「縺ォ繧医k螳悟ィ縺ェ騾」謗・蛻、螳壹′陦後o繧後∪縺吶ョ縺ァ縲√せ繝九壹ャ繝医ョ荳ュ縺ォ讀懃エ「隱槭ョ繝上う繝ゥ繧、繝医′蜷ォ縺セ繧後↑縺譁譖ク縺ッ讀懃エ「繧エ繝溘〒縺ゅk縺薙→縺悟ョケ譏薙↓繧上°繧翫∪縺吶ゅ↑縺翫estseek.cgi縺ォ縺ッ縲∵、懃エ「繧エ繝溘〒縺ゅk縺薙→繧呈、懷コ縺励※陦ィ遉コ縺励↑縺繧医≧縺ォ縺吶k繧ェ繝励す繝ァ繝ウ繧ゅ≠繧翫∪縺吶

蛻縺九■譖ク縺肴婿蠑上→縺ョ豈碑シ

N-gram譁ケ蠑上→蟇セ豈斐&繧後k繧「繝励Ο繝シ繝√→縺励※縲∝縺九■譖ク縺肴婿蠑上′縺ゅj縺セ縺吶りェ辟カ險隱槭ョ譁豕輔d隱樊ウ輔↓蝓コ縺・縺乗婿豕輔〒蜊倩ェ槭d蠖「諷狗エ繧貞繧雁コ縺吶b縺ョ縺ァ縺吶Hyper Estraier縺ョ蜑崎コォ縺ァ縺ゅkEstraier縺ァ縺ッ蛻縺九■譖ク縺肴婿蠑上r謗。逕ィ縺励※縺縺セ縺励◆縲N-gram譁ケ蠑上ッ蜀咲樟邇縺後⊇縺シ螳檎挑縺ァ縺ゅkシ域、懃エ「貍上l縺後↑縺シ峨→縺縺蛻ゥ轤ケ縺後≠繧翫∪縺吶′縲∝縺九■譖ク縺肴婿蠑上↓豈斐∋縺ヲ邊セ蠎ヲ縺御ス弱>シ域、懃エ「繧エ繝溘′螟壹>シ峨→縺縺谺轤ケ縺後≠繧翫∪縺吶よ、懃エ「繧キ繧ケ繝繝縺ョ逕ィ騾斐d蟇セ雎。譁譖ク縺ョ蜀螳ケ縺ォ繧医▲縺ヲ縺ゥ縺。繧峨′驕ゥ縺吶k縺九ッ螟峨o縺」縺ヲ縺阪∪縺吶り亥袖繧呈戟縺溘l縺滓婿縺ッ縲?yper Estraier縺ィEstraier縺ョ菴ソ縺蜍晄焔繧呈ッ斐∋縺ヲ縺ソ縺ヲ縺上□縺輔>縲

Hyper Estraier縺ォ縺ッ縲¨-gram譁ケ蠑上→蛻縺九■譖ク縺肴婿蠑上r菴オ逕ィ縺吶k繧ェ繝励す繝ァ繝ウ繧ゅ≠繧翫∪縺吶N-gram縺ァ謚ス蜃コ縺励◆隱槭°繧峨↑繧九Γ繧、繝ウ繧、繝ウ繝繝繧ッ繧ケ縺ィ縺ッ蛻・縺ォ縲∝縺九■譖ク縺阪〒謚ス蜃コ縺励◆驥崎ヲ∬ェ槭□縺代°繧峨↑繧玖」懷勧繧、繝ウ繝繝繧ッ繧ケ繧堤ョ。逅縺励∪縺吶ゅ◎縺縺吶k縺ィ縲∵、懃エ「隱槭′驕ゥ蛻縺ォ蛻縺九■譖ク縺阪〒縺阪◆蝣エ蜷医ッ縲∬」懷勧繧、繝ウ繝繝繧ッ繧ケ繧定ヲ九※縲鬮倬溘〒鬮倡イセ蠎ヲ縺ェ讀懃エ「繧定。後≧縺薙→縺後〒縺阪∪縺吶ょ縺九■譖ク縺阪′縺縺セ縺剰。後∴縺ェ縺九▲縺溷エ蜷医b縲√Γ繧、繝ウ繧、繝ウ繝繝繧ッ繧ケ繧定ヲ九l縺ー縲∵、懃エ「貍上l縺ョ縺ェ縺邨先棡繧呈署遉コ縺吶k縺薙→縺後〒縺阪∪縺吶


邂。逅逕ィ繧ウ繝槭Φ繝

縺薙%縺ァ縺ッ縲√う繝ウ繝繝繧ッ繧ケ邂。逅逕ィ繧ウ繝槭Φ繝estcmd縺ョ隧ウ邏ー縺ェ莉墓ァ倥r隱ャ譏弱@縺セ縺吶よ、懃エ「繧ゅ〒縺阪k縺ョ縺ァ縲estcmd繧偵せ繧ッ繝ェ繝励ヨ險隱槭°繧牙他縺ウ蜃コ縺帙ー縺昴l縺ェ繧翫ョ繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺檎ー。蜊倥↓菴懊l縺セ縺吶

譖ク蠑

estcmd縺ッ螟壹¥縺ョ繧オ繝悶さ繝槭Φ繝峨ョ髮蜷井ス薙〒縺吶ゅし繝悶さ繝槭Φ繝峨ョ蜷榊燕縺ッ隨ャ1蠑墓焚縺ァ謖螳壹&繧後∪縺吶ゅ◎縺ョ莉悶ョ蠑墓焚縺ッ繧オ繝悶さ繝槭Φ繝峨ョ遞ョ鬘槭↓蠢懊§縺ヲ隗」驥医&繧後∪縺吶db縺ィ縺縺蠑墓焚縺ッ繧、繝ウ繝繝繧ッ繧ケ縺ョ繝代せ縺ァ縺吶

estcmd create [-tr] [-apn|-acc] [-xs|-xl|-xh|-xh2|-xh3] [-sv|-si|-sa] [-attr name type] db
繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-tr繧偵▽縺代k縺ィ縲∵里縺ォ繧、繝ウ繝繝繧ッ繧ケ縺後≠繧句エ蜷医↓繧よ眠縺励>繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-apn繧偵▽縺代k縺ィ縲∝ィ縺ヲ縺ョ險隱槭rN-gram豕輔〒蜃ヲ逅縺励∪縺吶
-acc繧偵▽縺代k縺ィ縲¨-gram豕輔ョ莉」繧上j縺ォ譁蟄礼ィョ蛻鬘樊ウ輔r蛻ゥ逕ィ縺励∪縺吶
-xs繧偵▽縺代k縺ィ縲50000莉カ譛ェ貅縺ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-xl繧偵▽縺代k縺ィ縲300000莉カ莉・荳翫ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-xh繧偵▽縺代k縺ィ縲1000000莉カ莉・荳翫ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-xh2繧偵▽縺代k縺ィ縲5000000莉カ莉・荳翫ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-xh3繧偵▽縺代k縺ィ縲10000000莉カ莉・荳翫ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-sv繧偵▽縺代k縺ィ縲√せ繧ウ繧「諠蝣ア繧堤エ譽縺励∪縺吶
-si繧偵▽縺代k縺ィ縲√せ繧ウ繧「諠蝣ア繧32繝薙ャ繝医ョ謨ー蛟、縺ィ縺励※險倬鹸縺励∪縺吶
-sa繧偵▽縺代k縺ィ縲√せ繧ウ繧「諠蝣ア繧偵◎縺ョ縺セ縺セ菫晏ュ倥@縺滉ク翫〒讀懃エ「譎ゅ↓隱ソ謨エ縺輔l縺ェ縺繧医≧縺ォ繝槭シ繧ッ縺励∪縺吶
-attr縺ッ螻樊ァ繧、繝ウ繝繝繧ッ繧ケ縺ョ蟇セ雎。縺ィ縺ェ繧句ア樊ァ蜷阪→繝繝シ繧ソ蝙九r謖螳壹@縺セ縺吶り、謨ー謖螳壼庄閭ス縺ァ縺吶
estcmd put [-tr] [-cl] [-ws] [-apn|-acc] [-xs|-xl|-xh|-xh2|-xh3] [-sv|-si|-sa] db [file]
譁譖ク繝峨Λ繝輔ヨ蠖「蠑上ョ繝輔ぃ繧、繝ォ繧堤匳骭イ縺励∪縺吶
file縺ッ蟇セ雎。縺ョ繝輔ぃ繧、繝ォ繧呈欠螳壹@縺セ縺吶′縲∫怐逡・縺励◆蝣エ蜷医ッ讓呎コ門・蜉帙′隱ュ縺ソ霎シ縺セ繧後∪縺吶
-tr繧偵▽縺代k縺ィ縲∵里縺ォ繧、繝ウ繝繝繧ッ繧ケ縺後≠繧句エ蜷医↓繧よ眠縺励>繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-cl繧剃サ倥¢繧九→縲∽ク頑嶌縺阪&繧後◆譁譖ク縺ョ鬆伜沺繧呈紛逅縺励∪縺吶
-ws繧剃サ倥¢繧九→縲驥阪∩莉倥¢螻樊ァ繧帝撕逧縺ォ驕ゥ逕ィ縺励∪縺吶
-apn繧偵▽縺代k縺ィ縲∝ィ縺ヲ縺ョ險隱槭rN-gram豕輔〒蜃ヲ逅縺励∪縺吶
-acc繧偵▽縺代k縺ィ縲¨-gram豕輔ョ莉」繧上j縺ォ譁蟄礼ィョ蛻鬘樊ウ輔r蛻ゥ逕ィ縺励∪縺吶
-xs繧偵▽縺代k縺ィ縲50000莉カ譛ェ貅縺ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-xl繧偵▽縺代k縺ィ縲300000莉カ莉・荳翫ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-xh繧偵▽縺代k縺ィ縲1000000莉カ莉・荳翫ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-xh2繧偵▽縺代k縺ィ縲5000000莉カ莉・荳翫ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-xh3繧偵▽縺代k縺ィ縲10000000莉カ莉・荳翫ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-sv繧偵▽縺代k縺ィ縲√せ繧ウ繧「諠蝣ア繧堤エ譽縺励∪縺吶
-si繧偵▽縺代k縺ィ縲√せ繧ウ繧「諠蝣ア繧32繝薙ャ繝医ョ謨ー蛟、縺ィ縺励※險倬鹸縺励∪縺吶
-sa繧偵▽縺代k縺ィ縲√せ繧ウ繧「諠蝣ア繧偵◎縺ョ縺セ縺セ菫晏ュ倥@縺滉ク翫〒讀懃エ「譎ゅ↓隱ソ謨エ縺輔l縺ェ縺繧医≧縺ォ繝槭シ繧ッ縺励∪縺吶
estcmd out [-cl] [-pc enc] db expr
迚ケ螳壹ョ譁譖ク縺ョ諠蝣ア繧偵う繝ウ繝繝繧ッ繧ケ縺九i蜑企勁縺励∪縺吶
expr縺ッ蟇セ雎。縺ョID逡ェ蜿キ縺偽RI縺九Ο繝シ繧ォ繝ォ繝代せ繧呈欠螳壹@縺セ縺吶
-cl繧剃サ倥¢繧九→縲∝炎髯、縺輔l縺滓枚譖ク縺ョ鬆伜沺繧呈紛逅縺励∪縺吶
-pc縺ッ繝輔ぃ繧、繝ォ縺ョ繝代せ縺ョ譁蟄励さ繝シ繝峨r謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッISO-8859-1縺ァ縺吶
estcmd edit [-pc enc] db expr name [value]
迚ケ螳壹ョ譁譖ク縺ョ螻樊ァ繧呈峩譁ー縺励∪縺吶
expr縺ッ蟇セ雎。縺ョID逡ェ蜿キ縺偽RI縺九Ο繝シ繧ォ繝ォ繝代せ繧呈欠螳壹@縺セ縺吶
name縺ッ螻樊ァ縺ョ蜷榊燕繧呈欠螳壹@縺セ縺吶
value縺ッ螻樊ァ縺ョ蛟、繧呈欠螳壹@縺セ縺吶ら怐逡・縺励◆蝣エ蜷医◎縺ョ螻樊ァ縺ッ蜑企勁縺輔l縺セ縺吶
-pc縺ッ繝輔ぃ繧、繝ォ縺ョ繝代せ縺ィ螻樊ァ蛟、縺ョ譁蟄励さ繝シ繝峨r謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッISO-8859-1縺ァ縺吶
estcmd get [-nl|-nb] [-pidx path] [-pc enc] db expr [attr]
迚ケ螳壹ョ譁譖ク縺ョ諠蝣ア繧呈枚譖ク繝峨Λ繝輔ヨ蠖「蠑上〒蜃コ蜉帙@縺セ縺吶
expr縺ッ蟇セ雎。縺ョID逡ェ蜿キ縺偽RI縺九Ο繝シ繧ォ繝ォ繝代せ繧呈欠螳壹@縺セ縺吶
attr繧剃サ倥¢繧九→縲√◎縺ョ螻樊ァ縺ョ蛟、縺ョ縺ソ繧貞コ蜉帙@縺セ縺吶
-nl繧剃サ倥¢繧九→縲√ヵ繧。繧、繝ォ繝ュ繝繧ッ繧偵°縺代↑縺縺ァ繧、繝ウ繝繝繧ッ繧ケ繧帝幕縺阪∪縺吶
-nb繧剃サ倥¢繧九→縲√ヶ繝ュ繝繧ッ縺帙★縺ォ繝輔ぃ繧、繝ォ繝ュ繝繧ッ繧偵°縺代∪縺吶
-pidx縺ッ讀懃エ「蟇セ雎。縺ォ霑ス蜉縺吶k逍台シシ繧、繝ウ繝繝繧ッ繧ケ縺ョ繝代せ繧呈欠螳壹@縺セ縺吶り、謨ー謖螳壼庄閭ス縺ァ縺吶
-pc縺ッ繝輔ぃ繧、繝ォ縺ョ繝代せ縺ョ譁蟄励さ繝シ繝峨r謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッISO-8859-1縺ァ縺吶
estcmd list [-nl|-nb] [-lp] db
繧、繝ウ繝繝繧ッ繧ケ縺ォ逋サ骭イ縺輔l縺ヲ縺繧句ィ縺ヲ縺ョ譁譖ク縺ョID逡ェ蜿キ繧貞コ蜉帙@縺セ縺吶
-nl繧剃サ倥¢繧九→縲√ヵ繧。繧、繝ォ繝ュ繝繧ッ繧偵°縺代↑縺縺ァ繧、繝ウ繝繝繧ッ繧ケ繧帝幕縺阪∪縺吶
-nb繧剃サ倥¢繧九→縲√ヶ繝ュ繝繧ッ縺帙★縺ォ繝輔ぃ繧、繝ォ繝ュ繝繧ッ繧偵°縺代∪縺吶
-lp繧剃サ倥¢繧九→縲√掲ile://縲阪ョURI縺ォ蟇セ蠢懊☆繧九Ο繝シ繧ォ繝ォ繝代せ繧ょコ蜉帙@縺セ縺吶
estcmd uriid [-pidx path] [-nl|-nb] [-pc enc] db expr
謖螳壹@縺欟RI縺ョ譁譖ク縺ョID逡ェ蜿キ繧貞コ蜉帙@縺セ縺吶
expr縺ッ蟇セ雎。縺ョURI縺九Ο繝シ繧ォ繝ォ繝代せ繧呈欠螳壹@縺セ縺吶
-nl繧剃サ倥¢繧九→縲√ヵ繧。繧、繝ォ繝ュ繝繧ッ繧偵°縺代↑縺縺ァ繧、繝ウ繝繝繧ッ繧ケ繧帝幕縺阪∪縺吶
-nb繧剃サ倥¢繧九→縲√ヶ繝ュ繝繧ッ縺帙★縺ォ繝輔ぃ繧、繝ォ繝ュ繝繧ッ繧偵°縺代∪縺吶
-pidx縺ッ讀懃エ「蟇セ雎。縺ォ霑ス蜉縺吶k逍台シシ繧、繝ウ繝繝繧ッ繧ケ縺ョ繝代せ繧呈欠螳壹@縺セ縺吶り、謨ー謖螳壼庄閭ス縺ァ縺吶
-pc縺ッ繝輔ぃ繧、繝ォ縺ョ繝代せ縺ョ譁蟄励さ繝シ繝峨r謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッISO-8859-1縺ァ縺吶
estcmd meta db [name [value]]
繧、繝ウ繝繝繧ッ繧ケ縺ョ繝。繧ソ繝繝シ繧ソ繧呈桶縺縺セ縺吶
name縺ッ繝。繧ソ繝繝シ繧ソ縺ョ蜷榊燕繧呈欠螳壹@縺セ縺吶ら怐逡・縺励◆蝣エ蜷医ッ蜷榊燕縺ョ荳隕ァ繧貞コ蜉帙@縺セ縺吶
value縺ッ險倬鹸縺吶k繝。繧ソ繝繝シ繧ソ縺ョ蛟、繧呈欠螳壹@縺セ縺吶ら怐逡・縺励◆蝣エ蜷医ッ迴セ迥カ縺ョ蛟、繧貞コ蜉帙@縺セ縺吶らゥコ譁蟄怜励ョ蝣エ蜷医ッ蜑企勁縺励∪縺吶
estcmd inform [-nl|-nb] db
繧、繝ウ繝繝繧ッ繧ケ縺ォ逋サ骭イ縺輔l縺滓枚譖ク謨ー繧逡ー縺ェ繧願ェ樊焚縺ェ縺ゥ縺ョ諠蝣ア繧貞コ蜉帙@縺セ縺吶
-nl繧剃サ倥¢繧九→縲√ヵ繧。繧、繝ォ繝ュ繝繧ッ繧偵°縺代↑縺縺ァ繧、繝ウ繝繝繧ッ繧ケ繧帝幕縺阪∪縺吶
-nb繧剃サ倥¢繧九→縲√ヶ繝ュ繝繧ッ縺帙★縺ォ繝輔ぃ繧、繝ォ繝ュ繝繧ッ繧偵°縺代∪縺吶
estcmd optimize [-onp] [-ond] db
繧、繝ウ繝繝繧ッ繧ケ繧呈怙驕ゥ蛹悶@縺ヲ縲∽ク崎ヲ√↑鬆伜沺繧貞炎髯、縺励∪縺吶
-onp繧剃サ倥¢繧九→縲∝炎髯、縺輔l縺滓枚譖ク縺ョ鬆伜沺繧貞屓蜿弱☆繧句ヲ逅繧堤怐逡・縺励∪縺吶
-ond繧剃サ倥¢繧九→縲√ョ繝シ繧ソ繝吶シ繧ケ繝輔ぃ繧、繝ォ縺ョ譛驕ゥ蛹悶r逵∫払縺励∪縺吶
estcmd merge [-cl] db target
蛻・縺ョ繧、繝ウ繝繝繧ッ繧ケ繧偵槭シ繧ク縺励∪縺吶
target縺ッ蛻・縺ョ繧、繝ウ繝繝繧ッ繧ケ縺ョ繝代せ繧呈欠螳壹@縺セ縺吶
-cl繧剃サ倥¢繧九→縲∝炎髯、縺輔l縺滓枚譖ク縺ョ鬆伜沺繧呈紛逅縺励∪縺吶
estcmd repair [-rst|-rsh] db
螢翫l縺溘う繝ウ繝繝繧ッ繧ケ繧剃ソョ蠕ゥ縺励∪縺吶
-rst繧剃サ倥¢繧九→縲∝宍蟇縺ェ謨エ蜷域ァ讀懈渊繧定。後>縺セ縺吶
-rsh繧剃サ倥¢繧九→縲∵紛蜷域ァ讀懈渊繧堤怐逡・縺励∪縺吶
estcmd search [-nl|-nb] [-pidx path] [-ic enc] [-vu|-va|-vf|-vs|-vh|-vx|-dd] [-sn wnum hnum anum] [-kn num] [-ec rn] [-gs|-gf|-ga] [-cd] [-ni] [-sf|-sfr|-sfu|-sfi] [-hs] [-attr expr] [-ord expr] [-max num] [-sk num] [-aux num] [-dis name] [-sim id] db [phrase]
繧、繝ウ繝繝繧ッ繧ケ縺ォ逋サ骭イ縺輔l縺滓枚譖ク繧呈、懃エ「縺励∪縺吶
phrase縺ッ蜈ィ譁讀懃エ「縺ョ讀懃エ「蠑上r謖螳壹@縺セ縺吶
-nl繧剃サ倥¢繧九→縲√ヵ繧。繧、繝ォ繝ュ繝繧ッ繧偵°縺代↑縺縺ァ繧、繝ウ繝繝繧ッ繧ケ繧帝幕縺阪∪縺吶
-nb繧剃サ倥¢繧九→縲√ヶ繝ュ繝繧ッ縺帙★縺ォ繝輔ぃ繧、繝ォ繝ュ繝繧ッ繧偵°縺代∪縺吶
-pidx縺ッ讀懃エ「蟇セ雎。縺ォ霑ス蜉縺吶k逍台シシ繧、繝ウ繝繝繧ッ繧ケ縺ョ繝代せ繧呈欠螳壹@縺セ縺吶り、謨ー謖螳壼庄閭ス縺ァ縺吶
-ic縺ッ蠑墓焚縺ョ譁蟄励さ繝シ繝峨r謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッUTF-8縺ァ縺吶
-vu繧剃サ倥¢繧九→縲!D逡ェ蜿キ縺ィURI繧偵ち繝門玄蛻繧翫↓縺励◆蠖「蠑上〒邨先棡繧貞コ蜉帙@縺セ縺吶
-va繧剃サ倥¢繧九→縲∝ア樊ァ諠蝣ア繧貞性繧√◆繝槭Ν繝√ヱ繝シ繝亥ス「蠑上〒邨先棡繧貞コ蜉帙@縺セ縺吶
-vf繧剃サ倥¢繧九→縲∵枚譖ク繝峨Λ繝輔ヨ蠖「蠑上r蜷ォ繧√◆繝槭Ν繝√ヱ繝シ繝亥ス「蠑上〒邨先棡繧貞コ蜉帙@縺セ縺吶
-vs繧剃サ倥¢繧九→縲∝ア樊ァ諠蝣ア縺ィ繧ケ繝九壹ャ繝医r蜷ォ繧√◆繝槭Ν繝√ヱ繝シ繝亥ス「蠑上〒邨先棡繧貞コ蜉帙@縺セ縺吶
-vh繧剃サ倥¢繧九→縲∝ア樊ァ諠蝣ア縺ィ繧ケ繝九壹ャ繝医r莠コ髢薙′隱ュ縺ソ繧縺吶>蠖「蠑上↓縺励※邨先棡繧貞コ蜉帙@縺セ縺吶
-vx繧剃サ倥¢繧九→縲∝ア樊ァ諠蝣ア縺ィ繧ケ繝九壹ャ繝医rXML蠖「蠑上↓縺励※邨先棡繧貞コ蜉帙@縺セ縺吶
-dd繧剃サ倥¢繧九→縲∫オ先棡繧呈枚譖ク繝峨Λ繝輔ヨ蠖「蠑上ョ繝輔ぃ繧、繝ォ縺ィ縺励※菫晏ュ倥@縺セ縺吶
-sn縺ッ縲√せ繝九壹ャ繝医ョ蜈ィ菴薙ョ蟷縺ィ蜀帝ュ縺九i謚ス蜃コ縺吶k蟷縺ィ繝上う繝ゥ繧、繝医&繧後k隱槭ョ蜻ィ霎コ縺九i謚ス蜃コ縺吶k蟷繧呈欠螳壹@縺セ縺吶
-kn縺ッ縲∵歓蜃コ縺吶k繧ュ繝シ繝ッ繝シ繝峨ョ謨ー繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医〒縺ッ繧ュ繝シ繝ッ繝シ繝画歓蜃コ縺ッ陦後>縺セ縺帙s縲
-um繧剃サ倥¢繧九→縲√く繝シ繝ッ繝シ繝峨r謚ス蜃コ縺吶k髫帙↓蠖「諷狗エ隗」譫仙勣繧堤畑縺縺セ縺吶
-ec縺ッ鬘樔シシ髫阡ス縺ョ荳矩剞鬘樔シシ蠎ヲ繧0.0縺九i1.0縺セ縺ァ縺ョ螳滓焚縺ァ謖螳壹@縺セ縺吶ゅ茎erv縲阪r謖螳壹☆繧九→繧オ繝シ繝仙腰菴阪↓縺ェ繧翫√慧ir縲阪r謖螳壹☆繧九→繝繧」繝ャ繧ッ繝医Μ蜊倅ス阪↓縺ェ繧翫√掲ile縲阪r謖螳壹☆繧九→繝輔ぃ繧、繝ォ蜊倅ス阪↓縺ェ繧翫∪縺吶
-gs繧剃サ倥¢繧九→縲¨-gram縺ョ蜈ィ縺ヲ縺ョ繧ュ繝シ縺ョ蟄伜惠繧呈、懈渊縺励∪縺吶ゅョ繝輔か繝ォ繝医ッ1蛟狗スョ縺阪〒縺吶
-gf繧剃サ倥¢繧九→縲¨-gram縺ョ繧ュ繝シ繧2蛟狗スョ縺阪〒讀懈渊縺励∪縺吶
-ga繧剃サ倥¢繧九→縲¨-gram縺ョ繧ュ繝シ繧3蛟狗スョ縺阪〒讀懈渊縺励∪縺吶
-cd繧剃サ倥¢繧九→縲∵枚譖ク縺ョ蜀螳ケ縺後ヵ繝ャ繝シ繧コ縺ィ遒コ螳溘↓驕ゥ蜷医☆繧九°讀懈渊縺励∪縺吶
-ni繧剃サ倥¢繧九→縲ゝF-IDF豕輔↓繧医k繧ケ繧ウ繧「縺ョ隱ソ謨エ繧定。後>縺セ縺帙s縲
-sf繧剃サ倥¢繧九→縲∵、懃エ「蠑上r邁。萓ソ譖ク蠑上→縺励※謇ア縺縺セ縺吶
-sfr繧剃サ倥¢繧九→縲∵、懃エ「蠑上r邊礼払譖ク蠑上→縺励※謇ア縺縺セ縺吶
-sfu繧剃サ倥¢繧九→縲∵、懃エ「蠑上r隲也炊蜥梧嶌蠑上→縺励※謇ア縺縺セ縺吶
-sfi繧剃サ倥¢繧九→縲∵、懃エ「蠑上r隲也炊遨肴嶌蠑上→縺励※謇ア縺縺セ縺吶
-hs繧剃サ倥¢繧九→縲∬ゥイ蠖捺枚譖ク縺ョ繧ケ繧ウ繧「諠蝣ア繧貞ア樊ァ縺ィ縺励※蜃コ蜉帙@縺セ縺吶
-attr縺ッ邨槭j霎シ縺ソ縺ョ螻樊ァ譚。莉カ繧呈欠螳壹@縺セ縺吶り、謨ー謖螳壼庄閭ス縺ァ縺吶
-ord縺ッ繧ス繝シ繝域擅莉カ繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ繧ケ繧ウ繧「縺ョ髯埼縺ァ縺吶
-max縺ッ譛螟ァ陦ィ遉コ莉カ謨ー繧呈欠螳壹@縺セ縺吶りイ謨ー縺ォ縺吶k縺ィ辟。蛻カ髯舌↓縺ェ繧翫∪縺吶ゅョ繝輔か繝ォ繝医ッ10莉カ縺ァ縺吶
-sk縺ッ陦ィ遉コ繧偵せ繧ュ繝繝励☆繧倶サカ謨ー繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ0莉カ縺ァ縺吶
-aux縺ッ陬懷勧繧、繝ウ繝繝繧ッ繧ケ縺ョ邨先棡繧呈治逕ィ縺吶k險ア蜿ッ繧呈欠螳壹@縺セ縺吶0繧定カ翫∴縺ェ縺蛟、繧呈欠螳壹☆繧九→陬懷勧繧、繝ウ繝繝繧ッ繧ケ縺ッ菴ソ繧上l縺セ縺帙s縲ゅョ繝輔か繝ォ繝医ッ32莉カ縺ァ縺吶
-dis縺ッ驥崎、蝗樣∩螻樊ァ縺ョ蜷榊燕繧呈欠螳壹@縺セ縺吶
-sim縺ッ鬘樔シシ讀懃エ「縺ョ遞ョ譁譖ク縺ョID逡ェ蜿キ繧呈欠螳壹@縺セ縺吶
estcmd gather [-tr] [-cl] [-ws] [-no] [-fe|-ft|-fh|-fm] [-fx sufs cmd] [-fz] [-fo] [-rm sufs] [-ic enc] [-il lang] [-bc] [-lt num] [-lf num] [-pc enc] [-px name] [-aa name value] [-apn|-acc] [-xs|-xl|-xh|-xh2|-xh3] [-sv|-si|-sa] [-ss name] [-sd] [-cm] [-cs num] [-ncm] [-kn num] [-um] db [file|dir]
繝輔ぃ繧、繝ォ繧キ繧ケ繝繝繧呈爾邏「縺励※譁譖ク繧堤匳骭イ縺励∪縺吶
隨ャ3蠑墓焚縺ィ縺励※繝輔ぃ繧、繝ォ蜷阪r謖螳壹☆繧九→縲√◎縺ョ繝輔ぃ繧、繝ォ縺九i蜃ヲ逅蟇セ雎。縺ョ繝代せ縺ョ繝ェ繧ケ繝医r隱ュ縺ソ霎シ縺ソ縺セ縺吶ゅ-縲阪r謖螳壹@縺溷エ蜷医∵ィ呎コ門・蜉帙′隱ュ縺ソ霎シ縺セ繧後∪縺吶Gind繧ウ繝槭Φ繝峨ョ蜃コ蜉帙r隱ュ縺ソ霎シ繧縺ィ萓ソ蛻ゥ縺ァ縺吶
隨ャ3蠑墓焚縺ィ縺励※繝繧」繝ャ繧ッ繝医Μ蜷阪r謖螳壹☆繧九→縲√◎縺ョ繝繧」繝ャ繧ッ繝医Μ莉・荳九ョ蜈ィ縺ヲ縺ョ繝輔ぃ繧、繝ォ繧貞ヲ逅蟇セ雎。縺ォ縺励∪縺吶
-tr繧偵▽縺代k縺ィ縲∵里縺ォ繧、繝ウ繝繝繧ッ繧ケ縺後≠繧句エ蜷医↓繧よ眠縺励>繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-cl繧剃サ倥¢繧九→縲∽ク頑嶌縺阪&繧後◆譁譖ク縺ョ鬆伜沺繧呈紛逅縺励∪縺吶
-ws繧剃サ倥¢繧九→縲驥阪∩莉倥¢螻樊ァ繧帝撕逧縺ォ驕ゥ逕ィ縺励∪縺吶
-no繧剃サ倥¢繧九→縲∝ヲ逅蜀螳ケ縺ョ陦ィ遉コ縺縺代r陦後>縲∝ョ滄圀縺ョ蜃ヲ逅繧定。後>縺セ縺帙s縲
-fe繧剃サ倥¢繧九→縲∝ヲ逅蟇セ雎。縺ョ蜈ィ縺ヲ縺ョ繝輔ぃ繧、繝ォ繧呈枚譖ク繝峨Λ繝輔ヨ縺ィ縺励※謇ア縺縺セ縺吶ゅョ繝輔か繝ォ繝医〒縺ッ縲∵僑蠑オ蟄舌↓繧医▲縺ヲ譁譖ク蠖「蠑上r蛻、譁ュ縺励√し繝昴シ繝亥、悶ョ繧ゅョ縺ッ辟。隕悶&繧後∪縺吶
-ft繧剃サ倥¢繧九→縲∝ヲ逅蟇セ雎。縺ョ蜈ィ縺ヲ縺ョ繝輔ぃ繧、繝ォ繧偵励Ξ繝シ繝ウ繝繧ュ繧ケ繝医→縺励※謇ア縺縺セ縺吶
-fh繧剃サ倥¢繧九→縲∝ヲ逅蟇セ雎。縺ョ蜈ィ縺ヲ縺ョ繝輔ぃ繧、繝ォ繧辿TML縺ィ縺励※謇ア縺縺セ縺吶
-fm繧剃サ倥¢繧九→縲∝ヲ逅蟇セ雎。縺ョ蜈ィ縺ヲ縺ョ繝輔ぃ繧、繝ォ繧樽IME縺ィ縺励※謇ア縺縺セ縺吶
-fx縺ッ縲√ヵ繧。繧、繝ォ蜷阪ョ謗・蟆セ霎槭↓髢「騾」縺・縺代◆螟夜Κ繧ウ繝槭Φ繝峨r謖螳壹@縺セ縺吶ゅき繝ウ繝槫玄蛻繧翫〒隍謨ー縺ョ謗・蟆セ霎槭r謖螳壹〒縺阪∪縺吶ゅ*縲阪□縺ィ蜈ィ縺ヲ縺ョ繝輔ぃ繧、繝ォ縺ォ荳閾エ縺励∪縺吶ゅさ繝槭Φ繝牙錐縺ョ蜑阪↓縲卦@縲阪r縺、縺代k縺ィ縺昴ョ蜃コ蜉帙′繝励Ξ繝シ繝ウ繝繧ュ繧ケ繝医→縺励※隗」譫舌&繧後√粂@縲阪r縺、縺代k縺ィHTML縺ィ縺励※隗」譫舌&繧後√勲@縲阪r縺、縺代k縺ィMIME縺ィ縺励※隗」譫舌&繧後√>縺壹l縺ァ繧ゅ↑縺蝣エ蜷医ッ譁譖ク繝峨Λ繝輔ヨ縺ィ縺励※隗」譫舌&繧後∪縺吶ゅ%縺ョ繧ェ繝励す繝ァ繝ウ縺ッ隍謨ー蝗樊欠螳壹〒縺阪∪縺吶
-fz繧剃サ倥¢繧九→縲-fx縺ョ譚。莉カ縺ォ蠖薙※縺ッ縺セ繧峨↑縺繝輔ぃ繧、繝ォ繧堤┌隕悶@縺セ縺吶
-fo繧剃サ倥¢繧九→縲∝ヲ逅蟇セ雎。縺ョ繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ縺ソ縺セ縺帙s縲ょ、夜Κ繝輔ぅ繝ォ繧ソ縺ョ蜉ケ邇蛹悶ョ縺溘a縺ォ菴ソ縺縺セ縺吶
-rm縺ッ縲∝ヲ逅蠕後↓蜑企勁縺吶k繝輔ぃ繧、繝ォ繧呈欠螳壹@縺セ縺吶ゅき繝ウ繝槫玄蛻繧翫〒隍謨ー縺ョ謗・蟆セ霎槭r謖螳壹〒縺阪∪縺吶ゅ*縲阪r謖螳壹☆繧九→蜈ィ縺ヲ縺ョ繝輔ぃ繧、繝ォ繧貞炎髯、縺励∪縺吶ゅ%縺ョ繧ェ繝励す繝ァ繝ウ縺ッ隍謨ー蝗樊欠螳壹〒縺阪∪縺吶
-ic縺ッ蟇セ雎。譁譖ク縺ョ譁蟄励さ繝シ繝峨r謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ閾ェ蜍募愛螳壹〒縺吶
-il縺ッ譁蟄励さ繝シ繝峨ョ蛻、螳壹〒蜆ェ蜈医&繧後k險隱槭r謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ闍ア隱槭〒縺吶
-bc繧剃サ倥¢繧九→縲√ヰ繧、繝翫Μ繝輔ぃ繧、繝ォ繧呈、懷コ縺励※蜃ヲ逅蟇セ雎。縺九i髯、螟悶@縺セ縺吶
-lt縺ッ縲∬ァ」譫舌☆繧九ユ繧ュ繧ケ繝医ョ繧オ繧、繧コ蛻カ髯舌r繧ュ繝ュ繝舌う繝亥腰菴阪〒謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ128KB縺ァ縺吶りイ謨ー縺ォ縺吶k縺ィ辟。蛻カ髯舌↓縺ェ繧翫∪縺吶ょ宛髯舌r雜縺医◆蝣エ蜷医∝磯ュ縺九i蛻カ髯舌し繧、繧コ縺セ縺ァ縺ョ繝繧ュ繧ケ繝医′隗」譫舌&繧後∪縺吶
-lf縺ッ縲∬ェュ縺ソ霎シ繧繝輔ぃ繧、繝ォ縺ョ繧オ繧、繧コ蛻カ髯舌r繝。繧ャ繝舌う繝亥腰菴阪〒謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ32MB縺ァ縺吶りイ謨ー縺ォ縺吶k縺ィ辟。蛻カ髯舌↓縺ェ繧翫∪縺吶ょ宛髯舌r雜縺医◆蝣エ蜷医√◎縺ョ繝輔ぃ繧、繝ォ縺ッ辟。隕悶&繧後∪縺吶
-pc縺ッ繝輔ぃ繧、繝ォ縺ョ繝代せ縺ョ譁蟄励さ繝シ繝峨r謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッISO-8859-1縺ァ縺吶
-px縺ッ繝代せ縺ョ繝ェ繧ケ繝医°繧芽ェュ縺ソ蜿悶k螻樊ァ縺ョ蜷榊燕繧呈欠螳壹@縺セ縺吶ゅヱ繧ケ縺ョ繝ェ繧ケ繝医ッTSV蠖「蠑上↓縺吶k縺薙→縺後〒縺阪∫ャャ1繝輔ぅ繝シ繝ォ繝峨ッ蟇セ雎。譁譖ク縺ョ繝代せ蜷阪∫ャャ2繝輔ぅ繝シ繝ォ繝我サ・髯阪ッ螻樊ァ蛟、縺ョ螳夂セゥ縺ィ縺励※謇ア繧上l縺セ縺吶-px縺ォ繧医▲縺ヲ隨ャ2繝輔ぅ繝シ繝ォ繝我サ・髯阪↓蟇セ蠢懊☆繧句ア樊ァ蜷阪r螳夂セゥ縺励∪縺吶ゅ%縺ョ繧ェ繝励す繝ァ繝ウ縺ッ隍謨ー蝗樊欠螳壹〒縺阪∪縺吶
-aa縺ッ霑ス蜉縺吶k螻樊ァ縺ョ蜷榊燕縺ィ蛟、繧呈欠螳壹@縺セ縺吶ゅ%縺ョ繧ェ繝励す繝ァ繝ウ縺ッ隍謨ー蝗樊欠螳壹〒縺阪∪縺吶
-apn繧偵▽縺代k縺ィ縲∝ィ縺ヲ縺ョ險隱槭rN-gram豕輔〒蜃ヲ逅縺励∪縺吶
-acc繧偵▽縺代k縺ィ縲¨-gram豕輔ョ莉」繧上j縺ォ譁蟄礼ィョ蛻鬘樊ウ輔r蛻ゥ逕ィ縺励∪縺吶
-xs繧偵▽縺代k縺ィ縲50000莉カ譛ェ貅縺ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-xl繧偵▽縺代k縺ィ縲300000莉カ莉・荳翫ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-xh繧偵▽縺代k縺ィ縲1000000莉カ莉・荳翫ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-xh2繧偵▽縺代k縺ィ縲5000000莉カ莉・荳翫ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-xh3繧偵▽縺代k縺ィ縲10000000莉カ莉・荳翫ョ譁譖ク繧堤匳骭イ縺吶k縺薙→繧呈Φ螳壹@縺ヲ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶
-sv繧偵▽縺代k縺ィ縲√せ繧ウ繧「諠蝣ア繧堤エ譽縺励∪縺吶
-si繧偵▽縺代k縺ィ縲√せ繧ウ繧「諠蝣ア繧32繝薙ャ繝医ョ謨ー蛟、縺ィ縺励※險倬鹸縺励∪縺吶
-sa繧偵▽縺代k縺ィ縲√せ繧ウ繧「諠蝣ア繧偵◎縺ョ縺セ縺セ菫晏ュ倥@縺滉ク翫〒讀懃エ「譎ゅ↓隱ソ謨エ縺輔l縺ェ縺繧医≧縺ォ繝槭シ繧ッ縺励∪縺吶
-ss縺ッ縲∽サ」譖ソ繧ケ繧ウ繧「縺ィ縺励※謇ア縺螻樊ァ縺ョ蜷榊燕繧呈欠螳壹@縺セ縺吶
-sd繧剃サ倥¢繧九→縲√ヵ繧。繧、繝ォ縺ョ譖エ譁ー譌・譎ゅr譁譖ク縺ョ螻樊ァ縺ィ縺励※霑ス蜉縺励∪縺吶
-cm繧剃サ倥¢繧九→縲∵枚譖ク縺ョ螻樊ァ縺ョ譖エ譁ー譌・譎ゅ′繝輔ぃ繧、繝ォ縺ョ譖エ譁ー譌・譎ゅh繧雁商縺蝣エ蜷医↓縺ョ縺ソ逋サ骭イ繧定。後>縺セ縺吶
-cs縺ッ縲√く繝」繝繧キ繝・繝。繝「繝ェ縺ョ繧オ繧、繧コ繧偵Γ繧ャ繝舌う繝亥腰菴阪〒謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ64MB縺ァ縺吶
-ncm繧偵▽縺代k縺ィ縲∽サョ諠ウ繝。繝「繝ェ縺ョ谿矩乗、懈渊繧堤怐逡・縺励∪縺吶
-kn縺ッ縲∵歓蜃コ縺吶k繧ュ繝シ繝ッ繝シ繝峨ョ謨ー繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医〒縺ッ繧ュ繝シ繝ッ繝シ繝画歓蜃コ縺ッ陦後>縺セ縺帙s縲
-um繧剃サ倥¢繧九→縲√く繝シ繝ッ繝シ繝峨r謚ス蜃コ縺吶k髫帙↓蠖「諷狗エ隗」譫仙勣繧堤畑縺縺セ縺吶
estcmd purge [-cl] [-no] [-fc] [-pc enc] [-attr expr] db [prefix]
繧、繝ウ繝繝繧ッ繧ケ蜀縺ォ縺ゅ▲縺ヲ繝輔ぃ繧、繝ォ繧キ繧ケ繝繝荳翫↓縺ェ縺譁譖ク縺ョ諠蝣ア繧貞炎髯、縺励∪縺吶
prefix繧呈欠螳壹☆繧九→縲√◎縺ョ譁蟄怜励〒蟋九∪繧偽RI縺ョ譁譖ク縺ョ縺ソ繧貞ッセ雎。縺ィ縺励∪縺吶ゅョ繧」繝ャ繧ッ繝医Μ縺ョ繝ュ繝シ繧ォ繝ォ繝代せ縺ァ繧よ欠螳壹〒縺阪∪縺吶
-cl繧剃サ倥¢繧九→縲∝炎髯、縺輔l縺滓枚譖ク縺ョ鬆伜沺繧呈紛逅縺励∪縺吶
-no繧剃サ倥¢繧九→縲∝ヲ逅蜀螳ケ縺ョ陦ィ遉コ縺縺代r陦後>縲∝ョ滄圀縺ョ蜃ヲ逅繧定。後>縺セ縺帙s縲
-fc繧剃サ倥¢繧九→縲√ヵ繧。繧、繝ォ縺後≠繧九°縺ェ縺縺九↓縺九°繧上i縺壽枚譖ク諠蝣ア繧貞炎髯、縺励∪縺吶
-pc縺ッ繝輔ぃ繧、繝ォ縺ョ繝代せ縺ョ譁蟄励さ繝シ繝峨r謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッISO-8859-1縺ァ縺吶
-attr縺ッ邨槭j霎シ縺ソ縺ョ螻樊ァ譚。莉カ繧呈欠螳壹@縺セ縺吶り、謨ー謖螳壼庄閭ス縺ァ縺吶
estcmd extkeys [-no] [-fc] [-dfdb file] [-ncm] [-ni] [-kn num] [-um] [-attr expr] db [prefix]
繧、繝ウ繝繝繧ッ繧ケ蜀縺ョ蜷譁譖ク縺ョ繧ュ繝シ繝ッ繝シ繝峨r謚ス蜃コ縺励◆繝繝シ繧ソ繝吶シ繧ケ繧剃ス懈舌@縺セ縺吶
prefix繧呈欠螳壹☆繧九→縲√◎縺ョ譁蟄怜励〒蟋九∪繧偽RI縺ョ譁譖ク縺ョ縺ソ繧貞ッセ雎。縺ィ縺励∪縺吶
-no繧剃サ倥¢繧九→縲∝ヲ逅蜀螳ケ縺ョ陦ィ遉コ縺縺代r陦後>縲∝ョ滄圀縺ョ蜃ヲ逅繧定。後>縺セ縺帙s縲
-fc繧剃サ倥¢繧九→縲∵里縺ォ繧ュ繝シ繝ッ繝シ繝峨′逋サ骭イ縺輔l縺ヲ縺繧区枚譖ク縺ァ繧ゅく繝シ繝ッ繝シ繝峨r菴懊j縺ェ縺翫@縺セ縺吶
-dfdb縺ッ縲∵枚譖ク鬆サ蠎ヲ繧定ィ倬鹸縺励◆螟夜Κ繝繝シ繧ソ繝吶シ繧ケ繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医〒縺ッ繧、繝ウ繝繝繧ッ繧ケ縺九i蜍慕噪縺ォ譁譖ク鬆サ蠎ヲ繧定ィ育ョ励@縺セ縺吶
-ncm繧偵▽縺代k縺ィ縲∽サョ諠ウ繝。繝「繝ェ縺ョ谿矩乗、懈渊繧堤怐逡・縺励∪縺吶
-ni繧剃サ倥¢繧九→縲ゝF-IDF豕輔↓繧医k繧ケ繧ウ繧「縺ョ隱ソ謨エ繧定。後>縺セ縺帙s縲
-kn縺ッ縲∵歓蜃コ縺吶k繧ュ繝シ繝ッ繝シ繝峨ョ謨ー繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ32蛟九〒縺吶
-um繧剃サ倥¢繧九→縲√く繝シ繝ッ繝シ繝峨r謚ス蜃コ縺吶k髫帙↓蠖「諷狗エ隗」譫仙勣繧堤畑縺縺セ縺吶
-attr縺ッ邨槭j霎シ縺ソ縺ョ螻樊ァ譚。莉カ繧呈欠螳壹@縺セ縺吶り、謨ー謖螳壼庄閭ス縺ァ縺吶
estcmd words [-nl|-nb] [-dfdb file] [-kw|-kt] db
繧、繝ウ繝繝繧ッ繧ケ蜀縺ョ逡ー縺ェ繧願ェ槭→縺昴ョ繝ャ繧ウ繝シ繝峨し繧、繧コシ域枚譖ク鬆サ蠎ヲシ峨r蜃コ蜉帙@縺セ縺吶
-nl繧剃サ倥¢繧九→縲√ヵ繧。繧、繝ォ繝ュ繝繧ッ繧偵°縺代↑縺縺ァ繧、繝ウ繝繝繧ッ繧ケ繧帝幕縺阪∪縺吶
-nb繧剃サ倥¢繧九→縲√ヶ繝ュ繝繧ッ縺帙★縺ォ繝輔ぃ繧、繝ォ繝ュ繝繧ッ繧偵°縺代∪縺吶
-dfdb縺ッ縲∫オ先棡繧呈シ邏阪☆繧句、夜Κ縺ョ繝繝シ繧ソ繝吶シ繧ケ繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医〒縺ッ讓呎コ門コ蜉帙↓TSV蠖「蠑上〒蜃コ蜉帙&繧後∪縺吶ょ、夜Κ繝繝シ繧ソ繝吶シ繧ケ縺梧里縺ォ蟄伜惠縺吶k蝣エ蜷医ッ縲∝推繝ャ繧ウ繝シ繝峨ョ蛟、繧貞刈邂励@縺セ縺吶
-kw繧剃サ倥¢繧九→縲√く繝シ繝ッ繝シ繝峨→縺昴ョ隧イ蠖捺枚譖ク謨ー繧貞コ蜉帙@縺セ縺吶
-kt繧剃サ倥¢繧九→縲√く繝シ繝ッ繝シ繝峨→縺昴ョ髢「騾」隱槭r蜃コ蜉帙@縺セ縺吶
estcmd draft [-ft|-fh|-fm] [-ic enc] [-il lang] [-bc] [-lt num] [-kn num] [-um] [file]
蜷遞ョ蠖「蠑上ョ繝輔ぃ繧、繝ォ繧呈枚譖ク繝峨Λ繝輔ヨ蠖「蠑上↓螟画鋤縺励※蜃コ蜉帙@縺セ縺吶
file縺ッ蟇セ雎。縺ョ繝輔ぃ繧、繝ォ繧呈欠螳壹@縺セ縺吶′縲∫怐逡・縺励◆蝣エ蜷医ッ讓呎コ門・蜉帙′隱ュ縺ソ霎シ縺セ繧後∪縺吶
-ft繧剃サ倥¢繧九→縲∝ッセ雎。繧偵励Ξ繝シ繝ウ繝繧ュ繧ケ繝医→縺励※謇ア縺縺セ縺吶ゅョ繝輔か繝ォ繝医ッ譁譖ク繝峨Λ繝輔ヨ蠖「蠑上〒縺吶
-fh繧剃サ倥¢繧九→縲∝ッセ雎。繧辿TML縺ィ縺励※謇ア縺縺セ縺吶
-fm繧剃サ倥¢繧九→縲∝ッセ雎。繧樽IME縺ィ縺励※謇ア縺縺セ縺吶
-ic縺ッ蟇セ雎。譁譖ク縺ョ譁蟄励さ繝シ繝峨r謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ閾ェ蜍募愛螳壹〒縺吶
-il縺ッ譁蟄励さ繝シ繝峨ョ蛻、螳壹〒蜆ェ蜈医&繧後k險隱槭r謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ闍ア隱槭〒縺吶
-bc繧剃サ倥¢繧九→縲√ヰ繧、繝翫Μ繝輔ぃ繧、繝ォ繧呈、懷コ縺励※蜃ヲ逅蟇セ雎。縺九i髯、螟悶@縺セ縺吶
-lt縺ッ縲∬ァ」譫舌☆繧九ユ繧ュ繧ケ繝医ョ繧オ繧、繧コ蛻カ髯舌r繧ュ繝ュ繝舌う繝亥腰菴阪〒謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ256KB縺ァ縺吶りイ謨ー縺ォ縺吶k縺ィ辟。蛻カ髯舌↓縺ェ繧翫∪縺吶ょ宛髯舌r雜縺医◆蝣エ蜷医∝磯ュ縺九i蛻カ髯舌し繧、繧コ縺セ縺ァ縺ョ繝繧ュ繧ケ繝医′隗」譫舌&繧後∪縺吶
-kn縺ッ縲∵歓蜃コ縺吶k繧ュ繝シ繝ッ繝シ繝峨ョ謨ー繧呈欠螳壹@縺セ縺吶
-um繧剃サ倥¢繧九→縲√く繝シ繝ッ繝シ繝峨r謚ス蜃コ縺吶k髫帙↓蠖「諷狗エ隗」譫仙勣繧堤畑縺縺セ縺吶
estcmd break [-ic enc] [-il lang] [-apn|-acc] [-wt] [file]
繝励Ξ繝シ繝ウ繝繧ュ繧ケ繝医r讀懃エ「隱槭↓蛻隗」縺励∪縺吶
file縺ッ蟇セ雎。縺ョ繝輔ぃ繧、繝ォ繧呈欠螳壹@縺セ縺吶′縲∫怐逡・縺励◆蝣エ蜷医ッ讓呎コ門・蜉帙′隱ュ縺ソ霎シ縺セ繧後∪縺吶ゅ掘縲阪〒蟋九∪繧句エ蜷医√掘縲阪h繧雁セ後m縺ョ譁蟄怜励◎縺ョ繧ゅョ繧貞ヲ逅蟇セ雎。縺ィ縺励∪縺吶
-ic縺ッ蜃ヲ逅蟇セ雎。縺ョ譁蟄励さ繝シ繝峨r謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ閾ェ蜍募愛螳壹〒縺吶
-il縺ッ譁蟄励さ繝シ繝峨ョ蛻、螳壹〒蜆ェ蜈医&繧後k險隱槭r謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ闍ア隱槭〒縺吶
-apn繧偵▽縺代k縺ィ縲∝ィ縺ヲ縺ョ險隱槭rN-gram豕輔〒蜃ヲ逅縺励∪縺吶
-acc繧偵▽縺代k縺ィ縲¨-gram豕輔ョ莉」繧上j縺ォ譁蟄礼ィョ蛻鬘樊ウ輔r蛻ゥ逕ィ縺励∪縺吶
-wt繧剃サ倥¢繧九→縲√梧忰蟆セ縺ョ1-gram縲阪b蜃コ蜉帙@縺セ縺吶
estcmd iconv [-ic enc] [-il lang] [-oc enc] [file]
譁蟄励さ繝シ繝峨r螟画鋤縺励∪縺吶
file縺ッ蟇セ雎。縺ョ繝輔ぃ繧、繝ォ繧呈欠螳壹@縺セ縺吶′縲∫怐逡・縺励◆蝣エ蜷医ッ讓呎コ門・蜉帙′隱ュ縺ソ霎シ縺セ繧後∪縺吶ゅ掘縲阪〒蟋九∪繧句エ蜷医√掘縲阪h繧雁セ後m縺ョ譁蟄怜励◎縺ョ繧ゅョ繧貞ヲ逅蟇セ雎。縺ィ縺励∪縺吶
-ic縺ッ蜃ヲ逅蟇セ雎。縺ョ譁蟄励さ繝シ繝峨r謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ閾ェ蜍募愛螳壹〒縺吶
-il縺ッ譁蟄励さ繝シ繝峨ョ蛻、螳壹〒蜆ェ蜈医&繧後k險隱槭r謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ闍ア隱槭〒縺吶
-oc縺ッ蜃コ蜉帙ョ譁蟄励さ繝シ繝峨r謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッUTF-8縺ァ縺吶
estcmd regex [-inv] [-repl str] expr [file]
豁」隕剰。ィ迴セ繧貞性繧陦後r蜃コ蜉帙@縺セ縺吶
expr縺ッ豁」隕剰。ィ迴セ繧呈欠螳壹@縺セ縺吶
file縺ッ蟇セ雎。縺ョ繝輔ぃ繧、繝ォ繧呈欠螳壹@縺セ縺吶′縲∫怐逡・縺励◆蝣エ蜷医ッ讓呎コ門・蜉帙′隱ュ縺ソ霎シ縺セ繧後∪縺吶
-inv繧剃サ倥¢繧九→縲∵ュ」隕剰。ィ迴セ縺ォ繝槭ャ繝√@縺ェ縺陦後r蜃コ蜉帙@縺セ縺吶
-repl繧剃サ倥¢繧九→縲∵ュ」隕剰。ィ迴セ縺ォ繝槭ャ繝√☆繧矩Κ蛻繧呈欠螳壹@縺滓枚蟄怜励↓鄂ョ縺肴鋤縺医k縺ィ縺ィ繧ゅ↓縲√槭ャ繝√@縺ェ縺陦後b蜃コ蜉帙@縺セ縺吶
estcmd scandir [-tf|-td] [-pa|-pu] [dir]
繝繧」繝ャ繧ッ繝医Μ縺ォ蜷ォ縺セ繧後k繝輔ぃ繧、繝ォ繧貞榊クー逧縺ォ謗「邏「縺励※蜃コ蜉帙@縺セ縺吶
dir縺ッ謗「邏「縺ョ襍キ轤ケ縺ィ縺ェ繧九ョ繧」繝ャ繧ッ繝医Μ繧呈欠螳壹@縺セ縺吶′縲∫怐逡・縺励◆蝣エ蜷医ッ繧ォ繝ャ繝ウ繝医ョ繧」繝ャ繧ッ繝医Μ縺梧欠螳壹&繧後∪縺吶
-tf繧剃サ倥¢繧九→縲騾壼クク縺ョ繝輔ぃ繧、繝ォ縺ョ縺ソ繧貞コ蜉帙@縺セ縺吶
-td繧剃サ倥¢繧九→縲√ョ繧」繝ャ繧ッ繝医Μ縺ョ縺ソ繧貞コ蜉帙@縺セ縺吶
-pa繧剃サ倥¢繧九→縲∫オカ蟇セ繝代せ繧貞コ蜉帙@縺セ縺吶
-pu繧剃サ倥¢繧九→縲ゞRL繧貞コ蜉帙@縺セ縺吶
estcmd multi [-db db] [-nl|-nb] [-ic enc] [-gs|-gf|-ga] [-cd] [-ni] [-sf|-sfr|-sfu|-sfi] [-hs] [-hu] [-attr expr] [-ord expr] [-max num] [-sk num] [-aux num] [-dis name] [phrase]
繝ュ繝シ繧ォ繝ォ繝。繧ソ讀懃エ「縺ョ繝繧ケ繝医r陦後>縺セ縺吶
phrase縺ッ蜈ィ譁讀懃エ「縺ョ讀懃エ「蠑上r謖螳壹@縺セ縺吶
-db縺ッ縲√Γ繧ソ讀懃エ「縺ョ蟇セ雎。縺ィ縺ェ繧九ョ繝シ繧ソ繝吶シ繧ケ繧呈欠螳壹@縺セ縺吶り、謨ー謖螳壼庄閭ス縺ァ縺吶
-nl繧剃サ倥¢繧九→縲√ヵ繧。繧、繝ォ繝ュ繝繧ッ繧偵°縺代↑縺縺ァ繧、繝ウ繝繝繧ッ繧ケ繧帝幕縺阪∪縺吶
-nb繧剃サ倥¢繧九→縲√ヶ繝ュ繝繧ッ縺帙★縺ォ繝輔ぃ繧、繝ォ繝ュ繝繧ッ繧偵°縺代∪縺吶
-pidx縺ッ讀懃エ「蟇セ雎。縺ォ霑ス蜉縺吶k逍台シシ繧、繝ウ繝繝繧ッ繧ケ縺ョ繝代せ繧呈欠螳壹@縺セ縺吶り、謨ー謖螳壼庄閭ス縺ァ縺吶
-ic縺ッ蠑墓焚縺ョ譁蟄励さ繝シ繝峨r謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッUTF-8縺ァ縺吶
-gs繧剃サ倥¢繧九→縲¨-gram縺ョ蜈ィ縺ヲ縺ョ繧ュ繝シ縺ョ蟄伜惠繧呈、懈渊縺励∪縺吶ゅョ繝輔か繝ォ繝医ッ1蛟狗スョ縺阪〒縺吶
-gf繧剃サ倥¢繧九→縲¨-gram縺ョ繧ュ繝シ繧2蛟狗スョ縺阪〒讀懈渊縺励∪縺吶
-ga繧剃サ倥¢繧九→縲¨-gram縺ョ繧ュ繝シ繧3蛟狗スョ縺阪〒讀懈渊縺励∪縺吶
-cd繧剃サ倥¢繧九→縲∵枚譖ク縺ョ蜀螳ケ縺後ヵ繝ャ繝シ繧コ縺ィ遒コ螳溘↓驕ゥ蜷医☆繧九°讀懈渊縺励∪縺吶
-ni繧剃サ倥¢繧九→縲ゝF-IDF豕輔↓繧医k繧ケ繧ウ繧「縺ョ隱ソ謨エ繧定。後>縺セ縺帙s縲
-sf繧剃サ倥¢繧九→縲∵、懃エ「蠑上r邁。萓ソ譖ク蠑上→縺励※謇ア縺縺セ縺吶
-sfr繧剃サ倥¢繧九→縲∵、懃エ「蠑上r邊礼払譖ク蠑上→縺励※謇ア縺縺セ縺吶
-sfu繧剃サ倥¢繧九→縲∵、懃エ「蠑上r隲也炊蜥梧嶌蠑上→縺励※謇ア縺縺セ縺吶
-sfi繧剃サ倥¢繧九→縲∵、懃エ「蠑上r隲也炊遨肴嶌蠑上→縺励※謇ア縺縺セ縺吶
-hs繧剃サ倥¢繧九→縲∬ゥイ蠖捺枚譖ク縺ョ繧ケ繧ウ繧「諠蝣ア繧貞コ蜉帙↓蜷ォ繧√∪縺吶
-hu繧剃サ倥¢繧九→縲∬ゥイ蠖捺枚譖ク縺ョ縺URL繧貞コ蜉帙↓蜷ォ繧√∪縺吶
-attr縺ッ邨槭j霎シ縺ソ縺ョ螻樊ァ譚。莉カ繧呈欠螳壹@縺セ縺吶り、謨ー謖螳壼庄閭ス縺ァ縺吶
-ord縺ッ繧ス繝シ繝域擅莉カ繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ繧ケ繧ウ繧「縺ョ髯埼縺ァ縺吶
-max縺ッ譛螟ァ陦ィ遉コ莉カ謨ー繧呈欠螳壹@縺セ縺吶りイ謨ー縺ォ縺吶k縺ィ辟。蛻カ髯舌↓縺ェ繧翫∪縺吶ゅョ繝輔か繝ォ繝医ッ10莉カ縺ァ縺吶
-sk縺ッ陦ィ遉コ繧偵せ繧ュ繝繝励☆繧倶サカ謨ー繧呈欠螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ0莉カ縺ァ縺吶
-aux縺ッ陬懷勧繧、繝ウ繝繝繧ッ繧ケ縺ョ邨先棡繧呈治逕ィ縺吶k險ア蜿ッ繧呈欠螳壹@縺セ縺吶0繧定カ翫∴縺ェ縺蛟、繧呈欠螳壹☆繧九→陬懷勧繧、繝ウ繝繝繧ッ繧ケ縺ッ菴ソ繧上l縺セ縺帙s縲ゅョ繝輔か繝ォ繝医ッ32莉カ縺ァ縺吶
-dis縺ッ驥崎、蝗樣∩螻樊ァ縺ョ蜷榊燕繧呈欠螳壹@縺セ縺吶
estcmd randput [-ren|-rla|-reu|-ror|-rjp|-rch] [-cs num] db dnum
辟。菴懃ぜ縺ォ逕滓舌@縺滓枚譖ク繧堤匳骭イ縺吶k繝繧ケ繝医r陦後>縺セ縺吶
-ren繧剃サ倥¢繧九→縲∬恭譁鬚ィ縺ョ譁譖ク縺ョ縺ソ繧堤匳骭イ縺励∪縺吶ゅョ繝輔か繝ォ繝医ッ蜈ィ遞ョ鬘槭r逋サ骭イ縺励∪縺吶
-rla繧剃サ倥¢繧九→縲∫峡譁縲∽サ乗枚縲∬・ソ譁鬚ィ縺ョ譁譖ク縺ョ縺ソ繧堤匳骭イ縺励∪縺吶
-reu繧剃サ倥¢繧九→縲∝ク梧枚縲髴イ譁鬚ィ縺ョ譁譖ク縺ョ縺ソ繧堤匳骭イ縺励∪縺吶
-ror繧剃サ倥¢繧九→縲√い繧ク繧「蜈ィ蝓溘ョ譁蟄励r菴ソ縺」縺滓枚譖ク縺ョ縺ソ繧堤匳骭イ縺励∪縺吶
-rjp繧剃サ倥¢繧九→縲∝柱譁鬚ィ縺ョ譁譖ク縺ョ縺ソ繧堤匳骭イ縺励∪縺吶
-rch繧剃サ倥¢繧九→縲ゞCS-2縺ョ蜈ィ縺ヲ縺ョ譁蟄励r菴ソ縺」縺滓枚譖ク縺ョ縺ソ繧堤匳骭イ縺励∪縺吶
-cs縺ッ縲√く繝」繝繧キ繝・繝。繝「繝ェ縺ョ繧オ繧、繧コ繧偵Γ繧ャ繝舌う繝亥腰菴阪〒謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ64MB縺ァ縺吶
estcmd wicked db dnum
譁譖ク縺ョ逋サ骭イ縲∝炎髯、縲∵、懃エ「縲√ョ繝シ繧ソ繝吶シ繧ケ縺ョ髢矩哩縲∵怙驕ゥ蛹悶↑縺ゥ繧堤┌菴懃ぜ縺ォ郢ー繧願ソ斐☆繝繧ケ繝医r陦後>縺セ縺吶
dnum縺ッ蜃ヲ逅縺ョ蝗樊焚繧呈欠螳壹@縺セ縺吶
estcmd regression db
蝗槫クー繝繧ケ繝医r陦後>縺セ縺吶
estcmd version
繝舌シ繧ク繝ァ繝ウ縺ィ闡嶺ス懈ィゥ縺ョ諠蝣ア繧貞コ蜉帙@縺セ縺吶

蜈ィ縺ヲ縺ョ繧オ繝悶さ繝槭Φ繝峨ッ縲∝ヲ逅縺梧ュ」蟶ク縺ォ邨ゆコ縺励◆蝣エ蜷医↓縺ッ0繧偵√◎縺縺ァ縺ェ縺蝣エ蜷医ッ1繧堤オゆコ繧ケ繝繝シ繧ソ繧ケ縺ォ縺励∪縺吶putoutgatherpurgerandputwickedregression縺ォ縺、縺縺ヲ縺ッ縲∝ョ溯。御クュ縺ョ繝励Ο繧サ繧ケ縺ォ1シSIGHUPシ峨2シSIGINTシ峨3シSIGQUITシ峨13シSIGPIPEシ峨15シSIGTERMシ峨ョ縺ゥ繧後°縺ョ繧キ繧ー繝翫Ν繧帝√k縺薙→縺ォ繧医j縲√ョ繝シ繧ソ繝吶シ繧ケ繧帝哩縺倥※豁」蟶ク邨ゆコ縺輔○繧九%縺ィ縺後〒縺阪∪縺吶

create縺ョ縲-attr縲阪が繝励す繝ァ繝ウ縺ォ縺翫¢繧九ョ繝シ繧ソ蝙九ッ縲√seq縲阪↑繧峨す繝シ繧ア繝ウ繧キ繝」繝ォ蝙九√str縲阪↑繧画枚蟄怜怜梛縲√num縲阪↑繧画焚蛟、蝙九↓縺ェ繧翫∪縺吶

gather遲峨ョ縲-ic縲阪が繝励す繝ァ繝ウ縺ァ縺ッ縲√UTF-8縲阪EUC-JP縲阪Shift_JIS縲阪ISO-2022-JP縲阪ISO-8859-1縲阪↑縺ゥ縺ョ縲!ETF縺ォ逋サ骭イ縺輔l縺ヲ縺繧区枚蟄励さ繝シ繝牙錐繧呈欠螳壹@縺ヲ縺上□縺輔>縲ょョ滄圀縺ォ縺ッ縲(conv縺瑚ェ崎ュ倥☆繧句錐蜑阪ッ蜈ィ縺ヲ菴ソ縺医∪縺吶ゅ∪縺溘√-il縲阪が繝励す繝ァ繝ウ縺ァ縺ッ縲√en縲搾シ郁恭隱橸シ峨√ja縲搾シ域律譛ャ隱橸シ峨√zh縲搾シ井クュ蝗ス隱橸シ峨√ko縲搾シ域悃魄ョ隱橸シ峨ョ縺ゥ繧後°繧呈欠螳壹@縺ヲ縺上□縺輔>縲

gather縺ョ縲-fx縲阪が繝励す繝ァ繝ウ縺ァ謖螳壹@縺溷、夜Κ繧ウ繝槭Φ繝峨ッ縲∫ャャ1蠑墓焚縺ォ蟇セ雎。譁譖ク縺ョ繝代せ縲∫ャャ2蠑墓焚縺ォ蜃コ蜉帛医ョ繝代せ縺梧ク。縺輔l縺ヲ蜻シ縺ウ蜃コ縺輔l縺セ縺吶ゅ☆縺ェ繧上■縲∝、夜Κ繧ウ繝槭Φ繝峨ッ隨ャ1蠑墓焚縺ョ繝輔ぃ繧、繝ォ繧定ァ」譫舌@縺ヲ譁譖ク繝峨Λ繝輔ヨ繧繝励Ξ繝シ繝ウ繝繧ュ繧ケ繝医dHTML繧МIME繧堤函謌舌@縲∫ャャ2蠑墓焚縺ョ繝輔ぃ繧、繝ォ縺ォ譖ク縺崎セシ繧縺ィ縺縺讖溯ス繧呈戟縺、縺薙→縺梧悄蠕縺輔l縺セ縺吶ゅ↑縺翫∝ッセ雎。譁譖ク縺ッ荳譎ゅヵ繧。繧、繝ォ縺ィ縺励※繧ウ繝斐シ縺輔l縺ヲ貂。縺輔l縺セ縺吶ょッセ雎。譁譖ク縺ョ蜈譚・縺ョ繝代せ縺ッ迺ー蠅螟画焚ESTORIGFILE縺ョ蛟、縺ィ縺励※貂。縺輔l縺セ縺吶′縲∵アコ縺励※蜈縺ョ繝輔ぃ繧、繝ォ繧貞、画峩縺励※縺ッ縺縺代∪縺帙s縲ESTORIGFILE繧剃スソ縺蝣エ蜷医ッ繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧蠢隕√ッ縺ゅj縺セ縺帙s縺ョ縺ァ縲√-fo縲阪が繝励す繝ァ繝ウ繧ょ酔譎ゅ↓縺、縺代k縺ィ繧医>縺ァ縺励g縺縲

gather縺ィextkeys縺ョ螳溯。梧凾縺ォ縺ッ縲∽サョ諠ウ繝。繝「繝ェ縺ョ遨コ縺埼伜沺縺悟ー代↑縺蝣エ蜷医↓縺ッ蜃ヲ逅繧貞●豁「縺吶k繝√ぉ繝繧ッ讖溯ス縺悟ロ縺阪∪縺吶6NIX邉サ縺ョOS縺ァ繧ケ繝ッ繝繝鈴伜沺繧堤「コ菫昴@縺ヲ縺縺ェ縺蝣エ蜷医ッ縺薙ョ繝√ぉ繝繧ッ縺瑚ェ、蜍穂ス懊☆繧句エ蜷医′縺ゅj縺セ縺吶ョ縺ァ縲√◎縺ョ髫帙↓縺ッ縲-ncm縲阪が繝励す繝ァ繝ウ繧呈欠螳壹@縺ヲ螳溯。後@縺ヲ縺上□縺輔>縲

蠢懃畑萓具シ壹Γ繝シ繝ォ繝懊ャ繧ッ繧ケ縺ョ繧、繝ウ繝繧ッ繧キ繝ウ繧ー

mh蠖「蠑擾シ1繝。繝シ繝ォシ1繝輔ぃ繧、繝ォシ峨〒繝。繝シ繝ォ繝懊ャ繧ッ繧ケ繧堤ョ。逅縺吶k繝。繝シ繝ゥシMew縲仝anderlust縲ヾylpheed縺ェ縺ゥシ峨r縺贋スソ縺縺ェ繧峨∝九縺ョ繝。繝シ繝ォ繧貞ッセ雎。縺ォ縺励◆蜈ィ譁讀懃エ「縺ョ繧、繝ウ繝繝繧ッ繧ケ繧堤ー。蜊倥↓菴懊k縺薙→縺後〒縺阪∪縺吶ゆセ九∴縺ー縲√Γ繝シ繝ォ繝懊ャ繧ッ繧ケ縺後/home/mikio/Mail縲阪↓縺ゅj縲√◎縺ョ荳ュ縺ョbusiness繝輔か繝ォ繝縺鞠riends繝輔か繝ォ繝縺ォ謖ッ繧雁縺代i繧後◆繝。繝シ繝ォ繧堤匳骭イ縺吶k蝣エ蜷医∽サ・荳九ョ繧ウ繝槭Φ繝峨r螳溯。後@縺セ縺吶

find /home/mikio/Mail -type f | egrep 'inbox/(business|friends)/[0-9]+$' |
  estcmd gather -cl -fm -cm casket -

菴懈舌&繧後◆繧、繝ウ繝繝繧ッ繧ケ縺ッ縲estseek.cgi繧剃スソ縺」縺ヲ讀懃エ「縺吶k縺薙→縺後〒縺阪∪縺吶ゅ↑縺翫-cm繧ェ繝励す繝ァ繝ウ繧偵▽縺代※縺翫¥縺薙→縺ァ縲∝キョ蛻譖エ譁ー縺後〒縺阪∪縺吶MIME縺ォ縺ッDate繝倥ャ繝縺後≠繧翫∪縺吶ョ縺ァ縲-sd繧ェ繝励す繝ァ繝ウ縺ァ繝輔ぃ繧、繝ォ縺ョ譖エ譁ー譎ょ綾繧呈戟縺」縺ヲ縺上k蠢隕√ッ縺ゅj縺セ縺帙s縲

mh蠖「蠑丈サ・螟悶ョ繝。繝シ繝ゥ繧偵♀菴ソ縺縺ョ蝣エ蜷医ッ縲[h蠖「蠑上↓縺ェ繧九h縺縺ォ繝。繝シ繝ォ繧偵お繧ッ繧ケ繝昴シ繝医@縺ヲ縺上□縺輔>縲8indows縺ァ險縺縺ィ縺薙m縺ョEML蠖「蠑上〒繧よァ九>縺セ縺帙s縲ゅ≠繧九>縺ッ縲、PI繧剃スソ縺」縺ヲ蟆ら畑縺ョ繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ繧剃ス懈舌@縺ヲ縺上□縺輔>縲

蠢懃畑萓具シ壼、夜Κ繧ウ繝槭Φ繝峨ョ繝輔ぅ繝ォ繧ソ

螟夜Κ繧ウ繝槭Φ繝峨r繝輔ぅ繝ォ繧ソ縺ィ縺励※蜻シ縺ウ蜃コ縺吶%縺ィ繧ゅ〒縺阪∪縺吶ゅ/usr/local/share/hyperestraier/filter/縲阪↓蜷遞ョ縺ョ繝輔ぅ繝ォ繧ソ縺後う繝ウ繧ケ繝医シ繝ォ縺輔l縺ヲ縺繧九ョ縺ァ縲驕ゥ螳懊#蛻ゥ逕ィ縺上□縺輔>縲

estfxmantotxt縺ッUNIX縺ョman縺ョ繝槭ル繝・繧「繝ォ繧偵励Ξ繝シ繝ウ繝繧ュ繧ケ繝亥ス「蠑上↓螟画鋤縺吶k繝輔ぅ繝ォ繧ソ縺ァ縺吶ゆサ・荳九ョ繧医≧縺ォ蛻ゥ逕ィ縺励※縲man縺ョ繝輔ぃ繧、繝ォ繧貞ッセ雎。縺ォ縺励◆繧、繝ウ繝繝繧ッ繧ケ繧剃ス懊k縺薙→縺後〒縺阪∪縺吶

PATH=$PATH:/usr/local/share/hyperestraier/filter ; export PATH
find /usr/share/man /usr/local/man -type f |
  egrep '.*/man[0-3]/.*\.[0-3](.gz)*$' |
  estcmd gather -cl -fx ".1,.2,.3,.1.gz,.2.gz,.3.gz" "T@estfxmantotxt" -fz -sd -cm casket -

estfxmsotohtml縺ッMS-OfficeシWord/Excel/PowerPointシ峨ョ繝輔ぃ繧、繝ォ繧辿TML蠖「蠑上↓螟画鋤縺吶k繝輔ぅ繝ォ繧ソ縺ァ縺吶ゆサ・荳九ョ繧医≧縺ォ蛻ゥ逕ィ縺励※縲`S-Office縺ョ繝輔ぃ繧、繝ォ繧貞ッセ雎。縺ォ縺励◆繧、繝ウ繝繝繧ッ繧ケ繧剃ス懊k縺薙→縺後〒縺阪∪縺吶ゅ↑縺翫estfxmsotohtml繧貞虚菴懊&縺帙k縺ォ縺ッwvWareシwv-1.0.3シ峨→xlhtmlシppthtml繧ょ酔譴アシ峨r繧、繝ウ繧ケ繝医シ繝ォ縺励※縺翫¥縺薙→縺悟ソ隕√〒縺吶

PATH=$PATH:/usr/local/share/hyperestraier/filter ; export PATH
estcmd gather -cl -fx ".doc,.xls,.ppt" "H@estfxmsotohtml" -fz -ic UTF-8 -sd -cm casket .

estfxpdftohtml縺ッPDF縺ョ繝輔ぃ繧、繝ォ繧辿TML蠖「蠑上↓螟画鋤縺吶k繝輔ぅ繝ォ繧ソ縺ァ縺吶ゆサ・荳九ョ繧医≧縺ォ蛻ゥ逕ィ縺励※縲 ̄DF縺ョ繝輔ぃ繧、繝ォ繧貞ッセ雎。縺ォ縺励◆繧、繝ウ繝繝繧ッ繧ケ繧剃ス懊k縺薙→縺後〒縺阪∪縺吶ゅ↑縺翫estfxpdftohtml繧貞虚菴懊&縺帙k縺ォ縺ッpdftotextxpdf縺ォ蜷梧「アシ峨r繧、繝ウ繧ケ繝医シ繝ォ縺励※縺翫¥縺薙→縺悟ソ隕√〒縺吶

PATH=$PATH:/usr/local/share/hyperestraier/filter ; export PATH
estcmd gather -cl -fx ".pdf" "H@estfxpdftohtml" -fz -ic UTF-8 -sd -cm casket .

estfxxdwtotxt縺ッDocuWorks縺ョ繝輔ぃ繧、繝ォ繧偵励Ξ繝シ繝ウ繝繧ュ繧ケ繝亥ス「蠑上↓螟画鋤縺吶k繝輔ぅ繝ォ繧ソ縺ァ縺吶ゆサ・荳九ョ繧医≧縺ォ蛻ゥ逕ィ縺励※縲.ocuWorks縺ョ繝輔ぃ繧、繝ォ繧貞ッセ雎。縺ォ縺励◆繧、繝ウ繝繝繧ッ繧ケ繧剃ス懊k縺薙→縺後〒縺阪∪縺吶ゅ↑縺翫estfxxdwtotxt繧貞虚菴懊&縺帙k縺ォ縺ッxdw2text繧偵う繝ウ繧ケ繝医シ繝ォ縺励※縺翫¥縺薙→縺悟ソ隕√〒縺吶

PATH=$PATH:/usr/local/share/hyperestraier/filter ; export PATH
estcmd gather -cl -fx ".xdw" "T@estfxxdwtotxt" -fz -ic CP932 -sd -cm casket .

蜷繝輔ぅ繝ォ繧ソ縺ョ荳ュ霄ォ繧定ヲ九※縺縺溘□縺代l縺ー縲√→縺ヲ繧らー。蜊倥↑繧キ繧ァ繝ォ繧ケ繧ッ繝ェ繝励ヨ縺ァ縺ゅk縺薙→縺後♀蛻縺九j縺縺溘□縺代k縺ィ諤昴>縺セ縺吶ゅす繧ァ繝ォ繧Пerl繧Сuby遲峨〒蜷梧ァ倥ョ繝励Ο繧ー繝ゥ繝繧呈嶌縺代ー讒倥縺ェ繝輔ぅ繝ォ繧ソ繧堤ー。蜊倥↓菴懊k縺薙→縺後〒縺阪∪縺吶ゅ◆縺縺励∝、夜Κ繧ウ繝槭Φ繝峨ョ繝輔ぅ繝ォ繧ソ縺ッ蜻シ縺ウ蜃コ縺励ョ繧ェ繝シ繝舌シ繝倥ャ繝峨′螟ァ縺阪>縺ョ縺ァ縲∝、ァ驥上ョ譁譖ク繧呈桶縺縺ョ縺ォ縺ッ蜷代>縺ヲ縺縺セ縺帙s縲よ悽譬シ逧縺ォ繧繧九↑繧峨ーAPI繧剃スソ縺」縺ヲ縺上□縺輔>縲

蠢懃畑萓具シ壹さ繝槭Φ繝峨Λ繧、繝ウ縺九i縺ョ讀懃エ「

繧ウ繝槭Φ繝峨Λ繧、繝ウ縺九i讀懃エ「縺吶k髫帙↓縺ッ縲∫ォッ譛ォ縺ョ譁蟄励さ繝シ繝峨r閠諷ョ縺吶k蠢隕√′縺ゅj縺セ縺吶ゆセ九∴縺ー遶ッ譛ォ縺ョ譁蟄励さ繝シ繝峨′EUC-JP縺ョ蝣エ蜷医ッ縲∽サ・荳九ョ繧医≧縺ォ縺吶k縺ィ繧医>縺ァ縺励g縺縲

estcmd search -ic EUC-JP -vh -max 8 casket '縺薙s縺ォ縺。縺ッ' |
  iconv -f UTF-8 -t EUC-JP -c | less

-ic繧ェ繝励す繝ァ繝ウ縺ァ讀懃エ「蠑上ョ譁蟄励さ繝シ繝峨r謖螳壹@縺ヲ縲(conv縺ァ蜃コ蜉帙ョ譁蟄励さ繝シ繝峨r螟画鋤縺励※縺縺セ縺吶-vh繧ェ繝励す繝ァ繝ウ縺ィ-max繧ェ繝励す繝ァ繝ウ縺ッ讀懃エ「邨先棡繧定ヲ九d縺吶¥縺吶k縺溘a縺ォ縺、縺代※縺縺セ縺吶ゆク願ソー縺ョ讀懃エ「隱槭r蜿ッ螟峨↓縺励◆繧ケ繧ッ繝ェ繝励ヨ繧剃ス懊▲縺ヲ縺翫¥縺ィ萓ソ蛻ゥ縺九b縺励l縺セ縺帙s縲

蠢懃畑萓具シ唸ML蠖「蠑上ョ讀懃エ「邨先棡

蜷遞ョ縺ョ繧ケ繧ッ繝ェ繝励ヨ險隱槭°繧羽yper Estraier縺ョ讀懃エ「邨先棡繧呈焔霆ス縺ォ蛻ゥ逕ィ縺吶k縺溘a縺ォ縺ッ縲estcmd縺ョXML蜃コ蜉帶ゥ溯ス繧堤畑縺繧九→繧医>縺ァ縺励g縺縲9ML縺ョ隧ウ縺励>譖ク蠑上↓縺、縺縺ヲ縺ッestresult.dtd繧偵#隕ァ縺上□縺輔>縲

estcmd search -vx -max 8 casket 'socket AND shutdown'

讀懃エ「逕ィCGI繧ケ繧ッ繝ェ繝励ヨ

縺薙%縺ァ縺ッ縲∵、懃エ「逕ィCGI繧ケ繧ッ繝ェ繝励ヨestseek.cgi縺ョ隧ウ邏ー縺ェ莉墓ァ倥r隱ャ譏弱@縺セ縺吶りィュ螳壹ヵ繧。繧、繝ォ縺ョ譖ク縺肴婿縺御クュ蠢縺ォ縺ェ繧翫∪縺吶

讒区

estseek.cgi縺悟虚菴懊☆繧九↓縺ッ縲險ュ螳壹ヵ繧。繧、繝ォ縺ィ繝繝ウ繝励Ξ繝シ繝医ヵ繧。繧、繝ォ縺ィ繝医ャ繝励壹シ繧ク繝輔ぃ繧、繝ォ縺ィ繝倥Ν繝励ヵ繧。繧、繝ォ縺悟ソ隕√〒縺吶ゅ◎繧後◇繧estseek.confestseek.tmplestseek.topestseek.help縺ィ縺縺縺ョ縺梧ィ呎コ也噪縺ェ蜷榊燕縺ァ縺吶

險ュ螳壹ヵ繧。繧、繝ォ縺ョ蜷榊燕縺ッCGI繧ケ繧ッ繝ェ繝励ヨ縺ョ謗・蟆セ霎槭r.conf縺ォ螟峨∴縺溘b縺ョ縺ァ縺吶estseek.cgiestsearch.cgi縺ィ縺縺蜷榊燕縺ォ螟峨∴縺溘→縺励◆繧峨estsearch.conf縺瑚ェュ縺ソ霎シ縺セ繧後∪縺吶ゅ◎縺ョ莉悶ョ繝輔ぃ繧、繝ォ縺ョ蜷榊燕縺ッ險ュ螳壹ヵ繧。繧、繝ォ縺ョ荳ュ縺ァ險倩ソー縺輔l縺セ縺吶ョ縺ァ縲∝酔荳繝繧」繝ャ繧ッ繝医Μ縺ョ荳ュ縺ォ縺縺上▽繧ゅョ讀懃エ「逕ィ繝壹シ繧ク繧定ィュ鄂ョ縺吶k縺薙→縺後〒縺阪∪縺吶

estseek.cgi縺ッ縲/usr/local/libexec/estseek.cgi縲阪→縺励※繧、繝ウ繧ケ繝医シ繝ォ縺輔l縺ヲ縺縺セ縺吶ョ縺ァ縲√◎繧後r繧ウ繝斐シ縺励※蛻ゥ逕ィ縺励※縺上□縺輔>縲ゅ∪縺溘∬ィュ螳壹ヵ繧。繧、繝ォ縺ェ縺ゥ縺ョ繧オ繝ウ繝励Ν縺後/usr/local/share/hyperestraier/縲阪ョ荳ュ縺ォ繧、繝ウ繧ケ繝医シ繝ォ縺輔l縺ヲ縺縺セ縺吶ョ縺ァ縲√◎繧後r繧ウ繝斐シ縺励※菫ョ豁」縺吶k縺ィ讌ス縺ァ縺吶ゅ/usr/local/share/hyperestraier/locale/ja/縲阪ョ荳ュ縺ォ縺ッ譌・譛ャ隱槫喧縺輔l縺溘し繝ウ繝励Ν繧ゅ≠繧翫∪縺吶

險ュ螳壹ヵ繧。繧、繝ォ縺ョ譖ク蠑

險ュ螳壹ヵ繧。繧、繝ォ縺ッ縲∝、画焚蜷阪→蛟、繧偵:縲阪〒蛹コ蛻縺」縺溷ス「蠑上ョ陦後r荳ヲ縺ケ縺溘b縺ョ縺ァ縺吶ゅ#縲阪〒蟋九∪繧玖。後ッ繧ウ繝。繝ウ繝医→縺励※辟。隕悶&繧後∪縺吶ゅョ繝輔か繝ォ繝医〒縺ッ縲∬ィュ螳壹ヵ繧。繧、繝ォ縺ッ莉・荳九ョ繧医≧縺ェ蜀螳ケ縺ォ縺ェ縺」縺ヲ縺縺セ縺吶

indexname: casket
tmplfile: estseek.tmpl
topfile: estseek.top
helpfile: estseek.help
lockindex: true
pseudoindex:
replace: ^file:///home/mikio/public_html/{{!}}http://localhost/
replace: /index\.html?${{!}}/
showlreal: false
deftitle: Hyper Estraier: a full-text search system for communities
formtype: normal
perpage: 10 100 10
attrselect: false
#genrecheck: private{{!}}private
#genrecheck: business{{!}}business
#genrecheck: misc{{!}}miscellaneous
attrwidth: 80
showscore: true
extattr: author|Author
extattr: from|From
extattr: to|To
extattr: cc|Cc
extattr: date|Date
snipwwidth: 480
sniphwidth: 96
snipawidth: 96
condgstep: 2
dotfidf: true
scancheck: 3
phraseform: 2
dispproxy:
candetail: true
candir: false
auxmin: 32
smlrvnum: 32
smlrtune: 16 1024 4096
clipview: 2
clipweight: none
relkeynum: 0
spcache:
wildmax: 256
qxpndcmd:
logfile:
logformat: {time}\t{REMOTE_ADDR}:{REMOTE_PORT}\t{cond}\n

縺昴l縺槭l縺ョ螟画焚縺ョ讖溯ス繧剃サ・荳九↓遉コ縺励∪縺吶

  • indexname : 繧、繝ウ繝繝繧ッ繧ケ縺ョ繝代せ繧呈欠螳壹@縺セ縺吶
  • tmplfile : 繝繝ウ繝励Ξ繝シ繝医ヵ繧。繧、繝ォ縺ョ繝代せ繧呈欠螳壹@縺セ縺吶
  • topfile : 繝医ャ繝励壹シ繧ク繝輔ぃ繧、繝ォ縺ョ繝代せ繧呈欠螳壹@縺セ縺吶
  • helpfile : 繝倥Ν繝励ヵ繧。繧、繝ォ縺ョ繝代せ繧呈欠螳壹@縺セ縺吶
  • lockindex : 繧、繝ウ繝繝繧ッ繧ケ縺ォ繝輔ぃ繧、繝ォ繝ュ繝繧ッ繧偵°縺代k縺九←縺縺九r謖螳壹@縺セ縺吶ゅtrue縲阪°縲false縲阪〒縺吶
  • pseudoindex : 讀懃エ「蟇セ雎。縺ィ縺励※霑ス蜉縺吶k逍台シシ繧、繝ウ繝繝繧ッ繧ケ縺ョ繝代せ繧呈欠螳壹@縺セ縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • replace : URI繧貞、画鋤縺吶k縺溘a縺ョ豁」隕剰。ィ迴セ縺ィ鄂ョ謠帶枚蟄怜励r縲{{!}}縲阪〒蛹コ蛻縺」縺ヲ謖螳壹@縺セ縺吶ょ、画鋤譁蟄怜怜縺ョ縲&縲阪ッ荳閾エ譁蟄怜励↓螻暮幕縺輔l縺セ縺吶るΚ蛻蠑上↓螻暮幕縺輔l繧九\1縲阪°繧峨\9縲阪b蛻ゥ逕ィ縺ァ縺阪∪縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • showlreal : URI縺ョ莉」繧上j縺ォ繝ュ繝シ繧ォ繝ォ縺ョ邨カ蟇セ繝代せ繧定。ィ遉コ縺吶k縺九←縺縺九r謖螳壹@縺セ縺吶ゅtrue縲阪°縲false縲阪〒縺吶
  • deftitle : 繝繝輔か繝ォ繝医ョ繝壹シ繧ク繧ソ繧、繝医Ν繧呈欠螳壹@縺セ縺吶
  • formtype : 蜈・蜉帙ヵ繧ゥ繝シ繝縺ョ遞ョ鬘槭r謖螳壹@縺セ縺吶ゅnormal縲阪ッ豎守畑縺ァ縲√web縲阪ッWeb繧オ繧、繝育畑縺ァ縲√file縲阪ッ繝輔ぃ繧、繝ォ繧キ繧ケ繝繝逕ィ縺ァ縲√mail縲阪ッ繝。繝シ繝ォ繝懊ャ繧ッ繧ケ逕ィ縺ァ縺吶
  • perpage : 陦ィ遉コ莉カ謨ー縺ョ繧サ繝ャ繧ッ繝医懊ャ繧ッ繧ケ縺ョ譛菴主、縺ィ譛螟ァ蛟、縺ィ蠅怜繧呈欠螳壹@縺セ縺吶
  • attrselect : 螻樊ァ譚。莉カ縺ョ蜈・蜉帙↓繧サ繝ャ繧ッ繝医懊ャ繧ッ繧ケ繧剃スソ縺縺九r謖螳壹@縺セ縺吶ゅtrue縲阪°縲false縲阪〒縺吶
  • genrecheck : 繧ク繝」繝ウ繝ォ螻樊ァ縺ォ繧医k邨槭j霎シ縺ソ縺ョ縺溘a縺ョ繝√ぉ繝繧ッ繝懊ャ繧ッ繧ケ繧呈欠螳壹@縺セ縺吶ょア樊ァ蛟、縺ィ陦ィ遉コ逕ィ縺ョ繝ゥ繝吶Ν繧偵{{!}}縲阪〒蛹コ蛻縺」縺ヲ謖螳壹@縺セ縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • attrwidth : 陦ィ遉コ縺吶k螻樊ァ蛟、縺ョ譛螟ァ蟷繧呈欠螳壹@縺セ縺吶
  • showscore : 繧ケ繧ウ繧「繧定。ィ遉コ縺吶k縺九r謖螳壹@縺セ縺吶ゅtrue縲阪°縲false縲阪〒縺吶
  • extattr : 陦ィ遉コ縺吶k螻樊ァ縺ョ蜷榊燕縺ィ繝ゥ繝吶Ν繧偵|縲阪〒蛹コ蛻縺」縺ヲ謖螳壹@縺セ縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • snipwwidth : 讀懃エ「邨先棡縺ョ繧ケ繝九壹ャ繝医ョ蜈ィ菴薙ョ蟷繧呈欠螳壹@縺セ縺吶
  • sniphwidth : 讀懃エ「邨先棡縺ョ繧ケ繝九壹ャ繝医r菴懊k髫帙↓譁譖ク縺ョ蜀帝ュ縺九i蜿門セ励☆繧句ケ繧呈欠螳壹@縺セ縺吶
  • snipawidth : 讀懃エ「邨先棡縺ョ繧ケ繝九壹ャ繝医r菴懊k髫帙↓讀懃エ「隱槭ョ蜻ィ霎コ縺九i蜿門セ励☆繧句ケ繧呈欠螳壹@縺セ縺吶
  • condgstep : N-gram縺ョ讀懈渊邊セ蠎ヲ繧呈欠螳壹@縺セ縺吶ゅ1縲阪□縺ィ蜈ィ縺ヲ縺ョ隱槭r隱ソ縺ケ縲√2縲阪□縺ィ1蛟狗スョ縺阪√3縲阪□縺ィ2蛟狗スョ縺阪√4縲阪□縺ィ3蛟狗スョ縺阪↓隱ソ縺ケ縺セ縺吶
  • dotfidf : TF-IDF豕輔r驕ゥ逕ィ縺吶k縺九←縺縺九r謖螳壹@縺セ縺吶ゅtrue縲阪°縲false縲阪〒縺吶
  • scancheck : 譁譖ク縺ョ蜀螳ケ縺ィ讀懃エ「繝輔Ξ繝シ繧コ縺ョ邊セ蟇讀懈渊繧偵☆繧区焚繧呈欠螳壹@縺セ縺吶
  • phraseform : 讀懃エ「譚。莉カ蠑上ョ遞ョ鬘樊欠螳壹@縺セ縺吶ゅ1縲阪□縺ィ騾壼クク譖ク蠑上〒縲√2縲阪□縺ィ邁。萓ソ譖ク蠑上〒縲√3縲阪□縺ィ邊礼払譖ク蠑上〒縲√4縲阪□縺ィ隲也炊蜥梧嶌蠑上〒縲√5縲阪□縺ィ隲也炊遨肴嶌蠑上〒縺吶
  • dispproxy : 陦ィ遉コ逕ィCGI繧ケ繧ッ繝ェ繝励ヨシestproxy.cgiシ峨ョURL繧呈欠螳壹@縺セ縺吶ゅ[URI]縲阪→謖螳壹☆繧九→蜷譁譖ク縺ョURI縺ォ鄂ョ謠帙&繧後∪縺吶ら怐逡・縺吶k縺ィ菫ョ鬟セ陦ィ遉コ縺ッ辟。蜉ケ縺ォ縺ェ繧翫∪縺吶
  • candetail : 隧ウ邏ー陦ィ遉コ繧呈怏蜉ケ縺ォ縺吶k縺九←縺縺九r謖螳壹@縺セ縺吶ゅtrue縲阪°縲false縲阪〒縺吶
  • candir : 繝繧」繝ャ繧ッ繝医Μ陦ィ遉コ繧呈怏蜉ケ縺ォ縺吶k縺九←縺縺九r謖螳壹@縺セ縺吶ゅtrue縲阪°縲false縲阪〒縺吶
  • auxmin : 陬懷勧繧、繝ウ繝繝繧ッ繧ケ縺ョ邨先棡繧呈治逕ィ縺吶k譛菴弱ョ譁譖ク謨ー繧呈欠螳壹@縺セ縺吶0縺ェ繧芽」懷勧繧、繝ウ繝繝繧ッ繧ケ繧剃スソ縺縺セ縺帙s縲
  • smlrvnum : 鬘樔シシ讀懃エ「縺ョ繝吶け繝医Ν縺ョ谺。蜈謨ー繧呈欠螳壹@縺セ縺吶0縺ェ繧蛾。樔シシ讀懃エ「縺檎┌蜉ケ縺ォ縺ェ繧翫∪縺吶
  • smlrtune : 鬘樔シシ讀懃エ「縺ョ繝√Η繝シ繝九Φ繧ー繝代Λ繝。繝シ繧ソ繧呈欠螳壹@縺セ縺吶ゅく繝シ繝ッ繝シ繝画焚縺ィ繧ュ繝シ繝ッ繝シ繝画ッ弱ョ譁譖ク謨ー縺ィ蜈ィ菴薙ョ蛟呵」懊ョ謨ー繧堤ゥコ逋ス蛹コ蛻繧翫〒謖螳壹@縺セ縺吶
  • clipview : 鬘樔シシ髫阡ス縺ョ髫帙↓陦ィ遉コ縺輔l繧区枚譖ク謨ー繧呈欠螳壹@縺セ縺吶りイ謨ー縺ェ繧蛾。樔シシ髫阡ス縺檎┌蜉ケ縺ォ縺ェ繧翫∪縺吶
  • clipweight : 鬘樔シシ髫阡ス縺ョ髫帙ョ驥阪∩莉倥¢繧呈欠螳壹@縺セ縺吶ゅnone縲阪□縺ィ驥阪∩莉倥¢繧偵○縺壹√url縲阪□縺ィURL繧堤畑縺縺セ縺吶
  • relkeynum : 陦ィ遉コ縺吶k髢「騾」隱槭ョ謨ー繧呈欠螳壹@縺セ縺吶
  • spcache : 繧ケ繝壹す繝」繝ォ繧ュ繝」繝繧キ繝・縺ョ螻樊ァ蜷阪r謖螳壹@縺セ縺吶
  • wildmax : 繝ッ繧、繝ォ繝峨き繝シ繝牙ア暮幕縺ョ譛螟ァ隱樊焚繧呈欠螳壹@縺セ縺吶
  • qxpndcmd : 繧ッ繧ィ繝ェ螻暮幕縺ョ繧ウ繝槭Φ繝峨r謖螳壹@縺セ縺吶らゥコ譁蟄怜励↑繧峨け繧ィ繝ェ螻暮幕縺檎┌蜉ケ縺ォ縺ェ繧翫∪縺吶
  • logfile : 繝ュ繧ー繝輔ぃ繧、繝ォ縺ョ繝代せ繧呈欠螳壹@縺セ縺吶
  • logformat : 繝ュ繧ー縺ョ譖ク蠑上r謖螳壹@縺セ縺吶ゅ{time}縲阪ッ迴セ蝨ィ譎ょ綾縺ォ螟画鋤縺輔l縲√{cond}縲阪ッ讀懃エ「譚。莉カ縺ォ鄂ョ謠帙&繧後√{hnum}縲阪ッ讀懃エ「縺ョ隧イ蠖謎サカ謨ー縺ォ鄂ョ謠帙&繧後√◎繧御サ・螟悶〒縲{}縲阪〒諡ャ縺」縺溘b縺ョ縺ッ縺昴ョ蜷榊燕縺ョ迺ー蠅螟画焚縺ョ蛟、縺ォ鄂ョ謠帙&繧後∪縺吶ゅ\t縲阪ッ繧ソ繝悶↓縲√\n縲阪ッ謾ケ陦後↓鄂ョ謠帙&繧後∪縺吶

replace縺ッ豁」隕剰。ィ迴セ縺ォ繧医▲縺ヲURI繧貞、画鋤縺吶k縺ョ縺ォ菴ソ縺縺セ縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶ょ磯ュ縺ォ繝槭ャ繝√☆繧九^縲阪r鬧菴ソ縺吶l縺ー謗・鬆ュ霎橸シ医ョ繧」繝ャ繧ッ繝医Μシ峨ョ螟画鋤縺後〒縺阪∪縺吶@縲∵忰蟆セ縺ォ繝槭ャ繝√☆繧九$縲阪r鬧菴ソ縺吶l縺ー謗・蟆セ霎橸シ域僑蠑オ蟄撰シ峨ョ螟画鋤縺後〒縺阪∪縺吶ゆセ九∴縺ー縲√\.htm${{!}}.html縲阪→縺吶k縺ィ縲∵忰蟆セ縺ョ縲.htm縲阪r縲.html縲阪↓螟画鋤縺ァ縺阪∪縺吶ゅ{{!}}縲阪ョ蜑阪ョ驛ィ蛻縺ッ豁」隕剰。ィ迴セ縺ェ縺ョ縺ァ縲√\縲阪d縲.縲阪↓縺ッ繧ィ繧ケ繧ア繝シ繝玲枚蟄励\縲阪r蜑咲スョ縺吶k蠢隕√′縺ゅk縺薙→縺ォ豕ィ諢上@縺ヲ縺上□縺輔>縲ゅ{{!}}縲阪ョ蠕後ョ鄂ョ謠帶枚蟄怜励ッ豁」隕剰。ィ迴セ縺ァ縺ッ縺ェ縺縺ョ縺ァ縲√お繧ケ繧ア繝シ繝励ッ蠢隕√≠繧翫∪縺帙s縲

extattr縺ッ莉サ諢上ョ螻樊ァ繧定。ィ遉コ縺吶k縺ョ縺ォ菴ソ縺縺セ縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶ゆセ九∴縺ー縲∵枚譖ク縺ョ譖エ譁ー譌・譎ゅr縲Modified縲阪→縺縺繝ゥ繝吶Ν繧偵▽縺代※陦ィ遉コ縺励◆縺蝣エ蜷医ッ縲extattr: @mtime|Modified縲阪→譖ク縺阪∵枚譖ク縺ョ繧オ繧、繧コ繧偵Size縲阪→縺縺繝ゥ繝吶Ν繧偵▽縺代※陦ィ遉コ縺励◆縺蝣エ蜷医ッ縲extattr: @size|Size縲阪→譖ク縺阪∪縺吶

繝繝ウ繝励Ξ繝シ繝医ヵ繧。繧、繝ォ

讀懃エ「繝壹シ繧ク縺ョ隕区縺医r豎コ繧√k縺溘a縺ョ繝輔ぃ繧、繝ォ縺ァ縺吶HTML縺ァ縲∬ィ倩ソー縺励※縺ゅk蜀螳ケ縺後◎縺ョ縺セ縺セ陦ィ遉コ縺輔l縺セ縺吶ゅ◆縺縺励√<!--ESTTITLE-->縲阪ョ驛ィ蛻縺ォ縺ッ繝壹シ繧ク繧ソ繧、繝医Ν縺梧諺蜈・縺輔l縲√<!--ESTFORM-->縲阪ョ驛ィ蛻縺ォ縺ッ讀懃エ「繝輔か繝シ繝縺梧諺蜈・縺輔l縲√<!--ESTRESULT-->縲阪ョ驛ィ蛻縺ォ縺ッ讀懃エ「邨先棡縺梧諺蜈・縺輔l縲√<!--ESTINFO-->縲阪ョ驛ィ蛻縺ォ縺ッ繧、繝ウ繝繝繧ッ繧ケ縺ョ諠蝣ア縺梧諺蜈・縺輔l縺セ縺吶CSS繧ЙavaScript繧帝ァ菴ソ縺吶l縺ー縲√°縺ェ繧願ェ逕ア縺ォ繝ヲ繝シ繧カ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ繧偵き繧ケ繧ソ繝槭う繧コ縺吶k縺薙→縺後〒縺阪∪縺吶

繝医ャ繝励壹シ繧ク繝輔ぃ繧、繝ォ

讀懃エ「逕ィCGI繧ケ繧ッ繝ェ繝励ヨ縺ォ譛蛻昴↓繧「繧ッ繧サ繧ケ縺励◆髫帙√≠繧九>縺ッ讀懈渊譚。莉カ繧貞ィ縺丞・蜉帙@縺ェ縺縺ァ繧「繧ッ繧サ繧ケ縺励◆髫帙↓陦ィ遉コ縺輔l繧九Γ繝繧サ繝シ繧ク繧定ィ倩ソー縺励◆繝輔ぃ繧、繝ォ縺ァ縺吶りィ倩ソー縺励※縺ゅk蜀螳ケ縺梧、懃エ「邨先棡縺ョ菴咲スョ縺ォ縺昴ョ縺セ縺セ謖ソ蜈・縺輔l縺セ縺吶ゅョ繝輔か繝ォ繝医〒縺ッHyper Estraier縺ョ繝舌リ繝シ縺瑚ィ倩ソー縺励※縺ゅj縺セ縺吶′縲√♀螂ス縺ソ縺ョ繝舌リ繝シ縺ォ螟峨∴縺溘j縲√す繧ケ繝繝縺ョ繝。繝ウ繝繝翫Φ繧ケ諠蝣ア縺ェ縺ゥ繧定ィ倩シ峨@縺溘j縺吶k縺ィ繧医>縺ァ縺励g縺縲

繝倥Ν繝励ヵ繧。繧、繝ォ

蜈・蜉帷畑繝輔か繝シ繝縺ョ莉倩ソ代↓縺ゅk縲help縲阪Μ繝ウ繧ッ繧帝∈謚槭☆繧九→陦ィ遉コ縺輔l繧九Γ繝繧サ繝シ繧ク繧定ィ倩ソー縺励◆繝輔ぃ繧、繝ォ縺ァ縺吶ゅョ繝輔か繝ォ繝医〒縺ッ讀懃エ「讖溯ス縺ョ邁。蜊倥↑菴ソ縺譁ケ縺瑚ィ倩ソー縺励※縺ゅj縺セ縺吶りィュ螳壹↓繧医▲縺ヲ讖溯ス縺悟「玲ク帙@縺溷エ蜷医ッ繝倥Ν繝励b驕ゥ蠖薙↓譖ク縺肴鋤縺医※縺上□縺輔>縲

讀懃エ「繝輔か繝シ繝縺ョ險ュ鄂ョ

Web繧オ繧、繝医ョ讀懃エ「讖溯ス縺ィ縺励※險ュ鄂ョ縺吶k蝣エ蜷医√し繧、繝医ョ繝医ャ繝励壹シ繧ク縺ォ讀懃エ「繝輔か繝シ繝繧堤スョ縺阪◆縺上↑繧九〒縺励g縺縲ゅ◎縺ョ蝣エ蜷医∽サ・荳九ョ繧医≧縺ェHTML繧呈嶌縺縺ヲ縺上□縺輔>縲

<form method="get" action="estseek.cgi">
<div>
<input type="text" name="phrase" value="" size="32" />
<input type="submit" value="Search" />
<input type="hidden" name="enc" value="UTF-8" />
</div>
</form>

estseek.cgi縲阪ョ驛ィ蛻縺ッ險ュ鄂ョ縺励◆estseek.cgi縺ョURL縺ォ縺励※縺上□縺輔>縲ゅUTF-8縲阪ョ驛ィ蛻縺ッ縺昴ョ繝壹シ繧ク縺ョ譁蟄励さ繝シ繝峨↓縺励※縺上□縺輔>縲ゅEUC-JP縲阪Shift_JIS縲阪ISO-2022-JP縲阪ISO-8859-1縲阪↑縺ゥ縺御スソ縺医∪縺吶

縺頑エ定誠縺ェ蜈・蜉帙ヵ繧ゥ繝シ繝

Web繧オ繧、繝医r讀懃エ「縺吶k髫帙↓縺ッ縲∵悽譁繧ゅ@縺上ッ繧ソ繧、繝医Ν縺ァ邨槭j霎シ繧縺薙→縺悟、壹>縺ァ縺励g縺縲ゅ∪縺溘√た繝シ繝域擅莉カ縺ォ縺ッ繧ケ繧ウ繧「縺区律莉倥°繧オ繧、繧コ繧呈欠螳壹☆繧九%縺ィ縺悟、壹>縺ァ縺励g縺縲ゅ◎縺縺縺」縺溷ク蝙狗噪縺ェ謫堺ス懊r邁。蜊倥↓陦後↑縺縺溘a縺ォ縲estseek.cgi縺ォ縺ッWeb繧オ繧、繝育畑縺ョ蜈・蜉帙ヵ繧ゥ繝シ繝縺ョ蠖「蠑上′逕ィ諢上&繧後※縺縺セ縺吶りィュ螳壹ヵ繧。繧、繝ォ縺ョformtype縺ョ蛟、繧偵web縲阪↓縺吶k縺ィ縲仝eb繧オ繧、繝域、懃エ「逕ィ縺ョ蜈・蜉帙ヵ繧ゥ繝シ繝縺ォ縺ェ繧翫∪縺吶ゅ↑縺翫仝eb繧オ繧、繝医ョ讀懃エ「繧帝ォ倬溷喧縺吶k縺ォ縺ッ縲∽サ・荳九ョ繧医≧縺ォ螻樊ァ繧、繝ウ繝繝繧ッ繧ケ繧貞シオ縺」縺ヲ縺翫¥縺ィ繧医>縺ァ縺励g縺縲

estcmd create -attr @title str -attr @mdate seq -attr @size seq casket

繝輔ぃ繧、繝ォ繧オ繝シ繝舌r讀懃エ「縺吶k髫帙↓縺ッ縲∵悽譁繧ゅ@縺上ッ繝輔ぃ繧、繝ォ蜷阪〒邨槭j霎シ繧縺薙→縺悟、壹>縺ァ縺励g縺縲ゅ∪縺溘√た繝シ繝域擅莉カ縺ォ縺ッ繧ケ繧ウ繧「縺区律莉倥°繧オ繧、繧コ繧呈欠螳壹☆繧九%縺ィ縺悟、壹>縺ァ縺励g縺縲ゅ◎縺縺縺」縺溷ク蝙狗噪縺ェ謫堺ス懊r邁。蜊倥↓陦後↑縺縺溘a縺ォ縲estseek.cgi縺ォ縺ッ繝輔ぃ繧、繝ォ繧オ繝シ繝千畑縺ョ蜈・蜉帙ヵ繧ゥ繝シ繝縺ョ蠖「蠑上′逕ィ諢上&繧後※縺縺セ縺吶りィュ螳壹ヵ繧。繧、繝ォ縺ョformtype縺ョ蛟、繧偵file縲阪↓縺吶k縺ィ縲√ヵ繧。繧、繝ォ繧オ繝シ繝先、懃エ「逕ィ縺ョ蜈・蜉帙ヵ繧ゥ繝シ繝縺ォ縺ェ繧翫∪縺吶ゅ↑縺翫√ヵ繧。繧、繝ォ繧オ繝シ繝舌ョ讀懃エ「繧帝ォ倬溷喧縺吶k縺ォ縺ッ縲∽サ・荳九ョ繧医≧縺ォ螻樊ァ繧、繝ウ繝繝繧ッ繧ケ繧貞シオ縺」縺ヲ縺翫¥縺ィ繧医>縺ァ縺励g縺縲

estcmd create -attr _lpath str -attr @mdate seq -attr @size seq casket

繝。繝シ繝ォ繝懊ャ繧ッ繧ケ繧呈、懃エ「縺吶k髫帙↓縺ッ縲∵悽譁繧ゅ@縺上ッSubject/From/To/Cc縺ョ蜷繝倥ャ繝縺ァ邨槭j霎シ繧縺薙→縺悟、壹>縺ァ縺励g縺縲ゅ∪縺溘√た繝シ繝域擅莉カ縺ォ縺ッ繧ケ繧ウ繧「縺区律莉倥°繧オ繧、繧コ繧呈欠螳壹☆繧九%縺ィ縺悟、壹>縺ァ縺励g縺縲ゅ◎縺縺縺」縺溷ク蝙狗噪縺ェ謫堺ス懊r邁。蜊倥↓陦後↑縺縺溘a縺ォ縲estseek.cgi縺ォ縺ッ繝。繝シ繝ォ繝懊ャ繧ッ繧ケ逕ィ縺ョ蜈・蜉帙ヵ繧ゥ繝シ繝縺ョ蠖「蠑上′逕ィ諢上&繧後※縺縺セ縺吶りィュ螳壹ヵ繧。繧、繝ォ縺ョformtype縺ョ蛟、繧偵mail縲阪↓縺吶k縺ィ縲√Γ繝シ繝ォ繝懊ャ繧ッ繧ケ讀懃エ「逕ィ縺ョ蜈・蜉帙ヵ繧ゥ繝シ繝縺ォ縺ェ繧翫∪縺吶ゅ↑縺翫√Γ繝シ繝ォ繝懊ャ繧ッ繧ケ縺ョ讀懃エ「繧帝ォ倬溷喧縺吶k縺ォ縺ッ縲∽サ・荳九ョ繧医≧縺ォ螻樊ァ繧、繝ウ繝繝繧ッ繧ケ繧貞シオ縺」縺ヲ縺翫¥縺ィ繧医>縺ァ縺励g縺縲

estcmd create -attr subject str -attr from str -attr @mdate seq -attr @size seq casket

縺頑エ定誠縺ェ蜈・蜉帙ヵ繧ゥ繝シ繝縺ッJavaScript縺ォ繧医▲縺ヲ螳溽樟縺輔l縺ヲ縺繧九ョ縺ァ縲゛avaScript繧偵し繝昴シ繝医@縺ェ縺繝悶Λ繧ヲ繧カ繧呈Φ螳壹☆繧句エ蜷医↓縺ッ菴ソ繧上↑縺譁ケ縺後h縺縺ァ縺励g縺縲

繧ッ繧ィ繝ェ螻暮幕

縲携o/went/gone/going縲阪稽an/men縲阪梧ュゥ縺/豁ゥ縺(縺)縲阪ョ繧医≧縺ェ豢サ逕ィ繧縲√慶enter/centre縲阪熊-1/F1縲阪後励Ο繧ュ繧キ/繝励Ο繧ッ繧キ縲阪ョ繧医≧縺ェ陦ィ險俶昭繧後d縲√畦ady/madam/gentlewoman縲阪御セ/豁ヲ閠/豁ヲ螢ォ縲阪ョ繧医≧縺ェ鬘樒セゥ隱槭r閠諷ョ縺励◆讀懃エ「縺後〒縺阪k縺ィ萓ソ蛻ゥ縺ァ縺吶ゆセ九∴縺ー縲√携o縲阪〒讀懃エ「縺吶k縺ィ縲√詣ent縲阪d縲携one縲阪d縲携oing縲阪r蜷ォ繧譁譖ク繧ゅヲ繝繝医☆繧九→縺縺縺薙→縺ァ縺吶ゅ◎繧後↓縺ッ縲√go縲阪→縺縺隱槭′蜈・蜉帙&繧後◆髫帙↓縲√◎繧後r繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺後go OR went OR gone OR going縲阪→縺縺繧ッ繧ィ繝ェ縺ォ螻暮幕縺吶l縺ー繧医>縺薙→縺ォ縺ェ繧翫∪縺吶

estseek.conf縺ョqxpndcmd縺ォ繧ウ繝槭Φ繝峨Λ繧、繝ウ繧呈欠螳壹☆繧九%縺ィ縺ァ縲∽ササ諢上ョ繧ウ繝槭Φ繝峨r蜻シ縺ウ蜃コ縺吶け繧ィ繝ェ螻暮幕繧定。後≧縺薙→縺後〒縺阪∪縺吶よ欠螳壹@縺溘さ繝槭Φ繝峨↓縺ッ縲∫腸蠅螟画焚ESTWORD縺ョ蛟、縺ィ縺励※縲∵、懃エ「隱槭′貂。縺輔l縺セ縺吶よ、懃エ「繝輔Ξ繝シ繧コ縺ォ隍謨ー縺ョ隱槭′謖螳壹&繧後◆蝣エ蜷医ッ縲∝推隱槭↓蟇セ蠢懊@縺ヲ繧ウ繝槭Φ繝峨′隍謨ー蝗槫他縺ウ蜃コ縺輔l縺セ縺吶ょ他縺ウ蜃コ縺輔l縺溘さ繝槭Φ繝峨ッ縲√け繧ィ繝ェ螻暮幕縺励◆邨先棡縺ョ隱槭r謾ケ陦悟玄蛻繧翫〒蜃コ蜉帙@縺セ縺吶ゅ◎縺ョ繧医≧縺ェ蜍穂ス懊r縺吶k繧ウ繝槭Φ繝峨r菴懊▲縺ヲ縺翫¢縺ー縲∝・ス縺阪↑繧医≧縺ォ繧ッ繧ィ繝ェ螻暮幕繧定。後≧縺薙→縺後〒縺阪∪縺吶

WordNet縺ィ縺縺闍ア隱槭ョ繧キ繧ス繝シ繝ゥ繧ケ繧堤畑縺縺ヲ鬘樒セゥ隱槭ョ繧ッ繧ィ繝ェ螻暮幕繧偵☆繧九◆繧√ョ繧ウ繝槭Φ繝estwnetxpnd縺後/usr/local/share/hyperestraier/filter縲阪ョ荳ュ縺ォ繧、繝ウ繧ケ繝医シ繝ォ縺輔l縺ヲ縺縺セ縺吶8ordNet繧偵う繝ウ繧ケ繝医シ繝ォ縺励◆荳翫〒縲estwnetxpnd縺ョ邨カ蟇セ繝代せ繧qxpndcmd縺ョ蛟、縺ィ縺励※險ュ螳壹☆繧九→菴ソ縺医k繧医≧縺ォ縺ェ繧翫∪縺吶

estcmd extkeys縲阪〒繧ュ繝シ繝ッ繝シ繝峨r謚ス蜃コ縺励※縺ゅk蝣エ蜷医ッ縲√estcmd words -kt縲阪〒髢「騾」隱槭ョ荳隕ァ繧偵ム繝ウ繝励☆繧九%縺ィ縺後〒縺阪∪縺吶ょコ蜉帙ッTSV蠖「蠑上〒縺吶らャャ1繝輔ぅ繝シ繝ォ繝峨ッ繧ュ繝シ繝ッ繝シ繝峨ョ譁蟄怜励〒縲∫ャャ2繝輔ぅ繝シ繝ォ繝峨ッ縺昴ョ隱槭ョ鬆サ蠎ヲ縺ァ縺吶らャャ3繝輔ぅ繝シ繝ォ繝我サ・髯阪↓縺ッ縲髢「騾」隱槭ョ譁蟄怜励→縺昴ョ繧ケ繧ウ繧「縺御コ、莠偵↓迴セ繧後∪縺吶ゅ%縺ョ蜃コ蜉帙r繧ゅ→縺ォ繝繝シ繧ソ繝吶シ繧ケ繧剃ス懈舌@縲√◎繧後r繧ッ繧ィ繝ェ螻暮幕縺ョ繧ウ繝槭Φ繝峨〒蛻ゥ逕ィ縺吶k縺ィ繧医>縺ァ縺励g縺縲

陬乗橿

螻樊ァ譚。莉カ縺ョ蜈・蜉帶ャ縺ォ縲gstep=1縲阪↑縺ゥ縺ィ縺吶k縺ィ縲¨-gram縺ョ讀懈渊邊セ蠎ヲ繧剃ク譎ら噪縺ォ螟峨∴繧峨l縺セ縺吶ょ酔讒倥↓縲tfidf=true縲阪∪縺溘ッ縲tfidf=false縲阪→縺吶k縺ィ縲ゝF-IDF豕輔ョ譛牙柑辟。蜉ケ繧剃ク譎ら噪縺ォ螟峨∴繧峨l縺セ縺吶ゅscan=true縲阪∪縺溘ッ縲scan=false縲阪→縺吶k縺ィ縲∵、懃エ「繝輔Ξ繝シ繧コ縺ョ邊セ蟇讀懈渊縺ョ譛牙柑辟。蜉ケ繧剃ク譎ら噪縺ォ螟峨∴繧峨l縺セ縺吶

讀懃エ「邨先棡縺ョ邨碁℃譎る俣陦ィ遉コ縺ョ蜿ウ蛛エ縺ォ縲*縲阪槭シ繧ッ縺後▽縺上%縺ィ縺後≠繧翫∪縺吶ゅ%繧後ッ縲√う繝ウ繝繝繧ッ繧ケ蜀縺ォ蜑企勁譁譖ク縺ョ諠蝣ア縺後◆縺上&繧薙≠繧九%縺ィ縺ォ繧医▲縺ヲ讀懃エ「蜃ヲ逅縺碁撼蜉ケ邇縺ォ縺ェ縺」縺溘%縺ィ繧呈э蜻ウ縺励※縺縺セ縺吶るサ郢√↓縺薙l縺後〒繧九h縺縺ォ縺ェ縺」縺溘i縲√う繝ウ繝繝繧ッ繧ケ縺ョ譛驕ゥ蛹悶r陦後▲縺ヲ縺上□縺輔>縲


陦ィ遉コ逕ィCGI繧ケ繧ッ繝ェ繝励ヨ

縺薙%縺ァ縺ッ縲∬。ィ遉コ逕ィCGI繧ケ繧ッ繝ェ繝励ヨestproxy.cgi縺ョ隧ウ邏ー縺ェ莉墓ァ倥r隱ャ譏弱@縺セ縺吶ゅ%繧後r菴ソ縺縺ィ縲;oogle縺ョ繧ュ繝」繝繧キ繝・讖溯ス縺ョ繧医≧縺ォ縲∵、懃エ「隱槭ョ驛ィ蛻繧偵ワ繧、繝ゥ繧、繝医@縺ヲ陦ィ遉コ縺吶k縺薙→縺後〒縺阪∪縺吶

讒区舌→讖溯ス

estproxy.cgi縺悟虚菴懊☆繧九↓縺ッ縲estproxy.conf縺ィ縺縺險ュ螳壹ヵ繧。繧、繝ォ縺悟ソ隕√〒縺吶りィュ螳壹ヵ繧。繧、繝ォ縺ョ蜷榊燕縺ッCGI繧ケ繧ッ繝ェ繝励ヨ縺ョ謗・蟆セ霎槭r.conf縺ォ螟峨∴縺溘b縺ョ縺ァ縺吶

estproxy.cgi縺ッ縲/usr/local/libexec/estproxy.cgi縲阪→縺励※繧、繝ウ繧ケ繝医シ繝ォ縺輔l縺ヲ縺縺セ縺吶ョ縺ァ縲√◎繧後r繧ウ繝斐シ縺励※蛻ゥ逕ィ縺励※縺上□縺輔>縲ゅ∪縺溘∬ィュ螳壹ヵ繧。繧、繝ォ縺ョ繧オ繝ウ繝励Ν縺後/usr/local/share/hyperestraier/estproxy.conf縲阪→縺励※繧、繝ウ繧ケ繝医シ繝ォ縺輔l縺ヲ縺縺セ縺吶ョ縺ァ縲√◎繧後r繧ウ繝斐シ縺励※菫ョ豁」縺吶k縺ィ讌ス縺ァ縺吶

estproxy.cgi縺ッ縲,GI繧ケ繧ッ繝ェ繝励ヨ縺ィ縺励※蜍穂ス懊☆繧九励Ο繧ッ繧キ縺ァ縺吶ゅ☆縺ェ繧上■縲仝eb荳翫ョ莉サ諢上ョ譁譖ク縺ョURL繧偵ヱ繝ゥ繝。繝シ繧ソ縺ィ縺励※荳弱∴繧九→縲√Θ繝シ繧カ縺ョ莉」逅縺ィ縺励※縺昴ョ譁譖ク縺ョ繝繝シ繧ソ繧貞叙蠕励@縲驕ゥ蠖薙↑蜉蟾・繧呈命縺励◆荳翫〒縲√◎縺ョ邨先棡繧定。ィ遉コ縺励∪縺吶ょ叙蠕励☆縺ケ縺肴枚譖ク縺ョURL縺ッ縲url縲阪→縺縺蜷榊燕縺ョ繝代Λ繝。繝シ繧ソ縺ィ縺励※謖螳壹@縺セ縺吶HTML莉・螟悶ョ繝。繝繧」繧「繧ソ繧、繝励ョ譁譖ク繧HTML縺ォ螟画鋤縺励※陦ィ遉コ縺吶k縺ョ縺檎音蠕エ縺ァ縺吶ゅ&繧峨↓縲√word1縲阪°繧峨word32縲阪∪縺ァ縺ョ蜷榊燕縺ョ繝代Λ繝。繝シ繧ソ縺ォ繧医▲縺ヲ縲√ワ繧、繝ゥ繧、繝医☆縺ケ縺崎ェ槫唱繧呈欠螳壹☆繧九%縺ィ縺後〒縺阪∪縺吶

蟇セ蠢懊☆繧九励Ο繝医さ繝ォ縺ッ縲?TTP縺ィFILE縺ァ縺吶ゅhttp://縲阪〒蟋九∪繧偽RL繧呈欠螳壹☆繧九→縲?TTP繝励Ο繝医さ繝ォ繧堤畑縺縺ヲ縺昴ョ繧ウ繝ウ繝繝ウ繝繧貞叙蠕励@縺セ縺呻シ井サ翫ョ縺ィ鬆ォTTPS縺ォ縺ッ蟇セ蠢懊@縺ヲ縺縺セ縺帙sシ峨ゅfile://縲阪〒蟋九∪繧偽RL繧呈欠螳壹☆繧九→縲estproxy.cgi縺悟虚菴懊☆繧九ヵ繧。繧、繝ォ繧キ繧ケ繝繝荳翫ョ繝輔ぃ繧、繝ォ繧堤峩謗・隱ュ縺ソ霎シ繧薙〒蜃ヲ逅縺励∪縺吶ゅ%縺ョ莉慕オ縺ソ縺ォ繧医▲縺ヲ縲√し繝シ繝蝉ク翫ョ莉サ諢上ョ繝輔ぃ繧、繝ォ縺ョ蜀螳ケ繧貞刈蟾・縺励※陦ィ遉コ縺吶k縺薙→縺後〒縺阪∪縺吶

蟇セ蠢懊☆繧九ヵ繧。繧、繝ォ蠖「蠑上ッ縲√励Ξ繝シ繝ウ繝繧ュ繧ケ繝茨シtext/plainシ峨→HTMLシtext/htmlシ峨→MIMEシmessage/rfc822シ峨〒縺吶ゅ◎繧御サ・螟悶ョ蠖「蠑上ョ蝣エ蜷医〒繧ゅ∽ササ諢上ョ螟夜Κ繝輔ぅ繝ォ繧ソ縺ァ蜉蟾・縺吶k縺薙→縺ォ繧医▲縺ヲ蜃ヲ逅縺吶k縺薙→縺後〒縺阪∪縺吶

險ュ螳壹ヵ繧。繧、繝ォ縺ョ譖ク蠑

險ュ螳壹ヵ繧。繧、繝ォ縺ッ縲∝、画焚蜷阪→蛟、繧偵:縲阪〒蛹コ蛻縺」縺溷ス「蠑上ョ陦後r荳ヲ縺ケ縺溘b縺ョ縺ァ縺吶ゅ#縲阪〒蟋九∪繧玖。後ッ繧ウ繝。繝ウ繝医→縺励※辟。隕悶&繧後∪縺吶ゅョ繝輔か繝ォ繝医〒縺ッ縲∬ィュ螳壹ヵ繧。繧、繝ォ縺ッ莉・荳九ョ繧医≧縺ェ蜀螳ケ縺ォ縺ェ縺」縺ヲ縺縺セ縺吶

#replace: ^http://localhost/{{!}}file:///home/mikio/public_html/
allowrx: ^http://
#allowrx: ^file://
denyrx: /\.
passaddr: 1
limitsize: 32
urlrule: \.est${{!}}text/x-estraier-draft
urlrule: \.(eml|mime|mht|mhtml)${{!}}message/rfc822
typerule: ^text/x-estraier-draft${{!}}[DRAFT]
typerule: ^text/plain${{!}}[TEXT]
typerule: ^(text/html|application/xhtml+xml)${{!}}[HTML]
typerule: ^message/rfc822${{!}}[MIME]
language: 0
shownavi: 1

縺昴l縺槭l縺ョ螟画焚縺ョ讖溯ス繧剃サ・荳九↓遉コ縺励∪縺吶

  • replace : URL繧貞、画鋤縺吶k縺溘a縺ョ豁」隕剰。ィ迴セ縺ィ鄂ョ謠帶枚蟄怜励r縲{{!}}縲阪〒蛹コ蛻縺」縺ヲ謖螳壹@縺セ縺吶ょ、画鋤譁蟄怜怜縺ョ縲&縲阪ッ荳閾エ譁蟄怜励↓螻暮幕縺輔l縺セ縺吶るΚ蛻蠑上↓螻暮幕縺輔l繧九\1縲阪°繧峨\9縲阪b蛻ゥ逕ィ縺ァ縺阪∪縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • allowrx : 蜿門セ励☆繧九%縺ィ繧定ィア蜿ッ縺吶kURL繧呈ュ」隕剰。ィ迴セ縺ァ謖螳壹@縺セ縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • denyrx : 蜿門セ励☆繧九%縺ィ繧堤ヲ∵ュ「縺吶kURL繧呈ュ」隕剰。ィ迴セ縺ァ謖螳壹@縺セ縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • passaddr : 豁」謨ー縺ェ繧峨√け繝ゥ繧、繧「繝ウ繝医ョIP繧「繝峨Ξ繧ケ繧湛-Forwarded-For繝倥ャ繝縺ァ騾夂衍縺励∪縺吶
  • limitsize : 蜿門セ励☆繧九ョ繝シ繧ソ縺ョ譛螟ァ繧オ繧、繧コ繧偵Γ繧ャ繝舌う繝亥腰菴阪〒謖螳壹@縺セ縺吶
  • urlrule : URL縺ョ豁」隕剰。ィ迴セ縺ィ縺昴l縺ォ蟇セ蠢懊☆繧九Γ繝繧」繧「繧ソ繧、繝励r謖螳壹@縺セ縺吶ゅ%縺ョ隕丞援縺ッContent-Type繝倥ャ繝繧医j繧ょ━蜈医&繧後∪縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • typerule : 繝。繝繧」繧「繧ソ繧、繝励→縺昴l縺ォ蟇セ蠢懊☆繧九ヵ繧」繝ォ繧ソ繧呈欠螳壹@縺セ縺吶ゅΓ繝繧」繧「繧ソ繧、繝励ッ豁」隕剰。ィ迴セ縺ァ謖螳壹@縲√ヵ繧」繝ォ繧ソ縺ッ譁譖ク繝峨Λ繝輔ヨ逕ィ縺ェ繧峨[DRAFT]縲阪→縺励√励Ξ繝シ繝ウ繝繧ュ繧ケ繝育畑縺ェ繧峨[TEXT]縲阪→縺励?TML逕ィ縺ェ繧峨[HTML]縲阪→縺励`IME逕ィ縺ェ繧峨[MIME]縲阪→縺励∪縺吶り、謨ー蝗樊欠螳壹〒縺阪∪縺吶
  • language : 螂ス縺セ縺励>險隱槭r謖螳壹@縺セ縺吶0縺ェ繧芽恭隱槭1縺ェ繧画律譛ャ隱槭2縺ェ繧我クュ蝗ス隱槭3縺ェ繧蛾沒蝗ス隱槭4縺ェ繧画悴謖螳壹〒縺吶
  • shownavi : 豁」謨ー縺ェ繧峨√リ繝薙ご繝シ繧キ繝ァ繝ウ繝舌シ繧定。ィ遉コ縺励∪縺吶

allowrx縺ィdenyrx縺ョ蛻、螳壹ッ縲replace繧帝←逕ィ縺励◆邨先棡縺ォ蟇セ縺励※陦後↑繧上l縺セ縺吶allowrx縺ィdenyrx縺ッ險倩ソー縺励◆鬆逡ェ縺ォ隗」驥医&繧後∪縺吶よュ」隕剰。ィ迴セ縺ォ縺翫¢繧玖恭蟄励ョ螟ァ譁蟄励→蟆乗枚蟄励ッ蛹コ蛻・縺輔l縺セ縺帙s縲

蠢懃畑萓具シ唏TML縺ョ繝上う繝ゥ繧、繝郁。ィ遉コ

estseek.cgi縺ョ讀懃エ「邨先棡縺ョ繝壹シ繧ク縺ォ縲∬ゥイ蠖捺枚譖ク縺ョ繝上う繝ゥ繧、繝郁。ィ遉コ縺ョ繝ェ繝ウ繧ッ繧偵▽縺代※縺ソ縺セ縺励g縺縲estseek.cgi縺ィ蜷後§蝣エ謇縺ォestproxy.cgi縺ィestproxy.conf繧らスョ縺縺ヲ縺上□縺輔>縲ゅ≠縺ィ縺ッ縲estseek.cgi縺ォ莉・荳九ョ險倩ソー繧偵☆繧九□縺代〒OK縺ァ縺吶

...
dispproxy: estproxy.cgi
...

譌・譛ャ隱槭ョ繝壹シ繧ク縺ョ譁蟄励さ繝シ繝芽ェ崎ュ倥ョ邊セ蠎ヲ繧貞髄荳翫&縺帙k縺溘a縺ォ縺ッ縲√language: 1縲阪b謖螳壹☆繧九→繧医>縺ァ縺励g縺縲ゅ∪縺溘∝刈蟾・貂医ョ繝壹シ繧ク縺ョ蜀帝ュ縺ォ縺ゅk繝翫ン繧イ繝シ繧キ繝ァ繝ウ繝舌シ縺御ク崎ヲ√↑蝣エ蜷医ッ縲√shownavi: 0縲阪↓縺励※縺上□縺輔>縲

蠢懃畑萓具シ壹Γ繝シ繝ォ縺ョ陦ィ遉コ

estseek.cgi縺ォ繧医k繝。繝シ繝ォ繝懊ャ繧ッ繧ケ縺ョ讀懃エ「繧キ繧ケ繝繝縺ァ讀懃エ「縺ョ隧イ蠖捺枚譖ク繧定。ィ遉コ縺吶k髫帙↓縺ッ縲∬ゥイ蠖捺枚譖ク縺ョ繧ソ繧、繝医Ν縺九i縺ョ繝ェ繝ウ繧ッ蜈医→縲[disp]縲阪ョ繝ェ繝ウ繧ッ蜈医ョ蜿梧婿縺ォestproxy.cgi繧剃スソ縺」縺溘壹シ繧ク縺ョURI繧呈欠螳壹☆繧九→萓ソ蛻ゥ縺ァ縺吶ゅ%縺薙〒縺ッ縲estseek.cgi縺ィestproxy.cgi縺悟酔縺伜エ謇縺ォ險ュ鄂ョ縺励※縺ゅj縲√Γ繝シ繝ォ繝懊ャ繧ッ繧ケ縺ョ繝繝シ繧ソ縺ッ縲/home/mikio/Mail縲阪ョ荳九↓縺ゅk繧ゅョ縺ィ縺励∪縺吶ゅ◎縺ョ蝣エ蜷医estseek.conf縺ォ縺ッ莉・荳九ョ繧医≧縺ォ險倩ソー縺励※縺上□縺輔>縲

...
replace: .*/Mail/{{!}}estproxy.cgi?url=file:///home/mikio/Mail/
...
dispproxy: [URI]
...

繧サ繧ュ繝・繝ェ繝繧」荳翫ョ逅逕ア縺九i縲estproxy.conf縺ョ繝繝輔か繝ォ繝医ョ險ュ螳壹〒縺ッ縲file://縲阪↓繧医k繧「繧ッ繧サ繧ケ縺ッ險ア蜿ッ縺励※縺縺セ縺帙s縺ョ縺ァ縲∽サ・荳九ョ逕ィ縺ォ險倩ソー縺励※繝。繝シ繝ォ繝懊ャ繧ッ繧ケ縺ョ荳ュ霄ォ縺ョ縺ソ繧定。ィ遉コ縺ァ縺阪k繧医≧縺ォ縺励※縺上□縺輔>縲

...
allowrx: ^file:///home/mikio/Mail/
...

譌・譛ャ隱槭ョ繝。繝シ繝ォ縺ョ譁蟄励さ繝シ繝芽ェ崎ュ倥ョ邊セ蠎ヲ繧貞髄荳翫&縺帙k縺溘a縺ォ縺ッ縲√language: 1縲阪b謖螳壹☆繧九→繧医>縺ァ縺励g縺縲ゅ↑縺翫√b縺励allowrx: file://縲阪→繧縺」縺ヲ縺励∪縺縺ィ繧オ繝シ繝蝉ク翫ョ蜈ィ縺ヲ縺ョ繝輔ぃ繧、繝ォ縺悟ャ髢九&繧後k縺薙→縺ォ縺ェ繧九ョ縺ァ豌励r縺、縺代※縺上□縺輔>縲


繧、繝ウ繝繝繧ッ繧ケ縺ョ讒矩

縺薙%縺ァ縺ッ縲?yper Estraier縺ョ繧、繝ウ繝繝繧ッ繧ケ縺ョ隧ウ邏ー縺ェ讒矩縺ォ縺、縺縺ヲ隱ャ譏弱@縺セ縺吶り」懷勧繧、繝ウ繝繝繧ッ繧ケ繧螻樊ァ繧、繝ウ繝繝繧ッ繧ケ繧堤畑縺縺ヲ讀懃エ「繧帝ォ倬溷喧縺吶k譁ケ豕輔↓縺、縺縺ヲ繧りェャ譏弱@縺セ縺吶

蝓コ譛ャ逧縺ェ讒矩

繧、繝ウ繝繝繧ッ繧ケ縺ョ繝繧」繝ャ繧ッ繝医Μ縺ョ荳ュ縺ォ縺ッ莉・荳九ョ繝輔ぃ繧、繝ォ繧繝繧」繝ャ繧ッ繝医Μ縺梧シ邏阪&繧後∪縺吶

  • _meta : 繝。繧ソ繝繝シ繧ソ繝吶シ繧ケ縲る崎、襍キ蜍暮亟豁「縺ョ繝ュ繝繧ッ讖滓ァ九b蜈シ縺ュ縺セ縺吶2DBM縺ョDepot繝繝シ繧ソ繝吶シ繧ケ縺ァ縺吶ゅΞ繧ウ繝シ繝峨ョ繧ュ繝シ縺ッ繝。繧ソ繝繝シ繧ソ縺ョ蜷榊燕縺ァ縲√Ξ繧ウ繝シ繝峨ョ蛟、縺ッ繝。繧ソ繝繝シ繧ソ縺ョ蛟、縺ァ縺吶
  • _idx/ : 霆「鄂ョ繧、繝ウ繝繝繧ッ繧ケ繝繧」繝ャ繧ッ繝医Μ縲ゆクュ縺ォ隍謨ー縺ョ霆「鄂ョ繧、繝ウ繝繝繧ッ繧ケ繝繝シ繧ソ繝吶シ繧ケ繝輔ぃ繧、繝ォ繧呈シ邏阪@縺セ縺吶ょ推縲縺ョ霆「鄂ョ繧、繝ウ繝繝繧ッ繧ケ繝繝シ繧ソ繝吶シ繧ケ縺ッQDBM縺ョVilla繝繝シ繧ソ繝吶シ繧ケ縺ァ縺吶ゅΞ繧ウ繝シ繝峨ョ繧ュ繝シ縺ッN-gram縺ョ繝医シ繧ッ繝ウ縺ョ逡ー縺ェ繧願ェ槭〒縲√Ξ繧ウ繝シ繝峨ョ蛟、縺ッ譁譖クID縺ィ繧ケ繧ウ繧「縺ィ繝上ャ繧キ繝・蛟、縺ョ繝ェ繧ケ繝医〒縺吶
  • _fwm : 蜊倩ェ槭Μ繧ケ繝医ョ繝シ繧ソ繝吶シ繧ケ繝輔ぃ繧、繝ォ縲りサ「鄂ョ繧、繝ウ繝繝繧ッ繧ケ縺ォ蜃コ迴セ縺励◆蜊倩ェ槭ョ繝ェ繧ケ繝医〒縺吶2DBM縺ョVilla繝繝シ繧ソ繝吶シ繧ケ縺ァ縺吶ゅΞ繧ウ繝シ繝峨ョ繧ュ繝シ縺ッN-gram縺ョ繝医シ繧ッ繝ウ縺ョ逡ー縺ェ繧願ェ槭〒縲∝、縺ッ縺ゅj縺セ縺帙s縲
  • _aux : 陬懷勧霆「鄂ョ繧、繝ウ繝繝繧ッ繧ケ繝輔ぃ繧、繝ォ縲ょ推逋サ骭イ譁譖ク縺ョ繧ュ繝シ繝ッ繝シ繝峨ョ縺ソ縺九i縺ェ繧玖サ「鄂ョ繧、繝ウ繝繝繧ッ繧ケ縺ァ縺吶2DBM縺ョVilla繝繝シ繧ソ繝吶シ繧ケ縺ァ縺吶ゅΞ繧ウ繝シ繝峨ョ繧ュ繝シ縺ッN-gramシ医∪縺溘ッ蛻縺九■譖ク縺搾シ峨ョ繝医シ繧ッ繝ウ縺ョ逡ー縺ェ繧願ェ槭〒縲√Ξ繧ウ繝シ繝峨ョ蛟、縺ッ譁譖クID縺ィ繧ケ繧ウ繧「縺ョ繝ェ繧ケ繝医〒縺吶
  • _xfm : 陬懷勧蜊倩ェ槭Μ繧ケ繝医ョ繝シ繧ソ繝吶シ繧ケ繝輔ぃ繧、繝ォ縲り」懷勧霆「鄂ョ繧、繝ウ繝繝繧ッ繧ケ縺ォ蜃コ迴セ縺励◆蜊倩ェ槭ョ繝ェ繧ケ繝医〒縺吶2DBM縺ョVilla繝繝シ繧ソ繝吶シ繧ケ縺ァ縺吶ゅΞ繧ウ繝シ繝峨ョ繧ュ繝シ縺ッN-gramシ医∪縺溘ッ蛻縺九■譖ク縺搾シ峨ョ繝医シ繧ッ繝ウ縺ョ逡ー縺ェ繧願ェ槭〒縲√Ξ繧ウ繝シ繝峨ョ蛟、縺ッDFシ医◎縺ョ繝医シ繧ッ繝ウ繧貞性繧譁譖ク謨ーシ峨ョ10騾イ謨ー譁蟄怜励〒縺吶
  • _attr/ : 螻樊ァ繝繝シ繧ソ繝吶シ繧ケ繝繧」繝ャ繧ッ繝医Μ縲ょ推逋サ骭イ譁譖ク縺ョ螻樊ァ繧剃ソ晄戟縺励∪縺吶2DBM縺ョCuria繝繝シ繧ソ繝吶シ繧ケ縺ァ縺吶ゅΞ繧ウ繝シ繝峨ョ繧ュ繝シ縺ッ譁譖クID縺ョint蝙九ロ繧、繝繧」繝冶。ィ迴セ縺ァ縲√Ξ繧ウ繝シ繝峨ョ蛟、縺ッ螻樊ァ蜷阪→螻樊ァ蛟、縺ョ繝槭ャ繝暦シCBMAPシ峨r逶エ蛻怜喧縺励◆繝繝シ繧ソ繧貞悸邵ョ縺励◆繧ゅョ縺ァ縺吶
  • _text/ : 譛ャ譁繝繝シ繧ソ繝吶シ繧ケ繝繧」繝ャ繧ッ繝医Μ縲ょ推逋サ骭イ譁譖ク縺ョ譛ャ譁繧剃ソ晄戟縺励∪縺吶2DBM縺ョCuria繝繝シ繧ソ繝吶シ繧ケ縺ァ縺吶ゅΞ繧ウ繝シ繝峨ョ繧ュ繝シ縺ッ譁譖クID縺ョint蝙九ロ繧、繝繧」繝冶。ィ迴セ縺ァ縲√Ξ繧ウ繝シ繝峨ョ蛟、縺ッ繝繧ュ繧ケ繝医ョ繝ェ繧ケ繝茨シCBLISTシ峨r逶エ蛻怜喧縺励◆繝繝シ繧ソ繧貞悸邵ョ縺励◆繧ゅョ縺ァ縺吶
  • _kwd/ : 繧ュ繝シ繝ッ繝シ繝峨ョ繝シ繧ソ繝吶シ繧ケ繝繧」繝ャ繧ッ繝医Μ縲ょ推逋サ骭イ譁譖ク縺ョ繧ュ繝シ繝ッ繝シ繝峨r菫晄戟縺励∪縺吶2DBM縺ョCuria繝繝シ繧ソ繝吶シ繧ケ縺ァ縺吶ゅΞ繧ウ繝シ繝峨ョ繧ュ繝シ縺ッ譁譖クID縺ョint蝙九ロ繧、繝繧」繝冶。ィ迴セ縺ァ縲√Ξ繧ウ繝シ繝峨ョ蛟、縺ッ繧ュ繝シ繝ッ繝シ繝峨→鬆サ蠎ヲ縺ョ繝槭ャ繝暦シCBMAPシ峨r逶エ蛻怜喧縺励◆繝繝シ繧ソ繧貞悸邵ョ縺励◆繧ゅョ縺ァ縺吶
  • _list : 譁譖ク繝ェ繧ケ繝医ョ繝シ繧ソ繝吶シ繧ケ繝輔ぃ繧、繝ォ縲ょ推逋サ骭イ譁譖ク縺ィ縺昴ョURI縺ョ髢「騾」莉倥¢繧定。後>縺セ縺吶2DBM縺ョVilla繝繝シ繧ソ繝吶シ繧ケ縺ァ縺吶ゅΞ繧ウ繝シ繝峨ョ繧ュ繝シ縺ッ譁譖ク縺ョURI縺ァ縲√Ξ繧ウ繝シ繝峨ョ蛟、縺ッ譁譖クID縺ョ蜊騾イ謨ー譁蟄怜励〒縺吶
  • __type_name : 螻樊ァ繧、繝ウ繝繝繧ッ繧ケ繝輔ぃ繧、繝ォ縲Uype縺ッ繝繝シ繧ソ蝙九〒縲]ame縺ッ16騾イ謨ー繧ィ繝ウ繧ウ繝シ繝峨r譁ス縺励◆螻樊ァ蜷阪〒縺吶Uype縺茎eq縺ョ蝣エ蜷医ッQDBM縺ョDepot繝繝シ繧ソ繝吶シ繧ケ縺ァ縲》ype縺茎tr縺杵um縺ョ蝣エ蜷医ッQDBM縺ョVilla繝繝シ繧ソ繝吶シ繧ケ縺ァ縺吶Teq縺ァ縺ッ縲√Ξ繧ウ繝シ繝峨ョ繧ュ繝シ縺ッ譁譖クID縺ョint蝙九ロ繧、繝繧」繝冶。ィ迴セ縺ァ縲√Ξ繧ウ繝シ繝峨ョ蛟、縺ッ螻樊ァ蛟、縺ァ縺吶Ttr縺ィnum縺ァ縺ッ縲√Ξ繧ウ繝シ繝峨ョ繧ュ繝シ縺ッ螻樊ァ蛟、縺ィ譁譖クID縺ョ譛ォ蟆セ縺ォint蝙九ロ繧、繝繧」繝冶。ィ迴セ繧帝」邨舌@縺溘b縺ョ縺ァ縲√Ξ繧ウ繝シ繝峨ョ蛟、縺ッ縺ゅj縺セ縺帙s縲

2髫主ア、霆「鄂ョ繧、繝ウ繝繝繧ッ繧ケ

荳ュ譬ク縺ィ縺ェ繧九ョ繝シ繧ソ繝吶シ繧ケ縺ッ_idx縺ァ縺吶ゅ%繧後ッ霆「鄂ョ繧、繝ウ繝繝繧ッ繧ケ縺セ縺溘ッ霆「鄂ョ繝輔ぃ繧、繝ォ縺ィ縺繧上l繧九ョ繝シ繧ソ繝吶シ繧ケ縺ァ縺ゅj縲√≠繧玖ェ槭r讀懃エ「繧ュ繝シ縺ォ縺励※縲√◎縺ョ隱槭r蜷ォ繧薙□譁譖ク縺ョ荳隕ァ繧呈爾縺呎ゥ溯ス繧呈署萓帙@縺セ縺吶ょィ縺ヲ縺ョ逋サ骭イ譁譖ク縺ォ陦ィ繧後k蜈ィ縺ヲ縺ョ隱槭ョ蜃コ迴セ諠蝣ア繧剃ソ晄戟縺励※縺繧九ョ縺ァ縲∬サ「鄂ョ繧、繝ウ繝繝繧ッ繧ケ縺ョ繧オ繧、繧コ縺ッ縺ィ縺ヲ繧ょ、ァ縺阪↑繧ゅョ縺ォ縺ェ繧翫∪縺吶

_aux縺ッ陬懷勧霆「鄂ョ繧、繝ウ繝繝繧ッ繧ケ縺ィ蜻シ縺ー繧後k縲∫匳骭イ譁譖ク縺ョ繧ュ繝シ繝ッ繝シ繝峨ョ縺ソ縺ョ蜃コ迴セ諠蝣ア繧定ィ倬鹸縺励◆霆「鄂ョ繧、繝ウ繝繝繧ッ繧ケ縺ァ縺吶ゅく繝シ繝ッ繝シ繝峨ョ縺ソ縺ォ蟇セ雎。繧堤オ槭▲縺ヲ縺繧九ョ縺ァ縲√ョ繝シ繧ソ繝吶シ繧ケ縺ョ繧オ繧、繧コ縺悟ー上&縺上∫イセ蠎ヲ縺ョ鬮倥>讀懃エ「邨先棡繧堤函謌舌〒縺阪k蛻ゥ轤ケ縺後≠繧翫∪縺吶ゅ◎縺ョ蜿埼擇縲∝ィ縺ヲ縺ョ隱槭r菫晄戟縺励※縺繧九o縺代〒縺ッ縺ェ縺縺ョ縺ァ縲∵、懃エ「貍上l縺檎匱逕溘☆繧句庄閭ス諤ァ縺後≠繧翫∪縺吶

讀懃エ「縺瑚。後o繧後◆髫帙↓縺ッ縲√∪縺夊」懷勧霆「鄂ョ繧、繝ウ繝繝繧ッ繧ケ縺ォ蟇セ縺励※讀懃エ「繧定。後>縲√◎縺薙〒蜊∝縺ェ莉カ謨ー縺ョ邨先棡縺悟セ励i繧後◆蝣エ蜷医ッ縺昴ョ譎らせ縺ァ邨先棡繧呈署遉コ縺励∪縺吶ゅ◎縺薙〒蜊∝縺御サカ謨ー縺悟セ励i繧後↑縺九▲縺溷エ蜷医ッ縺輔i縺ォ繝。繧、繝ウ縺ョ霆「鄂ョ繧、繝ウ繝繝繧ッ繧ケ繧呈、懃エ「縺励√◎縺ョ邨先棡繧呈署遉コ縺励∪縺吶ゅ%繧後↓繧医j縲∝、ァ謚オ縺ョ蝣エ蜷医ッ鬮倬溘↓鬮倡イセ蠎ヲ縺ョ邨先棡繧定ソ斐☆縺薙→縺後〒縺阪∪縺吶@縲∵、懃エ「貍上l縺瑚オキ縺薙k縺薙→繧ゅ≠繧翫∪縺帙s縲

繧ュ繝シ繝ッ繝シ繝峨ョ繝シ繧ソ繝吶シ繧ケ縺ィ鬘樔シシ讀懃エ「

鬘樔シシ讀懃エ「繧貞ョ溯。後☆繧九→縲∝呵」懊ョ蜷譁譖ク縺ョ譛ャ譁繧貞叙繧雁コ縺励※繧ュ繝シ繝ッ繝シ繝峨r險育ョ励@縺ヲ縺九i豈碑シ縺吶k縺ョ縺ァ縲√→縺ヲ繧よ凾髢薙′縺九°繧翫∪縺吶ら匳骭イ譁譖ク縺ョ繧ュ繝シ繝ッ繝シ繝峨r莠医a險育ョ励@縺ヲ繝繝シ繧ソ繝吶シ繧ケ縺ォ險俶カ縺励※縺翫¢縺ー縲鬘樔シシ讀懃エ「繧帝ォ倬溘↓陦後≧縺薙→縺後〒縺阪∪縺吶ゅく繝シ繝ッ繝シ繝峨ョ繝シ繧ソ繝吶シ繧ケ縺ッ縺昴ョ縺溘a縺ョ繝繝シ繧ソ繝吶シ繧ケ縺ァ縺吶

estseek.conf縺ォ縺翫¢繧smlrvnum縺ョ蛟、縺ッ鬘樔シシ讀懃エ「縺ョ髫帙↓謚ス蜃コ縺吶k繧ュ繝シ繝ッ繝シ繝峨ョ謨ー繧呈э蜻ウ縺励∪縺吶′縲√く繝シ繝ッ繝シ繝峨ョ繝シ繧ソ繝吶シ繧ケ繧貞茜逕ィ縺吶k蝣エ蜷医↓縺ッ縺昴ョ蛟、縺ッ辟。隕悶&繧後∪縺吶

繧ュ繝シ繝ッ繝シ繝画歓蜃コ

estcmd gather縺ァ譁譖ク繧堤匳骭イ縺励◆縺縺代〒縺ッ繧ュ繝シ繝ッ繝シ繝峨ョ謚ス蜃コ縺ッ陦後o繧後↑縺縺ョ縺ァ縲∬」懷勧霆「鄂ョ繧、繝ウ繝繝繧ッ繧ケ繧繧ュ繝シ繝ッ繝シ繝峨ョ繝シ繧ソ繝吶シ繧ケ縺ッ遨コ縺ョ縺セ縺セ縺ァ縺吶estcmd extkeys繧貞ョ溯。後☆繧九→縲√く繝シ繝ッ繝シ繝峨r謚ス蜃コ縺励※陬懷勧繧、繝ウ繝繝繧ッ繧ケ縺ィ繧ュ繝シ繝ッ繝シ繝峨ョ繝シ繧ソ繝吶シ繧ケ縺ォ逋サ骭イ縺励∪縺吶ゅ%縺ョ謫堺ス懊r陦後o縺ェ縺上※繧ょ虚菴懊↓謾ッ髫懊ッ縺ゅj縺セ縺帙s縺後∵、懃エ「騾溷コヲ繧剃ク翫£繧九◆繧√↓縺ッ縺懊イ繧縺」縺ヲ縺翫>縺ヲ縺上□縺輔>縲ら音縺ォ鬘樔シシ讀懃エ「縺ィ鬘樔シシ髫阡ス縺ョ騾溷コヲ縺悟括逧縺ォ蜷台ク翫@縺セ縺吶ゅく繝シ繝ッ繝シ繝峨ョ驕ク謚槭↓縺ッTF-IDF豕輔r逕ィ縺縺セ縺吶ョ縺ァ縲√う繝ウ繝繝繧ッ繧ケ繧呈ァ狗ッ峨☆繧区怙蠕後ョ謇矩縺ァ陦後▲縺滓婿縺檎イセ蠎ヲ縺悟ョ牙ョ壹@縺セ縺吶ゅ@縺溘′縺」縺ヲ縲extkeys繧貞性繧√◆繧、繝ウ繝繝繧ッ繧ケ縺ョ譖エ譁ー謇矩縺ッ莉・荳九ョ繧医≧縺ォ縺ェ繧翫∪縺吶

estcmd gather -cl -il ja -sd -cm casket .
estcmd purge -cl casket
estcmd extkeys casket

謚ス蜃コ縺輔l繧九く繝シ繝ッ繝シ繝峨ョ謨ー縺ョ繝繝輔か繝ォ繝亥、縺ッ32蛟九〒縺吶ゅ-kn縲阪が繝励す繝ァ繝ウ縺ァ謚ス蜃コ謨ー縺ッ螟画峩縺ァ縺阪∪縺吶ょ「励d縺吶→繝繝シ繧ソ繝吶シ繧ケ縺悟、ァ縺阪¥縺ェ繧翫∪縺吶′縲∵、懃エ「邊セ蠎ヲ縺ッ蜷台ク翫@縺セ縺吶る縺ォ貂帙i縺吶→繝繝シ繧ソ繝吶シ繧ケ縺ッ蟆上&縺上↑繧翫∪縺吶′縲∵、懃エ「邊セ蠎ヲ縺ッ菴惹ク九@縺セ縺吶よ枚譖ク繝峨Λ繝輔ヨ縺ォ莠医a繧ュ繝シ繝ッ繝シ繝峨r蝓九a霎シ繧縺ォ縺ッ縲%VECTOR蛻カ蠕。蜻ス莉、繧堤畑縺縺ヲ縺上□縺輔>縲

繝繝輔か繝ォ繝医〒縺ッ縲estcmd extkeys縺ッTD-IDF縺ョ縺溘a縺ョ譁譖ク鬆サ蠎ヲシDFシ峨ョ繝繝シ繧ソ繧貞ィ縺ヲ繝。繝「繝ェ荳翫↓螻暮幕縺吶k縺ョ縺ァ縲∵政霈峨Γ繝「繝ェ縺悟ー代↑縺迺ー蠅縺ァ縺ッ繝。繝「繝ェ荳崎カウ縺ォ縺ェ繧九%縺ィ縺瑚縺医i繧後∪縺吶ゅ◎縺ョ蝣エ蜷医ッ縲∽コ医aDF縺ョ繝繝シ繧ソ繧貞、夜Κ繝繝シ繧ソ繝吶シ繧ケ縺ォ菫晏ュ倥@縺ヲ縺翫>縺ヲ縲√◎繧後r菴ソ縺」縺ヲestcmd extkeys繧貞ョ溯。後☆繧九→繧医>縺ァ縺励g縺縲ゆサ・荳九ョ繧医≧縺ォ縺励※縺上□縺輔>縲

estcmd words -dfdb mydfdb casket
estcmd extkeys -dfdb mydfdb casket

蛻縺九■譖ク縺阪ョ蛻ゥ逕ィ

繧ュ繝シ繝ッ繝シ繝峨r謚ス蜃コ縺吶k縺溘a縺ォ蛻縺九■譖ク縺榊勣繧剃スソ縺繧医≧縺ォ縺吶k縺薙→繧ゅ〒縺阪∪縺吶estcmd extkeys繧貞ョ溯。後☆繧矩圀縺ォ縲-um縲阪が繝励す繝ァ繝ウ繧偵▽縺代k縺ィ縲∝ュ礼ィョ縺ォ繧医k蛻縺九■譖ク縺阪′陦後o繧後∪縺吶ゅ▽縺セ繧翫∵枚蟄励r遨コ逋ス縲∬恭謨ー蟄励∵シ「蟄励∝ケウ莉ョ蜷阪∫援莉ョ蜷阪√ワ繝ウ繧ー繝ォ縲√◎繧御サ・螟悶ョ險伜捷縺ォ蛻鬘槭@縲√◎繧後◇繧後ョ騾」邯壹@縺滄Κ蛻繧貞腰隱槭→縺励※蛻繧雁コ縺励∪縺吶

estcmd extkeys -um casket

譌・譛ャ隱樒畑縺ョ蠖「諷狗エ隗」譫仙勣MeCab繧貞縺九■譖ク縺阪↓蛻ゥ逕ィ縺吶k縺薙→繧ゅ〒縺阪∪縺吶Hyper Estraier繧偵ン繝ォ繝峨☆繧句燕縺ョ險ュ螳壹〒縲./configure --enable-mecab縲阪→縺励※縲?yper Estraier縺ォMeCab繧堤オ縺ソ霎シ繧薙〒縺翫¥縺ィ縲∝ュ礼ィョ縺ォ繧医k蛻縺九■譖ク縺阪ョ莉」繧上j縺ォMeCab縺御スソ繧上l縺セ縺吶

縺ェ縺翫∝ス「諷狗エ隗」譫舌↓繧医k繧ュ繝シ繝ッ繝シ繝画歓蜃コ縺ァ縺ッTF-IDF縺ォ繧医k繧ケ繧ウ繧「縺ョ隱ソ謨エ縺ッ荳崎ヲ√〒縺吶ョ縺ァ縲∵枚譖ク縺ョ逋サ骭イ縺ィ繧ュ繝シ繝ッ繝シ繝峨ョ謚ス蜃コ繧貞酔譎ゅ↓陦後▲縺ヲ繧らイセ蠎ヲ繧剃ソ昴▽縺薙→縺後〒縺阪∪縺吶ゆサ・荳九ョ繧医≧縺ォ縺励∪縺吶

estcmd gather -cl -sd -cm -kn 32 -um casket .

-kn縲阪ッ謚ス蜃コ縺吶k繧ュ繝シ繝ッ繝シ繝峨ョ謨ー繧呈欠螳壹@縺ヲ縲√-um縲阪ッ蠖「諷狗エ隗」譫仙勣繧貞茜逕ィ縺吶k縺薙→繧呈欠螳壹@縺セ縺吶よ枚譖ク縺ョ逋サ骭イ譎ゅ↓繧ュ繝シ繝ッ繝シ繝峨b逋サ骭イ縺励◆蝣エ蜷医estcmd extkeys繧貞ョ溯。後☆繧句ソ隕√ッ縺ゅj縺セ縺帙s縲ゅ◆縺縺励∝、ァ隕乗ィ。縺ェ繧オ繧、繝医ョ繧、繝ウ繝繝繧ッ繧ケ繧貞晄悄讒狗ッ峨☆繧句エ蜷医√く繝シ繝ッ繝シ繝画歓蜃コ縺ェ縺励〒estcmd gather繧貞ョ溯。後@縺ヲ縺九i縲estcmd extkeys縺ァ繧ュ繝シ繝ッ繝シ繝峨r謚ス蜃コ縺吶k譁ケ縺後∝ィ菴薙→縺励※縺ョ譎る俣縺ッ遏ュ縺上↑繧翫∪縺吶ょキョ蛻逋サ骭イ縺ョ髫帙↓縺ッ譁譖ク逋サ骭イ縺ィ繧ュ繝シ繝ッ繝シ繝画歓蜃コ繧貞酔譎ゅ↓陦後▲縺滓婿縺碁ォ倬溘〒縺吶

螻樊ァ繧、繝ウ繝繝繧ッ繧ケ

螻樊ァ讀懃エ「縺ッ螻樊ァ繝繝シ繧ソ繝吶シ繧ケ縺ォ縺翫¢繧句ィ縺ヲ縺ョ繝ャ繧ウ繝シ繝峨r讀懈渊縺吶k縺溘a縺ォ螟壹¥縺ョ譎る俣縺後°縺九j縺セ縺吶ょア樊ァ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌☆繧九→縲∵、懈渊縺吶k繝ャ繧ウ繝シ繝峨r邨槭j霎シ繧縺薙→縺ォ繧医▲縺ヲ螻樊ァ讀懃エ「繧帝ォ倬溷喧縺吶k縺薙→縺後〒縺阪∪縺吶ょア樊ァ繧、繝ウ繝繝繧ッ繧ケ縺ッestcmd create繧ウ繝槭Φ繝峨〒菴懈舌@縺セ縺吶ゅ-attr縲阪が繝励す繝ァ繝ウ縺ァ蟇セ雎。縺ィ縺ェ繧句ア樊ァ蜷阪→繝繝シ繧ソ蝙九r謖螳壹@縺セ縺吶ゆセ九∴縺ー@title螻樊ァ縺ォ繧キ繝シ繧ア繝ウ繧キ繝」繝ォ蝙九ョ繧、繝ウ繝繝繧ッ繧ケ繧貞シオ繧翫 author螻樊ァ縺ォ譁蟄怜怜梛縺ョ繧、繝ウ繝繝繧ッ繧ケ繧貞シオ繧翫 size螻樊ァ縺ォ謨ー蛟、蝙九ョ繧、繝ウ繝繝繧ッ繧ケ繧貞シオ繧九↓縺ッ縲∽サ・荳九ョ繧医≧縺ォ縺励※繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌@縺セ縺吶

estcmd create -attr @title seq -attr @author str -attr @size num casket

繧キ繝シ繧ア繝ウ繧キ繝」繝ォ蝙九ョ螻樊ァ繧、繝ウ繝繝繧ッ繧ケ縺ッ縲∵枚譖クID繧偵く繝シ縺ォ縺励※螻樊ァ蛟、繧貞、縺ォ謖√▽讒矩縺ァ縺吶よ、懃エ「譎ゅ↓縺ッ蜈ィ縺ヲ縺ョ繝ャ繧ウ繝シ繝峨′讀懈渊縺輔l縺セ縺吶′縲∝ア樊ァ繝繝シ繧ソ繝吶シ繧ケ繧医j縺ッ鬮倬溘↓螻樊ァ讀懃エ「縺瑚。後∴繧九h縺縺ォ縺ェ繧翫∪縺吶ゅ∪縺溘∝梛縺ォ萓晏ュ倥@縺ェ縺縺ィ縺縺蛻ゥ轤ケ縺ィ縲√た繝シ繝医b鬮倬溘↓縺ェ繧九→縺縺蛻ゥ轤ケ縺後≠繧翫∪縺吶よ枚蟄怜怜梛縺ョ螻樊ァ繧、繝ウ繝繝繧ッ繧ケ縺ッ縲∵鬆シ郁セ樊嶌鬆シ峨ョ譁蟄怜励r繧ュ繝シ縺ィ縺励※譁譖クID繧貞、縺ォ謖√▽讒矩縺ァ縺吶よ枚蟄怜怜梛縺ョ貍皮ョ怜ュ舌ョ荳驛ィシSTREQSTRBWSTROREQシ峨′縺ィ縺ヲ繧るォ倬溷喧縺輔l縺セ縺吶ゅ◎繧御サ・螟悶ョ譁蟄怜怜梛縺ョ貍皮ョ怜ュ舌b繧繧鬮倬溷喧縺輔l縺セ縺吶よ焚蛟、蝙九ョ螻樊ァ繧、繝ウ繝繝繧ッ繧ケ縺ッ縲∵鬆縺ョ謨ー蛟、繧偵く繝シ縺ィ縺励※譁譖クID繧貞、縺ォ謖√▽讒矩縺ァ縺吶よ焚蛟、蝙九ョ貍皮ョ怜ュ舌ョ荳驛ィシNUMEQNUMGTNUMGENUMLTNUMLENUMBTシ峨′縺ィ縺ヲ繧るォ倬溷喧縺輔l縺セ縺吶ゅ◎繧御サ・螟悶ョ謨ー蛟、蝙九ョ貍皮ョ怜ュ舌b繧繧鬮倬溷喧縺輔l縺セ縺吶ゅイ縺ィ縺、縺ョ螻樊ァ縺ォ謖螳壹〒縺阪k繧、繝ウ繝繝繧ッ繧ケ縺ッ縺イ縺ィ縺、縺縺代〒縺吶ゅ↑縺翫∝ア樊ァ繧、繝ウ繝繝繧ッ繧ケ繧貞シオ繧九→譁譖ク縺ョ譖エ譁ー繧蜑企勁縺ョ蜃ヲ逅縺ッ蟆代@驕縺上↑繧翫∪縺吶

譁蟄怜怜梛縺ィ謨ー蛟、蝙九ョ螻樊ァ繧、繝ウ繝繝繧ッ繧ケ縺悟シオ繧峨l縺ヲ縺繧句ア樊ァ縺ォ蟇セ縺励※縺ッ縲√◎縺ョ蛟、縺ョ荳贋ス阪r蜿門セ励☆繧九Λ繝ウ繧ュ繝ウ繧ー讀懃エ「繧定。後≧縺薙→縺後〒縺阪∪縺吶ゅΛ繝ウ繧ュ繝ウ繧ー讀懃エ「縺ッ縲∵、懃エ「繝輔Ξ繝シ繧コ縺後[RANK]縲阪〒蟋九∪縺」縺ヲ縺繧句エ蜷医↓陦後o繧後∪縺吶ゅ[RANK]縲阪ョ蠕後m縺ォ縺ッ縲∝叙蠕励☆繧倶サカ謨ー縺ィ蟇セ雎。縺ョ螻樊ァ蜷阪r遨コ逋ス縺ァ蛹コ蛻縺」縺ヲ謖螳壹@縺セ縺吶ゆセ九∴縺ー縲∵枚譖ク縺ョ繧オ繧、繧コ縺悟ー上&縺繧ゅョ縺九i10莉カ繧貞叙蠕励☆繧九↓縺ッ縲√[RANK] 10 @size縲阪→謖螳壹@縺セ縺吶ゆサカ謨ー縺瑚イ謨ー縺ョ蝣エ蜷医ッ縲鬆蠎上′髯埼縺ィ縺励※謇ア縺」縺ヲ邨カ蟇セ蛟、縺ョ莉カ謨ー繧貞叙蠕励@縺セ縺吶ゅΛ繝ウ繧ュ繝ウ繧ー讀懃エ「縺ッ螻樊ァ讀懃エ「蠑上〒縺ェ縺乗、懃エ「繝輔Ξ繝シ繧コ縺ォ謖螳壹☆繧九%縺ィ縺ォ豕ィ諢上@縺ヲ縺上□縺輔>縲ょィ譁讀懃エ「縺ィ繝ゥ繝ウ繧ュ繝ウ繧ー讀懃エ「繧貞酔譎ゅ↓陦後≧縺薙→縺ッ縺ァ縺阪∪縺帙s縲

逍台シシ繧、繝ウ繝繝繧ッ繧ケ

譁譖ク繝峨Λ繝輔ヨ繧堤音螳壹ョ繝輔か繝ォ繝縺ォ蜈・繧後※縺翫¥縺ィ縲√◎縺ョ繝輔か繝ォ繝繧堤桝莨シ逧縺ェ繧、繝ウ繝繝繧ッ繧ケ縺ィ縺励※謇ア縺縲√◎縺ョ荳ュ縺ォ縺ゅk譁譖ク繝峨Λ繝輔ヨ繧呈、懃エ「蟇セ雎。縺ォ蜷ォ繧√k縺薙→縺後〒縺阪∪縺吶ら桝莨シ繧、繝ウ繝繝繧ッ繧ケ縺ョ讀懃エ「縺ッgrep縺ィ蜷梧ァ倥ョ騾先ャ。謗「邏「縺ァ陦後↑繧上l繧九ョ縺ァ縲∵悽蠖薙ョ繧、繝ウ繝繝繧ッ繧ケ縺ォ豈斐∋縺ヲ縺九↑繧企≦縺縺ァ縺吶′縲√う繝ウ繝繝繧ッ繧ケ繧剃ス懊k蠢隕√′縺ェ縺縺ィ縺縺縺ョ縺御セソ蛻ゥ縺ェ縺ィ縺薙m縺ァ縺吶ら桝莨シ繧、繝ウ繝繝繧ッ繧ケ縺ョ繝繧」繝ャ繧ッ繝医Μ縺後/tmp/pindex縲阪〒縺ゅ▲縺溘→縺吶k縺ィ縲∽サ・荳九ョ繧医≧縺ォ縺励※縺昴l繧呈、懃エ「蟇セ雎。縺ォ蜉縺医k縺薙→縺後〒縺阪∪縺吶

estcmd search -pidx /tmp/pindex casket "unix AND linux"

逍台シシ繧、繝ウ繝繝繧ッ繧ケ繧呈、懃エ「蟇セ雎。縺ォ蜉縺医◆蝣エ蜷医∵悽蠖薙ョ繧、繝ウ繝繝繧ッ繧ケ縺ィ逍台シシ繧、繝ウ繝繝繧ッ繧ケ縺ョ繝。繧ソ讀懃エ「縺瑚。後↑繧上l縺セ縺吶ら桝莨シ繧、繝ウ繝繝繧ッ繧ケ縺ョ縺ソ繧貞ッセ雎。縺ィ縺励※讀懃エ「縺吶k蝣エ蜷医ッ縲∫ゥコ縺ョ繧、繝ウ繝繝繧ッ繧ケ縺ィ縺ョ繝。繧ソ讀懃エ「繧定。後↑縺」縺ヲ縺上□縺輔>縲ら桝莨シ繧、繝ウ繝繝繧ッ繧ケ縺ッ隍謨ー蛟区欠螳壹☆繧九%縺ィ繧ゅ〒縺阪∪縺吶estseek.cgi縺ァ逍台シシ繧、繝ウ繝繝繧ッ繧ケ繧呈、懃エ「蟇セ雎。縺ォ蜉縺医k蝣エ蜷医estseek.conf縺ォ縲pseudoindex: /tmp/pindex縲阪→縺縺」縺溯ィュ螳壹r蜉縺医※縺上□縺輔>縲

譛ャ蠖薙ョ繧、繝ウ繝繝繧ッ繧ケ縺ォ譁譖ク繧堤匳骭イ縺吶k髫帙↓縺ッ縲∝推譁譖ク繧貞挨蛟九ョ繧ウ繝阪け繧キ繝ァ繝ウ縺ァ逋サ骭イ縺吶k繧医j繧ゅ∵イ「螻ア縺ョ譁譖ク繧1蝗槭ョ繧ウ繝阪け繧キ繝ァ繝ウ縺ァ逋サ骭イ縺励◆譁ケ縺悟柑邇逧縺ァ縺吶ゅ@縺溘′縺」縺ヲ縲∫匳骭イ縺吶∋縺肴枚譖ク縺後≠繧狗ィ句コヲ縺ョ驥上↓縺ェ繧九∪縺ァ縺ッ逍台シシ繧、繝ウ繝繝繧ッ繧ケ縺ォ蜈・繧後※縺翫″縲√≠繧狗ィ句コヲ縺ョ驥上↓縺ェ縺」縺溘i逍台シシ繧、繝ウ繝繝繧ッ繧ケ縺ョ荳ュ縺ョ譁譖ク繝峨Λ繝輔ヨ繧呈悽蠖薙ョ繧、繝ウ繝繝繧ッ繧ケ縺ォ逋サ骭イ縺励※縲∫桝莨シ繧、繝ウ繝繝繧ッ繧ケ繧堤ゥコ縺ォ縺吶k縺ィ縺縺驕狗畑譁ケ豕輔b讀懆ィ弱☆繧倶セ。蛟、縺後≠繧九〒縺励g縺縲


蜉ゥ險

縺薙%縺ァ縺ッ縲√い繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ィ縺励※縺ョHyper Estraier繧呈エサ逕ィ縺吶k縺溘a縺ョ繧ウ繝繧偵>縺上▽縺狗エケ莉九@縺セ縺吶

螟ァ隕乗ィ。縺ェ繧、繝ウ繝繝繧ッ繧ケ縺ョ讒狗ッ

譁譖ク繧堤匳骭イ縺吶k蜃ヲ逅縺ァ縺ッ縲√う繝ウ繝繝繧ッ繧ケ縺ョ蜀驛ィ縺ァ謖√▲縺ヲ縺繧九ョ繝シ繧ソ繝吶シ繧ケ縺ォ閹ィ螟ァ縺ェ驥上ョ譖ク縺崎セシ縺ソ繧定。後>縺セ縺吶ゅョ繝シ繧ソ繝吶シ繧ケ繧貞盾辣ァ縺吶k繧ェ繝シ繝舌シ繝倥ャ繝峨r謚代∴繧九◆繧√↓縲?yper Estraier縺ッ蜃ヲ逅荳ュ縺ョ繝繝シ繧ソ繧偵Γ繝「繝ェ荳翫↓繧ュ繝」繝繧キ繝・縺吶k莉慕オ縺ソ繧呈戟縺」縺ヲ縺縺セ縺吶ゅく繝」繝繧キ繝・縺悟、ァ縺阪>譁ケ縺檎匳骭イ蜃ヲ逅縺ッ鬮倬溘↓縺ェ繧翫∪縺吶′縲√せ繝ッ繝繝励′襍キ縺阪k縺ィ縺九∴縺」縺ヲ蜉ケ邇縺瑚誠縺。縺セ縺吶ョ縺ァ縲∝ョ溘Γ繝「繝ェ縺ョ4蜑イ遞句コヲ縺ョ螟ァ縺阪&縺ォ縺吶k縺ィ繧医>繧医≧縺ァ縺吶ゆセ九∴縺ー1GB縺ョ螳溘Γ繝「繝ェ繧呈政霈峨@縺ヲ縺繧九槭す繝ウ縺ァ菴懈・ュ繧偵☆繧句エ蜷医400MB遞句コヲ縺碁←蛻縺ァ縺励g縺縲ゅ∪縺溘10荳莉カ莉・荳翫ョ譁譖ク繧堤匳骭イ縺吶k蝣エ蜷医√う繝ウ繝繝繧ッ繧ケ繧剃ス懈舌☆繧矩圀縺ォ螟ァ隕乗ィ。逕ィ縺ョ繝√Η繝シ繝九Φ繧ー繧偵☆繧九h縺縺ォ謖螳壹☆繧九→蜃ヲ逅蜉ケ邇縺悟髄荳翫@縺セ縺吶

estcmd縺ョ-cs繧ェ繝励す繝ァ繝ウ繧剃スソ縺縺ィ繧ュ繝」繝繧キ繝・繧オ繧、繧コ縺ョ謖螳壹′縺ァ縺阪∪縺吶ゅし繧、繧コ縺ッ繝。繧ャ繝舌う繝亥腰菴阪〒謖螳壹@縺セ縺吶ゅョ繝輔か繝ォ繝医ッ64MB縺ァ縺吶ゅ∪縺溘-xl繧ェ繝励す繝ァ繝ウ繧-xh繧ェ繝励す繝ァ繝ウ繧剃スソ縺縺ィ螟ァ隕乗ィ。逕ィ縺ョ繝√Η繝シ繝九Φ繧ー縺後↑縺輔l縺セ縺吶ゅ▽縺セ繧翫∽サ・荳九ョ繧医≧縺ォ縺励※譁譖ク繧堤匳骭イ縺吶k縺ィ繧医>縺ァ縺励g縺縲

estcmd gather -cl -il ja -xl -sd -cm -cs 400 casket .

繧、繝ウ繝繝繧ッ繧ケ縺ョ譛螟ァ繧オ繧、繧コ縺ッ縺翫♀繧医◎300GB縺ァ縺吶ゅ∪縺溘∝ッセ雎。譁譖ク縺後励Ξ繝シ繝ウ繝繧ュ繧ケ繝医ョ蝣エ蜷医√う繝ウ繝繝繧ッ繧ケ縺ョ繧オ繧、繧コ縺ッ蟇セ雎。譁譖ク縺ョ螳ケ驥上ョ50%縺九i200%遞句コヲ縺ォ縺ェ繧翫∪縺吶HTML縺ァ縺ゅl縺ー25%縺九i100%遞句コヲ縺ァ縺吶ゅ@縺溘′縺」縺ヲ縲∽ク縺、縺ョ繧、繝ウ繝繝繧ッ繧ケ縺ォ逋サ骭イ縺ァ縺阪k譁譖ク縺ョ邱城上ョ逶ョ螳峨ッ縲√励Ξ繝シ繝ウ繝繧ュ繧ケ繝医↑繧300GB縲?TML縺ェ繧600GB縺ィ縺縺」縺溘→縺薙m縺ァ縺吶ゅ↑縺翫√う繝ウ繝繝繧ッ繧ケ縺ョ繧オ繧、繧コ縺ッ縲∝ー上&縺譁譖ク縺悟、壽焚縺ゅk繧医j繧ゅ∝、ァ縺阪>譁譖ク縺悟ー第焚縺ゅk譁ケ縺悟ー上&縺上↑繧翫∪縺吶ゅ∪縺溘∵律譛ャ隱槭ョ譁譖ク繧医j繧り恭隱槭ョ譁譖ク縺ョ譁ケ縺悟ー上&縺上↑繧翫∪縺吶

100GB繧定カ翫∴繧九う繝ウ繝繝繧ッ繧ケ縺ァ陬懷勧繧、繝ウ繝繝繧ッ繧ケ繧貞茜逕ィ縺吶k蝣エ蜷医∬」懷勧繧、繝ウ繝繝繧ッ繧ケ縺ョ繧オ繧、繧コ縺2GB繧定カ翫∴縺ヲ繝繝シ繧ソ繝吶シ繧ケ縺ョ譖エ譁ー縺ォ螟ア謨励☆繧句庄閭ス諤ァ縺後≠繧翫∪縺吶ゅ◎縺ョ蝣エ蜷医ッ縲√ン繝ォ繝牙燕縺ョ險ュ螳壹〒縲./configure --enable-vista縲阪→縺励※縲〃ista繝繝シ繧ソ繝吶シ繧ケ繧堤オ縺ソ霎シ繧薙〒縺上□縺輔>縲

蜿ッ逕ィ諤ァ縺ョ遒コ菫

繧、繝ウ繝繝繧ッ繧ケ繧呈峩譁ー縺励※縺繧区怙荳ュ縺ォ縺ッ繝ュ繝繧ッ縺後°縺九k縺ョ縺ァ縲√◎縺ョ繧、繝ウ繝繝繧ッ繧ケ繧剃スソ縺」縺滓、懃エ「縺ッ縺昴ョ髢薙ッ縺ァ縺阪↑縺上↑繧翫∪縺吶よ、懃エ「繧キ繧ケ繝繝縺ィ縺励※縺ッ縲√◎縺ョ髢薙ッ蛛懈ュ「譎る俣縺ィ縺縺縺薙→縺ォ縺ェ繧翫∪縺吶ゅ◎繧後r驕ソ縺代k縺溘a縺ォ縺ッ縲√う繝ウ繝繝繧ッ繧ケ縺ョ繧ウ繝斐シ縺ォ蟇セ縺励※譖エ譁ー繧貞ヲ逅繧定。後>縲∝ョ御コ縺励◆繧峨が繝ェ繧ク繝翫Ν縺ィ蜈・繧梧鋤縺医k繧医≧縺ォ縺吶k縺ィ繧医>縺ァ縺励g縺縲ゅ∪縺溘√う繝ウ繝繝繧ッ繧ケ縺ョ譖エ譁ー荳ュ縺ォ荳肴э縺ォ繧キ繧ケ繝繝縺悟●豁「縺吶k縺ェ縺ゥ縺励※繧、繝ウ繝繝繧ッ繧ケ縺悟」翫l縺溷エ蜷医b縲∬、陬ス縺ォ蟇セ縺吶k譖エ譁ー縺ァ縺ゅl縺ー蝠城。後′縺ェ縺縺ョ縺ァ螳牙ソ縺ァ縺吶

荳願ソー縺ョ蜃ヲ逅繧定ェ蜍募喧縺吶k縺ォ縺ッ縲∽サ・荳九ョ繧医≧縺ェ繧ケ繧ッ繝ェ繝励ヨ繧呈嶌縺縺ヲ縺翫¥縺ィ繧医>縺ァ縺励g縺縲ょ帝ュ縺ョexit譁縺ッ縲∬、陬ス縺梧里縺ォ蟄伜惠縺励※縺繧句エ蜷茨シ井サ・蜑阪ョ譖エ譁ー縺ォ螟ア謨励☆繧九→縺昴≧縺ェ繧翫∪縺呻シ峨↓蜃ヲ逅繧貞●豁「縺吶k繧医≧縺ォ縺励※縺縺セ縺吶る比クュ縺ョexit譁縺ァ縺ッ縲∵峩譁ー縺励◆繧、繝ウ繝繝繧ッ繧ケ縺悟」翫l縺溷エ蜷医↓蜃ヲ逅繧貞●豁「縺吶k繧医≧縺ォ縺励※縺縺セ縺吶

test -e /home/www/casket-copy && exit
cp -R /home/www/casket /home/www/casket-copy
/usr/local/bin/estcmd gather -il ja -sd -cm /home/www/casket-copy /home/www/public_html
/usr/local/bin/estcmd purge /home/www/casket-copy
/usr/local/bin/estcmd extkeys /home/www/casket-copy
/usr/local/bin/estcmd optimize /home/www/casket-copy
/usr/local/bin/estcmd inform casket-copy || exit
rm -rf /home/www/casket
mv /home/www/casket-copy /home/www/casket

螳滄圀縺ョ縺ィ縺薙m縲estcmd search縺ョ-nl繧ェ繝励す繝ァ繝ウ繧呈欠螳壹@縺溘j縲estseek.conf縺ョlockindex縺ョ蛟、繧false縺ォ縺励◆繧翫☆繧後ー縲∵峩譁ー荳ュ縺ァ繝ュ繝繧ッ縺輔l縺ヲ縺繧九う繝ウ繝繝繧ッ繧ケ縺ォ蟇セ縺励※繧よ、懃エ「繧定。後≧縺薙→縺後〒縺阪∪縺吶ゅ◆縺縺励√う繝ウ繝繝繧ッ繧ケ蜀縺ョ繝繝シ繧ソ縺ョ謨エ蜷域ァ縺ォ髢「縺吶k菫晁ィシ縺後〒縺阪∪縺帙s縺ョ縺ァ縲∽ク肴ュ」縺ェ讀懃エ「邨先棡縺瑚ソ斐&繧後k蜿ッ閭ス諤ァ縺後≠繧翫∪縺吶

繧、繝ウ繝繝繧ッ繧ケ縺悟」翫l縺ヲ縺励∪縺」縺溷エ蜷医↓縺ッ縲estcmd repair繧剃スソ縺縺ィ菫ョ蠕ゥ縺ァ縺阪∪縺吶′縲∝」翫l繧句燕縺ョ蜈ィ縺ヲ縺ョ譁譖ク縺ィ縺昴ョ蜃コ迴セ諠蝣ア縺悟セゥ蜈縺ァ縺阪k縺ィ縺ッ髯舌j縺セ縺帙s縲ゅョ繝シ繧ソ縺ョ螳悟ィ諤ァ繧堤「コ菫昴☆繧九◆繧√↓縺ッ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懊j縺ェ縺翫@縺滓婿縺檎┌髮」縺ァ縺吶′縲∽ス懊j縺ェ縺翫@縺ヲ縺繧矩俣縺後ム繧ヲ繝ウ繧ソ繧、繝縺ォ縺ェ縺」縺ヲ縺励∪縺縺ョ縺ッ譛帙∪縺励>縺薙→縺ァ縺ッ縺ゅj縺セ縺帙s縲ゅ◎縺薙〒縲estcmd repair -rsh縺ァ邁。譏鍋噪縺ォ繧、繝ウ繝繝繧ッ繧ケ繧貞茜逕ィ蜿ッ閭ス縺ェ迥カ諷九↓縺励※蜿ッ逕ィ諤ァ繧堤「コ菫昴@縺ヲ縺翫>縺ヲ縲√ヰ繝繧ッ繧ー繝ゥ繧ヲ繝ウ繝峨d蛻・縺ョ繝槭す繝ウ縺ァ繧、繝ウ繝繝繧ッ繧ケ縺ョ蜀肴ァ狗ッ峨r陦後>縲∝ョ梧舌@縺溘i螢翫l縺溘b縺ョ縺ィ蜈・繧梧崛縺医k繧医≧縺ォ縺吶k縺ィ繧医>縺ァ縺励g縺縲

譁譖ク縺ョ蜑企勁

gatherpurge繧貞ョ溯。後☆繧矩圀縺ォ縲-cl縲阪r縺、縺代k縺ケ縺阪°縺ゥ縺縺九ッ驕狗畑縺ョ莉墓婿縺ォ繧医▲縺ヲ螟峨o縺」縺ヲ縺阪∪縺吶ゅ-cl縲阪r縺、縺代◆蝣エ蜷医ッ縲∬サ「鄂ョ繧、繝ウ繝繝繧ッ繧ケ繧帝Κ蛻逧縺ォ譛驕ゥ蛹悶☆繧九ョ縺ァ縲∝ヲ逅縺後d繧驥阪¥縺ェ繧翫∪縺吶ゅ◆縺縺励∵守、コ逧縺ォoptimize繧貞ョ溯。後@縺ェ縺上※繧よ、懃エ「縺ョ騾溷コヲ繧邊セ蠎ヲ縺瑚誠縺。縺セ縺帙s縲

-cl縲阪r縺、縺代↑縺蝣エ蜷医ッ縲∬サ「鄂ョ繧、繝ウ繝繝繧ッ繧ケ繧呈峩譁ー縺励↑縺縺ァ縲∵枚譖ク諠蝣ア縺ォ蜑企勁繝槭シ繧ッ繧偵▽縺代k縺縺代〒縺吶ョ縺ァ縲∵ッ碑シ逧縺ォ霆ス縺蜃ヲ逅縺ァ貂医∩縺セ縺吶ゅ◆縺縺励∵、懃エ「譎ゅ↓辟。鬧縺ェ鬆伜沺繧貞ヲ逅縺吶k縺薙→縺ォ縺ェ繧翫∪縺吶ョ縺ァ縲∵、懃エ「縺ョ騾溷コヲ縺ィ邊セ蠎ヲ縺悟ー代@縺壹▽關ス縺。縺ヲ縺阪∪縺吶ゅ◎繧後r隗」豸医☆繧九◆繧√↓縲∝ョ壽悄逧縺ォoptimize繧貞ョ溯。後☆繧九%縺ィ縺悟ソ隕√→縺ェ繧翫∪縺吶ゅ-cl縲阪r縺、縺代↑縺縺ァ蜑企勁縺励◆譁譖ク縺ョ鬆伜沺繧貞屓蜿弱☆繧九↓縺ッ縲optimize莉・螟悶ョ謇区ョオ縺ッ縺ゅj縺セ縺帙s縲

騾壼クク縺ョ驕狗畑縺ァ縺ッ縲√-cl縲阪r縺、縺代※gatherpurge繧貞ョ溯。後☆繧九ョ縺後h縺縺ァ縺励g縺縲ゅ◆縺縺励√→縺ヲ繧ょ、ァ驥上ョ荳頑嶌縺阪d蜑企勁繧定。後≧蝣エ蜷医↓縺ッ縲√-cl縲阪r縺、縺代↑縺縺ァgatherpurge繧貞ョ溯。後@縺ヲ縺九i縲optimize繧貞ョ溯。後☆繧区婿縺悟柑邇逧縺ァ縺吶ゅ∪縺溘∝庄逕ィ諤ァ縺ョ遒コ菫昴ョ鬆逶ョ縺ァ霑ー縺ケ縺溘h縺縺ォ縲√う繝ウ繝繝繧ッ繧ケ縺ョ隍陬ス縺ォ蟇セ縺励※譖エ譁ー縺吶k蝣エ蜷医↓繧ゅ-cl縲阪r縺、縺代↑縺譁ケ豕輔′驕ゥ縺励∪縺吶optimize繧偵@縺滓婿縺後う繝ウ繝繝繧ッ繧ケ縺悟ー上&縺丈ソ昴◆繧後k縺九i縺ァ縺吶

譁蟄怜喧縺大ッセ遲

繝励Ξ繝シ繝ウ繝繧ュ繧ケ繝医ョ譁譖ク繧縲?TML縺ョ譁譖ク縺ァmeta隕∫エ縺ォ繧医k譁蟄励さ繝シ繝峨ョ謖螳壹′縺ェ縺輔l縺ヲ縺縺ェ縺繧ゅョ縺ォ縺ッ縲√う繝ウ繝繧ッ繧キ繝ウ繧ー縺ョ髫帙↓縲-il縲阪が繝励す繝ァ繝ウ縺ョ險隱樊欠螳壹↓蠢懊§縺ヲ譁蟄励さ繝シ繝峨′閾ェ蜍募愛螳壹&繧後∪縺吶ゅ@縺九@縲∬ェ蜍募愛螳壹ョ邊セ蠎ヲ縺ッ螳檎挑縺ァ縺ッ縺ゅj縺セ縺帙s縲りェ蜍募愛螳壹ョ隱、繧翫↓繧医▲縺ヲ譁蟄怜喧縺代′逋コ逕溘@縺滄圀縺ォ縺ッ縲√-ic縲阪が繝励す繝ァ繝ウ縺ァ譁蟄励さ繝シ繝峨r譏守、コ縺吶k縺ィ繧医>縺ァ縺励g縺縲ゆセ九∴縺ー縲√/home/www/public_html/chinese縲堺サ・荳九ョ譁譖ク縺ッEUC-CN縺ァ譖ク縺九l縺ヲ縺縺ヲ縲√/home/www/public_html/korean縲堺サ・荳九ョ譁譖ク縺ッEUC-KR縺ァ譖ク縺九l縺ヲ縺繧九%縺ィ縺悟縺九▲縺ヲ縺繧九↑繧峨ー縲∽サ・荳九ョ繧医≧縺ォ縺励∪縺吶

estcmd gather -cl -ic EUC-CN -sd -cm casket /home/www/public_html/chinese
estcmd gather -cl -ic EUC-KR -sd -cm casket /home/www/public_html/korean
estcmd gather -cl -sd -cm casket /home/www/public_html

Windows荳翫〒縲縲阪縲阪縲阪↑縺ゥ縺ョ縺繧上f繧句、門ュ励r菴ソ縺縺薙→繧ょ、壹>縺九→諤昴>縺セ縺吶′縲√◎繧後i繧貞性繧薙□繝繧ュ繧ケ繝医rShift_JIS縺ィ縺励※謇ア縺縺ョ縺ッ驕ソ縺代◆譁ケ縺後h縺縺ァ縺励g縺縲よ枚蟄怜喧縺代☆繧句庄閭ス諤ァ縺碁ォ倥¥縺ェ繧翫∪縺吶ゆサ」繧上j縺ォCP932繧ゅ@縺上ッWindows-31J縺ィ縺励※謇ア縺」縺ヲ縺上□縺輔>縲

譌・譛ャ隱槭ョ繝代せ

譌・譛ャ隱槭↑縺ゥ縺ョ繝槭Ν繝√ヰ繧、繝域枚蟄励r蜷ォ繧薙□蜷榊燕縺ョ繝輔ぃ繧、繝ォ繧堤匳骭イ縺吶k縺薙→繧ゅ〒縺阪∪縺吶′縲∵枚蟄怜喧縺代r髦イ縺舌◆繧√↓縺ッ譁蟄励さ繝シ繝峨r譏守、コ縺吶k縺薙→縺悟ソ隕√〒縺吶estcmd gather縺ョ縲-pc縲阪が繝励す繝ァ繝ウ繧剃スソ縺縺セ縺吶ゆセ九∴縺ーEUC-JP縺ァ縺ゅk縺ィ謖螳壹☆繧句エ蜷医ッ縲∽サ・荳九ョ繧医≧縺ォ縺励∪縺吶

estcmd gather -cl -pc EUC-JP -sd -cm casket .

UNIX縺ァ縺ッEUC-JP縺偽TF-8縺ァ繝輔ぃ繧、繝ォ蜷阪r謇ア縺縺薙→縺悟、壹>縺ァ縺吶よ律譛ャ隱樒沿縺ョWindows縺ッCP932縺ァ繝輔ぃ繧、繝ォ蜷阪r謇ア縺縺セ縺吶ゅ-pc縲阪が繝励す繝ァ繝ウ縺ョ蛟、縺ォShift_JIS繧呈欠螳壹@縺ヲ繧よ悄蠕騾壹j縺ォ蜍穂ス懊@縺ェ縺縺薙→縺ォ豕ィ諢上☆縺ケ縺阪〒縺吶4hift_JIS縺ョ縲\縲搾シ0x5cシ峨rUTF-8縺ォ豁」隕丞喧縺吶k縺ィ縲√ヰ繝繧ッ繧ケ繝ゥ繝繧キ繝・縺ァ縺ェ縺丞繝槭シ繧ッ縺ォ縺ェ縺」縺ヲ縺励∪縺縲∝玄蛻繧頑枚蟄励→縺励※縺ョ讖溯ス縺悟、ア繧上l繧九◆繧√〒縺吶CP932シWindows-31Jシ峨ッ縲\縲阪r繝舌ャ繧ッ繧ケ繝ゥ繝繧キ繝・縺ィ縺励※謇ア縺縺薙→縺梧守、コ縺輔l縺ヲ縺繧玖ヲ乗シ縺ェ縺ョ縺ァ縲√%縺ョ蝠城。後ッ縺ゅj縺セ縺帙s縲

逋サ骭イ譁譖ク縺ョ驕ク謚

繧、繝ウ繝繝繧ッ繧ケ縺ォ逋サ骭イ縺吶k譁譖ク縺ョ繝輔ぃ繧、繝ォ繧帝∈謚槭☆繧矩圀縺ォ縺ッ縲ゞNIX縺ァ縺ッfind繧ウ繝槭Φ繝峨ョ蜃コ蜉帙restcmd gather縺ォ隱ュ縺ソ霎シ縺セ縺帙k縺ィ萓ソ蛻ゥ縺ァ縺吶estcmd gather縺ッ蜈・蜉帙ヵ繧。繧、繝ォ蜷阪ョ縺ィ縺薙m縺ォ縲-縲阪r謖螳壹☆繧九→讓呎コ門・蜉帙r隱ュ縺ソ霎シ縺ソ縺セ縺吶find縺ッ髱槫クク縺ォ鬮俶ゥ溯ス縺ァ縲√-type f縲阪→縺縺繧ェ繝励す繝ァ繝ウ繧偵▽縺代l縺ー繝輔ぃ繧、繝ォ蜷阪□縺代r蜃コ蜉帙〒縺阪∪縺吶@縲√-not -path /secret/縲阪→縺縺繧ェ繝励す繝ァ繝ウ繧偵▽縺代l縺ー縲√secret縲阪→縺縺繝繧」繝ャ繧ッ繝医Μ縺ョ荳ュ繧帝勁螟悶☆繧九%縺ィ縺後〒縺阪∪縺吶@縲√◎縺ョ莉悶↓繧よァ倥縺ェ繧ェ繝励す繝ァ繝ウ縺後≠繧翫∪縺吶ゅ∪縺溘grepfgrepegrep縺ィ縺縺」縺溘さ繝槭Φ繝峨〒find縺ョ蜃コ蜉帙r邨槭j霎シ繧縺ョ繧ゅh縺閠縺医〒縺吶

Windows縺ァ縺ッUNIX縺ョfind繧ウ繝槭Φ繝峨↓逶ク蠖薙☆繧区ィ呎コ悶ョ讖溯ス縺ッ縺ゅj縺セ縺帙s縺後estcmd scandir繧剃スソ縺縺ィ蜷後§繧医≧縺ェ縺薙→縺後〒縺阪∪縺呻シ医dir /s /b縲阪〒繧ょ、ァ謚オ縺ョ縺薙→縺ッ縺ァ縺阪∪縺吶′シ峨ゅ∪縺溘estcmd regex縺ッ縲ゞNIX縺ョegrep繧ウ繝槭Φ繝峨→蜷後§繧医≧縺ォ縲√ヵ繧。繧、繝ォ蜷阪ョ繝ェ繧ケ繝医r豁」隕剰。ィ迴セ縺ァ邨槭j霎シ繧縺薙→縺後〒縺阪∪縺吶ゆセ九∴縺ー縲C:\inetpub\wwwroot縲堺サ・荳九↓縺ゅkHTML繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ縺ョ繝ェ繧ケ繝医r蜃コ蜉帙☆繧九↓縺ッ縲∽サ・荳九ョ繧医≧縺ォ縺励∪縺吶

estcmd scandir -tf -pa "C:\inetpub\wwwroot" |
  estcmd regex -ci "\.html?$"

繝輔ぃ繧、繝ォ繝励Ο繝医さ繝ォ縺ョ蝠城。

讀懃エ「邨先棡縺ョ蜷譁譖ク縺ョURI繧偵ヵ繧。繧、繝ォ繝励Ο繝医さ繝ォシ医file://縲阪〒蟋九∪繧偽RLシ峨ョ蠖「蠑上〒陦ィ遉コ縺吶k蝣エ蜷医↓縺ッ縲√◎縺ョURI繧帝∈謚槭@縺滄圀縺ョ謖吝虚縺後ヶ繝ゥ繧ヲ繧カ縺ォ繧医▲縺ヲ逡ー縺ェ繧九%縺ィ縺ォ豕ィ諢上@縺ェ縺代l縺ー縺ェ繧翫∪縺帙s縲

Mozilla Firefox繧Нetscape縺ョ繝繝輔か繝ォ繝医ョ險ュ螳壹〒縺ッ縲√ヵ繧。繧、繝ォ繝励Ο繝医さ繝ォ縺ョURL繧偵ヶ繝ゥ繧ヲ繧コ縺吶k縺薙→縺ッ縺ァ縺阪∪縺帙s縲ゅい繝峨Ξ繧ケ繝舌シ縺ォ縲about:config縲阪→蜈・蜉帙@縺ヲ縺九i縲security.checkloaduri縲阪ョ蛟、繧偵false縲阪↓縺吶k蠢隕√′縺ゅj縺セ縺吶

Microsoft Internet Exploler縺ッ縲ゞRL繧ィ繝ウ繧ウ繝シ繝峨r繝繧ウ繝シ繝峨@縺ヲ蠕励i繧後◆譁蟄怜励ョ譁蟄励さ繝シ繝峨→URI縺檎スョ縺九l縺ヲ縺繧九壹シ繧ク縺ョ譁蟄励さ繝シ繝峨′蜷御ク縺ァ縺ゅk縺ィ莉ョ螳壹@縲√◎繧後↓蝓コ縺・縺縺ヲ繝ュ繝シ繧ォ繝ォ縺ォ縺翫¢繧区ィ呎コ悶ョ譁蟄励さ繝シ繝峨↓豁」隕丞喧繧定。後▲縺滉ク翫〒繝ェ繧ス繝シ繧ケ繧呈爾縺励∪縺吶ゅ@縺溘′縺」縺ヲ縲ヾhift_JIS縺ョ繝輔ぃ繧、繝ォ蜷阪r繧ィ繝ウ繧ウ繝シ繝峨@縺ヲ蠕励i繧後◆URI縺ッ縲estseek.cgi縺悟コ蜉帙☆繧偽TF-8縺ョ繝壹シ繧ク縺ォ鄂ョ縺上%縺ィ縺後〒縺阪∪縺帙s縲ょッセ遲悶→縺励※縺ッ縲∝挨縺ョ繝悶Λ繧ヲ繧カ繧剃スソ縺縺九∵律譛ャ隱槭ョ繝輔ぃ繧、繝ォ蜷阪r菴ソ繧上↑縺繧医≧縺ォ縺吶k縺九√ヵ繧。繧、繝ォ繝励Ο繝医さ繝ォ縺ョ莉」繧上j縺ォHTTP繧剃スソ縺縺薙→縺瑚縺医i繧後∪縺吶

SMB縺ョ繝輔ぃ繧、繝ォ繧オ繝シ繝舌ョ譁譖ク繧貞ッセ雎。縺ィ縺励※Windows縺ォ髢峨§縺溽腸蠅縺ァ蛻ゥ逕ィ縺吶k蝣エ蜷医ッ縲ゞRI縺ョ莉」繧上j縺ォUNCシUniversal Naming Conventionシ峨r繝ェ繝ウ繧ッ蜈医↓縺吶k縺ィ萓ソ蛻ゥ縺ァ縺吶estseek.conf縺ォ縺ゅk縲showlreal縲阪ョ蛟、繧偵true縲阪↓縺吶k縺ィ縲√お繝ウ繧ウ繝シ繝峨&繧後◆URI縺ョ莉」繧上j縺ォ縲∝ッセ雎。譁譖ク縺ョ繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ縺御スソ繧上l縺セ縺吶ゅ%縺ョ邨カ蟇セ繝代せ縺ォ縺ッURI繧ィ繝ウ繧ウ繝シ繝峨′譁ス縺輔l縺壹∽サョ蜷阪d貍「蟄励′縺昴ョ縺セ縺セ蜷ォ縺セ繧後∪縺呻シ医%繧後ッHTML縺ョ隕乗シ縺ォ驕募渚縺励∪縺吶′シ峨ゅ%繧後r縲replece縲阪↓繧医▲縺ヲUNC縺ォ蜉蟾・縺励※縺上□縺輔>縲ゅ↑縺翫ゞNC縺ォ繝峨Λ繧、繝匁枚蟄励r蜷ォ繧√※縺ッ縺ェ繧峨↑縺縺ィ縺縺縺薙→縺ォ豕ィ諢上@縺ヲ縺上□縺輔>縲ゆセ九∴縺ー縲√d:\pub縲阪′縲\\skyhigh\pub\縲阪→縺励※蜈ア譛峨&繧後※縺繧九↑繧峨estseek.conf縺ォ莉・荳九ョ繧医≧縺ェ險ュ螳壹r縺励∪縺吶

...
replece: ^d:\\pub\\{{!}}\\skyhigh\pub\
showlreal: true
...

Windows逕ィ縺ョ繝輔ぅ繝ォ繧ソ

Windows逕ィ縺ョ繝舌う繝翫Μ繝代ャ繧ア繝シ繧ク縺ォ縺ッ縲xdoc2txt縺ィ縺縺繝輔ぅ繝ォ繧ソ繝励Ο繧ー繝ゥ繝縺悟酔譴ア縺輔l縺ヲ縺縺セ縺吶ゅ%繧後rHyper Estraier縺九i蜻シ縺ウ蜃コ縺吶◆繧√ョestxfilt縺ィ縺縺繝ゥ繝繝代シ繧ょ酔譴ア縺輔l縺ヲ縺縺セ縺吶ゅ◎繧後i繧剃スソ縺縺ィ縲 ̄DF縲ヽTF縲`S-Word縲`S-Excel縲`S-PowerPoint縺ェ縺ゥ縺ョ繝輔ぃ繧、繝ォ繧偵う繝ウ繝繝繧ッ繧ケ縺ォ逋サ骭イ縺ァ縺阪∪縺吶ょ酔譴ア縺ョ繧ウ繝槭Φ繝峨→DLL縺ッ蜈ィ縺ヲ繝代せ縺ョ騾壹▲縺溷エ謇縺ォ鄂ョ縺縺ヲ縺上□縺輔>縲

萓九∴縺ー縲√D:\mikio\doc縲堺サ・荳九ョ繝輔ぃ繧、繝ォ繧堤匳骭イ縺励◆繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌☆繧九↓縺ッ縲∽サ・荳九ョ繧医≧縺ェ繧ウ繝槭Φ繝峨r螳溯。後@縺セ縺吶

cd D:\mikio\doc
estcmd gather -cl -fx .pdf,.rtf,.doc,.xls,.ppt T@estxfilt -fz ^
  -ic CP932 -pc CP932 -sd -cm casket .

-ic縲阪が繝励す繝ァ繝ウ縺ァCP932繧呈欠螳壹@縺ヲ縺繧九ョ縺ッ縲estxfilt縺ョ蜃コ蜉帙ョ譁蟄励さ繝シ繝峨′CP932縺ァ縺ゅk縺ィ繧上°縺」縺ヲ縺繧九◆繧√〒縺吶ゅ↑縺翫∬。梧忰縺ョ縲^縲阪ッ繧ウ繝槭Φ繝峨励Ο繝ウ繝励ヨ縺ョ繧ィ繧ケ繧ア繝シ繝玲枚蟄励〒縺吶

縺ェ縺翫仝indows荳翫〒繝ュ繝シ繧ォ繝ォ繝輔ぃ繧、繝ォ縺ョ逋サ骭イ繧定。後↑縺」縺溷エ蜷医↓縺ッ縲∝推譁譖ク縺ォ縺ッ縲file:///C|/pub/foo/bar.doc縲阪ョ繧医≧縺ェURI螻樊ァ縺御サ倥¢繧峨l縺セ縺吶ゅ%繧後r螟夜Κ蜈ャ髢狗畑縺ョHTTP縺ョURL縺ォ螟画鋤縺吶k縺ォ縺ッ縲√replace: ^file:///C\|/pub/{{!}}http://estraier.gov/縲阪↑縺ゥ縺ィ縺励※縺上□縺輔>縲ゅΓ繧ソ譁蟄励〒縺ゅk縲|縲阪↓荳閾エ縺輔○繧九↓縺ッ縲\|縲阪→縺励※繧ィ繧ケ繧ア繝シ繝励☆繧九%縺ィ縺悟ソ隕√〒縺吶

繝輔ぅ繝ォ繧ソ縺ョ菴懊j譁ケ

gather縺ョ縲-fx縲阪が繝励す繝ァ繝ウ縺ァ蜻シ縺ウ蜃コ縺輔l繧九ヵ繧」繝ォ繧ソ繝励Ο繧ー繝ゥ繝縺ッ縲∝・ス縺阪↑繧医≧縺ォ螳溯」縺吶k縺薙→縺後〒縺阪∪縺吶ゅ励Ο繧ー繝ゥ繝險隱槭ッ菴輔〒繧よァ九>縺セ縺帙s縲らャャ1蠑墓焚縺ァ謖螳壹&繧後k繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧薙〒縲∫ャャ2蠑墓焚縺ョ繝輔ぃ繧、繝ォ縺ォ譖ク縺崎セシ繧√ー繧医>縺ョ縺ァ縺吶ょコ蜉帙ョ蠖「蠑上ッ縲∵枚譖ク繝峨Λ繝輔ヨ縲√励Ξ繝シ繝ウ繝繧ュ繧ケ繝医?TML縲`IME縺九i驕ク謚槭☆繧九%縺ィ縺後〒縺阪∪縺吶

萓九∴縺ー縲`P3縺ョ繝輔ぃ繧、繝ォ縺九i繧ソ繧、繝医Ν遲峨ョ諠蝣ア繧呈栢縺榊コ縺吶ヵ繧」繝ォ繧ソ繧定縺医※縺ソ縺セ縺励g縺縲よィ呎コ悶す繧ァ繝ォ縺ァ螳溯」縺励※縲[p3info縺ィiconv繧堤オ縺ソ蜷医o縺帙k縺薙→縺ォ縺励∪縺吶ゅ↑縺翫!D3繧ソ繧ー縺ョ譁蟄励さ繝シ繝峨′ISO-8859-1シLatin1シ峨〒縺ゅk縺薙→繧貞燕謠舌→縺励※縺縺セ縺吶′縲√%繧後ッ螳滄圀縺ォ險倬鹸縺励※縺繧区枚蟄励さ繝シ繝峨↓蜷医o縺帙※隱ュ縺ソ縺九∴縺ヲ縺上□縺輔>縲

#! /bin/sh
mp3info -p '@title=%t\n@author=%a\n@type=audio/mpeg\n\n%c\n\t%t\n\t%a\n' "$1" |
  iconv -f ISO-8859-1 -t UTF-8 < "$2"

荳願ィ倥r縲estmp3todraft縲阪→縺縺蜷榊燕縺ァ菫晏ュ倥@縺ヲ縲∝ョ溯。梧ィゥ髯舌r縺、縺代※縲√ヱ繧ケ縺ョ騾壹▲縺溷エ謇縺ォ鄂ョ縺阪∪縺吶ゅ≠縺ィ縺ッ縲∽サ・荳九ョ繧ウ繝槭Φ繝峨r螳溯。後☆繧後ー縲`P3繝輔ぃ繧、繝ォ繧偵う繝ウ繝繝繧ッ繧ケ縺ォ逋サ骭イ縺吶k縺薙→縺後〒縺阪∪縺吶

estcmd gather -cl -fx .mp3 estmp3todraft -fz -sd -cm casket .

蜷遞ョ縺ョ繝輔ぅ繝ォ繧ソ縺悟螳溘☆繧九→螟壹¥縺ョ繝ヲ繝シ繧カ縺ォ蝟懊s縺ァ縺縺溘□縺代k縺ョ縺ァ縲√b縺励≠縺ェ縺溘′譛臥畑縺ェ繝輔ぅ繝ォ繧ソ繧剃ス懊▲縺溘↑繧峨?yper Estraier縺ョML縺ォ縺懊イ邏ケ莉九@縺ヲ縺上□縺輔>縲

繝ヲ繝シ繧カ繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縺ョ繧ォ繧ケ繧ソ繝槭う繧コ

螻樊ァ讀懃エ「譚。莉カ繧鬆蠎乗欠螳壹ョ蠑上r謇句・蜉帙☆繧九ョ縺碁擇蛟偵↑蝣エ蜷医estseek.conf縺ョattrselect螻樊ァ繧稚rue縺ォ縺励※縺上□縺輔>縲ゅそ繝ャ繧ッ繝医懊ャ繧ッ繧ケ縺ァ謖螳壹〒縺阪k繧医≧縺ォ縺ェ繧翫∪縺吶

莉サ諢上ョ繝ヲ繝シ繧カ螻樊ァ繧定。ィ遉コ縺励◆縺縺ェ繧峨estseek.conf縺ョextattr螻樊ァ繧貞茜逕ィ縺励※縺上□縺輔>縲

蜈・蜉帙ヵ繧ゥ繝シ繝繧貞、画峩縺励◆縺縺ェ繧峨estseek.tmpl縺ョ荳ュ縺ョ縲<!--ESTFORM-->縲阪ョ莉」繧上j縺ォ閾ェ蛻縺ァ繝輔か繝シ繝縺ョHTML繧呈嶌縺縺ヲ繧よァ九>縺セ縺帙s縲ゅ◎縺ョ莉悶゛avaScript繧ГSS繧帝ァ菴ソ縺吶l縺ー縺ー縺九↑繧翫ョ繧ォ繧ケ繧ソ繝槭う繧コ縺後〒縺阪k縺ッ縺壹〒縺吶

CSS繧ЙavaScript縺ァ縺ァ縺阪↑縺繧ォ繧ケ繧ソ繝槭う繧コ縺悟ソ隕√↑繧峨ー縲estseek.c縺ョ繧ス繝シ繧ケ繧呈嶌縺肴鋤縺医※謾ケ騾縺励※繧ゅh縺縺ァ縺吶@縲estcmd縺ョXML蜃コ蜉帙Δ繝シ繝峨r蜻シ縺ウ蜃コ縺吶せ繧ッ繝ェ繝励ヨ繧呈嶌縺縺ヲ繧ゅh縺縺ァ縺励g縺縲ゅb縺。繧阪s縲、PI繧剃スソ縺」縺溘励Ο繧ー繝ゥ繝溘Φ繧ー繧偵☆繧後ー縲∵怙繧ょシキ蜉帙↑繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ繧剃ス懊k縺薙→縺後〒縺阪k縺ァ縺励g縺縲

繧ク繝」繝ウ繝ォ縺ォ繧医k邨槭j霎シ縺ソ

estcmd縺ィestseek.cgi縺ォ縺ッ隍謨ー縺ョ繧、繝ウ繝繝繧ッ繧ケ繧呈ィェ譁ュ逧縺ォ讀懃エ「縺吶k讖溯ス縺ッ縺ゅj縺セ縺帙sシAPI繧剃スソ縺医ー蜿ッ閭ス縺ァ縺吶′シ峨ゅ@縺溘′縺」縺ヲ縲∽ク諡ャ縺ァ讀懃エ「縺吶k縺ォ縺ッ縲∫焚縺ェ繧狗ィョ鬘槭ョ繝繝シ繧ソ繧偵イ縺ィ縺、縺ョ繧、繝ウ繝繝繧ッ繧ケ縺ォ譬シ邏阪@縺ヲ縲√ず繝」繝ウ繝ォ螻樊ァ繧偵▽縺代k縺薙→縺ォ繧医▲縺ヲ蛹コ蛻・縺吶k縺ィ繧医>縺ァ縺励g縺縲ゆセ九∴縺ー縲√Γ繝シ繝ォ縺ィWeb繧ウ繝ウ繝繝ウ繝繧偵ず繝」繝ウ繝ォ蛻縺代@縺ヲ逋サ骭イ縺吶k縺ォ縺ッ縲∽サ・荳九ョ繧医≧縺ォ縺励∪縺吶よ怙蛻昴↓繧、繝ウ繝繝繧ッ繧ケ繧剃ス懊k譎ゅ□縺estcmd create縺ァ螻樊ァ繧、繝ウ繝繝繧ッ繧ケ繧貞シオ繧九ョ縺後昴う繝ウ繝医〒縺吶

estcmd create -attr @genre str casket
estcmd gather -fm -il ja -aa @genre mail casket /home/mikio/mailbox
estcmd gather -fh -il ja -aa @genre web casket /home/mikio/public_html

estseek.cgi縺ォ縺翫>縺ヲ縺ッ縲estseek.conf縺ョgenrecheck螻樊ァ繧定ィュ螳壹☆繧九%縺ィ縺ォ繧医▲縺ヲ縲∵、懃エ「蟇セ雎。縺ィ縺ェ繧九ず繝」繝ウ繝ォ繧偵メ繧ァ繝繧ッ繝懊ャ繧ッ繧ケ縺ァ驕ク繧薙〒讀懃エ「縺吶k縺薙→縺後〒縺阪∪縺吶ゆセ九∴縺ー縲∽ク願ィ倥ョ繧、繝ウ繝繝繧ッ繧ケ縺ォ蟇セ縺励※縺ッ莉・荳九ョ險ュ螳壹r縺吶k縺ィ繧医>縺ァ縺励g縺縲

genrecheck: mail{{!}}繝。繝シ繝ォ
genrecheck: web{{!}}Web繧ウ繝ウ繝繝ウ繝

繧、繝ウ繧ッ繝ェ繝。繝ウ繧ソ繝ォ讀懃エ「縺ィ螳悟ィN-gram譁ケ蠑

蜈・蜉帙ヵ繧」繝シ繝ォ繝峨↓譁蟄励r謇薙■霎シ繧豈弱↓邨先棡縺ョ逕サ髱「縺梧峩譁ー縺輔l繧九√>繧上f繧九う繝ウ繧ッ繝ェ繝。繝ウ繧ソ繝ォ讀懃エ「繧定。後≧縺薙→繧ゅ〒縺阪∪縺吶ゅ◎繧後↓縺ッ縲∽サ・荳九ョ謇矩繧貞ョ溯。後@縺ヲ縺上□縺輔>縲

  • estcmd gather縺ァ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懊k髫帙↓縲-apn繧ェ繝励す繝ァ繝ウ繧偵▽縺代∪縺吶
  • `/usr/local/share/hyperestraier/increm/' 莉・荳九↓縺ゅk繝輔ぃ繧、繝ォ鄒、繧弾stseek.cgi縺ョ縺ゅk繝繧」繝ャ繧ッ繝医Μ縺ォ繧ウ繝斐シ縺励∪縺吶
  • estseek.tmpl縺ョ荳ュ縺ョ縲<!--ESTFORM-->縲阪r蜑企勁縺励∪縺吶
  • 繧ウ繝斐シ縺励◆estseek-frame.html縺ォ繝悶Λ繧ヲ繧カ縺ァ繧「繧ッ繧サ繧ケ縺励∪縺吶

-apn繧ェ繝励す繝ァ繝ウ縺ッ縲∝ョ悟ィN-gram譁ケ蠑上ョ繝繝シ繧ソ繝吶シ繧ケ繧剃ス懊k縺薙→繧呈欠螳壹@縺セ縺吶ょョ悟ィN-gram譁ケ蠑上→縺ッ縲√Κ繝シ繝ュ繝繝醍ウサ縺ョ險隱槭r隗」譫舌☆繧矩圀縺ォ繧N-gram譁ケ蠑上r驕ゥ逕ィ縺吶k繧ゅョ縺ァ縺吶ゅ%縺ョ謖螳壹ッ繝繝シ繧ソ繝吶シ繧ケ繧剃ス懈舌☆繧区凾縺ォ縺励°縺ァ縺阪∪縺帙s縲ゅョ繝シ繧ソ繝吶シ繧ケ繧剃ス懈舌@縺溷セ後↓譁ケ蠑上r螟画峩縺吶k縺薙→縺ッ縺ァ縺阪↑縺縺ィ縺縺縺薙→縺ァ縺吶ょョ悟ィN-gram縺ァ縺ェ縺上※繧ゅう繝ウ繧ッ繝ェ繝。繝ウ繧ソ繝ォ讀懃エ「縺ッ蜿ッ閭ス縺ァ縺吶′縲∬恭譁縺縺ィ蜊倩ェ樊ッ弱〒縺励°譁譖ク縺後ヲ繝繝医@縺ェ縺縺ョ縺ァ螟壼ー台ク堺セソ縺ォ縺ェ繧翫∪縺吶ゅ↑縺翫∝ョ悟ィN-gram譁ケ蠑上ョ谺轤ケ縺ッ縲√う繝ウ繝繝繧ッ繧ケ縺ョ繧オ繧、繧コ縺悟、ァ縺阪¥縺ェ繧九%縺ィ縺ィ縲髢「騾」譁譖ク讀懃エ「縺ョ邊セ蠎ヲ縺御ク九′繧九%縺ィ縺ァ縺吶ゅ@縺溘′縺」縺ヲ縲√う繝ウ繧ッ繝ェ繝。繝ウ繧ソ繝ォ讀懃エ「繧剃スソ繧上↑縺蝣エ蜷医ッ騾壼クク縺ョ譁ケ蠑上′謗ィ螂ィ縺輔l縺セ縺吶

FastCGI

陬乗橿縺ョ遽逍縺ォ蜈・繧翫∪縺吶′縲estseek.cgi繧帝ォ倬溷喧縺励◆繝励Ο繧ー繝ゥ繝繧剃ス懊k縺薙→縺悟庄閭ス縺ァ縺吶ゅ%繧後ッUNIX迚医ョ縺ソ縺ョ讖溯ス縺ァ縲:astCGI縺ィ縺縺隕乗シ縺ォ蝓コ縺・縺上b縺ョ縺ァ縺吶FastCGI縺ョ螳溯。檎腸蠅シmod_fcgi縺ェ縺ゥシ峨→繝ゥ繧、繝悶Λ繝ェシlibfcgiシ峨r繧、繝ウ繧ケ繝医シ繝ォ縺励◆荳翫〒縲?yper Estraier縺ョ繧ス繝シ繧ケ繝代ャ繧ア繝シ繧ク縺ョ荳ュ縺ァ縲make fcgi縲阪r螳溯。後@縺ヲ縺上□縺輔>縲ゅ☆繧九→縲estseek.fcgi縲阪→縺縺繝励Ο繧ー繝ゥ繝縺御ス懈舌&繧後∪縺吶ゅ%繧後restseek.cgi縺ョ莉」繧上j縺ォ蛻ゥ逕ィ縺励※縺上□縺輔>縲

FastCGI繧ケ繧ッ繝ェ繝励ヨ縺ッCGI繧ケ繧ッ繝ェ繝励ヨ縺ィ縺サ縺シ蜷後§繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縺ァ縺ゅj縺ェ縺後i縲∝クク鬧舌励Ο繧サ繧ケ縺ォ縺ェ繧九%縺ィ縺檎音蠕エ縺ァ縺吶ゅ@縺溘′縺」縺ヲ縲√励Ο繧サ繧ケ繧定、陬ス縺励◆繧灰B縺ォ謗・邯壹@縺溘j縺吶k繧ェ繝シ繝舌シ繝倥ャ繝峨′縺九°繧峨↑縺縺ョ縺ァ縲∝ソ懃ュ疲凾髢薙′縺九↑繧顔洒縺上↑繧翫∪縺吶ょ酔譎よ磁邯壽焚縺悟、壹>繧オ繧、繝医〒縺ッ縺薙ョ譁ケ豕輔ッ繧ェ繧ケ繧ケ繝。縺ァ縺吶FastCGI縺ョ隧ウ邏ー縺ォ縺、縺縺ヲ縺ッFastCGI縺ョ繝帙シ繝繝壹シ繧ク繧偵#隕ァ縺上□縺輔>縲

estseek.fcgi縺ッ繧、繝ウ繝繝繧ッ繧ケ繧偵Ο繝繧ッ縺礼カ壹¢繧九ョ縺ァ縲仝eb繧オ繝シ繝舌ョ遞シ蜒堺クュ縺ッ繧、繝ウ繝繝繧ッ繧ケ繧呈峩譁ー縺吶k縺薙→縺後〒縺阪∪縺帙s縲ゅう繝ウ繝繝繧ッ繧ケ繧呈峩譁ー縺吶k縺溘a縺ォ縺ッ縲estcmd縺ァ譖エ譁ー蜻ス莉、繧呈寺縺代※縺九i縲仝eb繧オ繝シ繝舌r蜀崎オキ蜍輔☆繧九%縺ィ縺ォ縺ェ繧翫∪縺吶ゆサ・荳九ョ繧医≧縺ォ縺吶k縺ィ繧医>縺ァ縺励g縺縲

estcmd gather -cl -il ja -sd -cm casket . &
  sudo /usr/local/apache2/bin/apachectl restart

繧ケ繝壹す繝」繝ォ繧ュ繝」繝繧キ繝・縺ィ縺ッ縲∫音螳壹ョ螻樊ァ縺ョ蛟、繧偵く繝」繝繧キ繝・縺吶k縺薙→縺ォ繧医▲縺ヲ蜃ヲ逅縺ョ鬮倬溷喧繧貞峙繧倶サ慕オ縺ソ縺ァ縺吶estseek.conf縺ョspcache縺ッ繧ケ繝壹す繝」繝ォ繧ュ繝」繝繧キ繝・縺ョ螻樊ァ蜷阪r謖螳壹@縺セ縺吶ゆセ九∴縺ー縲∵峩譁ー譌・譎ゅ↓繧医k繧ス繝シ繝医r鬆サ郢√↓陦後≧蝣エ蜷医ッ縲@mdate螻樊ァ繧呈欠螳壹@縺ヲ縺翫¥縺ィ繧医>縺ァ縺励g縺縲ゅせ繝壹す繝」繝ォ繧ュ繝」繝繧キ繝・縺ョ蟇セ雎。縺ォ謖螳壹〒縺阪k螻樊ァ縺ッ縺イ縺ィ縺、縺縺代〒縺吶ゅせ繝壹す繝」繝ォ繧ュ繝」繝繧キ繝・縺ッ繝。繝「繝ェ荳翫ョ繧ュ繝」繝繧キ繝・縺ァ縺吶ョ縺ァ縲,GI縺ァ縺ッ讖溯ス縺励∪縺帙s縲ょクク鬧舌励Ο繧サ繧ケ縺ァ縺ゅkFastCGI縺ァ縺ョ縺ソ螽∝鴨繧堤匱謠ョ縺励∪縺吶

NFS縺ォ繧医k繧、繝ウ繝繝繧ッ繧ケ縺ョ蜈ア譛

NFS繝槭え繝ウ繝医ョ繝輔ぃ繧、繝ォ繧キ繧ケ繝繝荳翫↓繧、繝ウ繝繝繧ッ繧ケ繧堤スョ縺丞エ蜷医↓縺ッ闍・蟷イ縺ョ豕ィ諢上′蠢隕√〒縺吶ゅ∪縺壹√◎縺ョNFS繧オ繝シ繝舌♀繧医ウNFS繧ッ繝ゥ繧、繧「繝ウ繝医′繝ュ繝繧ッ繧偵し繝昴シ繝医@縺ヲ縺繧句ソ隕√′縺ゅj縺セ縺吶21荳也エ縺ョ螳溯」縺ァ縺ゅl縺ー螟ァ謚オ縺ッ繝ュ繝繧ッ繧偵し繝昴シ繝医@縺ヲ縺繧九〒縺励g縺縲ゅ∪縺溘¨FS繧オ繝シ繝舌ョ繝励Ο繧サ繝繧オ縺ィNFS繧ッ繝ゥ繧、繧「繝ウ繝医ョ繝励Ο繧サ繝繧オ縺ョ繧ィ繝ウ繝繧」繧「繝ウ縺御ク閾エ縺励※縺繧九%縺ィ縺悟ソ隕√〒縺吶

莉・荳翫ョ譚。莉カ繧呈コ縺溘@縺ヲ縺繧九↑繧峨ー縲¨FS繧剃スソ縺」縺ヲ隍謨ー縺ョ繝槭す繝ウ縺ァ繧、繝ウ繝繝繧ッ繧ケ繧貞ア譛峨☆繧九%縺ィ縺後〒縺阪∪縺吶ゆクヲ蛻怜喧縺ォ髢「縺吶k譚。莉カ縺ッ蜊倅ク縺ョ繝槭す繝ウ繧剃スソ縺」縺ヲ縺繧句エ蜷医→蜷後§縺ァ縺吶ゅ☆縺ェ繧上■縲√≠繧九励Ο繧サ繧ケ縺後Λ繧、繧ソ縺ァ謗・邯壹@縺ヲ縺繧矩俣縺ッ莉悶ョ繝励Ο繧サ繧ケ縺ッ繝ェ繝シ繝縺ァ繧ゅΛ繧、繧ソ縺ァ繧よ磁邯壹〒縺阪★縲√≠繧九励Ο繧サ繧ケ縺後Μ繝シ繝縺ァ謗・邯壹@縺ヲ縺繧矩俣縺ッ莉悶ョ繝励Ο繧サ繧ケ縺ッ繝ェ繝シ繝縺ァ縺ゅl縺ー謗・邯壹〒縺阪∪縺吶

WWWOFFLE縺ョ繧ュ繝」繝繧キ繝・縺ョ讀懃エ「

繝励Ο繧ッ繧キ繧オ繝シ繝晋WWOFFLE縺ョ繧ュ繝」繝繧キ繝・繧貞ッセ雎。縺ィ縺励◆讀懃エ「繧キ繧ケ繝繝繧呈ァ狗ッ峨☆繧九%縺ィ繧らー。蜊倥〒縺吶ゅ◎縺ョ縺溘a縺ォ縲仝WWOFFLE縺ョ繧ュ繝」繝繧キ繝・縺ョ繝ェ繧ケ繝医r蜃コ蜉帙☆繧九さ繝槭Φ繝峨→縺励※ `estwolefind' 縺梧署萓帙&繧後∪縺吶ゅ%繧後ッ縲∫ャャ1蠑墓焚縺ァ謖螳壹@縺溘ョ繧」繝ャ繧ッ繝医Μ縺ォ縺ゅkWWWOFFLE縺ョ繧ュ繝」繝繧キ繝・繝輔ぃ繧、繝ォ縺ョ繝代せ縺ィ縺昴l縺ォ蟇セ蠢懊☆繧偽RL縺翫h縺ウ繝輔ぃ繧、繝ォ蜷阪rTSV蠖「蠑上〒蜃コ蜉帙☆繧九b縺ョ縺ァ縺吶

萓九∴縺ー縲仝WWOFFLE縺ョ繧ュ繝」繝繧キ繝・縺後/var/spool/wwwoffle縲阪↓縺ゅk縺ェ繧峨ー縲∽サ・荳九ョ繧ウ繝槭Φ繝峨r螳溯。後@縺ヲ縺上□縺輔>縲ゅ↑縺翫∽ス懈・ュ縺ッ縲/var/spool/wwwoffle縲阪r隱ュ縺ソ蜿悶l繧区ィゥ髯舌′縺ゅk繝ヲ繝シ繧カ縺ァ陦後▲縺ヲ縺上□縺輔>縲

estwolefind /var/spool/wwwoffle |
  estcmd gather -cl -fm -il ja -bc -px @uri -px _lfile -sd -cm casket -

縺ゅ→縺ッ縲∵勸騾壹↓estseek.cgi縺ァ讀懃エ「繧定。後≧縺薙→縺後〒縺阪∪縺吶ょョ壽悄逧縺ォ荳願ィ倥ョ繧ウ繝槭Φ繝峨r螳溯。後☆繧九h縺縺ォ縺吶l縺ー縲∝ソォ驕ゥ縺ェWeb繝ゥ繧、繝輔ョ荳蜉ゥ縺ィ縺ェ繧九〒縺励g縺縲

蝨ァ邵ョ譁ケ蠑上ョ驕ク謚

繝繝輔か繝ォ繝医〒縺ッ繧、繝ウ繝繝繧ッ繧ケ縺ョ蜷繝繝シ繧ソ繝吶シ繧ケ縺ッZLIB繧堤畑縺縺ヲ蝨ァ邵ョ縺輔l縺セ縺吶′縲√ン繝ォ繝牙燕縺ョ險ュ螳壹〒縲./configure --disable-zlib縲阪→縺吶k縺ィ縲∝悸邵ョ繧偵@縺ェ縺繧医≧縺ォ縺吶k縺薙→縺後〒縺阪∪縺吶ょ酔讒倥↓縲√./configure --enable-lzo縲阪→縺吶k縺ィZLIB縺ョ莉」繧上j縺ォLZO繧堤畑縺繧九h縺縺ォ縲√./configure --enable-bzip縲阪→縺吶k縺ィZLIB縺ョ莉」繧上j縺ォBZIP2繧堤畑縺繧九h縺縺ォ縺吶k縺薙→縺後〒縺阪∪縺吶ゅ◆縺縺励∬サ「鄂ョ繧、繝ウ繝繝繧ッ繧ケ繝繧」繝ャ繧ッ繝医Μシ_idx/シ峨ョ蝨ァ邵ョ縺ォ髢「縺励※縺ッ縲_DBM縺瑚ゥイ蠖薙ョ蝨ァ邵ョ譁ケ蠑上r繧オ繝昴シ繝医@縺ヲ縺縺ェ縺蝣エ蜷医ッ髱槫悸邵ョ縺ィ縺ェ繧翫∪縺吶

蝨ァ邵ョ譁ケ蠑上ョ驕ク謚槭↓繧医▲縺ヲ縲√う繝ウ繝繝繧ッ繧ケ縺ョ繧オ繧、繧コ縺ィ讒狗ッ峨↓縺九°繧区凾髢薙ッ螟ァ縺阪¥螟峨o繧翫∪縺吶ゆサ・荳九↓繧、繝ウ繝繝繧ッ繧ケ縺ョ繧オ繧、繧コ縺ィ讒狗ッ画凾髢薙ョ蜿り蛟、繧堤、コ縺励∪縺吶ょッセ雎。譁譖ク縺ッWikipedia譌・譛ャ隱樒沿縺九i辟。菴懃ぜ縺ォ謚ス蜃コ縺励◆50000莉カ縺ョ譁譖クシ医励Ξ繝シ繝ウ繝繧ュ繧ケ繝医→縺励※130.69MBシ峨〒縲∝ョ溯。檎腸蠅縺ョCPU縺ッPentium4縺ョ1.7GHz縺ァ縲∵政霈峨Γ繝「繝ェ縺ッ1GB縺ァ縲∝牡繧雁ス薙※縺溘く繝」繝繧キ繝・繧オ繧、繧コ縺ッ512MB縺ァ縺吶

_idx _attr _text 蜷郁ィ 譎る俣
髱槫悸邵ョ 189.25MB 21.82MB 138.08MB 349.16MB 481遘
LZO 169.90MB 18.59MB 86.74MB 275.24MB 553遘
BZIP2 146.89MB 20.15MB 64.79MB 231.83MB 820遘
ZLIB 139.78MB 17.09MB 65.97MB 222.85MB 602遘

迚ケ蛻・縺ェ逅逕ア縺後↑縺髯舌j縺ッZLIB繧剃スソ縺縺薙→繧呈耳螂ィ縺励∪縺吶よ峩譁ー縺碁撼蟶ク縺ォ鬆サ郢√↑蝣エ蜷医ッ縲∝ヲ逅騾溷コヲ縺ョ騾溘>LZO繧剃スソ縺」縺ヲ繧ゅ>縺縺ァ縺励g縺縲る撼蝨ァ邵ョ繧ВZIP2繧剃スソ縺縺ケ縺咲憾豕√ッ縺セ縺壹↑縺縺ァ縺励g縺縲ゅ↑縺翫∵、懃エ「縺ォ縺九°繧区凾髢薙ッ縺ゥ縺ョ譁ケ蠑上〒繧ょ、ァ蟾ョ縺ゅj縺セ縺帙s縲

繧ケ繧ウ繧「縺ョ邊セ蠎ヲ繧剃ス輔ヰ繧、繝医↓縺吶k縺九↓繧医▲縺ヲ繧ゅう繝ウ繝繝繧ッ繧ケ縺ョ繧オ繧、繧コ縺ィ讒狗ッ画凾髢薙ッ螟峨o繧翫∪縺吶ゆサ・荳九↓蜿り蛟、繧堤、コ縺励∪縺吶ょ悸邵ョ譁ケ蠑上ッZLIB縺ィ縺励∪縺吶

_idx _attr _text 蜷郁ィ 譎る俣
0繝舌う繝 117.10MB 17.09MB 65.97MB 220.17MB 530遘
1繝舌う繝 139.78MB 17.09MB 65.97MB 222.85MB 602遘
4繝舌う繝 170.23MB 17.09MB 65.97MB 253.30MB 670遘

蟶ク縺ォ鬆蠎乗欠螳壼シ上r菴ソ縺蝣エ蜷医ッ繧ケ繧ウ繧「縺ッ荳崎ヲ√〒縺吶ョ縺ァ縲∫イセ蠎ヲ繧0繝舌う繝茨シ医▽縺セ繧願ィ倬鹸縺励↑縺シ峨↓縺励※繧ゅ>縺縺ァ縺励g縺縲ゅ◎縺縺ァ縺ェ縺蝣エ蜷医ッ1繝舌う繝茨シ医ョ繝輔か繝ォ繝茨シ峨↓縺吶k縺ョ縺後>縺縺ァ縺励g縺縲4繝舌う繝医↓縺励※繧ゆス捺─逧縺ェ邊セ蠎ヲ縺ッ縺昴l縺サ縺ゥ蜷台ク翫@縺セ縺帙s縲

閾ェ辟カ鬆蠎上ョ繧ォ繧ケ繧ソ繝槭う繧コ

鬆蠎乗欠螳壼シ上r菴輔b謖螳壹@縺ェ縺蝣エ蜷医ョ讀懃エ「邨先棡縺ョ陦ィ遉コ鬆蠎上r閾ェ辟カ鬆蠎上→蜻シ縺カ縺薙→縺ォ縺励∪縺吶ゅョ繝輔か繝ォ繝医〒縺ッ閾ェ辟カ鬆蠎上ッ繧ケ繧ウ繧「シ域、懃エ「隱槭ョ蜃コ迴セ謨ーシ峨ョ髯埼縺ァ縺吶ゅ→縺薙m縺ァ縲鬆蠎乗欠螳壼シ上r菴ソ縺」縺ヲ讀懃エ「邨先棡繧剃クヲ縺ケ譖ソ縺医◆髫帙↓縺ッ縲∬ェ辟カ鬆蠎上〒荳ヲ縺ケ縺溷エ蜷医↓豈斐∋縺ヲ縺九↑繧企≦縺上↑繧九→縺縺谺轤ケ縺後≠繧翫∪縺吶ゅ◎縺薙〒縲√せ繧ウ繧「縺ィ縺励※螻樊ァ縺ョ蛟、繧呈戟縺溘○縺ヲ縲鬆蠎乗欠螳壼シ上r菴ソ繧上★縺ォ縲∝ア樊ァ蛟、縺ォ繧医▲縺ヲ荳ヲ縺ウ譖ソ縺医◆讀懃エ「邨先棡繧貞セ励i繧後k繧医≧縺ォ縺励※縺ソ縺セ縺励g縺縲

繧ケ繧ウ繧「縺ィ縺励※螻樊ァ蛟、繧剃スソ縺縺ォ縺ッ縲estcmd縺ァ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌☆繧矩圀縺ォ縲-sa繧ェ繝励す繝ァ繝ウ繧剃サ倥¢縺ヲ繧ケ繧ウ繧「縺ョ邊セ蠎ヲ繧堤「コ菫昴@縺滉ク翫〒縲∵枚譖ク繧堤匳骭イ縺吶k髫帙↓-ss繧ェ繝励す繝ァ繝ウ縺ァ繧ケ繧ウ繧「縺ョ蛟、縺ィ縺ェ繧区焚蛟、蝙九ョ螻樊ァ縺ョ蜷榊燕繧呈欠螳壹@縺セ縺吶ゆセ九∴縺ー縲∵枚譖ク縺ョ繧オ繧、繧コ繧定ェ辟カ鬆蠎上↓縺吶k縺ォ縺ッ縲∽サ・荳九ョ繧医≧縺ェ繧ウ繝槭Φ繝峨r螳溯。後@縺ヲ縺上□縺輔>縲

estcmd gather -cl -il ja -sa -ss '@size' -sd -cm casket .

荳願ィ倥ョ繧医≧縺ォ繧、繝ウ繝繧ッ繧キ繝ウ繧ー繧定。後▲縺溷エ蜷医∵、懃エ「譎ゅ↓鬆蠎乗欠螳壼シ上r謖螳壹@縺ェ縺蝣エ蜷医ッ縲∬ゥイ蠖捺枚譖ク縺後し繧、繧コ縺悟、ァ縺阪>鬆縺ォ荳ヲ縺ケ繧峨l縺セ縺吶ゅし繧、繧コ縺悟ー上&縺鬆縺ォ荳ヲ縺ケ縺溘>蝣エ蜷医ッ縲鬆蠎乗欠螳壼シ上→縺励※縲√[SCA]縲阪r謖螳壹@縺ヲ縺上□縺輔>縲ゅ%縺ョ貍皮ョ怜ュ舌□縺代ッ鬆蠎乗欠螳壼シ上〒縺ゅ▲縺ヲ繧ょア樊ァ繧貞盾辣ァ縺励↑縺縺ョ縺ァ騾溷コヲ縺瑚誠縺。縺セ縺帙s縲よ枚譖ク繝峨Λ繝輔ヨ縺ォ莠医a莉」譖ソ繧ケ繧ウ繧「縺ョ謖螳壹r蝓九a霎シ繧縺ォ縺ッ縲%SCORE蛻カ蠕。蜻ス莉、繧堤畑縺縺ヲ縺上□縺輔>縲

逋サ骭イ譎ゅ↓譁譖ク縺ォ莉倅ク弱&繧後◆繧ケ繧ウ繧「縺ッ蠕後°繧牙、画峩縺吶k縺薙→縺ッ縺ァ縺阪∪縺帙s縲estcmd edit縺ァ螻樊ァ縺ョ蛟、繧貞、画峩縺励※繧ゅ◎繧後ッ繧ケ繧ウ繧「縺ォ蜿肴丐縺輔l縺ェ縺縺ィ縺縺縺薙→縺ァ縺吶ゅせ繧ウ繧「繧貞、画峩縺励◆縺蝣エ蜷医ッ縲√>縺」縺溘s縺昴ョ譁譖ク繧偵う繝ウ繝繝繧ッ繧ケ縺九i蜑企勁縺励※縺九i蜀咲匳骭イ縺励※縺上□縺輔>縲

繧、繝ウ繝繝繧ッ繧ケ縺ョ繝槭う繧ー繝ャ繝シ繧キ繝ァ繝ウ

Hyper Estraier縺ョ繝舌シ繧ク繝ァ繝ウ縺ォ繧医▲縺ヲ繧、繝ウ繝繝繧ッ繧ケ縺ョ蠖「蠑上′逡ー縺ェ繧句エ蜷医′縺ゅj縺セ縺吶ゆサ雁セ後ッ繝輔か繝シ繝槭ャ繝医r縺ェ繧九∋縺丞、画峩縺励↑縺繧医≧縺ォ縺吶k縺、繧ゅj縺ァ縺吶′縲∽ク縺御ク螟画峩縺輔l縺溷エ蜷医↓縺ッ縲∵里蟄倥ョ繧、繝ウ繝繝繧ッ繧ケ縺ョ繝繝シ繧ソ繧偵ム繝ウ繝励@縺ヲ縺翫″縲√◎縺ョ繝繝シ繧ソ繧呈眠縺励>繝舌シ繧ク繝ァ繝ウ縺ョHyper Estraier縺ォ隱ュ縺ソ霎シ縺セ縺帙k縺ィ繧医>縺ァ縺励g縺縲ゅ%縺ョ謇区ウ輔ッ縲√ヰ繝シ繧ク繝ァ繝ウ髢薙ョ繝槭う繧ー繝ャ繝シ繧キ繝ァ繝ウ縺縺代〒縺ェ縺上√お繝ウ繝繧」繧「繝ウ縺ョ逡ー縺ェ繧九励Λ繝繝医ヵ繧ゥ繝シ繝髢薙〒縺ョ繝槭う繧ー繝ャ繝シ繧キ繝ァ繝ウ縺ォ繧よ怏蜉ケ縺ァ縺吶

繝繝シ繧ソ繧偵ム繝ウ繝励☆繧九↓縺ッ縲∽サ・荳九ョ繧医≧縺ェ繧ウ繝槭Φ繝峨r螳溯。後@縺セ縺吶

estcmd search -max -1 -dd casket [UVSET]

縺吶k縺ィ縲√き繝ャ繝ウ繝医ョ繧」繝ャ繧ッ繝医Μ縺ォ00000001.est00000002.est00000003.est窶ヲ縺ィ縺縺」縺溷錐蜑阪ョ繝輔ぃ繧、繝ォ鄒、縺檎函謌舌&繧後∪縺吶ゅ◎繧後◇繧後ョ繝輔ぃ繧、繝ォ縺ッ繧、繝ウ繝繝繧ッ繧ケ蜀縺ョ蛟九縺ョ譁譖ク縺ョ譁譖ク繝峨Λ繝輔ヨ縺ァ縺吶ゅ◎縺励※縲√◎縺ョ繝輔ぃ繧、繝ォ鄒、繧呈眠縺励>迺ー蠅縺ォ遘サ縺励※縲estcmd gather縺ァ隱ュ縺ソ霎シ縺セ縺帙k縺縺代〒縺吶


繧医¥閨槭°繧後k雉ェ蝠

Q. 縲粂yper Estraier縲阪ッ縺ゥ縺逋コ髻ウ縺吶l縺ー繧医>縺ァ縺吶°シ
A. 菴懆縺ッ縲後ワ繧、繝代シ繧ィ繧ケ繝医Ξ繧、繧「縲阪→逋コ髻ウ縺励※縺縺セ縺吶ゅ■縺ェ縺ソ縺ォ縲√憩straier縲阪ッ蜿、縺繝輔Λ繝ウ繧ケ隱槭〒縲瑚ソキ縺縲阪→縺九後ッ縺舌l繧九阪→縺九>縺諢丞袖縺ョ險闡峨〒縺吶′縲∵悽蠖薙ョ隱ュ縺ソ譁ケ縺ッ繧医¥蛻縺九j縺セ縺帙s縲
Q. 縲粂yper Estraier縲阪→縲粂yperEstraier縲阪ッ縺ゥ縺。繧峨′豁」縺励>縺ァ縺吶°シ
A. 繝励Ο繧ク繧ァ繧ッ繝亥錐縺ィ縺励※縺ッ縲粂yper Estraier縲阪′蜈ャ蠑上ョ蜷榊燕縺ァ縺吶ゅヱ繝繧ア繝シ繧ク蜷阪→縺励※縺ッ縲敬yperestraier縲阪′菴ソ繧上l縺セ縺吶ゅ粂yperEstraier縲阪ッ繝励Ο繧ー繝ゥ繝蜀縺ョ隴伜挨蟄舌dHTTP縺ョ繝ヲ繝シ繧カ繧ィ繝シ繧ク繧ァ繝ウ繝亥錐縺ィ縺励※菴ソ繧上l繧九%縺ィ縺後≠繧翫∪縺吶
Q. 繧ウ繝槭Φ繝峨ョ螳溯。御セ九〒蜃コ縺ヲ縺上k縲慶asket縲阪▲縺ヲ菴輔〒縺吶°シ
A. 闍ア隱槭〒縲梧」コ譯カ縲阪→縺縺諢丞袖縺ョ險闡峨〒縺吶ゅ梧ュサ菴難シcorpseシ峨r蜈・繧後k邂ア縲阪→縲梧枚萓矩寔シcorpusシ峨r蜈・繧後k邂ア縲阪r謗帙¢縺ヲ縺繧九ョ縺ァ縺吶′縲√↑縺九↑縺区ー励▼縺縺ヲ繧ゅi縺医∪縺帙s縲
Q. Windows荳翫〒蜍輔″縺セ縺吶°シ
A. 蜍輔″縺セ縺吶ゅヰ繧、繝翫Μ繝代ャ繧ア繝シ繧ク繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ヲ縺上□縺輔>縲
Q. 繝薙ャ繧ー繧ィ繝ウ繝繧」繧「繝ウ繧ゅ@縺上ッ繝ェ繝医Ν繧ィ繝ウ繝繧」繧「繝ウ縺ョ繝槭す繝ウ荳翫〒蜍輔″縺セ縺吶°シ
A. 縺ッ縺縲ゅ←縺。繧峨〒繧ょ虚菴懊@縺セ縺吶ゅ◆縺縺励∝曙譁ケ縺ァ繧、繝ウ繝繝繧ッ繧ケ繧貞ア譛峨☆繧九%縺ィ縺ッ縺ァ縺阪∪縺帙s縲
Q. 64繝薙ャ繝医ョ繝励Ο繧サ繝繧オ縺ァ蜍輔″縺セ縺吶°シ
A. 縺ッ縺縲ょ撫鬘後↑縺丞虚菴懊@縺セ縺吶
Q. Estraier縺ィHyper Estraier繧貞酔荳繧キ繧ケ繝繝縺ォ蜈ア蟄倥&縺帙k縺薙→縺ッ蜿ッ閭ス縺ァ縺吶°縲
A. 縺ッ縺縲ょ庄閭ス縺ァ縺吶ゅさ繝槭Φ繝牙錐繧繝ゥ繧、繝悶Λ繝ェ蜷阪↑縺ゥ縺碁崎、縺励↑縺繧医≧縺ォ驟肴ョ縺励※縺縺セ縺吶ョ縺ァ縲∽コ偵>縺ォ陦晉ェ√☆繧九%縺ィ縺ッ縺ゅj縺セ縺帙s縲
Q. Estraier縺ィ繧、繝ウ繝繝繧ッ繧ケ縺ョ莠呈鋤諤ァ縺ッ縺ゅj縺セ縺吶°シ
A. 縺縺縺医ゆコ呈鋤諤ァ縺ッ縺ゅj縺セ縺帙s縲
Q. PDF縺ッ謇ア縺医∪縺吶°シ
A. 縺ッ縺縲る←蛻縺ェ繝輔ぅ繝ォ繧ソ繧堤オ縺ソ蜷医o縺帙l縺ー蜿ッ閭ス縺ァ縺吶ゅ◆縺縺励∵囓蜿キ蛹悶&繧後※縺縺溘j譁蟄励′逕サ蜒上→縺励※菫晏ュ倥&繧後※縺繧輝DF縺九i縺ッ繝繧ュ繧ケ繝医r謚ス蜃コ縺ァ縺阪∪縺帙s縲ゅユ繧ュ繧ケ繝域歓蜃コ遖∵ュ「縺ョ繝輔Λ繧ー縺檎ォ九▲縺ヲ縺繧九□縺代↑繧峨}dftotext繧偵ワ繝繧ッ縺吶l縺ー菴輔→縺九↑繧九i縺励>縺ァ縺吶
Q. 遘√ョ蝠逕ィ陬ス蜩√〒Hyper Estraier繧剃スソ縺」縺ヲ繧医>縺ァ縺吶°シ
A. 縺ッ縺縲Hyper Estraier繧貞膚逕ィ縺ョ陬ス蜩√d繧オ繝シ繝薙せ縺ァ蛻ゥ逕ィ縺吶k縺薙→縺ッ蜈ィ縺丞撫鬘後≠繧翫∪縺帙s縺励√Λ繧、繧サ繝ウ繧ケ譁吶b荳蛻縺九°繧翫∪縺帙s縺励∝茜逕ィ縺吶k縺薙→繧剃ス懆縺ォ蝣ア蜻翫☆繧句ソ隕√b縺ゅj縺セ縺帙s縺励∝茜逕ィ縺励※縺繧九%縺ィ繧偵←縺薙°縺ォ譏手ィ倥☆繧句ソ隕√b縺ゅj縺セ縺帙s縲ゅ↑縺翫´GPL縺ォ縺翫>縺ヲ縺ッ縲√Λ繧、繝悶Λ繝ェ繧偵せ繧ソ繝繧」繝繧ッ繝ェ繝ウ繧ッ縺励◆陬ス蜩√r驟榊ク縺吶k縺九ム繧、繝翫Α繝繧ッ繝ェ繝ウ繧ッ縺ォ縺励※繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ィ繝ゥ繧、繝悶Λ繝ェ繧貞挨騾斐↓驟榊ク縺吶k縺九ッ譛ャ雉ェ逧縺ェ蝠城。後〒縺ッ縺ゅj縺セ縺帙s縲ゅ←縺。繧峨↓縺帙hHyper Estraier閾ェ菴薙r辟。謾ケ螟峨〒驟榊ク縺吶k縺ョ縺ァ縺ゅl縺ー繧ス繝シ繧ケ繧ウ繝シ繝牙ャ髢九ョ鄒ゥ蜍吶ッ逋コ逕溘@縺セ縺帙s縲ゅ◆縺ィ縺Hyper Estraier繧呈隼螟峨@縺溘→縺励※繧ゅ∵隼螟峨@縺櫞yper Estraier閾ェ菴薙ョ繧ス繝シ繧ケ繧ウ繝シ繝峨r蜈ャ髢九☆繧後ー繧医>縺縺代〒縲√≠縺ェ縺溘ョ陬ス蜩√ョ縺昴ョ莉悶ョ繝「繧ク繝・繝シ繝ォ縺ョ繧ス繝シ繧ケ繧ウ繝シ繝峨r蜈ャ髢九☆繧句ソ隕√ッ縺ゅj縺セ縺帙s縲りゥウ縺励¥縺ッ縲COPYING縲阪ヵ繧。繧、繝ォ繧定ェュ繧薙〒縺上□縺輔>縲
Q. 繝薙Ν繝峨↓螟ア謨励@縺溘ョ縺ァ縺吶′縲√↑縺懊〒縺吶°シ
A. QDBM縺ィlibiconv縺ィzlib縺ョ繝舌シ繧ク繝ァ繝ウ縺碁←蛻縺九←縺縺玖ェソ縺ケ縺ヲ縺上□縺輔>縲Mac OS X縺ョ蝣エ蜷医ッ縲make mac縲阪?P-UX縺ョ蝣エ蜷医ッ縲make hpux縲阪r螳溯。後@縺溘°遒コ隱阪@縺ヲ縺上□縺輔>縲ゅン繝ォ繝峨↓蠢隕√↑繧ウ繝槭Φ繝会シarld縺ェ縺ゥシ峨′繝代せ縺ォ蜷ォ縺セ繧後※縺繧九°縺ゥ縺縺狗「コ隱阪@縺ヲ縺上□縺輔>縲ゅ◎繧後〒繧ゅム繝。縺ェ繧峨√Γ繝シ繝ェ繝ウ繧ー繝ェ繧ケ繝医°菴懆縺ォ蝣ア蜻翫@縺ヲ縺上□縺輔>縲
Q. 險ュ鄂ョ縺励◆estseek.cgi縺ォ繧「繧ッ繧サ繧ケ縺吶k縺ィ縲栗nternal Server Error縲阪↓縺ェ縺」縺ヲ縺励∪縺縺セ縺吶ゅ←縺縺吶l縺ー縺縺縺ァ縺吶°シ
A. estcmd縺悟ョ溯。後〒縺阪※豁」蟶ク縺ォ繧、繝ウ繝繝繧ッ繧ケ縺御ス懈舌〒縺阪※縺繧九↑繧峨√う繝ウ繧ケ繝医シ繝ォ縺ッ縺縺セ縺上>縺」縺ヲ縺繧九ッ縺壹〒縺吶ゅ♀縺昴i縺丞撫鬘後ッ縲仝eb繧オ繝シ繝舌r螳溯。後@縺ヲ縺繧九Θ繝シ繧カ縺ョ繝ゥ繧、繝悶Λ繝ェ讀懃エ「繝代せ縺ォlibestraier.so繧libqdbm.so縺ェ縺ゥ縺ョ縺ゅk蝣エ謇縺悟性縺セ繧後※縺縺ェ縺縺薙→縺ァ縺吶ら腸蠅螟画焚LD_LIBRARY_PATHシMac OS X縺ョ蝣エ蜷医ッDYLD_LIBRARY_PATH縺ァ縲仝indows縺ョ蝣エ蜷医ッPathシ峨r驕ゥ蛻縺ォ險ュ螳壹@縺ヲ縺上□縺輔>縲
Q. 繧、繝ウ繝繝繧ッ繧ケ縺悟」翫l縺ヲ縺励∪縺縺セ縺励◆縺後∽ソョ蠕ゥ縺吶k縺ォ縺ッ縺ゥ縺縺吶l縺ー縺縺縺ァ縺吶°シ
A. estcmd repair繧剃スソ縺縺ィ菫ョ蠕ゥ縺ァ縺阪∪縺吶ゅ@縺九@縲√う繝ウ繝繝繧ッ繧ケ縺悟」翫l縺滓凾縺ォ逋サ骭イ縺励※縺縺滓枚譖ク縺ッ豸亥、ア縺励※縺繧句庄閭ス諤ァ縺後≠繧九%縺ィ縺ォ豌励r莉倥¢縺ヲ縺上□縺輔>縲ゆク荳縺ョ莠区腐縺ォ蛯吶∴縺ヲ螳壽悄逧縺ォ繝舌ャ繧ッ繧「繝繝励r蜿悶k縺ョ縺ッ螟ァ莠コ縺ィ縺励※縺ョ繝槭リ繝シ縺ァ縺吶
Q. 繝舌げ繧堤匱隕九@縺セ縺励◆縲
A. 縺ァ縺阪k縺縺大ッセ蠢懊@縺溘>縺ョ縺ァ縲√Γ繝シ繝ェ繝ウ繧ー繝ェ繧ケ繝医°菴懆縺ォ蝣ア蜻翫@縺ヲ縺上□縺輔>縲ゅ◎縺ョ髫帙↓縲髢狗匱迺ー蠅縲∝ョ溯。檎腸蠅縲∝咲樟謇矩縲√お繝ゥ繝シ繝。繝繧サ繝シ繧ク縲√Ο繧ー縺ェ縺ゥ縲√〒縺阪k縺縺題ゥウ邏ー縺ェ繝繝シ繧ソ縺後≠繧九→蜉ゥ縺九j縺セ縺吶ゅ↑縺翫estcmd繧貞ョ溯。後☆繧矩圀縺ォ迺ー蠅螟画焚ESTDBGFD縺ョ蛟、縺ォ繝輔ぃ繧、繝ォ繝繧」繧ケ繧ッ繝ェ繝励ち繧定ィュ螳壹@縺ヲ縺翫¥縺ィ縲√◎縺薙↓繧ィ繝ゥ繝シ縺瑚オキ縺阪◆蝣エ謇縺悟コ蜉帙&繧後k繧医≧縺ォ縺ェ繧翫∪縺吶
Q. Hyper Estraier繧Еstraier縺ョ莉悶↓繧よ怏逕ィ縺ェ蜈ィ譁讀懃エ「繧キ繧ケ繝繝縺ッ縺ゅj縺セ縺吶°シ
A. 縺溘¥縺輔s縺ゅj縺セ縺吶ゅが繝シ繝励Φ繧ス繝シ繧ケ陬ス蜩√□縺ィ縲∵オキ螟悶〒縺ッApache LuceneXapianGNU mifluzHarvestSwish-eht://DigmnoGoSearch縺ェ縺ゥ縺梧怏蜷阪〒縺吶よ律譛ャ縺縺ィNamazuRastSennaGETA縺ェ縺ゥ縺梧怏蜷阪〒縺吶

hyperestraier-1.4.13/estbutler.c000066400000000000000000000441261125261632700166570ustar00rootroot00000000000000/************************************************************************************************* * The search helper for the node master * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #include "mastermod.h" /* global variables */ const char *g_progname; /* program name */ /* function prototypes */ int main(int argc, char **argv); static void usage(void); static int runinform(int argc, char **argv); static int runsearch(int argc, char **argv); static int rungetdoc(int argc, char **argv); static int rungetdocattr(int argc, char **argv); static int runetchdoc(int argc, char **argv); static int runuritoid(int argc, char **argv); static int procinform(const char *dbname, const char *outfile); static int procsearch(const char *dbname, CBMAP *params, const char *outfile, const char *myurl, const char *mylabel, int rateuri, int mergemethod, int scoreexpr, int searchmax, int wildmax, int wwidth, int hwidth, int awidth, int scancheck, int smlrvnum); static int procgetdoc(const char *dbname, const char *outfile, int id, const char *uri); static int procgetdocattr(const char *dbname, const char *outfile, int id, const char *uri, const char *attr); static int procetchdoc(const char *dbname, const char *outfile, int id, const char *uri, int knum); static int procuritoid(const char *dbname, const char *outfile, const char *uri); /* main routine */ int main(int argc, char **argv){ const char *tmp; int rv; if((tmp = getenv("ESTDBGFD")) != NULL) dpdbgfd = atoi(tmp); est_proc_env_reset(); g_progname = argv[0]; if(argc < 2) usage(); rv = 0; if(!strcmp(argv[1], "inform")){ rv = runinform(argc, argv); } else if(!strcmp(argv[1], "search")){ rv = runsearch(argc, argv); } else if(!strcmp(argv[1], "getdoc")){ rv = rungetdoc(argc, argv); } else if(!strcmp(argv[1], "getdocattr")){ rv = rungetdocattr(argc, argv); } else if(!strcmp(argv[1], "etchdoc")){ rv = runetchdoc(argc, argv); } else if(!strcmp(argv[1], "uritoid")){ rv = runuritoid(argc, argv); } else { usage(); } return rv; } /* print the usage and exit */ static void usage(void){ fprintf(stderr, "%s: the search helper for the node master\n", g_progname); fprintf(stderr, "\n"); fprintf(stderr, "usage:\n"); fprintf(stderr, " %s inform db outfile\n", g_progname); fprintf(stderr, " %s search db outfile params url label details ...\n", g_progname); fprintf(stderr, " %s getdoc db outfile id uri\n", g_progname); fprintf(stderr, " %s getdocattr db outfile id uri attr\n", g_progname); fprintf(stderr, " %s etchdoc db outfile id uri knum\n", g_progname); fprintf(stderr, " %s uritoid db outfile uri\n", g_progname); fprintf(stderr, "\n"); exit(1); } /* parse arguments of the inform command */ static int runinform(int argc, char **argv){ const char *dbname, *outfile; int rv; if(argc < 4) usage(); dbname = argv[2]; outfile = argv[3]; rv = procinform(dbname, outfile); return 0; } /* parse arguments of the search command */ static int runsearch(int argc, char **argv){ CBMAP *params; const char *dbname, *outfile; char *pbuf, *myurl, *mylabel; int rv, size, scoreexpr, rateuri, mergemethod, searchmax; int wildmax, wwidth, hwidth, awidth, scancheck, smlrvnum; if(argc < 17) usage(); dbname = argv[2]; outfile = argv[3]; pbuf = cbbasedecode(argv[4], &size); params = cbmapload(pbuf, size); myurl = cbbasedecode(argv[5], NULL); mylabel = cbbasedecode(argv[6], NULL); rateuri = atoi(argv[7]); mergemethod = atoi(argv[8]); scoreexpr = atoi(argv[9]); searchmax = atoi(argv[10]); wildmax = atoi(argv[11]); wwidth = atoi(argv[12]); hwidth = atoi(argv[13]); awidth = atoi(argv[14]); scancheck = atoi(argv[15]); smlrvnum = atoi(argv[16]); if(searchmax < 0 || wildmax < 0 || wwidth < 0 || hwidth < 0 || awidth < 0) usage(); rv = procsearch(dbname, params, outfile, myurl, mylabel, rateuri, mergemethod, scoreexpr, searchmax, wildmax, wwidth, hwidth, awidth, scancheck, smlrvnum); free(mylabel); free(myurl); cbmapclose(params); free(pbuf); return rv; } /* parse arguments of the getdoc command */ static int rungetdoc(int argc, char **argv){ const char *dbname, *outfile; char *uri; int id, rv; if(argc < 6) usage(); dbname = argv[2]; outfile = argv[3]; id = atoi(argv[4]); uri = cbbasedecode(argv[5], NULL); rv = procgetdoc(dbname, outfile, id, uri); free(uri); return rv; } /* parse arguments of the getdocattr command */ static int rungetdocattr(int argc, char **argv){ const char *dbname, *outfile; char *uri, *attr; int id, rv; if(argc < 7) usage(); dbname = argv[2]; outfile = argv[3]; id = atoi(argv[4]); uri = cbbasedecode(argv[5], NULL); attr = cbbasedecode(argv[6], NULL); rv = procgetdocattr(dbname, outfile, id, uri, attr); free(uri); free(attr); return rv; } /* parse arguments of the etchdoc command */ static int runetchdoc(int argc, char **argv){ const char *dbname, *outfile; char *uri; int id, knum, rv; if(argc < 7) usage(); dbname = argv[2]; outfile = argv[3]; id = atoi(argv[4]); uri = cbbasedecode(argv[5], NULL); knum = atoi(argv[6]); rv = procetchdoc(dbname, outfile, id, uri, knum); free(uri); return rv; } /* parse arguments of the uritoid command */ static int runuritoid(int argc, char **argv){ const char *dbname, *outfile; char *uri; int rv; if(argc < 5) usage(); dbname = argv[2]; outfile = argv[3]; uri = cbbasedecode(argv[4], NULL); rv = procuritoid(dbname, outfile, uri); free(uri); return rv; } /* perform the inform command */ static int procinform(const char *dbname, const char *outfile){ ESTDB *db; char outbuf[NUMBUFSIZ*3]; int ecode, err; if(!(db = est_db_open(dbname, ESTDBREADER | ESTDBNOLCK, &ecode))) return 1; err = FALSE; sprintf(outbuf, "%d\t%d\t%.0f\n", est_db_doc_num(db), est_db_word_num(db), est_db_size(db)); if(!cbwritefile(outfile, outbuf, -1)) err = TRUE; if(!est_db_close(db, &ecode)) err = TRUE; return err ? 1 : 0; } /* perform the search command */ static int procsearch(const char *dbname, CBMAP *params, const char *outfile, const char *myurl, const char *mylabel, int rateuri, int mergemethod, int scoreexpr, int searchmax, int wildmax, int wwidth, int hwidth, int awidth, int scancheck, int smlrvnum){ RESMAP *resmap; RESDOC **resdocs, *resdoc; ESTDB *db; ESTCOND *cond; ESTDOC *doc; CBMAP *hints, *kwords; const CBLIST *texts; CBLIST *words, *list; CBDATUM *datum; const char *bordstr, *tmp, *kbuf, *vbuf, *phrase, *order, *distinct; char name[NUMBUFSIZ], *snippet; int i, j, ecode, err, max, skip, num, ksiz, vsiz, lmax, cnt, score, down, dnum, wnum; int end, *res, rnum, hnum, id; double curtime, itime, weight, fsiz; if(!(db = est_db_open(dbname, ESTDBREADER | ESTDBNOLCK, &ecode))) return 1; err = FALSE; bordstr = est_border_str(); cond = est_cond_new(); max = DEFMAXSRCH; skip = 0; if((tmp = cbmapget(params, "skip", -1, NULL)) != NULL && (num = atoi(tmp)) > 0) skip = num; if((tmp = cbmapget(params, "phrase", -1, NULL)) != NULL && tmp[0] != '\0') est_cond_set_phrase(cond, tmp); if((tmp = cbmapget(params, "attr", -1, NULL)) != NULL && tmp[0] != '\0') est_cond_add_attr(cond, tmp); for(i = 0; i <= CONDATTRMAX; i++){ num = sprintf(name, "attr%d", i); if((tmp = cbmapget(params, name, num, NULL)) != NULL && tmp[0] != '\0') est_cond_add_attr(cond, tmp); } if((tmp = cbmapget(params, "order", -1, NULL)) != NULL && tmp[0] != '\0') est_cond_set_order(cond, tmp); if((tmp = cbmapget(params, "max", -1, NULL)) != NULL && (num = atoi(tmp)) >= 0) max = num; max = max > searchmax ? searchmax : max; if((tmp = cbmapget(params, "options", -1, NULL)) != NULL && (num = atoi(tmp)) > 0) est_cond_set_options(cond, num); if((tmp = cbmapget(params, "auxiliary", -1, NULL)) != NULL) est_cond_set_auxiliary(cond, atoi(tmp)); if((tmp = cbmapget(params, "distinct", -1, NULL)) != NULL && tmp[0] != '\0') est_cond_set_order(cond, tmp); if((tmp = cbmapget(params, "wwidth", -1, NULL)) != NULL) wwidth = atoi(tmp); if((tmp = cbmapget(params, "hwidth", -1, NULL)) != NULL && (num = atoi(tmp)) >= 0) hwidth = num; if((tmp = cbmapget(params, "awidth", -1, NULL)) != NULL && (num = atoi(tmp)) >= 0) awidth = num; resmap = resmap_new(); hints = cbmapopenex(MINIBNUM); curtime = est_gettimeofday(); lmax = max + skip + 1; est_cond_set_options(cond, ESTCONDSCFB); res = est_db_search(db, cond, &rnum, hints); hnum = (vbuf = cbmapget(hints, "", 0, NULL)) ? atoi(vbuf) : rnum; if(max >= 0 && hnum < max + 1 && est_cond_auxiliary_word(cond, "")){ free(res); est_cond_set_auxiliary(cond, -1); res = est_db_search(db, cond, &rnum, hints); hnum = (vbuf = cbmapget(hints, "", 0, NULL)) ? atoi(vbuf) : rnum; } itime = est_gettimeofday() - curtime; cnt = 0; phrase = est_cond_phrase(cond); rateuri = rateuri && !(phrase && cbstrfwmatch(phrase, ESTOPSIMILAR)); for(i = 0; i < rnum && cnt < lmax; i++){ if(!(doc = est_db_get_doc(db, res[i], 0))) continue; if(scancheck && phrase && phrase[0] != '[' && phrase[0] != '*' && !est_db_scan_doc(db, doc, cond)){ est_doc_delete(doc); continue; } score = est_cond_score(cond, i); if(rateuri && scoreexpr != SE_ASIS){ if((vbuf = est_doc_attr(doc, ESTDATTRURI)) != NULL){ if(score < 100) score = 100; down = 4; if(cbstrfwimatch(vbuf, "file://")){ vbuf += 7; } else if(cbstrfwimatch(vbuf, "ftp://")){ vbuf += 6; } else if(cbstrfwimatch(vbuf, "http://")){ vbuf += 7; } else if(cbstrfwimatch(vbuf, "https://")){ vbuf += 8; } else { down += 3; } while(vbuf[0] != '\0'){ if(vbuf[0] == '?' || vbuf[0] == '#'){ down++; break; } if(vbuf[0] == '/' && vbuf[1] != '\0') down++; vbuf++; } score *= 8.0 / (double)down; } else { score = 0; } } est_doc_add_attr(doc, DATTRNDURL, myurl); est_doc_add_attr(doc, DATTRNDLABEL, mylabel); if(score >= 0){ sprintf(name, "%d", score); est_doc_add_attr(doc, DATTRNDSCORE, name); } if(scoreexpr != SE_ASIS){ weight = 1.0; if((vbuf = est_doc_attr(doc, ESTDATTRWEIGHT)) != NULL){ weight = strtod(vbuf, NULL); weight = weight >= 0.01 ? weight : 0.01; } weight /= 10.0; switch(mergemethod){ case MM_SCORE: score = score * weight; break; case MM_SCRK: score = score * (max * 2 - cnt) * weight; break; case MM_RANK: score = SELFCREDIT * (max - cnt); break; } } resmap_put(resmap, score, doc, NULL, NULL); cnt++; } free(res); words = est_hints_to_words(hints); dnum = est_db_doc_num(db); wnum = est_db_word_num(db); fsiz = est_db_size(db); end = max + skip; curtime = est_gettimeofday() - curtime; datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "%s\n", bordstr); cbdatumprintf(datum, "VERSION\t%s\n", _EST_PROTVER); cbdatumprintf(datum, "NODE\t%s\n", myurl); cbdatumprintf(datum, "HIT\t%d\n", hnum); cbmapiterinit(hints); num = 1; while((kbuf = cbmapiternext(hints, &ksiz)) != NULL){ if(ksiz < 1) continue; cbdatumprintf(datum, "HINT#%d\t%s\t%s\n", num, kbuf, cbmapiterval(kbuf, NULL)); num++; } cbdatumprintf(datum, "DOCNUM\t%d\n", dnum); cbdatumprintf(datum, "WORDNUM\t%d\n", wnum); cbdatumprintf(datum, "TIME\t%.6f\n", curtime / 1000.0); cbdatumprintf(datum, "TIME#i\t%.6f\n", itime / 1000.0); cbdatumprintf(datum, "TIME#0\t%.6f\n", curtime / 1000.0); cbdatumprintf(datum, "LINK#0\t%s\t", myurl); cbdatumprintf(datum, "%s\t%d\t%d\t%d\t%.0f\t%d\n", mylabel, SELFCREDIT, dnum, wnum, fsiz, hnum); cbdatumprintf(datum, "VIEW\tSNIPPET\n"); cbdatumprintf(datum, "\n"); phrase = est_cond_phrase(cond); order = est_cond_order(cond); if(!order && phrase && cbstrfwmatch(phrase, ESTOPSIMILAR)) order = DATTRNDSCORE " " ESTORDNUMD; distinct = est_cond_distinct(cond); resdocs = resmap_list(resmap, &rnum, order, distinct); for(i = skip; i < rnum && i < end; i++){ resdoc = resdocs[i]; if(!resdoc->doc) continue; cbdatumprintf(datum, "%s\n", bordstr); list = est_doc_attr_names(resdoc->doc); for(j = 0; j < cblistnum(list); j++){ vbuf = cblistval(list, j, NULL); cbdatumprintf(datum, "%s=%s\n", vbuf, est_doc_attr(resdoc->doc, vbuf)); } cblistclose(list); if(smlrvnum > 0){ cbdatumprintf(datum, "%s", ESTDCNTLVECTOR); id = est_doc_id(resdoc->doc); kwords = id > 0 ? est_db_get_keywords(db, id) : NULL; if(!kwords) kwords = est_db_etch_doc(db, resdoc->doc, smlrvnum); cbmapiterinit(kwords); while((kbuf = cbmapiternext(kwords, &ksiz)) != NULL){ cbdatumcat(datum, "\t", 1); cbdatumcat(datum, kbuf, ksiz); cbdatumcat(datum, "\t", 1); vbuf = cbmapiterval(kbuf, &vsiz); cbdatumcat(datum, vbuf, vsiz); } cbmapclose(kwords); cbdatumcat(datum, "\n", 1); } cbdatumcat(datum, "\n", 1); if(wwidth < 0){ texts = est_doc_texts(resdoc->doc); for(j = 0; j < cblistnum(texts); j++){ vbuf = cblistval(texts, j, &vsiz); cbdatumcat(datum, vbuf, vsiz); cbdatumcat(datum, "\n", 1); } vbuf = est_doc_hidden_texts(resdoc->doc); if(vbuf[0] != '\0') cbdatumprintf(datum, "\t%s\n", vbuf); } else if(wwidth > 0){ snippet = est_doc_make_snippet(resdoc->doc, words, wwidth, hwidth, awidth); cbdatumcat(datum, snippet, -1); free(snippet); } } free(resdocs); cbdatumprintf(datum, "%s:END\n", bordstr); if(!cbwritefile(outfile, cbdatumptr(datum), cbdatumsize(datum))) err = TRUE; cbdatumclose(datum); cblistclose(words); cbmapclose(hints); resmap_delete(resmap); est_cond_delete(cond); if(!est_db_close(db, &ecode)) err = TRUE; return err ? 1 : 0; } /* perform the getdoc command */ static int procgetdoc(const char *dbname, const char *outfile, int id, const char *uri){ ESTDB *db; ESTDOC *doc; char *draft; int ecode, err; if(!(db = est_db_open(dbname, ESTDBREADER | ESTDBNOLCK, &ecode))) return 1; err = FALSE; if(id < 1) id = est_db_uri_to_id(db, uri); if(id > 0 && (doc = est_db_get_doc(db, id, 0)) != NULL){ draft = est_doc_dump_draft(doc); est_doc_delete(doc); } else { draft = cbmemdup("", 0); } if(!cbwritefile(outfile, draft, -1)) err = TRUE; free(draft); if(!est_db_close(db, &ecode)) err = TRUE; return err ? 1 : 0; } /* perform the getdocattr command */ static int procgetdocattr(const char *dbname, const char *outfile, int id, const char *uri, const char *attr){ ESTDB *db; char *value; int ecode, err; if(!(db = est_db_open(dbname, ESTDBREADER | ESTDBNOLCK, &ecode))) return 1; err = FALSE; if(id < 1) id = est_db_uri_to_id(db, uri); if(id > 0 && (value = est_db_get_doc_attr(db, id, attr)) != NULL){ value = cbrealloc(value, strlen(value) + 2); strcat(value, "\n"); } else { value = cbmemdup("", 0); } if(!cbwritefile(outfile, value, -1)) err = TRUE; free(value); if(!est_db_close(db, &ecode)) err = TRUE; return err ? 1 : 0; } /* perform the etchdoc command */ static int procetchdoc(const char *dbname, const char *outfile, int id, const char *uri, int knum){ ESTDB *db; ESTDOC *doc; CBMAP *kwords; CBDATUM *outbuf; const char *kbuf, *vbuf; int ecode, err, ksiz, vsiz; if(!(db = est_db_open(dbname, ESTDBREADER | ESTDBNOLCK, &ecode))) return 1; err = FALSE; outbuf = cbdatumopen(NULL, -1); if(id < 1) id = est_db_uri_to_id(db, uri); if(id > 0 && (kwords = est_db_get_keywords(db, id)) != NULL){ cbmapiterinit(kwords); while((kbuf = cbmapiternext(kwords, &ksiz)) != NULL){ vbuf = cbmapiterval(kbuf, &vsiz); cbdatumcat(outbuf, kbuf, ksiz); cbdatumcat(outbuf, "\t", 1); cbdatumcat(outbuf, vbuf, vsiz); cbdatumcat(outbuf, "\n", 1); } cbmapclose(kwords); } else if(id > 0 && (doc = est_db_get_doc(db, id, 0)) != NULL){ kwords = est_db_etch_doc(db, doc, knum > 0 ? knum : 32); cbmapiterinit(kwords); while((kbuf = cbmapiternext(kwords, &ksiz)) != NULL){ vbuf = cbmapiterval(kbuf, &vsiz); cbdatumcat(outbuf, kbuf, ksiz); cbdatumcat(outbuf, "\t", 1); cbdatumcat(outbuf, vbuf, vsiz); cbdatumcat(outbuf, "\n", 1); } cbmapclose(kwords); est_doc_delete(doc); } if(!cbwritefile(outfile, cbdatumptr(outbuf), cbdatumsize(outbuf))) err = TRUE; cbdatumclose(outbuf); if(!est_db_close(db, &ecode)) err = TRUE; return err ? 1 : 0; } /* perform the uritoid command */ static int procuritoid(const char *dbname, const char *outfile, const char *uri){ ESTDB *db; char outbuf[NUMBUFSIZ]; int ecode, err, id; if(!(db = est_db_open(dbname, ESTDBREADER | ESTDBNOLCK, &ecode))) return 1; err = FALSE; if((id = est_db_uri_to_id(db, uri)) > 0){ sprintf(outbuf, "%d\n", id); } else { outbuf[0] = '\0'; err = TRUE; } if(!cbwritefile(outfile, outbuf, -1)) err = TRUE; if(!est_db_close(db, &ecode)) err = TRUE; return err ? 1 : 0; } /* END OF FILE */ hyperestraier-1.4.13/estcall.c000066400000000000000000001312261125261632700162730ustar00rootroot00000000000000/************************************************************************************************* * The command line interface for the node API * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #include "estraier.h" #include "estmtdb.h" #include "estnode.h" #include "myconf.h" #define NUMBUFSIZ 32 /* size of a buffer for a number */ #define IOBUFSIZ 8192 /* size of a buffer for I/O */ #define MINIBNUM 31 /* bucket number of a small map */ #define RESLIMSIZE (1048576*128) /* limitation of the entity body of response */ #define SEARCHMAX 10 /* maximum number of shown documents */ #define SEARCHAUX 32 /* minimum hits to adopt the auxiliary index */ #define DATTRNDURL "#nodeurl" /* name of the pseudo-attribute of the node URL */ #define DATTRNDSCORE "#nodescore" /* name of the pseudo-attribute of the node score */ enum { /* enumeration for informing modes */ IM_BASIC, /* basical information */ IM_ADMINS, /* list of administrators */ IM_USERS, /* list of users */ IM_LINKS /* list of links */ }; enum { /* enumeration for viewing modes */ VM_PROT, /* protocol simulation */ VM_URI, /* ID and URI */ VM_XML /* XML */ }; /* global variables */ const char *g_progname = NULL; /* program name */ const char *g_pxhost = NULL; /* host name of the proxy */ int g_pxport = 0; /* host name of the proxy */ int g_timeout = -1; /* timeout in seconds */ const char *g_authname = NULL; /* name of authority */ const char *g_authpass = NULL; /* password of authority */ int g_infomode = IM_BASIC; /* informing mode */ int g_viewmode = VM_PROT; /* viewing mode */ int g_nonparse = FALSE; /* whether to output response headers */ CBLIST *g_exheaders = NULL; /* extension headers */ /* function prototypes */ int main(int argc, char **argv); static void usage(void); static void printferror(const char *format, ...); static int runput(int argc, char **argv); static int runout(int argc, char **argv); static int runedit(int argc, char **argv); static int runget(int argc, char **argv); static int runetch(int argc, char **argv); static int runuriid(int argc, char **argv); static int runinform(int argc, char **argv); static int runsync(int argc, char **argv); static int runoptimize(int argc, char **argv); static int runsearch(int argc, char **argv); static int runlist(int argc, char **argv); static int runsetuser(int argc, char **argv); static int runsetlink(int argc, char **argv); static int runraw(int argc, char **argv); static void xmlprintf(const char *format, ...); static int procput(const char *nurl, const char *file); static int procout(const char *nurl, int id, const char *uri); static int procedit(const char *nurl, int id, const char *uri, const char *name, const char *value); static int procget(const char *nurl, int id, const char *uri, const char *attr); static int procetch(const char *nurl, int id, const char *uri); static int procuriid(const char *nurl, const char *uri); static int procinform(const char *nurl); static int procsync(const char *nurl); static int procoptimize(const char *nurl); static int procsearch(const char *nurl, const char *phrase, const CBLIST *attrs, const char *ord, int max, int sk, int aux, int opts, int depth, int mask, double ec, const char *dis); static int proclist(const char *nurl); static int procsetuser(const char *nurl, const char *name, int mode); static int procsetlink(const char *nurl, const char *url, const char *label, int credit); static int procraw(const char *url, const char *file); /* main routine */ int main(int argc, char **argv){ int rv; est_proc_env_reset(); g_progname = argv[0]; if(!est_init_net_env()){ printferror("could not initialize network environment"); exit(1); } atexit(est_free_net_env); if(argc < 2) usage(); rv = 0; if(!strcmp(argv[1], "put")){ rv = runput(argc, argv); } else if(!strcmp(argv[1], "out")){ rv = runout(argc, argv); } else if(!strcmp(argv[1], "edit")){ rv = runedit(argc, argv); } else if(!strcmp(argv[1], "get")){ rv = runget(argc, argv); } else if(!strcmp(argv[1], "etch")){ rv = runetch(argc, argv); } else if(!strcmp(argv[1], "uriid")){ rv = runuriid(argc, argv); } else if(!strcmp(argv[1], "inform")){ rv = runinform(argc, argv); } else if(!strcmp(argv[1], "sync")){ rv = runsync(argc, argv); } else if(!strcmp(argv[1], "optimize")){ rv = runoptimize(argc, argv); } else if(!strcmp(argv[1], "search")){ rv = runsearch(argc, argv); } else if(!strcmp(argv[1], "list")){ rv = runlist(argc, argv); } else if(!strcmp(argv[1], "setuser")){ rv = runsetuser(argc, argv); } else if(!strcmp(argv[1], "setlink")){ rv = runsetlink(argc, argv); } else if(!strcmp(argv[1], "raw")){ rv = runraw(argc, argv); } else { usage(); } return rv; } /* print the usage and exit */ static void usage(void){ fprintf(stderr, "%s: command line utility for the node API of Hyper Estraier\n", g_progname); fprintf(stderr, "\n"); fprintf(stderr, "usage:\n"); fprintf(stderr, " %s put [-proxy host port] [-tout num] [-auth user pass]" " nurl [file]\n", g_progname); fprintf(stderr, " %s out [-proxy host port] [-tout num] [-auth user pass]" " nurl expr\n", g_progname); fprintf(stderr, " %s edit [-proxy host port] [-tout num] [-auth user pass]" " nurl expr name [value]\n", g_progname); fprintf(stderr, " %s get [-proxy host port] [-tout num] [-auth user pass]" " nurl expr [attr]\n", g_progname); fprintf(stderr, " %s etch [-proxy host port] [-tout num] [-auth user pass]" " nurl expr\n", g_progname); fprintf(stderr, " %s uriid [-proxy host port] [-tout num] [-auth user pass]" " nurl uri\n", g_progname); fprintf(stderr, " %s inform [-proxy host port] [-tout num] [-auth user pass]" " [-ia|-iu|-il] nurl\n", g_progname); fprintf(stderr, " %s sync [-proxy host port] [-tout num] [-auth user pass]" " nurl\n", g_progname); fprintf(stderr, " %s optimize [-proxy host port] [-tout num] [-auth user pass]" " nurl\n", g_progname); fprintf(stderr, " %s search [-proxy host port] [-tout num] [-auth user pass]" " [-vu|-vx] [-ec rn] [-sf] [-attr expr] [-ord expr] [-max num] [-sk num] [-aux num]" " [-dis name] [-dpt num] [-mask num] nurl [phrase]\n", g_progname); fprintf(stderr, " %s list [-proxy host port] [-tout num] [-auth user pass]" " nurl\n", g_progname); fprintf(stderr, " %s setuser [-proxy host port] [-tout num] [-auth user pass]" " nurl name mode\n", g_progname); fprintf(stderr, " %s setlink [-proxy host port] [-tout num] [-auth user pass]" " nurl url label credit\n", g_progname); fprintf(stderr, " %s raw [-proxy host port] [-tout num] [-auth user pass] [-np] [-eh expr]" " url [file]\n", g_progname); fprintf(stderr, "\n"); exit(1); } /* print formatted error string and flush the buffer */ static void printferror(const char *format, ...){ va_list ap; va_start(ap, format); fprintf(stderr, "%s: ERROR: ", g_progname); vfprintf(stderr, format, ap); fputc('\n', stderr); fflush(stderr); va_end(ap); } /* parse arguments of the put command */ static int runput(int argc, char **argv){ char *nurl, *file; int i, rv; nurl = NULL; file = NULL; for(i = 2; i < argc; i++){ if(!nurl && argv[i][0] == '-'){ if(!strcmp(argv[i], "-proxy")){ if(++i >= argc) usage(); g_pxhost = argv[i]; if(++i >= argc) usage(); g_pxport = atoi(argv[i]); } else if(!strcmp(argv[i], "-tout")){ if(++i >= argc) usage(); g_timeout = atoi(argv[i]); } else if(!strcmp(argv[i], "-auth")){ if(++i >= argc) usage(); g_authname = argv[i]; if(++i >= argc) usage(); g_authpass = argv[i]; } else { usage(); } } else if(!nurl){ nurl = argv[i]; } else if(!file){ file = argv[i]; } else { usage(); } } if(!nurl) usage(); rv = procput(nurl, file); return rv; } /* parse arguments of the out command */ static int runout(int argc, char **argv){ char *nurl, *expr; int i, id, rv; nurl = NULL; expr = NULL; id = 0; for(i = 2; i < argc; i++){ if(!nurl && argv[i][0] == '-'){ if(!strcmp(argv[i], "-proxy")){ if(++i >= argc) usage(); g_pxhost = argv[i]; if(++i >= argc) usage(); g_pxport = atoi(argv[i]); } else if(!strcmp(argv[i], "-tout")){ if(++i >= argc) usage(); g_timeout = atoi(argv[i]); } else if(!strcmp(argv[i], "-auth")){ if(++i >= argc) usage(); g_authname = argv[i]; if(++i >= argc) usage(); g_authpass = argv[i]; } else { usage(); } } else if(!nurl){ nurl = argv[i]; } else if(!expr){ expr = argv[i]; } else { usage(); } } if(!nurl || !expr) usage(); if((id = atoi(expr)) > 0) expr = NULL; rv = procout(nurl, id, expr); return rv; } /* parse arguments of the edit command */ static int runedit(int argc, char **argv){ char *nurl, *expr, *name, *value; int i, id, rv; nurl = NULL; expr = NULL; name = NULL; value = NULL; id = 0; for(i = 2; i < argc; i++){ if(!nurl && argv[i][0] == '-'){ if(!strcmp(argv[i], "-proxy")){ if(++i >= argc) usage(); g_pxhost = argv[i]; if(++i >= argc) usage(); g_pxport = atoi(argv[i]); } else if(!strcmp(argv[i], "-tout")){ if(++i >= argc) usage(); g_timeout = atoi(argv[i]); } else if(!strcmp(argv[i], "-auth")){ if(++i >= argc) usage(); g_authname = argv[i]; if(++i >= argc) usage(); g_authpass = argv[i]; } else { usage(); } } else if(!nurl){ nurl = argv[i]; } else if(!expr){ expr = argv[i]; } else if(!name){ name = argv[i]; } else if(!value){ value = argv[i]; } else { usage(); } } if(!nurl || !expr || !name) usage(); if((id = atoi(expr)) > 0) expr = NULL; rv = procedit(nurl, id, expr, name, value); return rv; } /* parse arguments of the get command */ static int runget(int argc, char **argv){ char *nurl, *expr, *attr; int i, id, rv; nurl = NULL; expr = NULL; attr = NULL; for(i = 2; i < argc; i++){ if(!nurl && argv[i][0] == '-'){ if(!strcmp(argv[i], "-proxy")){ if(++i >= argc) usage(); g_pxhost = argv[i]; if(++i >= argc) usage(); g_pxport = atoi(argv[i]); } else if(!strcmp(argv[i], "-tout")){ if(++i >= argc) usage(); g_timeout = atoi(argv[i]); } else if(!strcmp(argv[i], "-auth")){ if(++i >= argc) usage(); g_authname = argv[i]; if(++i >= argc) usage(); g_authpass = argv[i]; } else { usage(); } } else if(!nurl){ nurl = argv[i]; } else if(!expr){ expr = argv[i]; } else if(!attr){ attr = argv[i]; } else { usage(); } } if(!nurl || !expr) usage(); if((id = atoi(expr)) > 0) expr = NULL; rv = procget(nurl, id, expr, attr); return rv; } /* parse arguments of the etch command */ static int runetch(int argc, char **argv){ char *nurl, *expr; int i, id, rv; nurl = NULL; expr = NULL; for(i = 2; i < argc; i++){ if(!nurl && argv[i][0] == '-'){ if(!strcmp(argv[i], "-proxy")){ if(++i >= argc) usage(); g_pxhost = argv[i]; if(++i >= argc) usage(); g_pxport = atoi(argv[i]); } else if(!strcmp(argv[i], "-tout")){ if(++i >= argc) usage(); g_timeout = atoi(argv[i]); } else if(!strcmp(argv[i], "-auth")){ if(++i >= argc) usage(); g_authname = argv[i]; if(++i >= argc) usage(); g_authpass = argv[i]; } else { usage(); } } else if(!nurl){ nurl = argv[i]; } else if(!expr){ expr = argv[i]; } else { usage(); } } if(!nurl || !expr) usage(); if((id = atoi(expr)) > 0) expr = NULL; rv = procetch(nurl, id, expr); return rv; } /* parse arguments of the uriid command */ static int runuriid(int argc, char **argv){ char *nurl, *uri; int i, rv; nurl = NULL; uri = NULL; for(i = 2; i < argc; i++){ if(!nurl && argv[i][0] == '-'){ if(!strcmp(argv[i], "-proxy")){ if(++i >= argc) usage(); g_pxhost = argv[i]; if(++i >= argc) usage(); g_pxport = atoi(argv[i]); } else if(!strcmp(argv[i], "-tout")){ if(++i >= argc) usage(); g_timeout = atoi(argv[i]); } else if(!strcmp(argv[i], "-auth")){ if(++i >= argc) usage(); g_authname = argv[i]; if(++i >= argc) usage(); g_authpass = argv[i]; } else { usage(); } } else if(!nurl){ nurl = argv[i]; } else if(!uri){ uri = argv[i]; } else { usage(); } } if(!nurl || !uri) usage(); rv = procuriid(nurl, uri); return rv; } /* parse arguments of the inform command */ static int runinform(int argc, char **argv){ char *nurl; int i, rv; nurl = NULL; for(i = 2; i < argc; i++){ if(!nurl && argv[i][0] == '-'){ if(!strcmp(argv[i], "-proxy")){ if(++i >= argc) usage(); g_pxhost = argv[i]; if(++i >= argc) usage(); g_pxport = atoi(argv[i]); } else if(!strcmp(argv[i], "-tout")){ if(++i >= argc) usage(); g_timeout = atoi(argv[i]); } else if(!strcmp(argv[i], "-auth")){ if(++i >= argc) usage(); g_authname = argv[i]; if(++i >= argc) usage(); g_authpass = argv[i]; } else if(!strcmp(argv[i], "-ia")){ g_infomode = IM_ADMINS; } else if(!strcmp(argv[i], "-iu")){ g_infomode = IM_USERS; } else if(!strcmp(argv[i], "-il")){ g_infomode = IM_LINKS; } else { usage(); } } else if(!nurl){ nurl = argv[i]; } else { usage(); } } if(!nurl) usage(); rv = procinform(nurl); return rv; } /* parse arguments of the sync command */ static int runsync(int argc, char **argv){ char *nurl; int i, rv; nurl = NULL; for(i = 2; i < argc; i++){ if(!nurl && argv[i][0] == '-'){ if(!strcmp(argv[i], "-proxy")){ if(++i >= argc) usage(); g_pxhost = argv[i]; if(++i >= argc) usage(); g_pxport = atoi(argv[i]); } else if(!strcmp(argv[i], "-tout")){ if(++i >= argc) usage(); g_timeout = atoi(argv[i]); } else if(!strcmp(argv[i], "-auth")){ if(++i >= argc) usage(); g_authname = argv[i]; if(++i >= argc) usage(); g_authpass = argv[i]; } else { usage(); } } else if(!nurl){ nurl = argv[i]; } else { usage(); } } if(!nurl) usage(); rv = procsync(nurl); return rv; } /* parse arguments of the optimize command */ static int runoptimize(int argc, char **argv){ char *nurl; int i, rv; nurl = NULL; for(i = 2; i < argc; i++){ if(!nurl && argv[i][0] == '-'){ if(!strcmp(argv[i], "-proxy")){ if(++i >= argc) usage(); g_pxhost = argv[i]; if(++i >= argc) usage(); g_pxport = atoi(argv[i]); } else if(!strcmp(argv[i], "-tout")){ if(++i >= argc) usage(); g_timeout = atoi(argv[i]); } else if(!strcmp(argv[i], "-auth")){ if(++i >= argc) usage(); g_authname = argv[i]; if(++i >= argc) usage(); g_authpass = argv[i]; } else { usage(); } } else if(!nurl){ nurl = argv[i]; } else { usage(); } } if(!nurl) usage(); rv = procoptimize(nurl); return rv; } /* parse arguments of the search command */ static int runsearch(int argc, char **argv){ CBDATUM *pbuf; CBLIST *attrs; char *nurl, *ord, *dis; int i, max, sk, aux, opts, depth, mask, rv; double ec; nurl = NULL; ord = NULL; dis = NULL; max = SEARCHMAX; sk = 0; aux = SEARCHAUX; opts = 0; depth = 0; mask = 0; ec = -1.0; pbuf = cbdatumopen(NULL, -1); cbglobalgc(pbuf, (void (*)(void *))cbdatumclose); attrs = cblistopen(); cbglobalgc(attrs, (void (*)(void *))cblistclose); for(i = 2; i < argc; i++){ if(!nurl && argv[i][0] == '-'){ if(!strcmp(argv[i], "-proxy")){ if(++i >= argc) usage(); g_pxhost = argv[i]; if(++i >= argc) usage(); g_pxport = atoi(argv[i]); } else if(!strcmp(argv[i], "-tout")){ if(++i >= argc) usage(); g_timeout = atoi(argv[i]); } else if(!strcmp(argv[i], "-auth")){ if(++i >= argc) usage(); g_authname = argv[i]; if(++i >= argc) usage(); g_authpass = argv[i]; } else if(!strcmp(argv[i], "-vu")){ g_viewmode = VM_URI; } else if(!strcmp(argv[i], "-vx")){ g_viewmode = VM_XML; } else if(!strcmp(argv[i], "-ec")){ if(++i >= argc) usage(); ec = strtod(argv[i], NULL); } else if(!strcmp(argv[i], "-sf")){ opts |= ESTCONDSIMPLE; } else if(!strcmp(argv[i], "-attr")){ if(++i >= argc) usage(); cblistpush(attrs, argv[i], -1); } else if(!strcmp(argv[i], "-ord")){ if(++i >= argc) usage(); ord = argv[i]; } else if(!strcmp(argv[i], "-max")){ if(++i >= argc) usage(); max = atoi(argv[i]); } else if(!strcmp(argv[i], "-sk")){ if(++i >= argc) usage(); sk = atoi(argv[i]); } else if(!strcmp(argv[i], "-aux")){ if(++i >= argc) usage(); aux = atoi(argv[i]); } else if(!strcmp(argv[i], "-dis")){ if(++i >= argc) usage(); dis = argv[i]; } else if(!strcmp(argv[i], "-dpt")){ if(++i >= argc) usage(); depth = atoi(argv[i]); } else if(!strcmp(argv[i], "-mask")){ if(++i >= argc) usage(); mask = atoi(argv[i]); } else { usage(); } } else if(!nurl){ nurl = argv[i]; } else { if(cbdatumsize(pbuf) > 0) cbdatumcat(pbuf, " ", 1); cbdatumcat(pbuf, argv[i], -1); } } if(!nurl || depth < 0) usage(); rv = procsearch(nurl, cbdatumptr(pbuf), attrs, ord, max, sk, aux, opts, depth, mask, ec, dis); return rv; } /* parse arguments of the list command */ static int runlist(int argc, char **argv){ char *nurl; int i, rv; nurl = NULL; for(i = 2; i < argc; i++){ if(!nurl && argv[i][0] == '-'){ if(!strcmp(argv[i], "-proxy")){ if(++i >= argc) usage(); g_pxhost = argv[i]; if(++i >= argc) usage(); g_pxport = atoi(argv[i]); } else if(!strcmp(argv[i], "-tout")){ if(++i >= argc) usage(); g_timeout = atoi(argv[i]); } else if(!strcmp(argv[i], "-auth")){ if(++i >= argc) usage(); g_authname = argv[i]; if(++i >= argc) usage(); g_authpass = argv[i]; } else { usage(); } } else if(!nurl){ nurl = argv[i]; } else { usage(); } } if(!nurl) usage(); rv = proclist(nurl); return rv; } /* parse arguments of the setuser command */ static int runsetuser(int argc, char **argv){ char *nurl, *name, *mstr; int i, mode, rv; nurl = NULL; name = NULL; mstr = NULL; mode = 0; for(i = 2; i < argc; i++){ if(!nurl && argv[i][0] == '-'){ if(!strcmp(argv[i], "-proxy")){ if(++i >= argc) usage(); g_pxhost = argv[i]; if(++i >= argc) usage(); g_pxport = atoi(argv[i]); } else if(!strcmp(argv[i], "-tout")){ if(++i >= argc) usage(); g_timeout = atoi(argv[i]); } else if(!strcmp(argv[i], "-auth")){ if(++i >= argc) usage(); g_authname = argv[i]; if(++i >= argc) usage(); g_authpass = argv[i]; } else { usage(); } } else if(!nurl){ nurl = argv[i]; } else if(!name){ name = argv[i]; } else if(!mstr){ mstr = argv[i]; } else { usage(); } } if(!nurl || !name || !mstr || (mode = atoi(mstr)) < 0) usage(); rv = procsetuser(nurl, name, mode); return rv; } /* parse arguments of the setlink command */ static int runsetlink(int argc, char **argv){ char *nurl, *url, *label, *cstr; int i, credit, rv; nurl = NULL; url = NULL; label = NULL; cstr = NULL; for(i = 2; i < argc; i++){ if(!nurl && argv[i][0] == '-'){ if(!strcmp(argv[i], "-proxy")){ if(++i >= argc) usage(); g_pxhost = argv[i]; if(++i >= argc) usage(); g_pxport = atoi(argv[i]); } else if(!strcmp(argv[i], "-tout")){ if(++i >= argc) usage(); g_timeout = atoi(argv[i]); } else if(!strcmp(argv[i], "-auth")){ if(++i >= argc) usage(); g_authname = argv[i]; if(++i >= argc) usage(); g_authpass = argv[i]; } else { usage(); } } else if(!nurl){ nurl = argv[i]; } else if(!url){ url = argv[i]; } else if(!label){ label = argv[i]; } else if(!cstr){ cstr = argv[i]; } else { usage(); } } if(!nurl || !url || !label || !cstr) usage(); credit = atoi(cstr); rv = procsetlink(nurl, url, label, credit); return rv; } /* parse arguments of the raw command */ static int runraw(int argc, char **argv){ char *url, *file; int i, rv; g_exheaders = cblistopen(); cbglobalgc(g_exheaders, (void (*)(void *))cblistclose); url = NULL; file = NULL; for(i = 2; i < argc; i++){ if(!url && argv[i][0] == '-'){ if(!strcmp(argv[i], "-proxy")){ if(++i >= argc) usage(); g_pxhost = argv[i]; if(++i >= argc) usage(); g_pxport = atoi(argv[i]); } else if(!strcmp(argv[i], "-tout")){ if(++i >= argc) usage(); g_timeout = atoi(argv[i]); } else if(!strcmp(argv[i], "-auth")){ if(++i >= argc) usage(); g_authname = argv[i]; if(++i >= argc) usage(); g_authpass = argv[i]; } else if(!strcmp(argv[i], "-np")){ g_nonparse = TRUE; } else if(!strcmp(argv[i], "-eh")){ if(++i >= argc) usage(); cblistpush(g_exheaders, argv[i], -1); } else { usage(); } } else if(!url){ url = argv[i]; } else if(!file){ file = argv[i]; } else { usage(); } } if(!url) usage(); rv = procraw(url, file); return rv; } /* output escaped string */ static void xmlprintf(const char *format, ...){ va_list ap; char *tmp, cbuf[32]; unsigned char c; int cblen; va_start(ap, format); while(*format != '\0'){ if(*format == '%'){ cbuf[0] = '%'; cblen = 1; format++; while(strchr("0123456789 .+-", *format) && *format != '\0' && cblen < sizeof(cbuf) - 1){ cbuf[cblen++] = *format; format++; } cbuf[cblen++] = *format; cbuf[cblen] = '\0'; switch(*format){ case 's': tmp = va_arg(ap, char *); if(!tmp) tmp = "(null)"; printf(cbuf, tmp); break; case 'd': printf(cbuf, va_arg(ap, int)); break; case 'o': case 'u': case 'x': case 'X': case 'c': printf(cbuf, va_arg(ap, unsigned int)); break; case 'e': case 'E': case 'f': case 'g': case 'G': printf(cbuf, va_arg(ap, double)); break; case '@': tmp = va_arg(ap, char *); if(!tmp) tmp = "(null)"; while(*tmp){ switch(*tmp){ case '&': printf("&"); break; case '<': printf("<"); break; case '>': printf(">"); break; case '"': printf("""); break; default: if(!((*tmp >= 0 && *tmp <= 0x8) || (*tmp >= 0x0e && *tmp <= 0x1f))) putchar(*tmp); break; } tmp++; } break; case '?': tmp = va_arg(ap, char *); if(!tmp) tmp = "(null)"; while(*tmp){ c = *(unsigned char *)tmp; if((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || (c != '\0' && strchr("_-.", c))){ putchar(c); } else { printf("%%%02X", c); } tmp++; } break; case '%': putchar('%'); break; } } else { putchar(*format); } format++; } va_end(ap); } /* perform the put command */ static int procput(const char *nurl, const char *file){ ESTNODE *node; ESTDOC *doc; char *draft; int err; if(!(draft = cbreadfile(file, NULL))){ printferror("%s: could not open", file ? file : "(stdin)"); return 1; } err = FALSE; node = est_node_new(nurl); if(g_pxhost && g_pxport > 0) est_node_set_proxy(node, g_pxhost, g_pxport); if(g_timeout >= 0) est_node_set_timeout(node, g_timeout); if(g_authname && g_authpass) est_node_set_auth(node, g_authname, g_authpass); doc = est_doc_new_from_draft(draft); if(!est_node_put_doc(node, doc)){ printferror("failed: %d", est_node_status(node)); err = TRUE; } est_doc_delete(doc); est_node_delete(node); free(draft); return err ? 1 : 0; } /* perform the out command */ static int procout(const char *nurl, int id, const char *uri){ ESTNODE *node; int err; err = FALSE; node = est_node_new(nurl); if(g_pxhost && g_pxport > 0) est_node_set_proxy(node, g_pxhost, g_pxport); if(g_timeout >= 0) est_node_set_timeout(node, g_timeout); if(g_authname && g_authpass) est_node_set_auth(node, g_authname, g_authpass); if(uri ? !est_node_out_doc_by_uri(node, uri) : !est_node_out_doc(node, id)){ printferror("failed: %d", est_node_status(node)); err = TRUE; } est_node_delete(node); return err ? 1 : 0; } /* perform the edit command */ static int procedit(const char *nurl, int id, const char *uri, const char *name, const char *value){ ESTNODE *node; ESTDOC *doc; int err; err = FALSE; node = est_node_new(nurl); if(g_pxhost && g_pxport > 0) est_node_set_proxy(node, g_pxhost, g_pxport); if(g_timeout >= 0) est_node_set_timeout(node, g_timeout); if(g_authname && g_authpass) est_node_set_auth(node, g_authname, g_authpass); if((doc = uri ? est_node_get_doc_by_uri(node, uri) : est_node_get_doc(node, id)) != NULL){ est_doc_add_attr(doc, name, value); if(!(est_node_edit_doc(node, doc))){ printferror("failed: %d", est_node_status(node)); err = TRUE; } est_doc_delete(doc); } else { printferror("failed: %d", est_node_status(node)); err = TRUE; } est_node_delete(node); return err ? 1 : 0; } /* perform the get command */ static int procget(const char *nurl, int id, const char *uri, const char *attr){ ESTNODE *node; ESTDOC *doc; char *draft; int err; err = FALSE; node = est_node_new(nurl); if(g_pxhost && g_pxport > 0) est_node_set_proxy(node, g_pxhost, g_pxport); if(g_timeout >= 0) est_node_set_timeout(node, g_timeout); if(g_authname && g_authpass) est_node_set_auth(node, g_authname, g_authpass); err = FALSE; if(attr){ if((draft = uri ? est_node_get_doc_attr_by_uri(node, uri, attr) : est_node_get_doc_attr(node, id, attr)) != NULL){ printf("%s\n", draft); free(draft); } else { printferror("failed: %d", est_node_status(node)); err = TRUE; } } else { if((doc = uri ? est_node_get_doc_by_uri(node, uri) : est_node_get_doc(node, id)) != NULL){ draft = est_doc_dump_draft(doc); printf("%s", draft); free(draft); est_doc_delete(doc); } else { printferror("failed: %d", est_node_status(node)); err = TRUE; } } est_node_delete(node); return err ? 1 : 0; } /* perform the etch command */ static int procetch(const char *nurl, int id, const char *uri){ ESTNODE *node; CBMAP *kwords; const char *kbuf; int err, ksiz; err = FALSE; node = est_node_new(nurl); if(g_pxhost && g_pxport > 0) est_node_set_proxy(node, g_pxhost, g_pxport); if(g_timeout >= 0) est_node_set_timeout(node, g_timeout); if(g_authname && g_authpass) est_node_set_auth(node, g_authname, g_authpass); err = FALSE; if((kwords = uri ? est_node_etch_doc_by_uri(node, uri) : est_node_etch_doc(node, id)) != NULL){ cbmapiterinit(kwords); while((kbuf = cbmapiternext(kwords, &ksiz)) != NULL){ printf("%s\t%s\n", kbuf, cbmapget(kwords, kbuf, ksiz, NULL)); } cbmapclose(kwords); } else { printferror("failed: %d", est_node_status(node)); err = TRUE; } est_node_delete(node); return err ? 1 : 0; } /* perform the uriid command */ static int procuriid(const char *nurl, const char *uri){ ESTNODE *node; int err, id; err = FALSE; node = est_node_new(nurl); if(g_pxhost && g_pxport > 0) est_node_set_proxy(node, g_pxhost, g_pxport); if(g_timeout >= 0) est_node_set_timeout(node, g_timeout); if(g_authname && g_authpass) est_node_set_auth(node, g_authname, g_authpass); err = FALSE; if((id = est_node_uri_to_id(node, uri)) != -1){ printf("%d\n", id); } else { printferror("failed: %d", est_node_status(node)); err = TRUE; } est_node_delete(node); return err ? 1 : 0; } /* perform the inform command */ static int procinform(const char *nurl){ ESTNODE *node; const CBLIST *admins, *users, *links; const char *name, *label; int i, err, dnum, wnum; double size, ratio; err = FALSE; node = est_node_new(nurl); if(g_pxhost && g_pxport > 0) est_node_set_proxy(node, g_pxhost, g_pxport); if(g_timeout >= 0) est_node_set_timeout(node, g_timeout); if(g_authname && g_authpass) est_node_set_auth(node, g_authname, g_authpass); err = FALSE; name = est_node_name(node); label = est_node_label(node); dnum = est_node_doc_num(node); wnum = est_node_word_num(node); size = est_node_size(node); ratio = est_node_cache_usage(node); admins = est_node_admins(node); users = est_node_users(node); links = est_node_links(node); if(name && label && dnum >= 0 && wnum >= 0 && size >= 0.0 && ratio >= 0.0 && admins && users && links){ switch(g_infomode){ default: printf("%s\t%s\t%d\t%d\t%.0f\t%.6f\n", name, label, dnum, wnum, size, ratio); break; case IM_ADMINS: for(i = 0; i < cblistnum(admins); i++){ printf("%s\n", cblistval(admins, i, NULL)); } break; case IM_USERS: for(i = 0; i < cblistnum(users); i++){ printf("%s\n", cblistval(users, i, NULL)); } break; case IM_LINKS: for(i = 0; i < cblistnum(links); i++){ printf("%s\n", cblistval(links, i, NULL)); } break; } } else { printferror("failed: %d", est_node_status(node)); err = TRUE; } est_node_delete(node); return err ? 1 : 0; } /* perform the sync command */ static int procsync(const char *nurl){ ESTNODE *node; int err; err = FALSE; node = est_node_new(nurl); if(g_pxhost && g_pxport > 0) est_node_set_proxy(node, g_pxhost, g_pxport); if(g_timeout >= 0) est_node_set_timeout(node, g_timeout); if(g_authname && g_authpass) est_node_set_auth(node, g_authname, g_authpass); err = FALSE; if(!est_node_sync(node)){ printferror("failed: %d", est_node_status(node)); err = TRUE; } est_node_delete(node); return err ? 1 : 0; } /* perform the optimize command */ static int procoptimize(const char *nurl){ ESTNODE *node; int err; err = FALSE; node = est_node_new(nurl); if(g_pxhost && g_pxport > 0) est_node_set_proxy(node, g_pxhost, g_pxport); if(g_timeout >= 0) est_node_set_timeout(node, g_timeout); if(g_authname && g_authpass) est_node_set_auth(node, g_authname, g_authpass); err = FALSE; if(!est_node_optimize(node)){ printferror("failed: %d", est_node_status(node)); err = TRUE; } est_node_delete(node); return err ? 1 : 0; } /* perform the inform command */ static int procsearch(const char *nurl, const char *phrase, const CBLIST *attrs, const char *ord, int max, int sk, int aux, int opts, int depth, int mask, double ec, const char *dis){ ESTNODE *node; ESTNODERES *nres; ESTRESDOC *rdoc, **sdocs; ESTCOND *cond; CBMAP *hints; CBLIST *names, *elems, *lines; const char *kbuf, *vbuf, *ndurl, *ndscore; char tbuf[NUMBUFSIZ]; int i, j, err, ksiz, vsiz, dnum, wnum, snum, id, ld; err = FALSE; node = est_node_new(nurl); if(g_pxhost && g_pxport > 0) est_node_set_proxy(node, g_pxhost, g_pxport); if(g_timeout >= 0) est_node_set_timeout(node, g_timeout); if(g_authname && g_authpass) est_node_set_auth(node, g_authname, g_authpass); err = FALSE; cond = est_cond_new(); while(*phrase > '\0' && *phrase <= ' '){ phrase++; } if(phrase[0] != '\0' || cblistnum(attrs) < 1) est_cond_set_phrase(cond, phrase); for(i = 0; i < cblistnum(attrs); i++){ est_cond_add_attr(cond, cblistval(attrs, i, NULL)); } if(ord) est_cond_set_order(cond, ord); if(max >= 0){ est_cond_set_max(cond, ec >= 0.01 ? max * ((2.0 / ec) + 0.5) : max); } else { max = INT_MAX; } if(sk > 0) est_cond_set_skip(cond, sk); est_cond_set_options(cond, opts); est_cond_set_auxiliary(cond, aux); if(dis) est_cond_set_distinct(cond, dis); est_cond_set_mask(cond, mask); if((nres = est_node_search(node, cond, depth)) != NULL){ hints = est_noderes_hints(nres); if(ec > 0.0) est_noderes_eclipse(nres, max, ec); switch(g_viewmode){ case VM_URI: printf("%s\n", est_border_str()); cbmapiterinit(hints); while((kbuf = cbmapiternext(hints, &ksiz)) != NULL){ printf("%s\t%s\n", kbuf, cbmapget(hints, kbuf, ksiz, NULL)); } printf("\n"); printf("%s\n", est_border_str()); for(i = 0; i < max && i < est_noderes_doc_num(nres); i++){ rdoc = est_noderes_get_doc(nres, i); ndurl = est_resdoc_attr(rdoc, DATTRNDURL); ndscore = est_resdoc_attr(rdoc, DATTRNDSCORE); printf("%s\t%s\t%s\n", est_resdoc_uri(rdoc), ndurl ? ndurl : "", ndscore ? ndscore : ""); } printf("%s:END\n", est_border_str()); break; case VM_XML: xmlprintf("\n"); xmlprintf("\n", _EST_XNSEARCH, est_version); xmlprintf("\n"); if((vbuf = cbmapget(hints, "NODE", -1, NULL)) != NULL) xmlprintf("\n", vbuf); if((vbuf = cbmapget(hints, "HIT", -1, NULL)) != NULL) xmlprintf("\n", vbuf); for(i = 1; i < cbmaprnum(hints); i++){ sprintf(tbuf, "HINT#%d", i); if(!(vbuf = cbmapget(hints, tbuf, -1, &vsiz))) break; elems = cbsplit(vbuf, vsiz, "\t"); if(cblistnum(elems) == 2){ xmlprintf("\n", cblistval(elems, 0, NULL), cblistval(elems, 1, NULL)); } cblistclose(elems); } if((vbuf = cbmapget(hints, "TIME", -1, NULL)) != NULL){ xmlprintf("\n"); break; default: printf("%s\n", est_border_str()); cbmapiterinit(hints); while((kbuf = cbmapiternext(hints, &ksiz)) != NULL){ printf("%s\t%s\n", kbuf, cbmapget(hints, kbuf, ksiz, NULL)); } printf("\n"); for(i = 0; i < max && i < est_noderes_doc_num(nres); i++){ printf("%s\n", est_border_str()); rdoc = est_noderes_get_doc(nres, i); names = est_resdoc_attr_names(rdoc); for(j = 0; j < cblistnum(names); j++){ kbuf = cblistval(names, j, NULL); printf("%s=%s\n", kbuf, est_resdoc_attr(rdoc, kbuf)); } cblistclose(names); vbuf = est_resdoc_keywords(rdoc); if(vbuf[0] != '\0') printf("%s\t%s\n", ESTDCNTLVECTOR, vbuf); sdocs = est_resdoc_shadows(rdoc, &snum); for(j = 0; j < snum; j++){ printf("%s\t%s\t%.3f\n", ESTDCNTLSHADOW, est_resdoc_uri(sdocs[j]), est_resdoc_similarity(sdocs[j])); } printf("\n"); printf("%s", est_resdoc_snippet(rdoc)); } printf("%s:END\n", est_border_str()); break; } est_noderes_delete(nres); } else { printferror("failed: %d", est_node_status(node)); err = TRUE; } est_cond_delete(cond); est_node_delete(node); return err ? 1 : 0; } /* perform the list command */ static int proclist(const char *nurl){ ESTNODE *node; ESTDOC *doc; const char *tmp; int err; node = est_node_new(nurl); if(g_pxhost && g_pxport > 0) est_node_set_proxy(node, g_pxhost, g_pxport); if(g_timeout >= 0) est_node_set_timeout(node, g_timeout); if(g_authname && g_authpass) est_node_set_auth(node, g_authname, g_authpass); err = FALSE; if(est_node_iter_init(node)){ while((doc = est_node_iter_next(node)) != NULL){ tmp = est_doc_attr(doc, ESTDATTRID); printf("%s\t", tmp ? tmp : ""); tmp = est_doc_attr(doc, ESTDATTRURI); printf("%s\t", tmp ? tmp : ""); tmp = est_doc_attr(doc, ESTDATTRDIGEST); printf("%s\t", tmp ? tmp : ""); tmp = est_doc_attr(doc, ESTDATTRCDATE); printf("%s\t", tmp ? tmp : ""); tmp = est_doc_attr(doc, ESTDATTRMDATE); printf("%s\t", tmp ? tmp : ""); tmp = est_doc_attr(doc, ESTDATTRADATE); printf("%s\t", tmp ? tmp : ""); tmp = est_doc_attr(doc, ESTDATTRTITLE); printf("%s\t", tmp ? tmp : ""); tmp = est_doc_attr(doc, ESTDATTRAUTHOR); printf("%s\t", tmp ? tmp : ""); tmp = est_doc_attr(doc, ESTDATTRTYPE); printf("%s\t", tmp ? tmp : ""); tmp = est_doc_attr(doc, ESTDATTRLANG); printf("%s\t", tmp ? tmp : ""); tmp = est_doc_attr(doc, ESTDATTRGENRE); printf("%s\t", tmp ? tmp : ""); tmp = est_doc_attr(doc, ESTDATTRSIZE); printf("%s\t", tmp ? tmp : ""); tmp = est_doc_attr(doc, ESTDATTRWEIGHT); printf("%s\t", tmp ? tmp : ""); tmp = est_doc_attr(doc, ESTDATTRMISC); printf("%s\n", tmp ? tmp : ""); est_doc_delete(doc); } } else { printferror("failed: %d", est_node_status(node)); err = TRUE; } est_node_delete(node); return err ? 1 : 0; } /* perform the setuser command */ static int procsetuser(const char *nurl, const char *name, int mode){ ESTNODE *node; int err; err = FALSE; node = est_node_new(nurl); if(g_pxhost && g_pxport > 0) est_node_set_proxy(node, g_pxhost, g_pxport); if(g_timeout >= 0) est_node_set_timeout(node, g_timeout); if(g_authname && g_authpass) est_node_set_auth(node, g_authname, g_authpass); err = FALSE; if(!est_node_set_user(node, name, mode)){ printferror("failed: %d", est_node_status(node)); err = TRUE; } est_node_delete(node); return err ? 1 : 0; } /* perform the setlink command */ static int procsetlink(const char *nurl, const char *url, const char *label, int credit){ ESTNODE *node; int err; err = FALSE; node = est_node_new(nurl); if(g_pxhost && g_pxport > 0) est_node_set_proxy(node, g_pxhost, g_pxport); if(g_timeout >= 0) est_node_set_timeout(node, g_timeout); if(g_authname && g_authpass) est_node_set_auth(node, g_authname, g_authpass); err = FALSE; if(!est_node_set_link(node, url, label, credit)){ printferror("failed: %d", est_node_status(node)); err = TRUE; } est_node_delete(node); return err ? 1 : 0; } /* perform the raw command */ static int procraw(const char *url, const char *file){ CBMAP *resheads; CBDATUM *resbody; const char *ptr; char *auth, *reqbody; int i, err, rbsiz, rescode, size; if(file){ if(!(reqbody = cbreadfile(strcmp(file, "-") ? file : NULL, &rbsiz))){ printferror("%s: could not open", file); return 1; } } else { reqbody = NULL; rbsiz = 0; } err = FALSE; if(g_pxport < 1) g_pxport = 80; resheads = cbmapopenex(MINIBNUM); resbody = cbdatumopen(NULL, -1); auth = (g_authname && g_authpass) ? cbsprintf("%s:%s", g_authname, g_authpass) : NULL; if(est_url_shuttle(url, g_pxhost, g_pxport, g_timeout, RESLIMSIZE, auth, g_exheaders, reqbody, rbsiz, &rescode, resheads, resbody)){ if(rescode < 200 && rescode >= 300) err = TRUE; if(g_nonparse){ printf("%s\r\n", cbmapget(resheads, "", 0, NULL)); cbmapiterinit(resheads); while((ptr = cbmapiternext(resheads, &size)) != NULL){ if(size < 1) continue; printf("%s: %s\r\n", ptr, cbmapget(resheads, ptr, size, NULL)); } printf("\r\n"); } ptr = cbdatumptr(resbody); size = cbdatumsize(resbody); for(i = 0; i < size; i++){ putchar(ptr[i]); } } else { printferror("%s: connection failed", url); err = TRUE; } free(auth); cbdatumclose(resbody); cbmapclose(resheads); free(reqbody); return err ? 1 : 0; } /* END OF FILE */ hyperestraier-1.4.13/estcmd.c000066400000000000000000005010601125261632700161200ustar00rootroot00000000000000/************************************************************************************************* * The command line interface for the core API * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #include "estraier.h" #include "myconf.h" #include "mymorph.h" #define NUMBUFSIZ 32 /* size of a buffer for a number */ #define URIBUFSIZ 8192 /* size of a buffer for an URI */ #define MINIBNUM 31 /* bucket number of a small map */ #define SEARCHMAX 10 /* maximum number of shown documents */ #define SEARCHAUX 32 /* minimum hits to adopt the auxiliary index */ #define SNIPWWIDTH 480 /* whole width of the snippet */ #define SNIPHWIDTH 96 /* width of beginning of the text */ #define SNIPAWIDTH 96 /* width around each highlighted word */ #define CACHEMAX (1048576*1024) /* maximum chache size */ #define MEMCHKFREQ 32 /* frequency of checking memory exhaust */ #define MEMCHKALW (1048576*64) /* allowance of checking memory exhaust */ #define MEMLOADMAX 0.9 /* max load ratio of the physical memory */ #define LIMITTSIZ (1024*128) /* text size limitation */ #define LIMITFSIZ (1048576*32) /* file size limitation */ #define DATTRLPATH "_lpath" /* name of the attribute of the URI of local path */ #define DATTRLREAL "_lreal" /* name of the attribute of the real path */ #define DATTRLFILE "_lfile" /* name of the attribute of the file name */ #define DATTRNDSCORE "#nodescore" /* name of the pseudo-attribute of score */ #define KWORDNUM 32 /* number of shown keywords */ #define RELWDDMAX 32 /* max number of documents to calculate related words */ #define RELWDNUM 32 /* number of shown related words */ #define RDOCSNUM 6 /* number of sections of a random document */ #define RDOCCNUM 256 /* number of characters for int a section */ enum { /* enumeration for viewing modes */ VM_ID, /* ID only */ VM_URI, /* ID and URI */ VM_ATTR, /* all attributes */ VM_FULL, /* all attributes and body text */ VM_SNIP, /* all attributes and snippet */ VM_HMRD, /* human readable */ VM_XML, /* XML */ VM_DUMP /* dump draft files */ }; enum { /* enumeration for file formats */ FF_AUTO, /* automatic detection */ FF_DRAFT, /* draft */ FF_TEXT, /* plain text */ FF_HTML, /* HTML */ FF_MIME, /* MIME */ FF_NONE /* ignored */ }; enum { /* enumeration for file type */ ST_ALL, /* all */ ST_FILE, /* file only */ ST_DIR /* directory only */ }; enum { /* enumeration for path format */ SP_REL, /* relative path */ SP_ABS, /* absolute path */ SP_URL /* URL */ }; enum { /* enumeration for test documents */ RD_ENG, /* English */ RD_LAT, /* Latin */ RD_EURO, /* European mix */ RD_ORI, /* Oriental */ RD_JPN, /* Japanese */ RD_CHAO, /* chaos */ RD_RAND /* selected at random */ }; typedef struct { /* type of structure for a hitting object */ const char *word; /* face of keyword */ int pt; /* score tuned by TF-IDF */ } KEYSC; /* global variables */ const char *g_progname; /* program name */ int g_sigterm = FALSE; /* flag for termination signal */ int g_putopts = 0; /* options of registration */ int g_outopts = 0; /* options of deletion */ int g_optopts = 0; /* options of optimization */ int g_mgopts = 0; /* options of merger */ int g_rpopts = 0; /* options of repair */ int g_nooper = FALSE; /* whether not to operate actually */ const char *g_inputcode = "UTF-8"; /* input encoding */ int g_inputlang = ESTLANGEN; /* prefered language */ const char *g_outputcode = "UTF-8"; /* output encoding */ int g_bincheck = FALSE; /* whether to check binary */ int g_limittsiz = LIMITTSIZ; /* text size limitation */ int g_limitfsiz = LIMITFSIZ; /* file size limitation */ const char *g_pathcode = NULL; /* path encoding */ CBLIST *g_pathattrs = NULL; /* names of elements in path extension */ CBLIST *g_addattrs = NULL; /* names and values of additional attribues */ int g_oextmodes = 0; /* extra open modes */ int g_viewmode = VM_ID; /* viewing mode */ int g_snipwwidth = SNIPWWIDTH; /* whole width of the snippet */ int g_sniphwidth = SNIPHWIDTH; /* width of beginning of the text */ int g_snipawidth = SNIPAWIDTH; /* width around each highlighted word */ int g_filefmt = FF_AUTO; /* file format */ CBMAP *g_xcmdmap = NULL; /* map of suffixes and filter commands */ int g_filtorig = FALSE; /* whether to use filter for original files */ CBLIST *g_rmvsufs = NULL; /* list of suffixes of files to be removed */ const char *g_ssname = NULL; /* name of an attribute for substitute score */ int g_stdate = FALSE; /* whether to adopt date by stat */ int g_chkmdate = FALSE; /* whether to check modification date */ double g_cachesize = -1; /* size of the cache */ int g_nochkvmem = FALSE; /* whether to omit virtual memory checking */ int g_doforce = FALSE; /* whether to force purging or extracting */ int g_kwordnum = KWORDNUM; /* number of keywords */ int g_usemorph = FALSE; /* whether to use morphological analyzers */ int g_rdmode = RD_RAND; /* mode of random documents */ /* function prototypes */ int main(int argc, char **argv); static void printferror(const char *format, ...); static void printfinfo(const char *format, ...); static void dbinform(const char *message, void *opaque); static void setsignals(void); static void sigtermhandler(int num); static void usage(void); static int runcreate(int argc, char **argv); static int runput(int argc, char **argv); static int runout(int argc, char **argv); static int runedit(int argc, char **argv); static int runget(int argc, char **argv); static int runlist(int argc, char **argv); static int runuriid(int argc, char **argv); static int runmeta(int argc, char **argv); static int runinform(int argc, char **argv); static int runoptimize(int argc, char **argv); static int runmerge(int argc, char **argv); static int runrepair(int argc, char **argv); static int runsearch(int argc, char **argv); static int rungather(int argc, char **argv); static int runpurge(int argc, char **argv); static int runextkeys(int argc, char **argv); static int runwords(int argc, char **argv); static int rundraft(int argc, char **argv); static int runbreak(int argc, char **argv); static int runiconv(int argc, char **argv); static int runregex(int argc, char **argv); static int runscandir(int argc, char **argv); static int runmulti(int argc, char **argv); static int runrandput(int argc, char **argv); static int runwicked(int argc, char **argv); static int runregression(int argc, char **argv); static int proccreate(const char *dbname, CBMAP *attrs); static int procput(const char *dbname, const char *filename); static int procout(const char *dbname, int id, const char *expr); static int procedit(const char *dbname, int id, const char *expr, const char *name, const char *value); static int procget(const char *dbname, const CBLIST *pidxs, int id, const char *expr, const char *attr); static int proclist(const char *dbname, int lp); static int procuriid(const char *dbname, const CBLIST *pidxs, const char *expr); static int procmeta(const char *dbname, const char *mname, const char *mvalue); static int procinform(const char *dbname); static int procoptimize(const char *dbname); static int procmerge(const char *dbname, const char *tgname); static int procrepair(const char *dbname); static int procsearch(const char *dbname, const CBLIST *pidxs, const char *phrase, const CBLIST *attrs, const char *ord, int max, int sk, int aux, double ec, int opts, int cd, int sim, const char *dis); static int procgather(const char *dbname, const char *filename); static int procpurge(const char *dbname, const char *prefix, const CBLIST *attrs); static int procextkeys(const char *dbname, const char *prefix, const CBLIST *attrs, const char *dfdbname, int ni); static int procwords(const char *dbname, const char *dfdbname, int kw, int kt); static int procdraft(const char *filename); static int procbreak(const char *filename, int wt); static int prociconv(const char *filename); static int procregex(const char *regex, const char *filename, const char *repl, int inv, int ci); static int procscandir(const char *dirname, int tmode, int pmode); static int procmulti(const CBLIST *dbnames, const char *phrase, const CBLIST *attrs, const char *ord, int max, int sk, int aux, int opts, int cd, const char *dis, int hu); static int procrandput(const char *dbname, int dnum); static int procwicked(const char *dbname, int dnum); static int procregression(const char *dbname); static void xmlprintf(const char *format, ...); static int strtoidxtype(const char *str); static int strtolang(const char *str); static char *fgetl(FILE *ifp); static int doputdoc(ESTDB *db, const char *path, const CBLIST *attrs); static void doremovefile(const char *path); static const char *exprtouri(const char *expr); static const char *pathtourl(const char *path); static const char *pathtolreal(const char *path); static const char *urltopath(const char *uri); static int dosbadname(const char *name); static int est_check_binary(const char *buf, int size); static ESTDOC *est_doc_new_with_xcmd(const char *buf, int size, const char *path, const char *xcmd, const char *tmpdir, const char *penc, int plang); static ESTDOC *est_doc_new_from_draft_enc(const char *buf, int size, const char *enc); static ESTDOC *est_doc_new_from_text(const char *buf, int size, const char *penc, int plang, int bcheck); static ESTDOC *est_doc_new_from_html(const char *buf, int size, const char *penc, int plang, int bcheck); static char *est_html_enc(const char *str); static char *est_html_raw_text(const char *html); static ESTDOC *est_doc_new_from_mime(const char *buf, int size, const char *penc, int plang, int bcheck); static void est_doc_add_attr_mime(ESTDOC *doc, const char *name, const char *value); static ESTDOC *est_doc_new_from_chaos(int cnum, int snum, int mode); static char *est_random_str(int cnum, int mode); static int keysc_compare(const void *ap, const void *bp); /* main routine */ int main(int argc, char **argv){ const char *tmp; int rv; if((tmp = getenv("ESTDBGFD")) != NULL) dpdbgfd = atoi(tmp); est_proc_env_reset(); g_progname = argv[0]; g_sigterm = FALSE; if(argc < 2) usage(); rv = 0; if(!strcmp(argv[1], "create")){ setsignals(); rv = runcreate(argc, argv); } else if(!strcmp(argv[1], "put")){ setsignals(); rv = runput(argc, argv); } else if(!strcmp(argv[1], "out")){ setsignals(); rv = runout(argc, argv); } else if(!strcmp(argv[1], "edit")){ setsignals(); rv = runedit(argc, argv); } else if(!strcmp(argv[1], "get")){ rv = runget(argc, argv); } else if(!strcmp(argv[1], "list")){ rv = runlist(argc, argv); } else if(!strcmp(argv[1], "uriid")){ rv = runuriid(argc, argv); } else if(!strcmp(argv[1], "meta")){ setsignals(); rv = runmeta(argc, argv); } else if(!strcmp(argv[1], "inform")){ rv = runinform(argc, argv); } else if(!strcmp(argv[1], "optimize")){ setsignals(); rv = runoptimize(argc, argv); } else if(!strcmp(argv[1], "merge")){ setsignals(); rv = runmerge(argc, argv); } else if(!strcmp(argv[1], "repair")){ setsignals(); rv = runrepair(argc, argv); } else if(!strcmp(argv[1], "search")){ rv = runsearch(argc, argv); } else if(!strcmp(argv[1], "gather")){ setsignals(); rv = rungather(argc, argv); } else if(!strcmp(argv[1], "purge")){ setsignals(); rv = runpurge(argc, argv); } else if(!strcmp(argv[1], "extkeys")){ setsignals(); rv = runextkeys(argc, argv); } else if(!strcmp(argv[1], "words")){ setsignals(); rv = runwords(argc, argv); } else if(!strcmp(argv[1], "draft")){ rv = rundraft(argc, argv); } else if(!strcmp(argv[1], "break")){ rv = runbreak(argc, argv); } else if(!strcmp(argv[1], "iconv")){ rv = runiconv(argc, argv); } else if(!strcmp(argv[1], "regex")){ rv = runregex(argc, argv); } else if(!strcmp(argv[1], "scandir")){ rv = runscandir(argc, argv); } else if(!strcmp(argv[1], "multi")){ rv = runmulti(argc, argv); } else if(!strcmp(argv[1], "randput")){ setsignals(); rv = runrandput(argc, argv); } else if(!strcmp(argv[1], "wicked")){ setsignals(); rv = runwicked(argc, argv); } else if(!strcmp(argv[1], "regression")){ setsignals(); rv = runregression(argc, argv); } else if(!strcmp(argv[1], "version") || !strcmp(argv[1], "--version")){ printf("Hyper Estraier %s on %s\n", est_version, ESTSYSNAME); printf("Copyright (C) 2004-2007 Mikio Hirabayashi.\n"); rv = 0; } else { usage(); } return rv; } /* print formatted error string and flush the buffer */ static void printferror(const char *format, ...){ va_list ap; va_start(ap, format); fprintf(stderr, "%s: ERROR: ", g_progname); vfprintf(stderr, format, ap); fputc('\n', stderr); fflush(stderr); va_end(ap); } /* print formatted information string and flush the buffer */ static void printfinfo(const char *format, ...){ va_list ap; va_start(ap, format); printf("%s: INFO: ", g_progname); vprintf(format, ap); putchar('\n'); fflush(stdout); va_end(ap); } /* callback function for database events */ static void dbinform(const char *message, void *opaque){ printfinfo("%s", message); } /* set signal handlers */ static void setsignals(void){ est_signal(1, sigtermhandler); est_signal(2, sigtermhandler); est_signal(3, sigtermhandler); est_signal(13, SIG_IGN); est_signal(14, SIG_IGN); est_signal(15, sigtermhandler); g_sigterm = FALSE; } /* handler of termination signal */ static void sigtermhandler(int num){ g_sigterm = TRUE; printfinfo("the termination signal %d catched", num); } /* print the usage and exit */ static void usage(void){ fprintf(stderr, "%s: command line utility for the core API of Hyper Estraier\n", g_progname); fprintf(stderr, "\n"); fprintf(stderr, "usage:\n"); fprintf(stderr, " %s create [-tr] [-apn|-acc] [-xs|-xl|-xh|-xh2|-xh3] [-sv|-si|-sa]" " [-attr name type] db\n", g_progname); fprintf(stderr, " %s put [-tr] [-cl] [-ws] [-apn|-acc] [-xs|-xl|-xh|-xh2|-xh3] [-sv|-si|-sa]" " db [file]\n", g_progname); fprintf(stderr, " %s out [-cl] [-pc enc] db expr\n", g_progname); fprintf(stderr, " %s edit [-pc enc] db expr name [value]\n", g_progname); fprintf(stderr, " %s get [-nl|-nb] [-pidx path] [-pc enc] db expr [attr]\n", g_progname); fprintf(stderr, " %s list [-nl|-nb] [-lp] db\n", g_progname); fprintf(stderr, " %s uriid [-nl|-nb] [-pidx path] [-pc enc] db expr\n", g_progname); fprintf(stderr, " %s meta db [name [value]]\n", g_progname); fprintf(stderr, " %s inform [-nl|-nb] db\n", g_progname); fprintf(stderr, " %s optimize [-onp] [-ond] db\n", g_progname); fprintf(stderr, " %s merge [-cl] db target\n", g_progname); fprintf(stderr, " %s repair [-rst|-rsh] db\n", g_progname); fprintf(stderr, " %s search [-nl|-nb] [-pidx path] [-ic enc] [-vu|-va|-vf|-vs|-vh|-vx|-dd]" " [-sn wnum hnum anum] [-kn num] [-um] [-ec rn] [-gs|-gf|-ga] [-cd] [-ni]" " [-sf|-sfr|-sfu|-sfi] [-hs] [-attr expr] [-ord expr] [-max num] [-sk num] [-aux num]" " [-dis name] [-sim id] db [phrase]\n", g_progname); fprintf(stderr, " %s gather [-tr] [-cl] [-ws] [-no] [-fe|-ft|-fh|-fm]" " [-fx sufs cmd] [-fz] [-fo] [-rm sufs] [-ic enc] [-il lang] [-bc] [-lt num] [-lf num]" " [-pc enc] [-px name] [-aa name value] [-apn|-acc] [-xs|-xl|-xh|-xh2|-xh3]" " [-sv|-si|-sa] [-ss name] [-sd] [-cm] [-cs num] [-ncm] [-kn num] [-um]" " db [file|dir]\n", g_progname); fprintf(stderr, " %s purge [-cl] [-no] [-fc] [-pc enc] [-attr expr] db [prefix]\n", g_progname); fprintf(stderr, " %s extkeys [-no] [-fc] [-dfdb file] [-ncm] [-ni] [-kn num] [-um] [-ws]" " [-attr expr] db [prefix]\n", g_progname); fprintf(stderr, " %s words [-nl|-nb] [-dfdb file] [-kw|-kt] db\n", g_progname); fprintf(stderr, " %s draft [-ft|-fh|-fm] [-ic enc] [-il lang] [-bc] [-lt num]" " [-kn num] [-um] [file]\n", g_progname); fprintf(stderr, " %s break [-ic enc] [-il lang] [-apn|-acc] [-wt] [file]\n", g_progname); fprintf(stderr, " %s iconv [-ic enc] [-il lang] [-oc enc] [file]\n", g_progname); fprintf(stderr, " %s regex [-inv] [-ci] [-repl str] expr [file]\n", g_progname); fprintf(stderr, " %s scandir [-tf|-td] [-pa|-pu] [dir]\n", g_progname); fprintf(stderr, " %s multi [-db db] [-nl|-nb] [-ic enc] [-gs|-gf|-ga] [-cd] [-ni]" " [-sf|-sfr|-sfu|-sfi] [-hs] [-hu] [-attr expr] [-ord expr] [-max num] [-sk num]" " [-aux num] [-dis name] [phrase]\n", g_progname); fprintf(stderr, " %s randput [-ren|-rla|-reu|-ror|-rjp|-rch] [-cs num] db dnum\n", g_progname); fprintf(stderr, " %s wicked db dnum\n", g_progname); fprintf(stderr, " %s regression db\n", g_progname); fprintf(stderr, " %s version\n", g_progname); fprintf(stderr, "\n"); exit(1); } /* parse arguments of the create command */ static int runcreate(int argc, char **argv){ CBMAP *attrs; char *dbname; int i, rv; dbname = NULL; attrs = cbmapopenex(MINIBNUM); cbglobalgc(attrs, (void (*)(void *))cbmapclose); for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ if(!strcmp(argv[i], "-tr")){ g_oextmodes |= ESTDBTRUNC; } else if(!strcmp(argv[i], "-apn")){ g_oextmodes |= ESTDBPERFNG; } else if(!strcmp(argv[i], "-acc")){ g_oextmodes |= ESTDBCHRCAT; } else if(!strcmp(argv[i], "-xs")){ g_oextmodes |= ESTDBSMALL; } else if(!strcmp(argv[i], "-xl")){ g_oextmodes |= ESTDBLARGE; } else if(!strcmp(argv[i], "-xh")){ g_oextmodes |= ESTDBHUGE; } else if(!strcmp(argv[i], "-xh2")){ g_oextmodes |= ESTDBHUGE2; } else if(!strcmp(argv[i], "-xh3")){ g_oextmodes |= ESTDBHUGE3; } else if(!strcmp(argv[i], "-sv")){ g_oextmodes |= ESTDBSCVOID; } else if(!strcmp(argv[i], "-si")){ g_oextmodes |= ESTDBSCINT; } else if(!strcmp(argv[i], "-sa")){ g_oextmodes |= ESTDBSCASIS; } else if(!strcmp(argv[i], "-attr")){ if((i += 2) >= argc) usage(); cbmapput(attrs, argv[i-1], -1, argv[i], -1, TRUE); } else { usage(); } } else if(!dbname){ dbname = argv[i]; } else { usage(); } } if(!dbname) usage(); rv = proccreate(dbname, attrs); return rv; } /* parse arguments of the put command */ static int runput(int argc, char **argv){ char *dbname, *filename; int i, rv; dbname = NULL; filename = NULL; for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ if(!strcmp(argv[i], "-tr")){ g_oextmodes |= ESTDBTRUNC; } else if(!strcmp(argv[i], "-cl")){ g_putopts |= ESTPDCLEAN; } else if(!strcmp(argv[i], "-ws")){ g_putopts |= ESTPDWEIGHT; } else if(!strcmp(argv[i], "-apn")){ g_oextmodes |= ESTDBPERFNG; } else if(!strcmp(argv[i], "-acc")){ g_oextmodes |= ESTDBCHRCAT; } else if(!strcmp(argv[i], "-xs")){ g_oextmodes |= ESTDBSMALL; } else if(!strcmp(argv[i], "-xl")){ g_oextmodes |= ESTDBLARGE; } else if(!strcmp(argv[i], "-xh")){ g_oextmodes |= ESTDBHUGE; } else if(!strcmp(argv[i], "-xh2")){ g_oextmodes |= ESTDBHUGE2; } else if(!strcmp(argv[i], "-xh3")){ g_oextmodes |= ESTDBHUGE3; } else if(!strcmp(argv[i], "-sv")){ g_oextmodes |= ESTDBSCVOID; } else if(!strcmp(argv[i], "-si")){ g_oextmodes |= ESTDBSCINT; } else if(!strcmp(argv[i], "-sa")){ g_oextmodes |= ESTDBSCASIS; } else { usage(); } } else if(!dbname){ dbname = argv[i]; } else if(!filename){ filename = argv[i]; } else { usage(); } } if(!dbname) usage(); rv = procput(dbname, filename); return rv; } /* parse arguments of the out command */ static int runout(int argc, char **argv){ char *dbname, *expr; int i, id, rv; dbname = NULL; expr = NULL; for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ if(!strcmp(argv[i], "-cl")){ g_outopts |= ESTODCLEAN; } else if(!strcmp(argv[i], "-pc")){ if(++i >= argc) usage(); g_pathcode = argv[i]; } else { usage(); } } else if(!dbname){ dbname = argv[i]; } else if(!expr){ expr = argv[i]; } else { usage(); } } if(!dbname || !expr) usage(); if((id = atoi(expr)) > 0) expr = NULL; rv = procout(dbname, id, expr); return rv; } /* parse arguments of the edit command */ static int runedit(int argc, char **argv){ char *dbname, *expr, *name, *value; int i, id, rv; dbname = NULL; expr = NULL; name = NULL; value = NULL; for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ if(!strcmp(argv[i], "-pc")){ if(++i >= argc) usage(); g_pathcode = argv[i]; } else { usage(); } } else if(!dbname){ dbname = argv[i]; } else if(!expr){ expr = argv[i]; } else if(!name){ name = argv[i]; } else if(!value){ value = argv[i]; } else { usage(); } } if(!dbname || !expr || !name) usage(); if((id = atoi(expr)) > 0) expr = NULL; rv = procedit(dbname, id, expr, name, value); return rv; } /* parse arguments of the get command */ static int runget(int argc, char **argv){ CBLIST *pidxs; char *dbname, *expr, *attr; int i, id, rv; dbname = NULL; expr = NULL; attr = NULL; pidxs = cblistopen(); cbglobalgc(pidxs, (void (*)(void *))cblistclose); for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ if(!strcmp(argv[i], "-nl")){ g_oextmodes |= ESTDBNOLCK; } else if(!strcmp(argv[i], "-nb")){ g_oextmodes |= ESTDBLCKNB; } else if(!strcmp(argv[i], "-pidx")){ if(++i >= argc) usage(); cblistpush(pidxs, argv[i], -1); } else if(!strcmp(argv[i], "-pc")){ if(++i >= argc) usage(); g_pathcode = argv[i]; } else { usage(); } } else if(!dbname){ dbname = argv[i]; } else if(!expr){ expr = argv[i]; } else if(!attr){ attr = argv[i]; } else { usage(); } } if(!dbname || !expr) usage(); if((id = atoi(expr)) > 0) expr = NULL; rv = procget(dbname, pidxs, id, expr, attr); return rv; } /* parse arguments of the list command */ static int runlist(int argc, char **argv){ char *dbname; int i, lp, rv; dbname = NULL; lp = FALSE; for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ if(!strcmp(argv[i], "-nl")){ g_oextmodes |= ESTDBNOLCK; } else if(!strcmp(argv[i], "-nb")){ g_oextmodes |= ESTDBLCKNB; } else if(!strcmp(argv[i], "-lp")){ lp = TRUE; } else { usage(); } } else if(!dbname){ dbname = argv[i]; } else { usage(); } } if(!dbname) usage(); rv = proclist(dbname, lp); return rv; } /* parse arguments of the uriid command */ static int runuriid(int argc, char **argv){ CBLIST *pidxs; char *dbname, *expr; int i, rv; dbname = NULL; expr = NULL; pidxs = cblistopen(); cbglobalgc(pidxs, (void (*)(void *))cblistclose); for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ if(!strcmp(argv[i], "-nl")){ g_oextmodes |= ESTDBNOLCK; } else if(!strcmp(argv[i], "-nb")){ g_oextmodes |= ESTDBLCKNB; } else if(!strcmp(argv[i], "-pidx")){ if(++i >= argc) usage(); cblistpush(pidxs, argv[i], -1); } else if(!strcmp(argv[i], "-pc")){ if(++i >= argc) usage(); g_pathcode = argv[i]; } else { usage(); } } else if(!dbname){ dbname = argv[i]; } else if(!expr){ expr = argv[i]; } else { usage(); } } if(!dbname || !expr) usage(); rv = procuriid(dbname, pidxs, expr); return rv; } /* parse arguments of the meta command */ static int runmeta(int argc, char **argv){ char *dbname, *mname, *mvalue; int i, del, rv; dbname = NULL; mname = NULL; mvalue = NULL; del = FALSE; for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ usage(); } else if(!dbname){ dbname = argv[i]; } else if(!mname){ mname = argv[i]; } else if(!mvalue){ mvalue = argv[i]; } else { usage(); } } if(!dbname) usage(); rv = procmeta(dbname, mname, mvalue); return rv; } /* parse arguments of the inform command */ static int runinform(int argc, char **argv){ char *dbname; int i, rv; dbname = NULL; for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ if(!strcmp(argv[i], "-nl")){ g_oextmodes |= ESTDBNOLCK; } else if(!strcmp(argv[i], "-nb")){ g_oextmodes |= ESTDBLCKNB; } else { usage(); } } else if(!dbname){ dbname = argv[i]; } else { usage(); } } if(!dbname) usage(); rv = procinform(dbname); return rv; } /* parse arguments of the optimize command */ static int runoptimize(int argc, char **argv){ char *dbname; int i, rv; dbname = NULL; for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ if(!strcmp(argv[i], "-onp")){ g_optopts |= ESTOPTNOPURGE; } else if(!strcmp(argv[i], "-ond")){ g_optopts |= ESTOPTNODBOPT; } else { usage(); } } else if(!dbname){ dbname = argv[i]; } else { usage(); } } if(!dbname) usage(); rv = procoptimize(dbname); return rv; } /* parse arguments of the merge command */ static int runmerge(int argc, char **argv){ char *dbname, *tgname; int i, rv; dbname = NULL; tgname = NULL; for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ if(!strcmp(argv[i], "-cl")){ g_mgopts |= ESTMGCLEAN; } else { usage(); } } else if(!dbname){ dbname = argv[i]; } else if(!tgname){ tgname = argv[i]; } else { usage(); } } if(!dbname || !tgname) usage(); rv = procmerge(dbname, tgname); return rv; } /* parse arguments of the repair command */ static int runrepair(int argc, char **argv){ char *dbname; int i, rv; dbname = NULL; for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ if(!strcmp(argv[i], "-rst")){ g_rpopts |= ESTRPSTRICT; } else if(!strcmp(argv[i], "-rsh")){ g_rpopts |= ESTRPSHODDY; } else { usage(); } } else if(!dbname){ dbname = argv[i]; } else { usage(); } } if(!dbname) usage(); rv = procrepair(dbname); return rv; } /* parse arguments of the search command */ static int runsearch(int argc, char **argv){ CBDATUM *pbuf; CBLIST *pidxs, *attrs; char *dbname, *ord, *dis, *phrase, *tmp; int i, max, sk, aux, opts, cd, sim, rv; double ec; g_kwordnum = -1; dbname = NULL; ord = NULL; dis = NULL; max = SEARCHMAX; sk = 0; aux = SEARCHAUX; ec = -1.0; opts = 0; cd = FALSE; sim = -1; pbuf = cbdatumopen(NULL, -1); cbglobalgc(pbuf, (void (*)(void *))cbdatumclose); pidxs = cblistopen(); cbglobalgc(pidxs, (void (*)(void *))cblistclose); attrs = cblistopen(); cbglobalgc(attrs, (void (*)(void *))cblistclose); for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ if(!strcmp(argv[i], "-nl")){ g_oextmodes |= ESTDBNOLCK; } else if(!strcmp(argv[i], "-nb")){ g_oextmodes |= ESTDBLCKNB; } else if(!strcmp(argv[i], "-pidx")){ if(++i >= argc) usage(); cblistpush(pidxs, argv[i], -1); } else if(!strcmp(argv[i], "-ic")){ if(++i >= argc) usage(); g_inputcode = argv[i]; } else if(!strcmp(argv[i], "-vu")){ g_viewmode = VM_URI; } else if(!strcmp(argv[i], "-va")){ g_viewmode = VM_ATTR; } else if(!strcmp(argv[i], "-vf")){ g_viewmode = VM_FULL; } else if(!strcmp(argv[i], "-vs")){ g_viewmode = VM_SNIP; } else if(!strcmp(argv[i], "-vh")){ g_viewmode = VM_HMRD; } else if(!strcmp(argv[i], "-vx")){ g_viewmode = VM_XML; } else if(!strcmp(argv[i], "-dd")){ g_viewmode = VM_DUMP; } else if(!strcmp(argv[i], "-sn")){ if(++i >= argc) usage(); g_snipwwidth = atoi(argv[i]); if(++i >= argc) usage(); g_snipawidth = atoi(argv[i]); if(++i >= argc) usage(); g_sniphwidth = atoi(argv[i]); } else if(!strcmp(argv[i], "-kn")){ if(++i >= argc) usage(); g_kwordnum = atoi(argv[i]); } else if(!strcmp(argv[i], "-um")){ g_usemorph = TRUE; } else if(!strcmp(argv[i], "-ec")){ if(++i >= argc) usage(); if(!cbstricmp(argv[i], "serv") || !cbstricmp(argv[i], "s")){ ec = ESTECLSERV; } else if(!cbstricmp(argv[i], "dir") || !cbstricmp(argv[i], "d")){ ec = ESTECLDIR; } else if(!cbstricmp(argv[i], "file") || !cbstricmp(argv[i], "f")){ ec = ESTECLFILE; } else { ec = strtod(argv[i], NULL); if(ec < 0) ec = ESTECLSIMURL - ec; } } else if(!strcmp(argv[i], "-gs")){ opts |= ESTCONDSURE; } else if(!strcmp(argv[i], "-gf")){ opts |= ESTCONDFAST; } else if(!strcmp(argv[i], "-ga")){ opts |= ESTCONDAGITO; } else if(!strcmp(argv[i], "-cd")){ cd = TRUE; } else if(!strcmp(argv[i], "-ni")){ opts |= ESTCONDNOIDF; } else if(!strcmp(argv[i], "-sf")){ opts |= ESTCONDSIMPLE; } else if(!strcmp(argv[i], "-sfr")){ opts |= ESTCONDROUGH; } else if(!strcmp(argv[i], "-sfu")){ opts |= ESTCONDUNION; } else if(!strcmp(argv[i], "-sfi")){ opts |= ESTCONDISECT; } else if(!strcmp(argv[i], "-hs")){ opts |= ESTCONDSCFB; } else if(!strcmp(argv[i], "-attr")){ if(++i >= argc) usage(); cblistpush(attrs, argv[i], -1); } else if(!strcmp(argv[i], "-ord")){ if(++i >= argc) usage(); ord = argv[i]; } else if(!strcmp(argv[i], "-max")){ if(++i >= argc) usage(); max = atoi(argv[i]); } else if(!strcmp(argv[i], "-sk")){ if(++i >= argc) usage(); sk = atoi(argv[i]); } else if(!strcmp(argv[i], "-aux")){ if(++i >= argc) usage(); aux = atoi(argv[i]); } else if(!strcmp(argv[i], "-dis")){ if(++i >= argc) usage(); dis = argv[i]; } else if(!strcmp(argv[i], "-sim")){ if(++i >= argc) usage(); sim = atoi(argv[i]); } else { usage(); } } else if(!dbname){ dbname = argv[i]; } else { if(cbdatumsize(pbuf) > 0) cbdatumcat(pbuf, " ", 1); cbdatumcat(pbuf, argv[i], -1); } } if(!dbname || g_snipwwidth < 0 || g_sniphwidth < 0 || g_snipawidth < 0) usage(); if(!(phrase = est_iconv(cbdatumptr(pbuf), -1, g_inputcode, "UTF-8", NULL, NULL))){ printferror("%s: unsupported encoding\n", g_inputcode); return 1; } cbstrtrim(phrase); for(i = 0; i < cblistnum(attrs); i++){ if((tmp = est_iconv(cblistval(attrs, i, NULL), -1, g_inputcode, "UTF-8", NULL, NULL)) != NULL){ cblistover(attrs, i, tmp, -1); free(tmp); } } rv = procsearch(dbname, pidxs, phrase, attrs, ord, max, sk, aux, ec, opts, cd, sim, dis); free(phrase); return rv; } /* parse arguments of the gather command */ static int rungather(int argc, char **argv){ CBLIST *list; const char *elem; char *dbname, *filename; int i, j, rv; g_pathattrs = cblistopen(); cbglobalgc(g_pathattrs, (void (*)(void *))cblistclose); g_addattrs = cblistopen(); cbglobalgc(g_addattrs, (void (*)(void *))cblistclose); g_xcmdmap = cbmapopenex(MINIBNUM); cbglobalgc(g_xcmdmap, (void (*)(void *))cbmapclose); g_rmvsufs = cblistopen(); cbglobalgc(g_rmvsufs, (void (*)(void *))cblistclose); g_inputcode = NULL; g_kwordnum = -1; dbname = NULL; filename = NULL; for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ if(!strcmp(argv[i], "-tr")){ g_oextmodes |= ESTDBTRUNC; } else if(!strcmp(argv[i], "-cl")){ g_putopts |= ESTPDCLEAN; } else if(!strcmp(argv[i], "-ws")){ g_putopts |= ESTPDWEIGHT; } else if(!strcmp(argv[i], "-no")){ g_nooper = TRUE; } else if(!strcmp(argv[i], "-fe")){ g_filefmt = FF_DRAFT; } else if(!strcmp(argv[i], "-ft")){ g_filefmt = FF_TEXT; } else if(!strcmp(argv[i], "-fh")){ g_filefmt = FF_HTML; } else if(!strcmp(argv[i], "-fm")){ g_filefmt = FF_MIME; } else if(!strcmp(argv[i], "-fx")){ if((i += 2) >= argc) usage(); list = cbsplit(argv[i-1], -1, ","); for(j = 0; j < cblistnum(list); j++){ elem = cblistval(list, j, NULL); if(elem[0] != '\0') cbmapput(g_xcmdmap, elem, -1, argv[i], -1, FALSE); } cblistclose(list); } else if(!strcmp(argv[i], "-fz")){ g_filefmt = FF_NONE; } else if(!strcmp(argv[i], "-fo")){ g_filtorig = TRUE; } else if(!strcmp(argv[i], "-rm")){ if(++i >= argc) usage(); list = cbsplit(argv[i], -1, ","); for(j = 0; j < cblistnum(list); j++){ elem = cblistval(list, j, NULL); if(elem[0] != '\0') cblistpush(g_rmvsufs, elem, -1); } cblistclose(list); } else if(!strcmp(argv[i], "-ic")){ if(++i >= argc) usage(); g_inputcode = argv[i]; } else if(!strcmp(argv[i], "-il")){ if(++i >= argc) usage(); g_inputlang = strtolang(argv[i]); } else if(!strcmp(argv[i], "-bc")){ g_bincheck = TRUE; } else if(!strcmp(argv[i], "-lt")){ if(++i >= argc) usage(); g_limittsiz = strtod(argv[i], NULL) * 1024; } else if(!strcmp(argv[i], "-lf")){ if(++i >= argc) usage(); g_limitfsiz = strtod(argv[i], NULL) * 1024 * 1024; } else if(!strcmp(argv[i], "-pc")){ if(++i >= argc) usage(); g_pathcode = argv[i]; } else if(!strcmp(argv[i], "-px")){ if(++i >= argc) usage(); cblistpush(g_pathattrs, argv[i], -1); } else if(!strcmp(argv[i], "-aa")){ if(++i >= argc) usage(); cblistpush(g_addattrs, argv[i], -1); if(++i >= argc) usage(); cblistpush(g_addattrs, argv[i], -1); } else if(!strcmp(argv[i], "-apn")){ g_oextmodes |= ESTDBPERFNG; } else if(!strcmp(argv[i], "-acc")){ g_oextmodes |= ESTDBCHRCAT; } else if(!strcmp(argv[i], "-xs")){ g_oextmodes |= ESTDBSMALL; } else if(!strcmp(argv[i], "-xl")){ g_oextmodes |= ESTDBLARGE; } else if(!strcmp(argv[i], "-xh")){ g_oextmodes |= ESTDBHUGE; } else if(!strcmp(argv[i], "-xh2")){ g_oextmodes |= ESTDBHUGE2; } else if(!strcmp(argv[i], "-xh3")){ g_oextmodes |= ESTDBHUGE3; } else if(!strcmp(argv[i], "-sv")){ g_oextmodes |= ESTDBSCVOID; } else if(!strcmp(argv[i], "-si")){ g_oextmodes |= ESTDBSCINT; } else if(!strcmp(argv[i], "-sa")){ g_oextmodes |= ESTDBSCASIS; } else if(!strcmp(argv[i], "-ss")){ if(++i >= argc) usage(); g_ssname = argv[i]; } else if(!strcmp(argv[i], "-sd")){ g_stdate = TRUE; } else if(!strcmp(argv[i], "-cm")){ g_chkmdate = TRUE; } else if(!strcmp(argv[i], "-cs")){ if(++i >= argc) usage(); g_cachesize = strtod(argv[i], NULL) * 1024 * 1024; } else if(!strcmp(argv[i], "-ncm")){ g_nochkvmem = TRUE; } else if(!strcmp(argv[i], "-kn")){ if(++i >= argc) usage(); g_kwordnum = atoi(argv[i]); } else if(!strcmp(argv[i], "-um")){ g_usemorph = TRUE; } else { usage(); } } else if(!dbname){ dbname = argv[i]; } else if(!filename){ filename = argv[i]; } else { usage(); } } if(!dbname || !filename) usage(); rv = procgather(dbname, filename); return rv; } /* parse arguments of the purge command */ static int runpurge(int argc, char **argv){ CBLIST *attrs; char *dbname, *prefix; int i, rv; dbname = NULL; prefix = NULL; attrs = cblistopen(); cbglobalgc(attrs, (void (*)(void *))cblistclose); for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ if(!strcmp(argv[i], "-cl")){ g_outopts |= ESTODCLEAN; } else if(!strcmp(argv[i], "-no")){ g_nooper = TRUE; } else if(!strcmp(argv[i], "-fc")){ g_doforce = TRUE; } else if(!strcmp(argv[i], "-pc")){ if(++i >= argc) usage(); g_pathcode = argv[i]; } else if(!strcmp(argv[i], "-attr")){ if(++i >= argc) usage(); cblistpush(attrs, argv[i], -1); } else { usage(); } } else if(!dbname){ dbname = argv[i]; } else if(!prefix){ prefix = argv[i]; } else { usage(); } } if(!dbname) usage(); rv = procpurge(dbname, prefix, attrs); return rv; } /* parse arguments of the extkeys command */ static int runextkeys(int argc, char **argv){ CBLIST *attrs; char *dbname, *prefix, *dfdbname; int i, ni, rv; dbname = NULL; prefix = NULL; dfdbname = NULL; ni = FALSE; attrs = cblistopen(); cbglobalgc(attrs, (void (*)(void *))cblistclose); for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ if(!strcmp(argv[i], "-no")){ g_nooper = TRUE; } else if(!strcmp(argv[i], "-fc")){ g_doforce = TRUE; } else if(!strcmp(argv[i], "-dfdb")){ if(++i >= argc) usage(); dfdbname = argv[i]; } else if(!strcmp(argv[i], "-ncm")){ g_nochkvmem = TRUE; } else if(!strcmp(argv[i], "-ni")){ ni = TRUE; } else if(!strcmp(argv[i], "-kn")){ if(++i >= argc) usage(); g_kwordnum = atoi(argv[i]); } else if(!strcmp(argv[i], "-um")){ g_usemorph = TRUE; } else if(!strcmp(argv[i], "-ws")){ g_putopts |= ESTPDWEIGHT; } else if(!strcmp(argv[i], "-attr")){ if(++i >= argc) usage(); cblistpush(attrs, argv[i], -1); } else { usage(); } } else if(!dbname){ dbname = argv[i]; } else if(!prefix){ prefix = argv[i]; } else { usage(); } } if(!dbname || g_kwordnum < 1) usage(); rv = procextkeys(dbname, prefix, attrs, dfdbname, ni); return rv; } /* parse arguments of the words command */ static int runwords(int argc, char **argv){ char *dbname, *dfdbname; int i, kw, kt, rv; dbname = NULL; dfdbname = NULL; kw = FALSE; kt = FALSE; for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ if(!strcmp(argv[i], "-nl")){ g_oextmodes |= ESTDBNOLCK; } else if(!strcmp(argv[i], "-nb")){ g_oextmodes |= ESTDBLCKNB; } else if(!strcmp(argv[i], "-dfdb")){ if(++i >= argc) usage(); dfdbname = argv[i]; } else if(!strcmp(argv[i], "-kw")){ kw = TRUE; } else if(!strcmp(argv[i], "-kt")){ kt = TRUE; } else { usage(); } } else if(!dbname){ dbname = argv[i]; } else { usage(); } } if(!dbname) usage(); rv = procwords(dbname, dfdbname, kw, kt); return rv; } /* parse arguments of the draft command */ static int rundraft(int argc, char **argv){ char *filename; int i, rv; g_filefmt = FF_DRAFT; g_inputcode = NULL; g_kwordnum = -1; filename = NULL; for(i = 2; i < argc; i++){ if(!filename && argv[i][0] == '-'){ if(!strcmp(argv[i], "-ft")){ g_filefmt = FF_TEXT; } else if(!strcmp(argv[i], "-fh")){ g_filefmt = FF_HTML; } else if(!strcmp(argv[i], "-fm")){ g_filefmt = FF_MIME; } else if(!strcmp(argv[i], "-ic")){ if(++i >= argc) usage(); g_inputcode = argv[i]; } else if(!strcmp(argv[i], "-il")){ if(++i >= argc) usage(); g_inputlang = strtolang(argv[i]); } else if(!strcmp(argv[i], "-bc")){ g_bincheck = TRUE; } else if(!strcmp(argv[i], "-lt")){ if(++i >= argc) usage(); g_limittsiz = strtod(argv[i], NULL) * 1024; } else if(!strcmp(argv[i], "-kn")){ if(++i >= argc) usage(); g_kwordnum = atoi(argv[i]); } else if(!strcmp(argv[i], "-um")){ g_usemorph = TRUE; } else { usage(); } } else if(!filename){ filename = argv[i]; } else { usage(); } } rv = procdraft(filename); return rv; } /* parse arguments of the break command */ static int runbreak(int argc, char **argv){ char *filename; int i, wt, rv; g_inputcode = NULL; filename = NULL; wt = FALSE; for(i = 2; i < argc; i++){ if(!filename && argv[i][0] == '-'){ if(!strcmp(argv[i], "-ic")){ if(++i >= argc) usage(); g_inputcode = argv[i]; } else if(!strcmp(argv[i], "-il")){ if(++i >= argc) usage(); g_inputlang = strtolang(argv[i]); } else if(!strcmp(argv[i], "-apn")){ g_oextmodes |= ESTDBPERFNG; } else if(!strcmp(argv[i], "-acc")){ g_oextmodes |= ESTDBCHRCAT; } else if(!strcmp(argv[i], "-wt")){ wt = TRUE; } else { usage(); } } else if(!filename){ filename = argv[i]; } else { usage(); } } rv = procbreak(filename, wt); return rv; } /* parse arguments of the iconv command */ static int runiconv(int argc, char **argv){ char *filename; int i, rv; g_inputcode = NULL; filename = NULL; for(i = 2; i < argc; i++){ if(!filename && argv[i][0] == '-'){ if(!strcmp(argv[i], "-ic")){ if(++i >= argc) usage(); g_inputcode = argv[i]; } else if(!strcmp(argv[i], "-il")){ if(++i >= argc) usage(); g_inputlang = strtolang(argv[i]); } else if(!strcmp(argv[i], "-oc")){ if(++i >= argc) usage(); g_outputcode = argv[i]; } else { usage(); } } else if(!filename){ filename = argv[i]; } else { usage(); } } rv = prociconv(filename); return rv; } /* parse arguments of the regex command */ static int runregex(int argc, char **argv){ char *regex, *filename, *repl; int i, inv, ci, rv; regex = NULL; filename = NULL; repl = NULL; inv = FALSE; ci = FALSE; for(i = 2; i < argc; i++){ if(!regex && argv[i][0] == '-'){ if(!strcmp(argv[i], "-inv")){ inv = TRUE; } else if(!strcmp(argv[i], "-ci")){ ci = TRUE; } else if(!strcmp(argv[i], "-repl")){ if(++i >= argc) usage(); repl = argv[i]; } else { usage(); } } else if(!regex){ regex = argv[i]; } else if(!filename){ filename = argv[i]; } else { usage(); } } if(!regex) usage(); rv = procregex(regex, filename, repl, inv, ci); return rv; } /* parse arguments of the scandir command */ static int runscandir(int argc, char **argv){ char *dirname; int i, tmode, pmode, rv; dirname = NULL; tmode = ST_ALL; pmode = SP_REL; for(i = 2; i < argc; i++){ if(!dirname && argv[i][0] == '-'){ if(!strcmp(argv[i], "-tf")){ tmode = ST_FILE; } else if(!strcmp(argv[i], "-td")){ tmode = ST_DIR; } else if(!strcmp(argv[i], "-pa")){ pmode = SP_ABS; } else if(!strcmp(argv[i], "-pu")){ pmode = SP_URL; } else { usage(); } } else if(!dirname){ dirname = argv[i]; } else { usage(); } } if(!dirname) dirname = ESTCDIRSTR; rv = procscandir(dirname, tmode, pmode); return rv; } /* parse arguments of the multi command */ static int runmulti(int argc, char **argv){ CBDATUM *pbuf; CBLIST *dbnames, *attrs; char *ord, *phrase, *dis, *tmp; int i, max, sk, aux, opts, cd, hu, rv; ord = NULL; dis = NULL; max = SEARCHMAX; sk = 0; aux = SEARCHAUX; opts = 0; cd = FALSE; hu = FALSE; dbnames = cblistopen(); cbglobalgc(dbnames, (void (*)(void *))cblistclose); pbuf = cbdatumopen(NULL, -1); cbglobalgc(pbuf, (void (*)(void *))cbdatumclose); attrs = cblistopen(); cbglobalgc(attrs, (void (*)(void *))cblistclose); for(i = 2; i < argc; i++){ if(cbdatumsize(pbuf) < 1 && argv[i][0] == '-'){ if(!strcmp(argv[i], "-db")){ if(++i >= argc) usage(); cblistpush(dbnames, argv[i], -1); } else if(!strcmp(argv[i], "-nl")){ g_oextmodes |= ESTDBNOLCK; } else if(!strcmp(argv[i], "-nb")){ g_oextmodes |= ESTDBLCKNB; } else if(!strcmp(argv[i], "-ic")){ if(++i >= argc) usage(); g_inputcode = argv[i]; } else if(!strcmp(argv[i], "-gs")){ opts |= ESTCONDSURE; } else if(!strcmp(argv[i], "-gf")){ opts |= ESTCONDFAST; } else if(!strcmp(argv[i], "-ga")){ opts |= ESTCONDAGITO; } else if(!strcmp(argv[i], "-cd")){ cd = TRUE; } else if(!strcmp(argv[i], "-ni")){ opts |= ESTCONDNOIDF; } else if(!strcmp(argv[i], "-sf")){ opts |= ESTCONDSIMPLE; } else if(!strcmp(argv[i], "-sfr")){ opts |= ESTCONDROUGH; } else if(!strcmp(argv[i], "-sfu")){ opts |= ESTCONDUNION; } else if(!strcmp(argv[i], "-sfi")){ opts |= ESTCONDISECT; } else if(!strcmp(argv[i], "-hs")){ opts |= ESTCONDSCFB; } else if(!strcmp(argv[i], "-hu")){ hu = TRUE; } else if(!strcmp(argv[i], "-attr")){ if(++i >= argc) usage(); cblistpush(attrs, argv[i], -1); } else if(!strcmp(argv[i], "-ord")){ if(++i >= argc) usage(); ord = argv[i]; } else if(!strcmp(argv[i], "-max")){ if(++i >= argc) usage(); max = atoi(argv[i]); } else if(!strcmp(argv[i], "-sk")){ if(++i >= argc) usage(); sk = atoi(argv[i]); } else if(!strcmp(argv[i], "-aux")){ if(++i >= argc) usage(); aux = atoi(argv[i]); } else if(!strcmp(argv[i], "-dis")){ if(++i >= argc) usage(); dis = argv[i]; } else { usage(); } } else { if(cbdatumsize(pbuf) > 0) cbdatumcat(pbuf, " ", 1); cbdatumcat(pbuf, argv[i], -1); } } if(!(phrase = est_iconv(cbdatumptr(pbuf), -1, g_inputcode, "UTF-8", NULL, NULL))){ printferror("%s: unsupported encoding\n", g_inputcode); return 1; } cbstrtrim(phrase); for(i = 0; i < cblistnum(attrs); i++){ if((tmp = est_iconv(cblistval(attrs, i, NULL), -1, g_inputcode, "UTF-8", NULL, NULL)) != NULL){ cblistover(attrs, i, tmp, -1); free(tmp); } } rv = procmulti(dbnames, phrase, attrs, ord, max, sk, aux, opts, cd, dis, hu); free(phrase); return rv; } /* parse arguments of the randput command */ static int runrandput(int argc, char **argv){ char *dbname, *dnstr; int i, dnum, rv; dbname = NULL; dnstr = NULL; for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ if(!strcmp(argv[i], "-ren")){ g_rdmode = RD_ENG; } else if(!strcmp(argv[i], "-rla")){ g_rdmode = RD_LAT; } else if(!strcmp(argv[i], "-reu")){ g_rdmode = RD_EURO; } else if(!strcmp(argv[i], "-ror")){ g_rdmode = RD_ORI; } else if(!strcmp(argv[i], "-rjp")){ g_rdmode = RD_JPN; } else if(!strcmp(argv[i], "-rch")){ g_rdmode = RD_CHAO; } else if(!strcmp(argv[i], "-cs")){ if(++i >= argc) usage(); g_cachesize = strtod(argv[i], NULL) * 1024 * 1024; } else { usage(); } } else if(!dbname){ dbname = argv[i]; } else if(!dnstr){ dnstr = argv[i]; } else { usage(); } } if(!dbname || !dnstr) usage(); if((dnum = atoi(dnstr)) < 1) usage(); rv = procrandput(dbname, dnum); return rv; } /* parse arguments of the wicked command */ static int runwicked(int argc, char **argv){ char *dbname, *dnstr; int i, dnum, rv; dbname = NULL; dnstr = NULL; for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ usage(); } else if(!dbname){ dbname = argv[i]; } else if(!dnstr){ dnstr = argv[i]; } else { usage(); } } if(!dbname || !dnstr) usage(); if((dnum = atoi(dnstr)) < 1) usage(); rv = procwicked(dbname, dnum); return rv; } /* parse arguments of the regression command */ static int runregression(int argc, char **argv){ char *dbname; int i, rv; dbname = NULL; for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ usage(); } else if(!dbname){ dbname = argv[i]; } else { usage(); } } if(!dbname) usage(); rv = procregression(dbname); return rv; } /* perform the create command */ static int proccreate(const char *dbname, CBMAP *attrs){ ESTDB *db; const char *kbuf; int ecode, ksiz, type; if(!(db = est_db_open(dbname, ESTDBWRITER | ESTDBCREAT | g_oextmodes, &ecode))){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } est_db_set_informer(db, dbinform, NULL); cbmapiterinit(attrs); while((kbuf = cbmapiternext(attrs, &ksiz)) != NULL){ type = strtoidxtype(cbmapget(attrs, kbuf, ksiz, NULL)); if(!est_db_add_attr_index(db, kbuf, type)){ printferror("%s: %s", dbname, est_err_msg(est_db_error(db))); est_db_close(db, &ecode); return 1; } } if(!est_db_close(db, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } return 0; } /* perform the put command */ static int procput(const char *dbname, const char *filename){ ESTDB *db; ESTDOC *doc; const char *uri; char *draft; int ecode; if(!(draft = cbreadfile(filename, NULL))){ printferror("%s: could not open", filename ? filename : "(stdin)"); return 1; } if(!(db = est_db_open(dbname, ESTDBWRITER | ESTDBCREAT | g_oextmodes, &ecode))){ printferror("%s: %s", dbname, est_err_msg(ecode)); free(draft); return 1; } est_db_set_informer(db, dbinform, NULL); doc = est_doc_new_from_draft(draft); if(!est_db_put_doc(db, doc, g_putopts)){ printferror("%s: %s", dbname, est_err_msg(est_db_error(db))); est_doc_delete(doc); est_db_close(db, &ecode); free(draft); return 1; } if(!(uri = est_doc_attr(doc, ESTDATTRURI))) uri = ""; printfinfo("%d (%s): registered", est_doc_id(doc), uri); est_doc_delete(doc); if(!est_db_close(db, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); free(draft); return 1; } free(draft); return 0; } /* perform the out command */ static int procout(const char *dbname, int id, const char *expr){ ESTDB *db; int ecode; if(!(db = est_db_open(dbname, ESTDBWRITER, &ecode))){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } est_db_set_informer(db, dbinform, NULL); if(expr && (id = est_db_uri_to_id(db, expr)) < 1 && (id = est_db_uri_to_id(db, exprtouri(expr))) < 1){ printferror("%s: %s", dbname, est_err_msg(est_db_error(db))); est_db_close(db, &ecode); return 1; } if(!est_db_out_doc(db, id, g_outopts)){ printferror("%s: %s", dbname, est_err_msg(est_db_error(db))); est_db_close(db, &ecode); return 1; } printfinfo("%d: deleted", id); if(!est_db_close(db, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } return 0; } /* perform the edit command */ static int procedit(const char *dbname, int id, const char *expr, const char *name, const char *value){ ESTDB *db; ESTDOC *doc; char *str; int ecode; if(!(db = est_db_open(dbname, ESTDBWRITER, &ecode))){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } est_db_set_informer(db, dbinform, NULL); if(expr && (id = est_db_uri_to_id(db, expr)) < 1 && (id = est_db_uri_to_id(db, exprtouri(expr))) < 1){ printferror("%s: %s", dbname, est_err_msg(est_db_error(db))); est_db_close(db, &ecode); return 1; } if(!(doc = est_db_get_doc(db, id, ESTGDNOTEXT | ESTGDNOKWD))){ printferror("%s: %s", dbname, est_err_msg(est_db_error(db))); est_db_close(db, &ecode); return 1; } str = g_pathcode ? est_iconv(value, -1, g_pathcode, "UTF-8", NULL, NULL) : NULL; est_doc_add_attr(doc, name, str ? str : value); free(str); if(!est_db_edit_doc(db, doc)){ printferror("%s: %s", dbname, est_err_msg(est_db_error(db))); est_doc_delete(doc); est_db_close(db, &ecode); return 1; } est_doc_delete(doc); printfinfo("%d: edited", id); if(!est_db_close(db, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } return 0; } /* perform the get command */ static int procget(const char *dbname, const CBLIST *pidxs, int id, const char *expr, const char *attr){ ESTDB *db; ESTDOC *doc; char *draft; int i, ecode; if(!(db = est_db_open(dbname, ESTDBREADER | g_oextmodes, &ecode))){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } for(i = 0; i < cblistnum(pidxs); i++){ est_db_add_pseudo_index(db, cblistval(pidxs, i, NULL)); } if(expr && (id = est_db_uri_to_id(db, expr)) < 1 && (id = est_db_uri_to_id(db, exprtouri(expr))) < 1){ printferror("%s: %s", dbname, est_err_msg(est_db_error(db))); est_db_close(db, &ecode); return 1; } if(attr){ if(!(draft = est_db_get_doc_attr(db, id, attr))){ printferror("%s: %s", dbname, est_err_msg(est_db_error(db))); est_db_close(db, &ecode); return 1; } printf("%s\n", draft); free(draft); } else { if(!(doc = est_db_get_doc(db, id, 0))){ printferror("%s: %s", dbname, est_err_msg(est_db_error(db))); est_db_close(db, &ecode); return 1; } draft = est_doc_dump_draft(doc); printf("%s", draft); free(draft); est_doc_delete(doc); } if(!est_db_close(db, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } return 0; } /* perform the list command */ static int proclist(const char *dbname, int lp){ ESTDB *db; const char *path; char *vbuf; int ecode, id; if(!(db = est_db_open(dbname, ESTDBREADER | g_oextmodes, &ecode))){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } if(!est_db_iter_init(db, NULL)){ printferror("%s: %s", dbname, est_err_msg(est_db_error(db))); est_db_close(db, &ecode); return 1; } while((id = est_db_iter_next(db)) > 0){ if((vbuf = est_db_get_doc_attr(db, id, ESTDATTRURI)) != NULL){ printf("%d\t%s", id, vbuf); if(lp && (path = urltopath(vbuf)) != NULL){ printf("\t%s", path); } printf("\n"); free(vbuf); } } if(!est_db_close(db, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } return 0; } /* perform the uriid command */ static int procuriid(const char *dbname, const CBLIST *pidxs, const char *expr){ ESTDB *db; int i, ecode, id; if(!(db = est_db_open(dbname, ESTDBREADER | g_oextmodes, &ecode))){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } for(i = 0; i < cblistnum(pidxs); i++){ est_db_add_pseudo_index(db, cblistval(pidxs, i, NULL)); } if((id = est_db_uri_to_id(db, expr)) < 1 && (id = est_db_uri_to_id(db, exprtouri(expr))) < 1){ printferror("%s: %s", dbname, est_err_msg(est_db_error(db))); est_db_close(db, &ecode); return 1; } printf("%d\n", id); if(!est_db_close(db, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } return 0; } /* perform the meta command */ static int procmeta(const char *dbname, const char *mname, const char *mvalue){ ESTDB *db; CBLIST *names; char *vbuf; int i, ecode; if(!(db = est_db_open(dbname, mvalue ? (ESTDBWRITER | ESTDBCREAT) : (ESTDBREADER | ESTDBLCKNB), &ecode))){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } if(mname){ if(mvalue){ est_db_add_meta(db, mname, mvalue[0] != '\0' ? mvalue : NULL); } else { if((vbuf = est_db_meta(db, mname)) != NULL){ printf("%s\n", vbuf); free(vbuf); } } } else { names = est_db_meta_names(db); for(i = 0; i < cblistnum(names); i++){ printf("%s\n", cblistval(names, i, NULL)); } cblistclose(names); } if(!est_db_close(db, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } return 0; } /* perform the inform command */ static int procinform(const char *dbname){ ESTDB *db; CBLIST *exprs; int i, ecode; if(!(db = est_db_open(dbname, ESTDBREADER | g_oextmodes, &ecode))){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } printf("number of documents: %d\n", est_db_doc_num(db)); printf("number of words: %d\n", est_db_word_num(db)); printf("number of keywords: %d\n", est_db_keyword_num(db)); printf("file size: %.0f\n", est_db_size(db)); printf("inode number: %d\n", est_db_inode(db)); exprs = est_db_attr_index_exprs(db); printf("attribute indexes: "); for(i = 0; i < cblistnum(exprs); i++){ if(i > 0) printf(", "); printf("%s", cblistval(exprs, i, NULL)); } printf("\n"); printf("known options: "); i = 0; if(est_db_check_option(db, ESTDBPERFNG)){ if(i > 0) printf(", "); printf("perfng"); i++; } if(est_db_check_option(db, ESTDBCHRCAT)){ if(i > 0) printf(", "); printf("chrcat"); i++; } if(est_db_check_option(db, ESTDBSCVOID)){ if(i > 0) printf(", "); printf("scvoid"); i++; } if(est_db_check_option(db, ESTDBSCINT)){ if(i > 0) printf(", "); printf("scint"); i++; } if(est_db_check_option(db, ESTDBSCASIS)){ if(i > 0) printf(", "); printf("scasis"); i++; } printf("\n"); cblistclose(exprs); if(!est_db_close(db, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } return 0; } /* perform the optimize command */ static int procoptimize(const char *dbname){ ESTDB *db; int ecode; time_t curtime; curtime = time(NULL); if(!(db = est_db_open(dbname, ESTDBWRITER, &ecode))){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } est_db_set_informer(db, dbinform, NULL); if(!est_db_optimize(db, g_optopts)){ printferror("%s: %s", dbname, est_err_msg(est_db_error(db))); est_db_close(db, &ecode); return 1; } if(!est_db_close(db, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } curtime = time(NULL) - curtime; printfinfo("finished successfully: elapsed time: %dh %dm %ds", (int)(curtime / 3600), (int)((curtime / 60) % 60), (int)(curtime % 60)); return 0; } /* perform the merge command */ static int procmerge(const char *dbname, const char *tgname){ ESTDB *db; int ecode; time_t curtime; curtime = time(NULL); if(!(db = est_db_open(dbname, ESTDBWRITER, &ecode))){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } est_db_set_informer(db, dbinform, NULL); if(!est_db_merge(db, tgname, g_mgopts)){ printferror("%s: %s", dbname, est_err_msg(est_db_error(db))); est_db_close(db, &ecode); return 1; } if(!est_db_close(db, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } curtime = time(NULL) - curtime; printfinfo("finished successfully: elapsed time: %dh %dm %ds", (int)(curtime / 3600), (int)((curtime / 60) % 60), (int)(curtime % 60)); return 0; } /* perform the repair command */ static int procrepair(const char *dbname){ int ecode; if(!est_db_repair(dbname, g_rpopts, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } return 0; } /* perform the search command */ static int procsearch(const char *dbname, const CBLIST *pidxs, const char *phrase, const CBLIST *attrs, const char *ord, int max, int sk, int aux, double ec, int opts, int cd, int sim, const char *dis){ ESTDB *db; ESTCOND *cond; ESTDOC *doc, *tdoc; CBDATUM *pbuf; CBMAP *svmap, *hints, *kwords; const CBLIST *texts; CBLIST *names, *words, *lines; const char *kbuf, *vbuf, *line; char *draft, path[URIBUFSIZ], numbuf[NUMBUFSIZ], *word, *pv; const int *ary; int i, j, ecode, knum, ksiz, vsiz, *res, rnum, hits, snum, id, sc, anum, fin, cnt; double curtime; if(!(db = est_db_open(dbname, ESTDBREADER | g_oextmodes, &ecode))){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } for(i = 0; i < cblistnum(pidxs); i++){ est_db_add_pseudo_index(db, cblistval(pidxs, i, NULL)); } cond = est_cond_new(); if(sim > 0){ svmap = est_db_get_keywords(db, sim); if(!svmap && (doc = est_db_get_doc(db, sim, ESTGDNOATTR | ESTGDNOKWD)) != NULL){ knum = g_kwordnum > 0 ? g_kwordnum : KWORDNUM; svmap = g_usemorph ? est_morph_etch_doc(doc, knum) : est_db_etch_doc((opts & ESTCONDNOIDF) ? NULL : db, doc, knum); est_doc_delete(doc); } if(svmap){ pbuf = cbdatumopen(ESTOPSIMILAR, -1); cbmapiterinit(svmap); while((kbuf = cbmapiternext(svmap, &ksiz)) != NULL){ vbuf = cbmapget(svmap, kbuf, ksiz, &vsiz); cbdatumcat(pbuf, " WITH ", -1); cbdatumcat(pbuf, vbuf, vsiz); cbdatumcat(pbuf, " ", 1); cbdatumcat(pbuf, kbuf, ksiz); } est_cond_set_phrase(cond, cbdatumptr(pbuf)); cbdatumclose(pbuf); cbmapclose(svmap); } cd = FALSE; } else { while(*phrase > '\0' && *phrase <= ' '){ phrase++; } if(phrase[0] != '\0' || cblistnum(attrs) < 1) est_cond_set_phrase(cond, phrase); if(phrase[0] == '[' || phrase[0] == '*') cd = FALSE; } for(i = 0; i < cblistnum(attrs); i++){ est_cond_add_attr(cond, cblistval(attrs, i, NULL)); } if(ord) est_cond_set_order(cond, ord); if(max >= 0 && sk < 1 && !cd) est_cond_set_max(cond, max); est_cond_set_options(cond, opts); est_cond_set_auxiliary(cond, aux); if(ec > 0.0) est_cond_set_eclipse(cond, ec); if(dis) est_cond_set_distinct(cond, dis); hints = cbmapopenex(MINIBNUM); curtime = est_gettimeofday(); res = est_db_search(db, cond, &rnum, hints); hits = (vbuf = cbmapget(hints, "", 0, NULL)) ? atoi(vbuf) : rnum; if(max >= 0 && hits < max + 1 && est_cond_auxiliary_word(cond, "")){ free(res); est_cond_set_auxiliary(cond, -1); res = est_db_search(db, cond, &rnum, hints); hits = (vbuf = cbmapget(hints, "", 0, NULL)) ? atoi(vbuf) : rnum; } curtime = est_gettimeofday() - curtime; if(g_viewmode == VM_XML){ xmlprintf("\n"); xmlprintf("\n", _EST_XNSEARCH, est_version); xmlprintf("\n"); xmlprintf("\n", hits, est_cond_auxiliary_word(cond, "") ? "on" : "off"); cbmapiterinit(hints); while((kbuf = cbmapiternext(hints, NULL)) != NULL){ if(kbuf[0] == '\0') continue; vbuf = cbmapget(hints, kbuf, -1, NULL); xmlprintf("\n", kbuf, vbuf, est_cond_auxiliary_word(cond, kbuf) ? "on" : "off"); } xmlprintf("\n"); } else { printf("%s:END\n", est_border_str()); } free(res); cbmapclose(hints); est_cond_delete(cond); if(!est_db_close(db, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } return 0; } /* perform the gather command */ static int procgather(const char *dbname, const char *filename){ ESTDB *db; CBLIST *list, *clist, *attrs; FILE *ifp; const char *tmp; char *line, *path; int i, err, ecode, len; time_t curtime; struct stat sbuf; curtime = time(NULL); err = FALSE; if(stat(filename, &sbuf) != -1 && S_ISDIR(sbuf.st_mode)){ printfinfo("reading list from the directory: %s", filename); if((db = est_db_open(dbname, ESTDBWRITER | ESTDBCREAT | g_oextmodes, &ecode)) != NULL){ est_db_set_informer(db, dbinform, NULL); if(g_cachesize > 0){ if(g_cachesize > CACHEMAX) g_cachesize = CACHEMAX; est_db_set_cache_size(db, g_cachesize, -1, -1, -1); } list = cblistopen(); path = est_realpath(filename); cblistunshift(list, path, -1); free(path); while((line = cblistshift(list, &len)) != NULL){ if(stat(line, &sbuf) != -1 && S_ISDIR(sbuf.st_mode) && (clist = cbdirlist(line)) != NULL){ cblistsort(clist); for(i = cblistnum(clist) - 1; i >= 0; i--){ tmp = cblistval(clist, i, NULL); if(!strcmp(tmp, ESTCDIRSTR) || !strcmp(tmp, ESTPDIRSTR)) continue; if(ESTPATHCHR == '\\' && dosbadname(tmp)) continue; path = (len > 0 && line[len-1] == ESTPATHCHR) ? cbsprintf("%s%s", line, tmp) : cbsprintf("%s%c%s", line, ESTPATHCHR, tmp); cblistunshift(list, path, -1); free(path); } cblistclose(clist); } else { if(!doputdoc(db, line, NULL)){ printferror("%s: %s", line, est_err_msg(est_db_error(db))); err = TRUE; } doremovefile(line); } free(line); if(err || g_sigterm) break; } cblistclose(list); if(!est_db_close(db, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); err = TRUE; } } else { printferror("%s: %s", dbname, est_err_msg(ecode)); err = TRUE; } } else { if(!strcmp(filename, "-")){ ifp = stdin; printfinfo("reading list from the standard input", filename); } else if((ifp = fopen(filename, "rb")) != NULL){ printfinfo("reading list from the file: %s", filename); } else { printferror("%s: could not open", filename); return 1; } if((db = est_db_open(dbname, ESTDBWRITER | ESTDBCREAT | g_oextmodes, &ecode)) != NULL){ est_db_set_informer(db, dbinform, NULL); if(g_cachesize > 0){ if(g_cachesize > CACHEMAX) g_cachesize = CACHEMAX; est_db_set_cache_size(db, g_cachesize, -1, -1, -1); } while((line = fgetl(ifp)) != NULL){ if(line[0] == '\0'){ free(line); continue; } if(cblistnum(g_pathattrs) > 0){ attrs = cbsplit(line, -1, "\t"); path = cblistshift(attrs, NULL); if(!doputdoc(db, path, attrs)){ printferror("%s: %s", path, est_err_msg(est_db_error(db))); err = TRUE; } doremovefile(path); free(path); cblistclose(attrs); } else { if(!doputdoc(db, line, NULL)){ printferror("%s: %s", line, est_err_msg(est_db_error(db))); err = TRUE; } doremovefile(line); } free(line); if(err || g_sigterm) break; } if(!est_db_close(db, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); err = TRUE; } } else { printferror("%s: %s", dbname, est_err_msg(ecode)); err = TRUE; } if(ifp != stdin) fclose(ifp); } curtime = time(NULL) - curtime; if(!err) printfinfo("finished successfully: elapsed time: %dh %dm %ds", (int)(curtime / 3600), (int)((curtime / 60) % 60), (int)(curtime % 60)); return err ? 1 : 0; } /* perform the purge command */ static int procpurge(const char *dbname, const char *prefix, const CBLIST *attrs){ ESTDB *db; ESTCOND *cond; ESTDOC *doc; const char *luri, *path; char *attr; int i, ecode, err, *res, rnum; time_t curtime; struct stat sbuf; curtime = time(NULL); if(!(db = est_db_open(dbname, ESTDBWRITER, &ecode))){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } est_db_set_informer(db, dbinform, NULL); cond = est_cond_new(); attr = cbsprintf("%s STRBW %s", DATTRLPATH, prefix ? exprtouri(prefix) : ""); est_cond_add_attr(cond, attr); for(i = 0; i < cblistnum(attrs); i++){ est_cond_add_attr(cond, cblistval(attrs, i, NULL)); } res = est_db_search(db, cond, &rnum, NULL); err = FALSE; for(i = 0; i < rnum; i++){ if(!(doc = est_db_get_doc(db, res[i], ESTGDNOTEXT | ESTGDNOKWD))) continue; if((luri = est_doc_attr(doc, DATTRLPATH)) != NULL){ if((path = urltopath(luri)) != NULL){ if(!g_doforce && stat(path, &sbuf) != -1){ printfinfo("%s: passed", path); } else { if(g_nooper || est_db_out_doc(db, res[i], g_outopts)){ printfinfo("%d (%s): deleted", res[i], path); } else { printferror("%s: %s", dbname, est_err_msg(est_db_error(db))); err = TRUE; } } } else { printfinfo("%s: ignored", luri); } } else if(g_doforce){ luri = est_doc_attr(doc, ESTDATTRURI); if(g_nooper || est_db_out_doc(db, res[i], g_outopts)){ printfinfo("%d (%s): deleted", res[i], luri ? luri : "-"); } else { printferror("%s: %s", dbname, est_err_msg(est_db_error(db))); err = TRUE; } } else { printfinfo("(%d): ignored", res[i]); } est_doc_delete(doc); if(err || g_sigterm) break; } free(res); est_cond_delete(cond); free(attr); if(!est_db_close(db, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } curtime = time(NULL) - curtime; if(!err) printfinfo("finished successfully: elapsed time: %dh %dm %ds", (int)(curtime / 3600), (int)((curtime / 60) % 60), (int)(curtime % 60)); return err ? 1 : 0; } /* perform the extkeys command */ static int procextkeys(const char *dbname, const char *prefix, const CBLIST *attrs, const char *dfdbname, int ni){ static int count = 0; ESTDB *db; ESTCOND *cond; ESTDOC *doc; DEPOT *dfdb; CBMAP *kwords; const char *luri, *path, *vbuf; char *attr; int i, ecode, err, *res, rnum; double weight; time_t curtime; curtime = time(NULL); if(!(db = est_db_open(dbname, ESTDBWRITER, &ecode))){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } est_db_set_informer(db, dbinform, NULL); dfdb = NULL; if(!ni && dfdbname){ if(!(dfdb = dpopen(dfdbname, DP_OREADER, -1))){ printferror("%s: the document frequency database has some errors", dfdbname); return -1; } est_db_set_dfdb(db, dfdb); } if(!ni && !dfdb && !g_usemorph && (!prefix || prefix[0] == '\0')) est_db_fill_key_cache(db); cond = est_cond_new(); attr = cbsprintf("%s STRBW %s", DATTRLPATH, prefix ? exprtouri(prefix) : ""); est_cond_add_attr(cond, attr); for(i = 0; i < cblistnum(attrs); i++){ est_cond_add_attr(cond, cblistval(attrs, i, NULL)); } res = est_db_search(db, cond, &rnum, NULL); err = FALSE; for(i = 0; i < rnum; i++){ if(!g_doforce && est_db_measure_doc(db, res[i], ESTMDKWD) > 0){ printfinfo("%d: passed", res[i]); continue; } if(!(doc = est_db_get_doc(db, res[i], ESTGDNOKWD))) continue; luri = est_doc_attr(doc, DATTRLPATH); if(!luri && !(luri = est_doc_attr(doc, ESTDATTRURI))) luri = ""; kwords = g_usemorph ? est_morph_etch_doc(doc, g_kwordnum) : est_db_etch_doc(ni ? NULL : db, doc, g_kwordnum); weight = -1.0; if((g_putopts & ESTPDWEIGHT) && (vbuf = est_doc_attr(doc, ESTDATTRWEIGHT)) != NULL) weight = strtod(vbuf, NULL); if(weight < 0.0) weight = 1.0; if(g_nooper || est_db_put_keywords(db, res[i], kwords, weight)){ path = urltopath(luri); printfinfo("%d (%s): extracted", res[i], path ? path : luri); } else { printferror("%s: the keyword database has some errors", dbname); err = TRUE; } cbmapclose(kwords); est_doc_delete(doc); if(count++ % MEMCHKFREQ == 0){ if(est_memory_usage() > MEMLOADMAX && !est_db_flush(db, -1)){ printferror("%s: %s", est_db_name(db), est_err_msg(est_db_error(db))); err = TRUE; } if(!g_nochkvmem && !cbvmemavail(MEMCHKALW)){ printferror("exhausting memory"); err = TRUE; } } if(err || g_sigterm) break; } free(res); est_cond_delete(cond); free(attr); if(dfdb) dpclose(dfdb); if(!est_db_close(db, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } curtime = time(NULL) - curtime; if(!err) printfinfo("finished successfully: elapsed time: %dh %dm %ds", (int)(curtime / 3600), (int)((curtime / 60) % 60), (int)(curtime % 60)); return err ? 1 : 0; } /* perform the words command */ static int procwords(const char *dbname, const char *dfdbname, int kw, int kt){ ESTDB *db; ESTCOND *cond; DEPOT *dfdb; CBMAP *dfcc, *allkwd, *dockwd; KEYSC *scores; const char *kbuf, *vbuf; char *word, numbuf[NUMBUFSIZ]; int i, ecode, err, *res, rnum, ksiz, sc, scnum, len, num; if(!(db = est_db_open(dbname, ESTDBREADER | g_oextmodes, &ecode))){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } dfdb = NULL; if(dfdbname){ if(!(dfdb = dpopen(dfdbname, DP_OWRITER | DP_OCREAT, est_db_word_num(db) * 2 + 1))){ printferror("%s: the document frequency database has some errors", dfdbname); est_db_close(db, &ecode); return 1; } dpsetalign(dfdb, 4); } if(kt){ kw = TRUE; dfcc = cbmapopen(); est_db_keyword_iter_init(db); while((word = est_db_keyword_iter_next(db)) != NULL){ num = est_db_keyword_rec_size(db, word); cbmapput(dfcc, word, -1, (char *)&num, sizeof(int), FALSE); free(word); } cond = est_cond_new(); est_cond_set_options(cond, ESTCONDNOIDF | ESTCONDSCFB); est_cond_set_auxiliary(cond, 1); } else { dfcc = NULL; cond = NULL; } if(kw ? !est_db_keyword_iter_init(db) : !est_db_word_iter_init(db)){ printferror("%s: %s", dbname, est_err_msg(est_db_error(db))); err = TRUE; } err = FALSE; while(!err && (word = kw ? est_db_keyword_iter_next(db) : est_db_word_iter_next(db)) != NULL){ if(kt){ est_cond_set_phrase(cond, word); res = est_db_search(db, cond, &rnum, NULL); allkwd = cbmapopenex(MINIBNUM); for(i = 0; i < rnum && i < RELWDDMAX; i++){ if(!(dockwd = est_db_get_keywords(db, res[i]))) continue; cbmapiterinit(dockwd); while((kbuf = cbmapiternext(dockwd, &ksiz)) != NULL){ num = ((vbuf = cbmapget(dfcc, kbuf, ksiz, NULL)) != NULL ? *(int *)vbuf : 0) + 1024; sc = ((vbuf = cbmapget(allkwd, kbuf, ksiz, NULL)) != NULL ? atoi(vbuf) : 0) + pow((atoi(cbmapget(dockwd, kbuf, ksiz, NULL)) + 100) * pow(est_cond_score(cond, i) / 50.0, 1.2) / pow(num, 0.4), 0.7); if(ksiz < 3 || (((unsigned char *)kbuf)[0] >= 0xe0 && ksiz < 4)) sc /= 1.414; sprintf(numbuf, "%d", sc); cbmapput(allkwd, kbuf, ksiz, numbuf, -1, TRUE); } cbmapclose(dockwd); } scores = cbmalloc(cbmaprnum(allkwd) * sizeof(KEYSC) + 1); scnum = 0; cbmapiterinit(allkwd); while((kbuf = cbmapiternext(allkwd, &ksiz)) != NULL){ scores[scnum].word = kbuf; scores[scnum].pt = atoi(cbmapget(allkwd, kbuf, ksiz, NULL)); scnum++; } qsort(scores, scnum, sizeof(KEYSC), keysc_compare); printf("%s\t%d", word, rnum); for(i = 0; i < scnum && i < RELWDNUM; i++){ printf("\t%s\t%d", scores[i].word, scores[i].pt); } printf("\n"); free(scores); cbmapclose(allkwd); free(res); } else if(dfdb){ if((len = dpgetwb(dfdb, word, -1, 0, NUMBUFSIZ - 1, numbuf)) > 0){ numbuf[len] = '\0'; num = atoi(numbuf); } else { num = 0; } if(kw){ rnum = est_db_keyword_rec_size(db, word); } else { rnum = est_db_word_rec_size(db, word); } sprintf(numbuf, "%d", num + rnum); if(!dpput(dfdb, word, -1, numbuf, -1, DP_DOVER)){ printferror("%s: the document frequency database has some errors", dfdbname); err = TRUE; } } else { if(kw){ rnum = est_db_keyword_rec_size(db, word); } else { rnum = est_db_word_rec_size(db, word); } printf("%s\t%d\n", word, rnum); } free(word); if(g_sigterm) break; } if(cond) est_cond_delete(cond); if(dfcc) cbmapclose(dfcc); if(dfdb && !dpclose(dfdb)){ printferror("%s: the document frequency database has some errors", dfdbname); err = TRUE; } if(!est_db_close(db, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } return err ? 1 : 0; } /* perform the draft command */ static int procdraft(const char *filename){ ESTDOC *doc; CBMAP *kwords; struct stat sbuf; const char *kbuf; char *buf, *tbuf, *draft; int size, ksiz; if(!(buf = cbreadfile(filename, &size))){ printferror("%s: could not open", filename ? filename : "(stdin)"); return 1; } switch(g_filefmt){ case FF_TEXT: doc = est_doc_new_from_text(buf, size, g_inputcode, g_inputlang, g_bincheck); break; case FF_HTML: doc = est_doc_new_from_html(buf, size, g_inputcode, g_inputlang, g_bincheck); break; case FF_MIME: doc = est_doc_new_from_mime(buf, size, g_inputcode, g_inputlang, g_bincheck); break; default: doc = est_doc_new_from_draft_enc(buf, size, g_inputcode); break; } if(!doc){ printferror("%s: extraction failed", filename ? filename : "(stdin)"); free(buf); return 1; } if(g_limittsiz >= 0) est_doc_slim(doc, g_limittsiz); if(filename && stat(filename, &sbuf) == 0){ if(!est_doc_attr(doc, ESTDATTRURI)) est_doc_add_attr(doc, ESTDATTRURI, pathtourl(filename)); if(!est_doc_attr(doc, ESTDATTRMDATE)){ tbuf = cbdatestrwww(sbuf.st_mtime, 0); est_doc_add_attr(doc, ESTDATTRMDATE, tbuf); free(tbuf); } } if(g_kwordnum > 0){ kwords = g_usemorph ? est_morph_etch_doc(doc, g_kwordnum) : est_db_etch_doc(NULL, doc, g_kwordnum); cbmapiterinit(kwords); while((kbuf = cbmapiternext(kwords, &ksiz)) != NULL){ printf("%s\t%s\n", kbuf, cbmapget(kwords, kbuf, ksiz, NULL)); } cbmapclose(kwords); } else { draft = est_doc_dump_draft(doc); printf("%s", draft); free(draft); } est_doc_delete(doc); free(buf); return 0; } /* perform the break command */ static int procbreak(const char *filename, int wt){ CBLIST *words; char *str, *phrase; int i, size; if(filename && filename[0] == '@'){ str = cbmemdup(filename + 1, -1); size = strlen(str); } else if(!(str = cbreadfile(filename, &size))){ printferror("%s: could not open", filename ? filename : "(stdin)"); return 1; } if(!g_inputcode) g_inputcode = est_enc_name(str, size, g_inputlang); if(!(phrase = est_iconv(str, size, g_inputcode, "UTF-8", NULL, NULL))){ printferror("%s: unsupported encoding\n", g_inputcode); free(str); return 1; } words = cblistopen(); if(g_oextmodes & ESTDBPERFNG){ est_break_text_perfng(phrase, words, TRUE, wt); } else if(g_oextmodes & ESTDBCHRCAT){ est_break_text_chrcat(phrase, words, TRUE); } else { est_break_text(phrase, words, TRUE, wt); } for(i = 0; i < cblistnum(words); i++){ printf("%s\n", cblistval(words, i, NULL)); } cblistclose(words); free(phrase); free(str); return 0; } /* perform the iconv command */ static int prociconv(const char *filename){ char *istr, *ostr; int i, isiz, osiz; if(filename && filename[0] == '@'){ istr = cbmemdup(filename + 1, -1); isiz = strlen(istr); } else if(!(istr = cbreadfile(filename, &isiz))){ printferror("%s: could not open", filename ? filename : "(stdin)"); return 1; } if(!g_inputcode) g_inputcode = est_enc_name(istr, isiz, g_inputlang); if(!(ostr = est_iconv(istr, isiz, g_inputcode, g_outputcode, &osiz, NULL))){ printferror("%s: unsupported encoding\n", g_inputcode); free(istr); return 1; } for(i = 0; i < osiz; i++){ putchar(ostr[i]); } free(ostr); free(istr); return 0; } /* perform the regex command */ static int procregex(const char *regex, const char *filename, const char *repl, int inv, int ci){ FILE *ifp; char *regstr, *str, *tmp; void *regobj; regstr = cbsprintf("%s%s", ci ? "*I:" : "", regex); if(!(regobj = est_regex_new(regstr))){ printferror("%s: invalid regular expressions", regex); free(regstr); return 1; } if(!(ifp = filename ? fopen(filename, "rb") : stdin)){ printferror("%s: could not open", filename ? filename : "(stdin)"); est_regex_delete(regobj); free(regstr); return 1; } while((str = fgetl(ifp)) != NULL){ if(repl){ if((tmp = est_regex_replace(str, regstr, repl)) != NULL){ printf("%s\n", tmp); free(tmp); } } else if(inv){ if(!est_regex_match(regobj, str)) printf("%s\n", str); } else { if(est_regex_match(regobj, str)) printf("%s\n", str); } free(str); } if(ifp != stdin) fclose(ifp); est_regex_delete(regobj); free(regstr); return 0; } /* perform the scandir command */ static int procscandir(const char *dirname, int tmode, int pmode){ CBLIST *list, *clist; const char *tmp; char *line, *path; int i, len; struct stat sbuf; list = cblistopen(); cblistunshift(list, dirname, -1); while((line = cblistshift(list, &len)) != NULL){ if(stat(line, &sbuf) != -1 && S_ISDIR(sbuf.st_mode) && (clist = cbdirlist(line)) != NULL){ if(tmode != ST_FILE){ switch(pmode){ default: printf("%s\n", line); break; case SP_ABS: path = est_realpath(line); printf("%s\n", path); free(path); break; case SP_URL: printf("%s\n", pathtourl(line)); break; } } cblistsort(clist); for(i = cblistnum(clist) - 1; i >= 0; i--){ tmp = cblistval(clist, i, NULL); if(!strcmp(tmp, ESTCDIRSTR) || !strcmp(tmp, ESTPDIRSTR)) continue; if(ESTPATHCHR == '\\' && dosbadname(tmp)) continue; path = (len > 0 && line[len-1] == ESTPATHCHR) ? cbsprintf("%s%s", line, tmp) : cbsprintf("%s%c%s", line, ESTPATHCHR, tmp); cblistunshift(list, path, -1); free(path); } cblistclose(clist); } else if(tmode != ST_DIR){ switch(pmode){ default: printf("%s\n", line); break; case SP_ABS: path = est_realpath(line); printf("%s\n", path); free(path); break; case SP_URL: printf("%s\n", pathtourl(line)); break; } } free(line); } cblistclose(list); return 0; } /* perform the multi command */ static int procmulti(const CBLIST *dbnames, const char *phrase, const CBLIST *attrs, const char *ord, int max, int sk, int aux, int opts, int cd, const char *dis, int hu){ ESTDB **dbs; ESTCOND *cond; ESTDOC *doc; CBMAP *hints; const char *dbname, *kbuf, *vbuf; char *uri; int i, err, dbnum, dnum, wnum, ecode, *res, rnum, hits, cnt, snum, dbidx, id, sc; double curtime; err = FALSE; dbs = cbmalloc(sizeof(ESTDB *) * cblistnum(dbnames) + 1); dbnum = 0; dnum = 0; wnum = 0; for(i = 0; i < cblistnum(dbnames); i++){ dbname = cblistval(dbnames, i, NULL); if((dbs[dbnum] = est_db_open(dbname, ESTDBREADER | g_oextmodes, &ecode)) != NULL){ dnum += est_db_doc_num(dbs[dbnum]); wnum += est_db_word_num(dbs[dbnum]); dbnum++; } else { printferror("%s: %s", dbname, est_err_msg(ecode)); err = TRUE; } } cond = est_cond_new(); while(*phrase > '\0' && *phrase <= ' '){ phrase++; } if(phrase[0] != '\0' || cblistnum(attrs) < 1) est_cond_set_phrase(cond, phrase); if(phrase[0] == '[' || phrase[0] == '*') cd = FALSE; for(i = 0; i < cblistnum(attrs); i++){ est_cond_add_attr(cond, cblistval(attrs, i, NULL)); } if(ord) est_cond_set_order(cond, ord); if(max >= 0 && sk < 1 && !cd) est_cond_set_max(cond, max); est_cond_set_options(cond, opts); est_cond_set_auxiliary(cond, aux); if(dis) est_cond_set_distinct(cond, dis); hints = cbmapopenex(MINIBNUM); curtime = est_gettimeofday(); res = est_db_search_meta(dbs, dbnum, cond, &rnum, hints); hits = (vbuf = cbmapget(hints, "", 0, NULL)) ? atoi(vbuf) : rnum / 2; if(max >= 0 && hits < max + 1 && est_cond_auxiliary_word(cond, "")){ free(res); est_cond_set_auxiliary(cond, -1); res = est_db_search_meta(dbs, dbnum, cond, &rnum, hints); hits = (vbuf = cbmapget(hints, "", 0, NULL)) ? atoi(vbuf) : rnum / 2; } printf("%s\n", est_border_str()); printf("VERSION\t%s\n", _EST_PROTVER); printf("NODE\tlocal\n"); printf("HIT\t%d%s\n", hits, est_cond_auxiliary_word(cond, "") ? "+" : ""); cbmapiterinit(hints); cnt = 1; while((kbuf = cbmapiternext(hints, NULL)) != NULL){ if(kbuf[0] == '\0') continue; vbuf = cbmapget(hints, kbuf, -1, NULL); printf("HINT#%d\t%s\t%s%s\n", cnt, kbuf, vbuf, est_cond_auxiliary_word(cond, kbuf) ? "+" : ""); cnt++; } curtime = est_gettimeofday() - curtime; printf("TIME\t%.6f\n", curtime / 1000.0); printf("DOCNUM\t%d\n", dnum); printf("WORDNUM\t%d\n", wnum); printf("VIEW\tMULTI\n"); printf("\n"); printf("%s\n", est_border_str()); snum = max >= 0 && max < rnum ? max : rnum / 2; for(i = 0; i < rnum && snum > 0; i += 2){ dbidx = res[i]; id = res[i+1]; sc = est_cond_score(cond, i / 2); if(cd || hu){ if(!(doc = est_db_get_doc(dbs[dbidx], id, (cd ? 0 : ESTGDNOTEXT) | ESTGDNOKWD))) continue; if(cd && !est_db_scan_doc(dbs[dbidx], doc, cond)){ est_doc_delete(doc); continue; } vbuf = hu ? est_doc_attr(doc, ESTDATTRURI) : NULL; uri = vbuf ? cbmemdup(vbuf, -1) : NULL; est_doc_delete(doc); } else { uri = NULL; } if(sk-- > 0){ free(uri); continue; } printf("%d\t%d", dbidx, id); if(sc >= 0) printf("\t%d", sc); if(uri) printf("\t%s", uri); printf("\n"); free(uri); snum--; } printf("%s:END\n", est_border_str()); free(res); cbmapclose(hints); est_cond_delete(cond); for(i = 0; i < dbnum; i++){ if(!est_db_close(dbs[i], &ecode)){ printferror("dbs[%d]: %s", i, est_err_msg(ecode)); err = TRUE; } } free(dbs); return err ? 1 : 0; } /* perform the randput command */ static int procrandput(const char *dbname, int dnum){ ESTDB *db; ESTDOC *doc; const char *mode; char uri[URIBUFSIZ]; int i, ecode, err; time_t curtime; curtime = time(NULL); if(!(db = est_db_open(dbname, ESTDBWRITER | ESTDBCREAT | ESTDBTRUNC, &ecode))){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } est_db_set_informer(db, dbinform, NULL); if(g_cachesize > 0){ if(g_cachesize > CACHEMAX) g_cachesize = CACHEMAX; est_db_set_cache_size(db, g_cachesize, -1, -1, -1); } err = FALSE; for(i = 0; i < dnum; i++){ doc = est_doc_new_from_chaos(RDOCCNUM, RDOCSNUM, g_rdmode); sprintf(uri, "file:///tmp/randput-%08d-%05d.est", i + 1, (int)getpid()); est_doc_add_attr(doc, ESTDATTRURI, uri); if(est_db_put_doc(db, doc, 0)){ if(!(mode = est_doc_attr(doc, "mode"))) mode = "unknown"; printfinfo("%d (%s) (%s): registered", est_doc_id(doc), uri, mode); } else { printferror("%s: %s", dbname, est_err_msg(est_db_error(db))); err = TRUE; } est_doc_delete(doc); if(err || g_sigterm) break; } if(!est_db_close(db, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } curtime = time(NULL) - curtime; if(!err) printfinfo("finished successfully: elapsed time: %dh %dm %ds", (int)(curtime / 3600), (int)((curtime / 60) % 60), (int)(curtime % 60)); return err ? 1 : 0; } /* perform the wicked command */ static int procwicked(const char *dbname, int dnum){ ESTDB *db; ESTDOC *doc; ESTCOND *cond; CBLIST *words; char uri[URIBUFSIZ], *oper, *value, *first, *second, *phrase; int i, j, ecode, err, *res, rnum, size; double rnd; time_t curtime; curtime = time(NULL); if(!(db = est_db_open(dbname, ESTDBWRITER | ESTDBCREAT | ESTDBTRUNC, &ecode))){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } est_db_set_informer(db, dbinform, NULL); est_db_set_cache_size(db, 1024 * 1024 * 128, 1024, 256, 64); est_db_set_special_cache(db, ESTDATTRURI, 128); err = FALSE; for(i = 0; i < dnum; i++){ rnd = est_random(); if((int)(rnd * INT_MAX) % dnum < 5){ rnd = est_random(); if(rnd < 0.3){ if(!est_db_close(db, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } if(!(db = est_db_open(dbname, ESTDBWRITER, &ecode))){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } est_db_set_informer(db, dbinform, NULL); est_db_set_cache_size(db, 1024 * 1024 * 128, 1024, 256, 64); est_db_set_special_cache(db, ESTDATTRURI, i / 10 + 1); } else if(rnd < 0.5){ if(!est_db_optimize(db, (int)(est_random() * INT_MAX) % 2 == 0) ? ESTOPTNOPURGE : 0) err = TRUE; } else if(rnd < 0.8){ if(!est_db_flush(db, 1024)) err = TRUE; } else { if(!est_db_sync(db)) err = TRUE; } } else if(rnd < 0.05){ if(est_db_out_doc(db, (int)(est_random() * INT_MAX) % (i + 1) + 1, ((int)(est_random() * INT_MAX) % 2 == 0) ? ESTODCLEAN : 0)){ printfinfo("[%d:%d]: out", i + 1, est_db_doc_num(db)); } else if(est_db_error(db) != ESTENOITEM){ err = TRUE; } } else if(rnd < 0.1){ if((value = est_db_get_doc_attr(db, (int)(est_random() * INT_MAX) % (i + 1) + 1, ESTDATTRURI)) != NULL){ printfinfo("[%d:%d]: attr: %s", i + 1, est_db_doc_num(db), value); free(value); } } else if(rnd < 0.25){ rnd = est_random(); if(rnd < 0.5){ oper = " OR "; } else if(rnd < 0.7){ oper = " AND "; } else if(rnd < 0.8){ oper = " NOTAND "; } else if(rnd < 0.9){ oper = " "; } else { oper = ""; } first = est_random_str(5, (int)(est_random() * INT_MAX) % RD_RAND); second = est_random_str(2, (int)(est_random() * INT_MAX) % RD_RAND); phrase = cbsprintf("%s%s%s", first, oper, second); cond = est_cond_new(); est_cond_set_phrase(cond, phrase); if(est_random() < 0.25) est_cond_add_attr(cond, "@uri STREW 0.est"); if(est_random() < 0.25) est_cond_set_order(cond, "@uri STRD"); if(est_random() < 0.05) est_cond_set_options(cond, ESTCONDSURE | ESTCONDSCFB); if(est_random() < 0.05) est_cond_set_options(cond, ESTCONDAGITO | ESTCONDNOIDF); res = est_db_search(db, cond, &rnum, NULL); printfinfo("[%d:%d]: search: %d hits", i + 1, est_db_doc_num(db), rnum); if(est_random() < 0.05){ for(j = 0; j < rnum && j < 100; j++){ if((doc = est_db_get_doc(db, res[j], 0)) != NULL){ if(i % 10 == 0){ free(est_doc_cat_texts(doc)); free(est_doc_dump_draft(doc)); words = cblistopen(); cblistpush(words, "vw", -1); cblistpush(words, "xy", -1); cblistpush(words, "z", -1); free(est_doc_make_snippet(doc, words, 100, 10, 10)); cblistclose(words); } est_doc_delete(doc); } else if(est_db_error(db) != ESTENOITEM){ err = TRUE; } } } free(res); est_cond_delete(cond); free(phrase); free(first); free(second); } else { doc = est_doc_new_from_chaos(100, 3, est_random() < 0.5 ? RD_EURO : RD_RAND); if(est_random() < 0.2){ sprintf(uri, "file:///tmp/wicked-%08d-%05d.est", (int)(est_random() * INT_MAX) % (i + 1) + 1, (int)getpid()); } else { sprintf(uri, "file:///tmp/wicked-%08d-%05d.est", i + 1, (int)getpid()); } est_doc_add_attr(doc, ESTDATTRURI, uri); if(!est_db_put_doc(db, doc, est_random() < 0.5 ? ESTPDCLEAN : 0)) err = TRUE; if(est_random() < 0.1){ if(!est_db_set_doc_entity(db, est_doc_id(doc), uri, strlen(uri))) err = TRUE; value = est_db_get_doc_entity(db, est_doc_id(doc), &size); if(!value || strcmp(value, uri)) err = TRUE; free(value); } est_doc_delete(doc); } if(err || g_sigterm) break; } if(err) printferror("%s: %s", dbname, est_err_msg(est_db_error(db))); if(!est_db_close(db, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } curtime = time(NULL) - curtime; if(!err) printfinfo("finished successfully: elapsed time: %dh %dm %ds", (int)(curtime / 3600), (int)((curtime / 60) % 60), (int)(curtime % 60)); return err ? 1 : 0; } /* perform the regression command */ static int procregression(const char *dbname){ ESTDB *db, **dbs; ESTDOC *doc, *ndoc; ESTCOND *cond, *ncond; ESTRESMAPELEM *elems; CBMAP *hints, *rmap; const int *ary; char numbuf[NUMBUFSIZ]; int i, ecode, err, *res, rnum, anum, onum; time_t curtime; curtime = time(NULL); printfinfo("# opening the database"); if(!(db = est_db_open(dbname, ESTDBWRITER | ESTDBCREAT | ESTDBTRUNC, &ecode))){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } est_db_set_informer(db, dbinform, NULL); err = FALSE; if(!err){ printfinfo("# checking registration of small documents"); doc = est_doc_new(); est_doc_add_attr(doc, ESTDATTRURI, "file:///small/one"); est_doc_add_text(doc, "One!"); est_doc_add_hidden_text(doc, "(Check it out, come on!)"); if(!est_db_put_doc(db, doc, ESTPDCLEAN)) err = TRUE; est_doc_delete(doc); doc = est_doc_new(); est_doc_add_attr(doc, ESTDATTRURI, "file:///small/two"); est_doc_add_text(doc, "Two!!"); est_doc_add_hidden_text(doc, "(Check it out, come on!)"); if(!est_db_put_doc(db, doc, ESTPDCLEAN)) err = TRUE; est_doc_delete(doc); doc = est_doc_new(); est_doc_add_attr(doc, ESTDATTRURI, "file:///small/three"); est_doc_add_text(doc, "Three!!!"); est_doc_add_hidden_text(doc, "(Check it out, come on!)"); if(!est_db_put_doc(db, doc, ESTPDCLEAN)) err = TRUE; est_doc_delete(doc); doc = est_doc_new(); est_doc_add_attr(doc, ESTDATTRURI, "file:///empty"); if(!est_db_put_doc(db, doc, ESTPDCLEAN)) err = TRUE; est_doc_delete(doc); } if(!err){ printfinfo("# checking registration of an english document"); doc = est_doc_new(); est_doc_add_attr(doc, ESTDATTRURI, "file:///english"); est_doc_add_attr(doc, ESTDATTRTITLE, "Hyper Estraier"); est_doc_add_text(doc, "% This is a displayed sentence. ;-)"); est_doc_add_text(doc, "Hyper Estraier is a full-text search system for communities."); est_doc_add_text(doc, "A little suffering is good for the soul."); est_doc_add_text(doc, "They have been at a great feast of languages, and stolen the scraps."); est_doc_add_hidden_text(doc, "(Give it up, Yo! Give it up, Yo!)"); est_doc_add_hidden_text(doc, "% This is a hidden sentence. :-<"); est_doc_add_hidden_text(doc, "(Check it out, come on!)"); est_doc_add_hidden_text(doc, ""); if(!est_db_put_doc(db, doc, ESTPDCLEAN)) err = TRUE; est_doc_delete(doc); } if(!err){ printfinfo("# checking registration of a japanese document"); doc = est_doc_new(); est_doc_add_attr(doc, ESTDATTRURI, "file:///japanese"); est_doc_add_attr(doc, ESTDATTRTITLE, "\xe5\xb9\xb3\xe6\x9e\x97\xe5\xb9\xb9\xe9\x9b\x84"); est_doc_add_text(doc, "\xe6\x9c\xac\xe6\x97\xa5\xe3\x81\xaf\xe6\x99\xb4\xe5\xa4\xa9\xe3" "\x81\xaa\xe3\x82\x8a\xe3\x80\x82"); est_doc_add_text(doc, "\xe6\x9c\x95\xe3\x81\xaf\xe5\x9b\xbd\xe5\xae\xb6\xe7\xac\xac\xe4" "\xb8\x80\xe3\x81\xae\xe4\xb8\x8b\xe5\x83\x95\xe3\x81\xa7\xe3\x81" "\x82\xe3\x82\x8b\xe3\x80\x82"); est_doc_add_hidden_text(doc, "(Check it out, come on!)"); if(!est_db_put_doc(db, doc, ESTPDCLEAN)) err = TRUE; est_doc_delete(doc); } if(!err){ printfinfo("# checking duplication of documents"); doc = est_doc_new(); est_doc_add_attr(doc, ESTDATTRURI, "file:///duplication"); est_doc_add_text(doc, "Gamble, you gatta chance to make a Rumble!"); est_doc_add_hidden_text(doc, "(Check it out, come on!)"); if(!est_db_put_doc(db, doc, ESTPDCLEAN)) err = TRUE; est_doc_delete(doc); doc = est_doc_new(); est_doc_add_attr(doc, ESTDATTRURI, "file:///duplication"); est_doc_add_text(doc, "bring back hey, one more time!"); est_doc_add_hidden_text(doc, "(Check it out, come on!)"); if(!est_db_put_doc(db, doc, ESTPDCLEAN)) err = TRUE; est_doc_delete(doc); if(est_db_doc_num(db) != 7){ printferror("%s: the number of documents is invalid", dbname); err = TRUE; } } if(!err){ printfinfo("# checking search for unfixed documents"); cond = est_cond_new(); est_cond_set_phrase(cond, "check"); res = est_db_search(db, cond, &rnum, NULL); if(rnum != 6){ printferror("%s: the number of result is invalid", dbname); err = TRUE; } free(res); est_cond_delete(cond); } if(!err){ printfinfo("# checking partial flushing of the index"); if(!est_db_flush(db, 32)) err = TRUE; } if(!err){ printfinfo("# checking deletion with cleaning of a document"); if(!est_db_out_doc(db, 1, ESTODCLEAN)) err = TRUE; } if(!err){ printfinfo("# checking synchronization"); if(!est_db_sync(db)) err = TRUE; } if(!err){ printfinfo("# checking deletion without cleaning of a document"); if(!est_db_out_doc(db, 2, 0)) err = TRUE; } if(!err){ printfinfo("# checking word search"); cond = est_cond_new(); est_cond_set_phrase(cond, "check it AND on"); res = est_db_search(db, cond, &rnum, NULL); if(rnum != 5){ printferror("%s: the number of result is invalid", dbname); err = TRUE; } free(res); est_cond_set_phrase(cond, "RUMBLE OR \xe3\x80\x82"); res = est_db_search(db, cond, &rnum, NULL); if(rnum != 1){ printferror("%s: the number of result is invalid", dbname); err = TRUE; } free(res); est_cond_delete(cond); } if(!err){ printfinfo("# checking attribute search"); cond = est_cond_new(); est_cond_add_attr(cond, "@uri !ISTRINC SMaLl"); res = est_db_search(db, cond, &rnum, NULL); if(rnum != est_db_doc_num(db) - 1){ printferror("%s: the number of result is invalid", dbname); err = TRUE; } free(res); est_cond_delete(cond); cond = est_cond_new(); est_cond_add_attr(cond, "@uri STRBW file://"); est_cond_add_attr(cond, "@title STRINC \xe5\xb9\xb3"); res = est_db_search(db, cond, &rnum, NULL); if(rnum != 1){ printferror("%s: the number of result is invalid", dbname); err = TRUE; } free(res); est_cond_delete(cond); } if(!err){ printfinfo("# checking combined search"); cond = est_cond_new(); est_cond_set_phrase(cond, "\xe5\x9b\xbd\xe5\xae\xb6\xe7\xac\xac\xe4\xb8\x80"); est_cond_add_attr(cond, "@uri"); est_cond_set_order(cond, "@title"); res = est_db_search(db, cond, &rnum, NULL); if(rnum != 1){ printferror("%s: the number of result is invalid", dbname); err = TRUE; } free(res); est_cond_delete(cond); cond = est_cond_new(); est_cond_set_phrase(cond, "one | \xe3\x80\x82 | check & check it ! hogehoge"); est_cond_add_attr(cond, "@uri STRBW file://"); est_cond_set_order(cond, "@title STRD"); est_cond_set_options(cond, ESTCONDSURE | ESTCONDNOIDF | ESTCONDSIMPLE); res = est_db_search(db, cond, &rnum, NULL); if(rnum != 4){ printferror("%s: the number of result is invalid", dbname); err = TRUE; } free(res); est_cond_delete(cond); } if(!err){ printfinfo("# checking optimization"); if(!est_db_optimize(db, 0)) err = TRUE; cond = est_cond_new(); est_cond_set_phrase(cond, "check"); res = est_db_search(db, cond, &rnum, NULL); if(rnum != 4){ printferror("%s: the number of result is invalid", dbname); err = TRUE; } free(res); est_cond_delete(cond); } if(!err){ printfinfo("# checking traversal access"); cond = est_cond_new(); est_cond_set_phrase(cond, ESTOPUVSET); res = est_db_search(db, cond, &rnum, NULL); for(i = 0; i < rnum; i++){ if(!(doc = est_db_get_doc(db, res[i], 0))){ printferror("%s: a document cannot be retrieved", dbname); err = TRUE; break; } est_doc_delete(doc); } free(res); est_cond_delete(cond); } if(!err){ printfinfo("# checking deletion with cleaning of a document"); cond = est_cond_new(); est_cond_add_attr(cond, "@uri STRINC"); res = est_db_search(db, cond, &rnum, NULL); for(i = 0; i < rnum; i++){ if(!est_db_out_doc(db, res[i], ESTODCLEAN)) err = TRUE; } free(res); est_cond_delete(cond); } if(!err){ printfinfo("# checking attribute search with attribute indexes"); if(!est_db_add_attr_index(db, "seq", ESTIDXATTRSEQ)) err = TRUE; if(!est_db_add_attr_index(db, "str", ESTIDXATTRSTR)) err = TRUE; if(!est_db_add_attr_index(db, "num", ESTIDXATTRNUM)) err = TRUE; for(i = 1; i <= 100; i++){ doc = est_doc_new(); sprintf(numbuf, "%d", i); est_doc_add_attr(doc, ESTDATTRURI, numbuf); sprintf(numbuf, "%d", i / 2); est_doc_add_attr(doc, "seq", numbuf); est_doc_add_attr(doc, "str", numbuf); est_doc_add_attr(doc, "num", numbuf); if(!est_db_put_doc(db, doc, 0)) err = TRUE; est_doc_delete(doc); } cond = est_cond_new(); est_cond_add_attr(cond, "seq STREQ 30"); est_cond_add_attr(cond, "str STREQ 30"); est_cond_add_attr(cond, "num NUMEQ 30"); res = est_db_search(db, cond, &rnum, NULL); if(rnum != 2){ printferror("%s: the number of result is invalid", dbname); err = TRUE; } free(res); est_cond_delete(cond); cond = est_cond_new(); est_cond_add_attr(cond, "num NUMGE 10"); est_cond_add_attr(cond, "num NUMLT 20"); res = est_db_search(db, cond, &rnum, NULL); if(rnum != 20){ printferror("%s: the number of result is invalid", dbname); err = TRUE; } free(res); est_cond_delete(cond); } if(err) printferror("%s: %s", dbname, est_err_msg(est_db_error(db))); if(!err){ printfinfo("# checking object duplication"); doc = est_doc_new(); ndoc = est_doc_dup(doc); est_doc_delete(doc); est_doc_delete(ndoc); doc = est_doc_new(); est_doc_set_id(doc, 100); est_doc_add_attr(doc, "@uri", "original.mp3"); est_doc_add_attr(doc, "@title", "TAKE IT TO THE TOP"); est_doc_add_text(doc, "fly over the mountains"); est_doc_add_text(doc, "jump into the sea"); est_doc_add_text(doc, "move all the planets baby give them all to me"); est_doc_add_hidden_text(doc, "Don't stop!"); ndoc = est_doc_dup(doc); est_doc_add_attr(doc, "@uri", "duplication.mp3"); if(!est_db_put_doc(db, doc, ESTPDCLEAN) || !est_db_put_doc(db, ndoc, ESTPDCLEAN)){ printferror("%s: document object duplication failed", dbname); err = TRUE; } est_doc_delete(ndoc); est_doc_delete(doc); cond = est_cond_new(); ncond = est_cond_dup(cond); est_cond_delete(cond); est_cond_delete(ncond); cond = est_cond_new(); est_cond_set_phrase(cond, "fly sea"); est_cond_add_attr(cond, "@uri ISTREW .mp3"); est_cond_add_attr(cond, "@title ISTRINC take"); est_cond_set_order(cond, "@uri STRD"); est_cond_set_options(cond, ESTCONDAGITO); est_cond_set_options(cond, ESTCONDSIMPLE); est_cond_set_auxiliary(cond, 64); est_cond_set_eclipse(cond, 0.5); res = est_db_search(db, cond, &rnum, NULL); ncond = est_cond_dup(cond); for(i = 0; i < rnum; i++){ ary = est_cond_shadows(ncond, res[i], &anum); if(anum < 1){ printferror("%s: condition object duplication failed", dbname); err = TRUE; } } free(res); est_cond_delete(cond); est_cond_delete(ncond); } printfinfo("# checking meta search"); dbs = cbmalloc(5 * sizeof(ESTDB *)); for(i = 0; i < 5; i++){ dbs[i] = db; } cond = est_cond_new(); est_cond_set_phrase(cond, "all OR jump OR planets OR hoge"); est_cond_set_order(cond, "[IDD]"); est_cond_set_options(cond, ESTCONDSCFB); hints = cbmapopen(); free(est_db_search(db, cond, &onum, NULL)); res = est_db_search_meta(dbs, 5, cond, &rnum, hints); if(rnum != onum * 10){ printferror("%s: the number of result is invalid", dbname); err = TRUE; } free(res); cbmapclose(hints); est_cond_delete(cond); cond = est_cond_new(); est_cond_set_phrase(cond, "[UVSET]"); est_cond_add_attr(cond, "@uri ISTRRX [a-z2-3]"); est_cond_set_order(cond, "@title STRD"); est_cond_set_options(cond, ESTCONDSCFB); hints = cbmapopen(); free(est_db_search(db, cond, &onum, NULL)); res = est_db_search_meta(dbs, 5, cond, &rnum, hints); if(rnum != onum * 10){ printferror("%s: the number of result is invalid", dbname); err = TRUE; } free(res); cbmapclose(hints); est_cond_delete(cond); free(dbs); printfinfo("# closing the database"); if(!est_db_close(db, &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } printfinfo("# checking result map"); rmap = cbmapopen(); est_resmap_add(rmap, "one", 10, ESTRMLOSUM); est_resmap_add(rmap, "two", 10, ESTRMLOSUM); est_resmap_add(rmap, "two", 10, ESTRMLOSUM); est_resmap_add(rmap, "three", 10, ESTRMLOSUM); est_resmap_add(rmap, "three", 10, ESTRMLOSUM); est_resmap_add(rmap, "three", 10, ESTRMLOSUM); elems = est_resmap_dump(rmap, 2, &rnum); for(i = 0; i < rnum; i++){ free(cbmemdup(elems[i].key, -1)); } free(elems); cbmapclose(rmap); curtime = time(NULL) - curtime; if(!err) printfinfo("# finished successfully: elapsed time: %dh %dm %ds", (int)(curtime / 3600), (int)((curtime / 60) % 60), (int)(curtime % 60)); return err ? 1 : 0; } /* output escaped string */ static void xmlprintf(const char *format, ...){ va_list ap; char *tmp, cbuf[32]; unsigned char c; int cblen; va_start(ap, format); while(*format != '\0'){ if(*format == '%'){ cbuf[0] = '%'; cblen = 1; format++; while(strchr("0123456789 .+-", *format) && *format != '\0' && cblen < sizeof(cbuf) - 1){ cbuf[cblen++] = *format; format++; } cbuf[cblen++] = *format; cbuf[cblen] = '\0'; switch(*format){ case 's': tmp = va_arg(ap, char *); if(!tmp) tmp = "(null)"; printf(cbuf, tmp); break; case 'd': printf(cbuf, va_arg(ap, int)); break; case 'o': case 'u': case 'x': case 'X': case 'c': printf(cbuf, va_arg(ap, unsigned int)); break; case 'e': case 'E': case 'f': case 'g': case 'G': printf(cbuf, va_arg(ap, double)); break; case '@': tmp = va_arg(ap, char *); if(!tmp) tmp = "(null)"; while(*tmp){ switch(*tmp){ case '&': printf("&"); break; case '<': printf("<"); break; case '>': printf(">"); break; case '"': printf("""); break; default: if(!((*tmp >= 0 && *tmp <= 0x8) || (*tmp >= 0x0e && *tmp <= 0x1f))) putchar(*tmp); break; } tmp++; } break; case '?': tmp = va_arg(ap, char *); if(!tmp) tmp = "(null)"; while(*tmp){ c = *(unsigned char *)tmp; if((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || (c != '\0' && strchr("_-.", c))){ putchar(c); } else { printf("%%%02X", c); } tmp++; } break; case '%': putchar('%'); break; } } else { putchar(*format); } format++; } va_end(ap); } /* get the index data type value */ static int strtoidxtype(const char *str){ if(!cbstricmp(str, "str")) return ESTIDXATTRSTR; if(!cbstricmp(str, "num")) return ESTIDXATTRNUM; return ESTIDXATTRSEQ; } /* get the language value */ static int strtolang(const char *str){ if(!cbstricmp(str, "en")) return ESTLANGEN; if(!cbstricmp(str, "ja")) return ESTLANGJA; if(!cbstricmp(str, "zh")) return ESTLANGZH; if(!cbstricmp(str, "ko")) return ESTLANGKO; return ESTLANGMISC; } /* read a line */ static char *fgetl(FILE *ifp){ char *buf; int c, len, blen; buf = NULL; len = 0; blen = 1024; while((c = fgetc(ifp)) != EOF){ if(blen <= len) blen *= 2; buf = cbrealloc(buf, blen + 1); if(c == '\n') c = '\0'; if(c != '\r') buf[len++] = c; if(c == '\0') break; } if(!buf) return NULL; buf[len] = '\0'; return buf; } /* register a document */ static int doputdoc(ESTDB *db, const char *path, const CBLIST *attrs){ static int count = 0; ESTDOC *doc, *edoc; CBMAP *kwords; const char *uri, *vbuf, *xcmd, *lreal, *lfile; char *dbuf, *tbuf, numbuf[NUMBUFSIZ]; int i, err, fmt, id, dsiz, score; time_t emdate, fmdate; struct stat sbuf; xcmd = NULL; if(cbmaprnum(g_xcmdmap) > 0){ cbmapiterinit(g_xcmdmap); while((vbuf = cbmapiternext(g_xcmdmap, NULL)) != NULL){ if(!strcmp(vbuf, "*") || cbstrbwimatch(path, vbuf)){ xcmd = cbmapget(g_xcmdmap, vbuf, -1, NULL); break; } } } fmt = g_filefmt; if(g_filefmt == FF_NONE && !xcmd) return TRUE; if(g_filefmt == FF_AUTO){ if(cbstrbwimatch(path, ESTEXTSTR "est")){ fmt = FF_DRAFT; } else if(cbstrbwimatch(path, ESTEXTSTR "txt") || cbstrbwimatch(path, ESTEXTSTR "text") || cbstrbwimatch(path, ESTEXTSTR "asc")){ fmt = FF_TEXT; } else if(cbstrbwimatch(path, ESTEXTSTR "html") || cbstrbwimatch(path, ESTEXTSTR "htm") || cbstrbwimatch(path, ESTEXTSTR "xhtml") || cbstrbwimatch(path, ESTEXTSTR "xht")){ fmt = FF_HTML; } else if(cbstrbwimatch(path, ESTEXTSTR "eml") || cbstrbwimatch(path, ESTEXTSTR "mime") || cbstrbwimatch(path, ESTEXTSTR "mht") || cbstrbwimatch(path, ESTEXTSTR "mhtml")){ fmt = FF_MIME; } else if(!xcmd){ return TRUE; } } if(stat(path, &sbuf) == -1 || !S_ISREG(sbuf.st_mode) || !(uri = pathtourl(path))){ printferror("%s: could not open", path); return TRUE; } if(g_limitfsiz >= 0 && sbuf.st_size > g_limitfsiz){ printferror("%s: exceeding the file size limitation", path); return TRUE; } emdate = -1; if(g_chkmdate && (id = est_db_uri_to_id(db, uri)) > 0 && (tbuf = est_db_get_doc_attr(db, id, ESTDATTRMDATE)) != NULL){ emdate = cbstrmktime(tbuf); free(tbuf); } if(g_stdate && emdate >= 0 && emdate >= sbuf.st_mtime){ printfinfo("%s: passed (old document)", path); return TRUE; } if(g_filtorig){ dbuf = cbmemdup("", 0); dsiz = 0; } else { if(!(dbuf = cbreadfile(path, &dsiz))){ printferror("%s: could not open", path); return TRUE; } } if(xcmd){ doc = est_doc_new_with_xcmd(dbuf, dsiz, path, xcmd, est_db_name(db), g_inputcode, g_inputlang); if(doc && g_filtorig){ sprintf(numbuf, "%d", (int)sbuf.st_size); est_doc_add_attr(doc, ESTDATTRSIZE, numbuf); } } else { switch(fmt){ case FF_TEXT: doc = est_doc_new_from_text(dbuf, dsiz, g_inputcode, g_inputlang, g_bincheck); break; case FF_HTML: doc = est_doc_new_from_html(dbuf, dsiz, g_inputcode, g_inputlang, g_bincheck); break; case FF_MIME: doc = est_doc_new_from_mime(dbuf, dsiz, g_inputcode, g_inputlang, g_bincheck); break; default: doc = est_doc_new_from_draft_enc(dbuf, dsiz, g_inputcode); break; } } if(!doc || (g_bincheck && est_doc_is_empty(doc))){ printfinfo("%s: passed (empty document)", path); if(doc) est_doc_delete(doc); free(dbuf); return TRUE; } if(g_limittsiz >= 0) est_doc_slim(doc, g_limittsiz); if(attrs){ for(i = 0; i < cblistnum(g_pathattrs) && i < cblistnum(attrs); i++){ est_doc_add_attr(doc, cblistval(g_pathattrs, i, NULL), cblistval(attrs, i, NULL)); } } if(!est_doc_attr(doc, ESTDATTRURI)) est_doc_add_attr(doc, ESTDATTRURI, uri); if(!est_doc_attr(doc, DATTRLPATH)) est_doc_add_attr(doc, DATTRLPATH, uri); if((lreal = pathtolreal(path)) != NULL){ if(!est_doc_attr(doc, DATTRLREAL)) est_doc_add_attr(doc, DATTRLREAL, lreal); lfile = strrchr(lreal, ESTPATHCHR); lfile = lfile ? lfile + 1 : lreal; if(!est_doc_attr(doc, DATTRLFILE)) est_doc_add_attr(doc, DATTRLFILE, lfile); } uri = est_doc_attr(doc, ESTDATTRURI); if(g_stdate){ tbuf = cbdatestrwww(sbuf.st_mtime, 0); est_doc_add_attr(doc, ESTDATTRMDATE, tbuf); free(tbuf); } if(cblistnum(g_addattrs) > 0){ for(i = 0; i < cblistnum(g_addattrs); i += 2){ est_doc_add_attr(doc, cblistval(g_addattrs, i, NULL), cblistval(g_addattrs, i + 1, NULL)); } } if(g_chkmdate && emdate == -1 && (id = est_db_uri_to_id(db, uri)) > 0 && (edoc = est_db_get_doc(db, id, ESTGDNOTEXT | ESTGDNOKWD)) != NULL){ if((vbuf = est_doc_attr(edoc, ESTDATTRMDATE)) != NULL) emdate = cbstrmktime(vbuf); est_doc_delete(edoc); } fmdate = -1; if(g_chkmdate && (vbuf = est_doc_attr(doc, ESTDATTRMDATE)) != NULL) fmdate = cbstrmktime(vbuf); err = FALSE; if(emdate >= 0 && emdate >= fmdate){ printfinfo("%s: passed (old document)", path); } else if(g_nooper){ printfinfo("%d (%s): registered", -1, path); } else { if(g_ssname){ score = (vbuf = est_doc_attr(doc, g_ssname)) != NULL ? cbstrmktime(vbuf) : 0; if(score < 0) score = 0; est_doc_set_score(doc, score); } if(g_kwordnum > 0){ kwords = g_usemorph ? est_morph_etch_doc(doc, g_kwordnum) : est_db_etch_doc(NULL, doc, g_kwordnum); est_doc_set_keywords(doc, kwords); cbmapclose(kwords); } if(est_db_put_doc(db, doc, g_putopts)){ printfinfo("%d (%s): registered", est_doc_id(doc), path); } else { printferror("%s: %s", est_db_name(db), est_err_msg(est_db_error(db))); err = TRUE; } } est_doc_delete(doc); free(dbuf); if(count++ % MEMCHKFREQ == 0){ if(est_memory_usage() > MEMLOADMAX && !est_db_flush(db, -1)){ printferror("%s: %s", est_db_name(db), est_err_msg(est_db_error(db))); err = TRUE; } if(!g_nochkvmem && !cbvmemavail(MEMCHKALW)){ printferror("exhausting memory"); err = TRUE; } } return err ? FALSE : TRUE; } /* remove a file */ static void doremovefile(const char *path){ const char *elem; int i; if(g_nooper) return; for(i = 0; i < cblistnum(g_rmvsufs); i++){ elem = cblistval(g_rmvsufs, i, NULL); if(elem[0] == '\0') continue; if(!strcmp(elem, "*") || cbstrbwimatch(path, elem)){ if(unlink(path) == -1) printferror("%s: could not remove", path); break; } } } /* get the URI of an expression of a path or a URI */ static const char *exprtouri(const char *expr){ const char *rp; rp = expr; if(cbstrfwimatch(expr, "urn:")) rp += 4; while((*rp >= 'A' && *rp <= 'Z') || (*rp >= 'a' && *rp <= 'z')){ rp++; } if(rp > expr && rp[0] == ':' && rp[1] == '/' && rp[2] == '/') return expr; if(cbstrfwimatch(expr, "mailto:") && !strchr(expr, '/')) return expr; return pathtourl(expr); } /* get the URL of a path */ static const char *pathtourl(const char *path){ static char pbuf[URIBUFSIZ]; const char *elem; char *host, *rpath, *ebuf, *wp; CBLIST *list; int i, esiz; if(strlen(path) >= URIBUFSIZ / 4) return NULL; host = NULL; if(g_pathcode){ rpath = est_realpath(path); if(!(ebuf = est_iconv(rpath, -1, g_pathcode, "UTF-8", &esiz, NULL))){ esiz = strlen(rpath); ebuf = cbmemdup(rpath, esiz); } if(ESTPATHCHR == '\\' && cbstrfwmatch(ebuf, "\\\\") && (wp = strchr(ebuf + 2, '\\')) != NULL){ *wp = '\0'; host = cbmemdup(ebuf + 2, -1); list = cbsplit(wp + 1, -1, ESTPATHSTR); } else { list = cbsplit(ebuf, esiz, ESTPATHSTR); } free(ebuf); free(rpath); for(i = 0; i < cblistnum(list); i++){ elem = cblistval(list, i, &esiz); if((ebuf = est_iconv(elem, esiz, "UTF-8", g_pathcode, &esiz, NULL)) != NULL){ cblistover(list, i, ebuf, esiz); free(ebuf); } } } else { rpath = est_realpath(path); if(ESTPATHCHR == '\\' && cbstrfwmatch(rpath, "\\\\") && (wp = strchr(rpath + 2, '\\')) != NULL){ *wp = '\0'; host = cbmemdup(rpath + 2, -1); list = cbsplit(wp + 1, -1, ESTPATHSTR); } else { list = cbsplit(rpath, -1, ESTPATHSTR); } free(rpath); } wp = pbuf; wp += sprintf(wp, "file://"); if(host) wp += sprintf(wp, "%s", host); for(i = 0; i < cblistnum(list); i++){ elem = cblistval(list, i, NULL); if(elem[0] == '\0') continue; if(ESTPATHCHR == '\\' && i < 1 && ((elem[0] >= 'A' && elem[0] <= 'Z') || (elem[0] >= 'a' && elem[0] <= 'z')) && elem[1] == ':'){ wp += sprintf(wp, "/%c|", elem[0]); continue; } ebuf = cburlencode(elem, -1); wp += sprintf(wp, "/%s", ebuf); free(ebuf); } if(wp == pbuf + 7) *(wp++) = '/'; *wp = '\0'; cblistclose(list); free(host); return pbuf; } /* get the real path of a path */ static const char *pathtolreal(const char *path){ static char pbuf[URIBUFSIZ]; char *rbuf, *ebuf; rbuf = est_realpath(path); if((ebuf = est_iconv(rbuf, -1, g_pathcode ? g_pathcode : "ISO-8859-1", "UTF-8", NULL, NULL)) != NULL){ free(rbuf); rbuf = ebuf; } sprintf(pbuf, "%s", rbuf); free(rbuf); return pbuf; } /* get the local path of a URL */ static const char *urltopath(const char *url){ static char pbuf[URIBUFSIZ]; const char *pv, *elem; char *wp, *dbuf; CBLIST *list; int i; if(!cbstrfwimatch(url, "file://")) return NULL; pv = url + 7; if(!(url = strchr(pv, '/'))) return NULL; wp = pbuf; if(ESTPATHCHR == '\\'){ if(url[0] == '/' && ((url[1] >= 'A' && url[1] <= 'Z') || (url[1] >= 'a' && url[1] <= 'z')) && url[2] == '|' && url[3] == '/'){ wp += sprintf(wp, "%c:", url[1]); url += 3; } else if(url > pv){ wp += sprintf(wp, "\\\\"); memcpy(wp, pv, url - pv); wp += url - pv; } } list = cbsplit(url, -1, "/"); for(i = 0; i < cblistnum(list); i++){ elem = cblistval(list, i, NULL); if(elem[0] == '\0') continue; dbuf = cburldecode(elem, NULL); wp += sprintf(wp, "%c%s", ESTPATHCHR, dbuf); free(dbuf); } *wp = '\0'; cblistclose(list); return pbuf; } /* check whether a file name is bad on dosish file system */ static int dosbadname(const char *name){ static const char *badnames[] = { "AUX", "CON", "NUL", "PRN", "CLOCK", "CLOCK$", "CONFIG$", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9", NULL }; int i, len; if(name[0] == '\\' || strstr(name, ".\\")) return TRUE; for(i = 0; badnames[i]; i++){ if(cbstrfwimatch(name, badnames[i])){ len = strlen(badnames[i]); if(name[len] == '\0' || name[len] == '.') return TRUE; } } return FALSE; } /* check whether a buffer is binary */ static int est_check_binary(const char *buf, int size){ int i, bin; assert(buf && size >= 0); if(size < 32) return FALSE; /* PDF */ if(!memcmp(buf, "%PDF-", 5)) return TRUE; /* PostScript */ if(!memcmp(buf, "%!PS-Adobe", 10)) return TRUE; /* generic binary */ size -= 5; if(size >= 256) size = 256; bin = FALSE; for(i = 0; i < size; i++){ if(buf[i] == 0x0){ if(buf[i+1] == 0x0 && buf[i+2] == 0x0 && buf[i+3] == 0x0 && buf[i+4] == 0x0) return TRUE; bin = TRUE; } } if(!bin) return FALSE; /* PNG */ if(!memcmp(buf, "\x89PNG", 4)) return TRUE; /* GIF(87a) */ if(!memcmp(buf, "GIF87a", 6)) return TRUE; /* GIF(89a) */ if(!memcmp(buf, "GIF89a", 6)) return TRUE; /* JFIF */ if(!memcmp(buf, "\xff\xd8JFIF", 6)) return TRUE; /* TIFF(Intel) */ if(!memcmp(buf, "MM\x00\x2a", 4)) return TRUE; /* TIFF(Motorola) */ if(!memcmp(buf, "II\x2a\x00", 4)) return TRUE; /* BMP */ if(!memcmp(buf, "BM", 2)) return TRUE; /* GZIP */ if(!memcmp(buf, "\x1f\x8b\x08", 3)) return TRUE; /* BZIP2 */ if(!memcmp(buf, "BZh", 3)) return TRUE; /* ZIP */ if(!memcmp(buf, "PK\x03\x04", 4)) return TRUE; /* MP3(with ID3) */ if(!memcmp(buf, "ID3", 3)) return TRUE; /* MP3 */ if(((buf[0] * 0x100 + buf[1]) & 0xfffe) == 0xfffa) return TRUE; /* MIDI */ if(!memcmp(buf, "MThd", 4)) return TRUE; /* RPM package*/ if(!memcmp(buf, "0xed0xab", 2)) return TRUE; /* Debian package */ if(!memcmp(buf, "!\ndebian", 14)) return TRUE; /* ELF */ if(!memcmp(buf, "\x7f\x45\x4c\x46", 4)) return TRUE; /* MS-DOS executable */ if(!memcmp(buf, "MZ", 2)) return TRUE; /* MS-Office */ if(!memcmp(buf, "\xd0\xcf\x11\xe0\xa1\xb1\x1a\xe1", 8)) return TRUE; if(!memcmp(buf, "\xfe\x37\x00\x23", 4)) return TRUE; if(!memcmp(buf, "\xdb\xa5-\x00\x00\x00", 6)) return TRUE; return FALSE; } /* create a document object with an outer command */ static ESTDOC *est_doc_new_with_xcmd(const char *buf, int size, const char *path, const char *xcmd, const char *tmpdir, const char *penc, int plang){ ESTDOC *doc; const char *pv, *ext; char iname[URIBUFSIZ], oname[URIBUFSIZ], ebuf[URIBUFSIZ], cmd[URIBUFSIZ]; char *rbuf, numbuf[NUMBUFSIZ]; int fmt, rsiz; assert(buf && size >= 0 && path && xcmd && tmpdir); sprintf(ebuf, "ESTORIGFILE=%s", path); ext = NULL; if((pv = strrchr(path, ESTPATHCHR)) != NULL) path = pv; if((pv = strrchr(path, ESTEXTCHR)) != NULL) ext = pv; if(!ext || strlen(ext) >= 32 || strchr(ext, '"') || strchr(ext, '\\')) ext = ""; sprintf(iname, "%s%cxcmd-in-%08d%s", tmpdir, ESTPATHCHR, (int)getpid(), ext); sprintf(oname, "%s%cxcmd-out-%08d%cest", tmpdir, ESTPATHCHR, (int)getpid(), ESTEXTCHR); fmt = FF_DRAFT; if(cbstrfwmatch(xcmd, "T@")){ fmt = FF_TEXT; xcmd += 2; } else if(cbstrfwmatch(xcmd, "H@")){ fmt = FF_HTML; xcmd += 2; } else if(cbstrfwmatch(xcmd, "M@")){ fmt = FF_MIME; xcmd += 2; } if(!g_filtorig) cbwritefile(iname, buf, size); sprintf(cmd, "%s \"%s\" \"%s\"", xcmd, iname, oname); putenv(ebuf); system(cmd); if((rbuf = cbreadfile(oname, &rsiz)) != NULL){ switch(fmt){ case FF_TEXT: doc = est_doc_new_from_text(rbuf, rsiz, penc, plang, FALSE); break; case FF_HTML: doc = est_doc_new_from_html(rbuf, rsiz, penc, plang, FALSE); break; case FF_MIME: doc = est_doc_new_from_mime(rbuf, rsiz, penc, plang, FALSE); break; default: doc = est_doc_new_from_draft_enc(rbuf, rsiz, penc); break; } free(rbuf); } else { doc = est_doc_new(); } if(doc && fmt != FF_DRAFT){ sprintf(numbuf, "%d", size); est_doc_add_attr(doc, ESTDATTRSIZE, numbuf); est_doc_add_attr(doc, ESTDATTRTYPE, est_ext_type(ext)); } unlink(oname); unlink(iname); return doc; } /* create a document object from draft data in another encoding */ static ESTDOC *est_doc_new_from_draft_enc(const char *buf, int size, const char *enc){ ESTDOC *doc; char *rbuf; assert(buf); if(enc && (rbuf = est_iconv(buf, size, enc, "UTF-8", NULL, NULL)) != NULL){ doc = est_doc_new_from_draft(rbuf); free(rbuf); } else { doc = est_doc_new_from_draft(buf); } return doc; } /* create a document object from plain text */ static ESTDOC *est_doc_new_from_text(const char *buf, int size, const char *penc, int plang, int bcheck){ ESTDOC *doc; CBLIST *lines; CBDATUM *datum; const char *enc, *text, *line; char *nbuf, numbuf[NUMBUFSIZ]; int i; assert(buf && size >= 0); if(bcheck && est_check_binary(buf, size)) return NULL; doc = est_doc_new(); enc = penc ? penc : est_enc_name(buf, size, plang); if(!strcmp(enc, "UTF-8")){ nbuf = NULL; text = buf; } else { text = buf; nbuf = est_iconv(buf, size, enc, "UTF-8", NULL, NULL); if(nbuf) text = nbuf; } lines = cbsplit(text, -1, "\n"); CB_DATUMOPEN(datum); for(i = 0; i < CB_LISTNUM(lines); i++){ line = CB_LISTVAL(lines, i); while(*line == ' ' || *line == '\t' || *line == '\r'){ line++; } if(line[0] == '\0'){ est_doc_add_text(doc, CB_DATUMPTR(datum)); CB_DATUMSETSIZE(datum, 0); } else { CB_DATUMCAT(datum, " ", 1); CB_DATUMCAT(datum, line, strlen(line)); } } est_doc_add_text(doc, CB_DATUMPTR(datum)); CB_DATUMCLOSE(datum); CB_LISTCLOSE(lines); est_doc_add_attr(doc, ESTDATTRTYPE, "text/plain"); sprintf(numbuf, "%d", size); est_doc_add_attr(doc, ESTDATTRSIZE, numbuf); if(nbuf) free(nbuf); return doc; } /* create a document object from HTML */ static ESTDOC *est_doc_new_from_html(const char *buf, int size, const char *penc, int plang, int bcheck){ ESTDOC *doc; CBLIST *elems; CBMAP *attrs; CBDATUM *datum; const char *enc, *html, *elem, *next, *value, *name, *content; char *nbuf, *nenc, *rbuf, *lbuf, numbuf[NUMBUFSIZ]; int i, esiz; assert(buf && size >= 0); if(bcheck && est_check_binary(buf, size)) return NULL; doc = est_doc_new(); enc = est_enc_name(buf, size, plang); html = NULL; nbuf = NULL; if(!strcmp(enc, "UTF-16") || !strcmp(enc, "UTF-16BE") || !strcmp(enc, "UTF-16LE")){ nbuf = est_iconv(buf, size, enc, "UTF-8", NULL, NULL); } else if(!strcmp(enc, "US-ASCII")){ nbuf = NULL; } else { if((nenc = penc ? cbmemdup(penc, -1) : est_html_enc(buf)) != NULL){ if(cbstricmp(nenc, "UTF-8")){ nbuf = est_iconv(buf, size, nenc, "UTF-8", NULL, NULL); if(!nbuf) nbuf = est_iconv(buf, size, enc, "UTF-8", NULL, NULL); } free(nenc); } else { nbuf = est_iconv(buf, size, enc, "UTF-8", NULL, NULL); } } if(nbuf) html = nbuf; if(!html) html = buf; CB_DATUMOPEN(datum); elems = cbxmlbreak(html, TRUE); for(i = 0; i < CB_LISTNUM(elems); i++){ elem = CB_LISTVAL2(elems, i, esiz); if(!(next = cblistval(elems, i + 1, NULL))) next = ""; if(elem[0] == '<'){ if(cbstrfwimatch(elem, "") || cbstrfwimatch(elem, "

", """, "\"", "'", "'", /* ISO-8859-1 */ " ", "\xc2\xa0", "¡", "\xc2\xa1", "¢", "\xc2\xa2", "£", "\xc2\xa3", "¤", "\xc2\xa4", "¥", "\xc2\xa5", "¦", "\xc2\xa6", "§", "\xc2\xa7", "¨", "\xc2\xa8", "©", "\xc2\xa9", "ª", "\xc2\xaa", "«", "\xc2\xab", "¬", "\xc2\xac", "­", "\xc2\xad", "®", "\xc2\xae", "¯", "\xc2\xaf", "°", "\xc2\xb0", "±", "\xc2\xb1", "²", "\xc2\xb2", "³", "\xc2\xb3", "´", "\xc2\xb4", "µ", "\xc2\xb5", "¶", "\xc2\xb6", "·", "\xc2\xb7", "¸", "\xc2\xb8", "¹", "\xc2\xb9", "º", "\xc2\xba", "»", "\xc2\xbb", "¼", "\xc2\xbc", "½", "\xc2\xbd", "¾", "\xc2\xbe", "¿", "\xc2\xbf", "À", "\xc3\x80", "Á", "\xc3\x81", "Â", "\xc3\x82", "Ã", "\xc3\x83", "Ä", "\xc3\x84", "Å", "\xc3\x85", "Æ", "\xc3\x86", "Ç", "\xc3\x87", "È", "\xc3\x88", "É", "\xc3\x89", "Ê", "\xc3\x8a", "Ë", "\xc3\x8b", "Ì", "\xc3\x8c", "Í", "\xc3\x8d", "Î", "\xc3\x8e", "Ï", "\xc3\x8f", "Ð", "\xc3\x90", "Ñ", "\xc3\x91", "Ò", "\xc3\x92", "Ó", "\xc3\x93", "Ô", "\xc3\x94", "Õ", "\xc3\x95", "Ö", "\xc3\x96", "×", "\xc3\x97", "Ø", "\xc3\x98", "Ù", "\xc3\x99", "Ú", "\xc3\x9a", "Û", "\xc3\x9b", "Ü", "\xc3\x9c", "Ý", "\xc3\x9d", "Þ", "\xc3\x9e", "ß", "\xc3\x9f", "à", "\xc3\xa0", "á", "\xc3\xa1", "â", "\xc3\xa2", "ã", "\xc3\xa3", "ä", "\xc3\xa4", "å", "\xc3\xa5", "æ", "\xc3\xa6", "ç", "\xc3\xa7", "è", "\xc3\xa8", "é", "\xc3\xa9", "ê", "\xc3\xaa", "ë", "\xc3\xab", "ì", "\xc3\xac", "í", "\xc3\xad", "î", "\xc3\xae", "ï", "\xc3\xaf", "ð", "\xc3\xb0", "ñ", "\xc3\xb1", "ò", "\xc3\xb2", "ó", "\xc3\xb3", "ô", "\xc3\xb4", "õ", "\xc3\xb5", "ö", "\xc3\xb6", "÷", "\xc3\xb7", "ø", "\xc3\xb8", "ù", "\xc3\xb9", "ú", "\xc3\xba", "û", "\xc3\xbb", "ü", "\xc3\xbc", "ý", "\xc3\xbd", "þ", "\xc3\xbe", "ÿ", "\xc3\xbf", /* ISO-10646 */ "ƒ", "\xc6\x92", "Α", "\xce\x91", "Β", "\xce\x92", "Γ", "\xce\x93", "Δ", "\xce\x94", "Ε", "\xce\x95", "Ζ", "\xce\x96", "Η", "\xce\x97", "Θ", "\xce\x98", "Ι", "\xce\x99", "Κ", "\xce\x9a", "Λ", "\xce\x9b", "Μ", "\xce\x9c", "Ν", "\xce\x9d", "Ξ", "\xce\x9e", "Ο", "\xce\x9f", "Π", "\xce\xa0", "Ρ", "\xce\xa1", "Σ", "\xce\xa3", "Τ", "\xce\xa4", "Υ", "\xce\xa5", "Φ", "\xce\xa6", "Χ", "\xce\xa7", "Ψ", "\xce\xa8", "Ω", "\xce\xa9", "α", "\xce\xb1", "β", "\xce\xb2", "γ", "\xce\xb3", "δ", "\xce\xb4", "ε", "\xce\xb5", "ζ", "\xce\xb6", "η", "\xce\xb7", "θ", "\xce\xb8", "ι", "\xce\xb9", "κ", "\xce\xba", "λ", "\xce\xbb", "μ", "\xce\xbc", "ν", "\xce\xbd", "ξ", "\xce\xbe", "ο", "\xce\xbf", "π", "\xcf\x80", "ρ", "\xcf\x81", "ς", "\xcf\x82", "σ", "\xcf\x83", "τ", "\xcf\x84", "υ", "\xcf\x85", "φ", "\xcf\x86", "χ", "\xcf\x87", "ψ", "\xcf\x88", "ω", "\xcf\x89", "ϑ", "\xcf\x91", "ϒ", "\xcf\x92", "ϖ", "\xcf\x96", "•", "\xe2\x80\xa2", "…", "\xe2\x80\xa6", "′", "\xe2\x80\xb2", "″", "\xe2\x80\xb3", "‾", "\xe2\x80\xbe", "⁄", "\xe2\x81\x84", "℘", "\xe2\x84\x98", "ℑ", "\xe2\x84\x91", "ℜ", "\xe2\x84\x9c", "™", "\xe2\x84\xa2", "ℵ", "\xe2\x84\xb5", "←", "\xe2\x86\x90", "↑", "\xe2\x86\x91", "→", "\xe2\x86\x92", "↓", "\xe2\x86\x93", "↔", "\xe2\x86\x94", "↵", "\xe2\x86\xb5", "⇐", "\xe2\x87\x90", "⇑", "\xe2\x87\x91", "⇒", "\xe2\x87\x92", "⇓", "\xe2\x87\x93", "⇔", "\xe2\x87\x94", "∀", "\xe2\x88\x80", "∂", "\xe2\x88\x82", "∃", "\xe2\x88\x83", "∅", "\xe2\x88\x85", "∇", "\xe2\x88\x87", "∈", "\xe2\x88\x88", "∉", "\xe2\x88\x89", "∋", "\xe2\x88\x8b", "∏", "\xe2\x88\x8f", "∑", "\xe2\x88\x91", "−", "\xe2\x88\x92", "∗", "\xe2\x88\x97", "√", "\xe2\x88\x9a", "∝", "\xe2\x88\x9d", "∞", "\xe2\x88\x9e", "∠", "\xe2\x88\xa0", "∧", "\xe2\x88\xa7", "∨", "\xe2\x88\xa8", "∩", "\xe2\x88\xa9", "∪", "\xe2\x88\xaa", "∫", "\xe2\x88\xab", "∴", "\xe2\x88\xb4", "∼", "\xe2\x88\xbc", "≅", "\xe2\x89\x85", "≈", "\xe2\x89\x88", "≠", "\xe2\x89\xa0", "≡", "\xe2\x89\xa1", "≤", "\xe2\x89\xa4", "≥", "\xe2\x89\xa5", "⊂", "\xe2\x8a\x82", "⊃", "\xe2\x8a\x83", "⊄", "\xe2\x8a\x84", "⊆", "\xe2\x8a\x86", "⊇", "\xe2\x8a\x87", "⊕", "\xe2\x8a\x95", "⊗", "\xe2\x8a\x97", "⊥", "\xe2\x8a\xa5", "⋅", "\xe2\x8b\x85", "⌈", "\xe2\x8c\x88", "⌉", "\xe2\x8c\x89", "⌊", "\xe2\x8c\x8a", "⌋", "\xe2\x8c\x8b", "⟨", "\xe2\x8c\xa9", "⟩", "\xe2\x8c\xaa", "◊", "\xe2\x97\x8a", "♠", "\xe2\x99\xa0", "♣", "\xe2\x99\xa3", "♥", "\xe2\x99\xa5", "♦", "\xe2\x99\xa6", "Œ", "\xc5\x92", "œ", "\xc5\x93", "Š", "\xc5\xa0", "š", "\xc5\xa1", "Ÿ", "\xc5\xb8", "ˆ", "\xcb\x86", "˜", "\xcb\x9c", " ", "\xe2\x80\x82", " ", "\xe2\x80\x83", " ", "\xe2\x80\x89", "‌", "\xe2\x80\x8c", "‍", "\xe2\x80\x8d", "‎", "\xe2\x80\x8e", "‏", "\xe2\x80\x8f", "–", "\xe2\x80\x93", "—", "\xe2\x80\x94", "‘", "\xe2\x80\x98", "’", "\xe2\x80\x99", "‚", "\xe2\x80\x9a", "“", "\xe2\x80\x9c", "”", "\xe2\x80\x9d", "„", "\xe2\x80\x9e", "†", "\xe2\x80\xa0", "‡", "\xe2\x80\xa1", "‰", "\xe2\x80\xb0", "‹", "\xe2\x80\xb9", "›", "\xe2\x80\xba", "€", "\xe2\x82\xac", NULL }; char *raw, *wp, buf[2], *tmp; int i, j, hit, num, tsiz; assert(html); CB_MALLOC(raw, strlen(html) * 3 + 1); wp = raw; while(*html != '\0'){ if(*html == '&'){ if(*(html + 1) == '#'){ if(*(html + 2) == 'x' || *(html + 2) == 'X'){ num = strtol(html + 3, NULL, 16); } else { num = atoi(html + 2); } buf[0] = num / 256; buf[1] = num % 256; if((tmp = est_uconv_out(buf, 2, &tsiz)) != NULL){ for(j = 0; j < tsiz; j++){ *wp = ((unsigned char *)tmp)[j]; wp++; } free(tmp); } while(*html != ';' && *html != ' ' && *html != '\n' && *html != '\0'){ html++; } if(*html == ';') html++; } else { hit = FALSE; for(i = 0; pairs[i] != NULL; i += 2){ if(cbstrfwmatch(html, pairs[i])){ wp += sprintf(wp, "%s", pairs[i+1]); html += strlen(pairs[i]); hit = TRUE; break; } } if(!hit){ *wp = *html; wp++; html++; } } } else { *wp = *html; wp++; html++; } } *wp = '\0'; return raw; } /* create a document object from MIME */ static ESTDOC *est_doc_new_from_mime(const char *buf, int size, const char *penc, int plang, int bcheck){ ESTDOC *doc, *tdoc; CBMAP *attrs; const CBLIST *texts; CBLIST *parts, *lines; CBDATUM *datum; const char *key, *val, *bound, *part, *text, *line; char *body, *swap, numbuf[NUMBUFSIZ]; int i, j, bsiz, psiz, ssiz, mht; assert(buf && size >= 0); doc = est_doc_new(); attrs = cbmapopenex(MINIBNUM); body = cbmimebreak(buf, size, attrs, &bsiz); if((val = cbmapget(attrs, "subject", -1, NULL)) != NULL){ est_doc_add_attr_mime(doc, ESTDATTRTITLE, val); if((val = est_doc_attr(doc, ESTDATTRTITLE)) != NULL) est_doc_add_hidden_text(doc, val); } if((val = cbmapget(attrs, "from", -1, NULL)) != NULL) est_doc_add_attr_mime(doc, ESTDATTRAUTHOR, val); if((val = cbmapget(attrs, "date", -1, NULL)) != NULL){ est_doc_add_attr_mime(doc, ESTDATTRCDATE, val); est_doc_add_attr_mime(doc, ESTDATTRMDATE, val); } est_doc_add_attr(doc, ESTDATTRTYPE, "message/rfc822"); sprintf(numbuf, "%d", size); est_doc_add_attr(doc, ESTDATTRSIZE, numbuf); cbmapiterinit(attrs); while((key = cbmapiternext(attrs, NULL)) != NULL){ if((key[0] >= 'A' && key[0] <= 'Z') || key[0] == '@' || key[0] == '_') continue; val = cbmapiterval(key, NULL); est_doc_add_attr_mime(doc, key, val); } if((key = cbmapget(attrs, "TYPE", -1, NULL)) != NULL && cbstrfwimatch(key, "multipart/")){ mht = cbstrfwimatch(key, "multipart/related"); if((bound = cbmapget(attrs, "BOUNDARY", -1, NULL)) != NULL){ parts = cbmimeparts(body, bsiz, bound); for(i = 0; i < CB_LISTNUM(parts) && i < 8; i++){ part = CB_LISTVAL2(parts, i, psiz); if((tdoc = est_doc_new_from_mime(part, psiz, penc, plang, bcheck)) != NULL){ if(mht){ if((text = est_doc_attr(tdoc, ESTDATTRTITLE)) != NULL) est_doc_add_attr(doc, ESTDATTRTITLE, text); if((text = est_doc_attr(tdoc, ESTDATTRAUTHOR)) != NULL) est_doc_add_attr(doc, ESTDATTRAUTHOR, text); } texts = est_doc_texts(tdoc); for(j = 0; j < CB_LISTNUM(texts); j++){ text = CB_LISTVAL(texts, j); est_doc_add_text(doc, text); } est_doc_delete(tdoc); } } CB_LISTCLOSE(parts); } } else { key = cbmapget(attrs, "content-transfer-encoding", -1, NULL); if(key && cbstrfwimatch(key, "base64")){ swap = cbbasedecode(body, &ssiz); free(body); body = swap; bsiz = ssiz; } else if(key && cbstrfwimatch(key, "quoted-printable")){ swap = cbquotedecode(body, &ssiz); free(body); body = swap; bsiz = ssiz; } key = cbmapget(attrs, "content-encoding", -1, NULL); if(key && (cbstrfwimatch(key, "x-gzip") || cbstrfwimatch(key, "gzip")) && (swap = cbgzdecode(body, bsiz, &ssiz)) != NULL){ free(body); body = swap; bsiz = ssiz; } else if(key && (cbstrfwimatch(key, "x-deflate") || cbstrfwimatch(key, "deflate")) && (swap = cbinflate(body, bsiz, &ssiz)) != NULL){ free(body); body = swap; bsiz = ssiz; } if(!(key = cbmapget(attrs, "TYPE", -1, NULL)) || cbstrfwimatch(key, "text/plain")){ if(!bcheck || !est_check_binary(body, bsiz)){ if(penc && (swap = est_iconv(body, bsiz, penc, "UTF-8", &ssiz, NULL)) != NULL){ free(body); body = swap; bsiz = ssiz; } else if((key = cbmapget(attrs, "CHARSET", -1, NULL)) != NULL && (swap = est_iconv(body, bsiz, key, "UTF-8", &ssiz, NULL)) != NULL){ free(body); body = swap; bsiz = ssiz; } lines = cbsplit(body, bsiz, "\n"); CB_DATUMOPEN(datum); for(i = 0; i < CB_LISTNUM(lines); i++){ line = CB_LISTVAL(lines, i); while(*line == ' ' || *line == '>' || *line == '|' || *line == '\t' || *line == '\r'){ line++; } if(line[0] == '\0'){ est_doc_add_text(doc, CB_DATUMPTR(datum)); CB_DATUMSETSIZE(datum, 0); } else { CB_DATUMCAT(datum, " ", 1); CB_DATUMCAT(datum, line, strlen(line)); } } est_doc_add_text(doc, CB_DATUMPTR(datum)); CB_DATUMCLOSE(datum); CB_LISTCLOSE(lines); } } else if(cbstrfwimatch(key, "text/html") || cbstrfwimatch(key, "application/xhtml+xml")){ if((tdoc = est_doc_new_from_html(body, bsiz, penc, plang, bcheck)) != NULL){ if((text = est_doc_attr(tdoc, ESTDATTRTITLE)) != NULL){ if(!est_doc_attr(doc, ESTDATTRTITLE)) est_doc_add_attr(doc, ESTDATTRTITLE, text); est_doc_add_text(doc, text); } if((text = est_doc_attr(tdoc, ESTDATTRAUTHOR)) != NULL){ if(!est_doc_attr(doc, ESTDATTRAUTHOR)) est_doc_add_attr(doc, ESTDATTRAUTHOR, text); est_doc_add_text(doc, text); } texts = est_doc_texts(tdoc); for(i = 0; i < CB_LISTNUM(texts); i++){ text = CB_LISTVAL(texts, i); est_doc_add_text(doc, text); } est_doc_delete(tdoc); } } else if(cbstrfwimatch(key, "message/rfc822")){ if((tdoc = est_doc_new_from_mime(body, bsiz, penc, plang, bcheck)) != NULL){ if((text = est_doc_attr(tdoc, ESTDATTRTITLE)) != NULL){ if(!est_doc_attr(doc, ESTDATTRTITLE)) est_doc_add_attr(doc, ESTDATTRTITLE, text); est_doc_add_text(doc, text); } if((text = est_doc_attr(tdoc, ESTDATTRAUTHOR)) != NULL){ if(!est_doc_attr(doc, ESTDATTRAUTHOR)) est_doc_add_attr(doc, ESTDATTRAUTHOR, text); est_doc_add_text(doc, text); } texts = est_doc_texts(tdoc); for(i = 0; i < CB_LISTNUM(texts); i++){ text = CB_LISTVAL(texts, i); est_doc_add_text(doc, text); } est_doc_delete(tdoc); } } else if(cbstrfwimatch(key, "text/")){ if((tdoc = est_doc_new_from_text(body, bsiz, penc, plang, bcheck)) != NULL){ texts = est_doc_texts(tdoc); for(i = 0; i < CB_LISTNUM(texts); i++){ text = CB_LISTVAL(texts, i); est_doc_add_text(doc, text); } est_doc_delete(tdoc); } } } free(body); cbmapclose(attrs); return doc; } /* set mime value as an attribute of a document */ static void est_doc_add_attr_mime(ESTDOC *doc, const char *name, const char *value){ char enc[64], *ebuf, *rbuf; assert(doc && name && value); ebuf = cbmimedecode(value, enc); if((rbuf = est_iconv(ebuf, -1, enc, "UTF-8", NULL, NULL)) != NULL){ est_doc_add_attr(doc, name, rbuf); free(rbuf); } free(ebuf); } /* generate a document with random text */ static ESTDOC *est_doc_new_from_chaos(int cnum, int snum, int mode){ ESTDOC *doc; char *str; int i; doc = est_doc_new(); snum *= pow(est_random_nd() + 0.5, 3.0); if(mode == RD_RAND){ mode = est_random() * 100; if(mode < 20){ mode = RD_ENG; est_doc_add_attr(doc, "mode", "english"); } else if(mode < 40){ mode = RD_LAT; est_doc_add_attr(doc, "mode", "latin"); } else if(mode < 60){ mode = RD_EURO; est_doc_add_attr(doc, "mode", "euromix"); } else if(mode < 65){ mode = RD_ORI; est_doc_add_attr(doc, "mode", "oriental"); } else if(mode < 95){ mode = RD_JPN; est_doc_add_attr(doc, "mode", "japanese"); } else { mode = RD_CHAO; est_doc_add_attr(doc, "mode", "chaos"); } } switch(mode){ case RD_ENG: est_doc_add_attr(doc, "mode", "english"); break; case RD_LAT: est_doc_add_attr(doc, "mode", "latin"); break; case RD_ORI: est_doc_add_attr(doc, "mode", "oriental"); break; case RD_JPN: est_doc_add_attr(doc, "mode", "japanese"); break; case RD_EURO: est_doc_add_attr(doc, "mode", "euromix"); break; case RD_CHAO: est_doc_add_attr(doc, "mode", "chaos"); break; } for(i = 0; i <= snum; i++){ str = est_random_str(cnum, mode); if(est_random() < 0.05){ est_doc_add_hidden_text(doc, str); } else { est_doc_add_text(doc, str); } free(str); } return doc; } /* generate random string */ static char *est_random_str(int cnum, int mode){ const char echrs[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; CBDATUM *buf; char wc[2], *str; int i, c, wlen, dec, mm, big, n; CB_DATUMOPEN(buf); cnum *= pow(est_random_nd() + 0.5, 3.0); wlen = est_random_nd() * 8 + 4; dec = (int)(est_random() * INT_MAX) % 10; big = (((int)(est_random() * INT_MAX) % 0x29)) * 0x100; for(i = 0; i < cnum; i++){ switch(mode){ case RD_ENG: case RD_LAT: case RD_EURO: mm = (int)(est_random() * INT_MAX) % 100; if((mode == RD_LAT || mode == RD_EURO) && mm < 5){ c = 0x00a1 + (int)(pow(est_random_nd(), 2.0) * (0x00ff - 0x00a0)); } else if(mode == RD_EURO && (mm < 30 || dec > 8)){ if(dec % 2 == 0){ c = 0x0391 + (int)(pow(est_random_nd(), 2.0) * (0x03d6 - 0x0391)); } else { c = 0x0400 + (int)(pow(est_random_nd(), 2.0) * (0x045f - 0x0400)); } } else if(mm < 95){ if((n = est_random_nd() * (sizeof(echrs) - 1)) == (sizeof(echrs) - 1)) n = 0; c = echrs[n]; } else { c = (int)(est_random() * ('@' - ' ')) + ' '; } if(--wlen < 1){ c = ' '; wlen = pow(est_random_nd(), 3.0) * 8 + 4; dec = (int)(est_random() * INT_MAX) % 10; } break; case RD_ORI: c = big + est_random_nd() * 0x100; if(--wlen < 1){ wlen = pow(est_random_nd(), 3.0) * 12 + 6; big = (((int)(est_random() * INT_MAX) % 0x29)) * 0x100; } break; case RD_JPN: if(dec < 4){ c = 0x3041 + pow(est_random_nd(), 3.0) * (0x3094 - 0x3041); } else if(dec < 7){ c = 0x30a1 + pow(est_random_nd(), 3.0) * (0x30fe - 0x30a1); } else if(dec < 9){ c = 0x4e00 + pow(est_random_nd(), 3.0) * (0x9faf - 0x4e00); } else { if(est_random() < 0.7){ c = 0x00a1 + (int)(pow(est_random_nd(), 2.0) * (0x00ff - 0x00a0)); } else { c = 0x3041 + est_random() * (0xffef - 0x3041); } } if(--wlen < 1){ wlen = pow(est_random_nd(), 3.0) * 12 + 6; dec = (int)(est_random() * INT_MAX) % 10; } break; default: if(est_random() < 0.2){ c = 0x00a1 + (int)est_random() * (0x00ff - 0x00a0); } else { c = (int)(est_random() * 0x10000); } break; } if(c <= 0 || c >= 0x10000) c = 0x0020; wc[0] = c / 0x100; wc[1] = c % 0x100; CB_DATUMCAT(buf, wc, 2); } str = est_iconv(CB_DATUMPTR(buf), CB_DATUMSIZE(buf), "UTF-16BE", "UTF-8", NULL, NULL); CB_DATUMCLOSE(buf); return str; } /* compare two keywords by scores in descending order */ static int keysc_compare(const void *ap, const void *bp){ return ((KEYSC *)bp)->pt - ((KEYSC *)ap)->pt; } /* END OF FILE */ hyperestraier-1.4.13/estconfig.in000066400000000000000000000033741125261632700170130ustar00rootroot00000000000000#! /bin/sh #================================================================ # estconfig # Help configuration for Hyper Estraier #================================================================ # set variables LANG=C ; export LANG LC_ALL=C ; export LC_ALL progname="estconfig" package="@PACKAGE_NAME@" version="@PACKAGE_VERSION@" prefix="@prefix@" exec_prefix="@exec_prefix@" headdir="@includedir@" libdir="@libdir@" bindir="@bindir@" libexecdir="@libexecdir@" datadir="@datadir@/${package}" cflags="-I${headdir} @MYCPPOPTS@" ldflags="-L${libdir} @MYLDOPTS@" libs="-lestraier @MYSKLIBS@ @MYMTLIBS@ @LIBS@" # function to show usage usage(){ printf 'configuration helper for Hyper Estraier\n' printf '\n' printf 'usage:\n' printf ' %s --version\n' "$progname" printf ' %s --prefix\n' "$progname" printf ' %s --execprefix\n' "$progname" printf ' %s --headdir\n' "$progname" printf ' %s --libdir\n' "$progname" printf ' %s --bindir\n' "$progname" printf ' %s --libexecdir\n' "$progname" printf ' %s --datadir\n' "$progname" printf ' %s --cflags\n' "$progname" printf ' %s --ldflags\n' "$progname" printf ' %s --libs\n' "$progname" printf '\n' exit 1 } # show information case "$1" in --version) printf '%s\n' "${version}" ;; --prefix) printf '%s\n' "${prefix}" ;; --execprefix) printf '%s\n' "${exec_prefix}" ;; --headdir) printf '%s\n' "${headdir}" ;; --libdir) printf '%s\n' "${libdir}" ;; --bindir) printf '%s\n' "${bindir}" ;; --libexecdir) printf '%s\n' "${libexecdir}" ;; --datadir) printf '%s\n' "${datadir}" ;; --cflags) printf '%s\n' "${cflags}" ;; --ldflags) printf '%s\n' "${ldflags}" ;; --libs) printf '%s\n' "${libs}" ;; *) usage ;; esac # exit normally exit 0 # END OF FILE hyperestraier-1.4.13/estfraud.c000066400000000000000000001075461125261632700164710ustar00rootroot00000000000000/************************************************************************************************* * The pseudo master of node servers * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #if defined(MYFCGI) #include #endif #include "mastermod.h" #define CONFSUFFIX ".conf" /* suffix of the configuration file */ #define OUTBUFSIZ 262144 /* size of the output buffer */ #define PPOUTDOC "_OUTDOC_" /* pseudo parameter to delete a document */ #define PPPOSTCMD "_POSTCMD_" /* pseudo parameter of the post command */ /* global variables for configurations */ const char *g_conffile = NULL; /* path of the configuration file */ const char *g_indexdir = NULL; /* path of the directory containing indexes */ int g_runmode = 0; /* running mode */ const char *g_pidxsuffix = NULL; /* suffix of pseudo indexes */ int g_pidxdocmax = -1; /* maximum number of documents in each pseudo index */ int g_pidxdocmin = -1; /* minimum number of documents in each pseudo index */ int g_lockindex = FALSE; /* whether to perform file locking to the database */ int g_searchmax = 0; /* maximum number of documents to send */ int g_rateuri = FALSE; /* whether to rate URI for scoring */ int g_mergemethod = -1; /* merge method of meta search */ int g_scoreexpr = -1; /* score expression */ int g_wildmax = -1; /* maximum number of expansion of wild cards */ int g_snipwwidth = -1; /* whole width of the snippet */ int g_sniphwidth = -1; /* width of beginning of the text */ int g_snipawidth = -1; /* width around each highlighted word */ int g_scancheck = FALSE; /* whether to check documents by scanning */ int g_smlrvnum = -1; /* number of keywords for similarity search */ int g_extdelay = 0; /* number of documents for delay of extraction */ /* other global variables */ char g_outbuf[OUTBUFSIZ]; /* output buffer */ const char *g_scriptname = NULL; /* name of the script */ /* function prototypes */ int main(int argc, char **argv); static int realmain(int argc, char **argv); static void die(const char *msg); static const char *skiplabel(const char *str); static CBMAP *getparameters(void); static void senderror(int code, const char *msg); static void sendnodecmdinform(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params); static void sendnodecmdcacheusage(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params); static void sendnodecmdsearch(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params); static void sendnodecmdgetdoc(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params); static void sendnodecmdgetdocattr(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params); static void sendnodecmdetchdoc(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params); static void sendnodecmduritoid(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params); static void sendnodecmdputdoc(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params); static void sendnodecmdoutdoc(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params); static void sendnodecmdeditdoc(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params); static void sendnodecmdsync(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params); static void sendnodecmdoptimize(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params); static void procpostcmdoutdoc(const char *idxname, const char *uri); static void procpostcmdsync(const char *idxname); static void procpostcmdoptimize(const char *idxname); /* main routine */ int main(int argc, char **argv){ #if defined(MYFCGI) static int cnt = 0; est_proc_env_reset(); while(FCGI_Accept() >= 0){ realmain(argc, argv); fflush(stdout); if(++cnt >= 64) exit(0); } return 0; #else est_proc_env_reset(); return realmain(argc, argv); #endif } /* real main routine */ static int realmain(int argc, char **argv){ ESTMTDB *db; CBLIST *lines; CBMAP *params; CBDATUM *myurl; const char *rp, *idxname, *cmd; char *tmp, *wp; int i, omode, ecode; /* set configurations */ setvbuf(stdout, g_outbuf, _IOFBF, OUTBUFSIZ); g_scriptname = argv[0]; if((rp = getenv("SCRIPT_NAME")) != NULL) g_scriptname = rp; if((rp = strrchr(g_scriptname, '/')) != NULL) g_scriptname = rp + 1; tmp = cbmalloc(strlen(g_scriptname) + strlen(CONFSUFFIX) + 1); sprintf(tmp, "%s", g_scriptname); cbglobalgc(tmp, free); if(!(wp = strrchr(tmp, '.'))) wp = tmp + strlen(tmp); sprintf(wp, "%s", CONFSUFFIX); g_conffile = tmp; if(!(lines = cbreadlines(g_conffile))) die("the configuration file is missing."); cbglobalgc(lines, (void (*)(void *))cblistclose); for(i = 0; i < cblistnum(lines); i++){ rp = cblistval(lines, i, NULL); if(cbstrfwimatch(rp, "indexdir:")){ g_indexdir = skiplabel(rp); } else if(cbstrfwimatch(rp, "runmode:")){ g_runmode = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "pidxsuffix:")){ g_pidxsuffix = skiplabel(rp); } else if(cbstrfwimatch(rp, "pidxdocmax:")){ g_pidxdocmax = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "pidxdocmin:")){ g_pidxdocmin = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "lockindex:")){ g_lockindex = atoi(skiplabel(rp)) > 0; } else if(cbstrfwimatch(rp, "searchmax:")){ g_searchmax = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "rateuri:")){ g_rateuri = atoi(skiplabel(rp)) > 0; } else if(cbstrfwimatch(rp, "mergemethod:")){ g_mergemethod = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "scoreexpr:")){ g_scoreexpr = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "wildmax:")){ g_wildmax = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "snipwwidth:")){ g_snipwwidth = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "sniphwidth:")){ g_sniphwidth = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "snipawidth:")){ g_snipawidth = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "scancheck:")){ g_scancheck = atoi(skiplabel(rp)) > 0; } else if(cbstrfwimatch(rp, "smlrvnum:")){ g_smlrvnum = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "extdelay:")){ g_extdelay = atoi(skiplabel(rp)); } } if(!g_indexdir) die("indexdir is undefined."); if(g_runmode < RM_NORMAL || g_runmode > RM_RDONLY) die("runmode is undefined."); if(!g_pidxsuffix) die("pidxsuffix is undefined."); if(g_pidxdocmax < 0) die("pidxdocmax is undefined."); if(g_pidxdocmin < 0) die("pidxdocmin is undefined."); if(g_searchmax < 0) die("searchmax is undefined."); if(g_rateuri < 0) die("rateuri is undefined."); if(g_mergemethod < 0) die("mergemethod is undefined."); if(g_scoreexpr < 0) die("scoreexpr is undefined."); if(g_wildmax < 0) die("wildmax is undefined."); if(g_snipwwidth < 0) die("snipwwidth is undefined."); if(g_sniphwidth < 0) die("sniphwidth is undefined."); if(g_snipawidth < 0) die("snipawidth is undefined."); if(g_smlrvnum < 0) die("smlrvnum is undefined."); /* read parameters */ if(!(idxname = getenv("PATH_INFO"))) idxname = ""; if(*idxname == '/') idxname++; if((rp = strrchr(idxname, '/')) != NULL){ tmp = cbmemdup(idxname, rp - idxname); idxname = tmp; cbglobalgc(tmp, free); if(strstr(idxname, ESTPATHSTR ESTCDIRSTR ESTPATHSTR) || strstr(idxname, ESTPATHSTR ESTPDIRSTR ESTPATHSTR)) idxname = ""; cmd = rp + 1; } else { cmd = ""; } params = getparameters(); cbglobalgc(params, (void (*)(void *))cbmapclose); cbmapout(params, PPOUTDOC, -1); cbmapout(params, PPPOSTCMD, -1); myurl = cbdatumopen(NULL, -1); if((rp = getenv("HTTP_HOST")) != NULL) cbdatumprintf(myurl, "http://%s", rp); if((rp = getenv("SCRIPT_NAME")) != NULL) cbdatumprintf(myurl, "%s", rp); cbdatumprintf(myurl, "/%s", idxname); /* open the database */ tmp = cbsprintf("%s%c%s", g_indexdir, ESTPATHCHR, idxname); omode = ESTDBREADER; if(!g_lockindex && strcmp(cmd, "put_doc") && strcmp(cmd, "out_doc")) omode |= ESTDBNOLCK; if((db = est_mtdb_open(tmp, omode, &ecode)) != NULL && *g_pidxsuffix != '\0'){ free(tmp); tmp = cbsprintf("%s%c%s%s", g_indexdir, ESTPATHCHR, idxname, g_pidxsuffix); est_mtdb_add_pseudo_index(db, tmp); } free(tmp); /* send the result */ if(!db){ senderror(404, "Not Found (the node does not exist)"); } else if(!strcmp(cmd, "inform")){ sendnodecmdinform(db, cbdatumptr(myurl), idxname, params); } else if(!strcmp(cmd, "cacheusage")){ sendnodecmdcacheusage(db, cbdatumptr(myurl), idxname, params); } else if(!strcmp(cmd, "search")){ sendnodecmdsearch(db, cbdatumptr(myurl), idxname, params); } else if(!strcmp(cmd, "get_doc")){ sendnodecmdgetdoc(db, cbdatumptr(myurl), idxname, params); } else if(!strcmp(cmd, "get_doc_attr")){ sendnodecmdgetdocattr(db, cbdatumptr(myurl), idxname, params); } else if(!strcmp(cmd, "etch_doc")){ sendnodecmdetchdoc(db, cbdatumptr(myurl), idxname, params); } else if(!strcmp(cmd, "uri_to_id")){ sendnodecmduritoid(db, cbdatumptr(myurl), idxname, params); } else if(!strcmp(cmd, "put_doc")){ if(g_runmode == RM_RDONLY){ senderror(503, "Service Unavailable (read only)"); } else { sendnodecmdputdoc(db, cbdatumptr(myurl), idxname, params); } } else if(!strcmp(cmd, "out_doc")){ if(g_runmode == RM_RDONLY){ senderror(503, "Service Unavailable (read only)"); } else { sendnodecmdoutdoc(db, cbdatumptr(myurl), idxname, params); } } else if(!strcmp(cmd, "edit_doc")){ if(g_runmode == RM_RDONLY){ senderror(503, "Service Unavailable (read only)"); } else { sendnodecmdeditdoc(db, cbdatumptr(myurl), idxname, params); } } else if(!strcmp(cmd, "sync")){ if(g_runmode == RM_RDONLY){ senderror(503, "Service Unavailable (read only)"); } else { sendnodecmdsync(db, cbdatumptr(myurl), idxname, params); } } else if(!strcmp(cmd, "optimize")){ if(g_runmode == RM_RDONLY){ senderror(503, "Service Unavailable (read only)"); } else { sendnodecmdoptimize(db, cbdatumptr(myurl), idxname, params); } } else if(!strcmp(cmd, "_set_user") || !strcmp(cmd, "_set_link")){ senderror(501, "Not Implemented (editing meta data is not supported)"); } else { senderror(400, "Bad Request (the command is invalid)"); } /* release resources */ if(db) est_mtdb_close(db, &ecode); cbdatumclose(myurl); /* perform the post commands */ if((cmd = cbmapget(params, PPOUTDOC, -1, NULL)) != NULL) procpostcmdoutdoc(idxname, cmd); if((cmd = cbmapget(params, PPPOSTCMD, -1, NULL)) != NULL){ if(!strcmp(cmd, "sync")){ procpostcmdsync(idxname); } else if(!strcmp(cmd, "optimize")){ procpostcmdoptimize(idxname); } } return 0; } /* show the error page and exit */ static void die(const char *msg){ printf("Status: 500 Internal Server Error\r\n"); printf("Content-Type: text/plain; charset=UTF-8\r\n"); printf("\r\n"); printf("Error: %s\n", msg); exit(1); } /* skip the label of a line */ static const char *skiplabel(const char *str){ if(!(str = strchr(str, ':'))) return ""; str++; while(*str != '\0' && (*str == ' ' || *str == '\t')){ str++; } return str; } /* get CGI parameters */ static CBMAP *getparameters(void){ int maxlen = 1024 * 1024 * 32; CBMAP *map, *attrs; CBLIST *pairs, *parts; const char *type, *rp, *body; char *buf, *key, *val, *dkey, *dval, *wp, *bound, *fbuf, *aname; int i, len, c, blen, flen; map = cbmapopenex(37); buf = NULL; len = 0; if((rp = getenv("REQUEST_METHOD")) != NULL && !strcmp(rp, "POST") && (rp = getenv("CONTENT_LENGTH")) != NULL && (len = atoi(rp)) > 0){ if(len > maxlen) len = maxlen; buf = cbmalloc(len + 1); for(i = 0; i < len && (c = getchar()) != EOF; i++){ buf[i] = c; } buf[i] = '\0'; if(i != len){ free(buf); buf = NULL; } } else if((rp = getenv("QUERY_STRING")) != NULL){ buf = cbmemdup(rp, -1); len = strlen(buf); } if(buf && len > 0){ if(!(type = getenv("CONTENT_TYPE"))) type = "text/plain"; if(cbstrfwmatch(type, "multipart/form-data") && (rp = strstr(rp, "boundary=")) != NULL){ rp += 9; bound = cbmemdup(rp, -1); if((wp = strchr(bound, ';')) != NULL) *wp = '\0'; parts = cbmimeparts(buf, len, bound); for(i = 0; i < cblistnum(parts); i++){ body = cblistval(parts, i, &blen); attrs = cbmapopen(); fbuf = cbmimebreak(body, blen, attrs, &flen); if((rp = cbmapget(attrs, "NAME", -1, NULL)) != NULL){ cbmapput(map, rp, -1, fbuf, flen, FALSE); aname = cbsprintf("%s-filename", rp); if((rp = cbmapget(attrs, "FILENAME", -1, NULL)) != NULL) cbmapput(map, aname, -1, rp, -1, FALSE); free(aname); } free(fbuf); cbmapclose(attrs); } cblistclose(parts); free(bound); } else if(cbstrfwmatch(type, ESTDRAFTTYPE)){ cbmapput(map, "draft", -1, buf, -1, FALSE); } else { pairs = cbsplit(buf, -1, "&"); for(i = 0; i < cblistnum(pairs); i++){ key = cbmemdup(cblistval(pairs, i, NULL), -1); if((val = strchr(key, '=')) != NULL){ *(val++) = '\0'; dkey = cburldecode(key, NULL); dval = cburldecode(val, NULL); cbmapput(map, dkey, -1, dval, -1, FALSE); free(dval); free(dkey); } free(key); } cblistclose(pairs); } } free(buf); return map; } /* send the error page */ static void senderror(int code, const char *msg){ printf("Status: %d %s\r\n", code, msg); printf("Content-Type: text/plain; charset=UTF-8\r\n"); printf("\r\n"); printf("%s\n", msg); } /* send the result of the inform command */ static void sendnodecmdinform(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params){ printf("Content-Type: %s; charset=UTF-8\r\n", ESTINFORMTYPE); printf("\r\n"); printf("%s\t%s\t%d\t%d\t%.0f\n", myurl, mylabel, est_mtdb_doc_num(db) + est_mtdb_pseudo_doc_num(db), est_mtdb_word_num(db), est_mtdb_size(db)); printf("\n"); printf("dummy-admin\n"); printf("\n"); printf("dummy-user\n"); printf("\n"); } /* send the result of the cacheusage command */ static void sendnodecmdcacheusage(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params){ printf("Content-Type: text/plain; charset=UTF-8\r\n"); printf("\r\n"); printf("%0.6f\n", 0.0); } /* send the result of the search command */ static void sendnodecmdsearch(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params){ RESMAP *resmap; RESDOC **resdocs, *resdoc; ESTCOND *cond; CBMAP *hints, *kwords; const CBLIST *texts; CBLIST *attrs, *words, *list; ESTDOC *doc; const char *rp, *phrase, *order, *distinct, *bordstr, *kbuf, *vbuf; char name[NUMBUFSIZ], *snippet; int i, j, len, max, options, auxiliary, wwidth, hwidth, awidth, skip, lmax, rateuri; int *res, rnum, hnum, miss, cnt, score, down, dnum, wnum, end, num, id; double curtime, itime, weight, fsiz; if(!(phrase = cbmapget(params, "phrase", -1, NULL))) phrase = ""; while(*phrase == ' ' || *phrase == '\t'){ phrase++; } attrs = cblistopen(); cbglobalgc(attrs, (void (*)(void *))cblistclose); if((rp = cbmapget(params, "attr", -1, NULL)) != NULL){ while(*rp == ' ' || *rp == '\t'){ rp++; } if(*rp != '\0') cblistpush(attrs, rp, -1); } for(i = 0; i <= CONDATTRMAX; i++){ len = sprintf(name, "attr%d", i); if((rp = cbmapget(params, name, len, NULL)) != NULL){ while(*rp == ' ' || *rp == '\t'){ rp++; } if(*rp != '\0') cblistpush(attrs, rp, -1); } } if(!(order = cbmapget(params, "order", -1, NULL))) order = ""; while(*order == ' ' || *order == '\t'){ order++; } max = -1; if((rp = cbmapget(params, "max", -1, NULL)) != NULL) max = atoi(rp); if(max < 1) max = DEFMAXSRCH; if(max > g_searchmax) max = g_searchmax; options = -1; if((rp = cbmapget(params, "options", -1, NULL)) != NULL) options = atoi(rp); auxiliary = INT_MIN; if((rp = cbmapget(params, "auxiliary", -1, NULL)) != NULL) auxiliary = atoi(rp); if(!(distinct = cbmapget(params, "distinct", -1, NULL))) distinct = ""; while(*distinct == ' ' || *distinct == '\t'){ distinct++; } wwidth = -1; if((rp = cbmapget(params, "wwidth", -1, NULL)) != NULL) wwidth = atoi(rp); if(wwidth < 0) wwidth = g_snipwwidth; hwidth = -1; if((rp = cbmapget(params, "hwidth", -1, NULL)) != NULL) hwidth = atoi(rp); if(hwidth < 0) hwidth = g_snipwwidth; awidth = -1; if((rp = cbmapget(params, "awidth", -1, NULL)) != NULL) awidth = atoi(rp); if(awidth < 0) awidth = g_snipawidth; skip = -1; if((rp = cbmapget(params, "skip", -1, NULL)) != NULL) skip = atoi(rp); if(skip < 0) skip = 0; bordstr = est_border_str(); cond = est_cond_new(); if(*phrase != '\0') est_cond_set_phrase(cond, phrase); for(i = 0; i < cblistnum(attrs); i++){ est_cond_add_attr(cond, cblistval(attrs, i, NULL)); } if(*order != '\0') est_cond_set_order(cond, order); if(options > 0) est_cond_set_options(cond, options); est_cond_set_options(cond, ESTCONDSCFB); if(auxiliary != INT_MIN) est_cond_set_auxiliary(cond, auxiliary); if(*distinct != '\0') est_cond_set_distinct(cond, distinct); resmap = resmap_new(); hints = cbmapopenex(MINIBNUM); curtime = est_gettimeofday(); lmax = max + skip + 1; res = est_mtdb_search(db, cond, &rnum, hints); hnum = (vbuf = cbmapget(hints, "", 0, NULL)) ? atoi(vbuf) : rnum; if(max >= 0 && hnum < max + 1 && est_cond_auxiliary_word(cond, "")){ free(res); est_cond_set_auxiliary(cond, -1); res = est_mtdb_search(db, cond, &rnum, hints); hnum = (vbuf = cbmapget(hints, "", 0, NULL)) ? atoi(vbuf) : rnum; } miss = 0; itime = est_gettimeofday() - curtime; cnt = 0; rateuri = g_rateuri && !cbstrfwmatch(phrase, ESTOPSIMILAR); for(i = 0; i < rnum && cnt < lmax; i++){ if(!(doc = est_mtdb_get_doc(db, res[i], 0))) continue; if(g_scancheck && *phrase != '\0' && *phrase != '[' && *phrase != '*' && res[i] < ESTPDOCIDMIN && !est_mtdb_scan_doc(db, doc, cond)){ est_doc_delete(doc); miss++; continue; } score = est_cond_score(cond, i); if(rateuri && g_scoreexpr != SE_ASIS){ if((vbuf = est_doc_attr(doc, ESTDATTRURI)) != NULL){ if(score < 100) score = 100; down = 4; if(cbstrfwimatch(vbuf, "file://")){ vbuf += 7; } else if(cbstrfwimatch(vbuf, "ftp://")){ vbuf += 6; } else if(cbstrfwimatch(vbuf, "http://")){ vbuf += 7; } else if(cbstrfwimatch(vbuf, "https://")){ vbuf += 8; } else { down += 3; } while(vbuf[0] != '\0'){ if(vbuf[0] == '?' || vbuf[0] == '#'){ down++; break; } if(vbuf[0] == '/' && vbuf[1] != '\0') down++; vbuf++; } score *= 8.0 / (double)down; } else { score = 0; } } est_doc_add_attr(doc, DATTRNDURL, myurl); est_doc_add_attr(doc, DATTRNDLABEL, mylabel); if(score >= 0){ sprintf(name, "%d", score); est_doc_add_attr(doc, DATTRNDSCORE, name); } if(g_scoreexpr != SE_ASIS){ weight = 1.0; if((vbuf = est_doc_attr(doc, ESTDATTRWEIGHT)) != NULL){ weight = strtod(vbuf, NULL); weight = weight >= 0.01 ? weight : 0.01; } weight /= 10.0; switch(g_mergemethod){ case MM_SCORE: score = score * weight; break; case MM_SCRK: score = score * (max * 2 - cnt) * weight; break; case MM_RANK: score = SELFCREDIT * (max - cnt); break; } } resmap_put(resmap, score, doc, NULL, NULL); cnt++; } free(res); words = est_hints_to_words(hints); dnum = est_mtdb_doc_num(db) + est_mtdb_pseudo_doc_num(db); wnum = est_mtdb_word_num(db); fsiz = est_mtdb_size(db); end = max + skip; curtime = est_gettimeofday() - curtime; printf("Content-Type: %s; charset=UTF-8\r\n", ESTSEARCHTYPE); printf("\r\n"); printf("%s\n", bordstr); printf("VERSION\t%s\n", _EST_PROTVER); printf("NODE\t%s\n", myurl); printf("HIT\t%d\n", hnum - miss); cbmapiterinit(hints); num = 1; while((kbuf = cbmapiternext(hints, NULL)) != NULL){ if(*kbuf == '\0') continue; printf("HINT#%d\t%s\t%s\n", num, kbuf, cbmapiterval(kbuf, NULL)); num++; } printf("DOCNUM\t%d\n", dnum); printf("WORDNUM\t%d\n", wnum); printf("TIME\t%.6f\n", curtime / 1000.0); printf("TIME#i\t%.6f\n", itime / 1000.0); printf("TIME#0\t%.6f\n", curtime / 1000.0); printf("LINK#0\t%s\t", myurl); printf("%s\t%d\t%d\t%d\t%.0f\t%d\n", mylabel, SELFCREDIT, dnum, wnum, fsiz, hnum - miss); printf("VIEW\tSNIPPET\n"); printf("\n"); if(*order == '\0' && cbstrfwmatch(phrase, ESTOPSIMILAR)) order = DATTRNDSCORE " " ESTORDNUMD; resdocs = resmap_list(resmap, &rnum, order, NULL); for(i = skip; i < rnum && i < end; i++){ resdoc = resdocs[i]; if(!resdoc->doc) continue; printf("%s\n", bordstr); list = est_doc_attr_names(resdoc->doc); for(j = 0; j < cblistnum(list); j++){ vbuf = cblistval(list, j, NULL); printf("%s=%s\n", vbuf, est_doc_attr(resdoc->doc, vbuf)); } cblistclose(list); if(g_smlrvnum > 0){ printf("%s", ESTDCNTLVECTOR); id = est_doc_id(resdoc->doc); kwords = id > 0 ? est_mtdb_get_keywords(db, id) : NULL; if(!kwords){ if(g_extdelay < 0){ kwords = est_morph_etch_doc(resdoc->doc, g_smlrvnum); } else { kwords = est_mtdb_etch_doc(db, resdoc->doc, g_smlrvnum); } } cbmapiterinit(kwords); while((kbuf = cbmapiternext(kwords, NULL)) != NULL){ printf("\t%s\t%s", kbuf, cbmapiterval(kbuf, NULL)); } cbmapclose(kwords); printf("\n"); } printf("\n"); if(wwidth < 0){ texts = est_doc_texts(resdoc->doc); for(j = 0; j < cblistnum(texts); j++){ printf("%s\n", cblistval(texts, j, NULL)); } vbuf = est_doc_hidden_texts(resdoc->doc); if(vbuf[0] != '\0') printf("\t%s\n", vbuf); } else if(wwidth > 0){ snippet = est_doc_make_snippet(resdoc->doc, words, wwidth, hwidth, awidth); printf("%s", snippet); free(snippet); } } free(resdocs); printf("%s:END\n", bordstr); cblistclose(words); cbmapclose(hints); resmap_delete(resmap); est_cond_delete(cond); } /* send the result of the get_doc command */ static void sendnodecmdgetdoc(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params){ ESTDOC *doc; const char *rp, *uri; char *draft; int id; id = (rp = cbmapget(params, "id", -1, NULL)) ? atoi(rp) : 0; if(!(uri = cbmapget(params, "uri", -1, NULL))) uri = ""; if(id < 1 && uri[0] == '\0'){ senderror(400, "Bad Request (the parameters lack)"); return; } if(id < 1) id = est_mtdb_uri_to_id(db, uri); if(id > 0 && (doc = est_mtdb_get_doc(db, id, 0)) != NULL){ est_doc_add_attr(doc, DATTRNDURL, myurl); est_doc_add_attr(doc, DATTRNDLABEL, mylabel); draft = est_doc_dump_draft(doc); printf("Content-Type: %s; charset=UTF-8\r\n", ESTDRAFTTYPE); printf("\r\n"); printf("%s", draft); free(draft); est_doc_delete(doc); } else { senderror(400, "Bad Request (maybe, the document does not exist)"); } } /* send the result of the get_doc_attr command */ static void sendnodecmdgetdocattr(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params){ const char *rp, *uri, *attr; char *value; int id; id = (rp = cbmapget(params, "id", -1, NULL)) ? atoi(rp) : 0; if(!(uri = cbmapget(params, "uri", -1, NULL))) uri = ""; if(!(attr = cbmapget(params, "attr", -1, NULL))) attr = ""; if((id < 1 && uri[0] == '\0') || attr[0] == '\0'){ senderror(400, "Bad Request (the parameters lack)"); return; } if(id < 1) id = est_mtdb_uri_to_id(db, uri); if(id > 0 && (value = est_mtdb_get_doc_attr(db, id, attr)) != NULL){ printf("Content-Type: text/plain; charset=UTF-8\r\n"); printf("\r\n"); printf("%s\n", value); free(value); } else { senderror(400, "Bad Request (maybe, the document or the attribute does not exist)"); } } /* send the result of the etch_doc command */ static void sendnodecmdetchdoc(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params){ ESTDOC *doc; CBMAP *kwords; const char *rp, *uri, *kbuf; int id, ksiz; id = (rp = cbmapget(params, "id", -1, NULL)) ? atoi(rp) : 0; if(!(uri = cbmapget(params, "uri", -1, NULL))) uri = ""; if(id < 1 && uri[0] == '\0'){ senderror(400, "Bad Request (the parameters lack)"); return; } if(id < 1) id = est_mtdb_uri_to_id(db, uri); kwords = NULL; if(id > 0){ kwords = est_mtdb_get_keywords(db, id); if(!kwords && (doc = est_mtdb_get_doc(db, id, 0)) != NULL){ kwords = est_mtdb_etch_doc(db, doc, g_smlrvnum > 0 ? g_smlrvnum : KWORDNUM); est_doc_delete(doc); } } if(kwords){ printf("Content-Type: text/plain; charset=UTF-8\r\n"); printf("\r\n"); cbmapiterinit(kwords); while((kbuf = cbmapiternext(kwords, &ksiz)) != NULL){ printf("%s\t%s\n", kbuf, cbmapiterval(kbuf, NULL)); } cbmapclose(kwords); } else { senderror(400, "Bad Request (maybe, the document does not exist)"); } } /* send the result of the uri_to_id command */ static void sendnodecmduritoid(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params){ const char *uri; int id; uri = cbmapget(params, "uri", -1, NULL); if(!uri){ senderror(400, "Bad Request (the parameters lack)"); return; } if((id = est_mtdb_uri_to_id(db, uri)) > 0){ printf("Content-Type: text/plain; charset=UTF-8\r\n"); printf("\r\n"); printf("%d\n", id); } else { senderror(400, "Bad Request (maybe, the URI is not registered)"); } } /* send the result of the put_doc command */ static void sendnodecmdputdoc(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params){ ESTDOC *doc; CBMAP *kwords; const char *draft, *uri; char *dbuf, *tmp; draft = cbmapget(params, "draft", -1, NULL); if(!draft){ senderror(400, "Bad Request (the parameters lack)"); return; } doc = est_doc_new_from_draft(draft); if(!(uri = est_doc_attr(doc, ESTDATTRURI))){ senderror(400, "Bad Request (the parameters lack)"); est_doc_delete(doc); return; } dbuf = NULL; if(g_smlrvnum > 0 && g_extdelay < 0 && !est_doc_keywords(doc)){ kwords = est_morph_etch_doc(doc, g_smlrvnum); est_doc_set_keywords(doc, kwords); cbmapclose(kwords); dbuf = est_doc_dump_draft(doc); draft = dbuf; } tmp = cbsprintf("%s%s%c%012d%06d.est", est_mtdb_name(db), g_pidxsuffix, ESTPATHCHR, (int)time(NULL), (int)getpid()); if(cbwritefile(tmp, draft, -1)){ if(est_mtdb_uri_to_id(db, uri) > 0) cbmapput(params, PPOUTDOC, -1, uri, -1, TRUE); if(est_mtdb_pseudo_doc_num(db) > g_pidxdocmax) cbmapput(params, PPPOSTCMD, -1, "sync", -1, TRUE); printf("Content-Type: text/plain; charset=UTF-8\r\n"); printf("\r\n"); printf("OK\n"); } else { senderror(403, "Forbidden (writing a pseudo document failed)"); } free(tmp); free(dbuf); est_doc_delete(doc); } /* send the result of the out_doc command */ static void sendnodecmdoutdoc(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params){ const char *rp, *uri; char *tmp; int id; id = (rp = cbmapget(params, "id", -1, NULL)) ? atoi(rp) : 0; if(!(uri = cbmapget(params, "uri", -1, NULL))) uri = ""; if(id < 1 && uri[0] == '\0'){ senderror(400, "Bad Request (the parameters lack)"); return; } if(id < 1) id = est_mtdb_uri_to_id(db, uri); if(id > 0){ if((tmp = est_mtdb_get_doc_attr(db, id, ESTDATTRURI)) != NULL){ cbmapput(params, PPOUTDOC, -1, tmp, -1, TRUE); free(tmp); } printf("Content-Type: text/plain; charset=UTF-8\r\n"); printf("\r\n"); printf("OK\n"); } else { senderror(400, "Bad Request (maybe, the document does not exist)"); } } /* send the result of the edit_doc command */ static void sendnodecmdeditdoc(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params){ ESTDOC *doc, *odoc, *ndoc; const CBLIST *texts; CBLIST *list, *names; const char *draft, *uri, *name, *vbuf; char *tmp, numbuf[NUMBUFSIZ], *odraft, *ndraft; int i, j, id, done; draft = cbmapget(params, "draft", -1, NULL); if(!draft){ senderror(400, "Bad Request (the parameters lack)"); return; } doc = est_doc_new_from_draft(draft); if(!(uri = est_doc_attr(doc, ESTDATTRURI))){ senderror(400, "Bad Request (the parameters lack)"); est_doc_delete(doc); return; } if((id = est_mtdb_uri_to_id(db, uri)) < 1){ senderror(400, "Bad Request (maybe, the document does not exist)"); est_doc_delete(doc); return; } if(id >= ESTPDOCIDMIN){ est_doc_add_attr(doc, ESTDATTRID, NULL); tmp = cbsprintf("%s%s", est_mtdb_name(db), g_pidxsuffix); list = cbdirlist(tmp); free(tmp); done = FALSE; if(list){ cblistsort(list); for(i = 0; !done && i < cblistnum(list); i++){ name = cblistval(list, i, NULL); if(!strcmp(name, ESTCDIRSTR) || !strcmp(name, ESTPDIRSTR)) continue; tmp = cbsprintf("%s%s%c%s", est_mtdb_name(db), g_pidxsuffix, ESTPATHCHR, name); if((odraft = cbreadfile(tmp, NULL)) != NULL){ odoc = est_doc_new_from_draft(odraft); if((vbuf = est_doc_attr(odoc, ESTDATTRURI)) != NULL && !strcmp(vbuf, uri)){ ndoc = est_doc_new(); names = est_doc_attr_names(doc); for(j = 0; j < cblistnum(names); j++){ vbuf = cblistval(names, j, NULL); if(!strcmp(vbuf, ESTDATTRID)) continue; est_doc_add_attr(ndoc, vbuf, est_doc_attr(doc, vbuf)); } texts = est_doc_texts(odoc); for(j = 0; j < cblistnum(texts); j++){ est_doc_add_text(ndoc, cblistval(texts, j, NULL)); } if((vbuf = est_doc_hidden_texts(odoc)) != NULL && vbuf[0] != '\0') est_doc_add_hidden_text(ndoc, vbuf); ndraft = est_doc_dump_draft(ndoc); if(cbwritefile(tmp, ndraft, -1)) done = TRUE; free(ndraft); cblistclose(names); est_doc_delete(ndoc); } est_doc_delete(odoc); free(odraft); } free(tmp); } cblistclose(list); } if(done){ printf("Content-Type: text/plain; charset=UTF-8\r\n"); printf("\r\n"); printf("OK\n"); } else { senderror(403, "Forbidden (writing a pseudo document failed)"); } } else { sprintf(numbuf, "%d", id); est_doc_add_attr(doc, ESTDATTRID, numbuf); if(est_mtdb_edit_doc(db, doc)){ printf("Content-Type: text/plain; charset=UTF-8\r\n"); printf("\r\n"); printf("OK\n"); } else { senderror(400, "Bad Request (maybe, the document is invalid)"); } } est_doc_delete(doc); } /* send the result of the sync command */ static void sendnodecmdsync(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params){ cbmapput(params, PPPOSTCMD, -1, "sync", -1, TRUE); printf("Content-Type: text/plain; charset=UTF-8\r\n"); printf("\r\n"); printf("OK\n"); } /* send the result of the optimize command */ static void sendnodecmdoptimize(ESTMTDB *db, const char *myurl, const char *mylabel, CBMAP *params){ cbmapput(params, PPPOSTCMD, -1, "optimize", -1, TRUE); printf("Content-Type: text/plain; charset=UTF-8\r\n"); printf("\r\n"); printf("OK\n"); } /* perform the sync post command */ static void procpostcmdoutdoc(const char *idxname, const char *uri){ ESTMTDB *db; ESTDOC *doc; CBLIST *list; const char *name, *vbuf; char *tmp, *draft; int i, ecode, done, id; tmp = cbsprintf("%s%c%s", g_indexdir, ESTPATHCHR, idxname); if(!(db = est_mtdb_open(tmp, ESTDBWRITER, &ecode))){ free(tmp); return; } free(tmp); done = FALSE; if((id = est_mtdb_uri_to_id(db, uri)) > 0 && est_mtdb_out_doc(db, id, ESTODCLEAN)) done = TRUE; if(!done){ tmp = cbsprintf("%s%c%s%s", g_indexdir, ESTPATHCHR, idxname, g_pidxsuffix); list = cbdirlist(tmp); free(tmp); if(list){ cblistsort(list); for(i = 0; !done && i < cblistnum(list); i++){ name = cblistval(list, i, NULL); if(!strcmp(name, ESTCDIRSTR) || !strcmp(name, ESTPDIRSTR)) continue; tmp = cbsprintf("%s%c%s%s%c%s", g_indexdir, ESTPATHCHR, idxname, g_pidxsuffix, ESTPATHCHR, name); if((draft = cbreadfile(tmp, NULL)) != NULL){ doc = est_doc_new_from_draft(draft); if((vbuf = est_doc_attr(doc, ESTDATTRURI)) != NULL && !strcmp(vbuf, uri)){ unlink(tmp); done = TRUE; } est_doc_delete(doc); free(draft); } free(tmp); } cblistclose(list); } } est_mtdb_close(db, &ecode); } /* perform the sync post command */ static void procpostcmdsync(const char *idxname){ ESTMTDB *db; ESTDOC *doc; CBLIST *list; const char *name; char *tmp, *draft; int i, ecode, num; tmp = cbsprintf("%s%c%s", g_indexdir, ESTPATHCHR, idxname); if(!(db = est_mtdb_open(tmp, ESTDBWRITER, &ecode))){ free(tmp); return; } free(tmp); tmp = cbsprintf("%s%c%s%s", g_indexdir, ESTPATHCHR, idxname, g_pidxsuffix); list = cbdirlist(tmp); free(tmp); if(list){ cblistsort(list); num = cblistnum(list) - g_pidxdocmin; for(i = 0; i < num; i++){ name = cblistval(list, i, NULL); if(!strcmp(name, ESTCDIRSTR) || !strcmp(name, ESTPDIRSTR)) continue; tmp = cbsprintf("%s%c%s%s%c%s", g_indexdir, ESTPATHCHR, idxname, g_pidxsuffix, ESTPATHCHR, name); if((draft = cbreadfile(tmp, NULL)) != NULL){ doc = est_doc_new_from_draft(draft); if(est_mtdb_put_doc(db, doc, ESTPDCLEAN)) unlink(tmp); est_doc_delete(doc); free(draft); } free(tmp); } cblistclose(list); } est_mtdb_close(db, &ecode); } /* perform the optimize post command */ static void procpostcmdoptimize(const char *idxname){ ESTMTDB *db; char *tmp; int ecode; tmp = cbsprintf("%s%c%s", g_indexdir, ESTPATHCHR, idxname); if(!(db = est_mtdb_open(tmp, ESTDBWRITER, &ecode))){ free(tmp); return; } free(tmp); est_mtdb_optimize(db, ESTOPTNOPURGE); est_mtdb_close(db, &ecode); } /* END OF FILE */ hyperestraier-1.4.13/estfraud.conf000066400000000000000000000003771125261632700171660ustar00rootroot00000000000000indexdir: . runmode: 2 pidxsuffix: -pidx pidxdocmax: 256 pidxdocmin: 0 lockindex: 0 searchmax: 1000 rateuri: 1 mergemethod: 2 scoreexpr: 2 wildmax: 256 snipwwidth: 480 sniphwidth: 96 snipawidth: 96 scancheck: 1 smlrvnum: 32 extdelay: 4096 hyperestraier-1.4.13/estload.c000066400000000000000000000230231125261632700162720ustar00rootroot00000000000000/************************************************************************************************* * The load tester for web applications * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #include "estraier.h" #include "estmtdb.h" #include "estnode.h" #include "myconf.h" #define AGENTNAME "EstLoad" /* name of the user agent */ #define IOBUFSIZ 8192 /* size of a buffer for I/O */ typedef struct { /* type of structure for a target URL */ char *host; /* hostname */ char *addr; /* IP address */ int port; /* port number */ char *auth; /* authority */ char *path; /* path */ char *query; /* query string */ } TARGET; typedef struct { /* type of structure for a worker thread */ int id; /* ID number */ int ims; /* interval time in milliseconds */ int pb; /* to print received data */ int qb; /* to be quiet */ CBLIST *targets; /* list of targets */ int alive; /* to be alive */ } MISSION; /* global variables */ const char *g_progname; /* program name */ /* function prototypes */ int main(int argc, char **argv); static void usage(void); static void printferror(const char *format, ...); static void printfinfo(const char *format, ...); static int procmain(const char *file, int tnum, int lnum, int ims, int pb, int qb); static void *procthread(void *arg); /* main routine */ int main(int argc, char **argv){ char *file; int i, tnum, lnum, ims, pb, qb, rv; est_proc_env_reset(); g_progname = argv[0]; if(!est_init_net_env()){ printferror("could not initialize network environment"); exit(1); } atexit(est_free_net_env); file = NULL; tnum = 1; lnum = 1; ims = 0; pb = FALSE; qb = FALSE; for(i = 1; i < argc; i++){ if(!file && argv[i][0] == '-'){ if(!strcmp(argv[i], "-t")){ if(++i >= argc) usage(); tnum = atoi(argv[i]); } else if(!strcmp(argv[i], "-l")){ if(++i >= argc) usage(); lnum = atoi(argv[i]); } else if(!strcmp(argv[i], "-i")){ if(++i >= argc) usage(); ims = atoi(argv[i]); } else if(!strcmp(argv[i], "-p")){ pb = TRUE; } else if(!strcmp(argv[i], "-q")){ qb = TRUE; } else { usage(); } } else if(!file){ file = argv[i]; } else { usage(); } } if(!file || tnum < 1 || lnum < 1) usage(); rv = procmain(file, tnum, lnum, ims, pb, qb); return rv; } /* print the usage and exit */ static void usage(void){ fprintf(stderr, "%s: stresser for web applications\n", g_progname); fprintf(stderr, "\n"); fprintf(stderr, "usage:\n"); fprintf(stderr, " %s [-t num] [-l num] [-i num] [-p] [-q] [file|url]\n", g_progname); fprintf(stderr, "\n"); exit(1); } /* print formatted error string and flush the buffer */ static void printferror(const char *format, ...){ va_list ap; va_start(ap, format); fprintf(stderr, "%s: ERROR: ", g_progname); vfprintf(stderr, format, ap); fputc('\n', stderr); fflush(stderr); va_end(ap); } /* print formatted information string and flush the buffer */ static void printfinfo(const char *format, ...){ va_list ap; va_start(ap, format); printf("%s: INFO: ", g_progname); vprintf(format, ap); putchar('\n'); fflush(stdout); va_end(ap); } /* proc the main command */ static int procmain(const char *file, int tnum, int lnum, int ims, int pb, int qb){ pthread_t *threads; MISSION *missions; TARGET target; CBLIST *list; CBMAP *elems; const char *line, *host, *pstr, *auth, *path, *query; int i, j, cnt, pnum, err; double etime; if(cbstrfwimatch(file, "http://")){ list = cblistopen(); cblistpush(list, file, -1); } else if(!(list = cbreadlines(file))){ printferror("%s: could not open", file); return 1; } threads = cbmalloc(tnum * sizeof(pthread_t)); missions = cbmalloc(tnum * sizeof(MISSION)); for(i = 0; i < tnum; i++){ missions[i].id = i + 1; missions[i].ims = ims; missions[i].pb = pb; missions[i].qb = qb; missions[i].targets = cblistopen(); } cnt = 0; for(i = 0; i < lnum; i++){ for(j = 0; j < cblistnum(list); j++){ line = cblistval(list, j, NULL); if((line[0] == '\0')) continue; elems = cburlbreak(line); host = cbmapget(elems, "host", -1, NULL); pnum = (pstr = cbmapget(elems, "port", -1, NULL)) ? atoi(pstr) : 80; auth = cbmapget(elems, "authority", -1, NULL); path = cbmapget(elems, "path", -1, NULL); query = cbmapget(elems, "query", -1, NULL); if(!host || pnum < 1){ printferror("%s: invalid URL", line); cbmapclose(elems); continue; } if(!auth) auth = ""; if(!path) path = "/"; if(!query) query = ""; if(!(target.addr = est_get_host_addr(host))){ printferror("%s: unknown host", host); cbmapclose(elems); continue; } target.host = cbmemdup(host, -1); target.port = pnum; target.auth = cbmemdup(auth, -1); target.path = cbmemdup(path, -1); target.query = cbmemdup(query, -1); cblistpush(missions[cnt++%tnum].targets, (char *)&target, sizeof(TARGET)); cbmapclose(elems); } } cblistclose(list); err = FALSE; etime = est_gettimeofday(); if(tnum > 1){ for(i = 0; i < tnum; i++){ missions[i].alive = FALSE; if(pthread_create(threads + i, NULL, procthread, missions + i) == 0){ missions[i].alive = TRUE; } else { printferror("thread creation failed"); err = TRUE; } } for(i = 0; i < tnum; i++){ if(!missions[i].alive) continue; if(pthread_join(threads[i], NULL) != 0){ printferror("thread join failed"); err = TRUE; } } } else { procthread(missions); } etime = est_gettimeofday() - etime; if(cnt > 0 && !err) printfinfo("finished: elepsed time: %.3f sec. (average: %.3f)", etime / 1000, etime / cnt / 1000); for(i = 0; i < tnum; i++){ for(j = 0; j < cblistnum(missions[i].targets); j++){ target = *(TARGET *)cblistval(missions[i].targets, j, NULL); free(target.query); free(target.path); free(target.auth); free(target.addr); free(target.host); } cblistclose(missions[i].targets); } free(missions); free(threads); return err ? 1 : 0; } /* process as a child thread */ static void *procthread(void *arg){ CBLIST *targets; TARGET target; char iobuf[IOBUFSIZ], *wp, *tmp; int i, id, ims, pb, qb, clsock, size; double etime; targets = ((MISSION *)arg)->targets; id = ((MISSION *)arg)->id; ims = ((MISSION *)arg)->ims; pb = ((MISSION *)arg)->pb; qb = ((MISSION *)arg)->qb; if(cblistnum(targets) < 1) return NULL; printfinfo("%d: started", id); etime = est_gettimeofday(); for(i = 0; i < cblistnum(targets); i++){ target = *(TARGET *)cblistval(targets, i, NULL); if(!qb) printfinfo("%d(%d/%d): http://%s:%d%s%s%s", id, i + 1, cblistnum(targets), target.host, target.port, target.path, target.query[0] != '\0' ? "?" : "", target.query); if((clsock = est_get_client_sock(target.addr, target.port)) != -1){ wp = iobuf; wp += sprintf(wp, "GET %s%s%s HTTP/1.0\r\n", target.path, target.query[0] != '\0' ? "?" : "", target.query); wp += sprintf(wp, "Host: %s:%d\r\n", target.host, target.port); wp += sprintf(wp, "Connection: close\r\n"); if(target.auth[0] != '\0'){ tmp = cbbaseencode(target.auth, -1); wp += sprintf(wp, "Authorization: Basic %s\r\n", tmp); free(tmp); } wp += sprintf(wp, "Referer: http://%s:%d%s%s%s\r\n", target.host, target.port, target.path, target.query[0] != '\0' ? "?" : "", target.query); wp += sprintf(wp, "User-Agent: %s/%s\r\n", AGENTNAME, est_version); wp += sprintf(wp, "\r\n"); est_sock_send_all(clsock, iobuf, wp - iobuf); while((size = recv(clsock, iobuf, IOBUFSIZ, 0)) > 0){ if(pb) fwrite(iobuf, 1, size, stdout); } est_sock_down(clsock); } else { printferror("%d(%d/%d): connection failed", id, i + 1, cblistnum(targets)); } if(ims > 0) est_usleep(ims * 1000); } etime = est_gettimeofday() - etime; printfinfo("%d: finished: elapsed time: %.3f sec. (average: %.3f)", id, etime / 1000, etime / cblistnum(targets) / 1000); return NULL; } /* END OF FILE */ hyperestraier-1.4.13/estmaster.c000066400000000000000000007703411125261632700166620ustar00rootroot00000000000000/************************************************************************************************* * The master of node servers * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #include "mastermod.h" #include "myimage.dat" #define SERVNAME "estmaster" /* name of the server */ #define IOBUFSIZ 8192 /* size of a buffer for I/O */ #define SPCACHEMNUM 131072 /* max number of the special cache */ #define IREFRESHSEC 3 /* wait time for refreshing and charging */ #define ICHARGENUM 16 /* number of keys per charging */ #define IFLUSHNUM 32768 /* number of keys per flushing */ #define LINKMASKMAX 9 /* maximum number of link masks */ #define LCSRCHRESMIN 31 /* minimum number of result to get from local */ #define RMSRCHRESMIN 16 /* minimum number of result to get from local */ #define FCLOSECONNNUM 10 /* number of over connections for forced closing */ #define FCLOSEWAITMAX 10 /* wait time for forced closing */ #define FTERMWAITMAX 60 /* wait time for forced termination */ #define HELPERTRYNUM 3 /* number of trys of helper command */ #define UICACHELIFE 1800 /* maximum age of image cache data */ #define IMGCACHELIFE (3600 * 24) /* maximum age of image cache data */ #define MASTERLOC "/master" /* location of the URL of the master */ #define NODEPREFIX "/node/" /* prefix of URLs of nodes */ #define MASTERUILOC "/master_ui" /* location of administration user intarfaces */ #define FAVICONLOC "/favicon.ico" /* location of the favorite icon */ #define IMAGEPREFIX "/image/" /* prefix of URLs of images */ #define SEARCHUICMD "search_ui" /* name of search user interface */ #define SEARCHATOMCMD "search_atom" /* name of Atom feed interface */ #define SEARCHRSSCMD "search_rss" /* name of RSS feed interface */ #define OPENSEARCHCMD "opensearch" /* name of OpenSearch Description */ #define BIGICONNAME "bigicon.png" /* name of the big icon */ #define CANVASNAME "canvas.png" /* name of the backgroud pattern */ #define DELIMSTR "{{!}}" /* delimiter string */ #define UIMIMETYPE "text/html; charset=UTF-8" /* media type of search_ui */ #define ATOMMIMETYPE "application/atom+xml" /* media type of search_atom */ #define RSSMIMETYPE "application/rdf+xml" /* media type of search_rss */ #define OSRCHMIMETYPE "application/opensearchdescription+xml" /* media type of opensearch */ #define DIRMIMETYPE "text/html" /* media type of directory index */ #define MENUMIMETYPE "text/html" /* media type of the menu page */ #define DEFMIMETYPE "application/octet-stream" /* media type by default */ typedef struct { /* type of structure for a communication */ int clsock; /* socket between client */ char claddr[ADDRBUFSIZ]; /* address of the client */ int clport; /* port number of the client */ } TARGCOMM; enum { /* enumeration for HTTP method */ HM_HEAD, /* HEAD */ HM_GET, /* GET */ HM_POST, /* POST */ HM_OPTIONS, /* OPTIONS */ HM_UNKNOWN /* unknown */ }; typedef struct { /* type of structure for a request */ const char *claddr; /* address of the client */ int clport; /* port number of the client */ char prefix[HOSTBUFSIZ]; /* prefix of the server */ int method; /* method */ char *target; /* target path */ char *name; /* user name */ char *passwd; /* password */ time_t ims; /* if-modified-since header */ int gzip; /* whether to accept gzip encoding */ int deflate; /* whether to accept deflate encoding */ char *ctype; /* content-type header */ char *referer; /* referer header */ char *estvia; /* x-estraier-via header */ char *body; /* entity body */ CBMAP *params; /* parameters */ time_t now; /* current time */ int reload; /* whether to be reloaded */ } REQUEST; typedef struct { /* type of structure for a local search */ REQUEST *req; /* request object */ int alive; /* whether to be alive */ ESTCOND *cond; /* search condition */ CBMAP *hints; /* hints about result */ int max; /* max number of retrieved documents */ NODE *node; /* self node object */ RESMAP *resmap; /* documents in result */ CBLIST *words; /* words in the search phrase */ int hnum; /* number of hits */ int mhnum; /* number of mishits */ double itime; /* index elapsed time */ double etime; /* total elapsed time */ } TARGLCSRCH; typedef struct { /* type of structure for a remote search */ REQUEST *req; /* request object */ int alive; /* whether to be alive */ const char *myurl; /* url of the local node */ ESTCOND *cond; /* search condition */ CBMAP *hints; /* hints about result */ int max; /* max number of retrieved documents */ NODE *node; /* self node object */ RESMAP *resmap; /* documents in result */ const char *url; /* URL of the link */ int credit; /* credit of the link */ char *label; /* label of the link */ int depth; /* depth of meta search */ int wwidth; /* while width of a snippet */ int hwidth; /* top width of a snippet */ int awidth; /* around width of a snippet */ int hnum; /* number of hits */ int dnum; /* number of documents */ int wnum; /* number of words */ double etime; /* elapsed time */ double size; /* size of the database */ time_t mtime; /* modification time */ } TARGRMSRCH; enum { /* enumeration for UI operations */ UI_VIEWMASTER, /* view master operations */ UI_SHUTDOWN, /* shutdown the master server */ UI_SYNCNODES, /* synchronize all nodes */ UI_BACKUPDB, /* backup the database */ UI_VIEWUSERS, /* view user operations */ UI_NEWUSER, /* create a user */ UI_DELUSER, /* delete a user */ UI_VIEWNODES, /* view node operations */ UI_NEWNODE, /* create a node */ UI_DELENODE, /* delete a node */ UI_EDITNODE, /* edit a node */ UI_STATNODE, /* view search history of a node */ UI_NONE /* none */ }; /* global variables */ const char *g_progname; /* program name */ int g_sigterm = FALSE; /* flag for termination signal */ int g_sigrestart = FALSE; /* flag for restarting signal */ int g_sigsync = FALSE; /* flag for synchronus signal */ int g_sigback = FALSE; /* flag for backup signal */ const char *g_rootdir = NULL; /* path of the root directory */ const char *g_bindaddr = NULL; /* binding address of TCP */ int g_portnum = 0; /* port number of TCP */ const char *g_publicurl = NULL; /* public URL */ int g_runmode = 0; /* runnning mode */ int g_authmode = 0; /* authorization mode */ int g_recvmax = 0; /* maximum length of data to receive */ int g_maxconn = 0; /* maximum number of connections */ int g_idleflush = 0; /* idle time to start flushing */ int g_idlesync = 0; /* idle time to start synchronizing */ int g_sessiontimeout = 0; /* timeout of a session, in seconds */ int g_searchtimeout = 0; /* timeout of search, in seconds */ int g_searchmax = 0; /* maximum number of documents to send */ int g_searchdepth = 0; /* depth of meta search */ int g_rateuri = FALSE; /* whether to rate URI for scoring */ int g_mergemethod = 0; /* merge method */ const char *g_proxyhost = NULL; /* host name of the proxy */ int g_proxyport = 0; /* port number of the proxy */ const char *g_logfile = NULL; /* path of the log file */ int g_loglevel = 0; /* logging level */ const char *g_backupcmd = NULL; /* path of the backup command */ int g_scalepred = 0; /* scale prediction */ int g_scoreexpr = 0; /* score expression */ CBLIST *g_attrindexes = NULL; /* expressions of attribute indexes */ const char *g_docroot = NULL; /* path of the document root directory */ const char *g_indexfile = NULL; /* name of the directory index file */ CBMAP *g_trustednodes = NULL; /* addresses of trusted nodes */ int g_denyuntrusted = FALSE; /* whether to deny untrusted nodes */ double g_cachesize = 0.0; /* maximum size of the index cache */ int g_cacheanum = 0; /* max of cached records for document attributes */ int g_cachetnum = 0; /* max of cached records for document texts */ int g_cachernum = 0; /* max of cached records for occurrence results */ const char *g_specialcache = NULL; /* name of the attribute of special cache */ double g_helpershift = 0.0; /* lower limit of cache usage size to use the helper */ int g_wildmax = -1; /* maximum number of extension of wild cards */ int g_limittextsize = 0; /* text size limitation */ int g_snipwwidth = 0; /* whole width of the snippet */ int g_sniphwidth = 0; /* width of beginning of the text */ int g_snipawidth = 0; /* width around each highlighted word */ int g_scancheck = FALSE; /* whether to check documents by scanning */ int g_smlrvnum = 0; /* number of keywords for similarity search */ int g_extdelay = 0; /* number of documents for delay of extraction */ const char *g_adminemail = NULL; /* e-mail address of the administrator */ CBLIST *g_uireplaces = NULL; /* expressions to replace the URI of each document */ CBLIST *g_uiextattrs = NULL; /* extra attributes to be shown */ int g_uiphraseform = 0; /* mode of phrase form */ const char *g_uismlrtune = NULL; /* tuning parameters for similarity search */ int g_bgmode = FALSE; /* whether to be foreground mode */ int g_romode = FALSE; /* whether to be read only mode */ int g_stmode = FALSE; /* whether to be single thread mode */ char g_hostname[HOSTBUFSIZ]; /* host name of the server */ DEPOT *g_metadb = NULL; /* meta database */ DEPOT *g_dfdb = NULL; /* document frequency database */ UMGR *g_umgr = NULL; /* user manager */ NMGR *g_nmgr = NULL; /* node manager */ RWLOCK *g_runlock = NULL; /* read-write lock for running threads */ RWLOCK *g_mgrlock = NULL; /* read-write lock for handling managers */ pthread_mutex_t g_backlock = PTHREAD_MUTEX_INITIALIZER; /* mutex for background tasks */ const char *g_bordstr = NULL; /* border string */ int g_svsock = -1; /* server socket */ int g_accesscount = 0; /* count of all access */ time_t g_startdate = 0; /* start date of the server */ double g_cacheratio = 0.0; /* worst usage ratio of the index cache */ /* function prototypes */ int main(int argc, char **argv); static int realmain(int argc, char **argv); static void setsignals(void); static void sigtermhandler(int num); static void usage(void); static int runinit(int argc, char **argv); static int runstart(int argc, char **argv); static int runstop(int argc, char **argv); static int rununittest(int argc, char **argv); static int runcrypt(int argc, char **argv); static void die(const char *format, ...); static void startup(void); static const char *skiplabel(const char *str); static void cleanup(void); static int procinit(const char *rootdir, int ex); static int procstart(const char *rootdir); static int procstop(const char *rootdir); static int procunittest(const char *rootdir); static int proccrypt(const char *key, const char *hash); static void dispatch(void); static void *refreshnode(void *targ); static void *flushnode(void *targ); static void *syncnodes(void *targ); static void backupdb(void); static void *communicate(void *targ); static void setparams(CBMAP *params, const char *src); static void addservinfo(CBDATUM *datum, time_t now, int ccage); static void senderror(int clsock, REQUEST *req, int code, const char *message); static void sendautherror(int clsock, REQUEST *req, const char *realm); static void sendnotmoderror(int clsock, REQUEST *req); static void sendheadonly(int clsock, REQUEST *req, const char *type); static int isbanned(USER *user); static int ismasteradmin(REQUEST *req, USER *user); static int isnodeadmin(NODE *node, REQUEST *req, USER *user); static int isnodeuser(NODE *node, REQUEST *req, USER *user); static int getnodeoptions(void); static void sendoptions(int clsock, REQUEST *req, USER *user); static void sendmasterdata(int clsock, REQUEST *req, USER *user); static void sendnodedata(int clsock, REQUEST *req, USER *user, const char *path); static void setdocorigin(ESTDOC *doc, REQUEST *req, NODE *node, int score); static void mergehints(CBMAP *total, CBMAP *local); static int islooproute(const char *url, REQUEST *req); static void *searchlocal(void *targ); static void *searchremote(void *targ); static void setsimilarphrase(ESTCOND *cond, const char *url, int id); static void catdocdata(CBDATUM *datum, NODE *node, RESDOC *resdoc, CBLIST *words, int wwidth, int hwidth, int awidth); static void catdocdataui(CBDATUM *datum, int num, RESDOC *resdoc, CBLIST *words, REQUEST *req, NODE *node, const char *condstr, const char *simcondstr); static void catdocdataatom(CBDATUM *datum, RESDOC *resdoc, CBLIST *words, NODE *node); static void catdocdatarss(CBDATUM *datum, RESDOC *resdoc, CBLIST *words, NODE *node); static char *makeshownuri(const char *uri); static void sendnodecmdinform(int clsock, REQUEST *req, NODE *node); static int sendnodecmdinformhelper(int clsock, REQUEST *req, NODE *node); static void sendnodecmdcacheusage(int clsock, REQUEST *req, NODE *node); static void sendnodecmdsearch(int clsock, REQUEST *req, NODE *node); static int sendnodecmdsearchhelper(int clsock, REQUEST *req, NODE *node, const char *myurl); static void sendnodecmdlist(int clsock, REQUEST *req, NODE *node); static void sendnodecmdgetdoc(int clsock, REQUEST *req, NODE *node); static int sendnodecmdgetdochelper(int clsock, REQUEST *req, NODE *node, int id, const char *uri); static void sendnodecmdgetdocattr(int clsock, REQUEST *req, NODE *node); static int sendnodecmdgetdocattrhelper(int clsock, REQUEST *req, NODE *node, int id, const char *uri, const char *attr); static void sendnodecmdetchdoc(int clsock, REQUEST *req, NODE *node); static int sendnodecmdetchdochelper(int clsock, REQUEST *req, NODE *node, int id, const char *uri); static void sendnodecmduritoid(int clsock, REQUEST *req, NODE *node); static int sendnodecmduritoidhelper(int clsock, REQUEST *req, NODE *node, const char *uri); static void sendnodecmdputdoc(int clsock, REQUEST *req, NODE *node); static void sendnodecmdoutdoc(int clsock, REQUEST *req, NODE *node); static void sendnodecmdeditdoc(int clsock, REQUEST *req, NODE *node); static void sendnodecmdsync(int clsock, REQUEST *req, NODE *node); static void sendnodecmdoptimize(int clsock, REQUEST *req, NODE *node); static void sendnodecmdsetuser(int clsock, REQUEST *req, NODE *node); static void sendnodecmdsetlink(int clsock, REQUEST *req, NODE *node); static void sendnodecmdsearchui(int clsock, REQUEST *req, NODE *node); static void sendnodecmdsearchatom(int clsock, REQUEST *req, NODE *node); static void sendnodecmdsearchrss(int clsock, REQUEST *req, NODE *node); static void sendnodecmdopensearch(int clsock, REQUEST *req, NODE *node); static void sendmasteruidata(int clsock, REQUEST *req, USER *user); static void sendfavicondata(int clsock, REQUEST *req); static void sendimagedata(int clsock, REQUEST *req, const char *name); static void sendfiledata(int clsock, REQUEST *req); static char *makelocalpath(const char *target); static void sendmenudata(int clsock, REQUEST *req); /* for windows service */ #if defined(MYWINSERV) SERVICE_STATUS_HANDLE g_svstat = 0; static void svmain(int argc, char **argv); static int sendstatus(int curstate, int exitcode, int svexitcode, int check, int hint); static void svfinish(int code); static void svhandle(int code); static void svmain(int argc, char **argv){ if(!(g_svstat = RegisterServiceCtrlHandler(SERVNAME, (LPHANDLER_FUNCTION)svhandle))){ svfinish(GetLastError()); return; } if(!sendstatus(SERVICE_START_PENDING, 0, 0, 1, 5000)){ svfinish(GetLastError()); return; } est_init_net_env(); startup(); if(!sendstatus(SERVICE_RUNNING, 0, 0, 0, 0)){ svfinish(GetLastError()); return; } dispatch(); cleanup(); svfinish(0); } static int sendstatus(int curstate, int exitcode, int svexitcode, int check, int hint){ SERVICE_STATUS st; st.dwServiceType = SERVICE_WIN32_OWN_PROCESS; st.dwCurrentState = curstate; if(curstate == SERVICE_START_PENDING){ st.dwControlsAccepted = 0; } else { st.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; } if(svexitcode == 0){ st.dwWin32ExitCode = exitcode; } else { st.dwWin32ExitCode = ERROR_SERVICE_SPECIFIC_ERROR; } st.dwServiceSpecificExitCode = svexitcode; st.dwCheckPoint = check; st.dwWaitHint = hint; if(!SetServiceStatus(g_svstat, &st)){ g_sigterm = TRUE; return FALSE; } return TRUE; } static void svfinish(int code){ if(g_svstat) sendstatus(SERVICE_STOPPED, code, 0, 0, 0); } static void svhandle(int code){ switch(code){ case SERVICE_CONTROL_STOP: case SERVICE_CONTROL_SHUTDOWN: sendstatus(SERVICE_STOP_PENDING, 0, 0, 1, 5000); g_sigterm = TRUE; break; case SERVICE_CONTROL_INTERROGATE: sendstatus(0, 0, 0, 0, 0); break; } } #endif /* main routine */ int main(int argc, char **argv){ #if defined(MYWINSERV) SERVICE_TABLE_ENTRY table[] = { { SERVNAME, (LPSERVICE_MAIN_FUNCTION)svmain }, { NULL, NULL } }; est_proc_env_reset(); g_progname = argv[0]; g_sigterm = FALSE; g_rootdir = argc >= 2 ? argv[1] : "casket"; if(!StartServiceCtrlDispatcher(table)) die("not called by service controll manager"); return 0; #else return realmain(argc, argv); #endif } /* real main routine */ static int realmain(int argc, char **argv){ const char *tmp; int rv; if((tmp = getenv("ESTDBGFD")) != NULL) dpdbgfd = atoi(tmp); est_proc_env_reset(); g_progname = argv[0]; g_sigterm = FALSE; if(argc < 2) usage(); rv = 0; if(!strcmp(argv[1], "init")){ rv = runinit(argc, argv); } else if(!strcmp(argv[1], "start")){ rv = runstart(argc, argv); } else if(!strcmp(argv[1], "stop")){ rv = runstop(argc, argv); } else if(!strcmp(argv[1], "unittest")){ rv = rununittest(argc, argv); } else if(!strcmp(argv[1], "crypt")){ rv = runcrypt(argc, argv); } else { usage(); } return rv; } /* set signal handlers */ static void setsignals(void){ est_signal(1, sigtermhandler); est_signal(2, sigtermhandler); est_signal(3, sigtermhandler); est_signal(13, SIG_IGN); est_signal(14, SIG_IGN); est_signal(15, sigtermhandler); g_sigterm = FALSE; g_sigrestart = FALSE; g_sigsync = FALSE; g_sigback = FALSE; } /* handler of termination signal */ static void sigtermhandler(int num){ g_sigterm = TRUE; if(num == 1 && g_bgmode) g_sigrestart = TRUE; } /* print the usage and exit */ static void usage(void){ fprintf(stderr, "%s: the master of node servers\n", g_progname); fprintf(stderr, "\n"); fprintf(stderr, "usage:\n"); fprintf(stderr, " %s init [-ex] rootdir\n", g_progname); fprintf(stderr, " %s start [-bg] [-ro] [-st] rootdir\n", g_progname); fprintf(stderr, " %s stop rootdir\n", g_progname); fprintf(stderr, " %s unittest rootdir\n", g_progname); fprintf(stderr, " %s crypt key [hash]\n", g_progname); fprintf(stderr, "\n"); exit(1); } /* parse arguments of the init command */ static int runinit(int argc, char **argv){ char *rootdir; int i, ex, rv; rootdir = NULL; ex = FALSE; for(i = 2; i < argc; i++){ if(!rootdir && argv[i][0] == '-'){ if(!strcmp(argv[i], "-ex")){ ex = TRUE; } else { usage(); } } else if(!rootdir){ rootdir = argv[i]; } else { usage(); } } if(!rootdir) usage(); rv = procinit(rootdir, ex); return rv; } /* parse arguments of the start command */ static int runstart(int argc, char **argv){ char *rootdir; int i, rv; rootdir = NULL; for(i = 2; i < argc; i++){ if(!rootdir && argv[i][0] == '-'){ if(!strcmp(argv[i], "-bg")){ g_bgmode = TRUE; } else if(!strcmp(argv[i], "-ro")){ g_romode = TRUE; } else if(!strcmp(argv[i], "-st")){ g_stmode = TRUE; } else { usage(); } } else if(!rootdir){ rootdir = argv[i]; } else { usage(); } } if(!rootdir) usage(); rv = procstart(rootdir); return rv; } /* parse arguments of the stop command */ static int runstop(int argc, char **argv){ char *rootdir; int i, rv; rootdir = NULL; for(i = 2; i < argc; i++){ if(!rootdir && argv[i][0] == '-'){ usage(); } else if(!rootdir){ rootdir = argv[i]; } else { usage(); } } if(!rootdir) usage(); rv = procstop(rootdir); return rv; } /* parse arguments of the unittest command */ static int rununittest(int argc, char **argv){ char *rootdir; int i, rv; rootdir = NULL; for(i = 2; i < argc; i++){ if(!rootdir && argv[i][0] == '-'){ usage(); } else if(!rootdir){ rootdir = argv[i]; } else { usage(); } } if(!rootdir) usage(); rv = procunittest(rootdir); return rv; } /* parse arguments of the crypt command */ static int runcrypt(int argc, char **argv){ char *key, *hash; int i, rv; key = NULL; hash = NULL; for(i = 2; i < argc; i++){ if(!key && argv[i][0] == '-'){ usage(); } else if(!key){ key = argv[i]; } else if(!hash){ hash = argv[i]; } else { usage(); } } if(!key) usage(); rv = proccrypt(key, hash); return rv; } /* print formatted error string and exit */ static void die(const char *format, ...){ va_list ap; char msgbuf[URIBUFSIZ]; va_start(ap, format); vsprintf(msgbuf, format, ap); if(log_open(g_rootdir, g_logfile ? g_logfile : LOGFILE, LL_INFO, FALSE)){ log_print(LL_ERROR, "startup failed: %s", msgbuf); } else { fprintf(stderr, "%s: %s\n", g_progname, msgbuf); fflush(stderr); } va_end(ap); exit(1); } /* initialize the global variables */ static void startup(void){ NODE *node; ESTMTDB *db; CBLIST *lines, *elems; struct stat sbuf; const char *rp, *name; char path[URIBUFSIZ], numbuf[NUMBUFSIZ]; int i, ecode, pid, omode; if(stat(g_rootdir, &sbuf) == -1) die("the server root directory (%s) could not open", g_rootdir); sprintf(path, "%s%c%s", g_rootdir, ESTPATHCHR, CONFFILE); if(!(lines = cbreadlines(path))) die("the configuration file (%s) could not open", path); cbglobalgc(lines, (void (*)(void *))cblistclose); g_attrindexes = cblistopen(); cbglobalgc(g_attrindexes, (void (*)(void *))cblistclose); g_trustednodes = cbmapopenex(MINIBNUM); cbglobalgc(g_trustednodes, (void (*)(void *))cbmapclose); g_uireplaces = cblistopen(); cbglobalgc(g_uireplaces, (void (*)(void *))cblistclose); g_uiextattrs = cblistopen(); cbglobalgc(g_uiextattrs, (void (*)(void *))cblistclose); for(i = 0; i < cblistnum(lines); i++){ rp = cblistval(lines, i, NULL); if(cbstrfwimatch(rp, "bindaddr:")){ g_bindaddr = skiplabel(rp); } else if(cbstrfwimatch(rp, "portnum:")){ g_portnum = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "publicurl:")){ g_publicurl = skiplabel(rp); } else if(cbstrfwimatch(rp, "runmode:")){ g_runmode = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "authmode:")){ g_authmode = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "recvmax:")){ g_recvmax = atoi(skiplabel(rp)) * 1024; } else if(cbstrfwimatch(rp, "maxconn:")){ g_maxconn = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "idleflush:")){ g_idleflush = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "idlesync:")){ g_idlesync = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "sessiontimeout:")){ g_sessiontimeout = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "searchtimeout:")){ g_searchtimeout = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "searchmax:")){ g_searchmax = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "searchdepth:")){ g_searchdepth = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "rateuri:")){ g_rateuri = atoi(skiplabel(rp)) > 0; } else if(cbstrfwimatch(rp, "mergemethod:")){ g_mergemethod = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "proxyhost:")){ g_proxyhost = skiplabel(rp); } else if(cbstrfwimatch(rp, "proxyport:")){ g_proxyport = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "logfile:")){ g_logfile = skiplabel(rp); } else if(cbstrfwimatch(rp, "loglevel:")){ g_loglevel = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "backupcmd:")){ g_backupcmd = skiplabel(rp); } else if(cbstrfwimatch(rp, "scalepred:")){ g_scalepred = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "scoreexpr:")){ g_scoreexpr = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "attrindex:")){ cblistpush(g_attrindexes, skiplabel(rp), -1); } else if(cbstrfwimatch(rp, "docroot:")){ g_docroot = skiplabel(rp); } else if(cbstrfwimatch(rp, "indexfile:")){ g_indexfile = skiplabel(rp); } else if(cbstrfwimatch(rp, "trustednode:")){ cbmapput(g_trustednodes, skiplabel(rp), -1, "", 0, TRUE); } else if(cbstrfwimatch(rp, "denyuntrusted:")){ g_denyuntrusted = atoi(skiplabel(rp)) > 0; } else if(cbstrfwimatch(rp, "cachesize:")){ g_cachesize = strtod(skiplabel(rp), NULL) * 1024 * 1024; } else if(cbstrfwimatch(rp, "cacheanum:")){ g_cacheanum = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "cachetnum:")){ g_cachetnum = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "cachernum:")){ g_cachernum = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "specialcache:")){ g_specialcache = skiplabel(rp); } else if(cbstrfwimatch(rp, "helpershift:")){ g_helpershift = strtod(skiplabel(rp), NULL); } else if(cbstrfwimatch(rp, "wildmax:")){ g_wildmax = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "limittextsize:")){ g_limittextsize = atoi(skiplabel(rp)) * 1024; } else if(cbstrfwimatch(rp, "snipwwidth:")){ g_snipwwidth = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "sniphwidth:")){ g_sniphwidth = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "snipawidth:")){ g_snipawidth = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "scancheck:")){ g_scancheck = atoi(skiplabel(rp)) > 0; } else if(cbstrfwimatch(rp, "smlrvnum:")){ g_smlrvnum = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "extdelay:")){ g_extdelay = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "adminemail:")){ g_adminemail = skiplabel(rp); } else if(cbstrfwimatch(rp, "uireplace:")){ cblistpush(g_uireplaces, skiplabel(rp), -1); } else if(cbstrfwimatch(rp, "uiextattr:")){ cblistpush(g_uiextattrs, skiplabel(rp), -1); } else if(cbstrfwimatch(rp, "uiphraseform:")){ g_uiphraseform = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "uismlrtune:")){ g_uismlrtune = skiplabel(rp); } } if(!g_bindaddr) die("bindaddr is undefined"); if(g_portnum < 1) die("portnum is undefined"); if(!g_publicurl) die("publicurl is undefined"); if(g_runmode < RM_NORMAL || g_runmode > RM_RDONLY) die("runmode is undefined"); if(g_authmode < AM_NONE || g_authmode > AM_ALL) die("authmode is undefined"); if(g_recvmax < 1) die("recvmax is undefined"); if(g_maxconn < 1) die("maxconn is undefined"); if(g_idleflush < 1) die("idleflush is undefined"); if(g_idlesync < 1) die("idlesync is undefined"); if(g_sessiontimeout < 1) die("sessiontimeout is undefined"); if(g_searchtimeout < 1) die("searchtimeout is undefined"); if(g_searchmax < 1) die("searchmax is undefined"); if(g_searchdepth < 0) die("searchdepth is undefined"); if(g_mergemethod < MM_SCORE || g_mergemethod > MM_RANK) die("mergemethod is undefined"); if(!g_proxyhost) die("proxyhost is undefined"); if(g_proxyhost[0] != '\0' && g_proxyport < 1) die("proxyport is undefined"); if(!g_logfile) die("logfile is undefined"); if(g_loglevel < LL_DEBUG || g_loglevel > LL_NONE) die("loglevel is undefined"); if(!g_docroot) die("docroot is undefined"); if(!g_indexfile) die("indexfile is undefined"); if(!g_backupcmd) die("backupcmd is undefined"); if(g_scalepred < SP_SMALL || g_scalepred > SP_HUGE) die("scalepred is undefined"); if(g_scoreexpr < SE_VOID || g_scoreexpr > SE_ASIS) die("scoreexpr is undefined"); if(g_cachesize < 0.0) die("cachesize is undefined"); if(g_cacheanum < 0) die("cacheanum is undefined"); if(g_cachetnum < 0) die("cachetnum is undefined"); if(g_cachernum < 0) die("cachernum is undefined"); if(!g_specialcache) die("indexfile is undefined"); if(g_helpershift < 0) die("helpershift is undefined"); if(g_wildmax < 0) die("wildmax is undefined"); if(g_limittextsize < 1) die("limittextsize is undefined"); if(g_snipwwidth < 0) die("snipwwidth is undefined"); if(g_sniphwidth < 0) die("sniphwidth is undefined"); if(g_snipawidth < 0) die("snipawidth is undefined"); if(g_smlrvnum < 0) die("smlrvnum is undefined"); if(!g_adminemail) die("adminemail is undefined"); if(g_uiphraseform < 1) die("uiphraseform is undefined"); if(!g_uismlrtune) die("uismlrtune is undefined"); if(g_romode) g_runmode = RM_RDONLY; if((pid = lockerpid(g_rootdir)) > 0) die("another process (pid:%d) has opened the database", pid); if(!log_open(g_rootdir, g_logfile, LL_CHECK, FALSE)) die("the log file (%s) could not open", g_logfile); sprintf(path, "%s%c%s", g_rootdir, ESTPATHCHR, METAFILE); if(!(g_metadb = dpopen(path, DP_OREADER, -1))){ if(dpecode == DP_ELOCK){ die("other process (pid:%d) has opened the database", lockerpid(g_rootdir)); } else { die("the meta database file (%s) could not open", path); } } sprintf(path, "%s%c%s", g_rootdir, ESTPATHCHR, NODEDIR); if(!(elems = cbdirlist(path))){ dpclose(g_metadb); die("the node directory (%s) could not open", path); } for(i = 0; i < cblistnum(elems); i++){ name = cblistval(elems, i, NULL); if(!strcmp(name, ESTCDIRSTR) || !strcmp(name, ESTPDIRSTR)) continue; sprintf(path, "%s%c%s%c%s", g_rootdir, ESTPATHCHR, NODEDIR, ESTPATHCHR, name); if((db = est_mtdb_open(path, ESTDBREADER, &ecode)) != NULL){ if(!est_mtdb_close(db, &ecode)){ cblistclose(elems); dpclose(g_metadb); die("the database (%s) could not close", path); } } else { cblistclose(elems); dpclose(g_metadb); die("the database (%s) could not open", path); } } cblistclose(elems); dpclose(g_metadb); if(g_bgmode && !be_daemon(g_rootdir)) die("the process could not be a daemon"); sprintf(g_hostname, "%s", est_get_host_name()); sprintf(path, "%s%c%s", g_rootdir, ESTPATHCHR, METAFILE); omode = (g_runmode == RM_RDONLY ? DP_OREADER : DP_OWRITER) | DP_OLCKNB; if(!(g_metadb = dpopen(path, omode, -1))){ if(dpecode == DP_ELOCK){ die("other process (pid:%d) has opened the database", lockerpid(g_rootdir)); } else { die("the meta database file (%s) could not open", path); } } pid = (int)getpid(); sprintf(path, "%s%c%s", g_rootdir, ESTPATHCHR, PIDFILE); sprintf(numbuf, "%d\n", pid); cbwritefile(path, numbuf, -1); if(!log_open(g_rootdir, g_logfile, g_loglevel, FALSE)){ unlink(path); dpclose(g_metadb); die("starting logging failed"); } log_print(LL_INFO, "starting the master process (pid:%d)", pid); g_umgr = umgr_new(g_rootdir); g_nmgr = nmgr_new(g_rootdir); if(!umgr_load(g_umgr) || !nmgr_load(g_nmgr, g_runmode != RM_RDONLY)){ unlink(path); nmgr_delete(g_nmgr); umgr_delete(g_umgr); dpclose(g_metadb); log_print(LL_ERROR, "loading users and nodes failed"); die("loading users and nodes failed"); } for(i = 0; i < cblistnum(g_attrindexes); i++){ name = cblistval(g_attrindexes, i, NULL); if(!(rp = strstr(name, "{{!}}"))) continue; memcpy(path, name, rp - name); path[rp-name] = '\0'; nmgr_add_aidx(g_nmgr, path, rp + 5); } g_runlock = rwlock_new(); g_mgrlock = rwlock_new(); if((g_svsock = est_get_server_sock(g_bindaddr, g_portnum)) == -1){ unlink(path); rwlock_delete(g_mgrlock); rwlock_delete(g_runlock); nmgr_delete(g_nmgr); umgr_delete(g_umgr); dpclose(g_metadb); log_print(LL_ERROR, "initializing network failed"); die("initializing network failed"); } g_accesscount = 0; g_startdate = time(NULL); if(g_docroot[0] != '\0'){ if(stat(g_docroot, &sbuf) == 0){ log_print(LL_INFO, "letting the directory (%s) be public", g_docroot); } else { log_print(LL_WARN, "missing the directory (%s)", g_docroot); } } sprintf(path, "%s%c%s", g_rootdir, ESTPATHCHR, DFDBFILE); g_dfdb = dpopen(path, DP_OREADER, -1); g_bordstr = est_border_str(); elems = nmgr_names(g_nmgr); for(i = 0; i < cblistnum(elems); i++){ if(!(name = cblistval(elems, i, NULL)) || !(node = nmgr_get(g_nmgr, name))) continue; est_mtdb_set_cache_size(node->db, g_cachesize, g_cacheanum, g_cachetnum, g_cachernum); if(g_specialcache[0] != '\0') est_mtdb_set_special_cache(node->db, g_specialcache, SPCACHEMNUM); est_mtdb_set_wildmax(node->db, g_wildmax); if(g_dfdb) est_mtdb_set_dfdb(node->db, g_dfdb); } cblistclose(elems); } /* skip the label of a line */ static const char *skiplabel(const char *str){ if(!(str = strchr(str, ':'))) return ""; str++; while(*str != '\0' && (*str == ' ' || *str == '\t')){ str++; } return str; } /* clean up resources */ static void cleanup(void){ char path[URIBUFSIZ]; if(g_svsock != -1) est_sock_down(g_svsock); rwlock_delete(g_mgrlock); rwlock_delete(g_runlock); nmgr_delete(g_nmgr); umgr_delete(g_umgr); sprintf(path, "%s%c%s", g_rootdir, ESTPATHCHR, STOPFILE); unlink(path); sprintf(path, "%s%c%s", g_rootdir, ESTPATHCHR, PIDFILE); unlink(path); dpclose(g_metadb); if(g_dfdb) dpclose(g_dfdb); log_print(LL_INFO, "the master process finished"); } /* perform the init command */ static int procinit(const char *rootdir, int ex){ UMGR *umgr; NMGR *nmgr; NODE *node; ESTDOC *doc; char *tmp; int err; setsignals(); if(!master_init(rootdir)){ log_print(LL_ERROR, "initializing the root directory failed"); return 1; } log_open(rootdir, LOGFILE, LL_INFO, FALSE); log_print(LL_INFO, "the root directory created"); umgr = umgr_new(rootdir); tmp = est_make_crypt("admin"); umgr_put(umgr, "admin", tmp, "s", "Carolus Magnus", "Administrator"); free(tmp); if(ex){ tmp = est_make_crypt("john"); umgr_put(umgr, "john", tmp, "", "John Doe", "Normal User"); free(tmp); tmp = est_make_crypt("dick"); umgr_put(umgr, "dick", tmp, "", "Richard Roe", "Normal User"); free(tmp); tmp = est_make_crypt("lupin"); umgr_put(umgr, "lupin", tmp, "b", "Arsene Lupin", "Banned User"); free(tmp); } err = FALSE; if(!umgr_delete(umgr)) err = TRUE; nmgr = nmgr_new(rootdir); if(ex){ nmgr_put(nmgr, "sample1", TRUE, 0); if((node = nmgr_get(nmgr, "sample1")) != NULL){ free(node->label); node->label = cbmemdup("Sample Node One", -1); cbmapput(node->admins, "john", -1, "", 0, TRUE); cbmapput(node->users, "john", -1, "", 0, TRUE); cbmapput(node->users, "dick", -1, "", 0, TRUE); cbmapput(node->users, "lupin", -1, "", 0, TRUE); node_set_link(node, "http://localhost:1978/node/sample2", "Sample-Node-Two", 4000); doc = est_doc_new(); est_doc_add_attr(doc, ESTDATTRURI, "http://localhost/foo.html"); est_doc_add_text(doc, "You may my glories and my state dispose,"); est_doc_add_text(doc, "But not my griefs; still am I king of those."); est_doc_add_text(doc, "(Give it up, Yo! Give it up, Yo!)"); est_mtdb_put_doc(node->db, doc, 0); est_doc_delete(doc); doc = est_doc_new(); est_doc_add_attr(doc, ESTDATTRURI, "http://localhost/bar.html"); est_doc_add_text(doc, "The faster I go, the behinder I get."); est_doc_add_text(doc, "(Give it up, Yo! Give it up, Yo!)"); est_mtdb_put_doc(node->db, doc, 0); est_doc_delete(doc); } else { err = TRUE; } nmgr_put(nmgr, "sample2", TRUE, 0); if((node = nmgr_get(nmgr, "sample2")) != NULL){ free(node->label); node->label = cbmemdup("Sample Node Two", -1); cbmapput(node->users, "john", -1, "", 0, TRUE); node_set_link(node, "http://localhost:1978/node/sample1", "Sample-Node-One", 8000); doc = est_doc_new(); est_doc_add_attr(doc, ESTDATTRURI, "http://localhost/foo.html"); est_doc_add_text(doc, "He that is giddy thinks the world turns round."); est_doc_add_text(doc, "(Give it up, Yo! Give it up, Yo!)"); est_mtdb_put_doc(node->db, doc, 0); est_doc_delete(doc); } else { err = TRUE; } } if(!nmgr_delete(nmgr)) err = TRUE; return err ? 1 : 0; } /* perform the start command */ static int procstart(const char *rootdir){ char *path; path = est_realpath(rootdir); cbglobalgc(path, free); g_rootdir = path; if(!est_init_net_env()) die("could not initialize network environment"); atexit(est_free_net_env); do { setsignals(); startup(); dispatch(); cleanup(); } while(g_sigrestart); return 0; } /* perform the stop command */ static int procstop(const char *rootdir){ struct stat sbuf; char path[URIBUFSIZ], *buf; int pid; sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, PIDFILE); if(!(buf = cbreadfile(path, NULL))) die("not running"); pid = atoi(buf); free(buf); if(pid < 1) die("not running"); if(est_kill(pid, 15)){ do { est_usleep(1000 * 500); if(!est_kill(pid, 13) && errno == ESRCH) break; } while(TRUE); } else { sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, STOPFILE); if(!cbwritefile(path, "OH, MY GOODNESS!\n", -1)) die("killing failed"); do { est_usleep(1000 * 500); if(stat(path, &sbuf) == -1 && errno == ENOENT) break; } while(TRUE); } return 0; } /* perform the unittest command */ static int procunittest(const char *rootdir){ UMGR *umgr; USER *user; NMGR *nmgr; NODE *node; RWLOCK *rwlock; RESMAP *resmap; RESDOC **resdocs; ESTNODERES *nres; ESTRESDOC *rdoc; ESTDOC *doc; CBLIST *list; CBMAP *attrs; const char *name, *path; char *str; int i, err, rnum; setsignals(); if(procinit(rootdir, TRUE) != 0) return 1; log_open(rootdir, LOGFILE, LL_DEBUG, FALSE); err = FALSE; umgr = umgr_new(rootdir); umgr_load(umgr); umgr_put(umgr, "mikio", "x", "", "Mikio Hirabayashi", "Test"); umgr_put(umgr, "mikio", "x", "", "Mikio Hirabayashi", "Test"); list = umgr_names(umgr); for(i = 0; i < cblistnum(list); i++){ name = cblistval(list, i, NULL); if(!(user = umgr_get(umgr, name))){ err = TRUE; continue; } if(i % 2 == 0) user_make_sess(user); if(i % 3 == 0){ user_set_sess_val(user, "oda", "nobunaga"); user_set_sess_val(user, "hashiba", "hideyoshi"); user_set_sess_val(user, "ieyasu", "tokugawa"); user_set_sess_val(user, "oda", NULL); free(user_sess_val(user, "oda")); free(user_sess_val(user, "hashiba")); user_clear_sess(user); free(user_sess_val(user, "ieyasu")); } } cblistclose(list); umgr_out(umgr, "mikio"); umgr_out(umgr, "hoge"); if(!umgr_delete(umgr)) err = TRUE; nmgr = nmgr_new(rootdir); nmgr_load(nmgr, TRUE); nmgr_put(nmgr, "eagle", TRUE, 0); nmgr_put(nmgr, "shark", TRUE, 0); nmgr_put(nmgr, "panther", TRUE, 0); nmgr_put(nmgr, "i n v a l i d", TRUE, 0); list = nmgr_names(nmgr); for(i = 0; i < cblistnum(list); i++){ path = cblistval(list, i, NULL); if(!(node = nmgr_get(nmgr, path))){ err = TRUE; continue; } doc = est_doc_new(); est_doc_add_attr(doc, ESTDATTRURI, "file:///home/mikio/sample1.html"); est_doc_add_text(doc, "Happy Hacking!"); if(!est_mtdb_put_doc(node->db, doc, 0)) err = TRUE; est_doc_delete(doc); doc = est_doc_new(); est_doc_add_attr(doc, ESTDATTRURI, "file:///home/mikio/sample2.txt"); est_doc_add_text(doc, "The savior becomes the victim."); if(!est_mtdb_put_doc(node->db, doc, 0)) err = TRUE; est_doc_delete(doc); node_set_link(node, "http://hoge.com/node/hoge1", "a", 100); node_set_link(node, "http://hoge.com/node/hoge2", "b", 200); node_set_link(node, "http://hoge.com/node/hoge2", "c", 300); } cblistclose(list); nmgr_out(nmgr, "eagle"); nmgr_out(nmgr, "hoge"); nmgr_delete(nmgr); rwlock = rwlock_new(); if(!rwlock_lock(rwlock, TRUE)) err = TRUE; if(!rwlock_unlock(rwlock)) err = TRUE; if(!rwlock_lock(rwlock, FALSE)) err = TRUE; if(!rwlock_unlock(rwlock)) err = TRUE; rwlock_delete(rwlock); resmap = resmap_new(); doc = est_doc_new(); est_doc_add_attr(doc, ESTDATTRURI, "http://tako.ika/one.html"); est_doc_add_text(doc, "This is a pen."); resmap_put(resmap, 100, doc, NULL, NULL); doc = est_doc_new(); est_doc_add_attr(doc, ESTDATTRURI, "http://tako.ika/two.html"); est_doc_add_text(doc, "Love is stranger."); resmap_put(resmap, 200, doc, NULL, NULL); doc = est_doc_new(); est_doc_add_attr(doc, ESTDATTRURI, "http://tako.ika/001.html"); resmap_put(resmap, 1, doc, NULL, cbmemdup("one", -1)); doc = est_doc_new(); est_doc_add_attr(doc, ESTDATTRURI, "http://tako.ika/006.html"); resmap_put(resmap, 6, doc, NULL, cbmemdup("six", -1)); doc = est_doc_new(); est_doc_add_attr(doc, ESTDATTRURI, "http://tako.ika/003.html"); resmap_put(resmap, 3, doc, NULL, cbmemdup("three", -1)); doc = est_doc_new(); est_doc_add_attr(doc, ESTDATTRURI, "http://tako.ika/004.html"); resmap_put(resmap, 4, doc, NULL, cbmemdup("four", -1)); doc = est_doc_new(); est_doc_add_attr(doc, ESTDATTRURI, "http://tako.ika/002.html"); resmap_put(resmap, 2, doc, NULL, cbmemdup("two", -1)); doc = est_doc_new(); est_doc_add_attr(doc, ESTDATTRURI, "http://tako.ika/005.html"); resmap_put(resmap, 1, doc, NULL, cbmemdup("five", -1)); resdocs = resmap_list(resmap, &rnum, NULL, NULL); for(i = 0; i < rnum; i++){ log_print(LL_DEBUG, "result: uri=%s score=%d body=%s", est_doc_attr(resdocs[i]->doc, ESTDATTRURI), resdocs[i]->score, resdocs[i]->body ? resdocs[i]->body : "(null)"); } free(resdocs); resmap_delete(resmap); nres = est_noderes_new(); for(i = 0; i < 128; i++){ attrs = cbmapopenex(MINIBNUM); str = cbsprintf("http://big/bigger/biggest/%d", i + 1); if(i % 10 != 0) cbmapput(attrs, ESTDATTRURI, -1, str, -1, FALSE); free(str); str = cbsprintf("This is %d\n", i + 1); est_noderes_add_doc(nres, attrs, str); } for(i = 0; i < 100 && est_noderes_shift_doc(nres, &attrs, &str); i++){ free(str); cbmapclose(attrs); } for(i = 0; i < est_noderes_doc_num(nres); i++){ rdoc = est_noderes_get_doc(nres, i); log_print(LL_DEBUG, "%s", est_resdoc_uri(rdoc)); } for(i = 0; i < 2048; i++){ attrs = cbmapopenex(MINIBNUM); str = cbsprintf("http://big/bigger/biggest/%d", i + 1); if(i % 10 != 0) cbmapput(attrs, ESTDATTRURI, -1, str, -1, FALSE); free(str); str = cbsprintf("This is %d\n", i + 1); est_noderes_add_doc(nres, attrs, str); } est_noderes_delete(nres); if(!err) log_print(LL_INFO, "finished successfully"); return err ? 1 : 0; } /* perform the crypt command */ static int proccrypt(const char *key, const char *hash){ char *tmp; if(hash){ if(!est_match_crypt(key, hash)){ fprintf(stderr, "%s and %s do not match", key, hash); return 1; } } else { tmp = est_make_crypt(key); printf("%s\n", tmp); free(tmp); } return 0; } /* listen the socket and dispatch processes */ static void dispatch(void){ pthread_t th; fd_set rfds; struct timeval tv; struct stat sbuf; char *stfile, claddr[ADDRBUFSIZ]; int clsock, clport, isec, cnum; time_t start; TARGCOMM *targ; log_print(LL_INFO, "waiting for requests"); stfile = cbsprintf("%s%c%s", g_rootdir, ESTPATHCHR, STOPFILE); isec = 0; start = -1; while(TRUE){ FD_ZERO(&rfds); FD_SET(g_svsock, &rfds); tv.tv_sec = 1; tv.tv_usec = 0; errno = 0; if(select(g_svsock + 1, &rfds, NULL, NULL, &tv) > 0 && FD_ISSET(g_svsock, &rfds)){ clsock = est_accept_conn(g_svsock, claddr, &clport); switch(clsock){ case -1: log_print(LL_ERROR, "accepting connection failed"); break; case 0: log_print(LL_WARN, "accepting connection interrupted by a signal"); break; default: if(rwlock_rnum(g_runlock) > g_maxconn + FCLOSECONNNUM){ log_print(LL_WARN, "doing forced shutdown due to jam-up"); est_sock_down(clsock); } else { g_accesscount++; targ = cbmalloc(sizeof(TARGCOMM)); targ->clsock = clsock; sprintf(targ->claddr, "%s", claddr); targ->clport = clport; if(g_stmode){ communicate(targ); } else { if(pthread_create(&th, NULL, communicate, targ) == 0){ if(pthread_detach(th) != 0) log_print(LL_ERROR, "detachting thread failed"); } else { log_print(LL_WARN, "creating thread failed"); est_sock_down(clsock); free(targ); } } } break; } isec = 0; } else { if(errno != EINTR) isec++; if(stat(stfile, &sbuf) == 0){ log_print(LL_INFO, "the stop file detected"); g_sigterm = TRUE; } } if(g_sigterm){ if(rwlock_rnum(g_runlock) < 1){ break; } else if(start == -1){ start = time(NULL); } else if(time(NULL) - start > 1){ break; } } if(isec >= IREFRESHSEC && g_runmode != RM_RDONLY){ if(g_stmode){ refreshnode(NULL); } else { if(pthread_create(&th, NULL, refreshnode, NULL) == 0){ if(pthread_detach(th) != 0) log_print(LL_ERROR, "detachting thread failed"); } else { log_print(LL_WARN, "creating thread failed"); } } est_usleep(1000 * 100); } if(isec >= g_idleflush * (1.0 - g_cacheratio) && (g_cacheratio > 0.0 || isec % (g_idleflush / 2 + 1) == 0)){ if(g_stmode){ flushnode(NULL); } else { if(pthread_create(&th, NULL, flushnode, NULL) == 0){ if(pthread_detach(th) != 0) log_print(LL_ERROR, "detachting thread failed"); } else { log_print(LL_WARN, "creating thread failed"); } } est_usleep(1000 * 100); } if(g_sigsync || g_sigback || isec >= g_idlesync){ if(g_cacheratio > 0.0){ if(g_stmode){ flushnode(NULL); } else { if(pthread_create(&th, NULL, flushnode, NULL) == 0){ if(pthread_detach(th) != 0) log_print(LL_ERROR, "detachting thread failed"); } else { log_print(LL_WARN, "creating thread failed"); } } } else { if(g_stmode){ syncnodes(NULL); } else { if(pthread_create(&th, NULL, syncnodes, NULL) == 0){ if(pthread_detach(th) != 0) log_print(LL_ERROR, "detachting thread failed"); } else { log_print(LL_WARN, "creating thread failed"); } } g_sigsync = FALSE; isec = 0; if(g_sigback){ backupdb(); g_sigback = FALSE; } } est_usleep(1000 * 100); } } free(stfile); log_print(LL_INFO, "shutting down"); start = time(NULL); while((cnum = rwlock_rnum(g_runlock)) > 0){ log_print(LL_INFO, "waiting for children: %d", cnum); est_usleep(1000 * 1000); if(time(NULL) - start > FCLOSEWAITMAX && g_svsock != -1){ est_sock_down(g_svsock); g_svsock = -1; log_print(LL_WARN, "doing forced shutdown of the server socket"); } if(time(NULL) - start > FTERMWAITMAX){ log_print(LL_WARN, "doing forced termination of the server process"); break; } } est_usleep(1000 * 100); } /* refresh or charge result cache of one of nodes */ static void *refreshnode(void *targ){ static int cnt = 0; CBLIST *list; NODE *node; if(pthread_mutex_trylock(&g_backlock) != 0) return NULL; if(!rwlock_lock(g_runlock, FALSE)){ log_print(LL_ERROR, "locking failed"); pthread_mutex_unlock(&g_backlock); return NULL; } if(!rwlock_lock(g_mgrlock, FALSE)){ rwlock_unlock(g_runlock); pthread_mutex_unlock(&g_backlock); log_print(LL_ERROR, "locking failed"); return NULL; } list = nmgr_names(g_nmgr); if(cblistnum(list) > 0){ if((node = nmgr_get(g_nmgr, cblistval(list, cnt++ % cblistnum(list), NULL))) != NULL){ if(node->dirty){ log_print(LL_INFO, "refreshing a node: %s", node->name); est_mtdb_refresh_rescc(node->db); node->dirty = FALSE; } else { est_mtdb_charge_rescc(node->db, ICHARGENUM); } } } cblistclose(list); if(!rwlock_unlock(g_mgrlock)) log_print(LL_ERROR, "unlocking failed"); if(!rwlock_unlock(g_runlock)) log_print(LL_ERROR, "unlocking failed"); if(pthread_mutex_unlock(&g_backlock) != 0) log_print(LL_ERROR, "unlocking failed"); return NULL; } /* flush one of nodes */ static void *flushnode(void *targ){ static int cnt = 0; CBLIST *list; NODE *node; int size; double msiz; if(g_runmode == RM_RDONLY) return NULL; if(pthread_mutex_trylock(&g_backlock) != 0) return NULL; if(!rwlock_lock(g_runlock, FALSE)){ log_print(LL_ERROR, "locking failed"); pthread_mutex_unlock(&g_backlock); return NULL; } if(!rwlock_lock(g_mgrlock, FALSE)){ rwlock_unlock(g_runlock); pthread_mutex_unlock(&g_backlock); log_print(LL_ERROR, "locking failed"); return NULL; } list = nmgr_names(g_nmgr); msiz = 0.0; if(cblistnum(list) > 0){ if((node = nmgr_get(g_nmgr, cblistval(list, cnt++ % cblistnum(list), NULL))) != NULL){ if(!est_mtdb_flush(node->db, est_mtdb_cache_num(node->db) > 0 ? IFLUSHNUM : -1)) log_print(LL_ERROR, "flushing failed"); if((size = est_mtdb_used_cache_size(node->db)) > msiz) msiz = size; } } g_cacheratio = msiz / g_cachesize; cblistclose(list); if(!rwlock_unlock(g_mgrlock)) log_print(LL_ERROR, "unlocking failed"); if(!rwlock_unlock(g_runlock)) log_print(LL_ERROR, "unlocking failed"); if(pthread_mutex_unlock(&g_backlock) != 0) log_print(LL_ERROR, "unlocking failed"); return NULL; } /* synchronize all nodes */ static void *syncnodes(void *targ){ if(g_runmode == RM_RDONLY) return NULL; if(pthread_mutex_lock(&g_backlock) != 0) return NULL; if(!rwlock_lock(g_runlock, FALSE)){ log_print(LL_ERROR, "locking failed"); pthread_mutex_unlock(&g_backlock); return NULL; } if(!rwlock_lock(g_mgrlock, TRUE)){ rwlock_unlock(g_runlock); pthread_mutex_unlock(&g_backlock); log_print(LL_ERROR, "locking failed"); return NULL; } umgr_sync(g_umgr); nmgr_sync(g_nmgr, TRUE); if(!dpsync(g_metadb)) log_print(LL_ERROR, "synchronizing the meda database failed"); if(!rwlock_unlock(g_mgrlock)) log_print(LL_ERROR, "unlocking failed"); if(!rwlock_unlock(g_runlock)) log_print(LL_ERROR, "unlocking failed"); if(pthread_mutex_unlock(&g_backlock) != 0) log_print(LL_ERROR, "unlocking failed"); return NULL; } /* backup the database */ static void backupdb(void){ char cmd[URIBUFSIZ], *tmp; if(g_backupcmd[0] == '\0') return; syncnodes(NULL); if(!rwlock_lock(g_runlock, FALSE)){ log_print(LL_ERROR, "locking failed"); return; } if(!rwlock_lock(g_mgrlock, TRUE)){ rwlock_unlock(g_runlock); log_print(LL_ERROR, "locking failed"); return; } log_print(LL_INFO, "running the backup command"); tmp = est_realpath(g_indexfile); sprintf(cmd, "%s \"%s\"", g_backupcmd, g_rootdir); free(tmp); system(cmd); if(!rwlock_unlock(g_mgrlock)) log_print(LL_ERROR, "unlocking failed"); if(!rwlock_unlock(g_runlock)) log_print(LL_ERROR, "unlocking failed"); } /* communicate with a client */ static void *communicate(void *targ){ TARGCOMM *myarg; REQUEST req; USER *user; const char *cstr; char ibuf[IOBUFSIZ], *tmp, *bp, *ep; int clsock, len, clen; myarg = (TARGCOMM *)targ; clsock = myarg->clsock; if(!rwlock_lock(g_runlock, FALSE)){ est_sock_down(myarg->clsock); free(myarg); log_print(LL_ERROR, "locking failed"); return NULL; } est_sock_recv_line(clsock, ibuf, IOBUFSIZ - 1); log_print(LL_INFO, "[%s:%d]: %s", myarg->claddr, myarg->clport, ibuf); if(cbstrfwmatch(ibuf, "HEAD ")){ req.method = HM_HEAD; } else if(cbstrfwmatch(ibuf, "GET ")){ req.method = HM_GET; } else if(cbstrfwmatch(ibuf, "POST ")){ req.method = HM_POST; } else if(cbstrfwmatch(ibuf, "OPTIONS ")){ req.method = HM_OPTIONS; } else { req.method = HM_UNKNOWN; } req.claddr = myarg->claddr; req.clport = myarg->clport; sprintf(req.prefix, "http://%s:%d", g_hostname, g_portnum); req.target = NULL; req.name = NULL; req.passwd = NULL; req.ims = -1; req.gzip = FALSE; req.deflate = FALSE; req.ctype = NULL; req.referer = NULL; req.estvia = NULL; req.body = NULL; req.params = cbmapopenex(MINIBNUM); req.now = time(NULL); req.reload = FALSE; if((bp = strchr(ibuf, ' ')) != NULL){ while(*bp == ' '){ bp++; } while(bp[0] == '/' && bp[1] == '/'){ bp++; } if((ep = strchr(bp, ' ')) != NULL){ req.target = cbmemdup(bp, ep - bp); } else { req.target = cbmemdup(bp, -1); } if((bp = strchr(req.target, '?')) != NULL){ *(bp++) = '\0'; setparams(req.params, bp); } } if(!req.target) req.target = cbmemdup("/", 1); clen = -1; do { len = est_sock_recv_line(clsock, ibuf, IOBUFSIZ - 1); if(len > 0) log_print(LL_DEBUG, "[%s:%d]: + %s", myarg->claddr, myarg->clport, ibuf); if(cbstrfwimatch(ibuf, "Host:")){ ibuf[HOSTBUFSIZ-1] = '\0'; sprintf(req.prefix, "http://%s", skiplabel(ibuf)); } else if(cbstrfwimatch(ibuf, "Content-Length:")){ clen = atoi(skiplabel(ibuf)); } else if(cbstrfwimatch(ibuf, "Content-Type:")){ req.ctype = cbmemdup(skiplabel(ibuf), -1); } else if(cbstrfwimatch(ibuf, "Referer:")){ req.referer = cbmemdup(skiplabel(ibuf), -1); } else if(cbstrfwimatch(ibuf, "X-Estraier-Via:")){ if(req.estvia){ tmp = cbsprintf("%s, %s", req.estvia, skiplabel(ibuf)); free(req.estvia); req.estvia = tmp; } else { req.estvia = cbmemdup(skiplabel(ibuf), -1); } } else if(cbstrfwimatch(ibuf, "Authorization:")){ cstr = skiplabel(ibuf); if(cbstrfwimatch(cstr, "basic") && (cstr = strchr(cstr, ' ')) != NULL){ while(*cstr == ' '){ cstr++; } bp = cbbasedecode(cstr, NULL); if((ep = strchr(bp, ':')) != NULL) *(ep++) = '\0'; req.name = cbmemdup(bp, -1); req.passwd = cbmemdup(ep ? ep : "", -1); free(bp); } } else if(cbstrfwimatch(ibuf, "If-Modified-Since:")){ req.ims = cbstrmktime(skiplabel(ibuf)); } else if(cbstrfwimatch(ibuf, "Accept-Encoding:")){ cstr = skiplabel(ibuf); if(ESTUSEZLIB && strstr(cstr, "gzip")) req.gzip = TRUE; if(ESTUSEZLIB && strstr(cstr, "deflate")) req.deflate = TRUE; } } while(len > 0); if(g_publicurl[0] != '\0') sprintf(req.prefix, "%s", g_publicurl); if(clen > g_recvmax) clen = g_recvmax; if(req.method == HM_POST && clen > 0){ req.body = est_sock_recv_all(clsock, clen); if(req.ctype && cbstrfwimatch(req.ctype, ESTFORMTYPE)) setparams(req.params, req.body); est_sock_recv_void(clsock); } if(req.ims > 0 && req.ims < req.now - UICACHELIFE) req.reload = TRUE; user = NULL; if(rwlock_lock(g_mgrlock, FALSE)){ if(req.name) user = umgr_get(g_umgr, req.name); if(user && !est_match_crypt(req.passwd, user->passwd)) user = NULL; if(!rwlock_unlock(g_mgrlock)) log_print(LL_ERROR, "unlocking failed"); } else { log_print(LL_ERROR, "locking failed"); } if(g_sigterm){ senderror(clsock, &req, 503, "Service Unavailable (shutting down)"); } else if(rwlock_rnum(g_runlock) > g_maxconn){ senderror(clsock, &req, 503, "Service Unavailable (too busy)"); } else if(req.method == HM_UNKNOWN){ senderror(clsock, &req, 501, "Not Implemented"); } else if(req.method == HM_POST && clen < 0){ senderror(clsock, &req, 411, "Length Required"); } else if(req.method == HM_POST && clen >= g_recvmax){ senderror(clsock, &req, 413, "Request Entity Too Large"); } else if(req.target[0] != '/' || strstr(req.target, "/../")){ senderror(clsock, &req, 400, "Bad Request (invalid URL)"); } else if(g_denyuntrusted && !cbmapget(g_trustednodes, req.claddr, -1, NULL)){ senderror(clsock, &req, 403, "Forbidden (untrusted node)"); } else if(req.method == HM_OPTIONS){ sendoptions(clsock, &req, user); } else if(!strcmp(req.target, MASTERLOC)){ sendmasterdata(clsock, &req, user); } else if(cbstrfwmatch(req.target, NODEPREFIX)){ sendnodedata(clsock, &req, user, req.target + strlen(NODEPREFIX)); } else if(!strcmp(req.target, MASTERUILOC)){ sendmasteruidata(clsock, &req, user); } else if(!strcmp(req.target, FAVICONLOC)){ sendfavicondata(clsock, &req); } else if(cbstrfwmatch(req.target, IMAGEPREFIX)){ sendimagedata(clsock, &req, req.target + strlen(IMAGEPREFIX)); } else if(g_docroot[0] != '\0'){ sendfiledata(clsock, &req); } else if(!strcmp(req.target, "/")){ sendmenudata(clsock, &req); } else { senderror(clsock, &req, 404, "Not Found"); } cbmapclose(req.params); free(req.body); free(req.estvia); free(req.referer); free(req.ctype); free(req.name); free(req.passwd); free(req.target); est_sock_down(myarg->clsock); free(myarg); if(!rwlock_unlock(g_runlock)) log_print(LL_ERROR, "unlocking failed"); return NULL; } /* set parameters into a map object */ static void setparams(CBMAP *params, const char *src){ CBLIST *pairs; char *key, *val, *dkey, *dval; int i; pairs = cbsplit(src, -1, "&"); for(i = 0; i < cblistnum(pairs); i++){ key = cbmemdup(cblistval(pairs, i, NULL), -1); if((val = strchr(key, '=')) != NULL){ *(val++) = '\0'; dkey = cburldecode(key, NULL); dval = cburldecode(val, NULL); cbmapput(params, dkey, -1, dval, -1, FALSE); free(dval); free(dkey); } free(key); } cblistclose(pairs); } /* add the server information to a datum object */ static void addservinfo(CBDATUM *datum, time_t now, int ccage){ char *tmp; tmp = cbdatestrhttp(now, 0); cbdatumprintf(datum, "Date: %s\r\n", tmp); free(tmp); cbdatumprintf(datum, "Server: %s/%s\r\n", SERVNAME, est_version); if(ccage < 1){ cbdatumprintf(datum, "Cache-Control: no-cache, must-revalidate, no-transform\r\n"); cbdatumprintf(datum, "Pragma: no-cache\r\n"); } else { cbdatumprintf(datum, "Cache-Control: max-age=%d, no-transform\r\n", ccage); tmp = cbdatestrhttp(now + ccage, 0); cbdatumprintf(datum, "Expires: %s\r\n", tmp); free(tmp); } cbdatumprintf(datum, "Connection: close\r\n"); } /* send error message */ static void senderror(int clsock, REQUEST *req, int code, const char *message){ CBDATUM *datum; datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 %d %s\r\n", code, message); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); if(req->method != HM_HEAD) cbdatumprintf(datum, "%s\n", message); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: %d %s", req->claddr, req->clport, code, message); } /* send authenticate error message */ static void sendautherror(int clsock, REQUEST *req, const char *realm){ CBDATUM *datum; datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 401 Unauthorized\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "WWW-Authenticate: Basic realm=\"%s\"\r\n", realm); cbdatumprintf(datum, "\r\n"); if(req->method != HM_HEAD) cbdatumprintf(datum, "Unauthorized\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 401 Unauthorized", req->claddr, req->clport); } /* send not modified error message */ static void sendnotmoderror(int clsock, REQUEST *req){ CBDATUM *datum; datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 304 Not Modified\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "\r\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 304 Not Modified", req->claddr, req->clport); } /* send header only message */ static void sendheadonly(int clsock, REQUEST *req, const char *type){ CBDATUM *datum; datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: %s\r\n", type); cbdatumprintf(datum, "\r\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (head)", req->claddr, req->clport); } /* check whether a user is banned */ static int isbanned(USER *user){ if(user && strchr(user->flags, 'b')) return TRUE; return FALSE; } /* check whether a user is an administrator of the master */ static int ismasteradmin(REQUEST *req, USER *user){ if(isbanned(user)) return FALSE; if(cbmapget(g_trustednodes, req->claddr, -1, NULL)) return TRUE; if(user && strchr(user->flags, 's')) return TRUE; return FALSE; } /* check whether a user is an administrator of a node */ static int isnodeadmin(NODE *node, REQUEST *req, USER *user){ if(isbanned(user)) return FALSE; if(ismasteradmin(req, user)) return TRUE; if(g_authmode == AM_NONE) return TRUE; if(user && cbmapget(node->admins, user->name, -1, NULL)) return TRUE; return FALSE; } /* check whether a user is a user of a node */ static int isnodeuser(NODE *node, REQUEST *req, USER *user){ if(isbanned(user)) return FALSE; if(isnodeadmin(node, req, user)) return TRUE; if(g_authmode == AM_NONE || g_authmode == AM_ADMIN) return TRUE; if(user && cbmapget(node->users, user->name, -1, NULL)) return TRUE; return FALSE; } /* get the options for node database */ static int getnodeoptions(void){ int options; options = 0; switch(g_scalepred){ case SP_SMALL: options |= ESTDBSMALL; break; default: break; case SP_LARGE: options |= ESTDBLARGE; break; case SP_HUGE: options |= ESTDBHUGE; break; } switch(g_scoreexpr){ case SE_VOID: options |= ESTDBSCVOID; break; default: break; case SE_INT: options |= ESTDBSCINT; break; case SE_ASIS: options |= ESTDBSCASIS; break; } return options; } /* send the option messages */ static void sendoptions(int clsock, REQUEST *req, USER *user){ CBDATUM *datum; datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Allow: GET,HEAD,POST,OPTIONS\r\n"); cbdatumprintf(datum, "\r\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (options)", req->claddr, req->clport); } /* send the master data */ static void sendmasterdata(int clsock, REQUEST *req, USER *user){ CBDATUM *datum; CBLIST *list; USER *tuser; NODE *tnode; const char *act, *name, *passwd, *flags, *fname, *misc, *label; char *tmp; int i; if(!rwlock_lock(g_mgrlock, TRUE)){ log_print(LL_ERROR, "locking failed"); senderror(clsock, req, 500, "Internal Server Error (locking failed)"); return; } if(req->referer && !cbstrfwmatch(req->referer, req->prefix)){ senderror(clsock, req, 403, "Forbidden (invalid referrer)"); if(!rwlock_unlock(g_mgrlock)) log_print(LL_ERROR, "unlocking failed"); return; } if(!ismasteradmin(req, user)){ sendautherror(clsock, req, "Super User"); if(!rwlock_unlock(g_mgrlock)) log_print(LL_ERROR, "unlocking failed"); return; } if(!(act = cbmapget(req->params, "action", -1, NULL))) act = ""; if(!(name = cbmapget(req->params, "name", -1, NULL))) name = ""; if(!(passwd = cbmapget(req->params, "passwd", -1, NULL))) passwd = ""; if(!(flags = cbmapget(req->params, "flags", -1, NULL))) flags = ""; if(!(fname = cbmapget(req->params, "fname", -1, NULL))) fname = ""; if(!(misc = cbmapget(req->params, "misc", -1, NULL))) misc = ""; if(!(label = cbmapget(req->params, "label", -1, NULL))) label = ""; if(!strcmp(act, "shutdown")){ datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 202 Accepted\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); cbdatumprintf(datum, "Accepted\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); g_sigterm = TRUE; cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 202 (accepted - shutdown)", req->claddr, req->clport); } else if(!strcmp(act, "sync")){ datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 202 Accepted\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); cbdatumprintf(datum, "Accepted\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); g_sigsync = TRUE; cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 202 (accepted - sync)", req->claddr, req->clport); } else if(!strcmp(act, "backup")){ datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 202 Accepted\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); cbdatumprintf(datum, "Accepted\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); g_sigback = TRUE; cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 202 (accepted - backup)", req->claddr, req->clport); } else if(!strcmp(act, "userlist")){ datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); list = umgr_names(g_umgr); for(i = 0; i < cblistnum(list); i++){ if(!(name = cblistval(list, i, NULL)) || !(tuser = umgr_get(g_umgr, name))) continue; cbdatumprintf(datum, "%s\t%s\t%s\t%s\t%s\n", tuser->name, tuser->passwd, tuser->flags, tuser->fname, tuser->misc); } cblistclose(list); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (userlist)", req->claddr, req->clport); } else if(!strcmp(act, "useradd") && name[0] != '\0' && passwd[0] != '\0'){ tmp = est_make_crypt(passwd); if(g_runmode == RM_RDONLY){ senderror(clsock, req, 503, "Service Unavailable (read only)"); } else if(umgr_put(g_umgr, name, tmp, flags, fname, misc)){ datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); cbdatumprintf(datum, "OK\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (useradd)", req->claddr, req->clport); } else { senderror(clsock, req, 400, "Bad Request (maybe, the user already exists)"); } free(tmp); } else if(!strcmp(act, "userdel") && name[0] != '\0'){ if(g_runmode == RM_RDONLY){ senderror(clsock, req, 503, "Service Unavailable (read only)"); } else if(umgr_out(g_umgr, name)){ datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); cbdatumprintf(datum, "OK\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (userdel)", req->claddr, req->clport); } else { senderror(clsock, req, 400, "Bad Request (maybe, the user does not exist)"); } } else if(!strcmp(act, "nodelist")){ datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); list = nmgr_names(g_nmgr); for(i = 0; i < cblistnum(list); i++){ if(!(name = cblistval(list, i, NULL)) || !(tnode = nmgr_get(g_nmgr, name))) continue; cbdatumprintf(datum, "%s\t%s\t%d\t%d\t%.0f\n", tnode->name, tnode->label, est_mtdb_doc_num(tnode->db), est_mtdb_word_num(tnode->db), est_mtdb_size(tnode->db)); } cblistclose(list); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (nodelist)", req->claddr, req->clport); } else if(!strcmp(act, "nodeadd") && name[0] != '\0'){ if(g_runmode == RM_RDONLY){ senderror(clsock, req, 503, "Service Unavailable (read only)"); } else if(nmgr_put(g_nmgr, name, TRUE, getnodeoptions())){ if((tnode = nmgr_get(g_nmgr, name)) != NULL){ free(tnode->label); tnode->label = cbmemdup(label[0] != '\0' ? label : name, -1); } nmgr_sync(g_nmgr, FALSE); datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); cbdatumprintf(datum, "OK\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (nodeadd)", req->claddr, req->clport); } else { senderror(clsock, req, 400, "Bad Request (maybe, the node already exists)"); } } else if(!strcmp(act, "nodedel") && name[0] != '\0'){ if(g_runmode == RM_RDONLY){ senderror(clsock, req, 503, "Service Unavailable (read only)"); } else if(nmgr_out(g_nmgr, name)){ datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); cbdatumprintf(datum, "OK\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (nodedel)", req->claddr, req->clport); } else { senderror(clsock, req, 400, "Bad Request (maybe, the node does not exist)"); } } else if(!strcmp(act, "nodeclr") && name[0] != '\0'){ if(g_runmode == RM_RDONLY){ senderror(clsock, req, 503, "Service Unavailable (read only)"); } else if(nmgr_clear(g_nmgr, name, getnodeoptions())){ datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); cbdatumprintf(datum, "OK\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (nodeclr)", req->claddr, req->clport); } else { senderror(clsock, req, 400, "Bad Request (maybe, the node does not exist)"); } } else if(!strcmp(act, "logrtt")){ if(log_rotate(g_rootdir, g_logfile)){ datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); cbdatumprintf(datum, "OK\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (nodeclr)", req->claddr, req->clport); } else { senderror(clsock, req, 500, "Internal Server Error (log rotation failed)"); } } else { senderror(clsock, req, 400, "Bad Request (the action is invalid or lack of parameters)"); } if(!rwlock_unlock(g_mgrlock)) log_print(LL_ERROR, "unlocking failed"); } /* send a node data */ static void sendnodedata(int clsock, REQUEST *req, USER *user, const char *path){ CBDATUM *datum; CBLIST *list; NODE *node; const char *cmd; char *pbuf, *pv; int i; pbuf = cbmemdup(path, -1); if((pv = strchr(path, '/')) != NULL){ *pv = '\0'; cmd = pv + 1; } else { cmd = ""; } while(*cmd == '/'){ cmd++; } if(!rwlock_lock(g_mgrlock, cmd[0] == '_')){ log_print(LL_ERROR, "locking failed"); senderror(clsock, req, 500, "Internal Server Error (locking failed)"); free(pbuf); return; } if(!(node = nmgr_get(g_nmgr, path))){ if(!strcmp(req->target, NODEPREFIX)){ datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); if(req->method != HM_HEAD){ list = nmgr_names(g_nmgr); for(i = 0; i < cblistnum(list); i++){ cbdatumprintf(datum, "%s\n", cblistval(list, i, NULL)); } cblistclose(list); } est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); } else { senderror(clsock, req, 404, "Not Found (the node does not exist)"); } } else if(!strcmp(cmd, "inform")){ if(!isnodeuser(node, req, user)){ sendautherror(clsock, req, node->name); } else { est_mtdb_interrupt(node->db); sendnodecmdinform(clsock, req, node); } } else if(!strcmp(cmd, "cacheusage")){ if(!isnodeuser(node, req, user)){ sendautherror(clsock, req, node->name); } else { sendnodecmdcacheusage(clsock, req, node); } } else if(!strcmp(cmd, "search")){ if(!isnodeuser(node, req, user)){ sendautherror(clsock, req, node->name); } else { est_mtdb_interrupt(node->db); sendnodecmdsearch(clsock, req, node); } } else if(!strcmp(cmd, "list")){ if(!isnodeuser(node, req, user)){ sendautherror(clsock, req, node->name); } else { est_mtdb_interrupt(node->db); sendnodecmdlist(clsock, req, node); } } else if(!strcmp(cmd, "get_doc")){ if(!isnodeuser(node, req, user)){ sendautherror(clsock, req, node->name); } else { est_mtdb_interrupt(node->db); sendnodecmdgetdoc(clsock, req, node); } } else if(!strcmp(cmd, "get_doc_attr")){ if(!isnodeuser(node, req, user)){ sendautherror(clsock, req, node->name); } else { est_mtdb_interrupt(node->db); sendnodecmdgetdocattr(clsock, req, node); } } else if(!strcmp(cmd, "etch_doc")){ if(!isnodeuser(node, req, user)){ sendautherror(clsock, req, node->name); } else { est_mtdb_interrupt(node->db); sendnodecmdetchdoc(clsock, req, node); } } else if(!strcmp(cmd, "uri_to_id")){ if(!isnodeuser(node, req, user)){ sendautherror(clsock, req, node->name); } else { est_mtdb_interrupt(node->db); sendnodecmduritoid(clsock, req, node); } } else if(!strcmp(cmd, "put_doc")){ if(g_runmode == RM_RDONLY){ senderror(clsock, req, 503, "Service Unavailable (read only)"); } else if(req->referer && !cbstrfwmatch(req->referer, req->prefix)){ senderror(clsock, req, 403, "Forbidden (invalid referrer)"); } else if(!isnodeadmin(node, req, user)){ sendautherror(clsock, req, node->name); } else { est_mtdb_interrupt(node->db); sendnodecmdputdoc(clsock, req, node); } } else if(!strcmp(cmd, "out_doc")){ if(g_runmode == RM_RDONLY){ senderror(clsock, req, 503, "Service Unavailable (read only)"); } else if(req->referer && !cbstrfwmatch(req->referer, req->prefix)){ senderror(clsock, req, 403, "Forbidden (invalid referrer)"); } else if(!isnodeadmin(node, req, user)){ sendautherror(clsock, req, node->name); } else { est_mtdb_interrupt(node->db); sendnodecmdoutdoc(clsock, req, node); } } else if(!strcmp(cmd, "edit_doc")){ if(g_runmode == RM_RDONLY){ senderror(clsock, req, 503, "Service Unavailable (read only)"); } else if(req->referer && !cbstrfwmatch(req->referer, req->prefix)){ senderror(clsock, req, 403, "Forbidden (invalid referrer)"); } else if(!isnodeadmin(node, req, user)){ sendautherror(clsock, req, node->name); } else { est_mtdb_interrupt(node->db); sendnodecmdeditdoc(clsock, req, node); } } else if(!strcmp(cmd, "sync")){ if(g_runmode == RM_RDONLY){ senderror(clsock, req, 503, "Service Unavailable (read only)"); } else if(req->referer && !cbstrfwmatch(req->referer, req->prefix)){ senderror(clsock, req, 403, "Forbidden (invalid referrer)"); } else if(!isnodeadmin(node, req, user)){ sendautherror(clsock, req, node->name); } else { est_mtdb_interrupt(node->db); sendnodecmdsync(clsock, req, node); } } else if(!strcmp(cmd, "optimize")){ if(g_runmode == RM_RDONLY){ senderror(clsock, req, 503, "Service Unavailable (read only)"); } else if(req->referer && !cbstrfwmatch(req->referer, req->prefix)){ senderror(clsock, req, 403, "Forbidden (invalid referrer)"); } else if(!isnodeadmin(node, req, user)){ sendautherror(clsock, req, node->name); } else { est_mtdb_interrupt(node->db); sendnodecmdoptimize(clsock, req, node); } } else if(!strcmp(cmd, "_set_user")){ if(g_runmode == RM_RDONLY){ senderror(clsock, req, 503, "Service Unavailable (read only)"); } else if(req->referer && !cbstrfwmatch(req->referer, req->prefix)){ senderror(clsock, req, 403, "Forbidden (invalid referrer)"); } else if(!isnodeadmin(node, req, user)){ sendautherror(clsock, req, node->name); } else { est_mtdb_interrupt(node->db); sendnodecmdsetuser(clsock, req, node); } } else if(!strcmp(cmd, "_set_link")){ if(g_runmode == RM_RDONLY){ senderror(clsock, req, 503, "Service Unavailable (read only)"); } else if(req->referer && !cbstrfwmatch(req->referer, req->prefix)){ senderror(clsock, req, 403, "Forbidden (invalid referrer)"); } else if(!isnodeadmin(node, req, user)){ sendautherror(clsock, req, node->name); } else { est_mtdb_interrupt(node->db); sendnodecmdsetlink(clsock, req, node); } } else if(!strcmp(cmd, SEARCHUICMD)){ if(req->ims > 0 && node->mtime <= req->ims && !req->reload){ sendnotmoderror(clsock, req); } else if(!isnodeuser(node, req, user)){ sendautherror(clsock, req, node->name); } else if(req->method == HM_HEAD){ sendheadonly(clsock, req, UIMIMETYPE); } else { est_mtdb_interrupt(node->db); sendnodecmdsearchui(clsock, req, node); } } else if(!strcmp(cmd, SEARCHATOMCMD)){ if(req->ims > 0 && node->mtime <= req->ims && !req->reload){ sendnotmoderror(clsock, req); } else if(!isnodeuser(node, req, user)){ sendautherror(clsock, req, node->name); } else if(req->method == HM_HEAD){ sendheadonly(clsock, req, ATOMMIMETYPE); } else { est_mtdb_interrupt(node->db); sendnodecmdsearchatom(clsock, req, node); } } else if(!strcmp(cmd, SEARCHRSSCMD)){ if(req->ims > 0 && node->mtime <= req->ims && !req->reload){ sendnotmoderror(clsock, req); } else if(!isnodeuser(node, req, user)){ sendautherror(clsock, req, node->name); } else if(req->method == HM_HEAD){ sendheadonly(clsock, req, RSSMIMETYPE); } else { est_mtdb_interrupt(node->db); sendnodecmdsearchrss(clsock, req, node); } } else if(!strcmp(cmd, OPENSEARCHCMD)){ if(req->ims > 0 && node->mtime <= req->ims && !req->reload){ sendnotmoderror(clsock, req); } else if(!isnodeuser(node, req, user)){ sendautherror(clsock, req, node->name); } else if(req->method == HM_HEAD){ sendheadonly(clsock, req, OSRCHMIMETYPE); } else { est_mtdb_interrupt(node->db); sendnodecmdopensearch(clsock, req, node); } } else { senderror(clsock, req, 400, "Bad Request (the command is invalid)"); } free(pbuf); if(!rwlock_unlock(g_mgrlock)) log_print(LL_ERROR, "unlocking failed"); } /* set the pseudo-attribute of the original node to a document */ static void setdocorigin(ESTDOC *doc, REQUEST *req, NODE *node, int score){ char pbuf[URIBUFSIZ]; sprintf(pbuf, "%s%s%s", req->prefix, NODEPREFIX, node->name); est_doc_add_attr(doc, DATTRNDURL, pbuf); est_doc_add_attr(doc, DATTRNDLABEL, node->label); if(score >= 0){ sprintf(pbuf, "%d", score); est_doc_add_attr(doc, DATTRNDSCORE, pbuf); } } /* merge local hints to total hints */ static void mergehints(CBMAP *total, CBMAP *local){ static pthread_mutex_t mymutex = PTHREAD_MUTEX_INITIALIZER; const char *kbuf, *vbuf; char numbuf[NUMBUFSIZ]; int ksiz, num, vsiz; if(pthread_mutex_lock(&mymutex) != 0) return; cbmapiterinit(local); while((kbuf = cbmapiternext(local, &ksiz)) != NULL){ num = atoi(cbmapiterval(kbuf, NULL)); if((vbuf = cbmapget(total, kbuf, ksiz, NULL)) != NULL) num += atoi(vbuf); vsiz = sprintf(numbuf, "%d", num); cbmapput(total, kbuf, ksiz, numbuf, vsiz, TRUE); } pthread_mutex_unlock(&mymutex); } /* check whether the request is looping */ static int islooproute(const char *url, REQUEST *req){ CBLIST *list; const char *rp; int i; assert(url && req); if(!req->estvia) return FALSE; list = cbsplit(req->estvia, -1, ","); for(i = 0; i < cblistnum(list); i++){ rp = cblistval(list, i, NULL); while(*rp == ' ' || *rp == '\t'){ rp++; } if(!strcmp(url, rp)){ cblistclose(list); return TRUE; } } cblistclose(list); return FALSE; } /* search a local index */ static void *searchlocal(void *targ){ REQUEST *req; ESTCOND *cond; ESTDOC *doc; NODE *node; RESMAP *resmap; CBMAP *hints, *myhints; CBLIST *words, *mywords; const char *phrase, *vbuf; int i, max, *res, rnum, hits, miss, cnt, rateuri, score, down, vsiz; double curtime, weight; req = ((TARGLCSRCH *)targ)->req; cond = ((TARGLCSRCH *)targ)->cond; node = ((TARGLCSRCH *)targ)->node; hints = ((TARGLCSRCH *)targ)->hints; max = ((TARGLCSRCH *)targ)->max; if(max < LCSRCHRESMIN) max = LCSRCHRESMIN; est_cond_set_max(cond, max); resmap = ((TARGLCSRCH *)targ)->resmap; words = ((TARGLCSRCH *)targ)->words; log_print(LL_DEBUG, "[%s:%d]: local search: %s", req->claddr, req->clport, est_mtdb_name(node->db)); curtime = est_gettimeofday(); myhints = cbmapopenex(MINIBNUM); est_cond_set_options(cond, ESTCONDSCFB); res = est_mtdb_search(node->db, cond, &rnum, myhints); hits = (vbuf = cbmapget(myhints, "", 0, NULL)) ? atoi(vbuf) : rnum; if(max >= 0 && hits < max + 1 && est_cond_auxiliary_word(cond, "")){ free(res); est_cond_set_auxiliary(cond, -1); res = est_mtdb_search(node->db, cond, &rnum, myhints); hits = (vbuf = cbmapget(myhints, "", 0, NULL)) ? atoi(vbuf) : rnum; } miss = 0; mergehints(hints, myhints); ((TARGLCSRCH *)targ)->itime = est_gettimeofday() - curtime; cnt = 0; phrase = est_cond_phrase(cond); rateuri = g_rateuri && !(phrase && cbstrfwmatch(phrase, ESTOPSIMILAR)); for(i = 0; i < rnum && cnt < max; i++){ if(!(doc = est_mtdb_get_doc(node->db, res[i], 0))) continue; if(g_scancheck && phrase && phrase[0] != '[' && phrase[0] != '*' && !est_mtdb_scan_doc(node->db, doc, cond)){ est_doc_delete(doc); miss++; continue; } score = est_cond_score(cond, i); if(rateuri && g_scoreexpr != SE_ASIS){ if((vbuf = est_doc_attr(doc, ESTDATTRURI)) != NULL){ if(score < 100) score = 100; down = 4; if(cbstrfwimatch(vbuf, "file://")){ vbuf += 7; } else if(cbstrfwimatch(vbuf, "ftp://")){ vbuf += 6; } else if(cbstrfwimatch(vbuf, "http://")){ vbuf += 7; } else if(cbstrfwimatch(vbuf, "https://")){ vbuf += 8; } else { down += 3; } while(vbuf[0] != '\0'){ if(vbuf[0] == '?' || vbuf[0] == '#'){ down++; break; } if(vbuf[0] == '/' && vbuf[1] != '\0') down++; vbuf++; } score *= 8.0 / (double)down; } else { score = 0; } } setdocorigin(doc, req, node, score); if(g_scoreexpr != SE_ASIS){ weight = 1.0; if((vbuf = est_doc_attr(doc, ESTDATTRWEIGHT)) != NULL){ weight = strtod(vbuf, NULL); weight = weight >= 0.01 ? weight : 0.01; } weight /= 10.0; switch(g_mergemethod){ case MM_SCORE: score = score * weight; break; case MM_SCRK: score = score * (max * 2 - cnt) * weight; break; case MM_RANK: score = SELFCREDIT * (max - cnt); break; } } resmap_put(resmap, score, doc, NULL, NULL); cnt++; } free(res); ((TARGLCSRCH *)targ)->hnum = atoi(cbmapget(myhints, "", 0, NULL)); ((TARGLCSRCH *)targ)->mhnum = miss; mywords = est_hints_to_words(myhints); cbmapiterinit(myhints); for(i = 0; i < cblistnum(mywords); i++){ vbuf = cblistval(mywords, i, &vsiz); if(vsiz > 0) cblistpush(words, vbuf, vsiz); } cblistclose(mywords); cbmapclose(myhints); ((TARGLCSRCH *)targ)->etime = est_gettimeofday() - curtime; return NULL; } /* search a remote index */ static void *searchremote(void *targ){ REQUEST *req; ESTCOND *cond; NODE *node; RESMAP *resmap; ESTNODE *tnode; ESTNODERES *nres; CBMAP *hints, *attrs, *myhints, *whints; CBLIST *list; const char *myurl, *url, *label, *vbuf, *pv; char numbuf[NUMBUFSIZ], *snippet; int i, max, credit, depth, wwidth, hwidth, awidth, len, cnt, score; double curtime; req = ((TARGRMSRCH *)targ)->req; myurl = ((TARGRMSRCH *)targ)->myurl; cond = ((TARGRMSRCH *)targ)->cond; node = ((TARGRMSRCH *)targ)->node; hints = ((TARGRMSRCH *)targ)->hints; max = ((TARGRMSRCH *)targ)->max; if(max < RMSRCHRESMIN) max = RMSRCHRESMIN; est_cond_set_max(cond, max); resmap = ((TARGRMSRCH *)targ)->resmap; url = ((TARGRMSRCH *)targ)->url; label = ((TARGRMSRCH *)targ)->label; credit = ((TARGRMSRCH *)targ)->credit; depth = ((TARGRMSRCH *)targ)->depth; wwidth = ((TARGRMSRCH *)targ)->wwidth; hwidth = ((TARGRMSRCH *)targ)->hwidth; awidth = ((TARGRMSRCH *)targ)->awidth; if(!strcmp(myurl, url) || islooproute(url, req)){ log_print(LL_DEBUG, "[%s:%d]: omitting request loop (link): %s", req->claddr, req->clport, url); return NULL; } log_print(LL_DEBUG, "[%s:%d]: remote search: %s", req->claddr, req->clport, url); curtime = est_gettimeofday(); tnode = est_node_new(url); if(g_proxyhost[0] != '\0') est_node_set_proxy(tnode, g_proxyhost, g_proxyport); est_node_set_timeout(tnode, g_searchtimeout); if(req->estvia) est_node_add_header(tnode, ESTHTHVIA, req->estvia); est_node_add_header(tnode, ESTHTHVIA, myurl); est_node_set_snippet_width(tnode, wwidth, hwidth, awidth); if((nres = est_node_search(tnode, cond, depth - 1)) != NULL){ cnt = 0; while(est_noderes_shift_doc(nres, &attrs, &snippet)){ switch(g_mergemethod){ case MM_SCORE: score = (vbuf = cbmapget(attrs, DATTRNDSCORE, -1, NULL)) != NULL ? atoi(vbuf) : 0; score = score * (credit / (double)SELFCREDIT); resmap_put(resmap, score, NULL, attrs, snippet); break; case MM_SCRK: score = (vbuf = cbmapget(attrs, DATTRNDSCORE, -1, NULL)) != NULL ? atoi(vbuf) : 0; score = score * (credit / (double)SELFCREDIT) * (max * 2 - cnt); resmap_put(resmap, score, NULL, attrs, snippet); break; case MM_RANK: resmap_put(resmap, credit * (max - cnt), NULL, attrs, snippet); break; } cnt++; } whints = cbmapopenex(MINIBNUM); myhints = est_noderes_hints(nres); if((vbuf = cbmapget(myhints, "HIT", -1, NULL)) != NULL){ cbmapput(whints, "", 0, vbuf, -1, FALSE); ((TARGRMSRCH *)targ)->hnum = atoi(vbuf); } else { cbmapput(whints, "", 0, "0", -1, FALSE); } if((vbuf = cbmapget(myhints, "DOCNUM", -1, NULL)) != NULL) ((TARGRMSRCH *)targ)->dnum = atoi(vbuf); if((vbuf = cbmapget(myhints, "WORDNUM", -1, NULL)) != NULL) ((TARGRMSRCH *)targ)->wnum = atoi(vbuf); if((vbuf = cbmapget(myhints, "LINK#0", -1, NULL)) != NULL){ list = cbsplit(vbuf, -1, "\t"); if(cblistnum(list) == 7) ((TARGRMSRCH *)targ)->size = strtod(cblistval(list, 5, NULL), NULL); cblistclose(list); } for(i = 0; i < cbmaprnum(myhints); i++){ len = sprintf(numbuf, "HINT#%d", i + 1); if((vbuf = cbmapget(myhints, numbuf, len, NULL)) != NULL && (pv = strchr(vbuf, '\t')) != NULL && pv > vbuf){ cbmapput(whints, vbuf, pv - vbuf, pv + 1, -1, FALSE); } else { break; } } mergehints(hints, whints); cbmapclose(whints); ((TARGRMSRCH *)targ)->mtime = est_noderes_mdate(nres); est_noderes_delete(nres); } else { log_print(LL_WARN, "[%s:%d]: connection failed: %s", req->claddr, req->clport, url); } est_node_delete(tnode); ((TARGRMSRCH *)targ)->etime = est_gettimeofday() - curtime; return NULL; } /* set the phrase for similar search of a document */ static void setsimilarphrase(ESTCOND *cond, const char *url, int id){ ESTNODE *tnode; CBMAP *kwords; CBDATUM *pbuf; const char *kbuf, *vbuf; int ksiz, vsiz; tnode = est_node_new(url); if(g_proxyhost[0] != '\0') est_node_set_proxy(tnode, g_proxyhost, g_proxyport); est_node_set_timeout(tnode, g_searchtimeout); if((kwords = est_node_etch_doc(tnode, id)) != NULL){ pbuf = cbdatumopen(ESTOPSIMILAR " ", -1); cbdatumcat(pbuf, g_uismlrtune, -1); cbmapiterinit(kwords); while((kbuf = cbmapiternext(kwords, &ksiz)) != NULL){ vbuf = cbmapiterval(kbuf, &vsiz); cbdatumcat(pbuf, " WITH ", -1); cbdatumcat(pbuf, vbuf, vsiz); cbdatumcat(pbuf, " ", 1); cbdatumcat(pbuf, kbuf, ksiz); } est_cond_set_phrase(cond, cbdatumptr(pbuf)); cbdatumclose(pbuf); cbmapclose(kwords); } est_node_delete(tnode); } /* concatenate a document data to an output buffer */ static void catdocdata(CBDATUM *datum, NODE *node, RESDOC *resdoc, CBLIST *words, int wwidth, int hwidth, int awidth){ CBMAP *kwords; CBLIST *list; const CBLIST *texts; const char *kbuf, *vbuf; char *snippet; int i, id, ksiz, vsiz; if(resdoc->doc){ list = est_doc_attr_names(resdoc->doc); for(i = 0; i < cblistnum(list); i++){ vbuf = cblistval(list, i, NULL); cbdatumprintf(datum, "%s=%s\n", vbuf, est_doc_attr(resdoc->doc, vbuf)); } cblistclose(list); if(g_smlrvnum > 0){ cbdatumprintf(datum, "%s", ESTDCNTLVECTOR); id = est_doc_id(resdoc->doc); kwords = id > 0 ? est_mtdb_get_keywords(node->db, id) : NULL; if(!kwords) kwords = est_mtdb_etch_doc(node->db, resdoc->doc, g_smlrvnum); cbmapiterinit(kwords); while((kbuf = cbmapiternext(kwords, &ksiz)) != NULL){ cbdatumcat(datum, "\t", 1); cbdatumcat(datum, kbuf, ksiz); cbdatumcat(datum, "\t", 1); vbuf = cbmapiterval(kbuf, &vsiz); cbdatumcat(datum, vbuf, vsiz); } cbmapclose(kwords); cbdatumcat(datum, "\n", 1); } } else if(resdoc->attrs){ list = cbmapkeys(resdoc->attrs); cblistsort(list); for(i = 0; i < cblistnum(list); i++){ vbuf = cblistval(list, i, NULL); if(vbuf[0] == '%') continue; cbdatumprintf(datum, "%s=%s\n", vbuf, cbmapget(resdoc->attrs, vbuf, -1, NULL)); } cblistclose(list); if((vbuf = cbmapget(resdoc->attrs, ESTDCNTLVECTOR, -1, NULL)) != NULL) cbdatumprintf(datum, "%s\t%s\n", ESTDCNTLVECTOR, vbuf); } cbdatumcat(datum, "\n", 1); if(resdoc->body){ cbdatumcat(datum, resdoc->body, -1); } else if(resdoc->doc){ if(wwidth < 0){ texts = est_doc_texts(resdoc->doc); for(i = 0; i < cblistnum(texts); i++){ vbuf = cblistval(texts, i, &vsiz); cbdatumcat(datum, vbuf, vsiz); cbdatumcat(datum, "\n", 1); } vbuf = est_doc_hidden_texts(resdoc->doc); if(vbuf[0] != '\0') cbdatumprintf(datum, "\t%s\n", vbuf); } else if(wwidth > 0){ snippet = est_doc_make_snippet(resdoc->doc, words, wwidth, hwidth, awidth); cbdatumcat(datum, snippet, -1); free(snippet); } } } /* concatenate a document data to an output buffer for search user interface */ static void catdocdataui(CBDATUM *datum, int num, RESDOC *resdoc, CBLIST *words, REQUEST *req, NODE *node, const char *condstr, const char *simcondstr){ CBLIST *lines; const char *uri, *file, *title, *type, *ndurl, *ndlabel, *vbuf; char *turi, buf[URIBUFSIZ], *pv, *snippet, *word; int i, id, vsiz, ld; cbdatumprintf(datum, "

\n", num); if(!(uri = resdoc->doc ? est_doc_attr(resdoc->doc, ESTDATTRURI) : cbmapget(resdoc->attrs, ESTDATTRURI, -1, NULL))) uri = "."; turi = makeshownuri(uri); if((file = strrchr(turi, '/')) != NULL) file++; title = resdoc->doc ? est_doc_attr(resdoc->doc, ESTDATTRTITLE) : cbmapget(resdoc->attrs, ESTDATTRTITLE, -1, NULL); if(!title) title = resdoc->doc ? est_doc_attr(resdoc->doc, DATTRLFILE) : cbmapget(resdoc->attrs, DATTRLFILE, -1, NULL); if(!title) title = file; if(!title || title[0] == '\0') title = "(no title)"; type = resdoc->doc ? est_doc_attr(resdoc->doc, ESTDATTRTYPE) : cbmapget(resdoc->attrs, ESTDATTRTYPE, -1, NULL); if(!type || type[0] == '\0') type = DEFMIMETYPE; ndurl = resdoc->doc ? est_doc_attr(resdoc->doc, DATTRNDURL) : cbmapget(resdoc->attrs, DATTRNDURL, -1, NULL); if(!ndurl) ndurl = "."; ndlabel = resdoc->doc ? est_doc_attr(resdoc->doc, DATTRNDLABEL) : cbmapget(resdoc->attrs, DATTRNDLABEL, -1, NULL); vbuf = resdoc->doc ? est_doc_attr(resdoc->doc, ESTDATTRID) : cbmapget(resdoc->attrs, ESTDATTRID, -1, NULL); id = vbuf ? atoi(vbuf) : -1; if(!ndlabel) ndlabel = "(unknown)"; cbdatumprintf(datum, "
", num); cbdatumprintf(datum, "%@", turi, type, num, num, title); cbdatumprintf(datum, " (%@)", ndurl, SEARCHUICMD, condstr, UIMIMETYPE, num, num, ndlabel); cbdatumprintf(datum, "
\n"); for(i = 0; i < cblistnum(g_uiextattrs); i++){ sprintf(buf, "%s", cblistval(g_uiextattrs, i, NULL)); if(!(pv = strchr(buf, '|'))) continue; *(pv++) = '\0'; vbuf = resdoc->doc ? est_doc_attr(resdoc->doc, buf) : cbmapget(resdoc->attrs, buf, -1, NULL); if(!vbuf) continue; cbdatumprintf(datum, "
", num, i + 1); cbdatumprintf(datum, "%@: ", num, i + 1, pv); cbdatumprintf(datum, "%@", num, i + 1, vbuf); cbdatumprintf(datum, "
\n"); } if(g_snipwwidth > 0){ cbdatumprintf(datum, "
", num); snippet = resdoc->doc ? est_doc_make_snippet(resdoc->doc, words, g_snipwwidth, g_sniphwidth, g_snipawidth) : NULL; lines = cbsplit(snippet ? snippet: resdoc->body, -1, "\n"); ld = TRUE; for(i = 0; i < cblistnum(lines); i++){ vbuf = cblistval(lines, i, &vsiz); word = cbmemdup(vbuf, vsiz); if(vsiz < 1){ if(!ld) cbdatumprintf(datum, " ... "); ld = TRUE; } else if((pv = strchr(word, '\t')) != NULL){ *pv = '\0'; cbdatumprintf(datum, "%@", word); ld = FALSE; } else { cbdatumprintf(datum, "%@", word); ld = FALSE; } free(word); } cblistclose(lines); free(snippet); cbdatumprintf(datum, "
\n"); } cbdatumprintf(datum, "
", num); cbdatumprintf(datum, "%@", num, turi); if(g_smlrvnum > 0 && id > 0) cbdatumprintf(datum, " - [similar]", req->prefix, NODEPREFIX, node->name, SEARCHUICMD, simcondstr, id, ndurl); cbdatumprintf(datum, "
\n"); free(turi); cbdatumprintf(datum, "
\n"); } /* concatenate a document data to an output buffer for Atom feed interface */ static void catdocdataatom(CBDATUM *datum, RESDOC *resdoc, CBLIST *words, NODE *node){ CBLIST *lines; const char *uri, *file, *title, *author, *type, *vbuf; char *turi, *dstr, *pv, *snippet, *word; int i, vsiz, ld; time_t mtime, ctime; if(!(uri = resdoc->doc ? est_doc_attr(resdoc->doc, ESTDATTRURI) : cbmapget(resdoc->attrs, ESTDATTRURI, -1, NULL))) uri = "."; turi = makeshownuri(uri); if((file = strrchr(turi, '/')) != NULL) file++; title = resdoc->doc ? est_doc_attr(resdoc->doc, ESTDATTRTITLE) : cbmapget(resdoc->attrs, ESTDATTRTITLE, -1, NULL); if(!title) title = resdoc->doc ? est_doc_attr(resdoc->doc, DATTRLFILE) : cbmapget(resdoc->attrs, DATTRLFILE, -1, NULL); if(!title) title = file; if(!title || title[0] == '\0') title = "(no title)"; author = resdoc->doc ? est_doc_attr(resdoc->doc, ESTDATTRAUTHOR) : cbmapget(resdoc->attrs, ESTDATTRAUTHOR, -1, NULL); if(!author || author[0] == '\0') author = "(anonymous)"; type = resdoc->doc ? est_doc_attr(resdoc->doc, ESTDATTRTYPE) : cbmapget(resdoc->attrs, ESTDATTRTYPE, -1, NULL); if(!type || type[0] == '\0') type = DEFMIMETYPE; vbuf = resdoc->doc ? est_doc_attr(resdoc->doc, ESTDATTRMDATE) : cbmapget(resdoc->attrs, ESTDATTRMDATE, -1, NULL); mtime = vbuf && vbuf[0] != '\0' ? cbstrmktime(vbuf) : node->mtime; vbuf = resdoc->doc ? est_doc_attr(resdoc->doc, ESTDATTRCDATE) : cbmapget(resdoc->attrs, ESTDATTRCDATE, -1, NULL); ctime = vbuf && vbuf[0] != '\0' ? cbstrmktime(vbuf) : -1; cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "%@\n", turi); cbdatumprintf(datum, "%@\n", title); cbdatumprintf(datum, "%@\n", author); dstr = cbdatestrwww(mtime, 0); cbdatumprintf(datum, "%@\n", dstr); free(dstr); if(ctime > 0){ dstr = cbdatestrwww(ctime, 0); cbdatumprintf(datum, "%@\n", dstr); free(dstr); } vbuf = resdoc->doc ? est_doc_attr(resdoc->doc, ESTDATTRGENRE) : cbmapget(resdoc->attrs, ESTDATTRGENRE, -1, NULL); if(vbuf && vbuf[0] != '\0') cbdatumprintf(datum, "\n", vbuf); cbdatumprintf(datum, "\n", type, turi); if(g_snipwwidth > 0){ cbdatumprintf(datum, ""); cbdatumprintf(datum, ""); snippet = resdoc->doc ? est_doc_make_snippet(resdoc->doc, words, g_snipwwidth, g_sniphwidth, g_snipawidth) : NULL; lines = cbsplit(snippet ? snippet: resdoc->body, -1, "\n"); ld = TRUE; for(i = 0; i < cblistnum(lines); i++){ vbuf = cblistval(lines, i, &vsiz); word = cbmemdup(vbuf, vsiz); if(vsiz < 1){ if(!ld) cbdatumprintf(datum, " ... "); ld = TRUE; } else if((pv = strchr(word, '\t')) != NULL){ *pv = '\0'; cbdatumprintf(datum, "%@", word); ld = FALSE; } else { cbdatumprintf(datum, "%@", word); ld = FALSE; } free(word); } cblistclose(lines); free(snippet); cbdatumprintf(datum, ""); cbdatumprintf(datum, "\n"); } vbuf = resdoc->doc ? est_doc_attr(resdoc->doc, DATTRNDURL) : cbmapget(resdoc->attrs, DATTRNDURL, -1, NULL); if(vbuf && vbuf[0] != '\0') cbdatumprintf(datum, "%@\n", vbuf); vbuf = resdoc->doc ? est_doc_attr(resdoc->doc, DATTRNDLABEL) : cbmapget(resdoc->attrs, DATTRNDLABEL, -1, NULL); if(vbuf && vbuf[0] != '\0') cbdatumprintf(datum, "%@\n", vbuf); vbuf = resdoc->doc ? est_doc_attr(resdoc->doc, DATTRNDSCORE) : cbmapget(resdoc->attrs, DATTRNDSCORE, -1, NULL); if(vbuf && vbuf[0] != '\0') cbdatumprintf(datum, "%@\n", vbuf); vbuf = resdoc->doc ? est_doc_attr(resdoc->doc, ESTDATTRID) : cbmapget(resdoc->attrs, ESTDATTRID, -1, NULL); if(vbuf && vbuf[0] != '\0') cbdatumprintf(datum, "%@\n", vbuf); cbdatumprintf(datum, "\n"); free(turi); } /* concatenate a document data to an output buffer for RSS feed interface */ static void catdocdatarss(CBDATUM *datum, RESDOC *resdoc, CBLIST *words, NODE *node){ CBLIST *lines; const char *uri, *file, *title, *author, *type, *vbuf; char *turi, *dstr, *pv, *snippet, *word; int i, vsiz, ld; time_t mtime; if(!(uri = resdoc->doc ? est_doc_attr(resdoc->doc, ESTDATTRURI) : cbmapget(resdoc->attrs, ESTDATTRURI, -1, NULL))) uri = "."; turi = makeshownuri(uri); if((file = strrchr(turi, '/')) != NULL) file++; title = resdoc->doc ? est_doc_attr(resdoc->doc, ESTDATTRTITLE) : cbmapget(resdoc->attrs, ESTDATTRTITLE, -1, NULL); if(!title) title = resdoc->doc ? est_doc_attr(resdoc->doc, DATTRLFILE) : cbmapget(resdoc->attrs, DATTRLFILE, -1, NULL); if(!title) title = file; if(!title || title[0] == '\0') title = "(no title)"; author = resdoc->doc ? est_doc_attr(resdoc->doc, ESTDATTRAUTHOR) : cbmapget(resdoc->attrs, ESTDATTRAUTHOR, -1, NULL); if(!author || author[0] == '\0') author = "(anonymous)"; type = resdoc->doc ? est_doc_attr(resdoc->doc, ESTDATTRTYPE) : cbmapget(resdoc->attrs, ESTDATTRTYPE, -1, NULL); if(!type || type[0] == '\0') type = DEFMIMETYPE; vbuf = resdoc->doc ? est_doc_attr(resdoc->doc, ESTDATTRMDATE) : cbmapget(resdoc->attrs, ESTDATTRMDATE, -1, NULL); mtime = vbuf && vbuf[0] != '\0' ? cbstrmktime(vbuf) : node->mtime; cbdatumprintf(datum, "\n", turi); cbdatumprintf(datum, "%@\n", title); cbdatumprintf(datum, "%@\n", turi); cbdatumprintf(datum, "%@\n", title); vbuf = resdoc->doc ? est_doc_attr(resdoc->doc, ESTDATTRGENRE) : cbmapget(resdoc->attrs, ESTDATTRGENRE, -1, NULL); if(vbuf && vbuf[0] != '\0') cbdatumprintf(datum, "%@\n", vbuf); cbdatumprintf(datum, "%@\n", author); dstr = cbdatestrwww(mtime, 0); cbdatumprintf(datum, "%@\n", dstr); free(dstr); cbdatumprintf(datum, "%@\n", type); vbuf = resdoc->doc ? est_doc_attr(resdoc->doc, ESTDATTRLANG) : cbmapget(resdoc->attrs, ESTDATTRLANG, -1, NULL); if(vbuf && vbuf[0] != '\0') cbdatumprintf(datum, "%@\n", vbuf); if(g_snipwwidth > 0){ cbdatumprintf(datum, ""); snippet = resdoc->doc ? est_doc_make_snippet(resdoc->doc, words, g_snipwwidth, g_sniphwidth, g_snipawidth) : NULL; lines = cbsplit(snippet ? snippet: resdoc->body, -1, "\n"); ld = TRUE; for(i = 0; i < cblistnum(lines); i++){ vbuf = cblistval(lines, i, &vsiz); word = cbmemdup(vbuf, vsiz); if(vsiz < 1){ if(!ld) cbdatumprintf(datum, " ... "); ld = TRUE; } else if((pv = strchr(word, '\t')) != NULL){ *pv = '\0'; cbdatumprintf(datum, "%@", word); ld = FALSE; } else { cbdatumprintf(datum, "%@", word); ld = FALSE; } free(word); } cblistclose(lines); free(snippet); cbdatumprintf(datum, "\n"); } vbuf = resdoc->doc ? est_doc_attr(resdoc->doc, DATTRNDURL) : cbmapget(resdoc->attrs, DATTRNDURL, -1, NULL); if(vbuf && vbuf[0] != '\0') cbdatumprintf(datum, "%@\n", vbuf); vbuf = resdoc->doc ? est_doc_attr(resdoc->doc, DATTRNDLABEL) : cbmapget(resdoc->attrs, DATTRNDLABEL, -1, NULL); if(vbuf && vbuf[0] != '\0') cbdatumprintf(datum, "%@\n", vbuf); vbuf = resdoc->doc ? est_doc_attr(resdoc->doc, DATTRNDSCORE) : cbmapget(resdoc->attrs, DATTRNDSCORE, -1, NULL); if(vbuf && vbuf[0] != '\0') cbdatumprintf(datum, "%@\n", vbuf); vbuf = resdoc->doc ? est_doc_attr(resdoc->doc, ESTDATTRID) : cbmapget(resdoc->attrs, ESTDATTRID, -1, NULL); if(vbuf && vbuf[0] != '\0') cbdatumprintf(datum, "%@\n", vbuf); cbdatumprintf(datum, "\n"); free(turi); } /* make a URI to be shown */ static char *makeshownuri(const char *uri){ char *turi, *bef, *aft, *pv, *nuri; int i; turi = cbmemdup(uri, -1); for(i = 0; i < cblistnum(g_uireplaces); i++){ bef = cbmemdup(cblistval(g_uireplaces, i, NULL), -1); if((pv = strstr(bef, "{{!}}")) != NULL){ *pv = '\0'; aft = pv + 5; } else { aft = ""; } nuri = est_regex_replace(turi, bef, aft); free(turi); turi = nuri; free(bef); } return turi; } /* send the result of the search command */ static void sendnodecmdinform(int clsock, REQUEST *req, NODE *node){ CBDATUM *datum; const char *kbuf; if(est_mtdb_cache_usage(node->db) >= g_helpershift && sendnodecmdinformhelper(clsock, req, node)) return; if(pthread_mutex_lock(&(node->mutex)) != 0){ log_print(LL_ERROR, "locking failed"); senderror(clsock, req, 500, "Internal Server Error (locking failed)"); return; } datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: %s; charset=UTF-8\r\n", ESTINFORMTYPE); cbdatumprintf(datum, "\r\n"); cbdatumprintf(datum, "%s\t%s\t%d\t%d\t%.0f\n", node->name, node->label, est_mtdb_doc_num(node->db), est_mtdb_word_num(node->db), est_mtdb_size(node->db)); cbdatumprintf(datum, "\n"); cbmapiterinit(node->admins); while((kbuf = cbmapiternext(node->admins, NULL)) != NULL){ if(kbuf[0] != '\0') cbdatumprintf(datum, "%s\n", kbuf); } cbdatumprintf(datum, "\n"); cbmapiterinit(node->users); while((kbuf = cbmapiternext(node->users, NULL)) != NULL){ if(kbuf[0] != '\0') cbdatumprintf(datum, "%s\n", kbuf); } cbdatumprintf(datum, "\n"); cbmapiterinit(node->links); while((kbuf = cbmapiternext(node->links, NULL)) != NULL){ if(kbuf[0] != '\0') cbdatumprintf(datum, "%s\t%s\n", kbuf, cbmapiterval(kbuf, NULL)); } est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (inform)", req->claddr, req->clport); if(pthread_mutex_unlock(&(node->mutex)) != 0) log_print(LL_ERROR, "unlocking failed"); } /* send the result of the inform helper command */ static int sendnodecmdinformhelper(int clsock, REQUEST *req, NODE *node){ CBDATUM *datum; char *dbuf, *ebuf, dbpath[URIBUFSIZ], opath[URIBUFSIZ]; const char *kbuf; int i, dsiz, err, dnum, wnum; double fsiz; if(pthread_mutex_lock(&(node->mutex)) != 0){ log_print(LL_ERROR, "locking failed"); return FALSE; } datum = cbdatumopen(NULL, -1); sprintf(dbpath, "%s%c%s%c%s", g_rootdir, ESTPATHCHR, NODEDIR, ESTPATHCHR, node->name); cbdatumprintf(datum, "%s \"%s\"", INFORMHELPER, dbpath); sprintf(opath, "%s%chelper-%d", dbpath, ESTPATHCHR, g_accesscount); cbdatumprintf(datum, " \"%s\"", opath); log_print(LL_DEBUG, "[%s:%d]: calling the inform helper: %s", req->claddr, req->clport, cbdatumptr(datum)); for(i = 0; i < HELPERTRYNUM; i++){ system(cbdatumptr(datum)); if((dbuf = cbreadfile(opath, &dsiz)) != NULL) break; est_usleep(1000 * 100); } cbdatumclose(datum); err = FALSE; if(dbuf){ datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: %s; charset=UTF-8\r\n", ESTINFORMTYPE); ebuf = cbdatestrhttp(node->mtime, 0); cbdatumprintf(datum, "Last-Modified: %s\r\n", ebuf); free(ebuf); cbdatumprintf(datum, "\r\n"); kbuf = dbuf; dnum = atoi(kbuf); wnum = 0; fsiz = 0.0; if((kbuf = strchr(kbuf, '\t')) != NULL){ kbuf++; wnum = atoi(kbuf); if((kbuf = strchr(kbuf, '\t')) != NULL){ kbuf++; fsiz = strtod(kbuf, NULL); } } cbdatumprintf(datum, "%s\t%s\t%d\t%d\t%.0f\n", node->name, node->label, dnum, wnum, fsiz); cbdatumprintf(datum, "\n"); cbmapiterinit(node->admins); while((kbuf = cbmapiternext(node->admins, NULL)) != NULL){ if(kbuf[0] != '\0') cbdatumprintf(datum, "%s\n", kbuf); } cbdatumprintf(datum, "\n"); cbmapiterinit(node->users); while((kbuf = cbmapiternext(node->users, NULL)) != NULL){ if(kbuf[0] != '\0') cbdatumprintf(datum, "%s\n", kbuf); } cbdatumprintf(datum, "\n"); cbmapiterinit(node->links); while((kbuf = cbmapiternext(node->links, NULL)) != NULL){ if(kbuf[0] != '\0') cbdatumprintf(datum, "%s\t%s\n", kbuf, cbmapiterval(kbuf, NULL)); } est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); free(dbuf); log_print(LL_DEBUG, "[%s:%d]: 200 OK (inform-helper)", req->claddr, req->clport); } else { log_print(LL_WARN, "[%s:%d]: the inform helper failed", req->claddr, req->clport); err = TRUE; } unlink(opath); if(pthread_mutex_unlock(&(node->mutex)) != 0) log_print(LL_ERROR, "unlocking failed"); return err ? FALSE : TRUE; } /* send the result of the cacheusage command */ static void sendnodecmdcacheusage(int clsock, REQUEST *req, NODE *node){ CBDATUM *datum; if(pthread_mutex_lock(&(node->mutex)) != 0){ log_print(LL_ERROR, "locking failed"); senderror(clsock, req, 500, "Internal Server Error (locking failed)"); return; } datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); cbdatumprintf(datum, "%.6f\n", est_mtdb_cache_usage(node->db)); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (cacheusage)", req->claddr, req->clport); if(pthread_mutex_unlock(&(node->mutex)) != 0) log_print(LL_ERROR, "unlocking failed"); } /* send the result of the search command */ static void sendnodecmdsearch(int clsock, REQUEST *req, NODE *node){ pthread_t lth, *rths; TARGLCSRCH ltarg; TARGRMSRCH *rtargs; RESMAP *resmap; RESDOC **resdocs; ESTCOND *cond; CBMAP *hints; CBDATUM *datum; const char *tmp, *url, *label, *kbuf, *phrase, *order, *distinct; char *myurl, *dstr, name[NUMBUFSIZ], masks[LINKMASKMAX+1], *zbuf; int i, num, max, depth, wwidth, hwidth, awidth, skip, dnum, wnum, hnum, end, ksiz, rnum, zsiz; double curtime; time_t mtime; myurl = cbsprintf("%s%s%s", req->prefix, NODEPREFIX, node->name); if(islooproute(myurl, req)){ log_print(LL_DEBUG, "[%s:%d]: omitting request loop (self): %s", req->claddr, req->clport, myurl); free(myurl); senderror(clsock, req, 400, "Bad Request (the request loops)"); return; } if(est_mtdb_cache_usage(node->db) >= g_helpershift && (!(tmp = cbmapget(req->params, "depth", -1, NULL)) || atoi(tmp) < 1 || cbmaprnum(node->links) < 1) && sendnodecmdsearchhelper(clsock, req, node, myurl)){ free(myurl); return; } if(pthread_mutex_lock(&(node->mutex)) != 0){ log_print(LL_ERROR, "locking failed"); senderror(clsock, req, 500, "Internal Server Error (locking failed)"); return; } cond = est_cond_new(); max = DEFMAXSRCH; depth = 0; wwidth = g_snipwwidth; hwidth = g_sniphwidth; awidth = g_snipawidth; skip = 0; if((tmp = cbmapget(req->params, "skip", -1, NULL)) != NULL && (num = atoi(tmp)) > 0) skip = num; if((tmp = cbmapget(req->params, "phrase", -1, NULL)) != NULL && tmp[0] != '\0') est_cond_set_phrase(cond, tmp); if((tmp = cbmapget(req->params, "attr", -1, NULL)) != NULL && tmp[0] != '\0') est_cond_add_attr(cond, tmp); for(i = 0; i <= CONDATTRMAX; i++){ num = sprintf(name, "attr%d", i); if((tmp = cbmapget(req->params, name, num, NULL)) != NULL && tmp[0] != '\0') est_cond_add_attr(cond, tmp); } if((tmp = cbmapget(req->params, "order", -1, NULL)) != NULL && tmp[0] != '\0') est_cond_set_order(cond, tmp); if((tmp = cbmapget(req->params, "max", -1, NULL)) != NULL && (num = atoi(tmp)) >= 0) max = num; max = max > g_searchmax ? g_searchmax : max; if((tmp = cbmapget(req->params, "options", -1, NULL)) != NULL && (num = atoi(tmp)) > 0) est_cond_set_options(cond, num); if((tmp = cbmapget(req->params, "auxiliary", -1, NULL)) != NULL) est_cond_set_auxiliary(cond, atoi(tmp)); if((tmp = cbmapget(req->params, "distinct", -1, NULL)) != NULL && tmp[0] != '\0') est_cond_set_distinct(cond, tmp); if((tmp = cbmapget(req->params, "depth", -1, NULL)) != NULL && (num = atoi(tmp)) > 0) depth = num; if(depth >= g_searchdepth) depth = g_searchdepth; if((tmp = cbmapget(req->params, "wwidth", -1, NULL)) != NULL) wwidth = atoi(tmp); if((tmp = cbmapget(req->params, "hwidth", -1, NULL)) != NULL && (num = atoi(tmp)) >= 0) hwidth = num; if((tmp = cbmapget(req->params, "awidth", -1, NULL)) != NULL && (num = atoi(tmp)) >= 0) awidth = num; if((tmp = cbmapget(req->params, "mask", -1, NULL)) != NULL && tmp[0] != '\0'){ num = atoi(tmp); for(i = 0; i <= LINKMASKMAX; i++){ masks[i] = num & (1 << i); } } else if((tmp = cbmapget(req->params, "allmask", -1, NULL)) != NULL && tmp[0] != '\0'){ memset(masks, 1, LINKMASKMAX+1); for(i = 0; i <= LINKMASKMAX; i++){ num = sprintf(name, "nomask%d", i); if((tmp = cbmapget(req->params, name, num, NULL)) != NULL && tmp[0] != '\0') masks[i] = 0; } } else { memset(masks, 0, LINKMASKMAX+1); if(!(tmp = cbmapget(req->params, "nomask", -1, NULL)) || tmp[0] == '\0'){ for(i = 0; i <= LINKMASKMAX; i++){ num = sprintf(name, "mask%d", i); if((tmp = cbmapget(req->params, name, num, NULL)) != NULL && tmp[0] != '\0') masks[i] = 1; } } } resmap = resmap_new(); hints = cbmapopenex(MINIBNUM); curtime = est_gettimeofday(); ltarg.req = req; ltarg.alive = TRUE; ltarg.cond = est_cond_dup(cond); ltarg.hints = hints; ltarg.max = max + skip + 1; ltarg.node = node; ltarg.resmap = resmap; ltarg.words = cblistopen(); ltarg.hnum = 0; ltarg.mhnum = 0; ltarg.itime = 0.0; ltarg.etime = 0.0; if(masks[0]){ ltarg.alive = FALSE; } else if(g_stmode){ searchlocal(<arg); ltarg.alive = FALSE; } else if(pthread_create(<h, NULL, searchlocal, <arg) != 0){ log_print(LL_WARN, "creating thread failed"); ltarg.alive = FALSE; } rths = cbmalloc(cbmaprnum(node->links) * sizeof(pthread_t) + 1); rtargs = cbmalloc(cbmaprnum(node->links) * sizeof(TARGRMSRCH) + 1); cbmapiterinit(node->links); for(i = 0; (url = cbmapiternext(node->links, NULL)) != NULL; i++){ rtargs[i].req = req; rtargs[i].alive = TRUE; rtargs[i].myurl = myurl; rtargs[i].cond = est_cond_dup(cond); rtargs[i].hints = hints; rtargs[i].max = max + skip + 1; rtargs[i].node = node; rtargs[i].resmap = resmap; rtargs[i].url = url; label = cbmapiterval(url, NULL); if((tmp = strchr(label, '\t')) != NULL){ rtargs[i].label = cbmemdup(label, tmp - label); rtargs[i].credit = atoi(tmp + 1); } else { rtargs[i].label = cbmemdup(label, -1); rtargs[i].credit = 0; } rtargs[i].depth = depth; rtargs[i].wwidth = wwidth; rtargs[i].hwidth = hwidth; rtargs[i].awidth = awidth; rtargs[i].hnum = 0; rtargs[i].dnum = 0; rtargs[i].wnum = 0; rtargs[i].etime = 0.0; rtargs[i].size = 0.0; rtargs[i].mtime = 0; if(depth < 1 || (i < LINKMASKMAX && masks[i+1])){ rtargs[i].alive = FALSE; rtargs[i].hnum = -1; rtargs[i].dnum = -1; rtargs[i].wnum = -1; rtargs[i].etime = -1.0; rtargs[i].size = -1.0; } else if(g_stmode){ searchremote(&rtargs[i]); rtargs[i].alive = FALSE; } else if(pthread_create(rths + i, NULL, searchremote, rtargs + i) != 0){ log_print(LL_WARN, "creating thread failed"); rtargs[i].alive = FALSE; } } if(pthread_mutex_unlock(&(node->mutex)) != 0) log_print(LL_ERROR, "unlocking failed"); dnum = 0; wnum = 0; mtime = node->mtime; if(ltarg.alive){ if(pthread_join(lth, NULL) == 0){ dnum = est_mtdb_doc_num(node->db); wnum = est_mtdb_word_num(node->db); } else { log_print(LL_ERROR, "joining thread failed"); } } else if(g_stmode){ dnum = est_mtdb_doc_num(node->db); wnum = est_mtdb_word_num(node->db); } for(i = 0; i < cbmaprnum(node->links); i++){ if(rtargs[i].alive){ if(pthread_join(rths[i], NULL) == 0){ dnum += rtargs[i].dnum; wnum += rtargs[i].wnum; if(rtargs[i].mtime > mtime) mtime = rtargs[i].mtime; } else { log_print(LL_ERROR, "joining thread failed"); } } else if(g_stmode && depth > 0){ dnum += rtargs[i].dnum; wnum += rtargs[i].wnum; if(rtargs[i].mtime > mtime) mtime = rtargs[i].mtime; } } hnum = (tmp = cbmapget(hints, "", 0, NULL)) ? atoi(tmp) : 0; hnum -= ltarg.mhnum; if(hnum < 0) hnum = 0; end = max + skip; curtime = est_gettimeofday() - curtime; datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: %s; charset=UTF-8\r\n", ESTSEARCHTYPE); if(req->gzip){ cbdatumprintf(datum, "Content-Encoding: gzip\r\n"); } else if(req->deflate){ cbdatumprintf(datum, "Content-Encoding: deflate\r\n"); } dstr = cbdatestrhttp(mtime, 0); cbdatumprintf(datum, "Last-Modified: %s\r\n", dstr); free(dstr); cbdatumprintf(datum, "\r\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumsetsize(datum, 0); cbdatumprintf(datum, "%s\n", g_bordstr); cbdatumprintf(datum, "VERSION\t%s\n", _EST_PROTVER); cbdatumprintf(datum, "NODE\t%s\n", myurl); cbdatumprintf(datum, "HIT\t%d\n", hnum); cbmapiterinit(hints); num = 1; while((kbuf = cbmapiternext(hints, &ksiz)) != NULL){ if(ksiz < 1) continue; cbdatumprintf(datum, "HINT#%d\t%s\t%s\n", num, kbuf, cbmapiterval(kbuf, NULL)); num++; } cbdatumprintf(datum, "DOCNUM\t%d\n", dnum); cbdatumprintf(datum, "WORDNUM\t%d\n", wnum); cbdatumprintf(datum, "TIME\t%.6f\n", curtime / 1000.0); if(ltarg.itime >= 0.0) cbdatumprintf(datum, "TIME#i\t%.6f\n", ltarg.itime / 1000.0); if(ltarg.etime >= 0.0) cbdatumprintf(datum, "TIME#0\t%.6f\n", ltarg.etime / 1000.0); for(i = 0; i < cbmaprnum(node->links); i++){ if(rtargs[i].etime >= 0.0) cbdatumprintf(datum, "TIME#%d\t%.6f\n", i + 1, rtargs[i].etime / 1000.0); } cbdatumprintf(datum, "LINK#0\t%s\t", myurl); cbdatumprintf(datum, "%s\t%d\t%d\t%d\t%.0f\t%d\n", node->label, SELFCREDIT, est_mtdb_doc_num(node->db), est_mtdb_word_num(node->db), est_mtdb_size(node->db), ltarg.hnum - ltarg.mhnum); for(i = 0; i < cbmaprnum(node->links); i++){ cbdatumprintf(datum, "LINK#%d\t%s\t%s\t%d\t%d\t%d\t%.0f\t%d\n", i + 1, rtargs[i].url, rtargs[i].label, rtargs[i].credit, rtargs[i].dnum, rtargs[i].wnum, rtargs[i].size, rtargs[i].hnum); } cbdatumprintf(datum, "VIEW\tSNIPPET\n"); cbdatumprintf(datum, "\n"); phrase = est_cond_phrase(cond); order = est_cond_order(cond); if(!order && phrase && cbstrfwmatch(phrase, ESTOPSIMILAR)) order = DATTRNDSCORE " " ESTORDNUMD; distinct = depth > 0 && cbmaprnum(node->links) > 0 ? est_cond_distinct(cond) : NULL; resdocs = resmap_list(resmap, &rnum, order, distinct); for(i = skip; i < rnum && i < end; i++){ cbdatumprintf(datum, "%s\n", g_bordstr); catdocdata(datum, node, resdocs[i], ltarg.words, wwidth, hwidth, awidth); } free(resdocs); cbdatumprintf(datum, "%s:END\n", g_bordstr); if(req->gzip){ if((zbuf = est_deflate(cbdatumptr(datum), cbdatumsize(datum), &zsiz, 1)) != NULL){ est_sock_send_all(clsock, zbuf, zsiz); free(zbuf); } } else if(req->deflate){ if((zbuf = est_deflate(cbdatumptr(datum), cbdatumsize(datum), &zsiz, 0)) != NULL){ est_sock_send_all(clsock, zbuf, zsiz); free(zbuf); } } else { est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); } cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (search)", req->claddr, req->clport); cblistclose(ltarg.words); est_cond_delete(ltarg.cond); for(i = 0; i < cbmaprnum(node->links); i++){ free(rtargs[i].label); est_cond_delete(rtargs[i].cond); } free(rtargs); free(rths); cbmapclose(hints); resmap_delete(resmap); est_cond_delete(cond); free(myurl); } /* send the result of the search helper command */ static int sendnodecmdsearchhelper(int clsock, REQUEST *req, NODE *node, const char *myurl){ CBDATUM *datum; char *dbuf, *ebuf, dbpath[URIBUFSIZ], opath[URIBUFSIZ]; int i, dsiz, err; if(pthread_mutex_lock(&(node->mutex)) != 0){ log_print(LL_ERROR, "locking failed"); return FALSE; } datum = cbdatumopen(NULL, -1); sprintf(dbpath, "%s%c%s%c%s", g_rootdir, ESTPATHCHR, NODEDIR, ESTPATHCHR, node->name); cbdatumprintf(datum, "%s \"%s\"", SEARCHHELPER, dbpath); dbuf = cbmapdump(req->params, &dsiz); ebuf = cbbaseencode(dbuf, dsiz); sprintf(opath, "%s%chelper-%d", dbpath, ESTPATHCHR, g_accesscount); cbdatumprintf(datum, " \"%s\" \"%s\"", opath, ebuf); free(ebuf); free(dbuf); ebuf = cbbaseencode(myurl, -1); cbdatumprintf(datum, " \"%s\"", ebuf); free(ebuf); ebuf = cbbaseencode(node->label, -1); cbdatumprintf(datum, " \"%s\"", ebuf); free(ebuf); cbdatumprintf(datum, " \"%d\" \"%d\" \"%d\" \"%d\" \"%d\"", g_rateuri, g_mergemethod, g_scoreexpr, g_searchmax, g_wildmax); cbdatumprintf(datum, " \"%d\" \"%d\" \"%d\" \"%d\" \"%d\"", g_snipwwidth, g_sniphwidth, g_snipawidth, g_scancheck, g_smlrvnum); log_print(LL_DEBUG, "[%s:%d]: calling the search helper: %s", req->claddr, req->clport, cbdatumptr(datum)); for(i = 0; i < HELPERTRYNUM; i++){ system(cbdatumptr(datum)); if((dbuf = cbreadfile(opath, &dsiz)) != NULL) break; est_usleep(1000 * 100); } cbdatumclose(datum); err = FALSE; if(dbuf){ datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: %s; charset=UTF-8\r\n", ESTSEARCHTYPE); ebuf = cbdatestrhttp(node->mtime, 0); cbdatumprintf(datum, "Last-Modified: %s\r\n", ebuf); free(ebuf); cbdatumprintf(datum, "\r\n"); cbdatumcat(datum, dbuf, dsiz); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); free(dbuf); log_print(LL_DEBUG, "[%s:%d]: 200 OK (search-helper)", req->claddr, req->clport); } else { log_print(LL_WARN, "[%s:%d]: the search helper failed", req->claddr, req->clport); err = TRUE; } unlink(opath); if(pthread_mutex_unlock(&(node->mutex)) != 0) log_print(LL_ERROR, "unlocking failed"); return err ? FALSE : TRUE; } /* send the result of the list command */ static void sendnodecmdlist(int clsock, REQUEST *req, NODE *node){ ESTDOC *doc; CBDATUM *head, *body; const char *tmp, *prev; char *zbuf; int max, num, cnt, id, zsiz; max = DEFMAXSRCH; if((tmp = cbmapget(req->params, "max", -1, NULL)) != NULL && (num = atoi(tmp)) >= 0) max = num; max = max > g_searchmax ? g_searchmax : max; prev = cbmapget(req->params, "prev", -1, NULL); if(pthread_mutex_lock(&(node->mutex)) != 0){ log_print(LL_ERROR, "locking failed"); senderror(clsock, req, 500, "Internal Server Error (locking failed)"); return; } body = cbdatumopen(NULL, -1); est_mtdb_iter_init(node->db, prev); cnt = 0; while(cnt < max && (id = est_mtdb_iter_next(node->db)) > 0){ if(!(doc = est_mtdb_get_doc(node->db, id, ESTGDNOTEXT))) continue; tmp = est_doc_attr(doc, ESTDATTRID); cbdatumcat(body, tmp ? tmp : "", -1); cbdatumcat(body, "\t", 1); tmp = est_doc_attr(doc, ESTDATTRURI); cbdatumcat(body, tmp ? tmp : "", -1); cbdatumcat(body, "\t", 1); tmp = est_doc_attr(doc, ESTDATTRDIGEST); cbdatumcat(body, tmp ? tmp : "", -1); cbdatumcat(body, "\t", 1); tmp = est_doc_attr(doc, ESTDATTRCDATE); cbdatumcat(body, tmp ? tmp : "", -1); cbdatumcat(body, "\t", 1); tmp = est_doc_attr(doc, ESTDATTRMDATE); cbdatumcat(body, tmp ? tmp : "", -1); cbdatumcat(body, "\t", 1); tmp = est_doc_attr(doc, ESTDATTRADATE); cbdatumcat(body, tmp ? tmp : "", -1); cbdatumcat(body, "\t", 1); tmp = est_doc_attr(doc, ESTDATTRTITLE); cbdatumcat(body, tmp ? tmp : "", -1); cbdatumcat(body, "\t", 1); tmp = est_doc_attr(doc, ESTDATTRAUTHOR); cbdatumcat(body, tmp ? tmp : "", -1); cbdatumcat(body, "\t", 1); tmp = est_doc_attr(doc, ESTDATTRTYPE); cbdatumcat(body, tmp ? tmp : "", -1); cbdatumcat(body, "\t", 1); tmp = est_doc_attr(doc, ESTDATTRLANG); cbdatumcat(body, tmp ? tmp : "", -1); cbdatumcat(body, "\t", 1); tmp = est_doc_attr(doc, ESTDATTRGENRE); cbdatumcat(body, tmp ? tmp : "", -1); cbdatumcat(body, "\t", 1); tmp = est_doc_attr(doc, ESTDATTRSIZE); cbdatumcat(body, tmp ? tmp : "", -1); cbdatumcat(body, "\t", 1); tmp = est_doc_attr(doc, ESTDATTRWEIGHT); cbdatumcat(body, tmp ? tmp : "", -1); cbdatumcat(body, "\t", 1); tmp = est_doc_attr(doc, ESTDATTRMISC); cbdatumcat(body, tmp ? tmp : "", -1); cbdatumcat(body, "\n", 1); est_doc_delete(doc); cnt++; } if(pthread_mutex_unlock(&(node->mutex)) != 0) log_print(LL_ERROR, "unlocking failed"); head = cbdatumopen(NULL, -1); cbdatumprintf(head, "HTTP/1.0 200 OK\r\n"); addservinfo(head, req->now, 0); cbdatumprintf(head, "Content-Type: %s; charset=UTF-8\r\n", ESTLISTTYPE); if(req->gzip){ cbdatumprintf(head, "Content-Encoding: gzip\r\n"); } else if(req->deflate){ cbdatumprintf(head, "Content-Encoding: deflate\r\n"); } cbdatumprintf(head, "\r\n"); est_sock_send_all(clsock, cbdatumptr(head), cbdatumsize(head)); cbdatumclose(head); if(req->gzip){ if((zbuf = est_deflate(cbdatumptr(body), cbdatumsize(body), &zsiz, 1)) != NULL){ est_sock_send_all(clsock, zbuf, zsiz); free(zbuf); } } else if(req->deflate){ if((zbuf = est_deflate(cbdatumptr(body), cbdatumsize(body), &zsiz, 0)) != NULL){ est_sock_send_all(clsock, zbuf, zsiz); free(zbuf); } } else { est_sock_send_all(clsock, cbdatumptr(body), cbdatumsize(body)); } cbdatumclose(body); log_print(LL_DEBUG, "[%s:%d]: 200 OK (list)", req->claddr, req->clport); } /* send the result of the get_doc command */ static void sendnodecmdgetdoc(int clsock, REQUEST *req, NODE *node){ ESTDOC *doc; CBDATUM *datum; const char *tmp, *uri; char *draft, *zbuf; int id, zsiz; id = (tmp = cbmapget(req->params, "id", -1, NULL)) ? atoi(tmp) : 0; if(!(uri = cbmapget(req->params, "uri", -1, NULL))) uri = ""; if(id < 1 && uri[0] == '\0'){ senderror(clsock, req, 400, "Bad Request (the parameters lack)"); return; } if(est_mtdb_cache_usage(node->db) >= g_helpershift && sendnodecmdgetdochelper(clsock, req, node, id, uri)) return; if(id < 1) id = est_mtdb_uri_to_id(node->db, uri); if(id > 0 && (doc = est_mtdb_get_doc(node->db, id, 0)) != NULL){ setdocorigin(doc, req, node, -1); draft = est_doc_dump_draft(doc); datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: %s; charset=UTF-8\r\n", ESTDRAFTTYPE); if(req->gzip){ cbdatumprintf(datum, "Content-Encoding: gzip\r\n"); } else if(req->deflate){ cbdatumprintf(datum, "Content-Encoding: deflate\r\n"); } cbdatumprintf(datum, "\r\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumsetsize(datum, 0); cbdatumcat(datum, draft, -1); if(req->gzip){ if((zbuf = est_deflate(cbdatumptr(datum), cbdatumsize(datum), &zsiz, 1)) != NULL){ est_sock_send_all(clsock, zbuf, zsiz); free(zbuf); } } else if(req->deflate){ if((zbuf = est_deflate(cbdatumptr(datum), cbdatumsize(datum), &zsiz, 0)) != NULL){ est_sock_send_all(clsock, zbuf, zsiz); free(zbuf); } } else { est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); } cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (get_doc)", req->claddr, req->clport); free(draft); est_doc_delete(doc); } else { if(est_mtdb_fatal(node->db)) log_print(LL_ERROR, "DB-ERROR: %s", est_err_msg(est_mtdb_error(node->db))); senderror(clsock, req, 400, "Bad Request (maybe, the document does not exist)"); } } /* send the result of the get_doc helper command */ static int sendnodecmdgetdochelper(int clsock, REQUEST *req, NODE *node, int id, const char *uri){ ESTDOC *doc; CBDATUM *datum; char *dbuf, *ebuf, dbpath[URIBUFSIZ], opath[URIBUFSIZ], *draft; int i, dsiz, err; if(pthread_mutex_lock(&(node->mutex)) != 0){ log_print(LL_ERROR, "locking failed"); return FALSE; } datum = cbdatumopen(NULL, -1); sprintf(dbpath, "%s%c%s%c%s", g_rootdir, ESTPATHCHR, NODEDIR, ESTPATHCHR, node->name); cbdatumprintf(datum, "%s \"%s\"", GETDOCHELPER, dbpath); sprintf(opath, "%s%chelper-%d", dbpath, ESTPATHCHR, g_accesscount); cbdatumprintf(datum, " \"%s\"", opath); cbdatumprintf(datum, " \"%d\"", id); ebuf = cbbaseencode(uri, -1); cbdatumprintf(datum, " \"%s\"", ebuf); free(ebuf); log_print(LL_DEBUG, "[%s:%d]: calling the get_doc helper: %s", req->claddr, req->clport, cbdatumptr(datum)); for(i = 0; i < HELPERTRYNUM; i++){ system(cbdatumptr(datum)); if((dbuf = cbreadfile(opath, &dsiz)) != NULL) break; est_usleep(1000 * 100); } cbdatumclose(datum); err = FALSE; if(dbuf){ if(dsiz > 0){ datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: %s; charset=UTF-8\r\n", ESTDRAFTTYPE); ebuf = cbdatestrhttp(node->mtime, 0); cbdatumprintf(datum, "Last-Modified: %s\r\n", ebuf); free(ebuf); cbdatumprintf(datum, "\r\n"); doc = est_doc_new_from_draft(dbuf); setdocorigin(doc, req, node, -1); draft = est_doc_dump_draft(doc); cbdatumcat(datum, draft, -1); free(draft); free(doc); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (get_doc-helper)", req->claddr, req->clport); } else { senderror(clsock, req, 400, "Bad Request (maybe, the document does not exist)"); } free(dbuf); } else { log_print(LL_WARN, "[%s:%d]: the get_doc helper failed", req->claddr, req->clport); err = TRUE; } unlink(opath); if(pthread_mutex_unlock(&(node->mutex)) != 0) log_print(LL_ERROR, "unlocking failed"); return err ? FALSE : TRUE; } /* send the result of the get_doc_attr command */ static void sendnodecmdgetdocattr(int clsock, REQUEST *req, NODE *node){ CBDATUM *datum; const char *tmp, *uri, *attr; char *value; int id; id = (tmp = cbmapget(req->params, "id", -1, NULL)) ? atoi(tmp) : 0; if(!(uri = cbmapget(req->params, "uri", -1, NULL))) uri = ""; if(!(attr = cbmapget(req->params, "attr", -1, NULL))) attr = ""; if((id < 1 && uri[0] == '\0') || attr[0] == '\0'){ senderror(clsock, req, 400, "Bad Request (the parameters lack)"); return; } if(est_mtdb_cache_usage(node->db) >= g_helpershift && sendnodecmdgetdocattrhelper(clsock, req, node, id, uri, attr)) return; if(id < 1) id = est_mtdb_uri_to_id(node->db, uri); if(id > 0 && (value = est_mtdb_get_doc_attr(node->db, id, attr)) != NULL){ datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); cbdatumprintf(datum, "%s\n", value); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (get_doc_attr)", req->claddr, req->clport); free(value); } else { if(est_mtdb_fatal(node->db)) log_print(LL_ERROR, "DB-ERROR: %s", est_err_msg(est_mtdb_error(node->db))); senderror(clsock, req, 400, "Bad Request (maybe, the document or the attribute does not exist)"); } } /* send the result of the get_doc_attr helper command */ static int sendnodecmdgetdocattrhelper(int clsock, REQUEST *req, NODE *node, int id, const char *uri, const char *attr){ CBDATUM *datum; char *dbuf, *ebuf, dbpath[URIBUFSIZ], opath[URIBUFSIZ]; int i, dsiz, err; if(pthread_mutex_lock(&(node->mutex)) != 0){ log_print(LL_ERROR, "locking failed"); return FALSE; } datum = cbdatumopen(NULL, -1); sprintf(dbpath, "%s%c%s%c%s", g_rootdir, ESTPATHCHR, NODEDIR, ESTPATHCHR, node->name); cbdatumprintf(datum, "%s \"%s\"", GETDOCATTRHELPER, dbpath); sprintf(opath, "%s%chelper-%d", dbpath, ESTPATHCHR, g_accesscount); cbdatumprintf(datum, " \"%s\"", opath); cbdatumprintf(datum, " \"%d\"", id); ebuf = cbbaseencode(uri, -1); cbdatumprintf(datum, " \"%s\"", ebuf); free(ebuf); ebuf = cbbaseencode(attr, -1); cbdatumprintf(datum, " \"%s\"", ebuf); free(ebuf); log_print(LL_DEBUG, "[%s:%d]: calling the get_doc_attr helper: %s", req->claddr, req->clport, cbdatumptr(datum)); for(i = 0; i < HELPERTRYNUM; i++){ system(cbdatumptr(datum)); if((dbuf = cbreadfile(opath, &dsiz)) != NULL) break; est_usleep(1000 * 100); } cbdatumclose(datum); err = FALSE; if(dbuf){ if(strchr(dbuf, '\n')){ datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); ebuf = cbdatestrhttp(node->mtime, 0); cbdatumprintf(datum, "Last-Modified: %s\r\n", ebuf); free(ebuf); cbdatumprintf(datum, "\r\n"); cbdatumcat(datum, dbuf, dsiz); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (get_doc_attr-helper)", req->claddr, req->clport); } else { senderror(clsock, req, 400, "Bad Request (maybe, the document or the attribute does not exist)"); } free(dbuf); } else { log_print(LL_WARN, "[%s:%d]: the get_doc_attr helper failed", req->claddr, req->clport); err = TRUE; } unlink(opath); if(pthread_mutex_unlock(&(node->mutex)) != 0) log_print(LL_ERROR, "unlocking failed"); return err ? FALSE : TRUE; } /* send the result of the etch_doc command */ static void sendnodecmdetchdoc(int clsock, REQUEST *req, NODE *node){ ESTDOC *doc; CBMAP *kwords; CBDATUM *datum; const char *tmp, *uri, *kbuf; int id, ksiz; id = (tmp = cbmapget(req->params, "id", -1, NULL)) ? atoi(tmp) : 0; if(!(uri = cbmapget(req->params, "uri", -1, NULL))) uri = ""; if(id < 1 && uri[0] == '\0'){ senderror(clsock, req, 400, "Bad Request (the parameters lack)"); return; } if(est_mtdb_cache_usage(node->db) >= g_helpershift && sendnodecmdetchdochelper(clsock, req, node, id, uri)) return; if(id < 1) id = est_mtdb_uri_to_id(node->db, uri); kwords = NULL; if(id > 0){ kwords = est_mtdb_get_keywords(node->db, id); if(!kwords && (doc = est_mtdb_get_doc(node->db, id, 0)) != NULL){ kwords = est_mtdb_etch_doc(node->db, doc, g_smlrvnum > 0 ? g_smlrvnum : KWORDNUM); if(g_runmode == RM_NORMAL) est_mtdb_put_keywords(node->db, id, kwords, 1.0); est_doc_delete(doc); } } if(kwords){ datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); cbmapiterinit(kwords); while((kbuf = cbmapiternext(kwords, &ksiz)) != NULL){ cbdatumprintf(datum, "%s\t%s\n", kbuf, cbmapiterval(kbuf, NULL)); } est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (etch_doc)", req->claddr, req->clport); cbmapclose(kwords); } else { if(est_mtdb_fatal(node->db)) log_print(LL_ERROR, "DB-ERROR: %s", est_err_msg(est_mtdb_error(node->db))); senderror(clsock, req, 400, "Bad Request (maybe, the document does not exist)"); } } /* send the result of the etch_doc helper command */ static int sendnodecmdetchdochelper(int clsock, REQUEST *req, NODE *node, int id, const char *uri){ CBDATUM *datum; char *dbuf, *ebuf, dbpath[URIBUFSIZ], opath[URIBUFSIZ]; int i, dsiz, err; if(pthread_mutex_lock(&(node->mutex)) != 0){ log_print(LL_ERROR, "locking failed"); return FALSE; } datum = cbdatumopen(NULL, -1); sprintf(dbpath, "%s%c%s%c%s", g_rootdir, ESTPATHCHR, NODEDIR, ESTPATHCHR, node->name); cbdatumprintf(datum, "%s \"%s\"", ETCHDOCHELPER, dbpath); sprintf(opath, "%s%chelper-%d", dbpath, ESTPATHCHR, g_accesscount); cbdatumprintf(datum, " \"%s\"", opath); cbdatumprintf(datum, " \"%d\"", id); ebuf = cbbaseencode(uri, -1); cbdatumprintf(datum, " \"%s\"", ebuf); free(ebuf); cbdatumprintf(datum, " \"%d\"", g_smlrvnum > 0 ? g_smlrvnum : KWORDNUM); log_print(LL_DEBUG, "[%s:%d]: calling the etch_doc helper: %s", req->claddr, req->clport, cbdatumptr(datum)); for(i = 0; i < HELPERTRYNUM; i++){ system(cbdatumptr(datum)); if((dbuf = cbreadfile(opath, &dsiz)) != NULL) break; est_usleep(1000 * 100); } cbdatumclose(datum); err = FALSE; if(dbuf){ if(strchr(dbuf, '\n')){ datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: %s; charset=UTF-8\r\n", ESTDRAFTTYPE); ebuf = cbdatestrhttp(node->mtime, 0); cbdatumprintf(datum, "Last-Modified: %s\r\n", ebuf); free(ebuf); cbdatumprintf(datum, "\r\n"); cbdatumcat(datum, dbuf, dsiz); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (etch_doc-helper)", req->claddr, req->clport); } else { senderror(clsock, req, 400, "Bad Request (maybe, the document does not exist)"); } free(dbuf); } else { log_print(LL_WARN, "[%s:%d]: the etch_doc helper failed", req->claddr, req->clport); err = TRUE; } unlink(opath); if(pthread_mutex_unlock(&(node->mutex)) != 0) log_print(LL_ERROR, "unlocking failed"); return err ? FALSE : TRUE; } /* send the result of the uri_to_id command */ static void sendnodecmduritoid(int clsock, REQUEST *req, NODE *node){ CBDATUM *datum; const char *uri; int id; uri = cbmapget(req->params, "uri", -1, NULL); if(!uri){ senderror(clsock, req, 400, "Bad Request (the parameters lack)"); return; } if(est_mtdb_cache_usage(node->db) >= g_helpershift && sendnodecmduritoidhelper(clsock, req, node, uri)) return; if((id = est_mtdb_uri_to_id(node->db, uri)) > 0){ datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); cbdatumprintf(datum, "%d\n", id); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (uri_to_id)", req->claddr, req->clport); } else { if(est_mtdb_fatal(node->db)) log_print(LL_ERROR, "DB-ERROR: %s", est_err_msg(est_mtdb_error(node->db))); senderror(clsock, req, 400, "Bad Request (maybe, the URI is not registered)"); } } /* send the result of the inform helper command */ static int sendnodecmduritoidhelper(int clsock, REQUEST *req, NODE *node, const char *uri){ CBDATUM *datum; char *dbuf, *ebuf, dbpath[URIBUFSIZ], opath[URIBUFSIZ]; int i, dsiz, err; if(pthread_mutex_lock(&(node->mutex)) != 0){ log_print(LL_ERROR, "locking failed"); return FALSE; } datum = cbdatumopen(NULL, -1); sprintf(dbpath, "%s%c%s%c%s", g_rootdir, ESTPATHCHR, NODEDIR, ESTPATHCHR, node->name); cbdatumprintf(datum, "%s \"%s\"", URITOIDHELPER, dbpath); sprintf(opath, "%s%chelper-%d", dbpath, ESTPATHCHR, g_accesscount); cbdatumprintf(datum, " \"%s\"", opath); ebuf = cbbaseencode(uri, -1); cbdatumprintf(datum, " \"%s\"", ebuf); free(ebuf); log_print(LL_DEBUG, "[%s:%d]: calling the uri_to_id helper: %s", req->claddr, req->clport, cbdatumptr(datum)); for(i = 0; i < HELPERTRYNUM; i++){ system(cbdatumptr(datum)); if((dbuf = cbreadfile(opath, &dsiz)) != NULL) break; est_usleep(1000 * 100); } cbdatumclose(datum); err = FALSE; if(dbuf){ if(dsiz > 0){ datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); ebuf = cbdatestrhttp(node->mtime, 0); cbdatumprintf(datum, "Last-Modified: %s\r\n", ebuf); free(ebuf); cbdatumprintf(datum, "\r\n"); cbdatumcat(datum, dbuf, dsiz); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (uri_to_id-helper)", req->claddr, req->clport); } else { senderror(clsock, req, 400, "Bad Request (maybe, the URI is not registered)"); } free(dbuf); } else { log_print(LL_WARN, "[%s:%d]: the uri_to_id helper failed", req->claddr, req->clport); err = TRUE; } unlink(opath); if(pthread_mutex_unlock(&(node->mutex)) != 0) log_print(LL_ERROR, "unlocking failed"); return err ? FALSE : TRUE; } /* send the result of the pub_doc command */ static void sendnodecmdputdoc(int clsock, REQUEST *req, NODE *node){ ESTDOC *doc; CBDATUM *datum; CBMAP *kwords; const char *draft; double ratio; if(req->ctype && cbstrfwimatch(req->ctype, ESTDRAFTTYPE)){ draft = req->body; } else { draft = cbmapget(req->params, "draft", -1, NULL); } if(!draft){ senderror(clsock, req, 400, "Bad Request (the parameters lack)"); return; } doc = est_doc_new_from_draft(draft); est_doc_slim(doc, g_limittextsize); if(est_mtdb_put_doc(node->db, doc, ESTPDCLEAN)){ if(!est_doc_keywords(doc) && g_smlrvnum > 0){ if(g_extdelay < 0){ kwords = est_morph_etch_doc(doc, g_smlrvnum); est_mtdb_put_keywords(node->db, est_doc_id(doc), kwords, 1.0); cbmapclose(kwords); } else if(est_mtdb_doc_num(node->db) > g_extdelay){ kwords = est_mtdb_etch_doc(node->db, doc, g_smlrvnum); est_mtdb_put_keywords(node->db, est_doc_id(doc), kwords, 1.0); cbmapclose(kwords); } } node->mtime = req->now; node->dirty = TRUE; ratio = est_mtdb_used_cache_size(node->db) / g_cachesize; g_cacheratio = ratio > g_cacheratio ? ratio : g_cacheratio; datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); cbdatumprintf(datum, "OK\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (put_doc)", req->claddr, req->clport); } else { if(est_mtdb_fatal(node->db)) log_print(LL_ERROR, "DB-ERROR: %s", est_err_msg(est_mtdb_error(node->db))); if(!est_doc_attr(doc, ESTDATTRURI)){ senderror(clsock, req, 400, "Bad Request (maybe, the document is invalid)"); } else { senderror(clsock, req, 400, "Bad Request (maybe, the database has a fatal error)"); } } est_doc_delete(doc); } /* send the result of the out_doc command */ static void sendnodecmdoutdoc(int clsock, REQUEST *req, NODE *node){ CBDATUM *datum; const char *tmp, *uri; int id; id = (tmp = cbmapget(req->params, "id", -1, NULL)) ? atoi(tmp) : 0; if(!(uri = cbmapget(req->params, "uri", -1, NULL))) uri = ""; if(id < 1 && uri[0] == '\0'){ senderror(clsock, req, 400, "Bad Request (the parameters lack)"); return; } if(id < 1) id = est_mtdb_uri_to_id(node->db, uri); if(id > 0 && est_mtdb_out_doc(node->db, id, ESTODCLEAN)){ node->mtime = req->now; node->dirty = TRUE; datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); cbdatumprintf(datum, "OK\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (out_doc)", req->claddr, req->clport); } else { if(est_mtdb_fatal(node->db)) log_print(LL_ERROR, "DB-ERROR: %s", est_err_msg(est_mtdb_error(node->db))); senderror(clsock, req, 400, "Bad Request (maybe, the document does not exist)"); } } /* send the result of the edit_doc command */ static void sendnodecmdeditdoc(int clsock, REQUEST *req, NODE *node){ ESTDOC *doc; CBDATUM *datum; const char *draft; if(req->ctype && cbstrfwimatch(req->ctype, ESTDRAFTTYPE)){ draft = req->body; } else { draft = cbmapget(req->params, "draft", -1, NULL); } if(!draft){ senderror(clsock, req, 400, "Bad Request (the parameters lack)"); return; } doc = est_doc_new_from_draft(draft); if(est_mtdb_edit_doc(node->db, doc)){ node->mtime = req->now; datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); cbdatumprintf(datum, "OK\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (edit_doc)", req->claddr, req->clport); } else { if(est_mtdb_fatal(node->db)) log_print(LL_ERROR, "DB-ERROR: %s", est_err_msg(est_mtdb_error(node->db))); if(!est_doc_attr(doc, ESTDATTRID) || !est_doc_attr(doc, ESTDATTRURI)){ senderror(clsock, req, 400, "Bad Request (maybe, the document is invalid)"); } else { senderror(clsock, req, 400, "Bad Request (maybe, the database has a fatal error)"); } } est_doc_delete(doc); } /* send the result of the sync command */ static void sendnodecmdsync(int clsock, REQUEST *req, NODE *node){ CBDATUM *datum; if(est_mtdb_sync(node->db)){ node->mtime = req->now; datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); cbdatumprintf(datum, "OK\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (sync)", req->claddr, req->clport); } else { if(est_mtdb_fatal(node->db)) log_print(LL_ERROR, "DB-ERROR: %s", est_err_msg(est_mtdb_error(node->db))); senderror(clsock, req, 400, "Bad Request (maybe, the database has a fatal error)"); } } /* send the result of the optimize command */ static void sendnodecmdoptimize(int clsock, REQUEST *req, NODE *node){ CBDATUM *datum; if(est_mtdb_optimize(node->db, ESTOPTNOPURGE)){ node->mtime = req->now; datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); cbdatumprintf(datum, "OK\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (optimize)", req->claddr, req->clport); } else { if(est_mtdb_fatal(node->db)) log_print(LL_ERROR, "DB-ERROR: %s", est_err_msg(est_mtdb_error(node->db))); senderror(clsock, req, 400, "Bad Request (maybe, the database has a fatal error)"); } } /* send the result of the _set_user command */ static void sendnodecmdsetuser(int clsock, REQUEST *req, NODE *node){ CBDATUM *datum; const char *name, *tmp; int mode; name = cbmapget(req->params, "name", -1, NULL); mode = (tmp = cbmapget(req->params, "mode", -1, NULL)) != NULL && tmp[0] != '\0' ? atoi(tmp) : -1; if(!name || name[0] == '\0' || mode < 0 || mode > 2){ senderror(clsock, req, 400, "Bad Request (the parameters lack)"); return; } if(!check_alnum_name(name)){ senderror(clsock, req, 400, "Bad Request (the name is invalid)"); return; } switch(mode){ case 1: cbmapput(node->admins, name, -1, "", 0, FALSE); break; case 2: cbmapput(node->users, name, -1, "", 0, FALSE); break; default: cbmapout(node->admins, name, -1); cbmapout(node->users, name, -1); break; } datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); cbdatumprintf(datum, "OK\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (_set_user)", req->claddr, req->clport); } /* send the result of the _set_link command */ static void sendnodecmdsetlink(int clsock, REQUEST *req, NODE *node){ CBDATUM *datum; const char *url, *label, *tmp; int credit; url = cbmapget(req->params, "url", -1, NULL); label = cbmapget(req->params, "label", -1, NULL); credit = (tmp = cbmapget(req->params, "credit", -1, NULL)) ? atoi(tmp) : -1; if(!url || url[0] == '\0'){ senderror(clsock, req, 400, "Bad Request (the parameters lack)"); return; } node_set_link(node, url, label, credit); datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: text/plain; charset=UTF-8\r\n"); cbdatumprintf(datum, "\r\n"); cbdatumprintf(datum, "OK\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (_set_link)", req->claddr, req->clport); } /* send the result of search user interface */ static void sendnodecmdsearchui(int clsock, REQUEST *req, NODE *node){ pthread_t lth, *rths; TARGLCSRCH ltarg; TARGRMSRCH *rtargs; RESMAP *resmap; RESDOC **resdocs; ESTCOND *cond; CBMAP *hints; const CBLIST *attrs; CBDATUM *condbuf, *simcondbuf, *datum; const char *tmp, *url, *label, *kbuf, *phrase, *order, *simnode; char *myurl, *dstr, name[NUMBUFSIZ], masks[LINKMASKMAX+1], *zbuf; int i, num, max, depth, simid, page, top, dnum, wnum, hnum, end, tab, axk, ksiz, rnum, zsiz; double curtime; time_t mtime; myurl = cbsprintf("%s%s%s", req->prefix, NODEPREFIX, node->name); if(islooproute(myurl, req)){ log_print(LL_DEBUG, "[%s:%d]: omitting request loop (self): %s", req->claddr, req->clport, myurl); free(myurl); senderror(clsock, req, 400, "Bad Request (the request loops)"); return; } if(pthread_mutex_lock(&(node->mutex)) != 0){ log_print(LL_ERROR, "locking failed"); senderror(clsock, req, 500, "Internal Server Error (locking failed)"); return; } cond = est_cond_new(); max = DEFMAXSRCH; depth = 0; page = 0; simid = 0; simnode = NULL; if((tmp = cbmapget(req->params, "page", -1, NULL)) != NULL && (num = atoi(tmp)) > 0) page = num; if((tmp = cbmapget(req->params, "pageone", -1, NULL)) != NULL && (num = atoi(tmp)) > 1) page = num - 1; if((tmp = cbmapget(req->params, "phrase", -1, NULL)) != NULL && tmp[0] != '\0') est_cond_set_phrase(cond, tmp); if((tmp = cbmapget(req->params, "attr", -1, NULL)) != NULL && tmp[0] != '\0') est_cond_add_attr(cond, tmp); for(i = 0; i <= CONDATTRMAX; i++){ num = sprintf(name, "attr%d", i); if((tmp = cbmapget(req->params, name, num, NULL)) != NULL && tmp[0] != '\0') est_cond_add_attr(cond, tmp); } if((tmp = cbmapget(req->params, "order", -1, NULL)) != NULL && tmp[0] != '\0') est_cond_set_order(cond, tmp); if((tmp = cbmapget(req->params, "max", -1, NULL)) != NULL && (num = atoi(tmp)) >= 0) max = num; max = max > g_searchmax ? g_searchmax : max; if((tmp = cbmapget(req->params, "depth", -1, NULL)) != NULL && (num = atoi(tmp)) > 0) depth = num; if((tmp = cbmapget(req->params, "simid", -1, NULL)) != NULL && (num = atoi(tmp)) > 0) simid = num; if((tmp = cbmapget(req->params, "simnode", -1, NULL)) != NULL && tmp[0] != '\0') simnode = tmp; if((tmp = cbmapget(req->params, "mask", -1, NULL)) != NULL && tmp[0] != '\0'){ num = atoi(tmp); for(i = 0; i <= LINKMASKMAX; i++){ masks[i] = num & (1 << i); } } else if((tmp = cbmapget(req->params, "allmask", -1, NULL)) != NULL && tmp[0] != '\0'){ memset(masks, 1, LINKMASKMAX+1); for(i = 0; i <= LINKMASKMAX; i++){ num = sprintf(name, "nomask%d", i); if((tmp = cbmapget(req->params, name, num, NULL)) != NULL && tmp[0] != '\0') masks[i] = 0; } } else { memset(masks, 0, LINKMASKMAX+1); if(!(tmp = cbmapget(req->params, "nomask", -1, NULL)) || tmp[0] == '\0'){ for(i = 0; i <= LINKMASKMAX; i++){ num = sprintf(name, "mask%d", i); if((tmp = cbmapget(req->params, name, num, NULL)) != NULL && tmp[0] != '\0') masks[i] = 1; } } } if(depth >= g_searchdepth) depth = g_searchdepth; switch(g_uiphraseform){ case PM_SIMPLE: est_cond_set_options(cond, ESTCONDSIMPLE); break; case PM_ROUGH: est_cond_set_options(cond, ESTCONDROUGH); break; case PM_UNION: est_cond_set_options(cond, ESTCONDUNION); break; case PM_ISECT: est_cond_set_options(cond, ESTCONDISECT); break; } top = !est_cond_phrase(cond) && !est_cond_attrs(cond) && simid < 1; phrase = est_cond_phrase(cond); attrs = est_cond_attrs(cond); order = est_cond_order(cond); condbuf = cbdatumopen(NULL, -1); simcondbuf = cbdatumopen(NULL, -1); cbdatumprintf(condbuf, "phrase=%?", phrase ? phrase : ""); cbdatumprintf(simcondbuf, "phrase="); if(attrs){ for(i = 0; i < cblistnum(attrs); i++){ tmp = cblistval(attrs, i, NULL); if(tmp[0] != '\0'){ cbdatumprintf(condbuf, "&attr%d=%?", i + 1, tmp); cbdatumprintf(simcondbuf, "&attr%d=%?", i + 1, tmp); } } } if(order && order[0] != '\0'){ cbdatumprintf(condbuf, "&order=%?", order); cbdatumprintf(simcondbuf, "&order=%?", order); } if(max != DEFMAXSRCH){ cbdatumprintf(condbuf, "&max=%d", max); cbdatumprintf(simcondbuf, "&max=%d", max); } if(depth > 0){ cbdatumprintf(condbuf, "&depth=%d", depth); cbdatumprintf(simcondbuf, "&depth=%d", depth); } if(simid > 0 && simnode && simnode[0] != '\0'){ cbdatumprintf(condbuf, "&simid=%d", simid); cbdatumprintf(condbuf, "&simnode=%?", simnode); setsimilarphrase(cond, simnode, simid); phrase = est_cond_phrase(cond); } for(i = 0; i <= LINKMASKMAX; i++){ if(masks[i]) cbdatumprintf(condbuf, "&mask%d=1", i); } resmap = resmap_new(); hints = cbmapopenex(MINIBNUM); curtime = est_gettimeofday(); ltarg.req = req; ltarg.alive = TRUE; ltarg.cond = est_cond_dup(cond); ltarg.hints = hints; ltarg.max = max + page * max + 1; ltarg.node = node; ltarg.resmap = resmap; ltarg.words = cblistopen(); ltarg.hnum = 0; ltarg.mhnum = 0; ltarg.itime = 0.0; ltarg.etime = 0.0; if(top || masks[0]){ ltarg.alive = FALSE; } else if(g_stmode){ searchlocal(<arg); ltarg.alive = FALSE; } else if(pthread_create(<h, NULL, searchlocal, <arg) != 0){ log_print(LL_WARN, "creating thread failed"); ltarg.alive = FALSE; } rths = cbmalloc(cbmaprnum(node->links) * sizeof(pthread_t) + 1); rtargs = cbmalloc(cbmaprnum(node->links) * sizeof(TARGRMSRCH) + 1); cbmapiterinit(node->links); for(i = 0; (url = cbmapiternext(node->links, NULL)) != NULL; i++){ rtargs[i].req = req; rtargs[i].alive = TRUE; rtargs[i].myurl = myurl; rtargs[i].cond = est_cond_dup(cond); rtargs[i].hints = hints; rtargs[i].max = max + page * max + 1; rtargs[i].node = node; rtargs[i].resmap = resmap; rtargs[i].url = url; label = cbmapiterval(url, NULL); if((tmp = strchr(label, '\t')) != NULL){ rtargs[i].label = cbmemdup(label, tmp - label); rtargs[i].credit = atoi(tmp + 1); } else { rtargs[i].label = cbmemdup(label, -1); rtargs[i].credit = 0; } rtargs[i].depth = depth; rtargs[i].wwidth = g_snipwwidth; rtargs[i].hwidth = g_sniphwidth; rtargs[i].awidth = g_snipawidth; rtargs[i].hnum = 0; rtargs[i].dnum = 0; rtargs[i].wnum = 0; rtargs[i].etime = 0.0; rtargs[i].size = 0.0; rtargs[i].mtime = 0; if(top || depth < 1 || (i < LINKMASKMAX && masks[i+1])){ rtargs[i].alive = FALSE; rtargs[i].hnum = -1; rtargs[i].dnum = -1; rtargs[i].wnum = -1; rtargs[i].etime = -1.0; rtargs[i].size = -1.0; } else if(g_stmode){ searchremote(&rtargs[i]); rtargs[i].alive = FALSE; } else if(pthread_create(rths + i, NULL, searchremote, rtargs + i) != 0){ log_print(LL_WARN, "creating thread failed"); rtargs[i].alive = FALSE; } } if(pthread_mutex_unlock(&(node->mutex)) != 0) log_print(LL_ERROR, "unlocking failed"); dnum = 0; wnum = 0; mtime = node->mtime; if(ltarg.alive){ if(pthread_join(lth, NULL) == 0){ dnum = est_mtdb_doc_num(node->db); wnum = est_mtdb_word_num(node->db); } else { log_print(LL_ERROR, "joining thread failed"); } } else if(!top && g_stmode){ dnum = est_mtdb_doc_num(node->db); wnum = est_mtdb_word_num(node->db); } for(i = 0; i < cbmaprnum(node->links); i++){ if(rtargs[i].alive){ if(pthread_join(rths[i], NULL) == 0){ dnum += rtargs[i].dnum; wnum += rtargs[i].wnum; if(rtargs[i].mtime > mtime) mtime = rtargs[i].mtime; } else { log_print(LL_ERROR, "joining thread failed"); } } else if(!top && g_stmode && depth > 0){ dnum += rtargs[i].dnum; wnum += rtargs[i].wnum; if(rtargs[i].mtime > mtime) mtime = rtargs[i].mtime; } } hnum = (tmp = cbmapget(hints, "", 0, NULL)) ? atoi(tmp) : 0; hnum -= ltarg.mhnum; if(hnum < 0) hnum = 0; end = page * max + max; curtime = est_gettimeofday() - curtime; tab = 1; axk = 'a'; datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, UICACHELIFE); cbdatumprintf(datum, "Content-Type: %s\r\n", UIMIMETYPE); if(req->gzip){ cbdatumprintf(datum, "Content-Encoding: gzip\r\n"); } else if(req->deflate){ cbdatumprintf(datum, "Content-Encoding: deflate\r\n"); } cbdatumprintf(datum, "Content-Disposition: inline; filename=%s.html\r\n", node->name); dstr = cbdatestrhttp(req->reload ? req->now : mtime, 0); cbdatumprintf(datum, "Last-Modified: %s\r\n", dstr); free(dstr); cbdatumprintf(datum, "\r\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumsetsize(datum, 0); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", UIMIMETYPE); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); dstr = cbdatestrhttp(mtime, 0); cbdatumprintf(datum, "\n", dstr); free(dstr); cbdatumprintf(datum, "\n", SERVNAME, est_version); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", UIMIMETYPE, req->prefix, NODEPREFIX, node->name, SEARCHUICMD); if(page > 0) cbdatumprintf(datum, "\n", UIMIMETYPE, req->prefix, NODEPREFIX, node->name, SEARCHUICMD, cbdatumptr(condbuf), page - 1); if(hnum > end) cbdatumprintf(datum, "\n", UIMIMETYPE, req->prefix, NODEPREFIX, node->name, SEARCHUICMD, cbdatumptr(condbuf), page + 1); cbdatumprintf(datum, "\n", OSRCHMIMETYPE, req->prefix, NODEPREFIX, node->name, OPENSEARCHCMD); if(!top){ cbdatumprintf(datum, "\n", ATOMMIMETYPE, req->prefix, NODEPREFIX, node->name, SEARCHATOMCMD, cbdatumptr(condbuf)); cbdatumprintf(datum, "\n", RSSMIMETYPE, req->prefix, NODEPREFIX, node->name, SEARCHRSSCMD, cbdatumptr(condbuf)); } cbdatumprintf(datum, "\n", req->prefix, FAVICONLOC); cbdatumprintf(datum, "\n", g_adminemail); if(phrase && phrase[0] != '\0'){ cbdatumprintf(datum, "Search %@: %@\n", node->label, simid > 0 ? ESTOPSIMILAR : phrase); } else { cbdatumprintf(datum, "Search Interface of %@\n", node->label); } cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "

Search Interface of %@

\n", node->label); cbdatumprintf(datum, "
\n", req->prefix, NODEPREFIX, node->name, SEARCHUICMD); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, ""); cbdatumprintf(datum, ""); cbdatumprintf(datum, ""); cbdatumprintf(datum, "\n"); for(i = 0; i < 3; i++){ cbdatumprintf(datum, ""); tmp = attrs ? cblistval(attrs, i, NULL) : NULL; cbdatumprintf(datum, "", i + 1); cbdatumprintf(datum, ""); cbdatumprintf(datum, "\n"); } cbdatumprintf(datum, ""); cbdatumprintf(datum, ""); cbdatumprintf(datum, ""); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, ""); cbdatumprintf(datum, ""); cbdatumprintf(datum, ""); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, ""); cbdatumprintf(datum, ""); cbdatumprintf(datum, ""); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, ""); cbdatumprintf(datum, ""); cbdatumprintf(datum, ""); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "
phrase:"); cbdatumprintf(datum, "", phrase ? phrase : "", tab++, axk++); cbdatumprintf(datum, "
attribute:"); cbdatumprintf(datum, "", i + 1, tmp ? tmp : "", i + 1, tab++, axk++); cbdatumprintf(datum, "
order:"); cbdatumprintf(datum, "", order ? order : "", tab++, axk++); cbdatumprintf(datum, "
max:"); cbdatumprintf(datum, ""); cbdatumprintf(datum, "
depth:"); cbdatumprintf(datum, ""); cbdatumprintf(datum, "
"); cbdatumprintf(datum, "", tab++, axk++); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, ""); cbdatumprintf(datum, ""); cbdatumprintf(datum, "", hnum); cbdatumprintf(datum, "\n"); cbmapiterinit(hints); num = 1; while((kbuf = cbmapiternext(hints, &ksiz)) != NULL){ if(ksiz < 1) continue; cbdatumprintf(datum, ""); cbdatumprintf(datum, "", num, num); cbdatumprintf(datum, "", num, kbuf, cbmapiterval(kbuf, NULL)); cbdatumprintf(datum, "\n"); num++; } cbdatumprintf(datum, ""); cbdatumprintf(datum, ""); cbdatumprintf(datum, "", dnum > 0 ? dnum : est_mtdb_doc_num(node->db)); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, ""); cbdatumprintf(datum, ""); cbdatumprintf(datum, "", wnum > 0 ? wnum : est_mtdb_word_num(node->db)); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, ""); cbdatumprintf(datum, ""); cbdatumprintf(datum, "", curtime / 1000.0); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, ""); cbdatumprintf(datum, ""); cbdatumprintf(datum, ""); cbdatumprintf(datum, "\n"); for(i = 0; i < cbmaprnum(node->links); i++){ cbdatumprintf(datum, ""); cbdatumprintf(datum, "", i + 1, i + 1); cbdatumprintf(datum, ""); cbdatumprintf(datum, "\n"); } cbdatumprintf(datum, ""); cbdatumprintf(datum, ""); if(top){ cbdatumprintf(datum, ""); } else { cbdatumprintf(datum, ""); } cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "
hit:%d
hint#%d:%@ (%@)
docnum:%d
wordnum:%d
time:%.6f
link#0:"); cbdatumprintf(datum, "", masks[0] ? "" : " checked=\"checked\""); cbdatumprintf(datum, " %@", node->label); cbdatumprintf(datum, " (%d)", ltarg.etime / 1000.0, ltarg.itime / 1000.0, ltarg.hnum - ltarg.mhnum); cbdatumprintf(datum, "
link#%d:", i + 1); cbdatumprintf(datum, "", i + 1, i < LINKMASKMAX && masks[i+1] ? "" : " checked=\"checked\"", i + 1); cbdatumprintf(datum, " %@", rtargs[i].url, SEARCHUICMD, cbdatumptr(condbuf), UIMIMETYPE, rtargs[i].label); if(rtargs[i].hnum >= 0){ cbdatumprintf(datum, " (%d)", rtargs[i].etime / 1000.0, rtargs[i].hnum); } cbdatumprintf(datum, "
feed:"); cbdatumprintf(datum, "OpenSearch\n", req->prefix, NODEPREFIX, node->name, OPENSEARCHCMD, OSRCHMIMETYPE); cbdatumprintf(datum, ""); cbdatumprintf(datum, "Atom", req->prefix, NODEPREFIX, node->name, SEARCHATOMCMD, cbdatumptr(condbuf), ATOMMIMETYPE); cbdatumprintf(datum, " RSS", req->prefix, NODEPREFIX, node->name, SEARCHRSSCMD, cbdatumptr(condbuf), RSSMIMETYPE); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); if(!top){ cbdatumprintf(datum, "
\n"); if(!order && phrase && cbstrfwmatch(phrase, ESTOPSIMILAR)) order = DATTRNDSCORE " " ESTORDNUMD; resdocs = resmap_list(resmap, &rnum, order, NULL); for(i = page * max; i < rnum && i < end; i++){ catdocdataui(datum, i + 1, resdocs[i], ltarg.words, req, node, cbdatumptr(condbuf), cbdatumptr(simcondbuf)); } free(resdocs); if(rnum < 1) cbdatumprintf(datum, "

The conditions did not match any documents.

\n"); cbdatumprintf(datum, "
"); if(page > 0){ cbdatumprintf(datum, "PREV", req->prefix, NODEPREFIX, node->name, SEARCHUICMD, cbdatumptr(condbuf), page - 1, UIMIMETYPE); } else { cbdatumprintf(datum, "PREV"); } if(hnum > end){ cbdatumprintf(datum, " NEXT", req->prefix, NODEPREFIX, node->name, SEARCHUICMD, cbdatumptr(condbuf), page + 1, UIMIMETYPE); } else { cbdatumprintf(datum, " NEXT"); } cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); } cbdatumprintf(datum, "
Powered by Hyper Estraier" " %@.
\n", _EST_PROJURL, est_version); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); if(req->gzip){ if((zbuf = est_deflate(cbdatumptr(datum), cbdatumsize(datum), &zsiz, 1)) != NULL){ est_sock_send_all(clsock, zbuf, zsiz); free(zbuf); } } else if(req->deflate){ if((zbuf = est_deflate(cbdatumptr(datum), cbdatumsize(datum), &zsiz, 0)) != NULL){ est_sock_send_all(clsock, zbuf, zsiz); free(zbuf); } } else { est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); } cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (%s)", req->claddr, req->clport, SEARCHUICMD); cblistclose(ltarg.words); est_cond_delete(ltarg.cond); for(i = 0; i < cbmaprnum(node->links); i++){ free(rtargs[i].label); est_cond_delete(rtargs[i].cond); } free(rtargs); free(rths); cbmapclose(hints); resmap_delete(resmap); cbdatumclose(simcondbuf); cbdatumclose(condbuf); est_cond_delete(cond); free(myurl); } /* send the result of Atom feed interface */ static void sendnodecmdsearchatom(int clsock, REQUEST *req, NODE *node){ pthread_t lth, *rths; TARGLCSRCH ltarg; TARGRMSRCH *rtargs; RESMAP *resmap; RESDOC **resdocs; ESTCOND *cond; CBMAP *hints; const CBLIST *attrs; CBDATUM *condbuf, *datum; const char *tmp, *url, *label, *kbuf, *phrase, *order, *simnode; char *myurl, *dstr, name[NUMBUFSIZ], masks[LINKMASKMAX+1], *zbuf; int i, num, max, depth, simid, page, top, dnum, wnum, hnum, end, ksiz, rnum, zsiz; double curtime; time_t mtime; myurl = cbsprintf("%s%s%s", req->prefix, NODEPREFIX, node->name); if(islooproute(myurl, req)){ log_print(LL_DEBUG, "[%s:%d]: omitting request loop (self): %s", req->claddr, req->clport, myurl); free(myurl); senderror(clsock, req, 400, "Bad Request (the request loops)"); return; } if(pthread_mutex_lock(&(node->mutex)) != 0){ log_print(LL_ERROR, "locking failed"); senderror(clsock, req, 500, "Internal Server Error (locking failed)"); return; } cond = est_cond_new(); max = DEFMAXSRCH; depth = 0; page = 0; simid = 0; simnode = NULL; if((tmp = cbmapget(req->params, "page", -1, NULL)) != NULL && (num = atoi(tmp)) > 0) page = num; if((tmp = cbmapget(req->params, "pageone", -1, NULL)) != NULL && (num = atoi(tmp)) > 1) page = num - 1; if((tmp = cbmapget(req->params, "phrase", -1, NULL)) != NULL && tmp[0] != '\0') est_cond_set_phrase(cond, tmp); if((tmp = cbmapget(req->params, "attr", -1, NULL)) != NULL && tmp[0] != '\0') est_cond_add_attr(cond, tmp); for(i = 0; i <= CONDATTRMAX; i++){ num = sprintf(name, "attr%d", i); if((tmp = cbmapget(req->params, name, num, NULL)) != NULL && tmp[0] != '\0') est_cond_add_attr(cond, tmp); } if((tmp = cbmapget(req->params, "order", -1, NULL)) != NULL && tmp[0] != '\0') est_cond_set_order(cond, tmp); if((tmp = cbmapget(req->params, "max", -1, NULL)) != NULL && (num = atoi(tmp)) >= 0) max = num; max = max > g_searchmax ? g_searchmax : max; if((tmp = cbmapget(req->params, "depth", -1, NULL)) != NULL && (num = atoi(tmp)) > 0) depth = num; if((tmp = cbmapget(req->params, "simid", -1, NULL)) != NULL && (num = atoi(tmp)) > 0) simid = num; if((tmp = cbmapget(req->params, "simnode", -1, NULL)) != NULL && tmp[0] != '\0') simnode = tmp; if((tmp = cbmapget(req->params, "mask", -1, NULL)) != NULL && tmp[0] != '\0'){ num = atoi(tmp); for(i = 0; i <= LINKMASKMAX; i++){ masks[i] = num & (1 << i); } } else if((tmp = cbmapget(req->params, "allmask", -1, NULL)) != NULL && tmp[0] != '\0'){ memset(masks, 1, LINKMASKMAX+1); for(i = 0; i <= LINKMASKMAX; i++){ num = sprintf(name, "nomask%d", i); if((tmp = cbmapget(req->params, name, num, NULL)) != NULL && tmp[0] != '\0') masks[i] = 0; } } else { memset(masks, 0, LINKMASKMAX+1); if(!(tmp = cbmapget(req->params, "nomask", -1, NULL)) || tmp[0] == '\0'){ for(i = 0; i <= LINKMASKMAX; i++){ num = sprintf(name, "mask%d", i); if((tmp = cbmapget(req->params, name, num, NULL)) != NULL && tmp[0] != '\0') masks[i] = 1; } } } if(depth >= g_searchdepth) depth = g_searchdepth; switch(g_uiphraseform){ case PM_SIMPLE: est_cond_set_options(cond, ESTCONDSIMPLE); break; case PM_ROUGH: est_cond_set_options(cond, ESTCONDROUGH); break; case PM_UNION: est_cond_set_options(cond, ESTCONDUNION); break; case PM_ISECT: est_cond_set_options(cond, ESTCONDISECT); break; } top = !est_cond_phrase(cond) && !est_cond_attrs(cond) && simid < 1; phrase = est_cond_phrase(cond); attrs = est_cond_attrs(cond); order = est_cond_order(cond); condbuf = cbdatumopen(NULL, -1); cbdatumprintf(condbuf, "phrase=%?", phrase ? phrase : ""); if(attrs){ for(i = 0; i < cblistnum(attrs); i++){ tmp = cblistval(attrs, i, NULL); if(tmp[0] != '\0') cbdatumprintf(condbuf, "&attr%d=%?", i + 1, tmp); } } if(order && order[0] != '\0') cbdatumprintf(condbuf, "&order=%?", order); if(max != DEFMAXSRCH) cbdatumprintf(condbuf, "&max=%d", max); if(depth > 0) cbdatumprintf(condbuf, "&depth=%d", depth); if(simid > 0 && simnode && simnode[0] != '\0'){ cbdatumprintf(condbuf, "&simid=%d", simid); cbdatumprintf(condbuf, "&simnode=%?", simnode); setsimilarphrase(cond, simnode, simid); phrase = est_cond_phrase(cond); } for(i = 0; i <= LINKMASKMAX; i++){ if(masks[i]) cbdatumprintf(condbuf, "&mask%d=1", i); } if(page > 0) cbdatumprintf(condbuf, "&page=%d", page); resmap = resmap_new(); hints = cbmapopenex(MINIBNUM); curtime = est_gettimeofday(); ltarg.req = req; ltarg.alive = TRUE; ltarg.cond = est_cond_dup(cond); ltarg.hints = hints; ltarg.max = max + page * max + 1; ltarg.node = node; ltarg.resmap = resmap; ltarg.words = cblistopen(); ltarg.hnum = 0; ltarg.mhnum = 0; ltarg.itime = 0.0; ltarg.etime = 0.0; if(top || masks[0]){ ltarg.alive = FALSE; } else if(g_stmode){ searchlocal(<arg); ltarg.alive = FALSE; } else if(pthread_create(<h, NULL, searchlocal, <arg) != 0){ log_print(LL_WARN, "creating thread failed"); ltarg.alive = FALSE; } rths = cbmalloc(cbmaprnum(node->links) * sizeof(pthread_t) + 1); rtargs = cbmalloc(cbmaprnum(node->links) * sizeof(TARGRMSRCH) + 1); cbmapiterinit(node->links); for(i = 0; (url = cbmapiternext(node->links, NULL)) != NULL; i++){ rtargs[i].req = req; rtargs[i].alive = TRUE; rtargs[i].myurl = myurl; rtargs[i].cond = est_cond_dup(cond); rtargs[i].hints = hints; rtargs[i].max = max + page * max + 1; rtargs[i].node = node; rtargs[i].resmap = resmap; rtargs[i].url = url; label = cbmapiterval(url, NULL); if((tmp = strchr(label, '\t')) != NULL){ rtargs[i].label = cbmemdup(label, tmp - label); rtargs[i].credit = atoi(tmp + 1); } else { rtargs[i].label = cbmemdup(label, -1); rtargs[i].credit = 0; } rtargs[i].depth = depth; rtargs[i].wwidth = g_snipwwidth; rtargs[i].hwidth = g_sniphwidth; rtargs[i].awidth = g_snipawidth; rtargs[i].hnum = 0; rtargs[i].dnum = 0; rtargs[i].wnum = 0; rtargs[i].etime = 0.0; rtargs[i].size = 0.0; rtargs[i].mtime = 0; if(top || depth < 1 || (i < LINKMASKMAX && masks[i+1])){ rtargs[i].alive = FALSE; rtargs[i].hnum = -1; rtargs[i].dnum = -1; rtargs[i].wnum = -1; rtargs[i].etime = -1.0; rtargs[i].size = -1.0; } else if(g_stmode){ searchremote(&rtargs[i]); rtargs[i].alive = FALSE; } else if(pthread_create(rths + i, NULL, searchremote, rtargs + i) != 0){ log_print(LL_WARN, "creating thread failed"); rtargs[i].alive = FALSE; } } if(pthread_mutex_unlock(&(node->mutex)) != 0) log_print(LL_ERROR, "unlocking failed"); dnum = 0; wnum = 0; mtime = node->mtime; if(ltarg.alive){ if(pthread_join(lth, NULL) == 0){ dnum = est_mtdb_doc_num(node->db); wnum = est_mtdb_word_num(node->db); } else { log_print(LL_ERROR, "joining thread failed"); } } else if(!top && g_stmode){ dnum = est_mtdb_doc_num(node->db); wnum = est_mtdb_word_num(node->db); } for(i = 0; i < cbmaprnum(node->links); i++){ if(rtargs[i].alive){ if(pthread_join(rths[i], NULL) == 0){ dnum += rtargs[i].dnum; wnum += rtargs[i].wnum; if(rtargs[i].mtime > mtime) mtime = rtargs[i].mtime; } else { log_print(LL_ERROR, "joining thread failed"); } } else if(!top && g_stmode && depth > 0){ dnum += rtargs[i].dnum; wnum += rtargs[i].wnum; if(rtargs[i].mtime > mtime) mtime = rtargs[i].mtime; } } hnum = (tmp = cbmapget(hints, "", 0, NULL)) ? atoi(tmp) : 0; hnum -= ltarg.mhnum; if(hnum < 0) hnum = 0; end = page * max + max; curtime = est_gettimeofday() - curtime; datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, UICACHELIFE); cbdatumprintf(datum, "Content-Type: %s\r\n", ATOMMIMETYPE); if(req->gzip){ cbdatumprintf(datum, "Content-Encoding: gzip\r\n"); } else if(req->deflate){ cbdatumprintf(datum, "Content-Encoding: deflate\r\n"); } cbdatumprintf(datum, "Content-Disposition: inline; filename=%s.atom\r\n", node->name); dstr = cbdatestrhttp(req->reload ? req->now : mtime, 0); cbdatumprintf(datum, "Last-Modified: %s\r\n", dstr); free(dstr); cbdatumprintf(datum, "\r\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumsetsize(datum, 0); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", _EST_XNSEARCH); cbdatumprintf(datum, "%@%@%@/%@?%s\n", req->prefix, NODEPREFIX, node->name, SEARCHATOMCMD, cbdatumptr(condbuf)); if(phrase && phrase[0] != '\0'){ cbdatumprintf(datum, "Search %@: %@\n", node->label, simid > 0 ? ESTOPSIMILAR : phrase); } else { cbdatumprintf(datum, "Search Interface of %@\n", node->label); } cbdatumprintf(datum, "Search Result of Hyper Estraier %@\n", est_version); dstr = cbdatestrwww(mtime, 0); cbdatumprintf(datum, "%@\n", dstr); free(dstr); cbdatumprintf(datum, "\n", req->prefix, NODEPREFIX, node->name, SEARCHATOMCMD, cbdatumptr(condbuf), ATOMMIMETYPE); if(page > 0) cbdatumprintf(datum, "\n", req->prefix, NODEPREFIX, node->name, SEARCHATOMCMD, cbdatumptr(condbuf), page - 1, ATOMMIMETYPE); if(hnum > end) cbdatumprintf(datum, "\n", req->prefix, NODEPREFIX, node->name, SEARCHATOMCMD, cbdatumptr(condbuf), page + 1, ATOMMIMETYPE); cbdatumprintf(datum, "\n", req->prefix, NODEPREFIX, node->name, SEARCHUICMD, cbdatumptr(condbuf), UIMIMETYPE); cbdatumprintf(datum, "\n", req->prefix, NODEPREFIX, node->name, SEARCHRSSCMD, cbdatumptr(condbuf), RSSMIMETYPE); cbdatumprintf(datum, "" "Hyper Estraier (%@)\n", _EST_PROJURL, est_version, SERVNAME); cbdatumprintf(datum, "%@%@%@\n", req->prefix, IMAGEPREFIX, BIGICONNAME); cbdatumprintf(datum, "\n", hnum); cbmapiterinit(hints); while((kbuf = cbmapiternext(hints, &ksiz)) != NULL){ if(ksiz < 1) continue; cbdatumprintf(datum, "\n", kbuf, cbmapiterval(kbuf, NULL)); } cbdatumprintf(datum, "\n", curtime / 1000.0); cbdatumprintf(datum, "\n", dnum > 0 ? dnum : est_mtdb_doc_num(node->db), wnum > 0 ? wnum : est_mtdb_word_num(node->db)); cbdatumprintf(datum, "\n", req->prefix, NODEPREFIX, node->name, node->label, SELFCREDIT, est_mtdb_doc_num(node->db), est_mtdb_word_num(node->db), est_mtdb_size(node->db), ltarg.hnum - ltarg.mhnum, ltarg.etime >= 0.0 ? ltarg.etime / 1000.0 : 0.0); for(i = 0; i < cbmaprnum(node->links); i++){ cbdatumprintf(datum, "\n", rtargs[i].url, rtargs[i].label, rtargs[i].credit, rtargs[i].dnum, rtargs[i].wnum, rtargs[i].size, rtargs[i].hnum, rtargs[i].etime >= 0.0 ? rtargs[i].etime / 1000.0 : 0.0); } cbdatumprintf(datum, "\n", phrase ? phrase : ""); cbdatumprintf(datum, "%d\n", hnum); cbdatumprintf(datum, "%d\n", page * max + 1); cbdatumprintf(datum, "%d\n", max); cbdatumprintf(datum, "\n", req->prefix, NODEPREFIX, node->name, OPENSEARCHCMD, OSRCHMIMETYPE); if(!top){ if(!order && phrase && cbstrfwmatch(phrase, ESTOPSIMILAR)) order = DATTRNDSCORE " " ESTORDNUMD; resdocs = resmap_list(resmap, &rnum, order, NULL); for(i = page * max; i < rnum && i < end; i++){ catdocdataatom(datum, resdocs[i], ltarg.words, node); } free(resdocs); } cbdatumprintf(datum, "\n"); if(req->gzip){ if((zbuf = est_deflate(cbdatumptr(datum), cbdatumsize(datum), &zsiz, 1)) != NULL){ est_sock_send_all(clsock, zbuf, zsiz); free(zbuf); } } else if(req->deflate){ if((zbuf = est_deflate(cbdatumptr(datum), cbdatumsize(datum), &zsiz, 0)) != NULL){ est_sock_send_all(clsock, zbuf, zsiz); free(zbuf); } } else { est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); } cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (%s)", req->claddr, req->clport, SEARCHATOMCMD); cblistclose(ltarg.words); est_cond_delete(ltarg.cond); for(i = 0; i < cbmaprnum(node->links); i++){ free(rtargs[i].label); est_cond_delete(rtargs[i].cond); } free(rtargs); free(rths); cbmapclose(hints); resmap_delete(resmap); cbdatumclose(condbuf); est_cond_delete(cond); free(myurl); } /* send the result of RSS feed interface */ static void sendnodecmdsearchrss(int clsock, REQUEST *req, NODE *node){ pthread_t lth, *rths; TARGLCSRCH ltarg; TARGRMSRCH *rtargs; RESMAP *resmap; RESDOC **resdocs, *resdoc; ESTCOND *cond; CBMAP *hints; const CBLIST *attrs; CBDATUM *condbuf, *datum; const char *tmp, *url, *label, *kbuf, *phrase, *order, *simnode; char *myurl, name[NUMBUFSIZ], masks[LINKMASKMAX+1], *dstr, *turi, *zbuf; int i, num, max, depth, simid, page, top, dnum, wnum, hnum, end, ksiz, rnum, zsiz; double curtime; time_t mtime; myurl = cbsprintf("%s%s%s", req->prefix, NODEPREFIX, node->name); if(islooproute(myurl, req)){ log_print(LL_DEBUG, "[%s:%d]: omitting request loop (self): %s", req->claddr, req->clport, myurl); free(myurl); senderror(clsock, req, 400, "Bad Request (the request loops)"); return; } if(pthread_mutex_lock(&(node->mutex)) != 0){ log_print(LL_ERROR, "locking failed"); senderror(clsock, req, 500, "Internal Server Error (locking failed)"); return; } cond = est_cond_new(); max = DEFMAXSRCH; depth = 0; page = 0; simid = 0; simnode = NULL; if((tmp = cbmapget(req->params, "page", -1, NULL)) != NULL && (num = atoi(tmp)) > 0) page = num; if((tmp = cbmapget(req->params, "pageone", -1, NULL)) != NULL && (num = atoi(tmp)) > 1) page = num - 1; if((tmp = cbmapget(req->params, "phrase", -1, NULL)) != NULL && tmp[0] != '\0') est_cond_set_phrase(cond, tmp); if((tmp = cbmapget(req->params, "attr", -1, NULL)) != NULL && tmp[0] != '\0') est_cond_add_attr(cond, tmp); for(i = 0; i <= CONDATTRMAX; i++){ num = sprintf(name, "attr%d", i); if((tmp = cbmapget(req->params, name, num, NULL)) != NULL && tmp[0] != '\0') est_cond_add_attr(cond, tmp); } if((tmp = cbmapget(req->params, "order", -1, NULL)) != NULL && tmp[0] != '\0') est_cond_set_order(cond, tmp); if((tmp = cbmapget(req->params, "max", -1, NULL)) != NULL && (num = atoi(tmp)) >= 0) max = num; max = max > g_searchmax ? g_searchmax : max; if((tmp = cbmapget(req->params, "depth", -1, NULL)) != NULL && (num = atoi(tmp)) > 0) depth = num; if((tmp = cbmapget(req->params, "simid", -1, NULL)) != NULL && (num = atoi(tmp)) > 0) simid = num; if((tmp = cbmapget(req->params, "simnode", -1, NULL)) != NULL && tmp[0] != '\0') simnode = tmp; if((tmp = cbmapget(req->params, "mask", -1, NULL)) != NULL && tmp[0] != '\0'){ num = atoi(tmp); for(i = 0; i <= LINKMASKMAX; i++){ masks[i] = num & (1 << i); } } else if((tmp = cbmapget(req->params, "allmask", -1, NULL)) != NULL && tmp[0] != '\0'){ memset(masks, 1, LINKMASKMAX+1); for(i = 0; i <= LINKMASKMAX; i++){ num = sprintf(name, "nomask%d", i); if((tmp = cbmapget(req->params, name, num, NULL)) != NULL && tmp[0] != '\0') masks[i] = 0; } } else { memset(masks, 0, LINKMASKMAX+1); if(!(tmp = cbmapget(req->params, "nomask", -1, NULL)) || tmp[0] == '\0'){ for(i = 0; i <= LINKMASKMAX; i++){ num = sprintf(name, "mask%d", i); if((tmp = cbmapget(req->params, name, num, NULL)) != NULL && tmp[0] != '\0') masks[i] = 1; } } } if(depth >= g_searchdepth) depth = g_searchdepth; switch(g_uiphraseform){ case PM_SIMPLE: est_cond_set_options(cond, ESTCONDSIMPLE); break; case PM_ROUGH: est_cond_set_options(cond, ESTCONDROUGH); break; case PM_UNION: est_cond_set_options(cond, ESTCONDUNION); break; case PM_ISECT: est_cond_set_options(cond, ESTCONDISECT); break; } top = !est_cond_phrase(cond) && !est_cond_attrs(cond) && simid < 1; phrase = est_cond_phrase(cond); attrs = est_cond_attrs(cond); order = est_cond_order(cond); condbuf = cbdatumopen(NULL, -1); cbdatumprintf(condbuf, "phrase=%?", phrase ? phrase : ""); if(attrs){ for(i = 0; i < cblistnum(attrs); i++){ tmp = cblistval(attrs, i, NULL); if(tmp[0] != '\0') cbdatumprintf(condbuf, "&attr%d=%?", i + 1, tmp); } } if(order && order[0] != '\0') cbdatumprintf(condbuf, "&order=%?", order); if(max != DEFMAXSRCH) cbdatumprintf(condbuf, "&max=%d", max); if(depth > 0) cbdatumprintf(condbuf, "&depth=%d", depth); if(simid > 0 && simnode && simnode[0] != '\0'){ cbdatumprintf(condbuf, "&simid=%d", simid); cbdatumprintf(condbuf, "&simnode=%?", simnode); setsimilarphrase(cond, simnode, simid); phrase = est_cond_phrase(cond); } for(i = 0; i <= LINKMASKMAX; i++){ if(masks[i]) cbdatumprintf(condbuf, "&mask%d=1", i); } if(page > 0) cbdatumprintf(condbuf, "&page=%d", page); resmap = resmap_new(); hints = cbmapopenex(MINIBNUM); curtime = est_gettimeofday(); ltarg.req = req; ltarg.alive = TRUE; ltarg.cond = est_cond_dup(cond); ltarg.hints = hints; ltarg.max = max + page * max + 1; ltarg.node = node; ltarg.resmap = resmap; ltarg.words = cblistopen(); ltarg.hnum = 0; ltarg.mhnum = 0; ltarg.itime = 0.0; ltarg.etime = 0.0; if(top || masks[0]){ ltarg.alive = FALSE; } else if(g_stmode){ searchlocal(<arg); ltarg.alive = FALSE; } else if(pthread_create(<h, NULL, searchlocal, <arg) != 0){ log_print(LL_WARN, "creating thread failed"); ltarg.alive = FALSE; } rths = cbmalloc(cbmaprnum(node->links) * sizeof(pthread_t) + 1); rtargs = cbmalloc(cbmaprnum(node->links) * sizeof(TARGRMSRCH) + 1); cbmapiterinit(node->links); for(i = 0; (url = cbmapiternext(node->links, NULL)) != NULL; i++){ rtargs[i].req = req; rtargs[i].alive = TRUE; rtargs[i].myurl = myurl; rtargs[i].cond = est_cond_dup(cond); rtargs[i].hints = hints; rtargs[i].max = max + page * max + 1; rtargs[i].node = node; rtargs[i].resmap = resmap; rtargs[i].url = url; label = cbmapiterval(url, NULL); if((tmp = strchr(label, '\t')) != NULL){ rtargs[i].label = cbmemdup(label, tmp - label); rtargs[i].credit = atoi(tmp + 1); } else { rtargs[i].label = cbmemdup(label, -1); rtargs[i].credit = 0; } rtargs[i].depth = depth; rtargs[i].wwidth = g_snipwwidth; rtargs[i].hwidth = g_sniphwidth; rtargs[i].awidth = g_snipawidth; rtargs[i].hnum = 0; rtargs[i].dnum = 0; rtargs[i].wnum = 0; rtargs[i].etime = 0.0; rtargs[i].size = 0.0; rtargs[i].mtime = 0; if(top || depth < 1 || (i < LINKMASKMAX && masks[i+1])){ rtargs[i].alive = FALSE; rtargs[i].hnum = -1; rtargs[i].dnum = -1; rtargs[i].wnum = -1; rtargs[i].etime = -1.0; rtargs[i].size = -1.0; } else if(g_stmode){ searchremote(&rtargs[i]); rtargs[i].alive = FALSE; } else if(pthread_create(rths + i, NULL, searchremote, rtargs + i) != 0){ log_print(LL_WARN, "creating thread failed"); rtargs[i].alive = FALSE; } } if(pthread_mutex_unlock(&(node->mutex)) != 0) log_print(LL_ERROR, "unlocking failed"); dnum = 0; wnum = 0; mtime = node->mtime; if(ltarg.alive){ if(pthread_join(lth, NULL) == 0){ dnum = est_mtdb_doc_num(node->db); wnum = est_mtdb_word_num(node->db); } else { log_print(LL_ERROR, "joining thread failed"); } } else if(!top && g_stmode){ dnum = est_mtdb_doc_num(node->db); wnum = est_mtdb_word_num(node->db); } for(i = 0; i < cbmaprnum(node->links); i++){ if(rtargs[i].alive){ if(pthread_join(rths[i], NULL) == 0){ dnum += rtargs[i].dnum; wnum += rtargs[i].wnum; if(rtargs[i].mtime > mtime) mtime = rtargs[i].mtime; } else { log_print(LL_ERROR, "joining thread failed"); } } else if(!top && g_stmode && depth > 0){ dnum += rtargs[i].dnum; wnum += rtargs[i].wnum; if(rtargs[i].mtime > mtime) mtime = rtargs[i].mtime; } } hnum = (tmp = cbmapget(hints, "", 0, NULL)) ? atoi(tmp) : 0; hnum -= ltarg.mhnum; if(hnum < 0) hnum = 0; end = page * max + max; curtime = est_gettimeofday() - curtime; datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, UICACHELIFE); cbdatumprintf(datum, "Content-Type: %s\r\n", RSSMIMETYPE); if(req->gzip){ cbdatumprintf(datum, "Content-Encoding: gzip\r\n"); } else if(req->deflate){ cbdatumprintf(datum, "Content-Encoding: deflate\r\n"); } cbdatumprintf(datum, "Content-Disposition: inline; filename=%s.rdf\r\n", node->name); dstr = cbdatestrhttp(req->reload ? req->now : mtime, 0); cbdatumprintf(datum, "Last-Modified: %s\r\n", dstr); free(dstr); cbdatumprintf(datum, "\r\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumsetsize(datum, 0); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", _EST_XNSEARCH); cbdatumprintf(datum, "\n", req->prefix, NODEPREFIX, node->name, SEARCHRSSCMD, cbdatumptr(condbuf)); if(phrase && phrase[0] != '\0'){ cbdatumprintf(datum, "Search %@: %@\n", node->label, simid > 0 ? ESTOPSIMILAR : phrase); } else { cbdatumprintf(datum, "Search Interface of %@\n", node->label); } cbdatumprintf(datum, "Search Result of Hyper Estraier %@\n", est_version); cbdatumprintf(datum, "%@%@%@/%@?%s\n", req->prefix, NODEPREFIX, node->name, SEARCHUICMD, cbdatumptr(condbuf)); if(!top){ if(!order && phrase && cbstrfwmatch(phrase, ESTOPSIMILAR)) order = DATTRNDSCORE " " ESTORDNUMD; resdocs = resmap_list(resmap, &rnum, order, NULL); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); for(i = page * max; i < rnum && i < end; i++){ resdoc = resdocs[i]; if(!(tmp = resdoc->doc ? est_doc_attr(resdoc->doc, ESTDATTRURI) : cbmapget(resdoc->attrs, ESTDATTRURI, -1, NULL))) tmp = "."; turi = makeshownuri(tmp); cbdatumprintf(datum, "\n", turi); free(turi); } cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); free(resdocs); } dstr = cbdatestrwww(mtime, 0); cbdatumprintf(datum, "%@\n", dstr); free(dstr); cbdatumprintf(datum, "\n", req->prefix, NODEPREFIX, node->name, SEARCHRSSCMD, cbdatumptr(condbuf), RSSMIMETYPE); if(page > 0) cbdatumprintf(datum, "\n", req->prefix, NODEPREFIX, node->name, SEARCHATOMCMD, cbdatumptr(condbuf), page - 1, ATOMMIMETYPE); if(hnum > end) cbdatumprintf(datum, "\n", req->prefix, NODEPREFIX, node->name, SEARCHATOMCMD, cbdatumptr(condbuf), page + 1, ATOMMIMETYPE); cbdatumprintf(datum, "\n", req->prefix, NODEPREFIX, node->name, SEARCHUICMD, cbdatumptr(condbuf), UIMIMETYPE); cbdatumprintf(datum, "\n", req->prefix, NODEPREFIX, node->name, SEARCHATOMCMD, cbdatumptr(condbuf), ATOMMIMETYPE); cbdatumprintf(datum, "\n", hnum); cbmapiterinit(hints); while((kbuf = cbmapiternext(hints, &ksiz)) != NULL){ if(ksiz < 1) continue; cbdatumprintf(datum, "\n", kbuf, cbmapiterval(kbuf, NULL)); } cbdatumprintf(datum, "\n", curtime / 1000.0); cbdatumprintf(datum, "\n", dnum > 0 ? dnum : est_mtdb_doc_num(node->db), wnum > 0 ? wnum : est_mtdb_word_num(node->db)); cbdatumprintf(datum, "\n", req->prefix, NODEPREFIX, node->name, node->label, SELFCREDIT, est_mtdb_doc_num(node->db), est_mtdb_word_num(node->db), est_mtdb_size(node->db), ltarg.hnum - ltarg.mhnum, ltarg.etime >= 0.0 ? ltarg.etime / 1000.0 : 0.0); for(i = 0; i < cbmaprnum(node->links); i++){ cbdatumprintf(datum, "\n", rtargs[i].url, rtargs[i].label, rtargs[i].credit, rtargs[i].dnum, rtargs[i].wnum, rtargs[i].size, rtargs[i].hnum, rtargs[i].etime >= 0.0 ? rtargs[i].etime / 1000.0 : 0.0); } cbdatumprintf(datum, "\n", phrase ? phrase : ""); cbdatumprintf(datum, "%d\n", hnum); cbdatumprintf(datum, "%d\n", page * max + 1); cbdatumprintf(datum, "%d\n", max); cbdatumprintf(datum, "\n", req->prefix, NODEPREFIX, node->name, OPENSEARCHCMD, OSRCHMIMETYPE); cbdatumprintf(datum, "\n"); if(!top){ if(!order && phrase && cbstrfwmatch(phrase, ESTOPSIMILAR)) order = DATTRNDSCORE " " ESTORDNUMD; resdocs = resmap_list(resmap, &rnum, order, NULL); for(i = page * max; i < rnum && i < end; i++){ catdocdatarss(datum, resdocs[i], ltarg.words, node); } free(resdocs); } cbdatumprintf(datum, "\n"); if(req->gzip){ if((zbuf = est_deflate(cbdatumptr(datum), cbdatumsize(datum), &zsiz, 1)) != NULL){ est_sock_send_all(clsock, zbuf, zsiz); free(zbuf); } } else if(req->deflate){ if((zbuf = est_deflate(cbdatumptr(datum), cbdatumsize(datum), &zsiz, 0)) != NULL){ est_sock_send_all(clsock, zbuf, zsiz); free(zbuf); } } else { est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); } cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (%s)", req->claddr, req->clport, SEARCHRSSCMD); cblistclose(ltarg.words); est_cond_delete(ltarg.cond); for(i = 0; i < cbmaprnum(node->links); i++){ free(rtargs[i].label); est_cond_delete(rtargs[i].cond); } free(rtargs); free(rths); cbmapclose(hints); resmap_delete(resmap); cbdatumclose(condbuf); est_cond_delete(cond); free(myurl); } /* send the result of OpenSearch description */ static void sendnodecmdopensearch(int clsock, REQUEST *req, NODE *node){ CBDATUM *datum; char *dstr, *zbuf; int zsiz; datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, UICACHELIFE); cbdatumprintf(datum, "Content-Type: %s\r\n", OSRCHMIMETYPE); if(req->gzip){ cbdatumprintf(datum, "Content-Encoding: gzip\r\n"); } else if(req->deflate){ cbdatumprintf(datum, "Content-Encoding: deflate\r\n"); } cbdatumprintf(datum, "Content-Disposition: inline; filename=%s.xml\r\n", node->name); dstr = cbdatestrhttp(node->mtime, 0); cbdatumprintf(datum, "Last-Modified: %s\r\n", dstr); free(dstr); cbdatumprintf(datum, "\r\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumsetsize(datum, 0); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", _EST_XNNODE); cbdatumprintf(datum, "%@\n", node->name); cbdatumprintf(datum, "%@\n", node->label); cbdatumprintf(datum, "Hyper Estraier %@ %@ %@\n", SERVNAME, node->name, node->label); cbdatumprintf(datum, "%@\n", g_adminemail); cbdatumprintf(datum, "\n", ATOMMIMETYPE, req->prefix, NODEPREFIX, node->name, SEARCHATOMCMD); cbdatumprintf(datum, "\n", UIMIMETYPE, req->prefix, NODEPREFIX, node->name, SEARCHUICMD); cbdatumprintf(datum, "" "%@%@\n", req->prefix, FAVICONLOC); cbdatumprintf(datum, "" "%@%@%@\n", req->prefix, IMAGEPREFIX, BIGICONNAME); switch(g_uiphraseform){ default: cbdatumprintf(datum, "\n", "search AND hyperestraier OR hyperestraier"); break; case PM_SIMPLE: case PM_ROUGH: cbdatumprintf(datum, "\n", "search \"hyper estraier\" | hyperestraier"); break; case PM_UNION: case PM_ISECT: cbdatumprintf(datum, "\n", "hop step jump"); break; } cbdatumprintf(datum, "%d\n", est_mtdb_doc_num(node->db)); cbdatumprintf(datum, "%d\n", est_mtdb_word_num(node->db)); cbdatumprintf(datum, "%.0f\n", est_mtdb_size(node->db)); cbdatumprintf(datum, "\n"); if(req->gzip){ if((zbuf = est_deflate(cbdatumptr(datum), cbdatumsize(datum), &zsiz, 1)) != NULL){ est_sock_send_all(clsock, zbuf, zsiz); free(zbuf); } } else if(req->deflate){ if((zbuf = est_deflate(cbdatumptr(datum), cbdatumsize(datum), &zsiz, 0)) != NULL){ est_sock_send_all(clsock, zbuf, zsiz); free(zbuf); } } else { est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); } cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (opensearch)", req->claddr, req->clport); } /* send administration interface data */ static void sendmasteruidata(int clsock, REQUEST *req, USER *user){ CBDATUM *datum; CBLIST *list, *words; USER *tuser; NODE *tnode; const char *tmp, *name, *passwd, *flags, *fname, *misc, *label, *admins, *users, *links; char *pbuf, *pv, *nv; int i, action, sure, vml, vul, vnl, vne, vns, size, dnum, msiz; double fsiz; time_t rsec; action = UI_NONE; if((tmp = cbmapget(req->params, "action", -1, NULL)) != NULL) action = atoi(tmp); sure = FALSE; if((tmp = cbmapget(req->params, "sure", -1, NULL)) != NULL) sure = atoi(tmp) > 0; if(!(name = cbmapget(req->params, "name", -1, NULL))) name = ""; if(!(passwd = cbmapget(req->params, "passwd", -1, NULL))) passwd = ""; if(!(flags = cbmapget(req->params, "flags", -1, NULL))) flags = ""; if(!(fname = cbmapget(req->params, "fname", -1, NULL))) fname = ""; if(!(misc = cbmapget(req->params, "misc", -1, NULL))) misc = ""; if(!(label = cbmapget(req->params, "label", -1, NULL))) label = ""; admins = cbmapget(req->params, "admins", -1, NULL); users = cbmapget(req->params, "users", -1, NULL); links = cbmapget(req->params, "links", -1, NULL); if(!rwlock_lock(g_mgrlock, TRUE)){ log_print(LL_ERROR, "locking failed"); senderror(clsock, req, 500, "Internal Server Error (locking failed)"); return; } if(req->referer && !cbstrfwmatch(req->referer, req->prefix) && action != UI_VIEWMASTER && action != UI_VIEWUSERS && action != UI_VIEWNODES && action != UI_STATNODE && action != UI_NONE){ senderror(clsock, req, 403, "Forbidden (invalid referrer)"); if(!rwlock_unlock(g_mgrlock)) log_print(LL_ERROR, "unlocking failed"); return; } if(!ismasteradmin(req, user)){ sendautherror(clsock, req, "Super User"); if(!rwlock_unlock(g_mgrlock)) log_print(LL_ERROR, "unlocking failed"); return; } datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: %s\r\n", UIMIMETYPE); cbdatumprintf(datum, "\r\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", UIMIMETYPE); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", SERVNAME, est_version); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", req->prefix, MASTERUILOC); cbdatumprintf(datum, "\n", req->prefix, FAVICONLOC); cbdatumprintf(datum, "\n", g_adminemail); cbdatumprintf(datum, "Administration Interface of Hyper Estraier\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "

Administration Interface

\n"); cbdatumprintf(datum, "
    \n"); vml = FALSE; vul = FALSE; vnl = FALSE; vne = FALSE; vns = FALSE; switch(action){ case UI_VIEWMASTER: case UI_SHUTDOWN: case UI_SYNCNODES: case UI_BACKUPDB: vml = TRUE; break; case UI_VIEWUSERS: case UI_NEWUSER: case UI_DELUSER: vul = TRUE; break; case UI_VIEWNODES: case UI_NEWNODE: case UI_DELENODE: vnl = TRUE; break; case UI_EDITNODE: vne = TRUE; break; case UI_STATNODE: vns = TRUE; break; default: break; } if(vml){ cbdatumprintf(datum, "
  • Manage Master" "
  • \n", req->prefix, MASTERUILOC, UI_VIEWMASTER); } else { cbdatumprintf(datum, "
  • Manage Master
  • \n", req->prefix, MASTERUILOC, UI_VIEWMASTER); } if(vul){ cbdatumprintf(datum, "
  • Manage Users" "
  • \n", req->prefix, MASTERUILOC, UI_VIEWUSERS); } else { cbdatumprintf(datum, "
  • Manage Users
  • \n", req->prefix, MASTERUILOC, UI_VIEWUSERS); } if(vnl || vne || vns){ cbdatumprintf(datum, "
  • Manage Nodes" "
  • \n", req->prefix, MASTERUILOC, UI_VIEWNODES); } else { cbdatumprintf(datum, "
  • Manage Nodes
  • \n", req->prefix, MASTERUILOC, UI_VIEWNODES); } cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); switch(action){ case UI_SHUTDOWN: if(sure){ g_sigterm = TRUE; cbdatumprintf(datum, "

Shutdown operation has been ordered.

\n"); } else { cbdatumprintf(datum, "
\n", req->prefix, MASTERUILOC); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "confirmation to shutdown the master server:\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", UI_SHUTDOWN); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); } cbdatumprintf(datum, "
\n"); break; case UI_SYNCNODES: if(sure){ g_sigsync = TRUE; cbdatumprintf(datum, "

Synchronus operation has been ordered.

\n"); } else { cbdatumprintf(datum, "
\n", req->prefix, MASTERUILOC); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "confirmation to synchronize all nodes:\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", UI_SYNCNODES); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); } cbdatumprintf(datum, "
\n"); break; case UI_BACKUPDB: if(sure){ g_sigback = TRUE; cbdatumprintf(datum, "

Backup operation has been ordered.

\n"); } else { cbdatumprintf(datum, "
\n", req->prefix, MASTERUILOC); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "confirmation to backup the database:\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", UI_BACKUPDB); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); } cbdatumprintf(datum, "
\n"); break; case UI_NEWUSER: pbuf = est_make_crypt(passwd); if(g_runmode == RM_RDONLY){ cbdatumprintf(datum, "

The server is in read only mode.

\n"); } else if(name[0] == '\0' || passwd[0] == '\0'){ cbdatumprintf(datum, "

The name and the password sould not be empty.

\n"); } else if((tuser = umgr_get(g_umgr, name)) != NULL){ cbdatumprintf(datum, "

The name should not be duplicated.

\n"); } else if(!check_alnum_name(name)){ cbdatumprintf(datum, "

The name can include alphanumeric characters only.

\n"); } else if(umgr_put(g_umgr, name, pbuf, flags, fname, misc)){ cbdatumprintf(datum, "

%@ was created successfully.

\n", name); } else { cbdatumprintf(datum, "

Some errors occurred.

\n"); } free(pbuf); cbdatumprintf(datum, "
\n"); break; case UI_DELUSER: if(g_runmode == RM_RDONLY){ cbdatumprintf(datum, "

The server is in read only mode.

\n"); } else if(sure){ if(umgr_out(g_umgr, name)){ cbdatumprintf(datum, "

%@ was deleted successfully.

\n", name); } else { cbdatumprintf(datum, "

Some errors occurred.

\n"); } } else { cbdatumprintf(datum, "
\n", req->prefix, MASTERUILOC); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "confirmation to delete %@:\n", name); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", UI_DELUSER); cbdatumprintf(datum, "\n", name); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); } cbdatumprintf(datum, "
\n"); break; case UI_NEWNODE: if(g_runmode == RM_RDONLY){ cbdatumprintf(datum, "

The server is in read only mode.

\n"); } else if(name[0] == '\0' || label[0] == '\0'){ cbdatumprintf(datum, "

The name and the label sould not be empty.

\n"); } else if((tnode = nmgr_get(g_nmgr, name)) != NULL){ cbdatumprintf(datum, "

The name should not be duplicated.

\n"); } else if(!check_alnum_name(name)){ cbdatumprintf(datum, "

The name can include alphanumeric characters only.

\n"); } else if(nmgr_put(g_nmgr, name, TRUE, getnodeoptions())){ if((tnode = nmgr_get(g_nmgr, name)) != NULL){ free(tnode->label); tnode->label = cbmemdup(label, -1); } nmgr_sync(g_nmgr, FALSE); cbdatumprintf(datum, "

%@ was created successfully.

\n", name); } else { cbdatumprintf(datum, "

Some errors occurred.

\n"); } cbdatumprintf(datum, "
\n"); break; case UI_DELENODE: if(g_runmode == RM_RDONLY){ cbdatumprintf(datum, "

The server is in read only mode.

\n"); } else if(sure){ if(nmgr_out(g_nmgr, name)){ cbdatumprintf(datum, "

%@ was deleted successfully.

\n", name); } else { cbdatumprintf(datum, "

Some errors occurred.

\n"); } } else { cbdatumprintf(datum, "
\n", req->prefix, MASTERUILOC); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "confirmation to delete %@:\n", name); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", UI_DELENODE); cbdatumprintf(datum, "\n", name); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); } cbdatumprintf(datum, "
\n"); break; case UI_EDITNODE: if(!(tnode = nmgr_get(g_nmgr, name))){ cbdatumprintf(datum, "

Some errors occurred.

\n"); cbdatumprintf(datum, "
\n"); } else if(label[0] != '\0'){ free(tnode->label); tnode->label = cbmemdup(label, -1); cbdatumprintf(datum, "

The label was updated.

\n"); cbdatumprintf(datum, "
\n"); } else if(admins){ cbmapclose(tnode->admins); tnode->admins = cbmapopenex(MINIBNUM); list = cbsplit(admins, -1, "\r\n"); for(i = 0; i < cblistnum(list); i++){ pbuf = cbmemdup(cblistval(list, i, NULL), -1); cbstrtrim(pbuf); if(pbuf[0] != '\0' && check_alnum_name(pbuf)) cbmapput(tnode->admins, pbuf, -1, "", 0, TRUE); free(pbuf); } cblistclose(list); cbdatumprintf(datum, "

The list of administrators was updated.

\n"); cbdatumprintf(datum, "
\n"); } else if(users){ cbmapclose(tnode->users); tnode->users = cbmapopenex(MINIBNUM); list = cbsplit(users, -1, "\r\n"); for(i = 0; i < cblistnum(list); i++){ pbuf = cbmemdup(cblistval(list, i, NULL), -1); cbstrtrim(pbuf); if(pbuf[0] != '\0' && check_alnum_name(pbuf)) cbmapput(tnode->users, pbuf, -1, "", 0, TRUE); free(pbuf); } cblistclose(list); cbdatumprintf(datum, "

The list of normal users was updated.

\n"); cbdatumprintf(datum, "
\n"); } else if(links){ cbmapclose(tnode->links); tnode->links = cbmapopenex(MINIBNUM); list = cbsplit(links, -1, "\r\n"); for(i = 0; i < cblistnum(list); i++){ pbuf = cbmemdup(cblistval(list, i, NULL), -1); cbstrtrim(pbuf); if((pv = strstr(pbuf, DELIMSTR)) != NULL && (nv = strstr(pv + 1, DELIMSTR)) != NULL){ *pv = '\0'; pv += strlen(DELIMSTR); *nv = '\0'; nv += strlen(DELIMSTR); node_set_link(tnode, pbuf, pv, atoi(nv)); } free(pbuf); } cblistclose(list); cbdatumprintf(datum, "

The list of links was updated.

\n"); cbdatumprintf(datum, "
\n"); } break; default: break; } if(vml){ cbdatumprintf(datum, "
    \n"); cbdatumprintf(datum, "
  • "); cbdatumprintf(datum, "SHUTDOWN", req->prefix, MASTERUILOC, UI_SHUTDOWN); cbdatumprintf(datum, "
  • \n"); cbdatumprintf(datum, "
  • "); cbdatumprintf(datum, "SYNCHRONIZE", req->prefix, MASTERUILOC, UI_SYNCNODES); cbdatumprintf(datum, "
  • \n"); if(g_backupcmd[0] != '\0'){ cbdatumprintf(datum, "
  • "); cbdatumprintf(datum, "BACKUP", req->prefix, MASTERUILOC, UI_BACKUPDB); cbdatumprintf(datum, "
  • \n"); } cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); list = nmgr_names(g_nmgr); dnum = 0; fsiz = 0.0; msiz = 0; for(i = 0; i < cblistnum(list); i++){ if(!(tmp = cblistval(list, i, NULL)) || !(tnode = nmgr_get(g_nmgr, tmp))) continue; dnum += est_mtdb_doc_num(tnode->db); fsiz += est_mtdb_size(tnode->db); if((size = est_mtdb_used_cache_size(tnode->db)) > msiz) msiz = size; } g_cacheratio = msiz / g_cachesize; cblistclose(list); rsec = req->now - g_startdate; cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
total number of documents
\n"); cbdatumprintf(datum, "
%d
\n", dnum); cbdatumprintf(datum, "
total size of database files
\n"); cbdatumprintf(datum, "
%0.0fMB
\n", fsiz / 1024.0 / 1024.0); cbdatumprintf(datum, "
worst usage ratio of the writing cache
\n"); cbdatumprintf(datum, "
%0.1f%%
\n", g_cacheratio * 100.0); cbdatumprintf(datum, "
total access count
\n"); cbdatumprintf(datum, "
%d
\n", g_accesscount); cbdatumprintf(datum, "
running time
\n"); pbuf = cbdatestrwww(g_startdate, 0); cbdatumprintf(datum, "
%dh %dm %ds (since %@)
\n", (int)(rsec / 3600), (int)((rsec / 60) % 60), (int)(rsec % 60), pbuf); free(pbuf); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); } if(vul){ list = umgr_names(g_umgr); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); for(i = 0; i < cblistnum(list); i++){ if(!(tmp = cblistval(list, i, NULL)) || !(tuser = umgr_get(g_umgr, tmp))) continue; pbuf = cbmemdup(tuser->passwd, -1); if(strlen(pbuf) > 8) sprintf(pbuf + 4, "..."); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", tuser->name); cbdatumprintf(datum, "\n", pbuf); cbdatumprintf(datum, "\n", tuser->flags); cbdatumprintf(datum, "\n", tuser->fname); cbdatumprintf(datum, "\n", tuser->misc); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); free(pbuf); } cbdatumprintf(datum, "
namepasswordflagsfull namemiscactions
%@%@%@%@%@"); cbdatumprintf(datum, "DELE", req->prefix, MASTERUILOC, UI_DELUSER, tuser->name); cbdatumprintf(datum, "
\n"); cblistclose(list); cbdatumprintf(datum, "
\n", req->prefix, MASTERUILOC); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", UI_NEWUSER); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); } if(vnl){ list = nmgr_names(g_nmgr); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); for(i = 0; i < cblistnum(list); i++){ if(!(tmp = cblistval(list, i, NULL)) || !(tnode = nmgr_get(g_nmgr, tmp))) continue; cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", req->prefix, NODEPREFIX, tnode->name, SEARCHUICMD, tnode->name); cbdatumprintf(datum, "\n", tnode->label); cbdatumprintf(datum, "\n", est_mtdb_doc_num(tnode->db)); cbdatumprintf(datum, "\n", est_mtdb_word_num(tnode->db)); cbdatumprintf(datum, "\n", est_mtdb_size(tnode->db) / 1024.0 / 1024.0); cbdatumprintf(datum, "\n", cbmaprnum(tnode->admins)); cbdatumprintf(datum, "\n", cbmaprnum(tnode->users)); cbdatumprintf(datum, "\n", cbmaprnum(tnode->links)); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); } cbdatumprintf(datum, "
namelabel#docs#wordssize#a#u#lactions
%@%@%d%d%.1f%d%d%d"); cbdatumprintf(datum, "STAT", req->prefix, MASTERUILOC, UI_STATNODE, tnode->name); cbdatumprintf(datum, " / EDIT", req->prefix, MASTERUILOC, UI_EDITNODE, tnode->name); cbdatumprintf(datum, " / DELE", req->prefix, MASTERUILOC, UI_DELENODE, tnode->name); cbdatumprintf(datum, "
\n"); cblistclose(list); cbdatumprintf(datum, "
\n", req->prefix, MASTERUILOC); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", UI_NEWNODE); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); } if(vne){ if((tnode = nmgr_get(g_nmgr, name)) != NULL){ cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
name
\n"); cbdatumprintf(datum, "
%@
\n", tnode->name); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n", req->prefix, MASTERUILOC); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
label
\n"); cbdatumprintf(datum, "
"); cbdatumprintf(datum, "", tnode->label); cbdatumprintf(datum, " "); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "\n", UI_EDITNODE); cbdatumprintf(datum, "\n", name); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n", req->prefix, MASTERUILOC); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
list of administrators
\n"); cbdatumprintf(datum, "
"); cbdatumprintf(datum, ""); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
"); cbdatumprintf(datum, ""); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "\n", UI_EDITNODE); cbdatumprintf(datum, "\n", name); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n", req->prefix, MASTERUILOC); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
list of normal users
\n"); cbdatumprintf(datum, "
"); cbdatumprintf(datum, ""); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
"); cbdatumprintf(datum, ""); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "\n", UI_EDITNODE); cbdatumprintf(datum, "\n", name); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n", req->prefix, MASTERUILOC); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
list of links
\n"); cbdatumprintf(datum, "
"); cbdatumprintf(datum, ""); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
"); cbdatumprintf(datum, ""); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "\n", UI_EDITNODE); cbdatumprintf(datum, "\n", name); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); } else { cbdatumprintf(datum, "

Some errors occured.

\n"); } cbdatumprintf(datum, "
\n"); } if(vns){ if((tnode = nmgr_get(g_nmgr, name)) != NULL){ cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
name
\n"); cbdatumprintf(datum, "
%@
\n", tnode->name); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
label
\n"); cbdatumprintf(datum, "
%@
\n", tnode->label); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
number of documents
\n"); cbdatumprintf(datum, "
%d
\n", est_mtdb_doc_num(tnode->db)); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
number of unique words
\n"); cbdatumprintf(datum, "
%d
\n", est_mtdb_word_num(tnode->db)); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
size of the database
\n"); cbdatumprintf(datum, "
%.1fMB
\n", est_mtdb_size(tnode->db) / 1024.0 / 1024.0); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
words in the reading cache
\n"); cbdatumprintf(datum, "
"); words = est_mtdb_list_rescc(tnode->db); for(i = 0; i < cblistnum(words); i++){ tmp = cblistval(words, i, NULL); if(i > 0) cbdatumprintf(datum, ", "); cbdatumprintf(datum, "%@", req->prefix, NODEPREFIX, tnode->name, SEARCHUICMD, tmp, tmp); } cblistclose(words); cbdatumprintf(datum, "...
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
usage ratio of the writing cache
\n"); size = est_mtdb_used_cache_size(tnode->db); cbdatumprintf(datum, "
%.1f%% (%.1fMB / %.1fMB), %d unique words
", size / g_cachesize * 100, size / 1024.0 / 1024.0, g_cachesize / 1024 / 1024, est_mtdb_cache_num(tnode->db)); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
modification date
\n"); pbuf = cbdatestrhttp(tnode->mtime, 0); cbdatumprintf(datum, "
%@
", pbuf); free(pbuf); cbdatumprintf(datum, "
\n"); } else { cbdatumprintf(datum, "

Some errors occured.

\n"); } cbdatumprintf(datum, "
\n"); } cbdatumprintf(datum, "
Powered by Hyper Estraier" " %@.
\n", _EST_PROJURL, est_version); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (ui:%d)", req->claddr, req->clport, action); if(!rwlock_unlock(g_mgrlock)) log_print(LL_ERROR, "unlocking failed"); } /* send the favorite icon data */ static void sendfavicondata(int clsock, REQUEST *req){ CBDATUM *datum; if(req->ims > 0){ sendnotmoderror(clsock, req); return; } datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, IMGCACHELIFE); cbdatumprintf(datum, "Content-Length: %d\r\n", sizeof(g_favicon)); cbdatumprintf(datum, "Content-Type: image/png\r\n"); cbdatumprintf(datum, "Last-Modified: Sat, 01 Jan 2000 00:00:00 GMT\r\n"); cbdatumprintf(datum, "\r\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); est_sock_send_all(clsock, (char *)g_favicon, sizeof(g_favicon)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (favicon)", req->claddr, req->clport); } /* send a image data */ static void sendimagedata(int clsock, REQUEST *req, const char *name){ CBDATUM *datum; const char *ptr, *type; int size; if(req->ims > 0){ sendnotmoderror(clsock, req); return; } if(!strcmp(name, BIGICONNAME)){ ptr = (char *)g_bigicon; size = sizeof(g_bigicon); type = "image/png"; } else if(!strcmp(name, CANVASNAME)){ ptr = (char *)g_canvas; size = sizeof(g_canvas); type = "image/png"; } else { senderror(clsock, req, 404, "File Not Found"); return; } datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, IMGCACHELIFE); cbdatumprintf(datum, "Content-Length: %d\r\n", size); cbdatumprintf(datum, "Content-Type: %s\r\n", type); cbdatumprintf(datum, "Last-Modified: Sat, 01 Jan 2000 00:00:00 GMT\r\n"); cbdatumprintf(datum, "\r\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); est_sock_send_all(clsock, ptr, size); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (%s)", req->claddr, req->clport, name); } /* send a file data */ static void sendfiledata(int clsock, REQUEST *req){ struct stat sbuf; CBLIST *list; CBDATUM *datum; const char *elem; char *path, *index, pbuf[URIBUFSIZ], ibuf[IOBUFSIZ], *ext, *tmp; int i, fd, len, fdir; time_t ims; double size; path = makelocalpath(req->target); if(g_indexfile[0] != '\0'){ index = cbsprintf("%s%c%s", path, ESTPATHCHR, g_indexfile); if(stat(index, &sbuf) == 0 && cbstrbwmatch(req->target, "/")){ free(path); path = index; index = NULL; } free(index); } if((list = cbdirlist(path)) != NULL){ datum = cbdatumopen(NULL, -1); if(cbstrbwmatch(req->target, "/")){ cblistsort(list); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: %s\r\n", DIRMIMETYPE); cbdatumprintf(datum, "\r\n"); if(req->method != HM_HEAD){ cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", DIRMIMETYPE); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", SERVNAME, est_version); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", req->prefix, FAVICONLOC); cbdatumprintf(datum, "\n", g_adminemail); cbdatumprintf(datum, "%@\n", req->target); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "

Index of %@

\n", req->target); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
    \n"); if(strcmp(req->target, "/")) cbdatumprintf(datum, "
  • ../
  • \n"); for(i = 0; i < cblistnum(list); i++){ elem = cblistval(list, i, NULL); if(!strcmp(elem, ESTCDIRSTR) || !strcmp(elem, ESTPDIRSTR) || elem[0] == ESTEXTCHR) continue; sprintf(pbuf, "%s%c%s", path, ESTPATHCHR, elem); if(!cbfilestat(pbuf, &fdir, NULL, NULL)) continue; cbdatumprintf(datum, "
  • %@%s
  • \n", elem, fdir ? "/" : "", elem, fdir ? "/" : ""); } cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
%@/%@ at %@/
\n", SERVNAME, est_version, req->prefix); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); } log_print(LL_DEBUG, "[%s:%d]: 200 OK (directory)", req->claddr, req->clport); } else { cblistsort(list); cbdatumprintf(datum, "HTTP/1.0 301 Moved Parmanently\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Location: %s%s/\r\n", req->prefix, req->target); cbdatumprintf(datum, "Content-Type: text/plain\r\n"); cbdatumprintf(datum, "\r\n"); if(req->method != HM_HEAD) cbdatumprintf(datum, "Go to %s/\n", req->target); log_print(LL_DEBUG, "[%s:%d]: 301 (moved parmanently)", req->claddr, req->clport); } est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); cblistclose(list); } else if(strstr(path, ESTPATHSTR ESTEXTSTR)){ senderror(clsock, req, 403, "Forbidden"); } else if((fd = open(path, O_RDONLY, 0)) != -1){ if(fstat(fd, &sbuf) == 0){ ims = sbuf.st_mtime; size = sbuf.st_size; } else { ims = -1; size = -1.0; } if(req->ims > 0 && ims <= req->ims){ sendnotmoderror(clsock, req); } else { datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); if(ims > 0){ tmp = cbdatestrhttp(ims, 0); cbdatumprintf(datum, "Last-Modified: %s\r\n", tmp); free(tmp); } if(size >= 0.0) cbdatumprintf(datum, "Content-Length: %.0f\r\n", size); ext = strrchr(path, ESTPATHCHR); ext = strrchr(ext ? ext : path, '.'); cbdatumprintf(datum, "Content-Type: %s\r\n", est_ext_type(ext ? ext : "")); cbdatumprintf(datum, "\r\n"); est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); if(req->method != HM_HEAD){ while((len = read(fd, ibuf, IOBUFSIZ)) > 0 && !g_sigterm){ send(clsock, ibuf, len, 0); } } cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (file)", req->claddr, req->clport); } close(fd); } else { senderror(clsock, req, 404, "Not Found"); } free(path); } /* make the local path of a target */ static char *makelocalpath(const char *target){ CBLIST *list; CBDATUM *datum; const char *elem; char *tmp; int i; datum = cbdatumopen(g_docroot, -1); list = cbsplit(target, -1, "/"); for(i = 0; i < cblistnum(list); i++){ elem = cblistval(list, i, NULL); if(elem[0] == '\0') continue; tmp = cburldecode(elem, NULL); cbdatumprintf(datum, "%c%s", ESTPATHCHR, tmp); free(tmp); } cblistclose(list); return cbdatumtomalloc(datum, NULL); } /* send the menu data */ static void sendmenudata(int clsock, REQUEST *req){ NODE *tnode; CBDATUM *datum; CBLIST *list; const char *tmp; int i; if(!rwlock_lock(g_mgrlock, FALSE)){ log_print(LL_ERROR, "locking failed"); senderror(clsock, req, 500, "Internal Server Error (locking failed)"); return; } datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "HTTP/1.0 200 OK\r\n"); addservinfo(datum, req->now, 0); cbdatumprintf(datum, "Content-Type: %s\r\n", DIRMIMETYPE); cbdatumprintf(datum, "\r\n"); if(req->method != HM_HEAD){ cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", MENUMIMETYPE); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", SERVNAME, est_version); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n", req->prefix, FAVICONLOC); cbdatumprintf(datum, "\n", g_adminemail); cbdatumprintf(datum, "%@\n", SERVNAME); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "

Hyper Estraier

\n"); list = nmgr_names(g_nmgr); if(cblistnum(list) > 0){ cbdatumprintf(datum, "
    \n"); for(i = 0; i < cblistnum(list); i++){ if(!(tmp = cblistval(list, i, NULL)) || !(tnode = nmgr_get(g_nmgr, tmp))) continue; cbdatumprintf(datum, "
  • %@
  • \n", req->prefix, NODEPREFIX, tnode->name, SEARCHUICMD, tnode->name); } cbdatumprintf(datum, "
\n"); } cblistclose(list); cbdatumprintf(datum, "
    \n"); cbdatumprintf(datum, "
  • administration
  • \n", req->prefix, MASTERUILOC); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
\n"); cbdatumprintf(datum, "
%@/%@ at %@/
\n", SERVNAME, est_version, req->prefix); cbdatumprintf(datum, "\n"); cbdatumprintf(datum, "\n"); } est_sock_send_all(clsock, cbdatumptr(datum), cbdatumsize(datum)); cbdatumclose(datum); log_print(LL_DEBUG, "[%s:%d]: 200 OK (menu)", req->claddr, req->clport); if(!rwlock_unlock(g_mgrlock)) log_print(LL_ERROR, "unlocking failed"); } /* END OF FILE */ hyperestraier-1.4.13/estmtdb.c000066400000000000000000000477511125261632700163170ustar00rootroot00000000000000/************************************************************************************************* * Implementation of the MT-safe API * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #include "estraier.h" #include "estmtdb.h" #include "myconf.h" #define ESTMINIBNUM 31 /* bucket number of map for attributes */ /* private function prototypes */ static int est_global_lock(void); static void est_global_unlock(void); static int est_mtdb_lock(ESTMTDB *db); static void est_mtdb_unlock(ESTMTDB *db); /************************************************************************************************* * API for MT-safe database *************************************************************************************************/ /* Global mutex. */ pthread_mutex_t est_global_mutex = PTHREAD_MUTEX_INITIALIZER; CBMAP *est_global_db_names = NULL; /* Open a database. */ ESTMTDB *est_mtdb_open(const char *name, int omode, int *ecp){ ESTMTDB *mtdb; ESTDB *db; char *path; assert(name && ecp); if(!est_global_lock()){ *ecp = ESTELOCK; return NULL; } if(!est_global_db_names){ est_global_db_names = cbmapopenex(ESTMINIBNUM); cbglobalgc(est_global_db_names, (void (*)(void *))cbmapclose); } path = est_realpath(name); if(cbmapget(est_global_db_names, path, -1, NULL)){ free(path); *ecp = ESTEACCES; est_global_unlock(); return NULL; } mtdb = cbmalloc(sizeof(ESTMTDB)); if(!(db = est_db_open(name, omode, ecp))){ free(mtdb); free(path); est_global_unlock(); return NULL; } free(path); path = est_realpath(name); cbmapput(est_global_db_names, path, -1, "", 0, FALSE); mtdb->db = db; mtdb->path = path; pthread_mutex_init(&(mtdb->mutex), NULL); est_global_unlock(); return mtdb; } /* Close a database. */ int est_mtdb_close(ESTMTDB *db, int *ecp){ int err; assert(db && ecp); if(!est_global_lock()){ *ecp = ESTELOCK; return FALSE; } err = FALSE; cbmapout(est_global_db_names, db->path, -1); pthread_mutex_destroy(&(db->mutex)); free(db->path); if(!est_db_close(db->db, ecp)) err = TRUE; free(db); est_global_unlock(); return err ? FALSE : TRUE; } /* Get the last happended error code of a database. */ int est_mtdb_error(ESTMTDB *db){ int rv; assert(db); if(!est_mtdb_lock(db)) return ESTELOCK; rv = est_db_error(db->db); est_mtdb_unlock(db); return rv; } /* Check whether a database has a fatal error. */ int est_mtdb_fatal(ESTMTDB *db){ int rv; assert(db); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_fatal(db->db); est_mtdb_unlock(db); return rv; } /* Add an index for narrowing or sorting with document attributes. */ int est_mtdb_add_attr_index(ESTMTDB *db, const char *name, int type){ int rv; assert(db && name); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_add_attr_index(db->db, name, type); est_mtdb_unlock(db); return rv; } /* Flush index words in the cache of a database. */ int est_mtdb_flush(ESTMTDB *db, int max){ int rv; assert(db); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_flush(db->db, max); est_mtdb_unlock(db); return rv; } /* Synchronize updating contents of a database. */ int est_mtdb_sync(ESTMTDB *db){ int rv; assert(db); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_sync(db->db); est_mtdb_unlock(db); return rv; } /* Optimize a database. */ int est_mtdb_optimize(ESTMTDB *db, int options){ int rv; assert(db); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_optimize(db->db, options); est_mtdb_unlock(db); return rv; } /* Merge another database. */ int est_mtdb_merge(ESTMTDB *db, const char *name, int options){ int rv; assert(db && name); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_merge(db->db, name, options); est_mtdb_unlock(db); return rv; } /* Add a document to a database. */ int est_mtdb_put_doc(ESTMTDB *db, ESTDOC *doc, int options){ int rv; assert(db && doc); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_put_doc(db->db, doc, options); est_mtdb_unlock(db); return rv; } /* Remove a document from a database. */ int est_mtdb_out_doc(ESTMTDB *db, int id, int options){ int rv; assert(db && id > 0); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_out_doc(db->db, id, options); est_mtdb_unlock(db); return rv; } /* Edit attributes of a document object in a database. */ int est_mtdb_edit_doc(ESTMTDB *db, ESTDOC *doc){ int rv; assert(db && doc); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_edit_doc(db->db, doc); est_mtdb_unlock(db); return rv; } /* Retrieve a document in a database. */ ESTDOC *est_mtdb_get_doc(ESTMTDB *db, int id, int options){ ESTDOC *rv; assert(db && id > 0); if(!est_mtdb_lock(db)) return NULL; rv = est_db_get_doc(db->db, id, options); est_mtdb_unlock(db); return rv; } /* Retrieve the value of an attribute of a document in a database. */ char *est_mtdb_get_doc_attr(ESTMTDB *db, int id, const char *name){ char *rv; assert(db && id > 0 && name); if(!est_mtdb_lock(db)) return NULL; rv = est_db_get_doc_attr(db->db, id, name); est_mtdb_unlock(db); return rv; } /* Get the ID of a document spacified by URI. */ int est_mtdb_uri_to_id(ESTMTDB *db, const char *uri){ int rv; assert(db && uri); if(!est_mtdb_lock(db)) return -1; rv = est_db_uri_to_id(db->db, uri); est_mtdb_unlock(db); return rv; } /* Get the name of a database. */ const char *est_mtdb_name(ESTMTDB *db){ const char *rv; assert(db); if(!est_mtdb_lock(db)) return ""; rv = est_db_name(db->db); est_mtdb_unlock(db); return rv; } /* Get the number of documents in a database. */ int est_mtdb_doc_num(ESTMTDB *db){ int rv; assert(db); if(!est_mtdb_lock(db)) return 0; rv = est_db_doc_num(db->db); est_mtdb_unlock(db); return rv; } /* Get the number of unique words in a database. */ int est_mtdb_word_num(ESTMTDB *db){ int rv; assert(db); if(!est_mtdb_lock(db)) return 0; rv = est_db_word_num(db->db); est_mtdb_unlock(db); return rv; } /* Get the size of a database. */ double est_mtdb_size(ESTMTDB *db){ double rv; assert(db); if(!est_mtdb_lock(db)) return 0.0; rv = est_db_size(db->db); est_mtdb_unlock(db); return rv; } /* Search documents corresponding a condition for a database. */ int *est_mtdb_search(ESTMTDB *db, ESTCOND *cond, int *nump, CBMAP *hints){ int *rv; assert(db && cond && nump); if(!est_mtdb_lock(db)){ est_db_set_ecode(db->db, ESTELOCK); cbmapput(hints, "", 0, "0", -1, TRUE); *nump = 0; return cbmalloc(1); } rv = est_db_search(db->db, cond, nump, hints); est_mtdb_unlock(db); return rv; } /* Search plural databases for documents corresponding a condition. */ int *est_mtdb_search_meta(ESTMTDB **dbs, int dbnum, ESTCOND *cond, int *nump, CBMAP *hints){ ESTDB **cdbs; CBMAP *umap; const char *kbuf; int i, *rv; assert(dbs && dbnum >= 0 && cond && nump); cdbs = cbmalloc(dbnum * sizeof(ESTDB *) + 1); if(dpisreentrant){ umap = cbmapopenex(dbnum + 1); for(i = 0; i < dbnum; i++){ if(!cbmapget(umap, (char *)&(dbs[i]), sizeof(ESTDB *), NULL) && !est_mtdb_lock(dbs[i])){ while(--i >= 0){ est_mtdb_unlock(dbs[i]); } free(cdbs); est_db_set_ecode(cdbs[i], ESTELOCK); cbmapput(hints, "", 0, "0", -1, TRUE); *nump = 0; return cbmalloc(1); } cbmapput(umap, (char *)&(dbs[i]), sizeof(ESTDB *), "", 0, FALSE); cdbs[i] = dbs[i]->db; } rv = est_db_search_meta(cdbs, dbnum, cond, nump, hints); cbmapiterinit(umap); while((kbuf = cbmapiternext(umap, NULL)) != NULL){ est_mtdb_unlock(*(ESTMTDB **)kbuf); } cbmapclose(umap); } else { if(pthread_mutex_lock(&est_global_mutex) != 0){ *nump = 0; return cbmalloc(1); } for(i = 0; i < dbnum; i++){ cdbs[i] = dbs[i]->db; } rv = est_db_search_meta(cdbs, dbnum, cond, nump, hints); pthread_mutex_unlock(&est_global_mutex); } free(cdbs); return rv; } /* Check whether a document object matches the phrase of a search condition object definitely. */ int est_mtdb_scan_doc(ESTMTDB *db, ESTDOC *doc, ESTCOND *cond){ int rv; assert(db && doc && cond); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_scan_doc(db->db, doc, cond); est_mtdb_unlock(db); return rv; } /* Set the maximum size of the cache memory of a database. */ void est_mtdb_set_cache_size(ESTMTDB *db, size_t size, int anum, int tnum, int rnum){ assert(db); if(!est_mtdb_lock(db)) return; est_db_set_cache_size(db->db, size, anum, tnum, rnum); est_mtdb_unlock(db); } /* Add a pseudo index directory to a database. */ int est_mtdb_add_pseudo_index(ESTMTDB *db, const char *path){ int rv; assert(db && path); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_add_pseudo_index(db->db, path); est_mtdb_unlock(db); return rv; } /************************************************************************************************* * features for experts *************************************************************************************************/ /* Set the error code of a database. */ void est_mtdb_set_ecode(ESTMTDB *db, int ecode){ assert(db); if(!est_mtdb_lock(db)) return; est_db_set_ecode(db->db, ecode); est_mtdb_unlock(db); } /* Check whether an option is set. */ int est_mtdb_check_option(ESTMTDB *db, int option){ int rv; assert(db); if(!est_mtdb_lock(db)) return -1; rv = est_db_check_option(db->db, option); est_mtdb_unlock(db); return rv; } /* Get the inode number of a database. */ int est_mtdb_inode(ESTMTDB *db){ int rv; assert(db); if(!est_mtdb_lock(db)) return -1; rv = est_db_inode(db->db); est_mtdb_unlock(db); return rv; } /* Set the entity data of a document in a database. */ int est_mtdb_set_doc_entity(ESTMTDB *db, int id, const char *ptr, int size){ int rv; assert(db && id > 0); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_set_doc_entity(db->db, id, ptr, size); est_mtdb_unlock(db); return rv; } /* Get the entity data of a document in a database. */ char *est_mtdb_get_doc_entity(ESTMTDB *db, int id, int *sp){ char *rv; assert(db && id > 0 && sp); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_get_doc_entity(db->db, id, sp); est_mtdb_unlock(db); return rv; } /* Set the maximum number of extension of wild cards. */ void est_mtdb_set_wildmax(ESTMTDB *db, int num){ assert(db && num >= 0); if(!est_mtdb_lock(db)) return; est_db_set_wildmax(db->db, num); est_mtdb_unlock(db); } /* Add a piece of meta data to a database. */ void est_mtdb_add_meta(ESTMTDB *db, const char *name, const char *value){ assert(db && name); if(!est_mtdb_lock(db)) return; est_db_add_meta(db->db, name, value); est_mtdb_unlock(db); } /* Get a list of names of meta data of a database. */ CBLIST *est_mtdb_meta_names(ESTMTDB *db){ CBLIST *rv; assert(db); if(!est_mtdb_lock(db)) return NULL; rv = est_db_meta_names(db->db); est_mtdb_unlock(db); return rv; } /* Get the value of a piece of meta data of a database. */ char *est_mtdb_meta(ESTMTDB *db, const char *name){ char *rv; assert(db && name); if(!est_mtdb_lock(db)) return NULL; rv = est_db_meta(db->db, name); est_mtdb_unlock(db); return rv; } /* Extract keywords of a document object. */ CBMAP *est_mtdb_etch_doc(ESTMTDB *db, ESTDOC *doc, int max){ CBMAP *rv; assert(doc && max >= 0); if(!db) return est_db_etch_doc(NULL, doc, max); if(!est_mtdb_lock(db)) return cbmapopenex(1); rv = est_db_etch_doc(db->db, doc, max); est_mtdb_unlock(db); return rv; } /* Store a map object of keywords. */ int est_mtdb_put_keywords(ESTMTDB *db, int id, CBMAP *kwords, double weight){ int rv; assert(db && id > 0 && kwords); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_put_keywords(db->db, id, kwords, weight); est_mtdb_unlock(db); return rv; } /* Remove keywords of a document. */ int est_mtdb_out_keywords(ESTMTDB *db, int id){ int rv; assert(db && id > 0); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_out_keywords(db->db, id); est_mtdb_unlock(db); return rv; } /* Retrieve a map object of keywords. */ CBMAP *est_mtdb_get_keywords(ESTMTDB *db, int id){ CBMAP *rv; assert(db && id > 0); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_get_keywords(db->db, id); est_mtdb_unlock(db); return rv; } /* Mesure the total size of each inner records of a stored document. */ int est_mtdb_measure_doc(ESTMTDB *db, int id, int parts){ int rv; assert(db && id > 0); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_measure_doc(db->db, id, parts); est_mtdb_unlock(db); return rv; } /* Initialize the iterator of a database. */ int est_mtdb_iter_init(ESTMTDB *db, const char *prev){ int rv; assert(db); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_iter_init(db->db, prev); est_mtdb_unlock(db); return rv; } /* Get the next ID of the iterator of a database. */ int est_mtdb_iter_next(ESTMTDB *db){ int rv; assert(db); if(!est_mtdb_lock(db)) return -1; rv = est_db_iter_next(db->db); est_mtdb_unlock(db); return rv; } /* Initialize the word iterator of a database. */ int est_mtdb_word_iter_init(ESTMTDB *db){ int rv; assert(db); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_word_iter_init(db->db); est_mtdb_unlock(db); return rv; } /* Get the next word of the word iterator of a database. */ char *est_mtdb_word_iter_next(ESTMTDB *db){ char *rv; assert(db); if(!est_mtdb_lock(db)) return NULL; rv = est_db_word_iter_next(db->db); est_mtdb_unlock(db); return rv; } /* Get the size of the record of a word. */ int est_mtdb_word_rec_size(ESTMTDB *db, const char *word){ int rv; assert(db && word); if(!est_mtdb_lock(db)) return 0; rv = est_db_word_rec_size(db->db, word); est_mtdb_unlock(db); return rv; } /* Get the number of unique keywords in a database. */ int est_mtdb_keyword_num(ESTMTDB *db){ int rv; assert(db); if(!est_mtdb_lock(db)) return 0; rv = est_db_keyword_num(db->db); est_mtdb_unlock(db); return rv; } /* Initialize the keyword iterator of a database. */ int est_mtdb_keyword_iter_init(ESTMTDB *db){ int rv; assert(db); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_keyword_iter_init(db->db); est_mtdb_unlock(db); return rv; } /* Get the next keyword of the word iterator of a database. */ char *est_mtdb_keyword_iter_next(ESTMTDB *db){ char *rv; assert(db); if(!est_mtdb_lock(db)) return NULL; rv = est_db_keyword_iter_next(db->db); est_mtdb_unlock(db); return rv; } /* Get the size of the record of a keyword. */ int est_mtdb_keyword_rec_size(ESTMTDB *db, const char *word){ int rv; assert(db && word); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_keyword_rec_size(db->db, word); est_mtdb_unlock(db); return rv; } /* Search documents corresponding a keyword for a database. */ int *est_mtdb_keyword_search(ESTMTDB *db, const char *word, int *nump){ int *rv; assert(db && word && nump); if(!est_mtdb_lock(db)) return NULL; rv = est_db_keyword_search(db->db, word, nump); est_mtdb_unlock(db); return rv; } /* Get the number of records in the cache memory of a database. */ int est_mtdb_cache_num(ESTMTDB *db){ int rv; assert(db); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_cache_num(db->db); est_mtdb_unlock(db); return rv; } /* Get the size of used cache region. */ int est_mtdb_used_cache_size(ESTMTDB *db){ int rv; assert(db); if(!est_mtdb_lock(db)) return FALSE; rv = est_db_used_cache_size(db->db); est_mtdb_unlock(db); return rv; } /* Set the special cache for narrowing and sorting with document attributes. */ void est_mtdb_set_special_cache(ESTMTDB *db, const char *name, int num){ assert(db && name && num >= 0); if(!est_mtdb_lock(db)) return; est_db_set_special_cache(db->db, name, num); est_mtdb_unlock(db); } /* Set the callback function to inform of database events. */ void est_mtdb_set_informer(ESTMTDB *db, void (*func)(const char *, void *), void *opaque){ assert(db && func); if(!est_mtdb_lock(db)) return; est_db_set_informer(db->db, func, opaque); est_mtdb_unlock(db); } /* Fill the cache for keys for TF-IDF. */ void est_mtdb_fill_key_cache(ESTMTDB *db){ assert(db); if(!est_mtdb_lock(db)) return; est_db_fill_key_cache(db->db); est_mtdb_unlock(db); } /* Set the database of document frequency. */ void est_mtdb_set_dfdb(ESTMTDB *db, DEPOT *dfdb){ assert(db && dfdb); if(!est_mtdb_lock(db)) return; est_db_set_dfdb(db->db, dfdb); est_mtdb_unlock(db); } /* Clear the result cache. */ void est_mtdb_refresh_rescc(ESTMTDB *db){ assert(db); if(!est_mtdb_lock(db)) return; est_db_refresh_rescc(db->db); est_mtdb_unlock(db); } /* Charge the result cache. */ void est_mtdb_charge_rescc(ESTMTDB *db, int max){ assert(db); if(!est_mtdb_lock(db)) return; est_db_charge_rescc(db->db, max); est_mtdb_unlock(db); } /* Get a list of words in the result cache. */ CBLIST *est_mtdb_list_rescc(ESTMTDB *db){ CBLIST *rv; assert(db); if(!est_mtdb_lock(db)) return cblistopen(); rv = est_db_list_rescc(db->db); est_mtdb_unlock(db); return rv; } /* Get the number of pseudo documents in a database. */ int est_mtdb_pseudo_doc_num(ESTMTDB *db){ int rv; assert(db); if(!est_mtdb_lock(db)) return 0; rv = est_db_pseudo_doc_num(db->db); est_mtdb_unlock(db); return rv; } /* Get a list of expressions of attribute indexes of a database. */ CBLIST *est_mtdb_attr_index_exprs(ESTMTDB *db){ CBLIST *rv; assert(db); if(!est_mtdb_lock(db)) return 0; rv = est_db_attr_index_exprs(db->db); est_mtdb_unlock(db); return rv; } /* Interrupt long time processing. */ void est_mtdb_interrupt(ESTMTDB *db){ assert(db); est_db_interrupt(db->db); } /************************************************************************************************* * features for hyper experts *************************************************************************************************/ /* Get the usage ratio of the cache. */ double est_mtdb_cache_usage(ESTMTDB *db){ if(db->db->flsflag) return 1.0; return (double)db->db->icsiz / db->db->icmax; } /************************************************************************************************* * private objects *************************************************************************************************/ /* Lock the global environment. The return value is true if success, else it is false. */ static int est_global_lock(void){ return pthread_mutex_lock(&est_global_mutex) == 0; } /* Unlock the global environment. */ static void est_global_unlock(void){ pthread_mutex_unlock(&est_global_mutex); } /* Lock a database object. `db' specifies a database object. The return value is true if success, else it is false. */ static int est_mtdb_lock(ESTMTDB *db){ assert(db); if(dpisreentrant){ if(pthread_mutex_lock(&(db->mutex)) != 0){ est_db_set_ecode(db->db, ESTELOCK); return FALSE; } return TRUE; } if(pthread_mutex_lock(&est_global_mutex) != 0){ est_db_set_ecode(db->db, ESTELOCK); return FALSE; } return TRUE; } /* Unlock a database object. `db' specifies a database object. */ static void est_mtdb_unlock(ESTMTDB *db){ assert(db); if(dpisreentrant){ pthread_mutex_unlock(&(db->mutex)); } else { pthread_mutex_unlock(&est_global_mutex); } } /* END OF FILE */ hyperestraier-1.4.13/estmtdb.h000066400000000000000000000216431125261632700163140ustar00rootroot00000000000000/************************************************************************************************* * The MT-safe API of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #ifndef _ESTMTDB_H /* duplication check */ #define _ESTMTDB_H #if defined(__cplusplus) /* export for C++ */ extern "C" { #endif #include #include #include #include /************************************************************************************************* * API for MT-safe database *************************************************************************************************/ typedef struct { /* type of structure for a MT-safe database */ ESTDB *db; /* database connection */ char *path; /* real path of the directory */ pthread_mutex_t mutex; /* mutex for each connection */ } ESTMTDB; /* Open a database. */ ESTMTDB *est_mtdb_open(const char *name, int omode, int *ecp); /* Close a database. */ int est_mtdb_close(ESTMTDB *db, int *ecp); /* Get the last happended error code of a database. */ int est_mtdb_error(ESTMTDB *db); /* Check whether a database has a fatal error. */ int est_mtdb_fatal(ESTMTDB *db); /* Add an index for narrowing or sorting with document attributes. */ int est_mtdb_add_attr_index(ESTMTDB *db, const char *name, int type); /* Flush index words in the cache of a database. */ int est_mtdb_flush(ESTMTDB *db, int max); /* Synchronize updating contents of a database. */ int est_mtdb_sync(ESTMTDB *db); /* Optimize a database. */ int est_mtdb_optimize(ESTMTDB *db, int options); /* Merge another database. */ int est_mtdb_merge(ESTMTDB *db, const char *name, int options); /* Add a document to a database. */ int est_mtdb_put_doc(ESTMTDB *db, ESTDOC *doc, int options); /* Remove a document from a database. */ int est_mtdb_out_doc(ESTMTDB *db, int id, int options); /* Edit attributes of a document object in a database. */ int est_mtdb_edit_doc(ESTMTDB *db, ESTDOC *doc); /* Retrieve a document in a database. */ ESTDOC *est_mtdb_get_doc(ESTMTDB *db, int id, int options); /* Retrieve the value of an attribute of a document in a database. */ char *est_mtdb_get_doc_attr(ESTMTDB *db, int id, const char *name); /* Get the ID of a document spacified by URI. */ int est_mtdb_uri_to_id(ESTMTDB *db, const char *uri); /* Get the name of a database. */ const char *est_mtdb_name(ESTMTDB *db); /* Get the number of documents in a database. */ int est_mtdb_doc_num(ESTMTDB *db); /* Get the number of unique words in a database. */ int est_mtdb_word_num(ESTMTDB *db); /* Get the size of a database. */ double est_mtdb_size(ESTMTDB *db); /* Search a database for documents corresponding a condition. */ int *est_mtdb_search(ESTMTDB *db, ESTCOND *cond, int *nump, CBMAP *hints); /* Search plural databases for documents corresponding a condition. */ int *est_mtdb_search_meta(ESTMTDB **dbs, int dbnum, ESTCOND *cond, int *nump, CBMAP *hints); /* Check whether a document object matches the phrase of a search condition object definitely. */ int est_mtdb_scan_doc(ESTMTDB *db, ESTDOC *doc, ESTCOND *cond); /* Set the maximum size of the cache memory of a database. */ void est_mtdb_set_cache_size(ESTMTDB *db, size_t size, int anum, int tnum, int rnum); /* Add a pseudo index directory to a database. */ int est_mtdb_add_pseudo_index(ESTMTDB *db, const char *path); /************************************************************************************************* * features for experts *************************************************************************************************/ /* Set the error code of a database. */ void est_mtdb_set_ecode(ESTMTDB *db, int ecode); /* Check whether an option is set. */ int est_mtdb_check_option(ESTMTDB *db, int option); /* Get the inode number of a database. */ int est_mtdb_inode(ESTMTDB *db); /* Set the entity data of a document in a database. */ int est_mtdb_set_doc_entity(ESTMTDB *db, int id, const char *ptr, int size); /* Get the entity data of a document in a database. */ char *est_mtdb_get_doc_entity(ESTMTDB *db, int id, int *sp); /* Set the maximum number of extension of wild cards. */ void est_mtdb_set_wildmax(ESTMTDB *db, int num); /* Add a piece of meta data to a database. */ void est_mtdb_add_meta(ESTMTDB *db, const char *name, const char *value); /* Get a list of names of meta data of a database. */ CBLIST *est_mtdb_meta_names(ESTMTDB *db); /* Get the value of a piece of meta data of a database. */ char *est_mtdb_meta(ESTMTDB *db, const char *name); /* Extract keywords of a document object. */ CBMAP *est_mtdb_etch_doc(ESTMTDB *db, ESTDOC *doc, int max); /* Store a map object of keywords. */ int est_mtdb_put_keywords(ESTMTDB *db, int id, CBMAP *kwords, double weight); /* Remove keywords of a document. */ int est_mtdb_out_keywords(ESTMTDB *db, int id); /* Retrieve a map object of keywords. */ CBMAP *est_mtdb_get_keywords(ESTMTDB *db, int id); /* Mesure the total size of each inner records of a stored document. */ int est_mtdb_measure_doc(ESTMTDB *db, int id, int parts); /* Initialize the iterator of a database. */ int est_mtdb_iter_init(ESTMTDB *db, const char *prev); /* Get the next ID of the iterator of a database. */ int est_mtdb_iter_next(ESTMTDB *db); /* Initialize the word iterator of a database. */ int est_mtdb_word_iter_init(ESTMTDB *db); /* Get the next word of the word iterator of a database. */ char *est_mtdb_word_iter_next(ESTMTDB *db); /* Get the size of the record of a word. */ int est_mtdb_word_rec_size(ESTMTDB *db, const char *word); /* Get the number of unique keywords in a database. */ int est_mtdb_keyword_num(ESTMTDB *db); /* Initialize the keyword iterator of a database. */ int est_mtdb_keyword_iter_init(ESTMTDB *db); /* Get the next keyword of the word iterator of a database. */ char *est_mtdb_keyword_iter_next(ESTMTDB *db); /* Get the size of the record of a keyword. */ int est_mtdb_keyword_rec_size(ESTMTDB *db, const char *word); /* Search documents corresponding a keyword for a database. */ int *est_mtdb_keyword_search(ESTMTDB *db, const char *word, int *nump); /* Get the number of records in the cache memory of a database. */ int est_mtdb_cache_num(ESTMTDB *db); /* Get the size of used cache region. */ int est_mtdb_used_cache_size(ESTMTDB *db); /* Set the special cache for narrowing and sorting with document attributes. */ void est_mtdb_set_special_cache(ESTMTDB *db, const char *name, int num); /* Set the callback function to inform of database events. */ void est_mtdb_set_informer(ESTMTDB *db, void (*func)(const char *, void *), void *opaque); /* Fill the cache for keys for TF-IDF. */ void est_mtdb_fill_key_cache(ESTMTDB *db); /* Set the database of document frequency. */ void est_mtdb_set_dfdb(ESTMTDB *db, DEPOT *dfdb); /* Clear the result cache. */ void est_mtdb_refresh_rescc(ESTMTDB *db); /* Charge the result cache. */ void est_mtdb_charge_rescc(ESTMTDB *db, int max); /* Get a list of words in the result cache. */ CBLIST *est_mtdb_list_rescc(ESTMTDB *db); /* Get the number of pseudo documents in a database. */ int est_mtdb_pseudo_doc_num(ESTMTDB *db); /* Get a list of expressions of attribute indexes of a database. */ CBLIST *est_mtdb_attr_index_exprs(ESTMTDB *db); /* Interrupt long time processing. */ void est_mtdb_interrupt(ESTMTDB *db); /************************************************************************************************* * features for hyper experts *************************************************************************************************/ /* Get the usage ratio of the cache. The return value is the usage ratio of the cache. While flushing, the return value is 1.0. Though this function is never blocked, the accuracy of the return value is inferior to `est_mtdb_used_cache_size'. */ double est_mtdb_cache_usage(ESTMTDB *db); #if defined(__cplusplus) /* export for C++ */ } #endif #endif /* duplication check */ /* END OF FILE */ hyperestraier-1.4.13/estmttest.c000066400000000000000000000467521125261632700167110ustar00rootroot00000000000000/************************************************************************************************* * The command line interface of the MT-safe API * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #include "estraier.h" #include "estmtdb.h" #include "myconf.h" #define URIBUFSIZ 8192 /* size of a buffer for an URI */ #define BRANCHDBNUM 4 /* number of branch databases */ typedef struct { /* type of structure for a thread mission */ int id; /* ID number */ ESTMTDB *db; /* database object */ ESTMTDB **others; /* other's database object */ int dnum; /* number of documents */ } MISSION; enum { /* enumeration for test documents */ RD_ENG, /* English */ RD_LAT, /* Latin */ RD_EURO, /* European mix */ RD_ORI, /* Oriental */ RD_JPN, /* Japanese */ RD_CHAO, /* chaos */ RD_RAND /* selected at random */ }; /* global variables */ const char *g_progname; /* program name */ int g_sigterm = FALSE; /* flag for termination signal */ /* function prototypes */ int main(int argc, char **argv); static void printferror(const char *format, ...); static void printfinfo(const char *format, ...); static void dbinform(const char *message, void *opaque); static void setsignals(void); static void sigtermhandler(int num); static void usage(void); static int runwicked(int argc, char **argv); static int runregression(int argc, char **argv); static int procwicked(const char *dbname, int dnum, int tnum); static int procregression(const char *dbname); static void *mtwkfunc(void *mission); static ESTDOC *est_doc_new_from_chaos(int cnum, int snum, int mode); static char *est_random_str(int cnum, int mode); /* main routine */ int main(int argc, char **argv){ const char *tmp; int rv; if((tmp = getenv("ESTDBGFD")) != NULL) dpdbgfd = atoi(tmp); est_proc_env_reset(); g_progname = argv[0]; g_sigterm = FALSE; if(argc < 2) usage(); rv = 0; if(!strcmp(argv[1], "wicked")){ setsignals(); rv = runwicked(argc, argv); } else if(!strcmp(argv[1], "regression")){ setsignals(); rv = runregression(argc, argv); } else { usage(); } return rv; } /* print formatted error string and flush the buffer */ static void printferror(const char *format, ...){ va_list ap; va_start(ap, format); fprintf(stderr, "%s: ERROR: ", g_progname); vfprintf(stderr, format, ap); fputc('\n', stderr); fflush(stderr); va_end(ap); } /* print formatted information string and flush the buffer */ static void printfinfo(const char *format, ...){ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; va_list ap; va_start(ap, format); if(pthread_mutex_lock(&mutex) != 0) return; printf("%s: INFO: ", g_progname); vprintf(format, ap); putchar('\n'); fflush(stdout); pthread_mutex_unlock(&mutex); va_end(ap); } /* callback function for database events */ static void dbinform(const char *message, void *opaque){ printfinfo("%s", message); } /* set signal handlers */ static void setsignals(void){ signal(1, sigtermhandler); signal(2, sigtermhandler); signal(3, sigtermhandler); signal(13, sigtermhandler); signal(15, sigtermhandler); } /* handler of termination signal */ static void sigtermhandler(int num){ static int tries = 0; if(tries++ <= 4){ signal(num, sigtermhandler); } else { signal(num, SIG_DFL); } g_sigterm = TRUE; printfinfo("the termination signal %d catched", num); } /* print the usage and exit */ static void usage(void){ fprintf(stderr, "%s: command line utility of Hyper Estraier\n", g_progname); fprintf(stderr, "\n"); fprintf(stderr, "usage:\n"); fprintf(stderr, " %s wicked db dnum tnum\n", g_progname); fprintf(stderr, " %s regression db\n", g_progname); fprintf(stderr, "\n"); exit(1); } /* parse arguments of the wicked command */ static int runwicked(int argc, char **argv){ char *dbname, *dnstr, *tnstr; int i, dnum, tnum, rv; dbname = NULL; dnstr = NULL; tnstr = NULL; for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ usage(); } else if(!dbname){ dbname = argv[i]; } else if(!dnstr){ dnstr = argv[i]; } else if(!tnstr){ tnstr = argv[i]; } else { usage(); } } if(!dbname || !dnstr || !tnstr) usage(); if((dnum = atoi(dnstr)) < 1) usage(); if((tnum = atoi(tnstr)) < 1) usage(); rv = procwicked(dbname, dnum, tnum); return rv; } /* parse arguments of the regression command */ static int runregression(int argc, char **argv){ char *dbname; int i, rv; dbname = NULL; for(i = 2; i < argc; i++){ if(!dbname && argv[i][0] == '-'){ usage(); } else if(!dbname){ dbname = argv[i]; } else { usage(); } } if(!dbname) usage(); rv = procregression(dbname); return rv; } /* perform the wicked command */ static int procwicked(const char *dbname, int dnum, int tnum){ ESTMTDB *dbs[BRANCHDBNUM]; MISSION *missions; pthread_t *threads; void *rv; char *name; int i, ecode, err; time_t curtime; curtime = time(NULL); for(i = 0; i < BRANCHDBNUM; i++){ name = cbsprintf("%s-%08d", dbname, i + 1); if(!(dbs[i] = est_mtdb_open(name, ESTDBWRITER | ESTDBCREAT | ESTDBTRUNC, &ecode))){ printferror("%s: %s", name, est_err_msg(ecode)); while(i >= 0){ est_mtdb_close(dbs[i], &ecode); i--; } free(name); return -1; } est_mtdb_set_informer(dbs[i], dbinform, NULL); est_mtdb_set_cache_size(dbs[i], 1024 * 1024 * 32, 1024, 256, 64); est_mtdb_set_special_cache(dbs[i], ESTDATTRURI, 128); free(name); } missions = cbmalloc(sizeof(MISSION) * tnum); threads = cbmalloc(sizeof(pthread_t) * tnum); err = FALSE; if(tnum == 1){ missions[0].id = 1; missions[0].db = dbs[0]; missions[0].others = dbs; missions[0].dnum = dnum; if(mtwkfunc(missions) != NULL) err = TRUE; } else { for(i = 0; i < tnum; i++){ missions[i].id = i + 1; missions[i].db = dbs[i%BRANCHDBNUM]; missions[i].others = dbs; missions[i].dnum = dnum; if(pthread_create(threads + i, NULL, mtwkfunc, missions + i) != 0){ printferror("%d: pthread_create failed", i + 1); missions[i].id = -1; err = TRUE; } } for(i = 0; i < tnum; i++){ if(missions[i].id == -1) continue; if(pthread_join(threads[i], &rv) != 0){ printferror("%s: pthread_join failed", missions[i].id); err = TRUE; } else if(rv){ err = TRUE; } } } for(i = 0; i < BRANCHDBNUM; i++){ if(!est_mtdb_close(dbs[i], &ecode)){ printferror("%s: %s", dbname, est_err_msg(ecode)); err = TRUE; } } free(threads); free(missions); curtime = time(NULL) - curtime; if(!err) printfinfo("finished successfully: elapsed time: %dh %dm %ds", (int)(curtime / 3600), (int)((curtime / 60) % 60), (int)(curtime % 60)); return err ? 1 : 0; } /* perform the regression command */ static int procregression(const char *dbname){ ESTMTDB *dbs[10], *db, *tdbs[5]; ESTDOC *doc; ESTCOND *cond; CBMAP *hints; char wbuf[URIBUFSIZ]; int i, j, ecode, err, *res, rnum; time_t curtime; curtime = time(NULL); printfinfo("# opening databases"); for(i = 0; i < 10; i++){ sprintf(wbuf, "%s-%08d", dbname, i + 1); if(!(dbs[i] = est_mtdb_open(wbuf, ESTDBWRITER | ESTDBCREAT | ESTDBTRUNC, &ecode))){ printferror("%s: %s", wbuf, est_err_msg(est_mtdb_error(dbs[i]))); return 1; } est_mtdb_set_informer(dbs[i], dbinform, NULL); } err = FALSE; printfinfo("# registering documents"); for(i = 0; i < 1000 && !g_sigterm; i++){ doc = est_doc_new(); sprintf(wbuf, "%d", rand() % (i + 100)); est_doc_add_attr(doc, ESTDATTRURI, wbuf); for(j = 0; j < 100; j++){ sprintf(wbuf, "%c%c", 'a' + rand() % 6, 'a' + rand() % 6); est_doc_add_text(doc, wbuf); } db = dbs[rand()%10]; if(!est_mtdb_put_doc(db, doc, ESTPDCLEAN)){ printferror("%s: %s", est_mtdb_name(db), est_err_msg(ecode)); err = TRUE; } est_doc_delete(doc); } printfinfo("# flushing half of databases"); for(i = 0; i < 10; i += 2){ if(!est_mtdb_flush(dbs[i], -1)){ printferror("%s: %s", est_mtdb_name(dbs[i]), est_err_msg(ecode)); err = TRUE; } } printfinfo("# searching databases"); for(i = 0; i < 1000 && !g_sigterm; i++){ cond = est_cond_new(); sprintf(wbuf, "%c%c", 'a' + rand() % 6, 'a' + rand() % 6); est_cond_set_phrase(cond, wbuf); switch(rand() % 5){ case 0: est_cond_set_order(cond, ESTORDIDA); break; case 1: est_cond_set_order(cond, ESTORDSCA); break; case 2: est_cond_set_order(cond, ESTDATTRURI " " ESTORDSTRA); break; } hints = cbmapopen(); res = est_mtdb_search_meta(dbs, 10, cond, &rnum, hints); for(j = 0; j < rnum; j += 2){ if(res[j] < 0 || res[j] >= 10){ printferror("%s: search result is invalid", dbname); err = TRUE; break; } } free(res); cbmapclose(hints); est_cond_delete(cond); } printfinfo("# searching certainly same databases"); tdbs[0] = dbs[0]; tdbs[1] = dbs[1]; tdbs[2] = dbs[2]; tdbs[3] = dbs[0]; tdbs[4] = dbs[1]; for(i = 0; i < 100 && !g_sigterm; i++){ cond = est_cond_new(); sprintf(wbuf, "%c%c", 'a' + rand() % 6, 'a' + rand() % 6); est_cond_set_phrase(cond, wbuf); switch(rand() % 5){ case 0: est_cond_set_order(cond, ESTORDIDA); break; case 1: est_cond_set_order(cond, ESTORDSCA); break; case 2: est_cond_set_order(cond, ESTDATTRURI " " ESTORDSTRA); break; } hints = cbmapopen(); res = est_mtdb_search_meta(tdbs, 5, cond, &rnum, hints); for(j = 0; j < rnum; j += 2){ if(res[j] < 0 || res[j] >= 5){ printferror("%s: search result is invalid", dbname); err = TRUE; break; } } free(res); cbmapclose(hints); est_cond_delete(cond); } printfinfo("# closing databases"); for(i = 0; i < 10; i++){ if(!est_mtdb_close(dbs[i], &ecode)){ printferror("%s: %s", est_mtdb_name(dbs[i]), est_err_msg(ecode)); err = TRUE; } } curtime = time(NULL) - curtime; if(!err) printfinfo("# finished successfully: elapsed time: %dh %dm %ds", (int)(curtime / 3600), (int)((curtime / 60) % 60), (int)(curtime % 60)); return err ? 1 : 0; } /* Thread function for wicked command */ static void *mtwkfunc(void *mission){ ESTMTDB *db, **others; ESTDOC *doc; ESTCOND *cond; char uri[URIBUFSIZ], *oper, *value, *first, *second, *phrase; int i, j, err, id, dnum, *res, rnum, size; double rnd; id = ((MISSION *)mission)->id; db = ((MISSION *)mission)->db; others = ((MISSION *)mission)->others; dnum = ((MISSION *)mission)->dnum; printfinfo("%d: started", id); err = FALSE; for(i = 0; i < dnum; i++){ rnd = est_random(); if((int)(rnd * INT_MAX) % dnum < 1){ rnd = est_random(); if(rnd < 0.3){ if(!est_mtdb_optimize(db, (int)(est_random() * INT_MAX) % 2 == 0) ? ESTOPTNOPURGE : 0) err = TRUE; } else if(rnd < 0.8){ if(!est_mtdb_flush(db, 1024)) err = TRUE; } else { if(!est_mtdb_sync(db)) err = TRUE; } } else if(rnd < 0.001){ est_usleep(1000 * 100); printfinfo("%d: [%d:%d]: sleep", id, i + 1, est_mtdb_doc_num(db)); } else if(rnd < 0.005){ for(j = 0; j < BRANCHDBNUM; j++){ est_mtdb_interrupt(others[j]); } printfinfo("%d: [%d:%d]: interrupt", id, i + 1, est_mtdb_doc_num(db)); } else if(rnd < 0.05){ if(est_mtdb_out_doc(db, (int)(est_random() * INT_MAX) % (i + 1) + 1, ((int)(est_random() * INT_MAX) % 2 == 0) ? ESTODCLEAN : 0)){ printfinfo("%d: [%d:%d]: out", id, i + 1, est_mtdb_doc_num(db)); } else if(est_mtdb_error(db) != ESTENOITEM){ err = TRUE; } } else if(rnd < 0.1){ if((value = est_mtdb_get_doc_attr(db, (int)(est_random() * INT_MAX) % (i + 1) + 1, ESTDATTRURI)) != NULL){ printfinfo("[%d:%d]: attr: %s", i + 1, est_mtdb_doc_num(db), value); free(value); } } else if(rnd < 0.25){ rnd = est_random(); if(rnd < 0.5){ oper = " OR "; } else if(rnd < 0.7){ oper = " AND "; } else if(rnd < 0.8){ oper = " NOTAND "; } else if(rnd < 0.9){ oper = " "; } else { oper = ""; } first = est_random_str(5, (int)(est_random() * INT_MAX) % RD_RAND); second = est_random_str(2, (int)(est_random() * INT_MAX) % RD_RAND); phrase = cbsprintf("%s%s%s", first, oper, second); cond = est_cond_new(); est_cond_set_phrase(cond, phrase); if(est_random() < 0.05) est_cond_add_attr(cond, "@uri STREW 0.est"); if(est_random() < 0.05) est_cond_set_order(cond, "@uri STRD"); res = est_mtdb_search(db, cond, &rnum, NULL); printfinfo("%d: [%d:%d]: search: %d hits", id, i + 1, est_mtdb_doc_num(db), rnum); if(est_random() < 0.01){ for(j = 0; j < rnum && j < 100; j++){ if((doc = est_mtdb_get_doc(db, res[j], 0)) != NULL){ est_doc_delete(doc); } else if(est_mtdb_error(db) != ESTENOITEM){ err = TRUE; } } } free(res); est_cond_delete(cond); free(phrase); free(first); free(second); } else { doc = est_doc_new_from_chaos(100, 3, est_random() < 0.5 ? RD_EURO : RD_RAND); if(est_random() < 0.2){ sprintf(uri, "file:///tmp/wicked-%08d-%05d.est", (int)(est_random() * INT_MAX) % (i + 1) + 1, (int)getpid()); } else { sprintf(uri, "file:///tmp/wicked-%08d-%05d.est", i + 1, (int)getpid()); } est_doc_add_attr(doc, ESTDATTRURI, uri); if(!est_mtdb_put_doc(db, doc, est_random() < 0.5 ? ESTPDCLEAN : 0)) err = TRUE; if(est_random() < 0.1){ if(!est_mtdb_set_doc_entity(db, est_doc_id(doc), uri, strlen(uri))) err = TRUE; value = est_mtdb_get_doc_entity(db, est_doc_id(doc), &size); if(!value || strcmp(value, uri)) err = TRUE; free(value); } est_doc_delete(doc); } if(err || g_sigterm) break; } if(err) printferror("%s: %s", est_mtdb_name(db), est_err_msg(est_mtdb_error(db))); printfinfo("%d: finished", id); return err ? "error" : NULL; } /* generate a document with random text */ static ESTDOC *est_doc_new_from_chaos(int cnum, int snum, int mode){ ESTDOC *doc; char *str; int i; doc = est_doc_new(); snum *= pow(est_random_nd() + 0.5, 3.0); if(mode == RD_RAND){ mode = est_random() * 100; if(mode < 20){ mode = RD_ENG; est_doc_add_attr(doc, "mode", "english"); } else if(mode < 40){ mode = RD_LAT; est_doc_add_attr(doc, "mode", "latin"); } else if(mode < 60){ mode = RD_EURO; est_doc_add_attr(doc, "mode", "euromix"); } else if(mode < 65){ mode = RD_ORI; est_doc_add_attr(doc, "mode", "oriental"); } else if(mode < 95){ mode = RD_JPN; est_doc_add_attr(doc, "mode", "japanese"); } else { mode = RD_CHAO; est_doc_add_attr(doc, "mode", "chaos"); } } switch(mode){ case RD_ENG: est_doc_add_attr(doc, "mode", "english"); break; case RD_LAT: est_doc_add_attr(doc, "mode", "latin"); break; case RD_ORI: est_doc_add_attr(doc, "mode", "oriental"); break; case RD_JPN: est_doc_add_attr(doc, "mode", "japanese"); break; case RD_EURO: est_doc_add_attr(doc, "mode", "euromix"); break; case RD_CHAO: est_doc_add_attr(doc, "mode", "chaos"); break; } for(i = 0; i <= snum; i++){ str = est_random_str(cnum, mode); if(est_random() < 0.05){ est_doc_add_hidden_text(doc, str); } else { est_doc_add_text(doc, str); } free(str); } return doc; } /* generate random string */ static char *est_random_str(int cnum, int mode){ const char echrs[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; CBDATUM *buf; char wc[2], *str; int i, c, wlen, dec, mm, big, n; buf = cbdatumopen("", 0); cnum *= pow(est_random_nd() + 0.5, 3.0); wlen = est_random_nd() * 8 + 4; dec = (int)(est_random() * INT_MAX) % 10; big = (((int)(est_random() * INT_MAX) % 0x29)) * 0x100; for(i = 0; i < cnum; i++){ switch(mode){ case RD_ENG: case RD_LAT: case RD_EURO: mm = (int)(est_random() * INT_MAX) % 100; if((mode == RD_LAT || mode == RD_EURO) && mm < 5){ c = 0x00a1 + (int)(pow(est_random_nd(), 2.0) * (0x00ff - 0x00a0)); } else if(mode == RD_EURO && (mm < 30 || dec > 8)){ if(dec % 2 == 0){ c = 0x0391 + (int)(pow(est_random_nd(), 2.0) * (0x03d6 - 0x0391)); } else { c = 0x0400 + (int)(pow(est_random_nd(), 2.0) * (0x045f - 0x0400)); } } else if(mm < 95){ if((n = est_random_nd() * (sizeof(echrs) - 1)) == (sizeof(echrs) - 1)) n = 0; c = echrs[n]; } else { c = (int)(est_random() * ('@' - ' ')) + ' '; } if(--wlen < 1){ c = ' '; wlen = pow(est_random_nd(), 3.0) * 8 + 4; dec = (int)(est_random() * INT_MAX) % 10; } break; case RD_ORI: c = big + est_random_nd() * 0x100; if(--wlen < 1){ wlen = pow(est_random_nd(), 3.0) * 12 + 6; big = (((int)(est_random() * INT_MAX) % 0x29)) * 0x100; } break; case RD_JPN: if(dec < 4){ c = 0x3041 + pow(est_random_nd(), 3.0) * (0x3094 - 0x3041); } else if(dec < 7){ c = 0x30a1 + pow(est_random_nd(), 3.0) * (0x30fe - 0x30a1); } else if(dec < 9){ c = 0x4e00 + pow(est_random_nd(), 3.0) * (0x9faf - 0x4e00); } else { if(est_random() < 0.7){ c = 0x00a1 + (int)(pow(est_random_nd(), 2.0) * (0x00ff - 0x00a0)); } else { c = 0x3041 + est_random() * (0xffef - 0x3041); } } if(--wlen < 1){ wlen = pow(est_random_nd(), 3.0) * 12 + 6; dec = (int)(est_random() * INT_MAX) % 10; } break; default: if(est_random() < 0.2){ c = 0x00a1 + (int)est_random() * (0x00ff - 0x00a0); } else { c = (int)(est_random() * 0x10000); } break; } if(c <= 0 || c >= 0x10000) c = 0x0020; wc[0] = c / 0x100; wc[1] = c % 0x100; cbdatumcat(buf, wc, 2); } str = est_iconv(CB_DATUMPTR(buf), CB_DATUMSIZE(buf), "UTF-16BE", "UTF-8", NULL, NULL); cbdatumclose(buf); return str; } /* END OF FILE */ hyperestraier-1.4.13/estnode.c000066400000000000000000002022431125261632700163030ustar00rootroot00000000000000/************************************************************************************************* * Implementation of the node API * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #include "estraier.h" #include "estmtdb.h" #include "estnode.h" #include "myconf.h" #if defined(_SYS_MSVC_) || defined(_SYS_MINGW_) #define socklen_t int #define in_addr_t int #elif defined(_SYS_MACOSX_) #define socklen_t int #endif #define ESTNUMBUFSIZ 32 /* size of a buffer for a number */ #define ESTPATHBUFSIZ 4096 /* size of a buffer for a path */ #define ESTIOBUFSIZ 8192 /* size of a buffer for I/O */ #define ESTMINIBNUM 31 /* bucket number of map for attributes */ #define ESTLISTUNIT 64 /* allocation unit number of a list */ #define ESTVAXVECNUM 256 /* maximum number of vector dimensions */ #define ESTECLPMAX 64 /* maximum number of documents to be eclipsed */ #define ESTITERUNIT 256 /* retrieval unit number of iterator */ #define ESTRESLIMSIZE (1048576*128) /* limitation of the entity body of response */ #define ESTWWIDTHDEF 480 /* default of whole width of a snippet */ #define ESTHWIDTHDEF 96 /* default of head width of a snippet */ #define ESTAWIDTHDEF 96 /* default of around width of a snippet */ #define ESTDNHOLDSEC 300 /* holding time of domain names */ #define ESTDNHOLDNUM 4096 /* holding number of domain names */ typedef struct { /* type of structure for interaction of a URL */ int alive; /* whether to be alive */ pthread_cond_t *cond; /* condition variable */ const char *url; /* URL */ const char *pxhost; /* host name of proxy */ int pxport; /* port number of proxy */ int limsize; /* limitation of the response body */ const char *auth; /* authority */ const CBLIST *reqheads; /* request headers */ const char *reqbody; /* request body */ int rbsiz; /* size of the request body */ int *rescodep; /* pointer to a variable for status code */ CBMAP *resheads; /* response headers */ CBDATUM *resbody; /* response body */ } TARGSHUTTLE; /* private function prototypes */ static char *est_gethostaddrbyname(const char *name); static int est_sock_close(int sock); static int est_inet_aton(const char *cp, struct in_addr *inp); static void *est_url_shuttle_impl(void *targ); static void est_sockpt_down(void *sp); static int est_node_set_info(ESTNODE *node); static void est_node_iter_delete(ESTNODE *node); static int est_node_read_list(ESTNODE *node); static void est_parse_search_header(ESTNODERES *nres, const char *str); static void est_parse_search_body(ESTNODERES *nres, char *str); /************************************************************************************************* * API for the network environment *************************************************************************************************/ /* Cache of host addresses. */ CBMAP *est_host_addrs = NULL; int est_host_attrs_cnt = 0; pthread_mutex_t est_host_addrs_mutex = PTHREAD_MUTEX_INITIALIZER; /* Initialize the networking environment. */ int est_init_net_env(void){ #if defined(_SYS_MSVC_) || defined(_SYS_MINGW_) WSADATA wsaData; if(pthread_mutex_lock(&est_host_addrs_mutex) != 0) return FALSE; if(WSAStartup(MAKEWORD(2,0), &wsaData) != 0){ pthread_mutex_unlock(&est_host_addrs_mutex); return FALSE; } if(est_host_attrs_cnt < 1) est_host_addrs = cbmapopenex(ESTDNHOLDNUM + 1); est_host_attrs_cnt++; pthread_mutex_unlock(&est_host_addrs_mutex); return TRUE; #else if(pthread_mutex_lock(&est_host_addrs_mutex) != 0) return FALSE; if(est_host_attrs_cnt < 1) est_host_addrs = cbmapopenex(ESTDNHOLDNUM + 1); est_host_attrs_cnt++; pthread_mutex_unlock(&est_host_addrs_mutex); return TRUE; #endif } /* Free the networking environment. */ void est_free_net_env(void){ #if defined(_SYS_MSVC_) || defined(_SYS_MINGW_) if(pthread_mutex_lock(&est_host_addrs_mutex) != 0) return; if(est_host_attrs_cnt < 1){ pthread_mutex_unlock(&est_host_addrs_mutex); return; } est_host_attrs_cnt--; if(est_host_attrs_cnt < 1){ cbmapclose(est_host_addrs); est_host_addrs = NULL; } WSACleanup(); pthread_mutex_unlock(&est_host_addrs_mutex); #else if(pthread_mutex_lock(&est_host_addrs_mutex) != 0) return; if(est_host_attrs_cnt < 1){ pthread_mutex_unlock(&est_host_addrs_mutex); return; } est_host_attrs_cnt--; if(est_host_attrs_cnt < 1){ cbmapclose(est_host_addrs); est_host_addrs = NULL; } pthread_mutex_unlock(&est_host_addrs_mutex); #endif } /************************************************************************************************* * API for search result of node *************************************************************************************************/ /* Delete a node result object. */ void est_noderes_delete(ESTNODERES *nres){ ESTRESDOC *docs; int i, dnum; assert(nres); cbmapclose(nres->hints); free(nres->survivors); docs = nres->docs + nres->top; dnum = nres->dnum; for(i = 0; i < dnum; i++){ free(nres->docs[i].children); if(docs[i].kwords) cbmapclose(docs[i].kwords); free(docs[i].snippet); cbmapclose(docs[i].attrs); } free(nres->docs); free(nres); } /* Get a map object for hints of a node result object. */ CBMAP *est_noderes_hints(ESTNODERES *nres){ assert(nres); return nres->hints; } /* Eclipse similar documents of a node result object. */ void est_noderes_eclipse(ESTNODERES *nres, int num, double limit){ ESTRESDOC *docs; CBLIST *fields; CBMAP *kwords; const char *kbuf, *vbuf; int i, j, dnum, ksiz, vsiz, snum, vnum, svec[ESTVAXVECNUM], tvec[ESTVAXVECNUM]; double dval; assert(nres); docs = nres->docs + nres->top; dnum = nres->dnum; if(num <= 0){ for(i = 0; i < dnum; i++){ docs[i].cnum = 0; docs[i].similarity = -1.0; } free(nres->survivors); nres->survivors = NULL; nres->snum = 0; return; } for(i = 0; i < dnum; i++){ if(docs[i].kwords) continue; if(!(vbuf = cbmapget(docs[i].attrs, ESTDCNTLVECTOR, -1, &vsiz)) || vsiz < 0) continue; kwords = cbmapopenex(ESTMINIBNUM); fields = cbsplit(vbuf, vsiz, "\t"); for(j = 0; j < cblistnum(fields) - 1; j += 2){ kbuf = cblistval(fields, j, &ksiz); vbuf = cblistval(fields, j + 1, &vsiz); cbmapput(kwords, kbuf, ksiz, vbuf, vsiz, FALSE); } cblistclose(fields); docs[i].kwords = kwords; docs[i].cnum = 0; docs[i].similarity = -1.0; } snum = 0; for(i = 0; i < dnum && snum < num; i++){ if(docs[i].similarity >= 0.0) continue; if(docs[i].kwords && (vnum = cbmaprnum(docs[i].kwords)) > 0){ vnum = vnum < ESTVAXVECNUM ? vnum : ESTVAXVECNUM; est_vector_set_seed(docs[i].kwords, svec, vnum); for(j = i + 1; j < dnum; j++){ if(docs[j].similarity >= 0.0 || !docs[j].kwords || cbmaprnum(docs[j].kwords) < 1) continue; est_vector_set_target(docs[i].kwords, docs[j].kwords, tvec, vnum); dval = est_vector_cosine(svec, tvec, vnum); if(dval > limit && docs[i].cnum < ESTECLPMAX){ if(!docs[i].children) docs[i].children = cbmalloc(ESTECLPMAX * sizeof(ESTRESDOC *)); docs[i].children[docs[i].cnum++] = docs + j; docs[j].similarity = dval; } } } snum++; } free(nres->survivors); nres->survivors = cbmalloc(dnum * sizeof(ESTRESDOC *) + 1); snum = 0; for(i = 0; i < dnum; i++){ if(docs[i].similarity >= 0.0) continue; nres->survivors[snum++] = docs + i; } nres->snum = snum; } /* Get the number of documents in a node result object. */ int est_noderes_doc_num(ESTNODERES *nres){ assert(nres); return nres->survivors ? nres->snum : nres->dnum; } /* Refer a result document object in a node result object. */ ESTRESDOC *est_noderes_get_doc(ESTNODERES *nres, int index){ assert(nres && index >= 0); if(nres->survivors){ if(index >= nres->snum) return NULL; return nres->survivors[index]; } if(index >= nres->dnum) return NULL; return nres->docs + (nres->top + index); } /* Get the URI of a result document object. */ const char *est_resdoc_uri(ESTRESDOC *rdoc){ assert(rdoc); return rdoc->uri; } /* Get a list of attribute names of a result document object. */ CBLIST *est_resdoc_attr_names(ESTRESDOC *rdoc){ CBLIST *names; const char *kbuf; int ksiz; assert(rdoc); names = cblistopen(); cbmapiterinit(rdoc->attrs); while((kbuf = cbmapiternext(rdoc->attrs, &ksiz)) != NULL){ if(kbuf[0] != '%') cblistpush(names, kbuf, ksiz); } cblistsort(names); return names; } /* Get the value of an attribute of a result document object. */ const char *est_resdoc_attr(ESTRESDOC *rdoc, const char *name){ assert(rdoc && name); return cbmapget(rdoc->attrs, name, -1, NULL); } /* Get the value of an attribute of a result document object. */ const char *est_resdoc_snippet(ESTRESDOC *rdoc){ assert(rdoc); return rdoc->snippet; } /* Get keywords of a result document object. */ const char *est_resdoc_keywords(ESTRESDOC *rdoc){ const char *vbuf; assert(rdoc); vbuf = cbmapget(rdoc->attrs, ESTDCNTLVECTOR, -1, NULL); return vbuf ? vbuf : ""; } /* Get an array of documents eclipsed by a result document object. */ ESTRESDOC **est_resdoc_shadows(ESTRESDOC *rdoc, int *np){ assert(rdoc && np); if(!rdoc->children){ *np = 0; return (ESTRESDOC **)""; } *np = rdoc->cnum; return rdoc->children; } /* Get similarity of an eclipsed result document object. */ double est_resdoc_similarity(ESTRESDOC *rdoc){ assert(rdoc); return rdoc->similarity; } /************************************************************************************************* * API for node *************************************************************************************************/ /* Create a node connection object. */ ESTNODE *est_node_new(const char *url){ ESTNODE *node; node = cbmalloc(sizeof(ESTNODE)); node->url = cbmemdup(url, -1); node->pxhost = NULL; node->pxport = 0; node->timeout = -1; node->auth = NULL; node->name = NULL; node->label = NULL; node->dnum = -1; node->wnum = -1; node->size = -1.0; node->admins = NULL; node->users = NULL; node->links = NULL; node->wwidth = ESTWWIDTHDEF; node->hwidth = ESTHWIDTHDEF; node->awidth = ESTAWIDTHDEF; node->ilist = NULL; node->iprev = NULL; node->status = 0; node->heads = cbmapopenex(ESTMINIBNUM); return node; } /* Destroy a node connection object. */ void est_node_delete(ESTNODE *node){ assert(node); cbmapclose(node->heads); est_node_iter_delete(node); if(node->links) cblistclose(node->links); if(node->users) cblistclose(node->users); if(node->admins) cblistclose(node->admins); free(node->label); free(node->name); free(node->auth); free(node->pxhost); free(node->url); free(node); } /* Set the proxy information of a node connection object. */ void est_node_set_proxy(ESTNODE *node, const char *host, int port){ assert(node && host && port >= 0); free(node->pxhost); node->pxhost = cbmemdup(host, -1); node->pxport = port; } /* Set timeout of a connection. */ void est_node_set_timeout(ESTNODE *node, int sec){ assert(node && sec >= 0); node->timeout = sec; } /* Set the authoririty information of a node connection object. */ void est_node_set_auth(ESTNODE *node, const char *name, const char *passwd){ assert(node && name && passwd); free(node->auth); node->auth = cbsprintf("%s:%s", name, passwd); } /* Get the status code of the last request of a node. */ int est_node_status(ESTNODE *node){ assert(node); return node->status; } /* Synchronize updating contents of the database of a node. */ int est_node_sync(ESTNODE *node){ CBLIST *reqheads; CBDATUM *reqbody; const char *kbuf; char url[ESTPATHBUFSIZ], *vbuf; int rescode, err; assert(node); err = FALSE; sprintf(url, "%s/sync", node->url); reqheads = cblistopen(); if(cbmaprnum(node->heads) > 0){ cbmapiterinit(node->heads); while((kbuf = cbmapiternext(node->heads, NULL)) != NULL){ vbuf = cbsprintf("%s: %s", kbuf, cbmapiterval(kbuf, NULL)); cblistpush(reqheads, vbuf, -1); free(vbuf); } } cblistpush(reqheads, "Content-Type: " ESTFORMTYPE, -1); reqbody = cbdatumopen(NULL, -1); if(!est_url_shuttle(url, node->pxhost, node->pxport, node->timeout, ESTRESLIMSIZE, node->auth, reqheads, cbdatumptr(reqbody), cbdatumsize(reqbody), &rescode, NULL, NULL)){ node->status = -1; err = TRUE; } if(!err){ node->status = rescode; if(rescode != 200) err = TRUE; } cbdatumclose(reqbody); cblistclose(reqheads); return err ? FALSE : TRUE; } /* Optimize the database of a node. */ int est_node_optimize(ESTNODE *node){ CBLIST *reqheads; CBDATUM *reqbody; const char *kbuf; char url[ESTPATHBUFSIZ], *vbuf; int rescode, err; assert(node); err = FALSE; sprintf(url, "%s/optimize", node->url); reqheads = cblistopen(); if(cbmaprnum(node->heads) > 0){ cbmapiterinit(node->heads); while((kbuf = cbmapiternext(node->heads, NULL)) != NULL){ vbuf = cbsprintf("%s: %s", kbuf, cbmapiterval(kbuf, NULL)); cblistpush(reqheads, vbuf, -1); free(vbuf); } } cblistpush(reqheads, "Content-Type: " ESTFORMTYPE, -1); reqbody = cbdatumopen(NULL, -1); if(!est_url_shuttle(url, node->pxhost, node->pxport, node->timeout, ESTRESLIMSIZE, node->auth, reqheads, cbdatumptr(reqbody), cbdatumsize(reqbody), &rescode, NULL, NULL)){ node->status = -1; err = TRUE; } if(!err){ node->status = rescode; if(rescode != 200) err = TRUE; } cbdatumclose(reqbody); cblistclose(reqheads); return err ? FALSE : TRUE; } /* Add a document to a node. */ int est_node_put_doc(ESTNODE *node, ESTDOC *doc){ CBLIST *reqheads; const char *kbuf; char url[ESTPATHBUFSIZ], *vbuf, *reqbody; int rescode, err; assert(node && doc); err = FALSE; sprintf(url, "%s/put_doc", node->url); reqheads = cblistopen(); if(cbmaprnum(node->heads) > 0){ cbmapiterinit(node->heads); while((kbuf = cbmapiternext(node->heads, NULL)) != NULL){ vbuf = cbsprintf("%s: %s", kbuf, cbmapiterval(kbuf, NULL)); cblistpush(reqheads, vbuf, -1); free(vbuf); } } cblistpush(reqheads, "Content-Type: " ESTDRAFTTYPE, -1); reqbody = est_doc_dump_draft(doc); if(!est_url_shuttle(url, node->pxhost, node->pxport, node->timeout, ESTRESLIMSIZE, node->auth, reqheads, reqbody, strlen(reqbody), &rescode, NULL, NULL)){ node->status = -1; err = TRUE; } if(!err){ node->status = rescode; if(rescode != 200) err = TRUE; } free(reqbody); cblistclose(reqheads); return err ? FALSE : TRUE; } /* Remove a document from a node. */ int est_node_out_doc(ESTNODE *node, int id){ CBLIST *reqheads; CBDATUM *reqbody; const char *kbuf; char url[ESTPATHBUFSIZ], *vbuf; int rescode, err; assert(node && id > 0); err = FALSE; sprintf(url, "%s/out_doc", node->url); reqheads = cblistopen(); if(cbmaprnum(node->heads) > 0){ cbmapiterinit(node->heads); while((kbuf = cbmapiternext(node->heads, NULL)) != NULL){ vbuf = cbsprintf("%s: %s", kbuf, cbmapiterval(kbuf, NULL)); cblistpush(reqheads, vbuf, -1); free(vbuf); } } cblistpush(reqheads, "Content-Type: " ESTFORMTYPE, -1); reqbody = cbdatumopen(NULL, -1); cbdatumprintf(reqbody, "id=%d", id); if(!est_url_shuttle(url, node->pxhost, node->pxport, node->timeout, ESTRESLIMSIZE, node->auth, reqheads, cbdatumptr(reqbody), cbdatumsize(reqbody), &rescode, NULL, NULL)){ node->status = -1; err = TRUE; } if(!err){ node->status = rescode; if(rescode != 200) err = TRUE; } cbdatumclose(reqbody); cblistclose(reqheads); return err ? FALSE : TRUE; } /* Remove a document specified by URI from a node. */ int est_node_out_doc_by_uri(ESTNODE *node, const char *uri){ CBLIST *reqheads; CBDATUM *reqbody; const char *kbuf; char url[ESTPATHBUFSIZ], *vbuf; int rescode, err; assert(node && uri); err = FALSE; sprintf(url, "%s/out_doc", node->url); reqheads = cblistopen(); if(cbmaprnum(node->heads) > 0){ cbmapiterinit(node->heads); while((kbuf = cbmapiternext(node->heads, NULL)) != NULL){ vbuf = cbsprintf("%s: %s", kbuf, cbmapiterval(kbuf, NULL)); cblistpush(reqheads, vbuf, -1); free(vbuf); } } cblistpush(reqheads, "Content-Type: " ESTFORMTYPE, -1); reqbody = cbdatumopen(NULL, -1); cbdatumprintf(reqbody, "uri=%?", uri); if(!est_url_shuttle(url, node->pxhost, node->pxport, node->timeout, ESTRESLIMSIZE, node->auth, reqheads, cbdatumptr(reqbody), cbdatumsize(reqbody), &rescode, NULL, NULL)){ node->status = -1; err = TRUE; } if(!err){ node->status = rescode; if(rescode != 200) err = TRUE; } cbdatumclose(reqbody); cblistclose(reqheads); return err ? FALSE : TRUE; } /* Edit attributes of a document in a node. */ int est_node_edit_doc(ESTNODE *node, ESTDOC *doc){ CBLIST *reqheads, *names; CBDATUM *reqbody; const char *kbuf; char url[ESTPATHBUFSIZ], *vbuf; int i, rescode, err, ksiz; assert(node && doc); err = FALSE; sprintf(url, "%s/edit_doc", node->url); reqheads = cblistopen(); if(cbmaprnum(node->heads) > 0){ cbmapiterinit(node->heads); while((kbuf = cbmapiternext(node->heads, NULL)) != NULL){ vbuf = cbsprintf("%s: %s", kbuf, cbmapiterval(kbuf, NULL)); cblistpush(reqheads, vbuf, -1); free(vbuf); } } cblistpush(reqheads, "Content-Type: " ESTDRAFTTYPE, -1); reqbody = cbdatumopen(NULL, -1); names = est_doc_attr_names(doc); for(i = 0; i < cblistnum(names); i++){ kbuf = cblistval(names, i, &ksiz); cbdatumcat(reqbody, kbuf, ksiz); cbdatumcat(reqbody, "=", 1); cbdatumcat(reqbody, est_doc_attr(doc, kbuf), -1); cbdatumcat(reqbody, "\n", 1); } cbdatumcat(reqbody, "\n", 1); if(!est_url_shuttle(url, node->pxhost, node->pxport, node->timeout, ESTRESLIMSIZE, node->auth, reqheads, cbdatumptr(reqbody), cbdatumsize(reqbody), &rescode, NULL, NULL)){ node->status = -1; err = TRUE; } if(!err){ node->status = rescode; if(rescode != 200) err = TRUE; } cblistclose(names); cbdatumclose(reqbody); cblistclose(reqheads); return err ? FALSE : TRUE; } /* Retrieve a document in a node. */ ESTDOC *est_node_get_doc(ESTNODE *node, int id){ ESTDOC *doc; CBLIST *reqheads; CBDATUM *reqbody, *resbody; const char *kbuf; char url[ESTPATHBUFSIZ], *vbuf; int rescode, err; assert(node && id > 0); err = FALSE; sprintf(url, "%s/get_doc", node->url); reqheads = cblistopen(); if(cbmaprnum(node->heads) > 0){ cbmapiterinit(node->heads); while((kbuf = cbmapiternext(node->heads, NULL)) != NULL){ vbuf = cbsprintf("%s: %s", kbuf, cbmapiterval(kbuf, NULL)); cblistpush(reqheads, vbuf, -1); free(vbuf); } } cblistpush(reqheads, "Content-Type: " ESTFORMTYPE, -1); reqbody = cbdatumopen(NULL, -1); cbdatumprintf(reqbody, "id=%d", id); resbody = cbdatumopen(NULL, -1); if(!est_url_shuttle(url, node->pxhost, node->pxport, node->timeout, ESTRESLIMSIZE, node->auth, reqheads, cbdatumptr(reqbody), cbdatumsize(reqbody), &rescode, NULL, resbody)){ node->status = -1; err = TRUE; } if(!err){ node->status = rescode; if(rescode != 200) err = TRUE; } doc = err ? NULL : est_doc_new_from_draft(cbdatumptr(resbody)); cbdatumclose(resbody); cbdatumclose(reqbody); cblistclose(reqheads); return doc; } /* Retrieve a document specified by URI in a node. */ ESTDOC *est_node_get_doc_by_uri(ESTNODE *node, const char *uri){ ESTDOC *doc; CBLIST *reqheads; CBDATUM *reqbody, *resbody; const char *kbuf; char url[ESTPATHBUFSIZ], *vbuf; int rescode, err; assert(node && uri); err = FALSE; sprintf(url, "%s/get_doc", node->url); reqheads = cblistopen(); if(cbmaprnum(node->heads) > 0){ cbmapiterinit(node->heads); while((kbuf = cbmapiternext(node->heads, NULL)) != NULL){ vbuf = cbsprintf("%s: %s", kbuf, cbmapiterval(kbuf, NULL)); cblistpush(reqheads, vbuf, -1); free(vbuf); } } cblistpush(reqheads, "Content-Type: " ESTFORMTYPE, -1); reqbody = cbdatumopen(NULL, -1); cbdatumprintf(reqbody, "uri=%?", uri); resbody = cbdatumopen(NULL, -1); if(!est_url_shuttle(url, node->pxhost, node->pxport, node->timeout, ESTRESLIMSIZE, node->auth, reqheads, cbdatumptr(reqbody), cbdatumsize(reqbody), &rescode, NULL, resbody)){ node->status = -1; err = TRUE; } if(!err){ node->status = rescode; if(rescode != 200) err = TRUE; } doc = err ? NULL : est_doc_new_from_draft(cbdatumptr(resbody)); cbdatumclose(resbody); cbdatumclose(reqbody); cblistclose(reqheads); return doc; } /* Retrieve the value of an attribute of a document in a node. */ char *est_node_get_doc_attr(ESTNODE *node, int id, const char *name){ CBLIST *reqheads; CBDATUM *reqbody, *resbody; const char *kbuf; char url[ESTPATHBUFSIZ], *vbuf; int rescode, err; assert(node && id > 0 && name); err = FALSE; sprintf(url, "%s/get_doc_attr", node->url); reqheads = cblistopen(); if(cbmaprnum(node->heads) > 0){ cbmapiterinit(node->heads); while((kbuf = cbmapiternext(node->heads, NULL)) != NULL){ vbuf = cbsprintf("%s: %s", kbuf, cbmapiterval(kbuf, NULL)); cblistpush(reqheads, vbuf, -1); free(vbuf); } } cblistpush(reqheads, "Content-Type: " ESTFORMTYPE, -1); reqbody = cbdatumopen(NULL, -1); cbdatumprintf(reqbody, "id=%d&attr=%?", id, name); resbody = cbdatumopen(NULL, -1); if(!est_url_shuttle(url, node->pxhost, node->pxport, node->timeout, ESTRESLIMSIZE, node->auth, reqheads, cbdatumptr(reqbody), cbdatumsize(reqbody), &rescode, NULL, resbody)){ node->status = -1; err = TRUE; } if(!err){ node->status = rescode; if(rescode != 200) err = TRUE; } if(err){ cbdatumclose(resbody); vbuf = NULL; } else { vbuf = cbdatumtomalloc(resbody, NULL); cbstrtrim(vbuf); } cbdatumclose(reqbody); cblistclose(reqheads); return vbuf; } /* Retrieve the value of an attribute of a document specified by URI in a node. */ char *est_node_get_doc_attr_by_uri(ESTNODE *node, const char *uri, const char *name){ CBLIST *reqheads; CBDATUM *reqbody, *resbody; const char *kbuf; char url[ESTPATHBUFSIZ], *vbuf; int rescode, err; assert(node && uri && name); err = FALSE; sprintf(url, "%s/get_doc_attr", node->url); reqheads = cblistopen(); if(cbmaprnum(node->heads) > 0){ cbmapiterinit(node->heads); while((kbuf = cbmapiternext(node->heads, NULL)) != NULL){ vbuf = cbsprintf("%s: %s", kbuf, cbmapiterval(kbuf, NULL)); cblistpush(reqheads, vbuf, -1); free(vbuf); } } cblistpush(reqheads, "Content-Type: " ESTFORMTYPE, -1); reqbody = cbdatumopen(NULL, -1); cbdatumprintf(reqbody, "uri=%?&attr=%?", uri, name); resbody = cbdatumopen(NULL, -1); if(!est_url_shuttle(url, node->pxhost, node->pxport, node->timeout, ESTRESLIMSIZE, node->auth, reqheads, cbdatumptr(reqbody), cbdatumsize(reqbody), &rescode, NULL, resbody)){ node->status = -1; err = TRUE; } if(!err){ node->status = rescode; if(rescode != 200) err = TRUE; } if(err){ cbdatumclose(resbody); vbuf = NULL; } else { vbuf = cbdatumtomalloc(resbody, NULL); cbstrtrim(vbuf); } cbdatumclose(reqbody); cblistclose(reqheads); return vbuf; } /* Extract keywords of a document. */ CBMAP *est_node_etch_doc(ESTNODE *node, int id){ CBLIST *reqheads; CBDATUM *reqbody, *resbody; CBMAP *kwords; CBLIST *lines; const char *kbuf, *pv; char url[ESTPATHBUFSIZ], *vbuf; int i, rescode, err; assert(node && id > 0); err = FALSE; sprintf(url, "%s/etch_doc", node->url); reqheads = cblistopen(); if(cbmaprnum(node->heads) > 0){ cbmapiterinit(node->heads); while((kbuf = cbmapiternext(node->heads, NULL)) != NULL){ vbuf = cbsprintf("%s: %s", kbuf, cbmapiterval(kbuf, NULL)); cblistpush(reqheads, vbuf, -1); free(vbuf); } } cblistpush(reqheads, "Content-Type: " ESTFORMTYPE, -1); reqbody = cbdatumopen(NULL, -1); cbdatumprintf(reqbody, "id=%d", id); resbody = cbdatumopen(NULL, -1); if(!est_url_shuttle(url, node->pxhost, node->pxport, node->timeout, ESTRESLIMSIZE, node->auth, reqheads, cbdatumptr(reqbody), cbdatumsize(reqbody), &rescode, NULL, resbody)){ node->status = -1; err = TRUE; } if(!err){ node->status = rescode; if(rescode != 200) err = TRUE; } if(err){ kwords = NULL; } else { kwords = cbmapopenex(ESTMINIBNUM); lines = cbsplit(cbdatumptr(resbody), cbdatumsize(resbody), "\n"); for(i = 0; i < cblistnum(lines); i++){ kbuf = cblistval(lines, i, NULL); if(!(pv = strchr(kbuf, '\t')) || pv == kbuf) continue; cbmapput(kwords, kbuf, pv - kbuf, pv + 1, -1, TRUE); } cblistclose(lines); } cbdatumclose(resbody); cbdatumclose(reqbody); cblistclose(reqheads); return kwords; } /* Extract keywords of a document specified by URI in a node. */ CBMAP *est_node_etch_doc_by_uri(ESTNODE *node, const char *uri){ CBLIST *reqheads; CBDATUM *reqbody, *resbody; CBMAP *kwords; CBLIST *lines; const char *kbuf, *pv; char url[ESTPATHBUFSIZ], *vbuf; int i, rescode, err; assert(node && uri); err = FALSE; sprintf(url, "%s/etch_doc", node->url); reqheads = cblistopen(); if(cbmaprnum(node->heads) > 0){ cbmapiterinit(node->heads); while((kbuf = cbmapiternext(node->heads, NULL)) != NULL){ vbuf = cbsprintf("%s: %s", kbuf, cbmapiterval(kbuf, NULL)); cblistpush(reqheads, vbuf, -1); free(vbuf); } } cblistpush(reqheads, "Content-Type: " ESTFORMTYPE, -1); reqbody = cbdatumopen(NULL, -1); cbdatumprintf(reqbody, "uri=%?", uri); resbody = cbdatumopen(NULL, -1); if(!est_url_shuttle(url, node->pxhost, node->pxport, node->timeout, ESTRESLIMSIZE, node->auth, reqheads, cbdatumptr(reqbody), cbdatumsize(reqbody), &rescode, NULL, resbody)){ node->status = -1; err = TRUE; } if(!err){ node->status = rescode; if(rescode != 200) err = TRUE; } if(err){ kwords = NULL; } else { kwords = cbmapopenex(ESTMINIBNUM); lines = cbsplit(cbdatumptr(resbody), cbdatumsize(resbody), "\n"); for(i = 0; i < cblistnum(lines); i++){ kbuf = cblistval(lines, i, NULL); if(!(pv = strchr(kbuf, '\t')) || pv == kbuf) continue; cbmapput(kwords, kbuf, pv - kbuf, pv + 1, -1, TRUE); } cblistclose(lines); } cbdatumclose(resbody); cbdatumclose(reqbody); cblistclose(reqheads); return kwords; } /* Get the ID of a document spacified by URI. */ int est_node_uri_to_id(ESTNODE *node, const char *uri){ CBLIST *reqheads; CBDATUM *reqbody, *resbody; const char *kbuf; char url[ESTPATHBUFSIZ], *vbuf; int rescode, err, id; assert(node && uri); err = FALSE; sprintf(url, "%s/uri_to_id", node->url); reqheads = cblistopen(); if(cbmaprnum(node->heads) > 0){ cbmapiterinit(node->heads); while((kbuf = cbmapiternext(node->heads, NULL)) != NULL){ vbuf = cbsprintf("%s: %s", kbuf, cbmapiterval(kbuf, NULL)); cblistpush(reqheads, vbuf, -1); free(vbuf); } } cblistpush(reqheads, "Content-Type: " ESTFORMTYPE, -1); reqbody = cbdatumopen(NULL, -1); cbdatumprintf(reqbody, "uri=%?", uri); resbody = cbdatumopen(NULL, -1); if(!est_url_shuttle(url, node->pxhost, node->pxport, node->timeout, ESTRESLIMSIZE, node->auth, reqheads, cbdatumptr(reqbody), cbdatumsize(reqbody), &rescode, NULL, resbody)){ node->status = -1; err = TRUE; } if(!err){ node->status = rescode; if(rescode != 200) err = TRUE; } id = err ? -1 : atoi(cbdatumptr(resbody)); cbdatumclose(resbody); cbdatumclose(reqbody); cblistclose(reqheads); return id; } /* Get the name of a node. */ const char *est_node_name(ESTNODE *node){ assert(node); if(node->name) return node->name; est_node_set_info(node); return node->name; } /* Get the label of a node. */ const char *est_node_label(ESTNODE *node){ assert(node); if(node->label) return node->label; est_node_set_info(node); return node->label; } /* Get the number of documents in a node. */ int est_node_doc_num(ESTNODE *node){ assert(node); if(node->dnum >= 0) return node->dnum; est_node_set_info(node); return node->dnum; } /* Get the number of words in a node. */ int est_node_word_num(ESTNODE *node){ assert(node); if(node->wnum >= 0) return node->wnum; est_node_set_info(node); return node->wnum; } /* Get the size of the datbase of a node. */ double est_node_size(ESTNODE *node){ assert(node); if(node->size >= 0.0) return node->size; est_node_set_info(node); return node->size; } /* Get the usage ratio of the cache of a node. */ double est_node_cache_usage(ESTNODE *node){ CBLIST *reqheads; CBDATUM *resbody; const char *kbuf; char url[ESTPATHBUFSIZ], *vbuf; int rescode, err; double ratio; assert(node); err = FALSE; sprintf(url, "%s/cacheusage", node->url); reqheads = cblistopen(); if(cbmaprnum(node->heads) > 0){ cbmapiterinit(node->heads); while((kbuf = cbmapiternext(node->heads, NULL)) != NULL){ vbuf = cbsprintf("%s: %s", kbuf, cbmapiterval(kbuf, NULL)); cblistpush(reqheads, vbuf, -1); free(vbuf); } } resbody = cbdatumopen(NULL, -1); if(!est_url_shuttle(url, node->pxhost, node->pxport, node->timeout, ESTRESLIMSIZE, node->auth, reqheads, NULL, -1, &rescode, NULL, resbody)){ node->status = -1; err = TRUE; } if(!err){ node->status = rescode; if(rescode != 200) err = TRUE; } ratio = err ? -1.0 : strtod(cbdatumptr(resbody), NULL); cbdatumclose(resbody); cblistclose(reqheads); return ratio; } /* Get a list of names of administrators of a node. */ const CBLIST *est_node_admins(ESTNODE *node){ assert(node); if(node->admins) return node->admins; est_node_set_info(node); return node->admins; } /* Get a list of names of users of a node. */ const CBLIST *est_node_users(ESTNODE *node){ assert(node); if(node->users) return node->users; est_node_set_info(node); return node->users; } /* Get a list of expressions of links of a node. */ const CBLIST *est_node_links(ESTNODE *node){ assert(node); if(node->links) return node->links; est_node_set_info(node); return node->links; } /* Search documents corresponding a condition for a node. */ ESTNODERES *est_node_search(ESTNODE *node, ESTCOND *cond, int depth){ ESTNODERES *nres; const CBLIST *attrs; CBMAP *resheads; CBLIST *reqheads; CBDATUM *reqbody, *resbody; const char *kbuf, *phrase, *order, *distinct, *cbuf; char buf[ESTPATHBUFSIZ], *vbuf, *ptr, *pv, *ep; int i, rescode, err, max, plen, part, end; assert(node && cond && depth >= 0); err = FALSE; sprintf(buf, "%s/search", node->url); reqheads = cblistopen(); if(cbmaprnum(node->heads) > 0){ cbmapiterinit(node->heads); while((kbuf = cbmapiternext(node->heads, NULL)) != NULL){ vbuf = cbsprintf("%s: %s", kbuf, cbmapiterval(kbuf, NULL)); cblistpush(reqheads, vbuf, -1); free(vbuf); } } cblistpush(reqheads, "Content-Type: " ESTFORMTYPE, -1); reqbody = cbdatumopen(NULL, -1); if((phrase = est_cond_phrase(cond)) != NULL) cbdatumprintf(reqbody, "phrase=%?", phrase); if((attrs = est_cond_attrs(cond)) != NULL){ for(i = 0; i < cblistnum(attrs); i++){ if(cbdatumsize(reqbody) > 0) cbdatumcat(reqbody, "&", 1); cbdatumprintf(reqbody, "attr%d=%?", i + 1, cblistval(attrs, i, NULL)); } } if((max = est_cond_max(cond)) >= 0){ if(cbdatumsize(reqbody) > 0) cbdatumcat(reqbody, "&", 1); cbdatumprintf(reqbody, "max=%d", max); } else { if(cbdatumsize(reqbody) > 0) cbdatumcat(reqbody, "&", 1); cbdatumprintf(reqbody, "max=%d", INT_MAX / 2); } if((order = est_cond_order(cond)) != NULL){ if(cbdatumsize(reqbody) > 0) cbdatumcat(reqbody, "&", 1); cbdatumprintf(reqbody, "order=%?", order); } if(cbdatumsize(reqbody) > 0) cbdatumcat(reqbody, "&", 1); cbdatumprintf(reqbody, "options=%d", est_cond_options(cond)); cbdatumprintf(reqbody, "&auxiliary=%d", est_cond_auxiliary(cond)); if((distinct = est_cond_distinct(cond)) != NULL) cbdatumprintf(reqbody, "&distinct=%?", distinct); cbdatumprintf(reqbody, "&depth=%d", depth); cbdatumprintf(reqbody, "&wwidth=%d", node->wwidth); cbdatumprintf(reqbody, "&hwidth=%d", node->hwidth); cbdatumprintf(reqbody, "&awidth=%d", node->awidth); cbdatumprintf(reqbody, "&skip=%d", est_cond_skip(cond)); cbdatumprintf(reqbody, "&mask=%d", est_cond_mask(cond)); resheads = cbmapopenex(ESTMINIBNUM); resbody = cbdatumopen(NULL, -1); if(!est_url_shuttle(buf, node->pxhost, node->pxport, node->timeout, ESTRESLIMSIZE, node->auth, reqheads, cbdatumptr(reqbody), cbdatumsize(reqbody), &rescode, resheads, resbody)){ node->status = -1; err = TRUE; } if(!err){ node->status = rescode; if(rescode != 200) err = TRUE; } if(err){ cbdatumclose(resbody); cbmapclose(resheads); cbdatumclose(reqbody); cblistclose(reqheads); return NULL; } ptr = cbdatumtomalloc(resbody, NULL); if(!(pv = strchr(ptr, '\n')) || pv <= ptr + 3){ free(ptr); cbdatumclose(reqbody); cblistclose(reqheads); return NULL; } *pv = '\0'; if(pv[-1] == '\r') pv[-1] = '\0'; plen = strlen(ptr); pv++; ep = pv; nres = est_noderes_new(); part = 0; end = FALSE; while(*ep != '\0'){ if(*ep == *ptr && cbstrfwmatch(ep, ptr) && ep[-1] == '\n' && (ep[plen] == '\r' || ep[plen] == '\n' || ep[plen] == ':')){ *ep = '\0'; if(part == 0){ est_parse_search_header(nres, pv); } else { est_parse_search_body(nres, pv); } ep += plen; if(cbstrfwmatch(ep, ":END")){ end = TRUE; break; } if(*ep == '\r') ep++; if(*ep == '\n') ep++; pv = ep; part++; } else { ep++; } } free(ptr); if((cbuf = cbmapget(resheads, "last-modified", -1, NULL)) != NULL){ nres->mdate = cbstrmktime(cbuf); } else { nres->mdate = time(NULL); } cbmapclose(resheads); cbdatumclose(reqbody); cblistclose(reqheads); if(!end){ est_noderes_delete(nres); return NULL; } return nres; } /* Set width of snippet in the result from a node. */ void est_node_set_snippet_width(ESTNODE *node, int wwidth, int hwidth, int awidth){ assert(node); node->wwidth = wwidth; if(hwidth >= 0) node->hwidth = hwidth; if(awidth >= 0) node->awidth = awidth; } /* Manage a user account of a node. */ int est_node_set_user(ESTNODE *node, const char *name, int mode){ CBLIST *reqheads; CBDATUM *reqbody, *resbody; const char *kbuf; char url[ESTPATHBUFSIZ], *vbuf; int rescode, err; assert(node && name); err = FALSE; sprintf(url, "%s/_set_user", node->url); reqheads = cblistopen(); if(cbmaprnum(node->heads) > 0){ cbmapiterinit(node->heads); while((kbuf = cbmapiternext(node->heads, NULL)) != NULL){ vbuf = cbsprintf("%s: %s", kbuf, cbmapiterval(kbuf, NULL)); cblistpush(reqheads, vbuf, -1); free(vbuf); } } cblistpush(reqheads, "Content-Type: " ESTFORMTYPE, -1); reqbody = cbdatumopen(NULL, -1); cbdatumprintf(reqbody, "name=%?&mode=%d", name, mode); resbody = cbdatumopen(NULL, -1); if(!est_url_shuttle(url, node->pxhost, node->pxport, node->timeout, ESTRESLIMSIZE, node->auth, reqheads, cbdatumptr(reqbody), cbdatumsize(reqbody), &rescode, NULL, resbody)){ node->status = -1; err = TRUE; } if(!err){ node->status = rescode; if(rescode != 200) err = TRUE; } cbdatumclose(resbody); cbdatumclose(reqbody); cblistclose(reqheads); return err ? FALSE : TRUE; } /* Manage a link of a node. */ int est_node_set_link(ESTNODE *node, const char *url, const char *label, int credit){ CBLIST *reqheads; CBDATUM *reqbody, *resbody; const char *kbuf; char myurl[ESTPATHBUFSIZ], *vbuf; int rescode, err; assert(node && url && label); err = FALSE; sprintf(myurl, "%s/_set_link", node->url); reqheads = cblistopen(); if(cbmaprnum(node->heads) > 0){ cbmapiterinit(node->heads); while((kbuf = cbmapiternext(node->heads, NULL)) != NULL){ vbuf = cbsprintf("%s: %s", kbuf, cbmapiterval(kbuf, NULL)); cblistpush(reqheads, vbuf, -1); free(vbuf); } } cblistpush(reqheads, "Content-Type: " ESTFORMTYPE, -1); reqbody = cbdatumopen(NULL, -1); if(credit >= 0){ cbdatumprintf(reqbody, "url=%?&label=%?&credit=%d", url, label, credit); } else { cbdatumprintf(reqbody, "url=%?&label=%?", url, label); } resbody = cbdatumopen(NULL, -1); if(!est_url_shuttle(myurl, node->pxhost, node->pxport, node->timeout, ESTRESLIMSIZE, node->auth, reqheads, cbdatumptr(reqbody), cbdatumsize(reqbody), &rescode, NULL, resbody)){ node->status = -1; err = TRUE; } if(!err){ node->status = rescode; if(rescode != 200) err = TRUE; } cbdatumclose(resbody); cbdatumclose(reqbody); cblistclose(reqheads); return err ? FALSE : TRUE; } /************************************************************************************************* * features for experts *************************************************************************************************/ /* Get the name of this host. */ const char *est_get_host_name(void){ static char host[ESTPATHBUFSIZ]; static int first = TRUE; if(!est_host_addrs) return "127.0.0.1"; if(first){ first = FALSE; if(gethostname(host, ESTPATHBUFSIZ - 1) == -1) return "127.0.0.1"; return host; } return host; } /* Get the address of a host. */ char *est_get_host_addr(const char *name){ const char *addr; char *buf, *pv, vbuf[64]; int i, ost, nsiz, asiz, vsiz; assert(name); if(pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &ost) != 0) return NULL; if(pthread_mutex_lock(&est_host_addrs_mutex) != 0){ pthread_setcancelstate(ost, NULL); return NULL; } if(!est_host_addrs){ pthread_mutex_unlock(&est_host_addrs_mutex); pthread_setcancelstate(ost, NULL); return NULL; } nsiz = strlen(name); buf = NULL; if((addr = cbmapget(est_host_addrs, name, nsiz, &asiz)) != NULL){ buf = cbmemdup(addr, asiz); if((pv = strchr(buf, '\t')) != NULL){ *pv = '\0'; if((int)time(NULL) - atoi(pv + 1) > ESTDNHOLDSEC){ free(buf); buf = NULL; } } cbmapmove(est_host_addrs, name, nsiz, FALSE); } pthread_mutex_unlock(&est_host_addrs_mutex); pthread_setcancelstate(ost, NULL); if(buf){ if(buf[0] != '\0') return buf; free(buf); return NULL; } buf = est_gethostaddrbyname(name); if(pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &ost) == 0){ if(pthread_mutex_lock(&est_host_addrs_mutex) == 0){ vsiz = sprintf(vbuf, "%s\t%d", buf ? buf : "", (int)time(NULL)); cbmapput(est_host_addrs, name, nsiz, vbuf, vsiz, TRUE); if(cbmaprnum(est_host_addrs) > ESTDNHOLDNUM){ cbmapiterinit(est_host_addrs); for(i = 0; i < ESTDNHOLDNUM / 4 && (addr = cbmapiternext(est_host_addrs, &asiz)) != NULL; i++){ cbmapout(est_host_addrs, addr, asiz); } } pthread_mutex_unlock(&est_host_addrs_mutex); } pthread_setcancelstate(ost, NULL); } return buf; } /* Get a server socket of an address and a port. */ int est_get_server_sock(const char *addr, int port){ struct sockaddr_in address; struct linger li; int ost, sock, optone; assert(port > 0); if(pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &ost) != 0) return -1; memset(&address, 0, sizeof(address)); address.sin_family = AF_INET; if(!est_inet_aton(addr ? addr : "0.0.0.0", &address.sin_addr)){ pthread_setcancelstate(ost, NULL); return -1; } address.sin_port = htons(port); if((sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1){ pthread_setcancelstate(ost, NULL); return -1; } li.l_onoff = 1; li.l_linger = 100; optone = 1; if(setsockopt(sock, SOL_SOCKET, SO_LINGER, (char *)&li, sizeof(li)) == -1 || setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&optone, sizeof(optone)) == -1){ est_sock_close(sock); pthread_setcancelstate(ost, NULL); return -1; } if(bind(sock, (struct sockaddr *)&address, sizeof(address)) == -1 || listen(sock, SOMAXCONN) == -1){ est_sock_close(sock); pthread_setcancelstate(ost, NULL); return -1; } pthread_setcancelstate(ost, NULL); return sock; } /* Accept a connection from a client. */ int est_accept_conn(int sock, char *abuf, int *pp){ struct sockaddr_in address; socklen_t socklen; int clsock; assert(sock >= 0); socklen = sizeof(address); if((clsock = accept(sock, (struct sockaddr *)&address, &socklen)) >= 0){ if(abuf) sprintf(abuf, "%s", inet_ntoa(address.sin_addr)); if(pp) *pp = (int)ntohs(address.sin_port); return clsock; } return (errno == EINTR || errno == EAGAIN) ? 0 : -1; } /* Get a client socket to an address and a port. */ int est_get_client_sock(const char *addr, int port){ struct sockaddr_in address; struct linger li; int ost, sock; assert(addr && port >= 0); if(pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &ost) != 0) return -1; memset(&address, 0, sizeof(address)); address.sin_family = AF_INET; if(!est_inet_aton(addr, &address.sin_addr)){ pthread_setcancelstate(ost, NULL); return -1; } address.sin_port = htons(port); if((sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1){ pthread_setcancelstate(ost, NULL); return -1; } li.l_onoff = 1; li.l_linger = 100; if(setsockopt(sock, SOL_SOCKET, SO_LINGER, (char *)&li, sizeof(li)) == -1){ est_sock_close(sock); pthread_setcancelstate(ost, NULL); return -1; } if(connect(sock, (struct sockaddr *)&address, sizeof(address)) == -1){ est_sock_close(sock); pthread_setcancelstate(ost, NULL); return -1; } pthread_setcancelstate(ost, NULL); return sock; } /* Shutdown and close a socket. */ void est_sock_down(int sock){ assert(sock >= 0); shutdown(sock, 2); est_sock_close(sock); } /* Receive all data from a socket. */ char *est_sock_recv_all(int sock, int len){ char *buf; int i, bs; assert(sock >= 0 && len >= 0); buf = cbmalloc(len + 1); for(i = 0; i < len && (bs = recv(sock, buf + i, len - i, 0)) != 0; i += bs){ if(bs == -1 && errno != EINTR){ free(buf); return NULL; } } buf[i] = '\0'; return buf; } /* Receive a line from a socket. */ int est_sock_recv_line(int sock, char *buf, int max){ char *wp; assert(sock >= 0 && buf && max > 0); max--; wp = buf; while(wp < buf + max){ switch(recv(sock, wp, 1, 0)){ case -1: if(errno != EINTR){ *wp = '\0'; return wp - buf; } break; case 0: *wp = '\0'; return wp - buf; default: switch(*wp){ case '\r': break; case '\n': *wp = '\0'; return wp - buf; default: wp++; break; } break; } } *wp = '\0'; return wp - buf; } /* Receive void data from a socket. */ void est_sock_recv_void(int sock){ fd_set rfds; struct timeval tv; char ibuf[ESTIOBUFSIZ]; assert(sock >= 0); FD_ZERO(&rfds); FD_SET(sock, &rfds); tv.tv_sec = 0; tv.tv_usec = 0; if(select(sock + 1, &rfds, NULL, NULL, &tv) > 0 && FD_ISSET(sock, &rfds)) recv(sock, ibuf, ESTIOBUFSIZ, 0); } /* Write all data into a socket. */ void est_sock_send_all(int sock, const char *buf, int len){ const char *rp; int rv, wb; assert(sock >= 0 && buf && len >= 0); rp = buf; rv = 0; do { wb = send(sock, rp, len, 0); switch(wb){ case -1: if(errno != EINTR) return; case 0: break; default: rp += wb; len -= wb; rv += wb; break; } } while(len > 0); } /* Perform an interaction of a URL. */ int est_url_shuttle(const char *url, const char *pxhost, int pxport, int outsec, int limsize, const char *auth, const CBLIST *reqheads, const char *reqbody, int rbsiz, int *rescodep, CBMAP *resheads, CBDATUM *resbody){ pthread_t th; pthread_mutex_t mutex; pthread_cond_t cond; struct timespec timeout; TARGSHUTTLE targ; int err, rv; void *rvp; pthread_mutex_init(&mutex, NULL); pthread_cond_init(&cond, NULL); targ.alive = TRUE; targ.cond = &cond; targ.url = url; targ.pxhost = pxhost; targ.pxport = pxport; targ.limsize = limsize; targ.auth = auth; targ.reqheads = reqheads; targ.reqbody = reqbody; targ.rbsiz = rbsiz; targ.rescodep = rescodep; targ.resheads = resheads; targ.resbody = resbody; err = FALSE; if(outsec >= 0){ if(pthread_mutex_lock(&mutex) == 0){ if(pthread_create(&th, NULL, est_url_shuttle_impl, &targ) == 0){ timeout.tv_sec = time(NULL) + outsec; timeout.tv_nsec = 1000 * 1000 * 500; rv = 0; while(targ.alive && rv != ETIMEDOUT){ rv = pthread_cond_timedwait(&cond, &mutex, &timeout); } if(rv == ETIMEDOUT){ pthread_cancel(th); pthread_join(th, NULL); err = TRUE; } else if(pthread_join(th, &rvp) != 0 || rvp != NULL){ err = TRUE; } } else { err = TRUE; } pthread_mutex_unlock(&mutex); } else { err = TRUE; } } else { if(est_url_shuttle_impl(&targ) != NULL) err = TRUE; } if(pthread_mutex_destroy(&mutex) != 0) err = TRUE; if(pthread_cond_destroy(&cond) != 0) err = TRUE; return err ? FALSE : TRUE; } /* Initialize the document iterator of a node. */ int est_node_iter_init(ESTNODE *node){ est_node_iter_delete(node); return est_node_read_list(node) != -1; } /* Get the next document of the document iterator of a node. */ ESTDOC *est_node_iter_next(ESTNODE *node){ ESTDOC *doc; char *vbuf; if(!node->ilist) return NULL; if(cblistnum(node->ilist) < 1){ cblistclose(node->ilist); node->ilist = cblistopen(); if((est_node_read_list(node) == -1 || cblistnum(node->ilist) < 1)) return NULL; } vbuf = cblistshift(node->ilist, NULL); doc = *(ESTDOC **)vbuf; free(vbuf); return doc; } /* Add a header to a node connection object. */ void est_node_add_header(ESTNODE *node, const char *name, const char *value){ const char *vbuf; int len; assert(node && name); len = strlen(name); if(value){ if((vbuf = cbmapget(node->heads, name, len, NULL)) != NULL){ cbmapputcat(node->heads, name, len, ", ", 2); cbmapputcat(node->heads, name, len, value, -1); } else { cbmapput(node->heads, name, len, value, -1, FALSE); } } else { cbmapout(node->heads, name, len); } } /* Create a node result object. */ ESTNODERES *est_noderes_new(void){ ESTNODERES *nres; nres = cbmalloc(sizeof(ESTNODERES)); nres->top = 0; nres->max = ESTLISTUNIT; nres->docs = cbmalloc(sizeof(ESTRESDOC) * nres->max); nres->dnum = 0; nres->survivors = NULL; nres->snum = 0; nres->hints = cbmapopenex(ESTMINIBNUM); nres->mdate = 0; return nres; } /* Add a document information to a node result object. */ void est_noderes_add_doc(ESTNODERES *nres, CBMAP *attrs, char *snippet){ const char *uri; int idx; assert(nres && attrs && snippet); if(!(uri = cbmapget(attrs, ESTDATTRURI, -1, NULL))){ free(snippet); cbmapclose(attrs); return; } if(nres->top + nres->dnum >= nres->max){ nres->max *= 2; nres->docs = cbrealloc(nres->docs, nres->max * sizeof(ESTRESDOC)); } idx = nres->top+nres->dnum; nres->docs[idx].uri = uri; nres->docs[idx].attrs = attrs; nres->docs[idx].snippet = snippet; nres->docs[idx].kwords = NULL; nres->docs[idx].similarity = -1.0; nres->docs[idx].children = NULL; nres->docs[idx].cnum = 0; nres->dnum++; } /* Remove the top of result document objects in a node result object. */ int est_noderes_shift_doc(ESTNODERES *nres, CBMAP **attrp, char **snippetp){ assert(nres && attrp && snippetp); if(nres->dnum < 1) return FALSE; *attrp = nres->docs[nres->top].attrs; *snippetp = nres->docs[nres->top].snippet; if(nres->docs[nres->top].kwords) cbmapclose(nres->docs[nres->top].kwords); free(nres->docs[nres->top].children); nres->top++; nres->dnum--; return TRUE; } /* Get the modification date of a node result object. */ time_t est_noderes_mdate(ESTNODERES *nres){ assert(nres); return nres->mdate; } /************************************************************************************************* * private objects *************************************************************************************************/ /* Get the primary address of a host name. `name' specifies the name of a host. The return value is the address of a host or `NULL' if failure. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ static char *est_gethostaddrbyname(const char *name){ #if defined(_SYS_LINUX_) struct hostent infobuf, *info; char buf[ESTIOBUFSIZ], *addr; int ecode; if(gethostbyname_r(name, &infobuf, buf, ESTIOBUFSIZ, &info, &ecode) == 0 && info){ addr = cbmemdup(inet_ntoa(*(struct in_addr *)info->h_addr_list[0]), -1); } else { addr = NULL; } return addr; #else static pthread_mutex_t mymutex = PTHREAD_MUTEX_INITIALIZER; struct hostent *info; char *addr; int ost; assert(name); if(pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &ost) != 0) return NULL; if(pthread_mutex_lock(&mymutex) != 0){ pthread_setcancelstate(ost, NULL); return NULL; } if((info = gethostbyname(name)) != NULL && info->h_addr_list[0]){ addr = cbmemdup(inet_ntoa(*(struct in_addr *)info->h_addr_list[0]), -1); } else { addr = NULL; } pthread_mutex_unlock(&mymutex); pthread_setcancelstate(ost, NULL); return addr; #endif } /* Close a socket. `sock' specifies a socket. The return value is 0 if success, else it is -1. */ static int est_sock_close(int sock){ #if defined(_SYS_MSVC_) || defined(_SYS_MINGW_) assert(sock >= 0); return closesocket(sock); #else assert(sock >= 0); return close(sock); #endif } /* Convert a host address to network binary data. `cp' specifies a host address. `inp' specifies the pointer to an structure into which the result is to be stored. The return value is true if success, else it is false. */ static int est_inet_aton(const char *cp, struct in_addr *inp){ #if defined(_SYS_MSVC_) || defined(_SYS_MINGW_) in_addr_t in; assert(cp && inp); if((in = inet_addr(cp)) == INADDR_NONE){ if(!strcmp(cp, "255.255.255.255")){ inp->s_addr = in; return TRUE; } return FALSE; } inp->s_addr = in; return TRUE; #else assert(cp && inp); return inet_aton(cp, inp); #endif } /* Perform the communication which can be canceled. `targ' specifies the pointer to a closure arguments. The return value is `NULL' if sucessful or non `NULL' value on error. */ static void *est_url_shuttle_impl(void *targ){ const CBLIST *reqheads; CBMAP *resheads, *elems; CBDATUM *resbody, *datum; const char *url, *pxhost, *auth, *reqbody, *tmp, *scheme, *host, *path, *query, *rp; char *addr, *enc, iobuf[ESTIOBUFSIZ], name[ESTIOBUFSIZ], *pv, *zbuf; int i, pxport, limsize, rbsiz, *rescodep, port, sock, *sp, size, nsiz, defl, zsiz; assert(targ); url = ((TARGSHUTTLE *)targ)->url; pxhost = ((TARGSHUTTLE *)targ)->pxhost; pxport = ((TARGSHUTTLE *)targ)->pxport; limsize = ((TARGSHUTTLE *)targ)->limsize; auth = ((TARGSHUTTLE *)targ)->auth; reqheads = ((TARGSHUTTLE *)targ)->reqheads; reqbody = ((TARGSHUTTLE *)targ)->reqbody; rbsiz = ((TARGSHUTTLE *)targ)->rbsiz; rescodep = ((TARGSHUTTLE *)targ)->rescodep; resheads = ((TARGSHUTTLE *)targ)->resheads; resbody = ((TARGSHUTTLE *)targ)->resbody; elems = cburlbreak(url); pthread_cleanup_push((void (*)(void *))cbmapclose, elems); scheme = cbmapget(elems, "scheme", -1, NULL); host = cbmapget(elems, "host", -1, NULL); port = (tmp = cbmapget(elems, "port", -1, NULL)) ? atoi(tmp) : 80; if(!auth) auth = cbmapget(elems, "authority", -1, NULL); if(!(path = cbmapget(elems, "path", -1, NULL))) path = "/"; if(!(query = cbmapget(elems, "query", -1, NULL))) query = ""; if(!scheme || cbstricmp(scheme, "http") || !host || port < 1 || !(addr = est_get_host_addr(pxhost ? pxhost : host))){ ((TARGSHUTTLE *)targ)->alive = FALSE; pthread_cond_signal(((TARGSHUTTLE *)targ)->cond); cbmapclose(elems); return "error"; } pthread_cleanup_push((void (*)(void *))free, addr); if((sock = est_get_client_sock(addr, pxhost ? pxport : port)) == -1){ ((TARGSHUTTLE *)targ)->alive = FALSE; pthread_cond_signal(((TARGSHUTTLE *)targ)->cond); free(addr); cbmapclose(elems); return "error"; } sp = cbmalloc(sizeof(int)); *sp = sock; pthread_cleanup_push((void (*)(void *))est_sockpt_down, sp); datum = cbdatumopen(NULL, -1); pthread_cleanup_push((void (*)(void *))cbdatumclose, datum); if(pxhost){ cbdatumprintf(datum, "%s %s HTTP/1.0\r\n", reqbody ? "POST" : "GET", url); } else if(reqbody){ cbdatumprintf(datum, "POST %s HTTP/1.0\r\n", path); } else if(query[0] != 0){ cbdatumprintf(datum, "GET %s?%s HTTP/1.0\r\n", path, query); } else { cbdatumprintf(datum, "GET %s HTTP/1.0\r\n", path); } cbdatumprintf(datum, "Host: %s:%d\r\n", host, port); cbdatumprintf(datum, "Connection: close\r\n", path); cbdatumprintf(datum, "User-Agent: %s/%s\r\n", ESTAGENTNAME, est_version); if(auth){ enc = cbbaseencode(auth, -1); cbdatumprintf(datum, "Authorization: Basic %s\r\n", enc); free(enc); } if(ESTUSEZLIB) cbdatumprintf(datum, "Accept-Encoding: deflate\r\n"); if(reqbody) cbdatumprintf(datum, "Content-Length: %d\r\n", rbsiz); if(reqheads){ for(i = 0; i < cblistnum(reqheads); i++){ rp = cblistval(reqheads, i, &size); cbdatumprintf(datum, rp, size); cbdatumprintf(datum, "\r\n", 2); } } cbdatumprintf(datum, "\r\n"); est_sock_send_all(sock, cbdatumptr(datum), cbdatumsize(datum)); if(reqbody) est_sock_send_all(sock, reqbody, rbsiz); if((size = est_sock_recv_line(sock, iobuf, ESTIOBUFSIZ - 1)) < 1 || !cbstrfwmatch(iobuf, "HTTP/") || !(rp = strchr(iobuf, ' '))){ ((TARGSHUTTLE *)targ)->alive = FALSE; pthread_cond_signal(((TARGSHUTTLE *)targ)->cond); cbdatumclose(datum); est_sockpt_down(sp); free(addr); cbmapclose(elems); return "error"; } rp++; if(rescodep) *rescodep = atoi(rp); if(resheads) cbmapput(resheads, "", 0, iobuf, size, TRUE); name[0] = '\0'; nsiz = 0; defl = FALSE; while((size = est_sock_recv_line(sock, iobuf, ESTIOBUFSIZ - 1)) > 0){ if(resheads){ if(iobuf[0] == ' ' || iobuf[0] == '\t'){ if(name[0] != '\0'){ iobuf[0] = ' '; cbmapputcat(resheads, name, nsiz, iobuf, size); } } else if((rp = strchr(iobuf, ':')) > iobuf){ nsiz = rp - iobuf; memcpy(name, iobuf, nsiz); name[nsiz] = '\0'; for(pv = name; *pv != '\0'; pv++){ if(*pv >= 'A'&& *pv <= 'Z') *pv = *pv + ('a' - 'A'); } rp++; if(*rp == ' ' || *rp == '\t') rp++; if(cbmapget(resheads, name, nsiz, NULL)){ cbmapputcat(resheads, name, nsiz, ", ", 2); cbmapputcat(resheads, name, nsiz, pv, -1); } else { cbmapput(resheads, name, nsiz, rp, -1, TRUE); } } } if(cbstrfwimatch(iobuf, "content-encoding:") && strstr(iobuf + 17, "deflate")) defl = TRUE; } if(limsize < 0) limsize = INT_MAX; while((size = recv(sock, iobuf, ESTIOBUFSIZ, 0)) > 0){ if(resbody && cbdatumsize(resbody) <= limsize) cbdatumcat(resbody, iobuf, size); } if(defl && (zbuf = est_inflate(cbdatumptr(resbody), cbdatumsize(resbody), &zsiz, 0)) != NULL){ cbdatumsetbuf(resbody, zbuf, zsiz); } pthread_cleanup_pop(1); pthread_cleanup_pop(1); pthread_cleanup_pop(1); pthread_cleanup_pop(1); ((TARGSHUTTLE *)targ)->alive = FALSE; pthread_cond_signal(((TARGSHUTTLE *)targ)->cond); return NULL; } /* Release the socket of a pointer. `sp' specifies the pointer to a variable of a file descriptor. */ static void est_sockpt_down(void *sp){ est_sock_down(*(int *)sp); free(sp); } /* Set meta informations of a node. `node' specifies a node connection object. The return value is true if success, else it is false. */ static int est_node_set_info(ESTNODE *node){ CBLIST *reqheads, *elems; CBDATUM *resbody; const char *kbuf, *ptr, *pv, *tv; char url[ESTPATHBUFSIZ], *vbuf; int rescode, err, tc; assert(node); err = FALSE; sprintf(url, "%s/inform", node->url); reqheads = cblistopen(); if(cbmaprnum(node->heads) > 0){ cbmapiterinit(node->heads); while((kbuf = cbmapiternext(node->heads, NULL)) != NULL){ vbuf = cbsprintf("%s: %s", kbuf, cbmapiterval(kbuf, NULL)); cblistpush(reqheads, vbuf, -1); free(vbuf); } } node->dnum = -1; node->wnum = -1; node->size = -1.0; if(node->admins){ cblistclose(node->admins); node->admins = NULL; } if(node->users){ cblistclose(node->users); node->users = NULL; } if(node->links){ cblistclose(node->links); node->links = NULL; } resbody = cbdatumopen(NULL, -1); if(!est_url_shuttle(url, node->pxhost, node->pxport, node->timeout, ESTRESLIMSIZE, node->auth, reqheads, NULL, -1, &rescode, NULL, resbody)){ node->status = -1; err = TRUE; } if(!err){ node->status = rescode; if(rescode != 200) err = TRUE; } if(!err){ ptr = cbdatumptr(resbody); if((pv = strchr(ptr, '\n')) != NULL){ elems = cbsplit(ptr, pv - ptr, "\t"); if(cblistnum(elems) == 5){ if(!node->name) node->name = cbmemdup(cblistval(elems, 0, NULL), -1); if(!node->label) node->label = cbmemdup(cblistval(elems, 1, NULL), -1); node->dnum = atoi(cblistval(elems, 2, NULL)); node->wnum = atoi(cblistval(elems, 3, NULL)); node->size = strtod(cblistval(elems, 4, NULL), NULL); if(node->dnum < 0){ node->dnum = -1; err = TRUE; } if(node->wnum < 0){ node->wnum = -1; err = TRUE; } if(node->size < 0.0){ node->size = -1.0; err = TRUE; } ptr = pv; ptr++; if(*ptr == '\n') ptr++; node->admins = cblistopen(); while((pv = strchr(ptr, '\n')) != NULL){ if(ptr == pv){ ptr = pv + 1; break; } cblistpush(node->admins, ptr, pv - ptr); ptr = pv + 1; } if(*pv == '\n') pv++; node->users = cblistopen(); while((pv = strchr(ptr, '\n')) != NULL){ if(ptr == pv){ ptr = pv + 1; break; } cblistpush(node->users, ptr, pv - ptr); ptr = pv + 1; } if(*pv == '\n') pv++; node->links = cblistopen(); while((pv = strchr(ptr, '\n')) != NULL){ if(ptr == pv){ ptr = pv + 1; break; } tc = 0; tv = ptr; while(tv < pv){ if(*tv == '\t') tc++; tv++; } if(tc == 2) cblistpush(node->links, ptr, pv - ptr); ptr = pv + 1; } } else { err = TRUE; } cblistclose(elems); } else { err = TRUE; } } cbdatumclose(resbody); cblistclose(reqheads); return err ? FALSE : TRUE; } /* Delete the document iterator of a node. `node' specifies a node connection object. */ static void est_node_iter_delete(ESTNODE *node){ int i; assert(node); if(node->ilist){ for(i = 0; i < cblistnum(node->ilist); i++){ est_doc_delete(*(ESTDOC **)cblistval(node->ilist, i, NULL)); } cblistclose(node->ilist); node->ilist = NULL; } free(node->iprev); node->iprev = NULL; } /* Read charge documents into the document iterator of a node. `node' specifies a node connection object. The return value is the number of charged documents or -1 on error. */ static int est_node_read_list(ESTNODE *node){ ESTDOC *doc; CBLIST *reqheads, *lines, *fields; CBDATUM *reqbody, *resbody; const char *kbuf, *id, *uri; char url[ESTPATHBUFSIZ], *vbuf; int i, rescode, err, ksiz, dnum; assert(node); err = FALSE; sprintf(url, "%s/list", node->url); reqheads = cblistopen(); if(cbmaprnum(node->heads) > 0){ cbmapiterinit(node->heads); while((kbuf = cbmapiternext(node->heads, NULL)) != NULL){ vbuf = cbsprintf("%s: %s", kbuf, cbmapiterval(kbuf, NULL)); cblistpush(reqheads, vbuf, -1); free(vbuf); } } cblistpush(reqheads, "Content-Type: " ESTFORMTYPE, -1); reqbody = cbdatumopen(NULL, -1); cbdatumprintf(reqbody, "max=%d", ESTITERUNIT); if(node->iprev) cbdatumprintf(reqbody, "&prev=%?", node->iprev); resbody = cbdatumopen(NULL, -1); if(!est_url_shuttle(url, node->pxhost, node->pxport, node->timeout, ESTRESLIMSIZE, node->auth, reqheads, cbdatumptr(reqbody), cbdatumsize(reqbody), &rescode, NULL, resbody)){ node->status = -1; err = TRUE; } if(!err){ node->status = rescode; if(rescode != 200) err = TRUE; } dnum = 0; if(!err){ if(!node->ilist) node->ilist = cblistopen(); lines = cbsplit(cbdatumptr(resbody), cbdatumsize(resbody), "\r\n"); for(i = 0; i < cblistnum(lines); i++){ kbuf = cblistval(lines, i, &ksiz); if(ksiz < 1) continue; fields = cbsplit(kbuf, ksiz, "\t"); if(cblistnum(fields) == 14){ id = cblistval(fields, 0, NULL); uri = cblistval(fields, 1, NULL); doc = est_doc_new(); est_doc_set_id(doc, atoi(id)); est_doc_add_attr(doc, ESTDATTRID, id); est_doc_add_attr(doc, ESTDATTRURI, uri); est_doc_add_attr(doc, ESTDATTRDIGEST, cblistval(fields, 2, NULL)); est_doc_add_attr(doc, ESTDATTRCDATE, cblistval(fields, 3, NULL)); est_doc_add_attr(doc, ESTDATTRMDATE, cblistval(fields, 4, NULL)); est_doc_add_attr(doc, ESTDATTRADATE, cblistval(fields, 5, NULL)); est_doc_add_attr(doc, ESTDATTRTITLE, cblistval(fields, 6, NULL)); est_doc_add_attr(doc, ESTDATTRAUTHOR, cblistval(fields, 7, NULL)); est_doc_add_attr(doc, ESTDATTRTYPE, cblistval(fields, 8, NULL)); est_doc_add_attr(doc, ESTDATTRLANG, cblistval(fields, 9, NULL)); est_doc_add_attr(doc, ESTDATTRGENRE, cblistval(fields, 10, NULL)); est_doc_add_attr(doc, ESTDATTRSIZE, cblistval(fields, 11, NULL)); est_doc_add_attr(doc, ESTDATTRWEIGHT, cblistval(fields, 12, NULL)); est_doc_add_attr(doc, ESTDATTRMISC, cblistval(fields, 13, NULL)); cblistpush(node->ilist, (char *)&doc, sizeof(ESTDOC *)); dnum++; free(node->iprev); node->iprev = cbmemdup(uri, -1); } cblistclose(fields); } cblistclose(lines); } cbdatumclose(resbody); cbdatumclose(reqbody); cblistclose(reqheads); return err ? -1 : dnum; } /* Parse the header of a result data. `nres' specifies a node result object. `str' specifies the header of a result data. */ static void est_parse_search_header(ESTNODERES *nres, const char *str){ CBLIST *lines; const char *line, *pv; int i; assert(nres && str); lines = cbsplit(str, -1, "\r\n"); for(i = 0; i < cblistnum(lines); i++){ line = cblistval(lines, i, NULL); if(!(pv = strchr(line, '\t')) || pv == line || pv[1] == '\0') continue; cbmapput(nres->hints, line, pv - line, pv + 1, -1, FALSE); } cblistclose(lines); } /* Parse a body part of a result data. `nres' specifies a node result object. `str' specifies a body part of a result data. */ static void est_parse_search_body(ESTNODERES *nres, char *str){ CBMAP *attrs; char *pv, *ep, *mp; pv = str; attrs = cbmapopenex(ESTMINIBNUM); while(TRUE){ if(!(ep = strchr(pv, '\n')) || ep == pv) break; *ep = '\0'; cbstrtrim(pv); if(*pv == '\0') break; if(*pv == '%'){ if(cbstrfwmatch(pv, ESTDCNTLVECTOR) && (pv = strchr(pv, '\t')) != NULL) cbmapput(attrs, ESTDCNTLVECTOR, -1, pv + 1, -1, FALSE); } else if((mp = strchr(pv, '=')) != NULL){ *mp = '\0'; cbmapput(attrs, pv, -1, mp + 1, -1, TRUE); } pv = ep + 1; } while(*pv == '\r' || *pv == '\n'){ pv++; } est_noderes_add_doc(nres, attrs, cbmemdup(pv, -1)); } /* END OF FILE */ hyperestraier-1.4.13/estnode.h000066400000000000000000000667131125261632700163220ustar00rootroot00000000000000/************************************************************************************************* * The node API of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #ifndef _ESTNODE_H /* duplication check */ #define _ESTNODE_H #if defined(__cplusplus) /* export for C++ */ extern "C" { #endif #include #include #include #include #include /************************************************************************************************* * API for the network environment *************************************************************************************************/ /* Initialize the networking environment. The return value is true if success, else it is false. As it is allowable to call this function multiple times, it is needed to call the function `est_free_net_env' at the same frequency. */ int est_init_net_env(void); /* Free the networking environment. */ void est_free_net_env(void); /************************************************************************************************* * API for search result of node *************************************************************************************************/ typedef struct _ESTRESDOC { /* type of structure for a document in result */ const char *uri; /* URI */ CBMAP *attrs; /* attributes */ char *snippet; /* snippet */ CBMAP *kwords; /* keywords */ double similarity; /* similarity to the parent document */ struct _ESTRESDOC **children; /* child documents */ int cnum; /* number of child documents */ } ESTRESDOC; typedef struct { /* type of structure for search result */ ESTRESDOC *docs; /* array of documents */ int top; /* offset number of the top element */ int max; /* maximum number of allcated elements */ int dnum; /* number of effective elements */ ESTRESDOC **survivors; /* pointers to surviving documents */ int snum; /* number of surviving elements */ CBMAP *hints; /* map object for hints */ time_t mdate; /* modification date */ } ESTNODERES; /* Delete a node result object. `nres' specifies a node result object. */ void est_noderes_delete(ESTNODERES *nres); /* Get a map object for hints of a node result object. `nres' specifies a node result object. The return value is a map object for hints. Keys of the map are "VERSION", "NODE", "HIT", "HINT#n", "DOCNUM", "WORDNUM", "TIME", "TIME#n", "LINK#n", and "VIEW". The life duration of the returned object is synchronous with the one of the node result object. */ CBMAP *est_noderes_hints(ESTNODERES *nres); /* Eclipse similar documents of a node result object. `nres' specifies a node result object. `num' specifies the number of documents to be shown. If it is not more than 0, eclipse is undone. `limit' specifies the lower limit of similarity for documents to be eclipsed. Similarity is between 0.0 and 1.0. */ void est_noderes_eclipse(ESTNODERES *nres, int num, double limit); /* Get the number of documents in a node result object. `nres' specifies a node result object. The return value is the number of documents in a node result object. */ int est_noderes_doc_num(ESTNODERES *nres); /* Refer a result document object in a node result object. `nres' specifies a node result object. `index' specifies the index of a document. The return value is a result document object or `NULL' if `index' is equal to or more than the number of documents. The life duration of the returned object is synchronous with the one of the node result object. */ ESTRESDOC *est_noderes_get_doc(ESTNODERES *nres, int index); /* Get the URI of a result document object. `doc' specifies a result document object. The return value is the URI of the result document object. The life duration of the returned string is synchronous with the one of the result document object. */ const char *est_resdoc_uri(ESTRESDOC *rdoc); /* Get a list of attribute names of a result document object. `rdoc' specifies a result document object. The return value is a new list object of attribute names of the result document object. Because the object of the return value is opened with the function `cblistopen', it should be closed with the function `cblistclose' if it is no longer in use. */ CBLIST *est_resdoc_attr_names(ESTRESDOC *rdoc); /* Get the value of an attribute of a result document object. `rdoc' specifies a result document object. `name' specifies the name of an attribute. The return value is the value of the attribute or `NULL' if it does not exist. The life duration of the returned string is synchronous with the one of the result document object. */ const char *est_resdoc_attr(ESTRESDOC *rdoc, const char *name); /* Get the snippet of a result document object. `rdoc' specifies a result document object. The return value is a string of the snippet of the result document object. There are tab separated values. Each line is a string to be shown. Though most lines have only one field, some lines have two fields. If the second field exists, the first field is to be shown with highlighted, and the second field means its normalized form. The life duration of the returned string is synchronous with the one of the result document object. */ const char *est_resdoc_snippet(ESTRESDOC *rdoc); /* Get keywords of a result document object. `rdoc' specifies a result document object. The return value is a string of serialized keywords of the result document object. There are tab separated values. Keywords and their scores come alternately. The life duration of the returned string is synchronous with the one of the result document object. */ const char *est_resdoc_keywords(ESTRESDOC *rdoc); /* Get an array of documents eclipsed by a result document object. `rdoc' specifies a result document object. `np' specifies the pointer to a variable to which the number of elements of the return value is assigned. The return value is an array of eclipsed result document objects. The life duration of the returned array and its elements is synchronous with the one of the result document object. */ ESTRESDOC **est_resdoc_shadows(ESTRESDOC *rdoc, int *np); /* Get similarity of an eclipsed result document object. `rdoc' specifies a result document object. The return value is similarity of the result document object to the front document or -1.0 if it is not eclipsed. */ double est_resdoc_similarity(ESTRESDOC *rdoc); /************************************************************************************************* * API for node *************************************************************************************************/ typedef struct { /* type of structure for a node object */ char *url; /* URL */ char *pxhost; /* host name of the proxy */ int pxport; /* port number of the proxy */ int timeout; /* timeout in seconds */ char *auth; /* authentication information */ char *name; /* name */ char *label; /* label */ int dnum; /* number of documents */ int wnum; /* number of words */ double size; /* size of the database */ CBLIST *admins; /* list of names of administrators */ CBLIST *users; /* list of names of users */ CBLIST *links; /* list of expressions of linking nodes */ int wwidth; /* whole width of a snippet */ int hwidth; /* head width of a snippet */ int awidth; /* around width of a snippet */ CBLIST *ilist; /* list of the document iterator */ char *iprev; /* previous URI of the document iterator */ int status; /* last status code */ CBMAP *heads; /* extention headers */ } ESTNODE; /* Create a node connection object. `url' specifies the URL of a node. The return value is a node connection object. */ ESTNODE *est_node_new(const char *url); /* Destroy a node connection object. `node' specifies a node connection object. */ void est_node_delete(ESTNODE *node); /* Set the proxy information of a node connection object. `node' specifies a node connection object. `host' specifies the host name of a proxy server. `port' specifies the port number of the proxy server. */ void est_node_set_proxy(ESTNODE *node, const char *host, int port); /* Set timeout of a connection. `node' specifies a node connection object. `sec' specifies timeout of the connection in seconds. */ void est_node_set_timeout(ESTNODE *node, int sec); /* Set the authentication information of a node connection object. `node' specifies a node connection object. `name' specifies the name of authentication. `passwd' specifies the password of the authentication. */ void est_node_set_auth(ESTNODE *node, const char *name, const char *passwd); /* Get the status code of the last request of a node. `node' specifies a node connection object. The return value is the status code of the last request of the node. -1 means failure of connection. */ int est_node_status(ESTNODE *node); /* Synchronize updating contents of the database of a node. `node' specifies a node connection object. The return value is true if success, else it is false. */ int est_node_sync(ESTNODE *node); /* Optimize the database of a node. `node' specifies a node connection object. The return value is true if success, else it is false. */ int est_node_optimize(ESTNODE *node); /* Add a document to a node. `node' specifies a node connection object. `doc' specifies a document object. The document object should have the URI attribute. The return value is true if success, else it is false. If the URI attribute is same with an existing document in the node, the existing one is deleted. */ int est_node_put_doc(ESTNODE *node, ESTDOC *doc); /* Remove a document from a node. `node' specifies a node connection object. `id' specifies the ID number of a registered document. The return value is true if success, else it is false. */ int est_node_out_doc(ESTNODE *node, int id); /* Remove a document specified by URI from a node. `node' specifies a node connection object. `uri' specifies the URI of a registered document. The return value is true if success, else it is false. */ int est_node_out_doc_by_uri(ESTNODE *node, const char *uri); /* Edit attributes of a document in a node. `node' specifies a node connection object. `doc' specifies a document object. The return value is true if success, else it is false. Neither the ID nor the URI can not be changed. */ int est_node_edit_doc(ESTNODE *node, ESTDOC *doc); /* Retrieve a document in a node. `node' specifies a node connection object. `id' specifies the ID number of a registered document. The return value is a document object. It should be deleted with `est_doc_delete' if it is no longer in use. On error, `NULL' is returned. */ ESTDOC *est_node_get_doc(ESTNODE *node, int id); /* Retrieve a document specified by URI in a node. `node' specifies a node connection object. `uri' specifies the URI of a registered document. The return value is a document object. It should be deleted with `est_doc_delete' if it is no longer in use. On error, `NULL' is returned. */ ESTDOC *est_node_get_doc_by_uri(ESTNODE *node, const char *uri); /* Retrieve the value of an attribute of a document in a node. `node' specifies a node connection object. `id' specifies the ID number of a registered document. `name' specifies the name of an attribute. The return value is the value of the attribute or `NULL' if it does not exist. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_node_get_doc_attr(ESTNODE *node, int id, const char *name); /* Retrieve the value of an attribute of a document specified by URI in a node. `node' specifies a node connection object. `uri' specifies the URI of a registered document. `name' specifies the name of an attribute. The return value is the value of the attribute or `NULL' if it does not exist. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_node_get_doc_attr_by_uri(ESTNODE *node, const char *uri, const char *name); /* Extract keywords of a document. `node' specifies a node connection object. `id' specifies the ID number of a registered document. The return value is a new map object of keywords and their scores in decimal string or `NULL' on error. Because the object of the return value is opened with the function `cbmapopen', it should be closed with the function `cbmapclose' if it is no longer in use. */ CBMAP *est_node_etch_doc(ESTNODE *node, int id); /* Extract keywords of a document specified by URI in a node. `node' specifies a node connection object. `uri' specifies the URI of a registered document. The return value is a new map object of keywords and their scores in decimal string or `NULL' on error. Because the object of the return value is opened with the function `cbmapopen', it should be closed with the function `cbmapclose' if it is no longer in use. */ CBMAP *est_node_etch_doc_by_uri(ESTNODE *node, const char *uri); /* Get the ID of a document spacified by URI. `node' specifies a node connection object. `uri' specifies the URI of a registered document. The return value is the ID of the document. On error, -1 is returned. */ int est_node_uri_to_id(ESTNODE *node, const char *uri); /* Get the name of a node. `node' specifies a node connection object. The return value is the name of the node. On error, `NULL' is returned. The life duration of the returned string is synchronous with the one of the node object. */ const char *est_node_name(ESTNODE *node); /* Get the label of a node. `node' specifies a node connection object. The return value is the label of the node. On error, `NULL' is returned. The life duration of the returned string is synchronous with the one of the node object. */ const char *est_node_label(ESTNODE *node); /* Get the number of documents in a node. `node' specifies a node connection object. The return value is the number of documents in the node. On error, -1 is returned. */ int est_node_doc_num(ESTNODE *node); /* Get the number of unique words in a node. `node' specifies a node connection object. The return value is the number of unique words in the node. On error, -1 is returned. */ int est_node_word_num(ESTNODE *node); /* Get the size of the datbase of a node. `node' specifies a node connection object. The return value is the size of the datbase of the node. On error, -1.0 is returned. */ double est_node_size(ESTNODE *node); /* Get the usage ratio of the cache of a node. `node' specifies a node connection object. The return value is the usage ratio of the cache of the node. On error, -1.0 is returned. */ double est_node_cache_usage(ESTNODE *node); /* Get a list of names of administrators of a node. `node' specifies a node connection object. The return value is a list object of names of administrators. On error, `NULL' is returned. The life duration of the returned object is synchronous with the one of the node object. */ const CBLIST *est_node_admins(ESTNODE *node); /* Get a list of names of users of a node. `node' specifies a node connection object. The return value is a list object of names of users. On error, `NULL' is returned. The life duration of the returned object is synchronous with the one of the node object. */ const CBLIST *est_node_users(ESTNODE *node); /* Get a list of expressions of links of a node. `node' specifies a node connection object. The return value is a list object of expressions of links. Each element is a TSV string and has three fields of the URL, the label, and the score. On error, `NULL' is returned. The life duration of the returned object is synchronous with the one of the node object. */ const CBLIST *est_node_links(ESTNODE *node); /* Search a node for documents corresponding a condition. `node' specifies a node connection object. `cond' specifies a condition object. `depth' specifies the depth of meta search. The return value is a node result object. It should be deleted with `est_noderes_delete' if it is no longer in use. On error, `NULL' is returned. */ ESTNODERES *est_node_search(ESTNODE *node, ESTCOND *cond, int depth); /* Set width of snippet in the result from a node. `node' specifies a node connection object. `wwidth' specifies whole width of a snippet. By default, it is 480. If it is 0, no snippet is sent. If it is negative, whole body text is sent instead of snippet. `hwidth' specifies width of strings picked up from the beginning of the text. By default, it is 96. If it is negative 0, the current setting is not changed. `awidth' specifies width of strings picked up around each highlighted word. By default, it is 96. If it is negative, the current setting is not changed. */ void est_node_set_snippet_width(ESTNODE *node, int wwidth, int hwidth, int awidth); /* Manage a user account of a node. `node' specifies a node connection object. `name' specifies the name of a user. `mode' specifies the operation mode. 0 means to delete the account. 1 means to set the account as an administrator. 2 means to set the account as a guest. The return value is true if success, else it is false. */ int est_node_set_user(ESTNODE *node, const char *name, int mode); /* Manage a link of a node. `node' specifies a node connection object. `url' specifies the URL of the target node of a link. `label' specifies the label of the link. `credit' specifies the credit of the link. If it is negative, the link is removed. The return value is true if success, else it is false. */ int est_node_set_link(ESTNODE *node, const char *url, const char *label, int credit); /************************************************************************************************* * features for experts *************************************************************************************************/ #define ESTAGENTNAME "HyperEstraier" /* name of the user agent */ #define ESTFORMTYPE "application/x-www-form-urlencoded" /* media type of docuemnt draft */ #define ESTINFORMTYPE "text/x-estraier-nodeinfo" /* media type of node information */ #define ESTSEARCHTYPE "text/x-estraier-search" /* media type of search result */ #define ESTLISTTYPE "text/x-estraier-list" /* media type of list result */ #define ESTDRAFTTYPE "text/x-estraier-draft" /* media type of docuemnt draft */ #define ESTHTHVIA "X-Estraier-Via" /* header to escape from looping route */ /* Get the name of this host. The return value is the name of this host. */ const char *est_get_host_name(void); /* Get the address of a host. `name' specifies the name of a host. The return value is the address of a host or `NULL' if failure. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_get_host_addr(const char *name); /* Get a server socket of an address and a port. `addr' specifies an address of a host. If it is `NULL', every network address is binded. `port' specifies a port number. The return value is the socket of the address and the port or -1 if failure. */ int est_get_server_sock(const char *addr, int port); /* Accept a connection from a client. `sock' specifies a server socket. `abuf' specifies a buffer into which the address of a connected client is written. The size of the buffer should be more than 32. If it is `NULL', it is not used. `pp' specifies the pointer to a variable to which the port of the client is assigned. If it is `NULL', it is not used. The return value is a socket connected to the client, or 0 if intterupted, or -1 if failure. The thread blocks until the connection is established. */ int est_accept_conn(int sock, char *abuf, int *pp); /* Get a client socket to an address and a port. `addr' specifies an address of a host. `port' specifies a port number. The return value is the socket to the address and the port or -1 if failure. */ int est_get_client_sock(const char *addr, int port); /* Shutdown and close a socket. `sock' specifies a socket. */ void est_sock_down(int sock); /* Receive all data from a socket. `sock' specifies a socket. `len' specifies the length of data to be read. The return value is the pointer to the region of an allocated region containing the received data. Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_sock_recv_all(int sock, int len); /* Receive a line from a socket. `sock' specifies a socket. `buf' specifies a buffer to store read data. `max' specifies the maximum length to read. It should be more than 0. The return value is the size of received data. Because an additional zero code is appended at the end of the region of the buffer, it can be treated as a character string. */ int est_sock_recv_line(int sock, char *buf, int max); /* Receive void data from a socket. `sock' specifies a socket. */ void est_sock_recv_void(int sock); /* Send all data into a socket. `sock' specifies a socket. `buf' specifies a buffer of data to write. `len' specifies the length of the data. */ void est_sock_send_all(int sock, const char *buf, int len); /* Perform an interaction of a URL. `url' specifies a URL. `pxhost' specifies the host name of a proxy. If it is `NULL', it is not used. `pxport' specifies the port number of the proxy. `outsec' specifies timeout in seconds. If it is negative, it is not used. `limsize' specifies limitation of the entity body of response. If it is negative, it is not used. `auth' specifies an authority information in such form as "user:pass". If it is `NULL', it is not used. `reqheads' specifies a list object of extension headers. If it is `NULL' it is not used. `reqbody' specifies the pointer of the entitiy body of request. If it is `NULL', "GET" method is used. `rbsiz' specifies the size of the entity body. `rescodep' specifies the pointer to a variable to which the status code of respnese is assigned. If it is `NULL', it is not used. `resheads' specifies a map object into which headers of response is stored. The value of each header is recorded as an attribute whose name is converted from the header name into lower cases. The top header for the status code is recorded with the key of an empty string. If it is `NULL', it is not used. `resbody' specifies a datum object into which the entity body of response is stored. If it is `NULL', it is not used. The return value is true if success, else it is false. Headers of "Host", "Connection", "User-Agent", "Authorization", "Accept-Encoding", and "Content-Length" are sent implicitly. */ int est_url_shuttle(const char *url, const char *pxhost, int pxport, int outsec, int limsize, const char *auth, const CBLIST *reqheads, const char *reqbody, int rbsiz, int *rescodep, CBMAP *resheads, CBDATUM *resbody); /* Initialize the document iterator of a node. `node' specifies a node connection object. The return value is true if success, else it is false. */ int est_node_iter_init(ESTNODE *node); /* Get the next document of the document iterator of a node. `node' specifies a node connection object. The return value is a document object though it does not have body text. If there is no more document, `NULL' is returned. Because the object of the return value is opened with the function `est_doc_new', it should be closed with the function `est_doc_delete' if it is no longer in use. */ ESTDOC *est_node_iter_next(ESTNODE *node); /* Add a header to a node connection object. `node' specifies a node connection object. `name' specifies the name of a header. `value' specifies the value of the header. If it is `NULL', the header is removed. If the specified header is already added, the value is concatenated at the end. */ void est_node_add_header(ESTNODE *node, const char *name, const char *value); /* Create a node result object. The return value is a node result object. */ ESTNODERES *est_noderes_new(void); /* Add a document information to a node result object. `nres' specifies a node result object. `attrs' specifies a map object of attributes of the document. The object is closed internally. `snippet' specifies the snippet of the document. The region is released internally. */ void est_noderes_add_doc(ESTNODERES *nres, CBMAP *attrs, char *snippet); /* Remove the top of result document objects in a node result object. `nres' specifies a node result object. `attrp' specifies the pointer to a variable to which reference of the map object of attribute is assigned. The object should be deleted with the function `cbmapclose'. `snippetp' specifies the pointer to a variable to which reference of the snippet string is assigned. The region should be released with the function `free'. The return value is true if success, else it is false. */ int est_noderes_shift_doc(ESTNODERES *nres, CBMAP **attrp, char **snippetp); /* Get the modification date of a node result object. `nres' specifies a node result object. The return value is the modification date of a node result object. */ time_t est_noderes_mdate(ESTNODERES *nres); #if defined(__cplusplus) /* export for C++ */ } #endif #endif /* duplication check */ /* END OF FILE */ hyperestraier-1.4.13/estproxy.c000066400000000000000000002003471125261632700165420ustar00rootroot00000000000000/************************************************************************************************* * A proxy with highlighting * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #if defined(MYFCGI) #include #endif #include "estraier.h" #include "estmtdb.h" #include "estnode.h" #include "myconf.h" #define AGENTNAME "EstProxy" /* name of the user agent */ #define CONFSUFFIX ".conf" /* suffix of the configuration file */ #define NUMBUFSIZ 32 /* size of a buffer for a number */ #define URIBUFSIZ 8192 /* size of a buffer for an URI */ #define OUTBUFSIZ 262144 /* size of the output buffer */ #define SOCKBUFSIZ 8192 /* size of the socket buffer */ #define MINIBNUM 31 /* bucket number of map for trivial use */ #define DRAFTCMD "[DRAFT]" /* built-in command for document draft */ #define TEXTCMD "[TEXT]" /* built-in command for plain text */ #define HTMLCMD "[HTML]" /* built-in command for HTML */ #define MIMECMD "[MIME]" /* built-in command for MIME */ /* global variables for configurations */ const char *g_conffile = NULL; /* path of the configuration file */ const CBLIST *g_replexprs = NULL; /* list of URL replacement expressions */ const CBLIST *g_rxlist = NULL; /* list of regular expressions for URL allowing */ int g_passaddr = FALSE; /* whether to pass the IP address of clients */ int g_limitsize = 0; /* limit size of data to receive */ CBMAP *g_urlrules = NULL; /* rules of URLs */ CBMAP *g_mtrules = NULL; /* rules of media types */ int g_language = 0; /* preferred language */ int g_shownavi = 0; /* whether to show navigation bar */ /* global variables for parameters */ const char *p_url = NULL; /* target URL */ const CBLIST *p_words = NULL; /* words to be highlighted */ int p_once = FALSE; /* whether to use direct link */ /* other global variables */ char g_outbuf[OUTBUFSIZ]; /* output buffer */ const char *g_remoteaddr = NULL; /* IP address of the client */ const char *g_scriptname = NULL; /* name of the script */ const char *g_hostname = NULL; /* name of the host */ const char *g_scriptpath = NULL; /* path of the script */ const char *g_agentname = NULL; /* name of the user agent */ /* color definitions */ const char *g_wordcolors[] = { /* highlighted colors */ "#ffff77", "#ffaaaa", "#bbbbff", "#aaffaa", "#88ffff", "#ff99ff" }; /* function prototypes */ int main(int argc, char **argv); static int realmain(int argc, char **argv); static void showerror(const char *msg); static const char *skiplabel(const char *str); static CBMAP *getparameters(void); static void xmlprintf(const char *format, ...); static char *replaceurl(const char *uri); static void sendform(void); static char *urltopath(const char *url); static int getlocalconnection(const char *url, int *codep, CBMAP *heads); static void senddirlist(const char *path); static char *readall(int fd, int *sp); static void passlocalrawdata(int fd); static void sendlocaldata(void); static int gethttpconnection(const char *url, int *codep, CBMAP *heads); static char *recvall(int sock, int *sp); static void passhttprawdata(int sock); static void modifylocation(CBMAP *heads, const char *name); static void sendhttpdata(void); static void sendnavibar(void); static void sendsnippet(const char *str); static const char *langstr(void); static void sendpagefromdraft(const char *buf, int size, const char *penc); static void sendpagefromtext(const char *buf, int size, const char *penc); static void sendpagefromhtml(const char *buf, int size, const char *penc); static char *htmlenc(const char *str); static char *htmlrawtext(const char *html); static void sendpagefrommime(const char *buf, int size, const char *penc); static void sendmimepart(const char *body, int bsiz, CBMAP *attrs, const char *penc); static char *mimestr(const char *mime); static void sendpagewithxcmd(const char *buf, int size, const char *penc, const char *cmd); /* main routine */ int main(int argc, char **argv){ #if defined(MYFCGI) static int cnt = 0; est_proc_env_reset(); est_init_net_env(); while(FCGI_Accept() >= 0){ realmain(argc, argv); fflush(stdout); if(++cnt >= 256) exit(0); } est_free_net_env(); return 0; #else est_proc_env_reset(); est_init_net_env(); realmain(argc, argv); est_free_net_env(); return 0; #endif } /* real main routine */ static int realmain(int argc, char **argv){ CBLIST *lines, *rplist, *rxlist, *wlist, *list; CBMAP *params, *urlmap, *mtmap; const char *rp, *pv; char *tmp, *wp, numbuf[NUMBUFSIZ]; int i, len, allow; setvbuf(stdout, g_outbuf, _IOFBF, OUTBUFSIZ); if((rp = getenv("REMOTE_ADDR")) != NULL){ g_remoteaddr = rp; } else { g_remoteaddr = "0.0.0.0"; } g_scriptname = argv[0]; if((rp = getenv("SCRIPT_NAME")) != NULL) g_scriptname = rp; g_hostname = est_get_host_name(); if((rp = getenv("HTTP_HOST")) != NULL) g_hostname = rp; g_scriptpath = g_scriptname; g_agentname = AGENTNAME; if((rp = getenv("HTTP_USER_AGENT")) != NULL) g_agentname = rp; if((rp = strrchr(g_scriptname, '/')) != NULL) g_scriptname = rp + 1; tmp = cbmalloc(strlen(g_scriptname) + strlen(CONFSUFFIX) + 1); sprintf(tmp, "%s", g_scriptname); cbglobalgc(tmp, free); if(!(wp = strrchr(tmp, '.'))) wp = tmp + strlen(tmp); sprintf(wp, "%s", CONFSUFFIX); g_conffile = tmp; if(!(lines = cbreadlines(g_conffile))) showerror("the configuration file is missing."); cbglobalgc(lines, (void (*)(void *))cblistclose); rplist = cblistopen(); cbglobalgc(rplist, (void (*)(void *))cblistclose); rxlist = cblistopen(); cbglobalgc(rxlist, (void (*)(void *))cblistclose); urlmap = cbmapopenex(MINIBNUM); cbglobalgc(urlmap, (void (*)(void *))cbmapclose); mtmap = cbmapopenex(MINIBNUM); cbglobalgc(mtmap, (void (*)(void *))cbmapclose); for(i = 0; i < cblistnum(lines); i++){ rp = cblistval(lines, i, NULL); if(cbstrfwimatch(rp, "replace:")){ rp = skiplabel(rp); if(*rp != '\0') cblistpush(rplist, rp, -1); } else if(cbstrfwimatch(rp, "allowrx:")){ rp = skiplabel(rp); if(*rp != '\0'){ tmp = cbsprintf("a*I:%s", rp); cblistpushbuf(rxlist, tmp, strlen(tmp)); } } else if(cbstrfwimatch(rp, "denyrx:")){ rp = skiplabel(rp); if(*rp != '\0'){ tmp = cbsprintf("d*I:%s", rp); cblistpushbuf(rxlist, tmp, strlen(tmp)); } } else if(cbstrfwimatch(rp, "passaddr:")){ g_passaddr = atoi(skiplabel(rp)) > 0; } else if(cbstrfwimatch(rp, "limitsize:")){ g_limitsize = atoi(skiplabel(rp)) * 1024 * 1024; } else if(cbstrfwimatch(rp, "urlrule:")){ rp = skiplabel(rp); if((pv = strstr(rp, "{{!}}")) != NULL) cbmapput(urlmap, rp, pv - rp, pv + 5, -1, TRUE); } else if(cbstrfwimatch(rp, "typerule:")){ rp = skiplabel(rp); if((pv = strstr(rp, "{{!}}")) != NULL) cbmapput(mtmap, rp, pv - rp, pv + 5, -1, TRUE); } else if(cbstrfwimatch(rp, "language:")){ g_language = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "shownavi:")){ g_shownavi = atoi(skiplabel(rp)) > 0; } } g_replexprs = rplist; g_rxlist = rxlist; g_urlrules = urlmap; g_mtrules = mtmap; params = getparameters(); cbglobalgc(params, (void (*)(void *))cbmapclose); wlist = cblistopen(); cbglobalgc(wlist, (void (*)(void *))cblistclose); if(!(p_url = cbmapget(params, "url", -1, NULL))) p_url = ""; for(i = 0; i < 256; i++){ len = sprintf(numbuf, "word%d", i); if((rp = cbmapget(params, numbuf, len, NULL)) != NULL && *rp != '\0') cblistpush(wlist, rp, -1); } if((rp = cbmapget(params, "words", -1, NULL)) != NULL){ tmp = est_regex_replace(rp, "(\xe3\x80\x80)+", " "); list = cbsplit(tmp, -1, ", \t\n\r"); for(i = 0; i < cblistnum(list); i++){ rp = cblistval(list, i, NULL); if(*rp != '\0') cblistpush(wlist, rp, -1); } cblistclose(list); free(tmp); } if((rp = cbmapget(params, "once", -1, NULL)) != NULL) p_once = atoi(rp) > 0; p_words = wlist; if(*p_url == '\0'){ sendform(); } else { allow = FALSE; tmp = replaceurl(p_url); for(i = 0; i < cblistnum(rxlist); i++){ rp = cblistval(rxlist, i, NULL); switch(*rp){ case 'a': rp++; if(est_regex_match_str(rp, tmp)) allow = TRUE; break; case 'd': rp++; if(est_regex_match_str(rp, tmp)) allow = FALSE; break; default: break; } } if(allow && cbstrfwimatch(tmp, "file://")){ sendlocaldata(); } else if(allow && cbstrfwimatch(tmp, "http://")){ sendhttpdata(); } else { printf("Status: 400 Forbidden\r\n"); printf("Content-Type: text/plain; charset=UTF-8\r\n"); printf("\r\n"); printf("Error: the requested URL is not allowed\n"); } free(tmp); } return 0; } /* show the error page and exit */ static void showerror(const char *msg){ printf("Status: 500 Internal Server Error\r\n"); printf("Content-Type: text/plain; charset=UTF-8\r\n"); printf("\r\n"); printf("Error: %s\n", msg); exit(1); } /* skip the label of a line */ static const char *skiplabel(const char *str){ if(!(str = strchr(str, ':'))) return ""; str++; while(*str != '\0' && (*str == ' ' || *str == '\t')){ str++; } return str; } /* get CGI parameters */ static CBMAP *getparameters(void){ int maxlen = 1024 * 1024 * 32; CBMAP *map, *attrs; CBLIST *pairs, *parts; const char *rp, *body; char *buf, *key, *val, *dkey, *dval, *wp, *bound, *fbuf, *aname; int i, len, c, blen, flen; map = cbmapopenex(37); buf = NULL; len = 0; if((rp = getenv("REQUEST_METHOD")) != NULL && !strcmp(rp, "POST") && (rp = getenv("CONTENT_LENGTH")) != NULL && (len = atoi(rp)) > 0){ if(len > maxlen) len = maxlen; buf = cbmalloc(len + 1); for(i = 0; i < len && (c = getchar()) != EOF; i++){ buf[i] = c; } buf[i] = '\0'; if(i != len){ free(buf); buf = NULL; } } else if((rp = getenv("QUERY_STRING")) != NULL){ buf = cbmemdup(rp, -1); len = strlen(buf); } if(buf && len > 0){ if((rp = getenv("CONTENT_TYPE")) != NULL && cbstrfwmatch(rp, "multipart/form-data") && (rp = strstr(rp, "boundary=")) != NULL){ rp += 9; bound = cbmemdup(rp, -1); if((wp = strchr(bound, ';')) != NULL) *wp = '\0'; parts = cbmimeparts(buf, len, bound); for(i = 0; i < cblistnum(parts); i++){ body = cblistval(parts, i, &blen); attrs = cbmapopen(); fbuf = cbmimebreak(body, blen, attrs, &flen); if((rp = cbmapget(attrs, "NAME", -1, NULL)) != NULL){ cbmapput(map, rp, -1, fbuf, flen, FALSE); aname = cbsprintf("%s-filename", rp); if((rp = cbmapget(attrs, "FILENAME", -1, NULL)) != NULL) cbmapput(map, aname, -1, rp, -1, FALSE); free(aname); } free(fbuf); cbmapclose(attrs); } cblistclose(parts); free(bound); } else { pairs = cbsplit(buf, -1, "&"); for(i = 0; i < cblistnum(pairs); i++){ key = cbmemdup(cblistval(pairs, i, NULL), -1); if((val = strchr(key, '=')) != NULL){ *(val++) = '\0'; dkey = cburldecode(key, NULL); dval = cburldecode(val, NULL); cbmapput(map, dkey, -1, dval, -1, FALSE); free(dval); free(dkey); } free(key); } cblistclose(pairs); } } free(buf); return map; } /* output escaped string */ static void xmlprintf(const char *format, ...){ va_list ap; const char *rp; char *tmp, cbuf[32], *ebuf; unsigned char c; int cblen, cnt, mlen; va_start(ap, format); while(*format != '\0'){ if(*format == '%'){ cbuf[0] = '%'; cblen = 1; format++; while(strchr("0123456789 .+-", *format) && *format != '\0' && cblen < sizeof(cbuf) - 1){ cbuf[cblen++] = *format; format++; } cbuf[cblen++] = *format; cbuf[cblen] = '\0'; switch(*format){ case 's': tmp = va_arg(ap, char *); if(!tmp) tmp = "(null)"; printf(cbuf, tmp); break; case 'd': printf(cbuf, va_arg(ap, int)); break; case 'o': case 'u': case 'x': case 'X': case 'c': printf(cbuf, va_arg(ap, unsigned int)); break; case 'e': case 'E': case 'f': case 'g': case 'G': printf(cbuf, va_arg(ap, double)); break; case '@': tmp = va_arg(ap, char *); if(!tmp) tmp = "(null)"; ebuf = NULL; if(cblen > 2){ mlen = atoi(cbuf + 1) * 10; cnt = 0; rp = tmp; while(*rp != '\0'){ if((*rp & 0x80) == 0x00){ cnt += 10; } else if((*rp & 0xe0) == 0xc0){ cnt += 15; } else if((*rp & 0xf0) == 0xe0 || (*rp & 0xf8) == 0xf0){ cnt += 20; } if(cnt > mlen){ ebuf = cbmemdup(tmp, rp - tmp); tmp = ebuf; break; } rp++; } } while(*tmp){ switch(*tmp){ case '&': printf("&"); break; case '<': printf("<"); break; case '>': printf(">"); break; case '"': printf("""); break; default: if(!((*tmp >= 0 && *tmp <= 0x8) || (*tmp >= 0x0e && *tmp <= 0x1f))) putchar(*tmp); break; } tmp++; } if(ebuf){ free(ebuf); printf("..."); } break; case '?': tmp = va_arg(ap, char *); if(!tmp) tmp = "(null)"; while(*tmp){ c = *(unsigned char *)tmp; if((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || (c != '\0' && strchr("_-.", c))){ putchar(c); } else { printf("%%%02X", c); } tmp++; } break; case '%': putchar('%'); break; } } else { putchar(*format); } format++; } va_end(ap); } /* make a URI to be shown */ static char *replaceurl(const char *uri){ char *turi, *bef, *aft, *pv, *nuri; int i; turi = cbmemdup(uri, -1); for(i = 0; i < cblistnum(g_replexprs); i++){ bef = cbmemdup(cblistval(g_replexprs, i, NULL), -1); if((pv = strstr(bef, "{{!}}")) != NULL){ *pv = '\0'; aft = pv + 5; } else { aft = ""; } nuri = est_regex_replace(turi, bef, aft); free(turi); turi = nuri; free(bef); } return turi; } /* show the input form */ static void sendform(void){ printf("Content-Type: text/html; charset=UTF-8\r\n"); printf("\r\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("%@/%@\n", AGENTNAME, est_version); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("

%@/%@

\n", AGENTNAME, est_version); xmlprintf("
\n"); xmlprintf("
\n", g_scriptname); xmlprintf("
\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("
\n"); xmlprintf("
\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("
\n"); xmlprintf("
\n"); xmlprintf("
\n"); xmlprintf("\n"); xmlprintf("\n"); } /* get the local path of a URL */ static char *urltopath(const char *url){ static char pbuf[URIBUFSIZ]; const char *pv, *elem; char *wp, *dbuf; CBLIST *list; int i; if(!cbstrfwimatch(url, "file://")) return NULL; pv = url + 7; if(!(url = strchr(pv, '/'))) return NULL; wp = pbuf; if(ESTPATHCHR == '\\'){ if(url[0] == '/' && ((url[1] >= 'A' && url[1] <= 'Z') || (url[1] >= 'a' && url[1] <= 'z')) && url[2] == '|' && url[3] == '/'){ wp += sprintf(wp, "%c:", url[1]); url += 3; } else if(url > pv){ wp += sprintf(wp, "\\\\"); memcpy(wp, pv, url - pv); wp += url - pv; } } list = cbsplit(url, -1, "/"); for(i = 0; i < cblistnum(list); i++){ elem = cblistval(list, i, NULL); if(elem[0] == '\0') continue; dbuf = cburldecode(elem, NULL); wp += sprintf(wp, "%c%s", ESTPATHCHR, dbuf); free(dbuf); } *wp = '\0'; cblistclose(list); return cbmemdup(pbuf, -1); } /* get the connection of a URL */ static int getlocalconnection(const char *url, int *codep, CBMAP *heads){ const char *ext, *pv; char *path; int fd; struct stat sbuf; cbmapput(heads, "ERROR", -1, "", -1, TRUE); cbmapput(heads, "", -1, "", -1, TRUE); if(!(path = urltopath(url))){ *codep = 400; cbmapput(heads, "ERROR", -1, "invalid URL", -1, TRUE); return -1; } if(stat(path, &sbuf) == -1){ if(errno == EACCES){ *codep = 403; cbmapput(heads, "ERROR", -1, "forbidden", -1, TRUE); } else { *codep = 404; cbmapput(heads, "ERROR", -1, "file not found", -1, TRUE); } } if(S_ISDIR(sbuf.st_mode)){ *codep = 0; cbmapput(heads, "ERROR", -1, path, -1, TRUE); free(path); return -1; } if((fd = open(path, O_RDONLY, 0)) == -1){ if(errno == EACCES){ *codep = 403; cbmapput(heads, "ERROR", -1, "forbidden", -1, TRUE); } else { *codep = 404; cbmapput(heads, "ERROR", -1, "file not found", -1, TRUE); } free(path); return -1; } *codep = 200; ext = NULL; if(!(pv = strrchr(url, ESTPATHCHR))) pv = url; if((pv = strrchr(pv, ESTEXTCHR)) != NULL) ext = pv; cbmapput(heads, "content-type", -1, est_ext_type(ext ? ext : ""), -1, TRUE); free(path); return fd; } /* send a list of files in a directory */ static void senddirlist(const char *path){ CBLIST *list; const char *elem; char *burl, *eurl, *nurl; int i; printf("Content-Type: text/html\n"); printf("\r\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n", g_language, g_language); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("%@/%@\n", AGENTNAME, est_version); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("

%@

\n", path); if((list = cbdirlist(path)) != NULL){ burl = cbsprintf("%s/", p_url); cblistsort(list); for(i = 0; i < cblistnum(list); i++){ elem = cblistval(list, i, NULL); eurl = cburlencode(elem, -1); nurl = cburlresolve(burl, elem); if(p_once){ xmlprintf("
  • %@
  • ", nurl, elem); } else { xmlprintf("
  • %@
  • ", g_scriptname, nurl, elem); } free(nurl); free(eurl); } cblistclose(list); free(burl); } else { xmlprintf("

    The directory could not be opened.

    \n"); } xmlprintf("\n"); xmlprintf("\n"); } /* read all data of a local connection */ static char *readall(int fd, int *sp){ CBDATUM *datum; char iobuf[SOCKBUFSIZ]; int size; datum = cbdatumopen(NULL, -1); while(cbdatumsize(datum) < g_limitsize && (size = read(fd, iobuf, SOCKBUFSIZ)) > 0){ cbdatumcat(datum, iobuf, size); } return cbdatumtomalloc(datum, sp); } /* pass through raw data of a connection */ static void passlocalrawdata(int fd){ char iobuf[SOCKBUFSIZ]; int size; while((size = read(fd, iobuf, SOCKBUFSIZ)) > 0){ fwrite(iobuf, 1, size, stdout); } } /* send the data of local file */ static void sendlocaldata(void){ CBMAP *heads; const char *kbuf, *vbuf, *cmd; char *url, *type, *enc, *pv, *rbuf; int fd, code, ksiz, rsiz; url = replaceurl(p_url); heads = cbmapopenex(MINIBNUM); if((fd = getlocalconnection(url, &code, heads)) == -1){ if(code == 0){ senddirlist(cbmapget(heads, "ERROR", -1, NULL)); } else { showerror(cbmapget(heads, "ERROR", -1, NULL)); } cbmapclose(heads); free(url); return; } cbmapiterinit(g_urlrules); while((kbuf = cbmapiternext(g_urlrules, &ksiz)) != NULL){ if(est_regex_match_str(kbuf, p_url)){ cbmapput(heads, "content-type", -1, cbmapget(g_urlrules, kbuf, ksiz, NULL), -1, TRUE); break; } } if(!(vbuf = cbmapget(heads, "content-type", -1, NULL))) vbuf = "text/plain"; type = cbmemdup(vbuf, -1); if((pv = strchr(type, ';')) != NULL) *pv = '\0'; cbstrtolower(type); enc = NULL; if((pv = strstr(vbuf, "charset=")) != NULL || (pv = strstr(vbuf, "CHARSET=")) != NULL){ pv = strchr(pv, '=') + 1; if(*pv == '"') pv++; enc = cbmemdup(pv, -1); if((pv = strchr(enc, '"')) != NULL) *pv = '\0'; } cmd = ""; cbmapiterinit(g_mtrules); while((kbuf = cbmapiternext(g_mtrules, &ksiz)) != NULL){ if(est_regex_match_str(kbuf, type)){ cmd = cbmapget(g_mtrules, kbuf, ksiz, NULL); break; } } printf("Status: %d\r\n", code); cbmapout(heads, "", -1); cbmapout(heads, "ERROR", -1); if(*cmd != '\0'){ cbmapput(heads, "content-type", -1, "text/html; charset=UTF-8", -1, TRUE); cbmapout(heads, "content-length", -1); cbmapout(heads, "content-encoding", -1); cbmapout(heads, "connection", -1); cbmapout(heads, "set-cookie", -1); cbmapout(heads, "set-cookie2", -1); cbmapout(heads, "etag", -1); cbmapout(heads, "transfer-encoding", -1); } modifylocation(heads, "location"); modifylocation(heads, "content-location"); cbmapiterinit(heads); while((kbuf = cbmapiternext(heads, &ksiz)) != NULL){ printf("%s: %s\r\n", kbuf, cbmapget(heads, kbuf, ksiz, NULL)); } printf("\r\n"); if(!strcmp(cmd, DRAFTCMD)){ rbuf = readall(fd, &rsiz); sendpagefromdraft(rbuf, rsiz, enc); free(rbuf); } else if(!strcmp(cmd, TEXTCMD)){ rbuf = readall(fd, &rsiz); sendpagefromtext(rbuf, rsiz, enc); free(rbuf); } else if(!strcmp(cmd, HTMLCMD)){ rbuf = readall(fd, &rsiz); sendpagefromhtml(rbuf, rsiz, enc); free(rbuf); } else if(!strcmp(cmd, MIMECMD)){ rbuf = readall(fd, &rsiz); sendpagefrommime(rbuf, rsiz, enc); free(rbuf); } else if(*cmd != '\0'){ rbuf = readall(fd, &rsiz); sendpagewithxcmd(rbuf, rsiz, enc, cmd); free(rbuf); } else { passlocalrawdata(fd); } free(enc); free(type); close(fd); cbmapclose(heads); free(url); } /* get the HTTP connection of a URL */ static int gethttpconnection(const char *url, int *codep, CBMAP *heads){ CBMAP *elems; const char *scheme, *host, *pstr, *auth, *path, *query, *rp; char *addr, iobuf[SOCKBUFSIZ], *wp, *tmp, name[SOCKBUFSIZ], *pv; int pnum, sock, size, nsiz; cbmapput(heads, "ERROR", -1, "", -1, TRUE); cbmapput(heads, "", -1, "", -1, TRUE); elems = cburlbreak(url); scheme = cbmapget(elems, "scheme", -1, NULL); host = cbmapget(elems, "host", -1, NULL); pnum = (pstr = cbmapget(elems, "port", -1, NULL)) ? atoi(pstr) : 80; auth = cbmapget(elems, "authority", -1, NULL); path = cbmapget(elems, "path", -1, NULL); query = cbmapget(elems, "query", -1, NULL); if(!scheme || cbstricmp(scheme, "http") || !host || pnum < 1){ cbmapput(heads, "ERROR", -1, "invalid URL", -1, TRUE); cbmapclose(elems); return -1; } if(!auth) auth = ""; if(!path) path = "/"; if(!query) query = ""; if(!(addr = est_get_host_addr(host))){ cbmapput(heads, "ERROR", -1, "unknown host", -1, TRUE); cbmapclose(elems); return -1; } if((sock = est_get_client_sock(addr, pnum)) == -1){ cbmapput(heads, "ERROR", -1, "connection failed", -1, TRUE); cbmapclose(elems); return -1; } wp = iobuf; wp += sprintf(wp, "GET %s%s%s HTTP/1.0\r\n", path, query[0] != '\0' ? "?" : "", query); wp += sprintf(wp, "Host: %s:%d\r\n", host, pnum); wp += sprintf(wp, "Connection: close\r\n"); if(auth[0] != '\0'){ tmp = cbbaseencode(auth, -1); wp += sprintf(wp, "Authorization: Basic %s\r\n", tmp); free(tmp); } wp += sprintf(wp, "User-Agent: %s\r\n", g_agentname); if(g_passaddr) wp += sprintf(wp, "X-Forwarded-For: %s\r\n", g_remoteaddr); switch(g_language){ case ESTLANGEN: wp += sprintf(wp, "Accept-Language: en,ja\r\n"); break; case ESTLANGJA: wp += sprintf(wp, "Accept-Language: ja,en\r\n"); break; case ESTLANGZH: wp += sprintf(wp, "Accept-Language: zh,en\r\n"); break; case ESTLANGKO: wp += sprintf(wp, "Accept-Language: ko,en\r\n"); break; } wp += sprintf(wp, "\r\n"); est_sock_send_all(sock, iobuf, wp - iobuf); if((size = est_sock_recv_line(sock, iobuf, SOCKBUFSIZ - 1)) < 1 || !cbstrfwmatch(iobuf, "HTTP/") || !(rp = strchr(iobuf, ' '))){ cbmapput(heads, "ERROR", -1, "no data received", -1, TRUE); est_sock_down(sock); cbmapclose(elems); return -1; } *codep = atoi(rp); cbmapput(heads, "", 0, iobuf, size, TRUE); name[0] = '\0'; nsiz = 0; while((size = est_sock_recv_line(sock, iobuf, SOCKBUFSIZ - 1)) > 0){ if(iobuf[0] == ' ' || iobuf[0] == '\t'){ if(name[0] != '\0'){ iobuf[0] = ' '; cbmapputcat(heads, name, nsiz, iobuf, size); } } else if((rp = strchr(iobuf, ':')) > iobuf){ nsiz = rp - iobuf; memcpy(name, iobuf, nsiz); name[nsiz] = '\0'; for(pv = name; *pv != '\0'; pv++){ if(*pv >= 'A'&& *pv <= 'Z') *pv = *pv + ('a' - 'A'); } rp++; if(*rp == ' ' || *rp == '\t') rp++; if(cbmapget(heads, name, nsiz, NULL)){ cbmapputcat(heads, name, nsiz, ", ", 2); cbmapputcat(heads, name, nsiz, pv, -1); } else { cbmapput(heads, name, nsiz, rp, -1, TRUE); } } } cbmapclose(elems); return sock; } /* receive all data of a networdk connection */ static char *recvall(int sock, int *sp){ CBDATUM *datum; char iobuf[SOCKBUFSIZ]; int size; datum = cbdatumopen(NULL, -1); while(cbdatumsize(datum) < g_limitsize && (size = recv(sock, iobuf, SOCKBUFSIZ, 0)) > 0){ cbdatumcat(datum, iobuf, size); } return cbdatumtomalloc(datum, sp); } /* pass through raw data of a connection */ static void passhttprawdata(int sock){ char iobuf[SOCKBUFSIZ]; int size; while((size = recv(sock, iobuf, SOCKBUFSIZ, 0)) > 0){ fwrite(iobuf, 1, size, stdout); } } /* modify a header of location */ static void modifylocation(CBMAP *heads, const char *name){ CBDATUM *datum; const char *url; char *nurl; int i; if(!(url = cbmapget(heads, name, -1, NULL))) return; nurl = cburlresolve(p_url, url); datum = cbdatumopen(NULL, -1); cbdatumprintf(datum, "http://%s%s?url=%?&once=%d", g_hostname, g_scriptpath, nurl, p_once); for(i = 0; i < cblistnum(p_words); i++){ cbdatumprintf(datum, "&word%d=%?", i + 1, cblistval(p_words, i, NULL)); } cbmapput(heads, name, -1, cbdatumptr(datum), cbdatumsize(datum), TRUE); cbdatumclose(datum); free(nurl); } /* send the data of HTTP connection */ static void sendhttpdata(void){ CBMAP *heads; const char *kbuf, *vbuf, *cmd; char *url, *type, *enc, *pv, *rbuf; int sock, code, ksiz, rsiz; url = replaceurl(p_url); heads = cbmapopenex(MINIBNUM); if((sock = gethttpconnection(url, &code, heads)) == -1){ showerror(cbmapget(heads, "ERROR", -1, NULL)); cbmapclose(heads); free(url); return; } cbmapiterinit(g_urlrules); while((kbuf = cbmapiternext(g_urlrules, &ksiz)) != NULL){ if(est_regex_match_str(kbuf, p_url)){ cbmapput(heads, "content-type", -1, cbmapget(g_urlrules, kbuf, ksiz, NULL), -1, TRUE); break; } } if(!(vbuf = cbmapget(heads, "content-type", -1, NULL))) vbuf = "text/plain"; type = cbmemdup(vbuf, -1); if((pv = strchr(type, ';')) != NULL) *pv = '\0'; cbstrtolower(type); enc = NULL; if((pv = strstr(vbuf, "charset=")) != NULL || (pv = strstr(vbuf, "CHARSET=")) != NULL){ pv = strchr(pv, '=') + 1; if(*pv == '"') pv++; enc = cbmemdup(pv, -1); if((pv = strchr(enc, '"')) != NULL) *pv = '\0'; } cmd = ""; cbmapiterinit(g_mtrules); while((kbuf = cbmapiternext(g_mtrules, &ksiz)) != NULL){ if(est_regex_match_str(kbuf, type)){ cmd = cbmapget(g_mtrules, kbuf, ksiz, NULL); break; } } printf("Status: %d\r\n", code); cbmapout(heads, "", -1); cbmapout(heads, "ERROR", -1); if(*cmd != '\0'){ cbmapput(heads, "content-type", -1, "text/html; charset=UTF-8", -1, TRUE); cbmapout(heads, "content-length", -1); cbmapout(heads, "content-encoding", -1); cbmapout(heads, "connection", -1); cbmapout(heads, "set-cookie", -1); cbmapout(heads, "set-cookie2", -1); cbmapout(heads, "etag", -1); cbmapout(heads, "transfer-encoding", -1); } modifylocation(heads, "location"); modifylocation(heads, "content-location"); cbmapiterinit(heads); while((kbuf = cbmapiternext(heads, &ksiz)) != NULL){ printf("%s: %s\r\n", kbuf, cbmapget(heads, kbuf, ksiz, NULL)); } printf("\r\n"); if(!strcmp(cmd, DRAFTCMD)){ rbuf = recvall(sock, &rsiz); sendpagefromdraft(rbuf, rsiz, enc); free(rbuf); } else if(!strcmp(cmd, TEXTCMD)){ rbuf = recvall(sock, &rsiz); sendpagefromtext(rbuf, rsiz, enc); free(rbuf); } else if(!strcmp(cmd, HTMLCMD)){ rbuf = recvall(sock, &rsiz); sendpagefromhtml(rbuf, rsiz, enc); free(rbuf); } else if(!strcmp(cmd, MIMECMD)){ rbuf = recvall(sock, &rsiz); sendpagefrommime(rbuf, rsiz, enc); free(rbuf); } else if(*cmd != '\0'){ rbuf = recvall(sock, &rsiz); sendpagewithxcmd(rbuf, rsiz, enc, cmd); free(rbuf); } else { passhttprawdata(sock); } free(enc); free(type); est_sock_down(sock); cbmapclose(heads); free(url); } /* send the navigation bar */ static void sendnavibar(void){ static int first = TRUE; const char *defstyle = "text-align: left; text-indent: 0em;" " margin: 0.2em 0.2em; padding 0em; 0em;" " color: #111111; background: transparent none; border: none;" " font-size: small; font-weight: normal;"; int i; if(!first) return; first = FALSE; xmlprintf("
    \n"); xmlprintf("

    " "This page have been mediated by Hyper Estraier %@.

    \n", defstyle, est_version); xmlprintf("
    \n", g_scriptname, defstyle); xmlprintf("
    \n", defstyle); xmlprintf("\n"); xmlprintf(" 0) xmlprintf(" "); xmlprintf("%@", cblistval(p_words, i, NULL)); } xmlprintf("\" size=\"24\" id=\"estproxy_words\" tabindex=\"1\" accesskey=\"0\" />\n"); xmlprintf("\n"); xmlprintf("\n", p_url); xmlprintf("\n", p_once); xmlprintf("
    \n"); xmlprintf("
    \n"); if(cblistnum(p_words) > 0){ xmlprintf("
    \n", defstyle); xmlprintf("jump to:\n"); for(i = 0; i < cblistnum(p_words); i++){ xmlprintf("" "%@\n", i + 1, g_wordcolors[i%(sizeof(g_wordcolors)/sizeof(char *))], cblistval(p_words, i, NULL)); } xmlprintf("
    \n"); } xmlprintf("
    \n", defstyle); xmlprintf("original page:\n"); xmlprintf("%64@\n", p_url, p_url); xmlprintf("
    \n"); xmlprintf("
    \n"); } /* send a snippet string */ static void sendsnippet(const char *str){ static CBMAP *colors = NULL; static CBMAP *ids = NULL; CBLIST *chunks, *lines; const char *line, *color, *id; char numbuf[NUMBUFSIZ], *snippet, *word, *pv; int i, j, len, tail; if(!colors){ colors = cbmapopenex(MINIBNUM); cbglobalgc(colors, (void (*)(void *))cbmapclose); ids = cbmapopenex(MINIBNUM); cbglobalgc(ids, (void (*)(void *))cbmapclose); for(i = 0; i < cblistnum(p_words); i++){ cbmapput(colors, cblistval(p_words, i, NULL), -1, g_wordcolors[i%(sizeof(g_wordcolors)/sizeof(char *))], -1, FALSE); len = sprintf(numbuf, "estproxy_word%d", i + 1); cbmapput(ids, cblistval(p_words, i, NULL), -1, numbuf, len, FALSE); } } if(cblistnum(p_words) < 1){ xmlprintf("%@", str); return; } tail = cbstrbwmatch(str, "\n"); chunks = cbsplit(str, -1, "\n"); for(i = 0; i < cblistnum(chunks); i++){ snippet = est_str_make_snippet(cblistval(chunks, i, NULL), p_words, INT_MAX, INT_MAX, 0); lines = cbsplit(snippet, -1, "\n"); for(j = 0; j < cblistnum(lines); j++){ line = cblistval(lines, j, NULL); if((pv = strchr(line, '\t')) != NULL){ word = cbmemdup(line, pv - line); pv++; len = strlen(pv); if(!(color = cbmapget(colors, pv, len, NULL))) color = "#cccccc"; if((id = cbmapget(ids, pv, len, NULL)) != NULL){ xmlprintf("%@", color, id, word); cbmapout(ids, pv, len); } else { xmlprintf("%@", color, word); } free(word); } else { xmlprintf("%@", line); } } free(snippet); if(i < cblistnum(chunks) - 1) xmlprintf("\n"); } cblistclose(chunks); if(tail) xmlprintf("\n"); } /* get the language string */ static const char *langstr(void){ switch(g_language){ case ESTLANGEN: return "en"; case ESTLANGJA: return "ja"; case ESTLANGZH: return "zh"; case ESTLANGKO: return "ko"; default: break; } return "en"; } /* send the result made from document draft */ static void sendpagefromdraft(const char *buf, int size, const char *penc){ ESTDOC *doc; CBMAP *kwords; const CBLIST *texts; CBLIST *names; const char *lang, *title, *rp; int i; doc = est_doc_new_from_draft(buf); if(!(lang = est_doc_attr(doc, ESTDATTRLANG))) lang = langstr(); if(!(title = est_doc_attr(doc, ESTDATTRTITLE))){ if((title = est_doc_attr(doc, ESTDATTRURI)) != NULL){ if((rp = strrchr(title, '/')) != NULL && rp[1] != '\0') title = rp + 1; } else { title = "(no title)"; } } xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n", lang, lang); xmlprintf("\n"); xmlprintf("\n", lang); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n", g_scriptname); xmlprintf("%@\n", title); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); if(g_shownavi) sendnavibar(); xmlprintf("

    %@

    \n", title); xmlprintf("
    \n"); names = est_doc_attr_names(doc); for(i = 0; i < cblistnum(names); i++){ rp = cblistval(names, i, NULL); xmlprintf("
    %@:" " %@
    \n", i + 1, rp, i + 1, est_doc_attr(doc, rp)); } cblistclose(names); xmlprintf("
    \n"); if((kwords = est_doc_keywords(doc)) != NULL && cbmaprnum(kwords) > 0){ xmlprintf("
    \n"); xmlprintf("

    "); cbmapiterinit(kwords); for(i = 1; (rp = cbmapiternext(kwords, NULL)) != NULL; i++){ if(i > 1) xmlprintf(", "); xmlprintf("%@" " (%@)", i, rp, i, cbmapget(kwords, rp, -1, NULL)); } xmlprintf("

    \n"); } xmlprintf("
    \n"); texts = est_doc_texts(doc); for(i = 0; i < cblistnum(texts); i++){ rp = cblistval(texts, i, NULL); xmlprintf("

    "); sendsnippet(rp); xmlprintf("

    \n"); } rp = est_doc_hidden_texts(doc); if(*rp != '\0'){ xmlprintf("
    \n"); xmlprintf("

    "); sendsnippet(rp); xmlprintf("

    \n"); } xmlprintf("
    \n"); xmlprintf("\n"); xmlprintf("\n"); est_doc_delete(doc); } /* send the result made from plain text */ static void sendpagefromtext(const char *buf, int size, const char *penc){ const char *lang, *enc, *text; char *title, *nbuf; lang = langstr(); title = est_regex_replace(p_url, ".*/([^/]*)/?$", "\\1"); enc = penc ? penc : est_enc_name(buf, size, g_language); if(!strcmp(enc, "UTF-8")){ nbuf = NULL; text = buf; } else { text = buf; nbuf = est_iconv(buf, size, enc, "UTF-8", NULL, NULL); if(nbuf) text = nbuf; } xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n", lang, lang); xmlprintf("\n"); xmlprintf("\n", lang); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n", g_scriptname); xmlprintf("%@\n", title); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); if(g_shownavi) sendnavibar(); xmlprintf("
    ");
      sendsnippet(text);
      xmlprintf("
    \n"); xmlprintf("\n"); xmlprintf("\n"); free(nbuf); free(title); } /* send the result made from HTML */ static void sendpagefromhtml(const char *buf, int size, const char *penc){ CBMAP *attrs; CBLIST *elems; const char *enc, *html, *elem, *name, *kbuf, *vbuf; char *nbuf, *nenc, *raw, *nurl; int i, esiz, ksiz, asis; enc = est_enc_name(buf, size, g_language); html = NULL; nbuf = NULL; if(!strcmp(enc, "UTF-16") || !strcmp(enc, "UTF-16BE") || !strcmp(enc, "UTF-16LE")){ nbuf = est_iconv(buf, size, enc, "UTF-8", NULL, NULL); } else if(!strcmp(enc, "US-ASCII")){ nbuf = NULL; } else { if((nenc = penc ? cbmemdup(penc, -1) : htmlenc(buf)) != NULL){ if(cbstricmp(nenc, "UTF-8")){ nbuf = est_iconv(buf, size, nenc, "UTF-8", NULL, NULL); if(!nbuf) nbuf = est_iconv(buf, size, enc, "UTF-8", NULL, NULL); } free(nenc); } else { nbuf = est_iconv(buf, size, enc, "UTF-8", NULL, NULL); } } if(nbuf) html = nbuf; if(!html) html = buf; asis = FALSE; elems = cbxmlbreak(html, FALSE); for(i = 0; i < CB_LISTNUM(elems); i++){ elem = CB_LISTVAL2(elems, i, esiz); if(elem[0] == '<'){ if(elem[1] == '?' || elem[1] == '!' || elem[1] == '/'){ xmlprintf("%s", elem); asis = FALSE; } else { attrs = cbxmlattrs(elem); name = cbmapget(attrs, "", -1, NULL); if(!cbstricmp(name, "title") || !cbstricmp(name, "script") || !cbstricmp(name, "style")) asis = TRUE; if(!cbstricmp(name, "meta")){ vbuf = cbmapget(attrs, "name", -1, NULL); if(!vbuf) vbuf = cbmapget(attrs, "Name", -1, NULL); if(!vbuf) vbuf = cbmapget(attrs, "NAME", -1, NULL); if(!vbuf) vbuf = cbmapget(attrs, "http-equiv", -1, NULL); if(!vbuf) vbuf = cbmapget(attrs, "Http-equiv", -1, NULL); if(!vbuf) vbuf = cbmapget(attrs, "Http-Equiv", -1, NULL); if(!vbuf) vbuf = cbmapget(attrs, "HTTP-EQUIV", -1, NULL); if(vbuf && !cbstricmp(vbuf, "content-type")){ xmlprintf(""); } else { xmlprintf("%s", elem); } } else { xmlprintf("<%s", name); cbmapiterinit(attrs); while((kbuf = cbmapiternext(attrs, &ksiz)) != NULL){ if(ksiz < 1) continue; vbuf = cbmapget(attrs, kbuf, ksiz, NULL); if(!cbstricmp(kbuf, "src") || !cbstricmp(kbuf, "href") || !cbstricmp(kbuf, "data")){ nurl = cburlresolve(p_url, vbuf); if(p_once){ xmlprintf(" %@=\"%@\"", kbuf, nurl); } else { xmlprintf(" %@=\"%s?url=%?\"", kbuf, g_scriptname, nurl); } free(nurl); } else if(!cbstricmp(kbuf, "action")){ nurl = cburlresolve(p_url, vbuf); xmlprintf(" %@=\"%@\"", kbuf, nurl); free(nurl); } else if(strchr(vbuf, '&')){ raw = htmlrawtext(vbuf); xmlprintf(" %@=\"%@\"", kbuf, raw); free(raw); } else { xmlprintf(" %@=\"%@\"", kbuf, vbuf); } } if(cbstrbwmatch(elem, "/>")){ xmlprintf(" />"); } else { xmlprintf(">"); } } if(!cbstricmp(name, "body") && g_shownavi){ xmlprintf("\n"); sendnavibar(); } cbmapclose(attrs); } } else if(asis){ xmlprintf("%s", elem); } else { if(strchr(elem, '&')){ raw = htmlrawtext(elem); sendsnippet(raw); free(raw); } else { sendsnippet(elem); } } } cblistclose(elems); free(nbuf); } /* get the encoding of an HTML string */ static char *htmlenc(const char *str){ CBLIST *elems; CBMAP *attrs; const char *elem, *equiv, *content; char *enc, *pv; int i; elems = cbxmlbreak(str, TRUE); for(i = 0; i < CB_LISTNUM(elems); i++){ elem = CB_LISTVAL(elems, i); if(elem[0] != '<' || !cbstrfwimatch(elem, "", """, "\"", "'", "'", " ", "\xc2\xa0", "¡", "\xc2\xa1", "¢", "\xc2\xa2", "£", "\xc2\xa3", "¤", "\xc2\xa4", "¥", "\xc2\xa5", "¦", "\xc2\xa6", "§", "\xc2\xa7", "¨", "\xc2\xa8", "©", "\xc2\xa9", "ª", "\xc2\xaa", "«", "\xc2\xab", "¬", "\xc2\xac", "­", "\xc2\xad", "®", "\xc2\xae", "¯", "\xc2\xaf", "°", "\xc2\xb0", "±", "\xc2\xb1", "²", "\xc2\xb2", "³", "\xc2\xb3", "´", "\xc2\xb4", "µ", "\xc2\xb5", "¶", "\xc2\xb6", "·", "\xc2\xb7", "¸", "\xc2\xb8", "¹", "\xc2\xb9", "º", "\xc2\xba", "»", "\xc2\xbb", "¼", "\xc2\xbc", "½", "\xc2\xbd", "¾", "\xc2\xbe", "¿", "\xc2\xbf", "À", "\xc3\x80", "Á", "\xc3\x81", "Â", "\xc3\x82", "Ã", "\xc3\x83", "Ä", "\xc3\x84", "Å", "\xc3\x85", "Æ", "\xc3\x86", "Ç", "\xc3\x87", "È", "\xc3\x88", "É", "\xc3\x89", "Ê", "\xc3\x8a", "Ë", "\xc3\x8b", "Ì", "\xc3\x8c", "Í", "\xc3\x8d", "Î", "\xc3\x8e", "Ï", "\xc3\x8f", "Ð", "\xc3\x90", "Ñ", "\xc3\x91", "Ò", "\xc3\x92", "Ó", "\xc3\x93", "Ô", "\xc3\x94", "Õ", "\xc3\x95", "Ö", "\xc3\x96", "×", "\xc3\x97", "Ø", "\xc3\x98", "Ù", "\xc3\x99", "Ú", "\xc3\x9a", "Û", "\xc3\x9b", "Ü", "\xc3\x9c", "Ý", "\xc3\x9d", "Þ", "\xc3\x9e", "ß", "\xc3\x9f", "à", "\xc3\xa0", "á", "\xc3\xa1", "â", "\xc3\xa2", "ã", "\xc3\xa3", "ä", "\xc3\xa4", "å", "\xc3\xa5", "æ", "\xc3\xa6", "ç", "\xc3\xa7", "è", "\xc3\xa8", "é", "\xc3\xa9", "ê", "\xc3\xaa", "ë", "\xc3\xab", "ì", "\xc3\xac", "í", "\xc3\xad", "î", "\xc3\xae", "ï", "\xc3\xaf", "ð", "\xc3\xb0", "ñ", "\xc3\xb1", "ò", "\xc3\xb2", "ó", "\xc3\xb3", "ô", "\xc3\xb4", "õ", "\xc3\xb5", "ö", "\xc3\xb6", "÷", "\xc3\xb7", "ø", "\xc3\xb8", "ù", "\xc3\xb9", "ú", "\xc3\xba", "û", "\xc3\xbb", "ü", "\xc3\xbc", "ý", "\xc3\xbd", "þ", "\xc3\xbe", "ÿ", "\xc3\xbf", "ƒ", "\xc6\x92", "Α", "\xce\x91", "Β", "\xce\x92", "Γ", "\xce\x93", "Δ", "\xce\x94", "Ε", "\xce\x95", "Ζ", "\xce\x96", "Η", "\xce\x97", "Θ", "\xce\x98", "Ι", "\xce\x99", "Κ", "\xce\x9a", "Λ", "\xce\x9b", "Μ", "\xce\x9c", "Ν", "\xce\x9d", "Ξ", "\xce\x9e", "Ο", "\xce\x9f", "Π", "\xce\xa0", "Ρ", "\xce\xa1", "Σ", "\xce\xa3", "Τ", "\xce\xa4", "Υ", "\xce\xa5", "Φ", "\xce\xa6", "Χ", "\xce\xa7", "Ψ", "\xce\xa8", "Ω", "\xce\xa9", "α", "\xce\xb1", "β", "\xce\xb2", "γ", "\xce\xb3", "δ", "\xce\xb4", "ε", "\xce\xb5", "ζ", "\xce\xb6", "η", "\xce\xb7", "θ", "\xce\xb8", "ι", "\xce\xb9", "κ", "\xce\xba", "λ", "\xce\xbb", "μ", "\xce\xbc", "ν", "\xce\xbd", "ξ", "\xce\xbe", "ο", "\xce\xbf", "π", "\xcf\x80", "ρ", "\xcf\x81", "ς", "\xcf\x82", "σ", "\xcf\x83", "τ", "\xcf\x84", "υ", "\xcf\x85", "φ", "\xcf\x86", "χ", "\xcf\x87", "ψ", "\xcf\x88", "ω", "\xcf\x89", "ϑ", "\xcf\x91", "ϒ", "\xcf\x92", "ϖ", "\xcf\x96", "•", "\xe2\x80\xa2", "…", "\xe2\x80\xa6", "′", "\xe2\x80\xb2", "″", "\xe2\x80\xb3", "‾", "\xe2\x80\xbe", "⁄", "\xe2\x81\x84", "℘", "\xe2\x84\x98", "ℑ", "\xe2\x84\x91", "ℜ", "\xe2\x84\x9c", "™", "\xe2\x84\xa2", "ℵ", "\xe2\x84\xb5", "←", "\xe2\x86\x90", "↑", "\xe2\x86\x91", "→", "\xe2\x86\x92", "↓", "\xe2\x86\x93", "↔", "\xe2\x86\x94", "↵", "\xe2\x86\xb5", "⇐", "\xe2\x87\x90", "⇑", "\xe2\x87\x91", "⇒", "\xe2\x87\x92", "⇓", "\xe2\x87\x93", "⇔", "\xe2\x87\x94", "∀", "\xe2\x88\x80", "∂", "\xe2\x88\x82", "∃", "\xe2\x88\x83", "∅", "\xe2\x88\x85", "∇", "\xe2\x88\x87", "∈", "\xe2\x88\x88", "∉", "\xe2\x88\x89", "∋", "\xe2\x88\x8b", "∏", "\xe2\x88\x8f", "∑", "\xe2\x88\x91", "−", "\xe2\x88\x92", "∗", "\xe2\x88\x97", "√", "\xe2\x88\x9a", "∝", "\xe2\x88\x9d", "∞", "\xe2\x88\x9e", "∠", "\xe2\x88\xa0", "∧", "\xe2\x88\xa7", "∨", "\xe2\x88\xa8", "∩", "\xe2\x88\xa9", "∪", "\xe2\x88\xaa", "∫", "\xe2\x88\xab", "∴", "\xe2\x88\xb4", "∼", "\xe2\x88\xbc", "≅", "\xe2\x89\x85", "≈", "\xe2\x89\x88", "≠", "\xe2\x89\xa0", "≡", "\xe2\x89\xa1", "≤", "\xe2\x89\xa4", "≥", "\xe2\x89\xa5", "⊂", "\xe2\x8a\x82", "⊃", "\xe2\x8a\x83", "⊄", "\xe2\x8a\x84", "⊆", "\xe2\x8a\x86", "⊇", "\xe2\x8a\x87", "⊕", "\xe2\x8a\x95", "⊗", "\xe2\x8a\x97", "⊥", "\xe2\x8a\xa5", "⋅", "\xe2\x8b\x85", "⌈", "\xe2\x8c\x88", "⌉", "\xe2\x8c\x89", "⌊", "\xe2\x8c\x8a", "⌋", "\xe2\x8c\x8b", "⟨", "\xe2\x8c\xa9", "⟩", "\xe2\x8c\xaa", "◊", "\xe2\x97\x8a", "♠", "\xe2\x99\xa0", "♣", "\xe2\x99\xa3", "♥", "\xe2\x99\xa5", "♦", "\xe2\x99\xa6", "Œ", "\xc5\x92", "œ", "\xc5\x93", "Š", "\xc5\xa0", "š", "\xc5\xa1", "Ÿ", "\xc5\xb8", "ˆ", "\xcb\x86", "˜", "\xcb\x9c", " ", "\xe2\x80\x82", " ", "\xe2\x80\x83", " ", "\xe2\x80\x89", "‌", "\xe2\x80\x8c", "‍", "\xe2\x80\x8d", "‎", "\xe2\x80\x8e", "‏", "\xe2\x80\x8f", "–", "\xe2\x80\x93", "—", "\xe2\x80\x94", "‘", "\xe2\x80\x98", "’", "\xe2\x80\x99", "‚", "\xe2\x80\x9a", "“", "\xe2\x80\x9c", "”", "\xe2\x80\x9d", "„", "\xe2\x80\x9e", "†", "\xe2\x80\xa0", "‡", "\xe2\x80\xa1", "‰", "\xe2\x80\xb0", "‹", "\xe2\x80\xb9", "›", "\xe2\x80\xba", "€", "\xe2\x82\xac", NULL }; char *raw, *wp, buf[2], *tmp; int i, j, hit, num, tsiz; CB_MALLOC(raw, strlen(html) * 3 + 1); wp = raw; while(*html != '\0'){ if(*html == '&'){ if(*(html + 1) == '#'){ if(*(html + 2) == 'x' || *(html + 2) == 'X'){ num = strtol(html + 3, NULL, 16); } else { num = atoi(html + 2); } buf[0] = num / 256; buf[1] = num % 256; if((tmp = est_uconv_out(buf, 2, &tsiz)) != NULL){ for(j = 0; j < tsiz; j++){ *wp = ((unsigned char *)tmp)[j]; wp++; } free(tmp); } while(*html != ';' && *html != ' ' && *html != '\n' && *html != '\0'){ html++; } if(*html == ';') html++; } else { hit = FALSE; for(i = 0; pairs[i] != NULL; i += 2){ if(cbstrfwmatch(html, pairs[i])){ wp += sprintf(wp, "%s", pairs[i+1]); html += strlen(pairs[i]); hit = TRUE; break; } } if(!hit){ *wp = *html; wp++; html++; } } } else { *wp = *html; wp++; html++; } } *wp = '\0'; return raw; } /* send the result made from MIME */ static void sendpagefrommime(const char *buf, int size, const char *penc){ CBMAP *attrs, *pattrs; CBLIST *parts; const char *val, *lang, *bound, *part; char *body, *title, *raw, *pbody; int i, bsiz, psiz, pbsiz; lang = langstr(); attrs = cbmapopenex(MINIBNUM); body = cbmimebreak(buf, size, attrs, &bsiz); if((val = cbmapget(attrs, "subject", -1, NULL)) != NULL){ title = mimestr(val); } else { title = cbmemdup("(no title)", -1); } xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n", lang, lang); xmlprintf("\n"); xmlprintf("\n", lang); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n", g_scriptname); xmlprintf("%@\n", title); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); if(g_shownavi) sendnavibar(); xmlprintf("

    %@

    \n", title); xmlprintf("
    \n"); if((val = cbmapget(attrs, "from", -1, NULL)) != NULL){ raw = mimestr(val); xmlprintf("
    From:" " %@
    \n", raw); free(raw); } if((val = cbmapget(attrs, "to", -1, NULL)) != NULL){ raw = mimestr(val); xmlprintf("
    To:" " %@
    \n", raw); free(raw); } if((val = cbmapget(attrs, "cc", -1, NULL)) != NULL){ raw = mimestr(val); xmlprintf("
    Cc:" " %@
    \n", raw); free(raw); } if((val = cbmapget(attrs, "subject", -1, NULL)) != NULL){ raw = mimestr(val); xmlprintf("
    Subject:" " %@
    \n", raw); free(raw); } if((val = cbmapget(attrs, "date", -1, NULL)) != NULL){ raw = mimestr(val); xmlprintf("
    Date:" " %@
    \n", raw); free(raw); } if((val = cbmapget(attrs, "x-mailer", -1, NULL)) != NULL){ raw = mimestr(val); xmlprintf("
    X-Mailer:" " %@
    \n", raw); free(raw); } xmlprintf("
    \n"); if((val = cbmapget(attrs, "TYPE", -1, NULL)) != NULL && cbstrfwimatch(val, "multipart/")){ if((bound = cbmapget(attrs, "BOUNDARY", -1, NULL)) != NULL){ parts = cbmimeparts(body, bsiz, bound); for(i = 0; i < CB_LISTNUM(parts) && i < 8; i++){ part = cblistval(parts, i, &psiz); pattrs = cbmapopenex(MINIBNUM); pbody = cbmimebreak(part, psiz, pattrs, &pbsiz); sendmimepart(pbody, pbsiz, pattrs, NULL); free(pbody); cbmapclose(pattrs); } cblistclose(parts); } } else { sendmimepart(body, bsiz, attrs, penc); } xmlprintf("
    \n"); xmlprintf("\n"); xmlprintf("\n"); free(title); free(body); cbmapclose(attrs); } /* send a part of MIME */ static void sendmimepart(const char *body, int bsiz, CBMAP *attrs, const char *penc){ const char *val; char *tbuf, *ebuf, *cbuf; int tsiz, esiz, csiz; tbuf = NULL; ebuf = NULL; cbuf = NULL; val = cbmapget(attrs, "content-transfer-encoding", -1, NULL); if(val && cbstrfwimatch(val, "base64")){ tbuf = cbbasedecode(body, &tsiz); body = tbuf; bsiz = tsiz; } else if(val && cbstrfwimatch(val, "quoted-printable")){ tbuf = cbquotedecode(body, &tsiz); body = tbuf; bsiz = tsiz; } val = cbmapget(attrs, "content-encoding", -1, NULL); if(val && (cbstrfwimatch(val, "x-gzip") || cbstrfwimatch(val, "gzip")) && (ebuf = cbgzdecode(body, bsiz, &esiz)) != NULL){ body = ebuf; bsiz = esiz; } else if(val && (cbstrfwimatch(val, "x-deflate") || cbstrfwimatch(val, "deflate")) && (ebuf = cbinflate(body, bsiz, &esiz)) != NULL){ body = ebuf; bsiz = esiz; } if(penc && (cbuf = est_iconv(body, bsiz, penc, "UTF-8", &csiz, NULL)) != NULL){ body = cbuf; bsiz = csiz; } else if((val = cbmapget(attrs, "CHARSET", -1, NULL)) != NULL && (cbuf = est_iconv(body, bsiz, val, "UTF-8", &csiz, NULL)) != NULL){ body = cbuf; bsiz = csiz; } xmlprintf("
    \n"); if(!(val = cbmapget(attrs, "TYPE", -1, NULL))) val = "text/plain"; if(cbstrfwimatch(val, "text/")){ if(!cbstrfwimatch(val, "text/plain")) xmlprintf("
    (%@)
    \n", val); xmlprintf("
    ");
        sendsnippet(body);
        xmlprintf("
    \n"); } else { xmlprintf("
    (%@; not shown)
    \n", val); } free(cbuf); free(ebuf); free(tbuf); } /* convert MIME encoded string into plain string */ static char *mimestr(const char *mime){ char enc[64], *ebuf, *rbuf; ebuf = cbmimedecode(mime, enc); rbuf = est_iconv(ebuf, -1, enc, "UTF-8", NULL, NULL); free(ebuf); return rbuf ? rbuf : cbmemdup(mime, -1); } /* send the result made with an outer command */ static void sendpagewithxcmd(const char *buf, int size, const char *penc, const char *cmd){ const char *tmpdir, *pv, *ext, *fmt; char iname[URIBUFSIZ], oname[URIBUFSIZ], cbuf[URIBUFSIZ], *rbuf; int rnd, pid, rsiz; struct stat sbuf; if(ESTPATHCHR == '/' && stat("/tmp", &sbuf) == 0){ tmpdir = "/tmp"; } else if(ESTPATHCHR == '\\' && ((pv = getenv("TMP")) != NULL || (pv = getenv("TEMP")) != NULL) && stat(pv, &sbuf) == 0){ tmpdir = pv; } else { tmpdir = ESTCDIRSTR; } ext = NULL; if(!(pv = strrchr(p_url, ESTPATHCHR))) pv = p_url; if((pv = strrchr(pv, ESTEXTCHR)) != NULL) ext = pv; if(!ext || strlen(ext) >= 32 || strchr(ext, '"') || strchr(ext, '\\')) ext = ""; rnd = dpouterhash(p_url, -1) & 0xffff; pid = (int)getpid() & 0xffff; sprintf(iname, "%s%cxcmd-in-%04X%04X%s", tmpdir, ESTPATHCHR, pid, rnd, ext); sprintf(oname, "%s%cxcmd-out-%04X%04X%cest", tmpdir, ESTPATHCHR, pid, rnd, ESTEXTCHR); fmt = DRAFTCMD; if(cbstrfwmatch(cmd, "T@")){ fmt = TEXTCMD; cmd += 2; } else if(cbstrfwmatch(cmd, "H@")){ fmt = HTMLCMD; cmd += 2; } else if(cbstrfwmatch(cmd, "M@")){ fmt = MIMECMD; cmd += 2; } cbwritefile(iname, buf, size); sprintf(cbuf, "%s \"%s\" \"%s\"", cmd, iname, oname); system(cbuf); if((rbuf = cbreadfile(oname, &rsiz)) != NULL){ if(fmt == DRAFTCMD){ sendpagefromdraft(rbuf, rsiz, NULL); } else if(fmt == TEXTCMD){ sendpagefromtext(rbuf, rsiz, NULL); } else if(fmt == HTMLCMD){ sendpagefromhtml(rbuf, rsiz, NULL); } else if(fmt == MIMECMD){ sendpagefrommime(rbuf, rsiz, NULL); } free(rbuf); } unlink(oname); unlink(iname); } /* END OF FILE */ hyperestraier-1.4.13/estproxy.conf000066400000000000000000000006711125261632700172430ustar00rootroot00000000000000#replace: ^http://localhost/{{!}}file:///home/mikio/public_html/ allowrx: ^http:// #allowrx: ^file:// denyrx: /\. passaddr: 1 limitsize: 32 urlrule: \.est${{!}}text/x-estraier-draft urlrule: \.(eml|mime|mht|mhtml)${{!}}message/rfc822 typerule: ^text/x-estraier-draft${{!}}[DRAFT] typerule: ^text/plain${{!}}[TEXT] typerule: ^(text/html|application/xhtml+xml)${{!}}[HTML] typerule: ^message/rfc822${{!}}[MIME] language: 0 shownavi: 1 hyperestraier-1.4.13/estraier.c000066400000000000000000012164331125261632700164670ustar00rootroot00000000000000/************************************************************************************************* * Implementation of the core API * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #if defined(_MYVISTA) #include #endif #include "estraier.h" #include "myconf.h" #define ESTNUMBUFSIZ 32 /* size of a buffer for a number */ #define ESTPATHBUFSIZ 4096 /* size of a buffer for a path */ #define ESTIOBUFSIZ 8192 /* size of a buffer for I/O */ #define ESTALLOCUNIT 1024 /* unit number of memory allocation */ #define ESTMINIBNUM 31 /* bucket number of map for attributes */ #define ESTSCANWNUM 256 /* number of words for scaning check */ #define ESTSIGNUM 64 /* number of signals */ #define ESTREGSUBMAX 32 /* maximum number of substrings for regex */ #define ESTMETADBNAME "_meta" /* name of the meta database */ #define ESTKEYIDXNUM "_idxnum" /* key for the number of inverted indexes */ #define ESTKEYDSEQ "_dseq" /* key for the sequence for document IDs */ #define ESTKEYDNUM "_dnum" /* key for the number of documents */ #define ESTKEYMETA "_meta" /* key for meta data */ #define ESTIDXDBNAME "_idx" /* name of the inverted index */ #define ESTIDXDBLRM 109 /* records in a leaf node of the inverted index */ #define ESTIDXDBLRMA 17 /* records in a leaf node of the index in APN mode */ #define ESTIDXDBNIM 160 /* records in a non-leaf node of the inverted index */ #define ESTIDXDBLCN 16 /* number of leaf cache of the inverted index */ #define ESTIDXDBNCN 16 /* number of non-leaf cache of the inverted index */ #define ESTIDXDBRLCN 128 /* number of leaf cache of the index reader */ #define ESTIDXDBRLCNA 32 /* number of leaf cache of the reader in APN mode */ #define ESTIDXDBRNCN 256 /* number of non-leaf cache of the index reader */ #define ESTIDXDBFBP 512 /* size of free block pool of the inverted index */ #define ESTIDXDBMIN (1048576*512) /* minimum size of a database file */ #define ESTIDXDBMAX (1048576*1536) /* maximum size of a database file */ #define ESTFWMDBNAME "_fwm" /* name of the database for forward matching */ #define ESTFWMDBLRM 251 /* records in a leaf node of forward matching DB */ #define ESTFWMDBNIM 110 /* records in a non-leaf node of forward matching DB */ #define ESTFWMDBLCN 32 /* number of leaf cache of forward matching DB */ #define ESTFWMDBNCN 16 /* number of non-leaf cache of forward matching DB */ #define ESTFWMDBFBP 128 /* size of free block pool of forward matching DB */ #define ESTAUXDBNAME "_aux" /* name of the auxiliary index */ #define ESTAUXDBLRM 23 /* records in a leaf node of the auxiliary index */ #define ESTAUXDBNIM 160 /* records in a non-leaf node of the auxiliary index */ #define ESTAUXDBLCN 16 /* number of leaf cache of the auxiliary index */ #define ESTAUXDBNCN 16 /* number of non-leaf cache of the auxiliary index */ #define ESTAUXDBRLCN 256 /* number of leaf cache of the auxiliary reader */ #define ESTAUXDBRNCN 64 /* number of non-leaf cache of the auxiliary reader */ #define ESTAUXDBFBP 256 /* size of free block pool of the auxiliary index */ #define ESTXFMDBNAME "_xfm" /* name of the database for auxiliary forward matching */ #define ESTXFMDBLRM 111 /* records in a leaf node of xfm DB */ #define ESTXFMDBNIM 110 /* records in a non-leaf node of xfm DB */ #define ESTXFMDBLCN 32 /* number of leaf cache of xfm DB */ #define ESTXFMDBNCN 16 /* number of non-leaf cache of xfm DB */ #define ESTXFMDBFBP 128 /* size of free block pool of xfm DB */ #define ESTATTRDBNAME "_attr" /* name of the database for attributes */ #define ESTATTRDBBNUM 212987 /* bucket number of the database for attributes */ #define ESTATTRDBDNUM 3 /* division number of the database for attributes */ #define ESTATTRDBALN -5 /* alignment of the database for attributes */ #define ESTATTRDBFBP 64 /* size of free block pool of the attribute DB */ #define ESTTEXTDBNAME "_text" /* name of the database of texts */ #define ESTTEXTDBBNUM 61417 /* bucket number of the database for texts */ #define ESTTEXTDBDNUM 7 /* division number of the database for texts */ #define ESTTEXTDBALN -5 /* alignment of the database for texts */ #define ESTTEXTDBFBP 128 /* size of free block pool of the text DB */ #define ESTKWDDBNAME "_kwd" /* name of the database of keywords */ #define ESTKWDDBBNUM 163819 /* bucket number of the database for keywords */ #define ESTKWDDBDNUM 3 /* division number of the database for keywords */ #define ESTKWDDBALN -5 /* alignment of the database for keywords */ #define ESTKWDDBFBP 64 /* size of free block pool of the keyword DB */ #define ESTLISTDBNAME "_list" /* name of the database of document list */ #define ESTLISTDBLRM 99 /* records in a leaf node of document list DB */ #define ESTLISTDBNIM 200 /* records in a non-leaf node of document list DB */ #define ESTLISTDBLCN 64 /* number of leaf cache of document list DB */ #define ESTLISTDBNCN 16 /* number of non-leaf cache of document list DB */ #define ESTLISTDBFBP 128 /* size of free block pool of document list DB */ #define ESTAISEQPREF "__seq_" /* prefix of the database for sequencial access */ #define ESTAISTRPREF "__str_" /* prefix of the database for string narrowing */ #define ESTAINUMPREF "__num_" /* prefix of the database for number narrowing */ #define ESTAIBDIAM 0.8 /* diameter of the bucket number */ #define ESTAIDXLRM 99 /* records in a leaf node of narrowing index */ #define ESTAIDXNIM 120 /* records in a non-leaf node of narrowing index */ #define ESTAIDXLCN 1024 /* number of leaf cache of narrowing index */ #define ESTAIDXNCN 256 /* number of non-leaf cache of narrowing index */ #define ESTAIDXDPFBP 32 /* size of free block pool of sequencial DB */ #define ESTAIDXVLFBP 128 /* size of free block pool of narrowing DB */ #define ESTAIKBUFSIZ 8192 /* size of a buffer for a key */ #define ESTAISNUMMIN 256 /* minimum number of scores to use narrowing index */ #define ESTOPDUMMY "[DUMMY]" /* dummy operator */ #define ESTDBSBRAT 0.3 /* ratio of bucket numbers of large mode */ #define ESTDBSDRAT 0.4 /* ratio of the division number of large mode */ #define ESTDBLBRAT 3.0 /* ratio of bucket numbers of large mode */ #define ESTDBLDRAT 1.0 /* ratio of the division number of large mode */ #define ESTDBHBRAT 5.0 /* ratio of bucket numbers of huge mode */ #define ESTDBHDRAT 2.0 /* ratio of the division number of huge mode */ #define ESTDBH2RAT 1.4 /* ratio of huge mode second */ #define ESTDBH3RAT 2.0 /* ratio of huge mode third */ #define ESTVLCRDNUM 2 /* division number of usual Villa databases */ #define ESTVLCRDNAUX 7 /* division number of the auxiliary index */ #define ESTIDXCCBNUM 524288 /* bucket number of cache for the inverted index */ #define ESTAUXCCBNUM 65521 /* bucket number of cache for the auxiliary index */ #define ESTIDXCCMAX (1048576*64) /* max size of the cache */ #define ESTOUTCCBNUM 131072 /* bucket number of cache for deleted documents */ #define ESTKEYCCMNUM 65536 /* bucket number of cache for keys for TF-IDF */ #define ESTATTRCCMNUM 8192 /* number of cache for attributes */ #define ESTTEXTCCMNUM 1024 /* number of cache for texts */ #define ESTRESCCMNUM 256 /* number of cache for results */ #define ESTCCIRSLOT 256 /* slot timing for interruption */ #define ESTCCCBFREQ 10000 /* frequency of callback for flushing words */ #define ESTDIRMODE 00755 /* permission of a creating directory */ #define ESTICCHECKSIZ 32768 /* size of checking character code */ #define ESTICMISSMAX 256 /* allowance number of missing characters */ #define ESTICALLWRAT 0.001 /* allowance ratio of missing characters */ #define ESTOCPOINT 16 /* point per occurrence */ #define ESTJHASHNUM 251 /* hash number for a junction */ #define ESTWORDMAXLEN 48 /* maximum length of a word */ #define ESTWORDAVGLEN 8 /* average length of a word */ #define ESTATTRALW 1.5 /* allowance ratio of attribute narrowing */ #define ESTKEYSCALW 3 /* allowance ratio of TF-IDF for keywords */ #define ESTMEMIRATIO 1.1 /* incremental ratio of memory allocation */ #define ESTSCOREUNIT 1000 /* unit of standard deviation of scoring */ #define ESTAUXMIN 32 /* minimum hits to adopt the auxiliary index */ #define ESTAUXEXRAT 16 /* ratio of hits of keywords expansion */ #define ESTWILDMAX 256 /* maximum number of expansion of wild cards */ #define ESTECLKNUM 32 /* number of keywords to eclipse candidates */ #define ESTSMLRKNUM 16 /* number of keywords to get candidates */ #define ESTSMLRUNUM 1024 /* number of adopted documents for a keyword */ #define ESTSMLRMNUM 4096 /* maximum number of candidates to be checked */ #define ESTSMLRNMIN 0.5 /* the minimum value for narrowing */ /* set a buffer for a variable length number */ #define EST_SET_VNUMBUF(EST_len, EST_buf, EST_num) \ do { \ int _EST_num = (EST_num); \ div_t EST_d; \ if(_EST_num == 0){ \ ((signed char *)(EST_buf))[0] = 0; \ (EST_len) = 1; \ } else { \ (EST_len) = 0; \ while(_EST_num > 0){ \ EST_d = div(_EST_num, 128); \ _EST_num = EST_d.quot; \ if(_EST_num > 0){ \ ((signed char *)(EST_buf))[(EST_len)] = -EST_d.rem - 1; \ } else { \ ((signed char *)(EST_buf))[(EST_len)] = EST_d.rem; \ } \ (EST_len)++; \ } \ } \ } while(FALSE) /* read a variable length buffer */ #define EST_READ_VNUMBUF(EST_buf, EST_num, EST_step) \ do { \ int _EST_i, _EST_base; \ (EST_num) = 0; \ _EST_base = 1; \ for(_EST_i = 0; TRUE; _EST_i++){ \ if(((signed char *)(EST_buf))[_EST_i] >= 0){ \ (EST_num) += ((signed char *)(EST_buf))[_EST_i] * _EST_base; \ break; \ } \ (EST_num) += _EST_base * (((signed char *)(EST_buf))[_EST_i] + 1) * -1; \ _EST_base *= 128; \ } \ EST_step = _EST_i + 1; \ } while(FALSE) typedef struct { /* type of structure for an attribute database */ void *db; /* handle of the database */ int type; /* data type */ } ESTATTRIDX; enum { /* enumeration for character categories */ ESTSPACECHR, /* space characters */ ESTDELIMCHR, /* delimiter characters */ ESTWESTALPH, /* west alphabets */ ESTEASTALPH, /* east alphabets */ ESTHIRAGANA, /* east alphabets: hiragana */ ESTKATAKANA, /* east alphabets: katakana */ ESTHANGUL, /* east alphabets: hangul */ ESTKANJI /* east alphabets: kanji */ }; enum { /* enumeration for flags for databases */ ESTDFPERFNG = 1 << 10, /* use perfect N-gram analizer */ ESTDFCHRCAT = 1 << 11, /* use character category analizer */ ESTDFZLIB = 1 << 15, /* compress records with ZLIB */ ESTDFLZO = 1 << 16, /* compress records with LZO */ ESTDFBZIP = 1 << 17, /* compress records with BZIP2 */ ESTDFSCVOID = 1 << 20, /* store scores as void */ ESTDFSCINT = 1 << 21, /* store scores as integer */ ESTDFSCASIS = 1 << 22 /* refrain from adjustment of scores */ }; enum { /* enumration for phrase format */ ESTPMUSUAL, /* usual phrase */ ESTPMSIMPLE, /* simplified phrase */ ESTPMROUGH, /* rough phrase */ ESTPMUNION, /* union phrase */ ESTPMISECT /* intersection phrase */ }; typedef struct { /* type of structure for a hitting object */ int id; /* ID of a document */ int score; /* score tuned by TF-IDF */ char *value; /* value of an attribute for sorting */ } ESTSCORE; typedef struct { /* type of structure for a conditional attribute */ char *name; /* name */ int nsiz; /* size of the name */ CBLIST *nlist; /* list of plural names */ char *oper; /* operator */ char *val; /* value */ int vsiz; /* size of the value */ const char *cop; /* canonical operator */ int sign; /* positive or negative */ char *sval; /* value of small cases */ int ssiz; /* size of the small value */ void *regex; /* compiled regular expressions */ time_t num; /* numeric value */ } ESTCATTR; typedef struct { /* type of structure for a hitting object */ const char *word; /* face of keyword */ int wsiz; /* size of the keyword */ int pt; /* score tuned by TF-IDF */ } ESTKEYSC; typedef struct { /* type of structure for a meta hitting object */ int db; /* index of a container database */ int id; /* ID of a document */ int score; /* score tuned by TF-IDF */ char *value; /* value of an attribute for sorting */ } ESTMETASCORE; /* private function prototypes */ static void est_set_ecode(int *ecp, int value, int line); static char *est_hex_encode(const char *str); static char *est_hex_decode(const char *str); static int est_enc_miss(const char *ptr, int size, const char *icode, const char *ocode); static void est_normalize_text(unsigned char *utext, int size, int *sp); static void est_canonicalize_text(unsigned char *utext, int size, int funcspc); static int est_char_category(int c); static int est_char_category_perfng(int c); static int est_char_category_chrcat(int c); static char *est_make_snippet(const char *str, int len, const CBLIST *words, int wwidth, int hwidth, int awidth); static int est_check_cjk_only(const char *str); static char *est_phrase_from_simple(const char *sphrase); static char *est_phrase_from_rough(const char *rphrase); static char *est_phrase_from_union(const char *uphrase); static char *est_phrase_from_isect(const char *iphrase); static void est_snippet_add_text(const unsigned char *rtext, const unsigned char *ctext, int size, int awsiz, CBDATUM *res, const CBLIST *rwords); static int est_str_fwmatch_wide(const unsigned char *haystack, int hsiz, const unsigned char *needle, int nsiz); static char *est_strstr_sparse(const char *haystack, const char *needle); static int est_idx_rec_last_id(const char *vbuf, int vsiz, int smode); static void est_encode_idx_rec(CBDATUM *datum, const char *vbuf, int vsiz, int lid, int smode); static void est_decode_idx_rec(CBDATUM *datum, const char *vbuf, int vsiz, int smode); static ESTIDX *est_idx_open(const char *name, int omode, int dnum); static int est_idx_close(ESTIDX *idx); static void est_idx_set_tuning(ESTIDX *idx, int lrecmax, int nidxmax, int lcnum, int ncnum, int fbpsiz); static void est_idx_increment(ESTIDX *idx); static int est_idx_dnum(ESTIDX *idx); static int est_idx_add(ESTIDX *idx, const char *word, int wsiz, const char *vbuf, int vsiz, int smode); static int est_idx_put_one(ESTIDX *idx, int inum, const char *word, int wsiz, const char *vbuf, int vsiz); static int est_idx_out(ESTIDX *idx, const char *word, int wsiz); static char *est_idx_scan(ESTIDX *idx, const char *word, int wsiz, int *sp, int smode); static const char *est_idx_get_one(ESTIDX *idx, int inum, const char *word, int wsiz, int *sp); static int est_idx_vsiz(ESTIDX *idx, const char *word, int wsiz); static int est_idx_num(ESTIDX *idx); static double est_idx_size(ESTIDX *idx); static int est_idx_size_current(ESTIDX *idx); static int est_idx_memflush(ESTIDX *idx); static int est_idx_sync(ESTIDX *idx); static int est_idx_optimize(ESTIDX *idx); static void est_idx_set_current(ESTIDX *idx); static int est_crput(CURIA *curia, int zmode, int id, const char *vbuf, int vsiz, int dmode); static int est_crout(CURIA *curia, int id); static char *est_crget(CURIA *curia, int flags, int id, int *sp); static int est_aidx_seq_put(DEPOT *db, int id, const char *vbuf, int vsiz); static int est_aidx_seq_out(DEPOT *db, int id); static char *est_aidx_seq_get(DEPOT *db, int id, int *sp); static int est_aidx_seq_narrow(DEPOT *db, const CBLIST *pdocs, const char *cop, int sign, const char *oval, int osiz, const char *sval, int ssiz, const void *regex, int onum, ESTSCORE *scores, int snum, int limit, int *restp); static int est_aidx_numcmp(const char *aptr, int asiz, const char *bptr, int bsiz); static int est_aidx_attr_put(VILLA *db, int id, const char *vbuf, int vsiz); static int est_aidx_attr_out(VILLA *db, int id, const char *vbuf, int vsiz); static int est_aidx_attr_narrow(VILLA *db, const CBLIST *pdocs, const char *cop, int sign, const char *oval, int osiz, const char *sval, int ssiz, const void *regex, int onum, ESTSCORE *scores, int snum); static int est_int_compare(const void *ap, const void *bp); static int est_short_compare(const void *ap, const void *bp); static void est_inodes_delete(void *arg); static void est_inodes_delete_informer(const char *msg, void *opaque); static int est_db_write_meta(ESTDB *db); static void est_db_inform(ESTDB *db, const char *info); static void est_db_prepare_meta(ESTDB *db); static int est_db_score_doc(ESTDB *db, ESTDOC *doc, ESTCOND *cond, int *scp); static int est_pidx_uri_to_id(ESTDB *db, const char *uri); static CBLIST *est_phrase_terms(const char *phrase); static int est_score_compare_by_id_asc(const void *ap, const void *bp); static int est_score_compare_by_id_desc(const void *ap, const void *bp); static int est_score_compare_by_score_asc(const void *ap, const void *bp); static int est_score_compare_by_score_desc(const void *ap, const void *bp); static int est_score_compare_by_str_asc(const void *ap, const void *bp); static int est_score_compare_by_str_desc(const void *ap, const void *bp); static int est_score_compare_by_num_asc(const void *ap, const void *bp); static int est_score_compare_by_num_desc(const void *ap, const void *bp); static int est_metascore_compare_by_id_asc(const void *ap, const void *bp); static int est_metascore_compare_by_id_desc(const void *ap, const void *bp); static int est_metascore_compare_by_score_asc(const void *ap, const void *bp); static int est_metascore_compare_by_score_desc(const void *ap, const void *bp); static int est_metascore_compare_by_str_asc(const void *ap, const void *bp); static int est_metascore_compare_by_str_desc(const void *ap, const void *bp); static int est_metascore_compare_by_num_asc(const void *ap, const void *bp); static int est_metascore_compare_by_num_desc(const void *ap, const void *bp); static ESTSCORE *est_search_uvset(ESTDB *db, int *nump, CBMAP *hints, int add); static void est_expand_word_bw(ESTDB *db, const char *word, CBLIST *list); static void est_expand_word_ew(ESTDB *db, const char *word, CBLIST *list); static void est_expand_word_rx(ESTDB *db, const char *word, CBLIST *list); static void est_expand_keyword_bw(ESTDB *db, const char *word, CBLIST *list); static void est_expand_keyword_ew(ESTDB *db, const char *word, CBLIST *list); static void est_expand_keyword_rx(ESTDB *db, const char *word, CBLIST *list); static ESTSCORE *est_search_union(ESTDB *db, const char *term, int gstep, void (*xpn)(const char *, CBLIST *), int *nump, CBMAP *hints, int add, int auxmin, CBMAP *auxwords); static const ESTSCORE *est_rescc_get(ESTDB *db, const char *word, int size, int *nump); static void est_rescc_put(ESTDB *db, const char *word, int size, ESTSCORE *scores, int num); static ESTSCORE *est_search_keywords(ESTDB *db, const char *word, int min, int *nump); static void est_weight_keywords(ESTDB *db, const char *word, ESTSCORE *scores, int snum); static ESTSCORE *est_search_rank(ESTDB *db, const char *name, int top, int *nump); static ESTSCORE *est_search_aidx_attr(ESTDB *db, const char *expr, int *nump); static ESTSCORE *est_search_pidxs(ESTDB *db, ESTCOND *cond, ESTSCORE *scores, int *nump, CBMAP *ordattrs); static int est_narrow_scores(ESTDB *db, const CBLIST *attrs, int ign, const char *order, const char *distinct, ESTSCORE *scores, int snum, int limit, int *restp, CBMAP *ordattrs); static ESTCATTR *est_make_cattr_list(const CBLIST *attrs, int *nump); static void est_free_cattr_list(ESTCATTR *list, int anum); static int est_eclipse_scores(ESTDB *db, ESTSCORE *scores, int snum, int num, int vnum, int tfidf, double limit, CBMAP *shadows); static int est_match_attr(const char *tval, int tsiz, const char *cop, int sign, const char *oval, int osiz, const char *sval, int ssiz, const void *regex, int onum); static int est_check_strand(const char *tval, const char *oval); static int est_check_stror(const char *tval, const char *oval); static int est_check_stroreq(const char *tval, const char *oval); static int est_check_numbt(const char *tval, const char *oval); static int est_keysc_compare(const void *ap, const void *bp); static ESTSCORE *est_search_similar(ESTDB *db, CBMAP *svmap, int *nump, int knum, int unum, int mnum, int tfidf, double nmin, int auxmin, CBMAP *auxwords); static CBMAP *est_phrase_vector(const char *phrase); static CBMAP *est_get_tvmap(ESTDB *db, int id, int vnum, int tfidf); static int est_url_sameness(const char *aurl, const char *burl); static void est_random_fclose(void); static int est_signal_dispatch(int signum); /************************************************************************************************* * common settings *************************************************************************************************/ /* version of Hyper Estraier */ const char *est_version = _EST_VERSION; /************************************************************************************************* * API for document *************************************************************************************************/ /* Create a document object. */ ESTDOC *est_doc_new(void){ ESTDOC *doc; CB_MALLOC(doc, sizeof(ESTDOC)); doc->id = -1; doc->attrs = NULL; doc->dtexts = NULL; doc->kwords = NULL; return doc; } /* Create a document object made from draft data. */ ESTDOC *est_doc_new_from_draft(const char *draft){ ESTDOC *doc; CBLIST *lines; const char *line; char *pv, *rp, *ep; int i; assert(draft); doc = est_doc_new(); lines = cbsplit(draft, -1, "\n"); for(i = 0; i < CB_LISTNUM(lines); i++){ line = CB_LISTVAL(lines, i); while(*line > '\0' && *line <= ' '){ line++; } if(*line == '\0'){ i++; break; } if(*line == '%'){ if(cbstrfwmatch(line, ESTDCNTLVECTOR)){ if(!doc->kwords) doc->kwords = cbmapopenex(ESTMINIBNUM); if((rp = strchr(line, '\t')) != NULL) rp++; while(rp && (pv = strchr(rp, '\t')) != NULL){ pv++; if((ep = strchr(pv, '\t')) != NULL){ *ep = '\0'; ep++; } if(rp[0] != '\0' && pv[0] != '\0') cbmapput(doc->kwords, rp, pv - rp - 1, pv, -1, TRUE); rp = ep; } } else if(cbstrfwmatch(line, ESTDCNTLSCORE)){ if((rp = strchr(line, '\t')) != NULL) est_doc_set_score(doc, atoi(rp + 1)); } } else if((pv = strchr(line, '=')) != NULL){ *(pv++) = '\0'; est_doc_add_attr(doc, line, pv); } } for(; i < CB_LISTNUM(lines); i++){ line = CB_LISTVAL(lines, i); if(*line == '\t'){ est_doc_add_hidden_text(doc, line + 1); } else { est_doc_add_text(doc, line); } } CB_LISTCLOSE(lines); return doc; } /* Destroy a document object. */ void est_doc_delete(ESTDOC *doc){ assert(doc); if(doc->kwords) cbmapclose(doc->kwords); if(doc->dtexts) CB_LISTCLOSE(doc->dtexts); if(doc->attrs) cbmapclose(doc->attrs); free(doc); } /* Add an attribute to a document object. */ void est_doc_add_attr(ESTDOC *doc, const char *name, const char *value){ char *rbuf, *wp; int len; assert(doc && name); if(name[0] == '\0' || name[0] == '%') return; if(!doc->attrs) doc->attrs = cbmapopenex(ESTMINIBNUM); if(value){ rbuf = cbmemdup(value, -1); for(wp = rbuf; *wp != '\0'; wp++){ if(*wp > 0 && *wp < ' ') *wp = ' '; } cbstrsqzspc(rbuf); if((len = strlen(name)) > 0) cbmapput(doc->attrs, name, len, rbuf, -1, TRUE); free(rbuf); } else { cbmapout(doc->attrs, name, -1); } } /* Add a sentence of text to a document object. */ void est_doc_add_text(ESTDOC *doc, const char *text){ unsigned char *utext; char *rtext, *wp; int size; assert(doc && text); while(*text > '\0' && *text <= ' '){ text++; } if(text[0] == '\0') return; if(!doc->dtexts) CB_LISTOPEN(doc->dtexts); utext = (unsigned char *)est_uconv_in(text, strlen(text), &size); est_normalize_text(utext, size, &size); rtext = est_uconv_out((char *)utext, size, NULL); for(wp = rtext; *wp != '\0'; wp++){ if(*wp > 0 && *wp < ' ') *wp = ' '; } cbstrsqzspc(rtext); if(rtext[0] != '\0'){ CB_LISTPUSHBUF(doc->dtexts, rtext, strlen(rtext)); } else { free(rtext); } free(utext); } /* Add a hidden sentence to a document object. */ void est_doc_add_hidden_text(ESTDOC *doc, const char *text){ unsigned char *utext; char *rtext, *wp; int size; assert(doc && text); while(*text > '\0' && *text <= ' '){ text++; } if(text[0] == '\0') return; utext = (unsigned char *)est_uconv_in(text, strlen(text), &size); est_normalize_text(utext, size, &size); rtext = est_uconv_out((char *)utext, size, NULL); for(wp = rtext; *wp != '\0'; wp++){ if(*wp > 0 && *wp < ' ') *wp = ' '; } cbstrsqzspc(rtext); if(rtext[0] != '\0'){ if(!doc->attrs) doc->attrs = cbmapopenex(ESTMINIBNUM); if(cbmapget(doc->attrs, "", 0, NULL)) cbmapputcat(doc->attrs, "", 0, " ", 1); cbmapputcat(doc->attrs, "", 0, rtext, -1); } free(rtext); free(utext); } /* Attach keywords to a document object. */ void est_doc_set_keywords(ESTDOC *doc, CBMAP *kwords){ assert(doc && kwords); if(doc->kwords) cbmapclose(doc->kwords); doc->kwords = cbmapdup(kwords); } /* Set the substitute score of a document object. */ void est_doc_set_score(ESTDOC *doc, int score){ char numbuf[ESTNUMBUFSIZ]; assert(doc); if(!doc->attrs) doc->attrs = cbmapopenex(ESTMINIBNUM); if(score >= 0){ sprintf(numbuf, "%d", score); cbmapput(doc->attrs, "\t", 1, numbuf, -1, TRUE); } else { cbmapout(doc->attrs, "\t", 1); } } /* Get the ID number of a document object. */ int est_doc_id(ESTDOC *doc){ assert(doc); return doc->id; } /* Get a list of attribute names of a document object. */ CBLIST *est_doc_attr_names(ESTDOC *doc){ CBLIST *names; const char *kbuf; int ksiz; assert(doc); if(!doc->attrs){ CB_LISTOPEN(names); return names; } CB_LISTOPEN(names); cbmapiterinit(doc->attrs); while((kbuf = cbmapiternext(doc->attrs, &ksiz)) != NULL){ if(ksiz > 0 && kbuf[0] != '\t') CB_LISTPUSH(names, kbuf, ksiz); } cblistsort(names); return names; } /* Get the value of an attribute of a document object. */ const char *est_doc_attr(ESTDOC *doc, const char *name){ assert(doc && name); if(!doc->attrs || name[0] == '\0') return NULL; return cbmapget(doc->attrs, name, -1, NULL); } /* Get a list of sentences of the text of a document object. */ const CBLIST *est_doc_texts(ESTDOC *doc){ assert(doc); if(!doc->dtexts) CB_LISTOPEN(doc->dtexts); return doc->dtexts; } /* Concatenate sentences of the text of a document object. */ char *est_doc_cat_texts(ESTDOC *doc){ CBDATUM *datum; const char *elem; int i, size; if(!doc->dtexts) return cbmemdup("", 0); CB_DATUMOPEN(datum); for(i = 0; i < CB_LISTNUM(doc->dtexts); i++){ elem = CB_LISTVAL2(doc->dtexts, i, size); if(i > 0) CB_DATUMCAT(datum, " ", 1); CB_DATUMCAT(datum, elem, size); } return cbdatumtomalloc(datum, NULL); } /* Get attached keywords of a document object. */ CBMAP *est_doc_keywords(ESTDOC *doc){ assert(doc); return doc->kwords; } /* Get the substitute score of a document object. */ int est_doc_score(ESTDOC *doc){ const char *vbuf; assert(doc); if(doc->attrs && (vbuf = cbmapget(doc->attrs, "\t", 1, NULL)) != NULL) return atoi(vbuf); return -1; } /* Dump draft data of a document object. */ char *est_doc_dump_draft(ESTDOC *doc){ CBLIST *list; CBDATUM *datum; const char *kbuf, *vbuf; int i, ksiz, vsiz; assert(doc); CB_DATUMOPEN(datum); if(doc->attrs){ list = est_doc_attr_names(doc); for(i = 0; i < CB_LISTNUM(list); i++){ kbuf = CB_LISTVAL2(list, i, ksiz); vbuf = cbmapget(doc->attrs, kbuf, ksiz, &vsiz); CB_DATUMCAT(datum, kbuf, ksiz); CB_DATUMCAT(datum, "=", 1); CB_DATUMCAT(datum, vbuf, vsiz); CB_DATUMCAT(datum, "\n", 1); } CB_LISTCLOSE(list); } if(doc->kwords && cbmaprnum(doc->kwords) > 0){ CB_DATUMCAT(datum, ESTDCNTLVECTOR, strlen(ESTDCNTLVECTOR)); cbmapiterinit(doc->kwords); while((kbuf = cbmapiternext(doc->kwords, &ksiz)) != NULL){ CB_MAPITERVAL(vbuf, kbuf, vsiz); CB_DATUMCAT(datum, "\t", 1); CB_DATUMCAT(datum, kbuf, ksiz); CB_DATUMCAT(datum, "\t", 1); CB_DATUMCAT(datum, vbuf, vsiz); } CB_DATUMCAT(datum, "\n", 1); } if(doc->attrs && (vbuf = cbmapget(doc->attrs, "\t", 1, &vsiz)) != NULL){ CB_DATUMCAT(datum, ESTDCNTLSCORE, strlen(ESTDCNTLSCORE)); CB_DATUMCAT(datum, "\t", 1); CB_DATUMCAT(datum, vbuf, vsiz); CB_DATUMCAT(datum, "\n", 1); } CB_DATUMCAT(datum, "\n", 1); if(doc->dtexts){ for(i = 0; i < CB_LISTNUM(doc->dtexts); i++){ kbuf = CB_LISTVAL2(doc->dtexts, i, ksiz); CB_DATUMCAT(datum, kbuf, ksiz); CB_DATUMCAT(datum, "\n", 1); } } if(doc->attrs && (vbuf = cbmapget(doc->attrs, "", 0, &vsiz)) != NULL){ CB_DATUMCAT(datum, "\t", 1); CB_DATUMCAT(datum, vbuf, vsiz); CB_DATUMCAT(datum, "\n", 1); } return cbdatumtomalloc(datum, NULL); } /* Make a snippet of the body text of a document object. */ char *est_doc_make_snippet(ESTDOC *doc, const CBLIST *words, int wwidth, int hwidth, int awidth){ CBDATUM *sbuf; const char *text; char *snippet; int i, size; assert(doc && words && wwidth >= 0 && hwidth >= 0 && awidth >= 0); if(!doc->dtexts) CB_LISTOPEN(doc->dtexts); CB_DATUMOPEN(sbuf); for(i = 0; i < CB_LISTNUM(doc->dtexts); i++){ text = CB_LISTVAL2(doc->dtexts, i, size); if(i > 0) CB_DATUMCAT(sbuf, " ", 1); CB_DATUMCAT(sbuf, text, size); } snippet = est_make_snippet(CB_DATUMPTR(sbuf), CB_DATUMSIZE(sbuf), words, wwidth, hwidth, awidth); CB_DATUMCLOSE(sbuf); return snippet; } /************************************************************************************************* * API for search conditions *************************************************************************************************/ /* Create a condition object. */ ESTCOND *est_cond_new(void){ ESTCOND *cond; CB_MALLOC(cond, sizeof(ESTCOND)); cond->phrase = NULL; cond->gstep = 2; cond->tfidf = TRUE; cond->pmode = ESTPMUSUAL; cond->cbxpn = NULL; cond->attrs = NULL; cond->order = NULL; cond->max = -1; cond->skip = 0; cond->auxmin = ESTAUXMIN; cond->auxwords = NULL; cond->scfb = FALSE; cond->scores = NULL; cond->snum = 0; cond->nscores = NULL; cond->nsnum = -1; cond->opts = 0; cond->ecllim = -1.0; cond->shadows = NULL; cond->distinct = NULL; cond->mask = 0; return cond; } /* Destroy a condition object. */ void est_cond_delete(ESTCOND *cond){ assert(cond); if(cond->distinct) free(cond->distinct); if(cond->shadows) cbmapclose(cond->shadows); if(cond->auxwords) cbmapclose(cond->auxwords); if(cond->scores) free(cond->scores); if(cond->order) free(cond->order); if(cond->attrs) CB_LISTCLOSE(cond->attrs); if(cond->phrase) free(cond->phrase); free(cond); } /* Set a search phrase to a condition object. */ void est_cond_set_phrase(ESTCOND *cond, const char *phrase){ assert(cond && phrase); if(cond->phrase) free(cond->phrase); while(*phrase > '\0' && *phrase <= ' '){ phrase++; } cond->phrase = cbmemdup(phrase, -1); } /* Add a condition of an attribute fo a condition object. */ void est_cond_add_attr(ESTCOND *cond, const char *expr){ assert(cond && expr); while(*expr > '\0' && *expr <= ' '){ expr++; } if(*expr == '\0') return; if(!cond->attrs) CB_LISTOPEN(cond->attrs); CB_LISTPUSH(cond->attrs, expr, strlen(expr)); } /* Set the order of a condition object. */ void est_cond_set_order(ESTCOND *cond, const char *expr){ assert(cond && expr); while(*expr > '\0' && *expr <= ' '){ expr++; } if(*expr == '\0') return; if(cond->order) free(cond->order); cond->order = cbmemdup(expr, -1); } /* Set the maximum number of retrieval of a condition object. */ void est_cond_set_max(ESTCOND *cond, int max){ assert(cond && max >= 0); cond->max = max; } /* Set the number of skipped documents of a condition object. */ void est_cond_set_skip(ESTCOND *cond, int skip){ assert(cond && skip >= 0); cond->skip = skip; } /* Set options of retrieval of a condition object. */ void est_cond_set_options(ESTCOND *cond, int options){ assert(cond); if(options & ESTCONDSURE) cond->gstep = 1; if(options & ESTCONDUSUAL) cond->gstep = 2; if(options & ESTCONDFAST) cond->gstep = 3; if(options & ESTCONDAGITO) cond->gstep = 4; if(options & ESTCONDNOIDF) cond->tfidf = FALSE; if(options & ESTCONDSIMPLE) cond->pmode = ESTPMSIMPLE; if(options & ESTCONDROUGH) cond->pmode = ESTPMROUGH; if(options & ESTCONDUNION) cond->pmode = ESTPMUNION; if(options & ESTCONDISECT) cond->pmode = ESTPMISECT; if(options & ESTCONDSCFB) cond->scfb = TRUE; cond->opts |= options; } /* Set permission to adopt result of the auxiliary index. */ void est_cond_set_auxiliary(ESTCOND *cond, int min){ assert(cond); cond->auxmin = min; } /* Set the upper limit of similarity for document eclipse. */ void est_cond_set_eclipse(ESTCOND *cond, double limit){ assert(cond); if(limit > 0.0) cond->ecllim = limit; } /* Set the attribute distinction filter. */ void est_cond_set_distinct(ESTCOND *cond, const char *name){ assert(cond && name); while(*name > '\0' && *name <= ' '){ name++; } if(*name == '\0') return; if(cond->distinct) free(cond->distinct); cond->distinct = cbmemdup(name, -1); } /* Set the mask of targets of meta search. */ void est_cond_set_mask(ESTCOND *cond, int mask){ assert(cond); cond->mask = mask & INT_MAX; } /************************************************************************************************* * API for database *************************************************************************************************/ /* Inode map for duplication check. */ CBMAP *est_inodes = NULL; /* Get the string of an error code. */ const char *est_err_msg(int ecode){ switch(ecode){ case ESTENOERR: return "no error"; case ESTEINVAL: return "invalid argument"; case ESTEACCES: return "access forbidden"; case ESTELOCK: return "lock failure"; case ESTEDB: return "database problem"; case ESTEIO: return "I/O problem"; case ESTENOITEM: return "no such item"; default: break; } return "miscellaneous"; } /* Open a database. */ ESTDB *est_db_open(const char *name, int omode, int *ecp){ ESTDB *db; DEPOT *metadb; ESTIDX *idxdb; CURIA *attrdb, *textdb, *kwddb; VILLA *fwmdb, *auxdb, *xfmdb, *listdb; CBMAP *aidxs; CBLIST *list; ESTATTRIDX attridx; void *aidxdb; const char *elem; char path[ESTPATHBUFSIZ], vbuf[ESTNUMBUFSIZ], *dec; int i, inode, domode, comode, vomode, flags, idxnum, dseq, dnum; int amode, zmode, smode, vsiz, type, crdnum; double bdiam, ddiam; assert(name && ecp); if(!est_inodes){ est_inodes = cbmapopenex(ESTMINIBNUM); cbglobalgc(est_inodes, est_inodes_delete); } est_set_ecode(ecp, ESTENOERR, __LINE__); if((omode & ESTDBWRITER) && (omode & ESTDBCREAT) && !est_mkdir(name)){ switch(errno){ case EACCES: est_set_ecode(ecp, ESTEACCES, __LINE__); return NULL; case EEXIST: break; default: est_set_ecode(ecp, ESTEIO, __LINE__); return NULL; } } if((inode = est_inode(name)) < 1){ est_set_ecode(ecp, ESTEIO, __LINE__); return NULL; } if(cbmapget(est_inodes, (char *)&inode, sizeof(int), NULL) && !(omode & ESTDBNOLCK)){ est_set_ecode(ecp, ESTEACCES, __LINE__); return NULL; } domode = DP_OREADER; comode = CR_OREADER; vomode = VL_OREADER; if(omode & ESTDBWRITER){ domode = DP_OWRITER; comode = CR_OWRITER; vomode = VL_OWRITER; if(ESTUSEBZIP){ vomode |= VL_OXCOMP; } else if(ESTUSELZO){ vomode |= VL_OYCOMP; } else if(ESTUSEZLIB){ vomode |= VL_OZCOMP; } if(omode & ESTDBCREAT){ domode |= DP_OCREAT; comode |= CR_OCREAT; vomode |= VL_OCREAT; } if(omode & ESTDBTRUNC){ domode |= DP_OTRUNC; comode |= CR_OTRUNC; vomode |= VL_OTRUNC; } } if(omode & ESTDBNOLCK){ domode |= DP_ONOLCK; comode |= CR_ONOLCK; vomode |= VL_ONOLCK; } if(omode & ESTDBLCKNB){ domode |= DP_OLCKNB; comode |= CR_OLCKNB; vomode |= VL_OLCKNB; } flags = 0; idxnum = 0; dseq = 0; dnum = 0; amode = 0; zmode = 0; smode = 0; if(omode & ESTDBSMALL){ bdiam = ESTDBSBRAT; ddiam = ESTDBSDRAT; } else if(omode & ESTDBLARGE){ bdiam = ESTDBLBRAT; ddiam = ESTDBLDRAT; } else if(omode & ESTDBHUGE){ bdiam = ESTDBHBRAT; ddiam = ESTDBHDRAT; } else if(omode & ESTDBHUGE2){ bdiam = ESTDBHBRAT * ESTDBH2RAT; ddiam = ESTDBHDRAT * ESTDBH2RAT; } else if(omode & ESTDBHUGE3){ bdiam = ESTDBHBRAT * ESTDBH3RAT; ddiam = ESTDBHDRAT * ESTDBH3RAT; } else { bdiam = 1.0; ddiam = 1.0; } sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTMETADBNAME); if((metadb = dpopen(path, domode, ESTMINIBNUM)) != NULL){ flags = dpgetflags(metadb); if(dprnum(metadb) < 1){ if(omode & ESTDBPERFNG){ flags |= ESTDFPERFNG; } else if(omode & ESTDBCHRCAT){ flags |= ESTDFCHRCAT; } if(ESTUSEBZIP){ flags |= ESTDFBZIP; } else if(ESTUSELZO){ flags |= ESTDFLZO; } else if(ESTUSEZLIB){ flags |= ESTDFZLIB; } if(omode & ESTDBSCVOID){ flags |= ESTDFSCVOID; } else if(omode & ESTDBSCINT){ flags |= ESTDFSCINT; } else if(omode & ESTDBSCASIS){ flags |= ESTDFSCASIS; } dpsetflags(metadb, flags); } if((vsiz = dpgetwb(metadb, ESTKEYIDXNUM, -1, 0, ESTNUMBUFSIZ - 1, vbuf)) > 0){ vbuf[vsiz] = '\0'; idxnum = atoi(vbuf); } if((vsiz = dpgetwb(metadb, ESTKEYDSEQ, -1, 0, ESTNUMBUFSIZ - 1, vbuf)) > 0){ vbuf[vsiz] = '\0'; dseq = atoi(vbuf); } if((vsiz = dpgetwb(metadb, ESTKEYDNUM, -1, 0, ESTNUMBUFSIZ - 1, vbuf)) > 0){ vbuf[vsiz] = '\0'; dnum = atoi(vbuf); } if(flags & ESTDFPERFNG){ amode = ESTDFPERFNG; } else if(flags & ESTDFCHRCAT){ amode = ESTDFCHRCAT; } if(flags & ESTDFZLIB){ zmode = ESTDFZLIB; } else if(flags & ESTDFLZO){ zmode = ESTDFLZO; } else if(flags & ESTDFBZIP){ zmode = ESTDFBZIP; } if(flags & ESTDFSCVOID){ smode = ESTDFSCVOID; } else if(flags & ESTDFSCINT){ smode = ESTDFSCINT; } else if(flags & ESTDFSCASIS){ smode = ESTDFSCASIS; } } else { est_set_ecode(ecp, dpecode == DP_ELOCK ? ESTELOCK : ESTEDB, __LINE__); return NULL; } if(idxnum < 1) idxnum = 1; if(dseq < 0) dseq = 0; if(dnum < 0) dnum = 0; crdnum = vlcrdnum; sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTIDXDBNAME); idxdb = est_idx_open(path, vomode, idxnum); sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTFWMDBNAME); vlcrdnum = ESTVLCRDNUM; fwmdb = vlopen(path, vomode, VL_CMPLEX); sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTAUXDBNAME); vlcrdnum = ESTVLCRDNAUX; auxdb = vlopen(path, vomode, VL_CMPLEX); sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTXFMDBNAME); vlcrdnum = ESTVLCRDNUM; xfmdb = vlopen(path, vomode, VL_CMPLEX); sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTATTRDBNAME); attrdb = cropen(path, comode, ESTATTRDBBNUM * bdiam, ESTATTRDBDNUM * ddiam); sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTTEXTDBNAME); textdb = cropen(path, comode, ESTTEXTDBBNUM * bdiam, ESTTEXTDBDNUM * ddiam); sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTKWDDBNAME); kwddb = cropen(path, comode, ESTKWDDBBNUM * bdiam, ESTKWDDBDNUM * ddiam); sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTLISTDBNAME); vlcrdnum = ESTVLCRDNUM; listdb = vlopen(path, vomode, VL_CMPLEX); vlcrdnum = crdnum; if(!idxdb || !fwmdb || !auxdb || !xfmdb || !attrdb ||!textdb || !kwddb || !listdb){ if(listdb) vlclose(listdb); if(kwddb) crclose(kwddb); if(textdb) crclose(textdb); if(attrdb) crclose(attrdb); if(xfmdb) vlclose(xfmdb); if(auxdb) vlclose(auxdb); if(fwmdb) vlclose(fwmdb); if(idxdb) est_idx_close(idxdb); dpclose(metadb); est_set_ecode(ecp, ESTEDB, __LINE__); return NULL; } if(omode & ESTDBWRITER){ est_idx_set_tuning(idxdb, amode == ESTDFPERFNG ? ESTIDXDBLRMA : ESTIDXDBLRM, ESTIDXDBNIM, ESTIDXDBLCN, ESTIDXDBNCN, ESTIDXDBFBP); est_idx_set_current(idxdb); vlsettuning(fwmdb, ESTFWMDBLRM, ESTFWMDBNIM, ESTFWMDBLCN, ESTFWMDBNCN); vlsetfbpsiz(fwmdb, ESTFWMDBFBP); vlsettuning(auxdb, ESTAUXDBLRM, ESTAUXDBNIM, ESTAUXDBLCN, ESTAUXDBNCN); vlsetfbpsiz(auxdb, ESTAUXDBFBP); vlsettuning(xfmdb, ESTXFMDBLRM, ESTXFMDBNIM, ESTXFMDBLCN, ESTXFMDBNCN); vlsetfbpsiz(xfmdb, ESTXFMDBFBP); crsetalign(attrdb, ESTATTRDBALN); crsetfbpsiz(attrdb, ESTATTRDBFBP); crsetalign(textdb, ESTTEXTDBALN); crsetfbpsiz(textdb, ESTTEXTDBFBP); crsetalign(kwddb, ESTKWDDBALN); crsetfbpsiz(kwddb, ESTKWDDBFBP); vlsettuning(listdb, ESTLISTDBLRM, ESTLISTDBNIM, ESTLISTDBLCN, ESTLISTDBNCN); vlsetfbpsiz(listdb, ESTLISTDBFBP); } else { est_idx_set_tuning(idxdb, -1, -1, amode == ESTDFPERFNG ? ESTIDXDBRLCNA : ESTIDXDBRLCN, ESTIDXDBRNCN, -1); vlsettuning(fwmdb, -1, -1, ESTFWMDBLCN, ESTFWMDBNCN); vlsettuning(auxdb, -1, -1, ESTAUXDBRLCN, ESTAUXDBRNCN); vlsettuning(xfmdb, -1, -1, ESTXFMDBLCN, ESTXFMDBNCN); vlsettuning(listdb, -1, -1, ESTLISTDBLCN, ESTLISTDBNCN); } if((omode & ESTDBWRITER) && (omode & ESTDBTRUNC) && (list = cbdirlist(name)) != NULL){ for(i = 0; i < CB_LISTNUM(list); i++){ elem = CB_LISTVAL(list, i); if(cbstrfwmatch(elem, ESTAISEQPREF) || cbstrfwmatch(elem, ESTAISTRPREF) || cbstrfwmatch(elem, ESTAINUMPREF)){ sprintf(path, "%s%c%s", name, ESTPATHCHR, elem); if(unlink(path) == -1) est_rmdir_rec(path); } } CB_LISTCLOSE(list); } aidxs = cbmapopenex(ESTMINIBNUM); if((list = cbdirlist(name)) != NULL){ for(i = 0; i < CB_LISTNUM(list); i++){ elem = CB_LISTVAL(list, i); dec = NULL; type = -1; if(cbstrfwmatch(elem, ESTAISEQPREF)){ dec = est_hex_decode(elem + strlen(ESTAISEQPREF)); type = ESTIDXATTRSEQ; } else if(cbstrfwmatch(elem, ESTAISTRPREF)){ dec = est_hex_decode(elem + strlen(ESTAISTRPREF)); type = ESTIDXATTRSTR; } else if(cbstrfwmatch(elem, ESTAINUMPREF)){ dec = est_hex_decode(elem + strlen(ESTAINUMPREF)); type = ESTIDXATTRNUM; } if(dec){ sprintf(path, "%s%c%s", name, ESTPATHCHR, elem); switch(type){ case ESTIDXATTRSTR: if((aidxdb = vlopen(path, vomode, VL_CMPLEX)) != NULL){ vlsettuning(aidxdb, ESTAIDXLRM, ESTAIDXNIM, ESTAIDXLCN, ESTAIDXNCN); vlsetfbpsiz(aidxdb, ESTAIDXVLFBP); attridx.db = aidxdb; attridx.type = type; cbmapput(aidxs, dec, -1, (char *)&attridx, sizeof(ESTATTRIDX), FALSE); } break; case ESTIDXATTRNUM: if((aidxdb = vlopen(path, vomode, est_aidx_numcmp)) != NULL){ vlsettuning(aidxdb, ESTAIDXLRM, ESTAIDXNIM, ESTAIDXLCN, ESTAIDXNCN); vlsetfbpsiz(aidxdb, ESTAIDXVLFBP); attridx.db = aidxdb; attridx.type = type; cbmapput(aidxs, dec, -1, (char *)&attridx, sizeof(ESTATTRIDX), FALSE); } break; default: if((aidxdb = dpopen(path, domode, crbnum(attrdb) / ESTAIBDIAM)) != NULL){ dpsetfbpsiz(aidxdb, ESTAIDXDPFBP); attridx.db = aidxdb; attridx.type = type; cbmapput(aidxs, dec, -1, (char *)&attridx, sizeof(ESTATTRIDX), FALSE); } break; } free(dec); } } CB_LISTCLOSE(list); } CB_MALLOC(db, sizeof(ESTDB)); db->name = cbmemdup(name, -1); db->inode = inode; db->metadb = metadb; db->idxdb = idxdb; db->fwmdb = fwmdb; db->auxdb = auxdb; db->xfmdb = xfmdb; db->attrdb = attrdb; db->textdb = textdb; db->kwddb = kwddb; db->listdb = listdb; db->aidxs = aidxs; CB_LISTOPEN(db->pdocs); db->puris = NULL; est_set_ecode(&(db->ecode), ESTENOERR, __LINE__); db->fatal = FALSE; db->dseq = dseq; db->dnum = dnum; db->amode = amode; db->zmode = zmode; db->smode = smode; if(omode & ESTDBWRITER){ db->idxcc = cbmapopenex(ESTIDXCCBNUM); db->auxcc = cbmapopenex(ESTAUXCCBNUM); db->icsiz = 0; db->icmax = ESTIDXCCMAX; db->outcc = cbmapopenex(ESTOUTCCBNUM); } else { db->idxcc = cbmapopenex(1); db->auxcc = cbmapopenex(1); db->icsiz = 0; db->icmax = 0; db->outcc = cbmapopenex(1); } db->keycc = cbmapopenex(ESTKEYCCMNUM + 1); db->kcmnum = ESTKEYCCMNUM; db->attrcc = cbmapopenex(ESTATTRCCMNUM + 1); db->acmnum = ESTATTRCCMNUM; db->textcc = cbmapopenex(ESTTEXTCCMNUM + 1); db->tcmnum = ESTTEXTCCMNUM; db->veccc = cbmapopenex(ESTATTRCCMNUM / 2 + 1); db->vcmnum = ESTATTRCCMNUM / 2; db->rescc = cbmapopenex(ESTRESCCMNUM * 2 + 1); db->rcmnum = ESTRESCCMNUM; db->spacc = NULL; db->scmnum = 0; db->scname = NULL; db->infocb = NULL; db->infoop = NULL; db->dfdb = NULL; db->metacc = NULL; db->wildmax = ESTWILDMAX; db->flsflag = FALSE; db->intflag = FALSE; cbmapput(est_inodes, (char *)&inode, sizeof(int), (char *)&db, sizeof(ESTDB *), FALSE); return db; } /* Close a database. */ int est_db_close(ESTDB *db, int *ecp){ ESTATTRIDX *attridx; const char *kbuf; int err; assert(db && ecp); est_set_ecode(ecp, ESTENOERR, __LINE__); err = FALSE; cbmapout(est_inodes, (char *)&(db->inode), sizeof(int)); if(dpwritable(db->metadb)){ if(!est_db_flush(db, -1)) err = TRUE; if(!est_db_write_meta(db)) err = TRUE; } est_db_inform(db, "closing"); if(db->metacc) cbmapclose(db->metacc); if(db->spacc){ free(db->scname); cbmapclose(db->spacc); } cbmapclose(db->rescc); cbmapclose(db->veccc); cbmapclose(db->textcc); cbmapclose(db->attrcc); cbmapclose(db->keycc); cbmapclose(db->outcc); cbmapclose(db->auxcc); cbmapclose(db->idxcc); if(db->puris) cbmapclose(db->puris); CB_LISTCLOSE(db->pdocs); cbmapiterinit(db->aidxs); while((kbuf = cbmapiternext(db->aidxs, NULL)) != NULL){ attridx = (ESTATTRIDX *)cbmapiterval(kbuf, NULL); switch(attridx->type){ case ESTIDXATTRSTR: case ESTIDXATTRNUM: if(!vlclose(attridx->db)) err = TRUE; break; default: if(!dpclose(attridx->db)) err = TRUE; break; } } cbmapclose(db->aidxs); if(!vlclose(db->listdb)) err = TRUE; if(!crclose(db->kwddb)) err = TRUE; if(!crclose(db->textdb)) err = TRUE; if(!crclose(db->attrdb)) err = TRUE; if(!vlclose(db->xfmdb)) err = TRUE; if(!vlclose(db->auxdb)) err = TRUE; if(!vlclose(db->fwmdb)) err = TRUE; if(!est_idx_close(db->idxdb)) err = TRUE; if(!dpclose(db->metadb)) err = TRUE; free(db->name); if(db->fatal){ est_set_ecode(ecp, db->ecode, __LINE__); err = TRUE; } else if(err){ est_set_ecode(ecp, ESTEDB, __LINE__); } free(db); return err ? FALSE : TRUE; } /* Get the last happended error code of a database. */ int est_db_error(ESTDB *db){ assert(db); return db->ecode; } /* Check whether a database has a fatal error. */ int est_db_fatal(ESTDB *db){ assert(db); return db->fatal; } /* Add an index for narrowing or sorting with document attributes. */ int est_db_add_attr_index(ESTDB *db, const char *name, int type){ ESTATTRIDX attridx; ESTSCORE *scores; void *aidxdb; char path[ESTPATHBUFSIZ], *enc, *vbuf; int i, domode, vomode, crdnum, err, snum; assert(db && name); if(!dpwritable(db->metadb)){ est_set_ecode(&(db->ecode), ESTEACCES, __LINE__); return FALSE; } if(cbmapget(db->aidxs, name, -1, NULL)){ est_set_ecode(&(db->ecode), ESTEMISC, __LINE__); return FALSE; } enc = est_hex_encode(name); switch(type){ case ESTIDXATTRSEQ: sprintf(path, "%s%c%s%s", db->name, ESTPATHCHR, ESTAISEQPREF, enc); break; case ESTIDXATTRSTR: sprintf(path, "%s%c%s%s", db->name, ESTPATHCHR, ESTAISTRPREF, enc); break; case ESTIDXATTRNUM: sprintf(path, "%s%c%s%s", db->name, ESTPATHCHR, ESTAINUMPREF, enc); break; default: free(enc); est_set_ecode(&(db->ecode), ESTEINVAL, __LINE__); return FALSE; } free(enc); domode = DP_OWRITER | DP_OCREAT | DP_OTRUNC; vomode = VL_OWRITER | VL_OCREAT | VL_OTRUNC; if(ESTUSEBZIP){ vomode |= VL_OXCOMP; } else if(ESTUSELZO){ vomode |= VL_OYCOMP; } else if(ESTUSEZLIB){ vomode |= VL_OZCOMP; } err = FALSE; crdnum = vlcrdnum; switch(type){ case ESTIDXATTRSTR: vlcrdnum = ESTVLCRDNUM; if(!(aidxdb = vlopen(path, vomode, VL_CMPLEX))){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); vlcrdnum = crdnum; return FALSE; } vlsettuning(aidxdb, ESTAIDXLRM, ESTAIDXNIM, ESTAIDXLCN, ESTAIDXNCN); vlsetfbpsiz(aidxdb, ESTAIDXVLFBP); if(est_db_doc_num(db) > 0){ scores = est_search_uvset(db, &snum, NULL, TRUE); for(i = 0; i < snum; i++){ if((vbuf = est_db_get_doc_attr(db, scores[i].id, name)) != NULL){ if(!est_aidx_attr_put(aidxdb, scores[i].id, vbuf, strlen(vbuf))){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } free(vbuf); } if(i % (ESTCCCBFREQ / 10) == 0) est_db_inform(db, "entering existing attributes"); } free(scores); } break; case ESTIDXATTRNUM: vlcrdnum = ESTVLCRDNUM; if(!(aidxdb = vlopen(path, vomode, est_aidx_numcmp))){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); vlcrdnum = crdnum; return FALSE; } vlsettuning(aidxdb, ESTAIDXLRM, ESTAIDXNIM, ESTAIDXLCN, ESTAIDXNCN); vlsetfbpsiz(aidxdb, ESTAIDXVLFBP); if(est_db_doc_num(db) > 0){ scores = est_search_uvset(db, &snum, NULL, TRUE); for(i = 0; i < snum; i++){ if((vbuf = est_db_get_doc_attr(db, scores[i].id, name)) != NULL){ if(!est_aidx_attr_put(aidxdb, scores[i].id, vbuf, strlen(vbuf))){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } free(vbuf); } if(i % (ESTCCCBFREQ / 10) == 0) est_db_inform(db, "entering existing attributes"); } free(scores); } break; default: if(!(aidxdb = dpopen(path, domode, crbnum(db->attrdb) * ESTAIBDIAM))){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); vlcrdnum = crdnum; return FALSE; } dpsetfbpsiz(aidxdb, ESTAIDXDPFBP); if(est_db_doc_num(db) > 0){ scores = est_search_uvset(db, &snum, NULL, TRUE); for(i = 0; i < snum; i++){ if((vbuf = est_db_get_doc_attr(db, scores[i].id, name)) != NULL){ if(!est_aidx_seq_put(aidxdb, scores[i].id, vbuf, strlen(vbuf))){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } free(vbuf); } if(i % (ESTCCCBFREQ / 10) == 0) est_db_inform(db, "entering existing attributes"); } free(scores); } break; } vlcrdnum = crdnum; attridx.db = aidxdb; attridx.type = type; cbmapput(db->aidxs, name, -1, (char *)&attridx, sizeof(ESTATTRIDX), FALSE); return err ? FALSE : TRUE; } /* Flush index words in the cache of a database. */ int est_db_flush(ESTDB *db, int max){ ESTATTRIDX *attridx; CBMAP *ids; CBLIST *keys; CBDATUM *nval; const char *kbuf, *vbuf, *rp, *pv, *ep; char *tbuf, *wp, numbuf[ESTNUMBUFSIZ]; int i, j, inc, err, ksiz, vsiz, rnum, len, id, sum, cid, vnum, lid, dnum, tsiz, vstep; assert(db); if(!dpwritable(db->metadb)){ est_set_ecode(&(db->ecode), ESTEACCES, __LINE__); return FALSE; } if(max < 1 || max >= INT_MAX){ if(!est_db_write_meta(db)) err = TRUE; if(!dpmemflush(db->metadb)) err = TRUE; if(!crmemflush(db->attrdb)) err = TRUE; if(!crmemflush(db->textdb)) err = TRUE; if(!crmemflush(db->kwddb)) err = TRUE; if(!vlmemflush(db->listdb)) err = TRUE; cbmapiterinit(db->aidxs); while((kbuf = cbmapiternext(db->aidxs, NULL)) != NULL){ attridx = (ESTATTRIDX *)cbmapiterval(kbuf, NULL); switch(attridx->type){ case ESTIDXATTRSTR: case ESTIDXATTRNUM: if(!vlmemflush(attridx->db)) err = TRUE; break; default: if(!dpmemflush(attridx->db)) err = TRUE; break; } } } if(cbmaprnum(db->idxcc) < 1 && cbmaprnum(db->auxcc) < 1 && cbmaprnum(db->outcc) < 1) return TRUE; db->flsflag = TRUE; db->intflag = FALSE; inc = est_db_used_cache_size(db) > db->icmax; err = FALSE; CB_LISTOPEN(keys); cbmapiterinit(db->idxcc); while((kbuf = cbmapiternext(db->idxcc, &ksiz)) != NULL){ CB_LISTPUSH(keys, kbuf, ksiz); } rnum = CB_LISTNUM(keys); cblistsort(keys); if(max > 0){ while(CB_LISTNUM(keys) > max){ CB_LISTDROP(keys); } } for(i = 0; i < CB_LISTNUM(keys); i++){ kbuf = CB_LISTVAL2(keys, i, ksiz); vbuf = cbmapget(db->idxcc, kbuf, ksiz, &vsiz); if(!est_idx_add(db->idxdb, kbuf, ksiz, vbuf, vsiz, db->smode) || (!vlput(db->fwmdb, kbuf, ksiz, "", 0, VL_DKEEP) && dpecode != DP_EKEEP)){ err = TRUE; break; } cbmapout(db->idxcc, kbuf, ksiz); db->icsiz -= vsiz; if(i % ESTCCCBFREQ == 0){ est_db_inform(db, "flushing index words"); if(est_idx_size_current(db->idxdb) >= ESTIDXDBMAX){ est_db_inform(db, "adding a new database file"); est_idx_increment(db->idxdb); inc = FALSE; } } if(max > 0 && db->intflag && i > 0 && i % ESTCCIRSLOT == 0) break; } CB_LISTCLOSE(keys); if(cbmaprnum(db->idxcc) < 1){ cbmapclose(db->idxcc); db->idxcc = cbmapopenex(rnum > ESTIDXCCBNUM ? rnum * 1.5 : ESTIDXCCBNUM); if(cbmaprnum(db->auxcc) > 0){ CB_LISTOPEN(keys); cbmapiterinit(db->auxcc); while((kbuf = cbmapiternext(db->auxcc, &ksiz)) != NULL){ CB_LISTPUSH(keys, kbuf, ksiz); } cblistsort(keys); for(i = 0; i < CB_LISTNUM(keys); i++){ kbuf = CB_LISTVAL2(keys, i, ksiz); vbuf = cbmapget(db->auxcc, kbuf, ksiz, &vsiz); if(!vlput(db->auxdb, kbuf, ksiz, vbuf, vsiz, VL_DCAT)){ err = TRUE; break; } len = sprintf(numbuf, "%d", vlvsiz(db->auxdb, kbuf, ksiz) / (int)(sizeof(int) * 2)); if(!vlput(db->xfmdb, kbuf, ksiz, numbuf, len, VL_DOVER)){ err = TRUE; break; } cbmapout(db->auxcc, kbuf, ksiz); db->icsiz -= vsiz; if(i % ESTCCCBFREQ == 0) est_db_inform(db, "flushing auxiliary keywords"); if(max > 0 && db->intflag && i > 0 && i % ESTCCIRSLOT == 0) break; } CB_LISTCLOSE(keys); if(cbmaprnum(db->auxcc) < 1){ cbmapclose(db->auxcc); db->auxcc = cbmapopenex(ESTAUXCCBNUM); } } } if(max < 1 && cbmaprnum(db->outcc) > 0){ ids = cbmapopen(); CB_LISTOPEN(keys); cbmapiterinit(db->outcc); while((kbuf = cbmapiternext(db->outcc, &ksiz)) != NULL){ if(*kbuf == '\t'){ id = atoi(kbuf + 1); cbmapput(ids, (char *)&id, sizeof(int), "", 0, FALSE); } else { CB_LISTPUSH(keys, kbuf, ksiz); } } cblistsort(keys); dnum = est_idx_dnum(db->idxdb); for(i = 0; i < CB_LISTNUM(keys); i++){ kbuf = CB_LISTVAL2(keys, i, ksiz); if(kbuf[0] == ' '){ if((tbuf = vlget(db->auxdb, kbuf + 1, ksiz - 1, &tsiz)) != NULL){ rp = tbuf; wp = tbuf; ep = tbuf + tsiz; while(rp < ep){ if(!cbmapget(ids, rp, sizeof(int), NULL)){ memmove(wp, rp, sizeof(int) * 2); wp += sizeof(int) * 2; } rp += sizeof(int) * 2; } if(wp > tbuf){ if(!vlput(db->auxdb, kbuf + 1, ksiz - 1, tbuf, wp - tbuf, VL_DOVER)) err = TRUE; len = sprintf(numbuf, "%d", (int)((wp - tbuf) / (sizeof(int) * 2))); if(!vlput(db->xfmdb, kbuf + 1, ksiz - 1, numbuf, len, VL_DOVER)) err = TRUE; } else { if(!vlout(db->auxdb, kbuf + 1, ksiz - 1)) err = TRUE; if(!vlout(db->xfmdb, kbuf + 1, ksiz - 1) && dpecode != DP_ENOITEM) err = TRUE; } free(tbuf); } } else { sum = 0; for(j = 0; j < dnum; j++){ if((vbuf = est_idx_get_one(db->idxdb, j, kbuf, ksiz, &tsiz)) != NULL){ CB_DATUMOPEN(nval); rp = vbuf; ep = vbuf + tsiz; lid = 0; cid = 0; while(rp < ep){ EST_READ_VNUMBUF(rp, vnum, vstep); cid += vnum + 1; rp += vstep; pv = rp; switch(db->smode){ case ESTDFSCVOID: break; default: rp++; break; case ESTDFSCINT: case ESTDFSCASIS: rp += sizeof(int); break; } while(*rp != 0x0){ rp += 2; } rp++; if(!cbmapget(ids, (char *)&cid, sizeof(int), NULL)){ EST_SET_VNUMBUF(vstep, numbuf, cid - lid - 1); CB_DATUMCAT(nval, numbuf, vstep); CB_DATUMCAT(nval, pv, rp - pv); lid = cid; } } if(!est_idx_put_one(db->idxdb, j, kbuf, ksiz, CB_DATUMPTR(nval), CB_DATUMSIZE(nval))) err = TRUE; sum += CB_DATUMSIZE(nval); CB_DATUMCLOSE(nval); } } if(sum < 1 && !vlout(db->fwmdb, kbuf, ksiz) && dpecode != DP_ENOITEM) err = TRUE; } cbmapout(db->outcc, kbuf, ksiz); if(i % ESTCCCBFREQ == 0) est_db_inform(db, "cleaning dispensable keys"); if(max > 0 && db->intflag && i > 0 && i % ESTCCIRSLOT == 0) break; } if(cbmaprnum(db->outcc) <= cbmaprnum(ids)){ cbmapclose(db->outcc); db->outcc = cbmapopenex(ESTOUTCCBNUM); } CB_LISTCLOSE(keys); cbmapclose(ids); } cbmapclose(db->keycc); db->keycc = cbmapopenex(ESTKEYCCMNUM + 1); db->kcmnum = ESTKEYCCMNUM; if(!(max > 0 && db->intflag) && inc && est_idx_size_current(db->idxdb) >= ESTIDXDBMIN){ est_db_inform(db, "adding a new database file"); est_idx_increment(db->idxdb); } if(max < 1 || max >= INT_MAX){ if(!vlmemflush(db->auxdb)) err = TRUE; if(!est_idx_memflush(db->idxdb)) err = TRUE; } if(max > 0 && db->intflag) est_db_inform(db, "flushing interrupted"); db->flsflag = FALSE; db->intflag = FALSE; if(err){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; return FALSE; } return TRUE; } /* Synchronize updating contents of a database. */ int est_db_sync(ESTDB *db){ ESTATTRIDX *attridx; const char *kbuf; int err; assert(db); if(!dpwritable(db->metadb)){ est_set_ecode(&(db->ecode), ESTEACCES, __LINE__); return FALSE; } err = FALSE; if(!est_db_flush(db, -1) || !est_db_write_meta(db)) err = TRUE; est_db_inform(db, "synchronizing the database for meta information"); if(!dpsync(db->metadb)) err = TRUE; est_db_inform(db, "synchronizing the inverted index"); if(!est_idx_sync(db->idxdb)) err = TRUE; est_db_inform(db, "synchronizing the database for forward matching"); if(!vlsync(db->fwmdb)) err = TRUE; est_db_inform(db, "synchronizing the database for attributes"); if(!crsync(db->attrdb)) err = TRUE; est_db_inform(db, "synchronizing the database for texts"); if(!crsync(db->textdb)) err = TRUE; est_db_inform(db, "synchronizing the database for keywords"); if(!crsync(db->kwddb)) err = TRUE; est_db_inform(db, "synchronizing the database for document list"); if(!vlsync(db->listdb)) err = TRUE; if(cbmaprnum(db->aidxs) > 0){ est_db_inform(db, "synchronizing the databases for attribute narrowing"); cbmapiterinit(db->aidxs); while((kbuf = cbmapiternext(db->aidxs, NULL)) != NULL){ attridx = (ESTATTRIDX *)cbmapiterval(kbuf, NULL); switch(attridx->type){ case ESTIDXATTRSTR: case ESTIDXATTRNUM: if(!vlsync(attridx->db)) err = TRUE; break; default: if(!dpsync(attridx->db)) err = TRUE; break; } } } if(err){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; } return err ? FALSE : TRUE; } /* Optimize a database. */ int est_db_optimize(ESTDB *db, int options){ CBMAP *dmap; CBLIST *words; CBDATUM *nval; ESTATTRIDX *attridx; const char *word, *rp, *pv, *ep; char *kbuf, *vbuf, *wp, numbuf[ESTNUMBUFSIZ]; int i, err, id, ksiz, vsiz, wsiz, len, vstep; assert(db); if(!dpwritable(db->metadb)){ est_set_ecode(&(db->ecode), ESTEACCES, __LINE__); return FALSE; } if(!est_db_flush(db, -1)) return FALSE; err = FALSE; if(!(options & ESTOPTNOPURGE)){ dmap = cbmapopenex(vlrnum(db->listdb) + 1); vlcurfirst(db->listdb); while((vbuf = vlcurval(db->listdb, NULL)) != NULL){ id = atoi(vbuf); cbmapput(dmap, (char *)&id, sizeof(int), "", 0, FALSE); free(vbuf); vlcurnext(db->listdb); } CB_LISTOPEN(words); vlcurfirst(db->fwmdb); while((kbuf = vlcurkey(db->fwmdb, &ksiz)) != NULL){ CB_LISTPUSHBUF(words, kbuf, ksiz); vlcurnext(db->fwmdb); } for(i = 0; i < CB_LISTNUM(words); i++){ if(i % (ESTIDXDBLRM * 4) == 0) est_idx_set_current(db->idxdb); word = CB_LISTVAL2(words, i, wsiz); vbuf = est_idx_scan(db->idxdb, word, wsiz, &vsiz, db->smode); CB_DATUMOPEN(nval); rp = vbuf; ep = vbuf + vsiz; while(rp < ep){ pv = rp; EST_READ_VNUMBUF(rp, id, vstep); rp += vstep; switch(db->smode){ case ESTDFSCVOID: break; default: rp++; break; case ESTDFSCINT: case ESTDFSCASIS: rp += sizeof(int); break; } while(*rp != 0x00){ rp += 2; } rp++; if(cbmapget(dmap, (char *)&id, sizeof(int), NULL)) CB_DATUMCAT(nval, pv, rp - pv); } if(!est_idx_out(db->idxdb, word, wsiz)) err = TRUE; if(CB_DATUMSIZE(nval) > 0){ if(!est_idx_add(db->idxdb, word, wsiz, CB_DATUMPTR(nval), CB_DATUMSIZE(nval), db->smode)) err = TRUE; } else { if(!vlout(db->fwmdb, word, wsiz)) err = TRUE; } CB_DATUMCLOSE(nval); free(vbuf); free(kbuf); if(i % ESTCCCBFREQ == 0) est_db_inform(db, "cleaning dispensable keys"); } CB_LISTCLOSE(words); CB_LISTOPEN(words); vlcurfirst(db->auxdb); while((kbuf = vlcurkey(db->auxdb, &ksiz)) != NULL){ CB_LISTPUSHBUF(words, kbuf, ksiz); vlcurnext(db->auxdb); } for(i = 0; i < CB_LISTNUM(words); i++){ word = CB_LISTVAL2(words, i, wsiz); if(!(vbuf = vlget(db->auxdb, word, wsiz, &vsiz))) continue; rp = vbuf; wp = vbuf; ep = vbuf + vsiz; while(rp < ep){ if(cbmapget(dmap, rp, sizeof(int), NULL)){ memmove(wp, rp, sizeof(int) * 2); wp += sizeof(int) * 2; } rp += sizeof(int) * 2; } if(wp > vbuf){ if(!vlput(db->auxdb, word, wsiz, vbuf, wp - vbuf, VL_DOVER)) err = TRUE; len = sprintf(numbuf, "%d", (int)((wp - vbuf) / (sizeof(int) * 2))); if(!vlput(db->xfmdb, word, wsiz, numbuf, len, VL_DOVER)) err = TRUE; } else { if(!vlout(db->auxdb, word, wsiz)) err = TRUE; if(!vlout(db->xfmdb, word, wsiz) && dpecode != DP_ENOITEM) err = TRUE; } free(vbuf); if(i % ESTCCCBFREQ == 0) est_db_inform(db, "cleaning dispensable auxiliary keys"); } CB_LISTCLOSE(words); cbmapclose(dmap); } if(!(options & ESTOPTNODBOPT)){ est_db_inform(db, "optimizing the inverted index"); if(!est_idx_optimize(db->idxdb)) err = TRUE; est_db_inform(db, "optimizing the database for forward matching"); if(!vloptimize(db->fwmdb)) err = TRUE; est_db_inform(db, "optimizing the auxiliary index"); if(!vloptimize(db->auxdb)) err = TRUE; est_db_inform(db, "optimizing the database for auxiliary forward matching"); if(!vloptimize(db->xfmdb)) err = TRUE; est_db_inform(db, "optimizing the database for attributes"); if(!croptimize(db->attrdb, -1)) err = TRUE; est_db_inform(db, "optimizing the database for texts"); if(!croptimize(db->textdb, -1)) err = TRUE; est_db_inform(db, "optimizing the database for keywords"); if(!croptimize(db->kwddb, -1)) err = TRUE; est_db_inform(db, "optimizing the database for document list"); if(!vloptimize(db->listdb)) err = TRUE; if(cbmaprnum(db->aidxs) > 0){ est_db_inform(db, "optimizing the databases for attribute narrowing"); cbmapiterinit(db->aidxs); while((rp = cbmapiternext(db->aidxs, NULL)) != NULL){ attridx = (ESTATTRIDX *)cbmapiterval(rp, NULL); switch(attridx->type){ case ESTIDXATTRSTR: case ESTIDXATTRNUM: if(!vloptimize(attridx->db)) err = TRUE; break; default: if(!dpoptimize(attridx->db, -1)) err = TRUE; break; } } } } cbmapclose(db->rescc); db->rescc = cbmapopenex(db->rcmnum * 2 + 1); if(err){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; } return err ? FALSE : TRUE; } /* Merge another database. */ int est_db_merge(ESTDB *db, const char *name, int options){ ESTDB *tgdb; ESTATTRIDX *attridx; CBMAP *idmap, *seqmap, *attrs; CBLIST *words; CBDATUM *rbuf; const char *kbuf, *vbuf, *rp, *ep, *sp; char *tbuf, numbuf[ESTNUMBUFSIZ]; int i, j, ecode, err, ksiz, vsiz, tsiz, oid, nid, len, vstep, anum, *ary; assert(db && name); if(!dpwritable(db->metadb)){ est_set_ecode(&(db->ecode), ESTEACCES, __LINE__); return FALSE; } est_db_inform(db, "opening the target database"); if(!(tgdb = est_db_open(name, ESTDBREADER, &ecode))){ est_set_ecode(&(db->ecode), ecode, __LINE__); return FALSE; } if(dpgetflags(db->metadb) != dpgetflags(tgdb->metadb)){ est_db_close(tgdb, &ecode); est_set_ecode(&(db->ecode), ESTEMISC, __LINE__); return FALSE; } err = FALSE; idmap = cbmapopenex(est_db_doc_num(tgdb) + 1); vlcurfirst(tgdb->listdb); for(i = 0; (kbuf = vlcurkeycache(tgdb->listdb, &ksiz)) != NULL; i++){ if((vbuf = vlgetcache(db->listdb, kbuf, ksiz, NULL)) != NULL && !est_db_out_doc(db, atoi(vbuf), options & ESTMGCLEAN ? ESTODCLEAN : 0)) err = TRUE; oid = atoi(vlcurvalcache(tgdb->listdb, NULL)); db->dseq++; db->dnum++; cbmapput(idmap, (char *)&oid, sizeof(int), (char *)&(db->dseq), sizeof(int), FALSE); vlcurnext(tgdb->listdb); if(i % (ESTCCCBFREQ / 10) == 0) est_db_inform(db, "calculating ID mapping"); } if(!est_db_flush(db, -1)){ cbmapclose(idmap); est_db_close(tgdb, &ecode); return FALSE; } cbmapiterinit(idmap); for(i = 0; (kbuf = cbmapiternext(idmap, &ksiz)) != NULL; i++){ CB_MAPITERVAL(vbuf, kbuf, vsiz); oid = *(int *)kbuf; nid = *(int *)vbuf; if((tbuf = est_crget(tgdb->attrdb, tgdb->zmode, oid, &tsiz)) != NULL){ attrs = cbmapload(tbuf, tsiz); len = sprintf(numbuf, "%d", nid); cbmapput(attrs, ESTDATTRID, -1, numbuf, len, TRUE); free(tbuf); tbuf = cbmapdump(attrs, &tsiz); if((vbuf = cbmapget(attrs, ESTDATTRURI, -1, &vsiz)) != NULL){ if(!vlput(db->listdb, vbuf, vsiz, numbuf, len, VL_DKEEP)){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } } else { est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } if(!est_crput(db->attrdb, db->zmode, nid, tbuf, tsiz, CR_DKEEP)){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } if(cbmaprnum(db->aidxs) > 0){ cbmapiterinit(db->aidxs); while((kbuf = cbmapiternext(db->aidxs, &ksiz)) != NULL){ if(!(vbuf = cbmapget(attrs, kbuf, ksiz, &vsiz))) continue; attridx = (ESTATTRIDX *)cbmapiterval(kbuf, NULL); switch(attridx->type){ case ESTIDXATTRSTR: case ESTIDXATTRNUM: if(!est_aidx_attr_put(attridx->db, nid, vbuf, vsiz)){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } break; default: if(!est_aidx_seq_put(attridx->db, nid, vbuf, vsiz)){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } break; } } } cbmapclose(attrs); free(tbuf); } else { est_set_ecode(&(db->ecode), ESTEDB, __LINE__); err = TRUE; } if((tbuf = est_crget(tgdb->textdb, tgdb->zmode, oid, &tsiz)) != NULL){ if(!est_crput(db->textdb, db->zmode, nid, tbuf, tsiz, CR_DKEEP)){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } free(tbuf); } else { est_set_ecode(&(db->ecode), ESTEDB, __LINE__); err = TRUE; } if((tbuf = est_crget(tgdb->kwddb, tgdb->zmode, oid, &tsiz)) != NULL){ if(!est_crput(db->kwddb, db->zmode, nid, tbuf, tsiz, CR_DKEEP)){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } free(tbuf); } else if(dpecode != DP_ENOITEM){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } if(i % (ESTCCCBFREQ / 10) == 0) est_db_inform(db, "importing documents"); } CB_LISTOPEN(words); vlcurfirst(tgdb->fwmdb); while((kbuf = vlcurkeycache(tgdb->fwmdb, &ksiz)) != NULL){ CB_LISTPUSH(words, kbuf, ksiz); vlcurnext(tgdb->fwmdb); } for(i = 0; i < CB_LISTNUM(words); i++){ kbuf = CB_LISTVAL2(words, i, ksiz); seqmap = cbmapopenex(tsiz / sizeof(int) + 1); tbuf = est_idx_scan(tgdb->idxdb, kbuf, ksiz, &tsiz, tgdb->smode); rp = tbuf; ep = tbuf + tsiz; while(rp < ep){ EST_READ_VNUMBUF(rp, oid, vstep); rp += vstep; vbuf = cbmapget(idmap, (char *)&oid, sizeof(int), NULL); nid = vbuf ? *(int *)vbuf : -1; sp = rp; switch(tgdb->smode){ case ESTDFSCVOID: break; default: rp++; break; case ESTDFSCINT: case ESTDFSCASIS: rp += sizeof(int); break; } while(*rp != 0x00){ rp += 2; } rp++; if(nid > 0) cbmapputcat(seqmap, (char *)&nid, sizeof(int), sp, rp - sp); } anum = cbmaprnum(seqmap); CB_MALLOC(ary, anum * sizeof(int) + 1); cbmapiterinit(seqmap); for(j = 0; (rp = cbmapiternext(seqmap, NULL)) != NULL; j++){ ary[j] = *(int *)rp; } qsort(ary, anum, sizeof(int), est_int_compare); CB_DATUMOPEN(rbuf); for(j = 0; j < anum; j++){ EST_SET_VNUMBUF(vstep, numbuf, ary[j]); CB_DATUMCAT(rbuf, numbuf, vstep); vbuf = cbmapget(seqmap, (char *)(ary + j), sizeof(int), &vsiz); CB_DATUMCAT(rbuf, vbuf, vsiz); } if(!est_idx_add(db->idxdb, kbuf, ksiz, CB_DATUMPTR(rbuf), CB_DATUMSIZE(rbuf), db->smode)){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } CB_DATUMCLOSE(rbuf); free(ary); cbmapclose(seqmap); free(tbuf); vlput(db->fwmdb, kbuf, ksiz, "", 0, VL_DKEEP); if(i % ESTCCCBFREQ == 0){ est_db_inform(db, "importing words"); if(est_idx_size_current(db->idxdb) >= ESTIDXDBMAX){ est_db_inform(db, "adding a new database file"); est_idx_increment(db->idxdb); } } } CB_LISTCLOSE(words); CB_LISTOPEN(words); vlcurfirst(tgdb->auxdb); while((kbuf = vlcurkeycache(tgdb->auxdb, &ksiz)) != NULL){ CB_LISTPUSH(words, kbuf, ksiz); vlcurnext(tgdb->auxdb); } for(i = 0; i < CB_LISTNUM(words); i++){ kbuf = CB_LISTVAL2(words, i, ksiz); vbuf = vlgetcache(tgdb->auxdb, kbuf, ksiz, &vsiz); CB_DATUMOPEN(rbuf); rp = vbuf; ep = vbuf + vsiz; while(rp < ep){ oid = *(int *)rp; vbuf = cbmapget(idmap, rp, sizeof(int), NULL); nid = vbuf ? *(int *)vbuf : -1; if(nid > 0){ CB_DATUMCAT(rbuf, (char *)&nid, sizeof(int)); CB_DATUMCAT(rbuf, rp + sizeof(int), sizeof(int)); } rp += sizeof(int) * 2; } if(!vlput(db->auxdb, kbuf, ksiz, CB_DATUMPTR(rbuf), CB_DATUMSIZE(rbuf), VL_DCAT)){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } CB_DATUMCLOSE(rbuf); anum = 0; if((vbuf = vlgetcache(tgdb->xfmdb, kbuf, ksiz, NULL)) != NULL) anum += atoi(vbuf); len = sprintf(numbuf, "%d", anum); vlput(db->xfmdb, kbuf, ksiz, numbuf, len, VL_DOVER); if(i % ESTCCCBFREQ == 0) est_db_inform(db, "importing auxiliary words"); } CB_LISTCLOSE(words); cbmapclose(idmap); est_db_inform(db, "closing the target database"); if(!est_db_close(tgdb, &ecode)){ est_set_ecode(&(db->ecode), ecode, __LINE__); return FALSE; } if(!est_db_flush(db, -1)) err = TRUE; return err ? FALSE : TRUE; } /* Add a document to a database. */ int est_db_put_doc(ESTDB *db, ESTDOC *doc, int options){ CBMAP *ocmap, *fmap, *qmap; CBLIST *words; CBDATUM *ocbuf; ESTATTRIDX *attridx; md5_state_t ms; const char *uri, *ndig, *text, *word, *fnext, *snext, *kbuf, *vbuf; unsigned char junc[2], c; char dobuf[32], dsbuf[64], *wp, *odig, wbuf[ESTWORDMAXLEN+3], *sbuf, nbuf[ESTNUMBUFSIZ]; int i, j, id, err, wnum, wsiz, fnsiz, snsiz, *np, score, num, ksiz, vsiz, ssiz; double tune, weight; assert(db && doc); if(!dpwritable(db->metadb)){ est_set_ecode(&(db->ecode), ESTEACCES, __LINE__); return FALSE; } if(!doc->attrs || !(uri = cbmapget(doc->attrs, ESTDATTRURI, -1, NULL)) || uri[0] == '\0'){ est_set_ecode(&(db->ecode), ESTEINVAL, __LINE__); return FALSE; } if(!doc->dtexts) CB_LISTOPEN(doc->dtexts); if(!(ndig = cbmapget(doc->attrs, ESTDATTRDIGEST, -1, NULL))){ md5_init(&ms); for(i = 0; i < CB_LISTNUM(doc->dtexts); i++){ vbuf = CB_LISTVAL2(doc->dtexts, i, vsiz); md5_append(&ms, (md5_byte_t *)vbuf, vsiz); md5_append(&ms, (md5_byte_t *)"\n", 1); } if((vbuf = cbmapget(doc->attrs, "", 0, &vsiz)) != NULL){ md5_append(&ms, (md5_byte_t *)"\t", 1); md5_append(&ms, (md5_byte_t *)vbuf, vsiz); md5_append(&ms, (md5_byte_t *)"\n", 1); } md5_finish(&ms, (md5_byte_t *)dobuf); wp = dsbuf; for(i = 0; i < 16; i++){ wp += sprintf(wp, "%02x", ((unsigned char *)dobuf)[i]); } ndig = dsbuf; cbmapput(doc->attrs, ESTDATTRDIGEST, -1, ndig, -1, FALSE); } if((id = est_db_uri_to_id(db, uri)) > 0){ if((odig = est_db_get_doc_attr(db, id, ESTDATTRDIGEST)) != NULL){ if(!strcmp(odig, ndig)){ free(odig); doc->id = id; sprintf(nbuf, "%d", id); cbmapput(doc->attrs, ESTDATTRID, -1, nbuf, -1, TRUE); return est_db_edit_doc(db, doc); } free(odig); } if(!est_db_out_doc(db, id, (options & ESTPDCLEAN) ? ESTODCLEAN : 0)) return FALSE; } doc->id = ++(db->dseq); sprintf(nbuf, "%d", doc->id); cbmapput(doc->attrs, ESTDATTRID, -1, nbuf, -1, TRUE); ocmap = cbmapopen(); fmap = cbmapopen(); qmap = cbmapopen(); wnum = 0; for(i = -1; i < CB_LISTNUM(doc->dtexts); i++){ if(i < 0){ if(!(text = cbmapget(doc->attrs, "", 0, NULL))) continue; } else { text = CB_LISTVAL(doc->dtexts, i); } CB_LISTOPEN(words); switch(db->amode){ case ESTDFPERFNG: est_break_text_perfng(text, words, FALSE, TRUE); break; case ESTDFCHRCAT: est_break_text_chrcat(text, words, FALSE); break; default: est_break_text(text, words, FALSE, TRUE); break; } wnum += CB_LISTNUM(words); for(j = 0; j < CB_LISTNUM(words); j++){ word = CB_LISTVAL2(words, j, wsiz); if(wsiz > ESTWORDMAXLEN) continue; fnext = cblistval(words, j + 1, &fnsiz); snext = cblistval(words, j + 2, &snsiz); junc[0] = fnext ? dpinnerhash(fnext, fnsiz) % ESTJHASHNUM + 1: 0xff; junc[1] = snext ? dpouterhash(snext, snsiz) % ESTJHASHNUM + 1: 0xff; memcpy(wbuf, word, wsiz); memcpy(wbuf + wsiz, "\t", 1); memcpy(wbuf + wsiz + 1, junc, 2); np = (int *)cbmapget(fmap, word, wsiz, NULL); num = np ? *(int *)np : 0; num += ESTOCPOINT; cbmapput(fmap, word, wsiz, (char *)&num, sizeof(int), TRUE); if(cbmapput(qmap, wbuf, wsiz + 3, "", 0, FALSE)) cbmapputcat(ocmap, word, wsiz, (char *)junc, fnext ? 2 : 0); } CB_LISTCLOSE(words); } score = (vbuf = cbmapget(doc->attrs, "\t", 1, NULL)) ? atoi(vbuf) : -1; weight = 1.0; if(score < 0 && (options & ESTPDWEIGHT) && (vbuf = cbmapget(doc->attrs, ESTDATTRWEIGHT, -1, NULL)) != NULL){ weight = strtod(vbuf, NULL); weight = weight >= 0.01 ? weight : 0.01; } tune = sqrt(wnum + 128) / 16.0 / weight; cbmapiterinit(ocmap); while((kbuf = cbmapiternext(ocmap, &ksiz)) != NULL){ CB_MAPITERVAL(vbuf, kbuf, vsiz); if(vsiz > 2) qsort((void *)vbuf, vsiz / 2, 2, est_short_compare); CB_DATUMOPEN(ocbuf); EST_SET_VNUMBUF(wsiz, wbuf, doc->id); CB_DATUMCAT(ocbuf, wbuf, wsiz); switch(db->smode){ case ESTDFSCVOID: break; default: num = score < 0 ? *(int *)cbmapget(fmap, kbuf, ksiz, NULL) / tune : score; if(num >= 0x80) num += (0x80 - num) * 0.75; if(num >= 0xc0) num += (0xc0 - num) * 0.75; c = num < 0xff ? num : 0xff; CB_DATUMCAT(ocbuf, (char *)&c, 1); break; case ESTDFSCINT: case ESTDFSCASIS: num = score < 0 ? *(int *)cbmapget(fmap, kbuf, ksiz, NULL) * 10 / tune : score; CB_DATUMCAT(ocbuf, (char *)&num, sizeof(int)); break; } CB_DATUMCAT(ocbuf, vbuf, vsiz); c = 0x00; CB_DATUMCAT(ocbuf, (char *)&c, 1); cbmapputcat(db->idxcc, kbuf, ksiz, CB_DATUMPTR(ocbuf), CB_DATUMSIZE(ocbuf)); db->icsiz += CB_DATUMSIZE(ocbuf); CB_DATUMCLOSE(ocbuf); } cbmapclose(qmap); cbmapclose(fmap); cbmapclose(ocmap); err = FALSE; sbuf = cbmapdump(doc->attrs, &ssiz); if(!est_crput(db->attrdb, db->zmode, doc->id, sbuf, ssiz, CR_DKEEP)){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } free(sbuf); sbuf = cblistdump(doc->dtexts, &ssiz); if(!est_crput(db->textdb, db->zmode, doc->id, sbuf, ssiz, CR_DKEEP)){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } free(sbuf); if(doc->kwords && !est_db_put_keywords(db, doc->id, doc->kwords, weight)) err = TRUE; sprintf(nbuf, "%d", doc->id); if(!vlput(db->listdb, uri, -1, nbuf, -1, VL_DKEEP)){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } if(cbmaprnum(db->aidxs) > 0){ cbmapiterinit(db->aidxs); while((kbuf = cbmapiternext(db->aidxs, &ksiz)) != NULL){ if(!(vbuf = cbmapget(doc->attrs, kbuf, ksiz, &vsiz))) continue; attridx = (ESTATTRIDX *)cbmapiterval(kbuf, NULL); switch(attridx->type){ case ESTIDXATTRSTR: case ESTIDXATTRNUM: if(!est_aidx_attr_put(attridx->db, doc->id, vbuf, vsiz)){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } break; default: if(!est_aidx_seq_put(attridx->db, doc->id, vbuf, vsiz)){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } break; } } } db->dnum++; if(est_db_used_cache_size(db) > db->icmax && !est_db_flush(db, INT_MAX)) err = TRUE; return err ? FALSE : TRUE; } /* Remove a document from a database. */ int est_db_out_doc(ESTDB *db, int id, int options){ ESTDOC *doc; CBLIST *words; ESTATTRIDX *attridx; const char *uri, *kbuf, *vbuf, *text, *word; char numbuf[ESTNUMBUFSIZ]; int i, j, ksiz, vsiz, len, wsiz; assert(db && id > 0); if(!dpwritable(db->metadb)){ est_set_ecode(&(db->ecode), ESTEACCES, __LINE__); return FALSE; } if(id >= ESTPDOCIDMIN){ est_set_ecode(&(db->ecode), ESTEINVAL, __LINE__); return FALSE; } if(!(doc = est_db_get_doc(db, id, ESTGDNOKWD))) return FALSE; if(!doc->attrs || !(uri = cbmapget(doc->attrs, ESTDATTRURI, -1, NULL))){ est_doc_delete(doc); est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; return FALSE; } if(!est_crout(db->attrdb, id) || !est_crout(db->textdb, id) || !vlout(db->listdb, uri, -1)){ est_doc_delete(doc); est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; return FALSE; } cbmapout(db->attrcc, (char *)&id, sizeof(int)); cbmapout(db->textcc, (char *)&id, sizeof(int)); if(db->spacc) cbmapout(db->spacc, (char *)&id, sizeof(int)); if(cbmaprnum(db->aidxs) > 0){ cbmapiterinit(db->aidxs); while((kbuf = cbmapiternext(db->aidxs, &ksiz)) != NULL){ if(!(vbuf = cbmapget(doc->attrs, kbuf, ksiz, &vsiz))) continue; attridx = (ESTATTRIDX *)cbmapiterval(kbuf, NULL); switch(attridx->type){ case ESTIDXATTRSTR: case ESTIDXATTRNUM: if(!est_aidx_attr_out(attridx->db, doc->id, vbuf, vsiz)){ est_doc_delete(doc); est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; return FALSE; } break; default: if(!est_aidx_seq_out(attridx->db, doc->id)){ est_doc_delete(doc); est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; return FALSE; } break; } } } if(options & ESTODCLEAN){ len = sprintf(numbuf, "\t%d", doc->id); cbmapput(db->outcc, numbuf, len, "", 0, FALSE); for(i = -1; i < CB_LISTNUM(doc->dtexts); i++){ if(i < 0){ if(!(text = cbmapget(doc->attrs, "", 0, NULL))) continue; } else { text = CB_LISTVAL(doc->dtexts, i); } CB_LISTOPEN(words); switch(db->amode){ case ESTDFPERFNG: est_break_text_perfng(text, words, FALSE, TRUE); break; case ESTDFCHRCAT: est_break_text_chrcat(text, words, FALSE); break; default: est_break_text(text, words, FALSE, TRUE); break; } for(j = 0; j < CB_LISTNUM(words); j++){ word = CB_LISTVAL2(words, j, wsiz); cbmapput(db->outcc, word, wsiz, "", 0, FALSE); } CB_LISTCLOSE(words); } if(!est_db_out_keywords(db, id) && db->ecode != ESTENOITEM){ est_doc_delete(doc); est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; return FALSE; } } else { if(!est_crout(db->kwddb, id) && dpecode != DP_ENOITEM){ est_doc_delete(doc); est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; return FALSE; } cbmapout(db->veccc, (char *)&id, sizeof(int)); } est_doc_delete(doc); if(!est_db_set_doc_entity(db, id, NULL, -1) && db->ecode != ESTENOITEM) return FALSE; db->dnum--; return TRUE; } /* Edit attributes of a document object in a database. */ int est_db_edit_doc(ESTDB *db, ESTDOC *doc){ ESTDOC *odoc; ESTATTRIDX *attridx; const char *uri, *tmp, *kbuf, *vbuf; char *ouri, numbuf[ESTNUMBUFSIZ], *text, *sbuf; int err, id, oid, ksiz, vsiz, ssiz; assert(db && doc); if(!dpwritable(db->metadb)){ est_set_ecode(&(db->ecode), ESTEACCES, __LINE__); return FALSE; } id = -1; uri = NULL; if(doc->attrs){ if((tmp = cbmapget(doc->attrs, ESTDATTRID, -1, NULL)) != NULL) id = atoi(tmp); if((tmp = cbmapget(doc->attrs, ESTDATTRURI, -1, NULL)) != NULL) uri = tmp; } if(id < 1 || id >= ESTPDOCIDMIN || (doc->id > 0 && doc->id != id) || !uri || uri[0] == '\0'){ est_set_ecode(&(db->ecode), ESTEINVAL, __LINE__); return FALSE; } err = FALSE; if((oid = est_db_uri_to_id(db, uri)) == -1){ if(!(ouri = est_db_get_doc_attr(db, id, ESTDATTRURI))){ est_set_ecode(&(db->ecode), ESTEINVAL, __LINE__); return FALSE; } sprintf(numbuf, "%d", id); if(!vlout(db->listdb, ouri, -1) || !vlput(db->listdb, uri, -1, numbuf, -1, VL_DKEEP)) err = TRUE; free(ouri); } else if(oid != id){ est_set_ecode(&(db->ecode), ESTEINVAL, __LINE__); return FALSE; } doc->id = id; if(cbmaprnum(db->aidxs) > 0 && (odoc = est_db_get_doc(db, id, ESTGDNOTEXT))){ if(!odoc->attrs) odoc->attrs = cbmapopenex(ESTMINIBNUM); cbmapiterinit(db->aidxs); while((kbuf = cbmapiternext(db->aidxs, &ksiz)) != NULL){ if(!(vbuf = cbmapget(odoc->attrs, kbuf, ksiz, &vsiz))) continue; attridx = (ESTATTRIDX *)cbmapiterval(kbuf, NULL); switch(attridx->type){ case ESTIDXATTRSTR: case ESTIDXATTRNUM: if(!est_aidx_attr_out(attridx->db, id, vbuf, vsiz)){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } break; default: if(!est_aidx_seq_out(attridx->db, id)){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } break; } } cbmapiterinit(db->aidxs); while((kbuf = cbmapiternext(db->aidxs, &ksiz)) != NULL){ if(!(vbuf = cbmapget(doc->attrs, kbuf, ksiz, &vsiz))) continue; attridx = (ESTATTRIDX *)cbmapiterval(kbuf, NULL); switch(attridx->type){ case ESTIDXATTRSTR: case ESTIDXATTRNUM: if(!est_aidx_attr_put(attridx->db, id, vbuf, vsiz)){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } break; default: if(!est_aidx_seq_put(attridx->db, id, vbuf, vsiz)){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } break; } } est_doc_delete(odoc); } if((text = est_db_get_doc_attr(db, id, "")) != NULL){ cbmapput(doc->attrs, "", 0, text, -1, TRUE); free(text); } sbuf = cbmapdump(doc->attrs, &ssiz); if(!est_crput(db->attrdb, db->zmode, id, sbuf, ssiz, CR_DOVER)){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } free(sbuf); cbmapout(db->attrcc, (char *)&id, sizeof(int)); if(db->spacc) cbmapout(db->spacc, (char *)&id, sizeof(int)); return err ? FALSE : TRUE; } /* Retrieve a document in a database. */ ESTDOC *est_db_get_doc(ESTDB *db, int id, int options){ ESTDOC *doc; const char *cbuf; char *vbuf, numbuf[ESTNUMBUFSIZ]; int i, csiz, vsiz, num; assert(db && id > 0); if(id >= ESTPDOCIDMIN){ if((num = id - ESTPDOCIDMIN) >= CB_LISTNUM(db->pdocs)){ est_set_ecode(&(db->ecode), ESTENOITEM, __LINE__); return NULL; } if((vbuf = cbreadfile(CB_LISTVAL(db->pdocs, num), NULL)) != NULL){ doc = est_doc_new_from_draft(vbuf); free(vbuf); } else { doc = est_doc_new(); } doc->id = id; sprintf(numbuf, "%d", id); est_doc_add_attr(doc, ESTDATTRID, numbuf); if(!est_doc_attr(doc, ESTDATTRURI)) est_doc_add_attr(doc, ESTDATTRURI, CB_LISTVAL(db->pdocs, num)); return doc; } cbuf = NULL; if(options & ESTGDNOATTR){ if(crvsiz(db->attrdb, (char *)&id, sizeof(int)) == -1){ if(dpecode == DP_ENOITEM){ est_set_ecode(&(db->ecode), ESTENOITEM, __LINE__); return NULL; } else { est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; return NULL; } } vbuf = NULL; } else if((cbuf = cbmapget(db->attrcc, (char *)&id, sizeof(int), &csiz)) != NULL){ cbmapmove(db->attrcc, (char *)&id, sizeof(int), FALSE); vbuf = NULL; } else if(!(vbuf = est_crget(db->attrdb, db->zmode, id, &vsiz))){ if(dpecode == DP_ENOITEM){ est_set_ecode(&(db->ecode), ESTENOITEM, __LINE__); return NULL; } else { est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; return NULL; } } doc = est_doc_new(); doc->id = id; if(cbuf){ doc->attrs = cbmapload(cbuf, csiz); } else if(vbuf){ doc->attrs = cbmapload(vbuf, vsiz); if(db->acmnum > 0) cbmapput(db->attrcc, (char *)&id, sizeof(int), vbuf, vsiz, TRUE); free(vbuf); if(cbmaprnum(db->attrcc) > db->acmnum){ num = cbmaprnum(db->attrcc) * 0.1 + 1; cbmapiterinit(db->attrcc); for(i = 0; i < num && (cbuf = cbmapiternext(db->attrcc, NULL)) != NULL; i++){ cbmapout(db->attrcc, cbuf, sizeof(int)); } } } else { doc->attrs = NULL; } if(!(options & ESTGDNOTEXT)){ if((cbuf = cbmapget(db->textcc, (char *)&id, sizeof(int), &csiz)) != NULL){ cbmapmove(db->textcc, (char *)&id, sizeof(int), FALSE); doc->dtexts = cblistload(cbuf, csiz); } else { if(!(vbuf = est_crget(db->textdb, db->zmode, id, &vsiz))){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; est_doc_delete(doc); return NULL; } doc->dtexts = cblistload(vbuf, vsiz); if(db->tcmnum > 0) cbmapput(db->textcc, (char *)&id, sizeof(int), vbuf, vsiz, TRUE); free(vbuf); if(cbmaprnum(db->textcc) > db->tcmnum){ num = cbmaprnum(db->textcc) * 0.1 + 1; cbmapiterinit(db->textcc); for(i = 0; i < num &&(cbuf = cbmapiternext(db->textcc, NULL)) != NULL; i++){ cbmapout(db->textcc, cbuf, sizeof(int)); } } } } if(!(options & ESTGDNOKWD)) doc->kwords = est_db_get_keywords(db, id); return doc; } /* Retrieve the value of an attribute of a document in a database. */ char *est_db_get_doc_attr(ESTDB *db, int id, const char *name){ ESTATTRIDX *attridx; ESTDOC *doc; const char *cbuf; char *mbuf, *vbuf; int cb, csiz, msiz, vsiz; assert(db && id > 0 && name); if(id >= ESTPDOCIDMIN){ if(!(doc = est_db_get_doc(db, id, 0))){ est_set_ecode(&(db->ecode), ESTENOITEM, __LINE__); return NULL; } if(!(cbuf = est_doc_attr(doc, name))){ est_set_ecode(&(db->ecode), ESTENOITEM, __LINE__); est_doc_delete(doc); return NULL; } vbuf = cbmemdup(cbuf, -1); est_doc_delete(doc); return vbuf; } cb = db->spacc && !strcmp(name, db->scname); if(cb && (cbuf = cbmapget(db->spacc, (char *)&id, sizeof(int), &csiz)) != NULL){ cbmapmove(db->spacc, (char *)&id, sizeof(int), FALSE); return cbmemdup(cbuf, csiz); } if((attridx = (ESTATTRIDX *)cbmapget(db->aidxs, name, -1, NULL)) != NULL && attridx->type == ESTIDXATTRSEQ){ if(!(vbuf = est_aidx_seq_get(attridx->db, id, &vsiz))){ est_set_ecode(&(db->ecode), ESTENOITEM, __LINE__); return NULL; } if(cb) cbmapput(db->spacc, (char *)&id, sizeof(int), vbuf, vsiz, FALSE); return vbuf; } if(!(mbuf = est_crget(db->attrdb, db->zmode, id, &msiz))){ est_set_ecode(&(db->ecode), dpecode == DP_ENOITEM ? ESTENOITEM : ESTEDB, __LINE__); return NULL; } if(!(vbuf = cbmaploadone(mbuf, msiz, name, -1, &vsiz))){ est_set_ecode(&(db->ecode), ESTENOITEM, __LINE__); free(mbuf); return NULL; } if(cb) cbmapput(db->spacc, (char *)&id, sizeof(int), vbuf, vsiz, FALSE); free(mbuf); return vbuf; } /* Get the ID of a document spacified by URI. */ int est_db_uri_to_id(ESTDB *db, const char *uri){ const char *vbuf; int id; assert(db && uri); if(!(vbuf = vlgetcache(db->listdb, uri, -1, NULL))){ if(CB_LISTNUM(db->pdocs) > 0 && (id = est_pidx_uri_to_id(db, uri)) > 0) return id; est_set_ecode(&(db->ecode), ESTENOITEM, __LINE__); return -1; } return atoi(vbuf); } /* Get the name of a database. */ const char *est_db_name(ESTDB *db){ assert(db); return db->name; } /* Get the number of documents in a database. */ int est_db_doc_num(ESTDB *db){ assert(db); return db->dnum; } /* Get the number of words in a database. */ int est_db_word_num(ESTDB *db){ int wnum; assert(db); wnum = vlrnum(db->fwmdb); return wnum > 0 ? wnum : 0; } /* Get the size of a database. */ double est_db_size(ESTDB *db){ ESTATTRIDX *attridx; const char *kbuf; double size; assert(db); size = (double)dpfsiz(db->metadb) + est_idx_size(db->idxdb) + vlfsiz(db->fwmdb) + vlfsiz(db->auxdb) + vlfsiz(db->xfmdb) + crfsizd(db->attrdb) + crfsizd(db->textdb) + crfsizd(db->kwddb) + vlfsiz(db->listdb); if(cbmaprnum(db->aidxs) > 0){ cbmapiterinit(db->aidxs); while((kbuf = cbmapiternext(db->aidxs, NULL)) != NULL){ attridx = (ESTATTRIDX *)cbmapiterval(kbuf, NULL); switch(attridx->type){ case ESTIDXATTRSTR: case ESTIDXATTRNUM: size += vlfsiz(attridx->db); break; default: size += dpfsiz(attridx->db); break; } } } return size; } /* Search documents corresponding a condition for a database. */ int *est_db_search(ESTDB *db, ESTCOND *cond, int *nump, CBMAP *hints){ ESTSCORE *scores, *tscores; CBMAP *svmap, *ordattrs; CBLIST *terms; const char *term, *rp; char *tmp, numbuf[ESTNUMBUFSIZ]; const int *nscores; int i, j, snum, ign, nsnum, unum, knum, mnum, top, pcnum, ncnum, tsnum, add; int nnum, id, score, hnum, len, rest, *rval, rnum; double tune; assert(db && cond && nump); if(cond->auxwords) cbmapclose(cond->auxwords); cond->auxwords = cbmapopenex(ESTMINIBNUM); scores = NULL; snum = 0; ign = -1; nscores = cond->nscores; nsnum = cond->nsnum; ordattrs = cbmapopenex(cond->order ? (CB_LISTNUM(db->pdocs) + ESTMINIBNUM) : 1); if(cond->phrase){ if(cbstrfwmatch(cond->phrase, ESTOPID)){ if((id = atoi(cond->phrase + strlen(ESTOPID))) > 0){ CB_MALLOC(scores, sizeof(ESTSCORE)); scores[0].id = id; scores[0].score = 0; scores[0].value = NULL; snum = 1; } else { CB_MALLOC(scores, 1); snum = 0; } } else if(cbstrfwmatch(cond->phrase, ESTOPURI)){ rp = cond->phrase + strlen(ESTOPURI); while(*rp > '\0' && *rp <= ' '){ rp++; } if((id = est_db_uri_to_id(db, rp)) > 0){ CB_MALLOC(scores, sizeof(ESTSCORE)); scores[0].id = id; scores[0].score = 0; scores[0].value = NULL; snum = 1; } else { CB_MALLOC(scores, 1); snum = 0; } } else if(cbstrfwmatch(cond->phrase, ESTOPSIMILAR)){ rp = cond->phrase + strlen(ESTOPSIMILAR); while(*rp > '\0' && *rp <= ' '){ rp++; } knum = -1; unum = -1; mnum = -1; if(*rp >= '0' && *rp <= '9'){ knum = atoi(rp); while(*rp >= '0' && *rp <= '9'){ rp++; } while(*rp > '\0' && *rp <= ' '){ rp++; } if(*rp >= '0' && *rp <= '9'){ unum = atoi(rp); while(*rp >= '0' && *rp <= '9'){ rp++; } while(*rp > '\0' && *rp <= ' '){ rp++; } if(*rp >= '0' && *rp <= '9'){ mnum = atoi(rp); while(*rp >= '0' && *rp <= '9'){ rp++; } while(*rp > '\0' && *rp <= ' '){ rp++; } } } } if(knum < 1) knum = ESTSMLRKNUM; if(unum < 1) unum = ESTSMLRUNUM; if(mnum < 1) mnum = ESTSMLRMNUM; svmap = est_phrase_vector(rp); scores = est_search_similar(db, svmap, &snum, knum, unum, mnum, cond->tfidf, cond->order ? ESTSMLRNMIN : 0.0, cond->auxmin, cond->auxwords); cbmapclose(svmap); } else if(cbstrfwmatch(cond->phrase, ESTOPRANK)){ rp = cond->phrase + strlen(ESTOPRANK); while(*rp > '\0' && *rp <= ' '){ rp++; } top = atoi(rp); while((*rp >= '0' && *rp <= '9') || *rp == '-'){ rp++; } while(*rp > '\0' && *rp <= ' '){ rp++; } scores = est_search_rank(db, rp, top, &snum); } else { switch(cond->pmode){ default: terms = est_phrase_terms(cond->phrase); break; case ESTPMSIMPLE: tmp = est_phrase_from_simple(cond->phrase); terms = est_phrase_terms(tmp); free(tmp); break; case ESTPMROUGH: tmp = est_phrase_from_rough(cond->phrase); terms = est_phrase_terms(tmp); free(tmp); break; case ESTPMUNION: tmp = est_phrase_from_union(cond->phrase); terms = est_phrase_terms(tmp); free(tmp); break; case ESTPMISECT: tmp = est_phrase_from_isect(cond->phrase); terms = est_phrase_terms(tmp); free(tmp); break; } pcnum = 0; ncnum = 0; add = TRUE; for(i = 0; i < CB_LISTNUM(terms); i++){ term = CB_LISTVAL(terms, i); if(!strcmp(term, ESTOPISECT)){ add = TRUE; } else if(!strcmp(term, ESTOPDIFF)){ add = FALSE; } else { if(!strcmp(term, ESTOPUVSET)){ tscores = est_search_uvset(db, &tsnum, hints, add); } else { tscores = est_search_union(db, term, cond->gstep, cond->cbxpn, &tsnum, hints, add, add && !cond->order ? cond->auxmin : -1, cond->auxwords); } if(add){ if(db->smode != ESTDFSCASIS){ if(cond->tfidf){ tune = pow(tsnum + 64, 0.4); for(j = 0; j < tsnum; j++){ tscores[j].score *= 100.0 / tune; } } else { for(j = 0; j < tsnum; j++){ tscores[j].score *= 10; } } } pcnum++; } else { ncnum++; } if(scores){ CB_REALLOC(scores, (snum + tsnum) * sizeof(ESTSCORE) + 1); for(j = 0; j < tsnum; j++){ scores[snum+j].id = tscores[j].id; scores[snum+j].score = add ? tscores[j].score : -1; scores[snum+j].value = NULL; } snum += tsnum; free(tscores); } else { scores = tscores; snum = tsnum; } } } if(scores){ if(pcnum > 1 || ncnum > 0){ qsort(scores, snum, sizeof(ESTSCORE), est_score_compare_by_id_asc); nnum = 0; for(i = 0; i < snum; i++){ id = scores[i].id; score = scores[i].score; hnum = score >= 0 ? 1 : 0; for(j = i + 1; j < snum && scores[j].id == id; j++){ if(score >= 0 && scores[j].score >= 0){ if(db->smode != ESTDFSCASIS) score += scores[j].score; hnum++; } else { score = -1; } } if(score >= 0 && hnum >= pcnum){ scores[nnum].id = id; scores[nnum].score = score; scores[nnum].value = NULL; nnum++; } i = j - 1; } snum = nnum; } } else { CB_MALLOC(scores, 1); snum = 0; } CB_LISTCLOSE(terms); } } else if(cond->attrs){ if(nscores && nsnum < ESTAISNUMMIN * 4){ CB_MALLOC(scores, nsnum * sizeof(ESTSCORE) + 1); nnum = 0; for(i = 0; i < nsnum; i++){ sprintf(numbuf, "%d", nscores[i]); if((id = est_db_uri_to_id(db, numbuf)) > 0){ scores[nnum].id = id; scores[nnum].score = nscores[i]; scores[nnum].value = NULL; nnum++; } } snum = nnum; nscores = NULL; nsnum = -1; } else { scores = NULL; for(i = 0; i < CB_LISTNUM(cond->attrs); i++){ if((scores = est_search_aidx_attr(db, CB_LISTVAL(cond->attrs, i), &snum)) != NULL){ ign = i; break; } } if(!scores) scores = est_search_uvset(db, &snum, hints, TRUE); } } else { CB_MALLOC(scores, 1); snum = 0; } if(CB_LISTNUM(db->pdocs) > 0) scores = est_search_pidxs(db, cond, scores, &snum, ordattrs); if(nscores && cond->phrase && cond->phrase[0] != '\0'){ qsort(scores, snum, sizeof(ESTSCORE), est_score_compare_by_score_desc); nnum = 0; j = 0; for(i = 0; i < snum; i++){ id = scores[i].id; score = scores[i].score; while(j < nsnum && nscores[j] > score){ j++; } if(j < nsnum && nscores[j] == score){ scores[nnum].id = id; scores[nnum].score = score; scores[nnum].value = NULL; nnum++; j++; } } snum = nnum; } if(cbmaprnum(db->outcc) > 0){ tsnum = 0; for(i = 0; i < snum; i++){ len = sprintf(numbuf, "\t%d", scores[i].id); if(cbmapget(db->outcc, numbuf, len, NULL)) continue; scores[tsnum++] = scores[i]; } snum = tsnum; } if(cond->max > 0 && cond->max * ESTATTRALW + 1 < snum && cond->attrs && !cond->order && !cond->distinct){ qsort(scores, snum, sizeof(ESTSCORE), est_score_compare_by_score_desc); nnum = est_narrow_scores(db, cond->attrs, ign, cond->order, cond->distinct, scores, snum, cond->max * ESTATTRALW + 1, &rest, ordattrs); if(hints){ sprintf(numbuf, "%d", rest > cond->max / 2 ? (int)(snum * (nnum / (double)(snum - rest))) : nnum); cbmapput(hints, "", 0, numbuf, -1, TRUE); } snum = nnum; } else { if(cond->attrs || cond->order || cond->distinct) snum = est_narrow_scores(db, cond->attrs, ign, cond->order, cond->distinct, scores, snum, INT_MAX, &rest, ordattrs); if(!cond->order) qsort(scores, snum, sizeof(ESTSCORE), est_score_compare_by_score_desc); if(hints){ sprintf(numbuf, "%d", snum); cbmapput(hints, "", 0, numbuf, -1, TRUE); } } if(cond->shadows) cbmapclose(cond->shadows); if(cond->ecllim >= 0.0){ cond->shadows = cbmapopenex(snum + 1); snum = est_eclipse_scores(db, scores, snum, cond->max > 0 ? cond->max : snum, ESTECLKNUM, cond->tfidf, cond->ecllim, cond->shadows); } else { cond->shadows = NULL; } rnum = snum - cond->skip; if(rnum < 0) rnum = 0; if(cond->max >= 0 && cond->max < rnum) rnum = cond->max; CB_MALLOC(rval, rnum * sizeof(int) + 1); tscores = scores + cond->skip; for(i = 0; i < rnum; i++){ rval[i] = tscores[i].id; } if(cond->scfb){ if(rnum > 0){ CB_REALLOC(cond->scores, rnum * sizeof(int) + 1); for(i = 0; i < rnum; i++){ cond->scores[i] = tscores[i].score; } cond->snum = rnum; } else { free(cond->scores); cond->scores = NULL; cond->snum = 0; } } *nump = rnum; if(*nump < 1) est_set_ecode(&(db->ecode), ESTENOITEM, __LINE__); cbmapclose(ordattrs); free(scores); return rval; } /* Search documents of plural databases. */ int *est_db_search_meta(ESTDB **dbs, int dbnum, ESTCOND *cond, int *nump, CBMAP *hints){ ESTMETASCORE *scores, *tscores; ESTCOND *tcond; CBMAP *thints, *umap; const char *kbuf, *otype, *rp; char *distinct, numbuf[ESTNUMBUFSIZ], *oname, *wp, *vbuf; int i, j, max, skip, smax, snum, *res, rnum, ksiz, num; time_t tval; assert(dbs && dbnum >= 0 && cond && nump); max = cond->max; if(cond->distinct) cond->max = -1; skip = cond->skip; cond->skip = 0; distinct = cond->distinct; cond->distinct = NULL; smax = ESTALLOCUNIT; CB_MALLOC(scores, smax * sizeof(ESTMETASCORE)); snum = 0; for(i = 0; i < dbnum; i++){ if(cond->mask & (1 << i)) continue; tcond = est_cond_dup(cond); est_cond_set_options(tcond, ESTCONDSCFB); thints = cbmapopenex(ESTMINIBNUM); res = est_db_search(dbs[i], tcond, &rnum, thints); for(j = 0; j < rnum; j++){ if(snum >= smax){ smax *= 2; CB_REALLOC(scores, smax * sizeof(ESTMETASCORE)); } scores[snum].db = i; scores[snum].id = res[j]; scores[snum].score = est_cond_score(tcond, j); scores[snum].value = NULL; snum++; } if(hints){ cbmapiterinit(thints); while((kbuf = cbmapiternext(thints, &ksiz)) != NULL){ num = atoi(cbmapiterval(kbuf, NULL)); if((rp = cbmapget(hints, kbuf, ksiz, NULL)) != NULL) num += atoi(rp); sprintf(numbuf, "%d", num); cbmapput(hints, kbuf, ksiz, numbuf, -1, TRUE); } } free(res); cbmapclose(thints); est_cond_delete(tcond); } oname = NULL; otype = NULL; if(cond->order){ oname = cbmemdup(cond->order, -1); cbstrtrim(oname); otype = ESTORDSTRA; if((wp = strchr(oname, ' ')) != NULL){ *wp = '\0'; rp = wp + 1; while(*rp == ' '){ rp++; } otype = rp; } } if(oname){ if(!cbstricmp(oname, ESTORDIDA)){ qsort(scores, snum, sizeof(ESTMETASCORE), est_metascore_compare_by_id_asc); } else if(!cbstricmp(oname, ESTORDIDD)){ qsort(scores, snum, sizeof(ESTMETASCORE), est_metascore_compare_by_id_desc); } else if(!cbstricmp(oname, ESTORDSCA)){ qsort(scores, snum, sizeof(ESTMETASCORE), est_metascore_compare_by_score_asc); } else if(!cbstricmp(oname, ESTORDSCD)){ qsort(scores, snum, sizeof(ESTMETASCORE), est_metascore_compare_by_score_desc); } else { for(i = 0; i < snum; i++){ scores[i].value = est_db_get_doc_attr(dbs[scores[i].db], scores[i].id, oname); if(!scores[i].value) scores[i].value = cbmemdup("", 0); } if(!cbstricmp(otype, ESTORDSTRA)){ qsort(scores, snum, sizeof(ESTMETASCORE), est_metascore_compare_by_str_asc); } else if(!cbstricmp(otype, ESTORDSTRD)){ qsort(scores, snum, sizeof(ESTMETASCORE), est_metascore_compare_by_str_desc); } else if(!cbstricmp(otype, ESTORDNUMA)){ for(i = 0; i < snum; i++){ tval = cbstrmktime(scores[i].value); free(scores[i].value); scores[i].value = (void *)tval; } qsort(scores, snum, sizeof(ESTMETASCORE), est_metascore_compare_by_num_asc); for(i = 0; i < snum; i++){ scores[i].value = NULL; } } else if(!cbstricmp(otype, ESTORDNUMD)){ for(i = 0; i < snum; i++){ tval = cbstrmktime(scores[i].value); free(scores[i].value); scores[i].value = (void *)tval; } qsort(scores, snum, sizeof(ESTMETASCORE), est_metascore_compare_by_num_desc); for(i = 0; i < snum; i++){ scores[i].value = NULL; } } for(i = 0; i < snum; i++){ free(scores[i].value); } } free(oname); } else { qsort(scores, snum, sizeof(ESTMETASCORE), est_metascore_compare_by_score_desc); } if(distinct){ umap = cbmapopenex(snum + 1); rnum = 0; for(i = 0; i < snum; i++){ vbuf = est_db_get_doc_attr(dbs[scores[i].db], scores[i].id, distinct); if(!vbuf) vbuf = cbmemdup("", 0); if(cbmapput(umap, vbuf, -1, "", 0, FALSE)) scores[rnum++] = scores[i]; free(vbuf); } snum = rnum; cbmapclose(umap); } rnum = snum - skip; if(rnum < 0) rnum = 0; if(cond->max >= 0 && cond->max < rnum) rnum = cond->max; CB_MALLOC(res, rnum * sizeof(int) * 2 + 1); tscores = scores + skip; for(i = 0; i < rnum; i++){ res[i*2] = tscores[i].db; res[i*2+1] = tscores[i].id; } if(cond->scfb){ if(rnum > 0){ CB_REALLOC(cond->scores, rnum * sizeof(int) + 1); for(i = 0; i < rnum; i++){ cond->scores[i] = tscores[i].score; } cond->snum = rnum; } else { free(cond->scores); cond->scores = NULL; cond->snum = 0; } } *nump = rnum * 2; free(scores); cond->max = max; cond->skip = skip; cond->distinct = distinct; return res; } /* Check whether a document object matches the phrase of a search condition object definitely. */ int est_db_scan_doc(ESTDB *db, ESTDOC *doc, ESTCOND *cond){ struct { char *word; int num; } wsets[ESTSCANWNUM]; CBLIST *terms, *words; const char *term, *text; unsigned char *rbuf; char *tmp; int i, j, k, wsnum, add, rsiz, hit; assert(db && doc && cond); if(!cond->phrase || cbstrfwmatch(cond->phrase, ESTOPSIMILAR) || cbstrfwmatch(cond->phrase, ESTOPID) || cbstrfwmatch(cond->phrase, ESTOPURI)) return FALSE; if(!doc->dtexts) CB_LISTOPEN(doc->dtexts); switch(cond->pmode){ default: terms = est_phrase_terms(cond->phrase); break; case ESTPMSIMPLE: tmp = est_phrase_from_simple(cond->phrase); terms = est_phrase_terms(tmp); free(tmp); break; case ESTPMROUGH: tmp = est_phrase_from_rough(cond->phrase); terms = est_phrase_terms(tmp); free(tmp); break; case ESTPMUNION: tmp = est_phrase_from_union(cond->phrase); terms = est_phrase_terms(tmp); free(tmp); break; case ESTPMISECT: tmp = est_phrase_from_isect(cond->phrase); terms = est_phrase_terms(tmp); free(tmp); break; } wsnum = 0; add = TRUE; for(i = 0; i < CB_LISTNUM(terms); i++){ term = CB_LISTVAL(terms, i); if(!strcmp(term, ESTOPISECT)){ add = TRUE; } else if(!strcmp(term, ESTOPDIFF)){ add = FALSE; } else if(add && strcmp(term, ESTOPUVSET)){ if(term[0] == ' '){ term++; if(term[0] == 'b'){ term++; } else if(term[0] == 'e'){ term++; } } words = cbsplit(term, -1, "\t"); while(wsnum < ESTSCANWNUM && CB_LISTNUM(words) > 0){ wsets[wsnum].word = cblistshift(words, NULL); wsets[wsnum].num = i; wsnum++; } CB_LISTCLOSE(words); } } for(i = -1; i < CB_LISTNUM(doc->dtexts); i++){ if(i < 0){ if(!doc->attrs || !(text = cbmapget(doc->attrs, "", 0, NULL))) continue; } else { text = CB_LISTVAL(doc->dtexts, i); } rbuf = (unsigned char *)est_uconv_in(text, strlen(text), &rsiz); est_canonicalize_text(rbuf, rsiz, FALSE); tmp = est_uconv_out((char *)rbuf, rsiz, &rsiz); for(j = 0; j < wsnum; j++){ if(!wsets[j].word) continue; if(est_strstr_sparse(tmp, wsets[j].word)){ for(k = 0; k < wsnum; k++){ if(!wsets[k].word) continue; if(wsets[k].num == wsets[j].num){ free(wsets[k].word); wsets[k].word = NULL; } } } } free(tmp); free(rbuf); } hit = TRUE; for(i = 0; i < wsnum; i++){ if(!wsets[i].word) continue; free(wsets[i].word); hit = FALSE; } CB_LISTCLOSE(terms); return hit; } /* Set the maximum size of the cache memory of a database. */ void est_db_set_cache_size(ESTDB *db, size_t size, int anum, int tnum, int rnum){ assert(db); if(dpwritable(db->metadb) && size >= 0) db->icmax = size; if(anum >= 0) db->acmnum = anum; if(tnum >= 0) db->tcmnum = tnum; if(rnum >= 0) db->rcmnum = rnum; db->vcmnum = db->acmnum / 2; } /* Add a pseudo index directory to a database. */ int est_db_add_pseudo_index(ESTDB *db, const char *path){ CBLIST *files; const char *file; char pbuf[ESTPATHBUFSIZ]; int i, len; assert(db && path); if(!(files = cbdirlist(path))){ est_set_ecode(&(db->ecode), ESTEINVAL, __LINE__); return FALSE; } cblistsort(files); for(i = 0; i < CB_LISTNUM(files); i++){ file = CB_LISTVAL(files, i); if(!strcmp(file, ESTCDIRSTR) || !strcmp(file, ESTPDIRSTR)) continue; len = sprintf(pbuf, "%s%c%s", path, ESTPATHCHR, file); CB_LISTPUSH(db->pdocs, pbuf, len); } CB_LISTCLOSE(files); if(db->puris){ cbmapclose(db->puris); db->puris = NULL; } return TRUE; } /************************************************************************************************* * features for experts *************************************************************************************************/ /* Handle to the file of random number generator. */ FILE *est_random_ifp = NULL; /* POSIX signal handlers. */ void (*est_signal_handlers[ESTSIGNUM])(int); /* Break a sentence of text and extract words. */ void est_break_text(const char *text, CBLIST *list, int norm, int tail){ CBLIST *words; const unsigned char *word, *next; unsigned char *utext; char *tmp; int i, j, k, size, cc, wsiz, nsiz, tsiz; assert(text && list); utext = (unsigned char *)est_uconv_in(text, strlen(text), &size); if(norm) est_normalize_text(utext, size, &size); est_canonicalize_text(utext, size, FALSE); CB_LISTOPEN(words); for(i = 0; i < size; i += 2){ cc = est_char_category(utext[i] * 0x100 + utext[i+1]); for(j = i + 2; j < size; j += 2){ if(est_char_category(utext[j] * 0x100 + utext[j+1]) != cc) break; } switch(cc){ case ESTDELIMCHR: case ESTWESTALPH: CB_LISTPUSH(words, (char *)(utext + i), j - i); break; case ESTEASTALPH: for(k = i; k < j; k += 2){ if(j - k >= 4){ CB_LISTPUSH(words, (char *)(utext + k), 4); } else { CB_LISTPUSH(words, (char *)(utext + k), 2); } } break; default: break; } i = j - 2; } for(i = 0; i < CB_LISTNUM(words); i++){ word = (unsigned char *)CB_LISTVAL2(words, i, wsiz); if(est_char_category(word[0] * 0x100 + word[1]) == ESTEASTALPH && wsiz == 2 && i < CB_LISTNUM(words) - 1){ next = (unsigned char *)cblistval(words, i + 1, &nsiz); if(nsiz > 4) nsiz = 4; if(est_char_category(next[0] * 0x100 + next[1]) == ESTEASTALPH && nsiz > 2) nsiz = 2; CB_MALLOC(tmp, wsiz + nsiz + 1); memcpy(tmp, word, wsiz); memcpy(tmp + wsiz, next, nsiz); cblistover(words, i, tmp, wsiz + nsiz); free(tmp); } } for(i = 0; i < CB_LISTNUM(words); i++){ word = (unsigned char *)CB_LISTVAL2(words, i, wsiz); if(!tail && wsiz == 2 && i == CB_LISTNUM(words) - 1){ if(est_char_category(word[0] * 0x100 + word[1]) == ESTEASTALPH) continue; } tmp = est_uconv_out((char *)word, wsiz, &tsiz); CB_LISTPUSHBUF(list, tmp, tsiz); } CB_LISTCLOSE(words); free(utext); } /* Break a sentence of text and extract words using perfect N-gram analyzer. */ void est_break_text_perfng(const char *text, CBLIST *list, int norm, int tail){ CBLIST *words; const unsigned char *word, *next; unsigned char *utext; char *tmp; int i, j, k, size, cc, wsiz, nsiz, tsiz; assert(text && list); utext = (unsigned char *)est_uconv_in(text, strlen(text), &size); if(norm) est_normalize_text(utext, size, &size); est_canonicalize_text(utext, size, FALSE); CB_LISTOPEN(words); for(i = 0; i < size; i += 2){ cc = est_char_category_perfng(utext[i] * 0x100 + utext[i+1]); for(j = i + 2; j < size; j += 2){ if(est_char_category_perfng(utext[j] * 0x100 + utext[j+1]) != cc) break; } switch(cc){ case ESTEASTALPH: for(k = i; k < j; k += 2){ if(j - k >= 4){ CB_LISTPUSH(words, (char *)(utext + k), 4); } else { CB_LISTPUSH(words, (char *)(utext + k), 2); } } break; default: break; } i = j - 2; } for(i = 0; i < CB_LISTNUM(words); i++){ word = (unsigned char *)CB_LISTVAL2(words, i, wsiz); if(est_char_category_perfng(word[0] * 0x100 + word[1]) == ESTEASTALPH && wsiz == 2 && i < CB_LISTNUM(words) - 1){ next = (unsigned char *)cblistval(words, i + 1, &nsiz); if(nsiz > 4) nsiz = 4; if(est_char_category_perfng(next[0] * 0x100 + next[1]) == ESTEASTALPH && nsiz > 2) nsiz = 2; CB_MALLOC(tmp, wsiz + nsiz + 1); memcpy(tmp, word, wsiz); memcpy(tmp + wsiz, next, nsiz); cblistover(words, i, tmp, wsiz + nsiz); free(tmp); } } for(i = 0; i < CB_LISTNUM(words); i++){ word = (unsigned char *)CB_LISTVAL2(words, i, wsiz); if(!tail && wsiz == 2 && i == CB_LISTNUM(words) - 1){ if(est_char_category_perfng(word[0] * 0x100 + word[1]) == ESTEASTALPH) continue; } tmp = est_uconv_out((char *)word, wsiz, &tsiz); CB_LISTPUSHBUF(list, tmp, tsiz); } CB_LISTCLOSE(words); free(utext); } /* Make a snippet of an arbitrary string. */ char *est_str_make_snippet(const char *str, const CBLIST *words, int wwidth, int hwidth, int awidth){ assert(str && words && wwidth >= 0 && hwidth >= 0 && awidth >= 0); return est_make_snippet(str, strlen(str), words, wwidth, hwidth, awidth); } /* Break a sentence of text and extract words, using character category analyzer. `text' specifies a sentence of text. `list' specifies a list object to which extract words are added. `norm' specifies whether to normalize the text. */ void est_break_text_chrcat(const char *text, CBLIST *list, int norm){ unsigned char *utext; char *tmp; int i, j, size, cc, tsiz; assert(text && list); utext = (unsigned char *)est_uconv_in(text, strlen(text), &size); if(norm) est_normalize_text(utext, size, &size); est_canonicalize_text(utext, size, FALSE); for(i = 0; i < size; i += 2){ cc = est_char_category_chrcat(utext[i] * 0x100 + utext[i+1]); for(j = i + 2; j < size; j += 2){ if(est_char_category_chrcat(utext[j] * 0x100 + utext[j+1]) != cc && (cc != ESTWESTALPH || utext[j] != 0x00 || utext[j+1] != 0x2d) && (cc != ESTHIRAGANA || utext[j] != 0x30 || utext[j+1] != 0xfc)) break; } if(cc != ESTSPACECHR){ tmp = est_uconv_out((char *)(utext + i), j - i, &tsiz); CB_LISTPUSHBUF(list, tmp, tsiz); } i = j - 2; } free(utext); } /* Convert the character encoding of a string. */ char *est_iconv(const char *ptr, int size, const char *icode, const char *ocode, int *sp, int *mp){ iconv_t ic; char *obuf, *wp, *rp; size_t isiz, osiz; int miss; assert(ptr && icode && ocode); if(size < 0) size = strlen(ptr); if(icode[0] == 'x' && icode[1] == '-'){ if(!cbstricmp(icode, "x-sjis")){ icode = "Shift_JIS"; } else if(!cbstricmp(icode, "x-ujis")){ icode = "EUC-JP"; } else if(!cbstricmp(icode, "x-euc-jp")){ icode = "EUC-JP"; } } else if(icode[0] == 'w' || icode[0] == 'W'){ if(!cbstricmp(icode, "windows-31j")){ icode = "CP932"; } } if(ocode[0] == 'x' && ocode[1] == '-'){ if(!cbstricmp(ocode, "x-sjis")){ ocode = "Shift_JIS"; } else if(!cbstricmp(ocode, "x-ujis")){ ocode = "EUC-JP"; } else if(!cbstricmp(ocode, "x-euc-jp")){ ocode = "EUC-JP"; } } else if(ocode[0] == 'w' || ocode[0] == 'W'){ if(!cbstricmp(ocode, "windows-31j")){ ocode = "CP932"; } } if((ic = iconv_open(ocode, icode)) == (iconv_t)-1) return NULL; isiz = size; osiz = isiz * 5; CB_MALLOC(obuf, osiz + 1); wp = obuf; rp = (char *)ptr; miss = 0; while(isiz > 0){ if(iconv(ic, (void *)&rp, &isiz, &wp, &osiz) == -1){ if(errno == EILSEQ && (*rp == 0x5c || *rp == 0x7e)){ *wp = *rp; wp++; rp++; isiz--; } else if(errno == EILSEQ || errno == EINVAL){ rp++; isiz--; miss++; } else { break; } } } *wp = '\0'; if(sp) *sp = wp - obuf; if(mp) *mp = miss; if(iconv_close(ic) == -1){ free(obuf); return NULL; } return obuf; } /* Detect the encoding of a string automatically. */ const char *est_enc_name(const char *ptr, int size, int plang){ const char *hypo; int i, lim, miss, ascii, cr; assert(ptr); if(size < 0) size = strlen(ptr); if(size > ESTICCHECKSIZ) size = ESTICCHECKSIZ; if(size >= 2 && (!memcmp(ptr, "\xfe\xff", 2) || !memcmp(ptr, "\xff\xfe", 2))) return "UTF-16"; ascii = TRUE; cr = FALSE; lim = size - 1; for(i = 0; i < lim; i += 2){ if(ptr[i] == 0x0) return "UTF-16BE"; if(ptr[i+1] == 0x0) return "UTF-16LE"; if(ptr[i] < 0x0 || ptr[i] == 0x1b){ ascii = FALSE; } else if(ptr[i] == 0xd){ cr = TRUE; } } if(ascii) return "US-ASCII"; switch(plang){ case ESTLANGEN: if(est_enc_miss(ptr, size, "UTF-8", "UTF-16BE") < 1) return "UTF-8"; return "ISO-8859-1"; case ESTLANGJA: lim = size - 3; for(i = 0; i < lim; i++){ if(ptr[i] == 0x1b){ i++; if(ptr[i] == '(' && strchr("BJHI", ptr[i+1])) return "ISO-2022-JP"; if(ptr[i] == '$' && strchr("@B(", ptr[i+1])) return "ISO-2022-JP"; } } if(est_enc_miss(ptr, size, "UTF-8", "UTF-16BE") < 1) return "UTF-8"; hypo = NULL; if(cr){ if((miss = est_enc_miss(ptr, size, "Shift_JIS", "EUC-JP")) < 1) return "Shift_JIS"; if(!hypo && miss / (double)size <= ESTICALLWRAT) hypo = "Shift_JIS"; if((miss = est_enc_miss(ptr, size, "EUC-JP", "UTF-16BE")) < 1) return "EUC-JP"; if(!hypo && miss / (double)size <= ESTICALLWRAT) hypo = "EUC-JP"; } else { if((miss = est_enc_miss(ptr, size, "EUC-JP", "UTF-16BE")) < 1) return "EUC-JP"; if(!hypo && miss / (double)size <= ESTICALLWRAT) hypo = "EUC-JP"; if((miss = est_enc_miss(ptr, size, "Shift_JIS", "EUC-JP")) < 1) return "Shift_JIS"; if(!hypo && miss / (double)size <= ESTICALLWRAT) hypo = "Shift_JIS"; } if((miss = est_enc_miss(ptr, size, "UTF-8", "UTF-16BE")) < 1) return "UTF-8"; if(!hypo && miss / (double)size <= ESTICALLWRAT) hypo = "UTF-8"; if((miss = est_enc_miss(ptr, size, "CP932", "UTF-16BE")) < 1) return "CP932"; if(!hypo && miss / (double)size <= ESTICALLWRAT) hypo = "CP932"; return hypo ? hypo : "ISO-8859-1"; case ESTLANGZH: if(est_enc_miss(ptr, size, "UTF-8", "UTF-16BE") < 1) return "UTF-8"; if(est_enc_miss(ptr, size, "EUC-CN", "UTF-16BE") < 1) return "EUC-CN"; if(est_enc_miss(ptr, size, "BIG5", "UTF-16BE") < 1) return "BIG5"; return "ISO-8859-1"; case ESTLANGKO: if(est_enc_miss(ptr, size, "UTF-8", "UTF-16BE") < 1) return "UTF-8"; if(est_enc_miss(ptr, size, "EUC-KR", "UTF-16BE") < 1) return "EUC-KR"; return "ISO-8859-1"; default: break; } return "ISO-8859-1"; } /* Convert a UTF-8 string into UTF-16BE. */ char *est_uconv_in(const char *ptr, int size, int *sp){ const unsigned char *rp; char *rbuf, *wp; assert(ptr && size >= 0 && sp); rp = (unsigned char *)ptr; CB_MALLOC(rbuf, size * 2 + 1); wp = rbuf; while(rp < (unsigned char *)ptr + size){ if(*rp < 0x7f){ *(wp++) = 0x00; *(wp++) = *rp; rp += 1; } else if(*rp < 0xdf){ if(rp >= (unsigned char *)ptr + size - 1) break; *(wp++) = (rp[0] & 0x1f) >> 2; *(wp++) = (rp[0] << 6) | (rp[1] & 0x3f); rp += 2; } else if(*rp < 0xf0){ if(rp >= (unsigned char *)ptr + size - 2) break; *(wp++) = (rp[0] << 4) | ((rp[1] & 0x3f) >> 2); *(wp++) = (rp[1] << 6) | (rp[2] & 0x3f); rp += 3; } else if(*rp < 0xf8){ if(rp >= (unsigned char *)ptr + size - 3) break; *(wp++) = 0x00; *(wp++) = '?'; rp += 4; } else if(*rp < 0xfb){ if(rp >= (unsigned char *)ptr + size - 4) break; *(wp++) = 0x00; *(wp++) = '?'; rp += 5; } else if(*rp < 0xfd){ if(rp >= (unsigned char *)ptr + size - 5) break; *(wp++) = 0x00; *(wp++) = '?'; rp += 6; } else { break; } } *wp = '\0'; *sp = wp - rbuf; return rbuf; } /* Convert a UTF-16BE string into UTF-8. */ char *est_uconv_out(const char *ptr, int size, int *sp){ const unsigned char *rp; char *rbuf, *wp; int c; assert(ptr && size >= 0); if(size % 2 != 0) size--; rp = (unsigned char *)ptr; CB_MALLOC(rbuf, size * 2 + 1); wp = rbuf; while(rp < (unsigned char *)ptr + size){ c = rp[0] * 0x100 + rp[1]; if(c < 0x0080){ *(wp++) = rp[1]; } else if(c < 0x0900){ *(wp++) = 0xc0 | (rp[0] << 2) | ((rp[1] >> 6) & 0x03); *(wp++) = 0x80 | (rp[1] & 0x3f); } else { *(wp++) = 0xe0 | ((rp[0] >> 4) & 0x0f); *(wp++) = 0x80 | ((rp[0] & 0x0f) << 2) | ((rp[1] >> 6) & 0x03); *(wp++) = 0x80 | (rp[1] & 0x3f); } rp += 2; } *wp = '\0'; if(sp) *sp = wp - rbuf; return rbuf; } /* Compress a serial object with ZLIB. */ char *est_deflate(const char *ptr, int size, int *sp, int mode){ #if ESTUSEZLIB z_stream zs; char *buf; unsigned char obuf[ESTIOBUFSIZ]; int rv, asiz, bsiz, osiz; if(size < 0) size = strlen(ptr); zs.zalloc = Z_NULL; zs.zfree = Z_NULL; zs.opaque = Z_NULL; switch(mode){ case -1: if(deflateInit2(&zs, 5, Z_DEFLATED, -15, 7, Z_DEFAULT_STRATEGY) != Z_OK) return NULL; break; case 1: if(deflateInit2(&zs, 6, Z_DEFLATED, 15 + 16, 9, Z_DEFAULT_STRATEGY) != Z_OK) return NULL; break; default: if(deflateInit2(&zs, 6, Z_DEFLATED, 15, 8, Z_DEFAULT_STRATEGY) != Z_OK) return NULL; break; } asiz = size + 16; if(asiz < ESTIOBUFSIZ) asiz = ESTIOBUFSIZ; CB_MALLOC(buf, asiz); bsiz = 0; zs.next_in = (unsigned char *)ptr; zs.avail_in = size; zs.next_out = obuf; zs.avail_out = ESTIOBUFSIZ; while((rv = deflate(&zs, Z_FINISH)) == Z_OK){ osiz = ESTIOBUFSIZ - zs.avail_out; if(bsiz + osiz > asiz){ asiz = asiz * 2 + osiz; CB_REALLOC(buf, asiz); } memcpy(buf + bsiz, obuf, osiz); bsiz += osiz; zs.next_out = obuf; zs.avail_out = ESTIOBUFSIZ; } if(rv != Z_STREAM_END){ free(buf); deflateEnd(&zs); return NULL; } osiz = ESTIOBUFSIZ - zs.avail_out; if(bsiz + osiz + 1 > asiz){ asiz = asiz * 2 + osiz; CB_REALLOC(buf, asiz); } memcpy(buf + bsiz, obuf, osiz); bsiz += osiz; buf[bsiz] = '\0'; if(mode == -1) bsiz++; *sp = bsiz; deflateEnd(&zs); return buf; #else if(size < 0) size = strlen(ptr); *sp = size; return cbmemdup(ptr, size); #endif } /* Decompress a serial object compressed with ZLIB. */ char *est_inflate(const char *ptr, int size, int *sp, int mode){ #if ESTUSEZLIB z_stream zs; char *buf; unsigned char obuf[ESTIOBUFSIZ]; int rv, asiz, bsiz, osiz; zs.zalloc = Z_NULL; zs.zfree = Z_NULL; zs.opaque = Z_NULL; switch(mode){ case -1: if(inflateInit2(&zs, -15) != Z_OK) return NULL; break; case 1: if(inflateInit2(&zs, 15 + 16) != Z_OK) return NULL; break; default: if(inflateInit2(&zs, 15) != Z_OK) return NULL; break; } asiz = size * 2 + 16; if(asiz < ESTIOBUFSIZ) asiz = ESTIOBUFSIZ; CB_MALLOC(buf, asiz); bsiz = 0; zs.next_in = (unsigned char *)ptr; zs.avail_in = size; zs.next_out = obuf; zs.avail_out = ESTIOBUFSIZ; while((rv = inflate(&zs, Z_NO_FLUSH)) == Z_OK){ osiz = ESTIOBUFSIZ - zs.avail_out; if(bsiz + osiz >= asiz){ asiz = asiz * 2 + osiz; CB_REALLOC(buf, asiz); } memcpy(buf + bsiz, obuf, osiz); bsiz += osiz; zs.next_out = obuf; zs.avail_out = ESTIOBUFSIZ; } if(rv != Z_STREAM_END){ free(buf); inflateEnd(&zs); return NULL; } osiz = ESTIOBUFSIZ - zs.avail_out; if(bsiz + osiz >= asiz){ asiz = asiz * 2 + osiz; CB_REALLOC(buf, asiz); } memcpy(buf + bsiz, obuf, osiz); bsiz += osiz; buf[bsiz] = '\0'; if(sp) *sp = bsiz; inflateEnd(&zs); return buf; #else if(sp) *sp = size; return cbmemdup(ptr, size); #endif } /* Compress a serial object with LZO. */ char *est_lzoencode(const char *ptr, int size, int *sp){ #if ESTUSELZO char wrkmem[LZO1X_1_MEM_COMPRESS]; lzo_bytep buf; lzo_uint bsiz; if(size < 0) size = strlen(ptr); CB_MALLOC(buf, size + size / 16 + 80); if(lzo1x_1_compress((lzo_bytep)ptr, size, buf, &bsiz, wrkmem) != LZO_E_OK){ free(buf); return NULL; } buf[bsiz] = '\0'; *sp = bsiz; return (char *)buf; #else if(size < 0) size = strlen(ptr); *sp = size; return cbmemdup(ptr, size); #endif } /* Decompress a serial object compressed with LZO. */ char *est_lzodecode(const char *ptr, int size, int *sp){ #if ESTUSELZO lzo_bytep buf; lzo_uint bsiz; int rat, rv; rat = 4; while(TRUE){ bsiz = (size + 256) * rat + 3; CB_MALLOC(buf, bsiz + 1); rv = lzo1x_decompress_safe((lzo_bytep)(ptr), size, buf, &bsiz, NULL); if(rv == LZO_E_OK){ break; } else if(rv == LZO_E_OUTPUT_OVERRUN){ free(buf); rat *= 2; } else { free(buf); return NULL; } } buf[bsiz] = '\0'; if(sp) *sp = bsiz; return (char *)buf; #else if(sp) *sp = size; return cbmemdup(ptr, size); #endif } /* Compress a serial object with BZIP2. */ char *est_bzencode(const char *ptr, int size, int *sp){ #if ESTUSEBZIP bz_stream zs; char *buf, obuf[ESTIOBUFSIZ]; int rv, asiz, bsiz, osiz; if(size < 0) size = strlen(ptr); zs.bzalloc = NULL; zs.bzfree = NULL; zs.opaque = NULL; if(BZ2_bzCompressInit(&zs, 9, 0, 30) != BZ_OK) return NULL; asiz = size + 16; if(asiz < ESTIOBUFSIZ) asiz = ESTIOBUFSIZ; CB_MALLOC(buf, asiz); bsiz = 0; zs.next_in = (char *)ptr; zs.avail_in = size; zs.next_out = obuf; zs.avail_out = ESTIOBUFSIZ; while((rv = BZ2_bzCompress(&zs, BZ_FINISH)) == BZ_FINISH_OK){ osiz = ESTIOBUFSIZ - zs.avail_out; if(bsiz + osiz > asiz){ asiz = asiz * 2 + osiz; CB_REALLOC(buf, asiz); } memcpy(buf + bsiz, obuf, osiz); bsiz += osiz; zs.next_out = obuf; zs.avail_out = ESTIOBUFSIZ; } if(rv != BZ_STREAM_END){ free(buf); BZ2_bzCompressEnd(&zs); return NULL; } osiz = ESTIOBUFSIZ - zs.avail_out; if(bsiz + osiz + 1 > asiz){ asiz = asiz * 2 + osiz; CB_REALLOC(buf, asiz); } memcpy(buf + bsiz, obuf, osiz); bsiz += osiz; buf[bsiz] = '\0'; *sp = bsiz; BZ2_bzCompressEnd(&zs); return buf; #else if(size < 0) size = strlen(ptr); *sp = size; return cbmemdup(ptr, size); #endif } /* Decompress a serial object compressed with BZIP2. */ char *est_bzdecode(const char *ptr, int size, int *sp){ #if ESTUSEBZIP bz_stream zs; char *buf, obuf[ESTIOBUFSIZ]; int rv, asiz, bsiz, osiz; zs.bzalloc = NULL; zs.bzfree = NULL; zs.opaque = NULL; if(BZ2_bzDecompressInit(&zs, 0, 0) != BZ_OK) return NULL; asiz = size * 2 + 16; if(asiz < ESTIOBUFSIZ) asiz = ESTIOBUFSIZ; CB_MALLOC(buf, asiz); bsiz = 0; zs.next_in = (char *)ptr; zs.avail_in = size; zs.next_out = obuf; zs.avail_out = ESTIOBUFSIZ; while((rv = BZ2_bzDecompress(&zs)) == BZ_OK){ osiz = ESTIOBUFSIZ - zs.avail_out; if(bsiz + osiz >= asiz){ asiz = asiz * 2 + osiz; CB_REALLOC(buf, asiz); } memcpy(buf + bsiz, obuf, osiz); bsiz += osiz; zs.next_out = obuf; zs.avail_out = ESTIOBUFSIZ; } if(rv != BZ_STREAM_END){ free(buf); BZ2_bzDecompressEnd(&zs); return NULL; } osiz = ESTIOBUFSIZ - zs.avail_out; if(bsiz + osiz >= asiz){ asiz = asiz * 2 + osiz; CB_REALLOC(buf, asiz); } memcpy(buf + bsiz, obuf, osiz); bsiz += osiz; buf[bsiz] = '\0'; if(sp) *sp = bsiz; BZ2_bzDecompressEnd(&zs); return buf; #else if(sp) *sp = size; return cbmemdup(ptr, size); #endif } /* Get the border string for draft data of documents. */ const char *est_border_str(void){ static int first = TRUE; static char border[ESTPATHBUFSIZ]; int t, p; if(first){ t = (int)(time(NULL) + est_random() * INT_MAX); p = (int)(getpid() + est_random() * INT_MAX); sprintf(border, "--------[%08X%08X]--------", dpouterhash((char *)&t, sizeof(int)), dpouterhash((char *)&p, sizeof(int))); first = FALSE; } return border; } /* Get the real random number. */ double est_random(void){ static int first = TRUE; int num; if(first && !est_random_ifp){ if((est_random_ifp = fopen("/dev/urandom", "rb")) != NULL){ atexit(est_random_fclose); } else { srand(getpid()); } first = FALSE; } if(est_random_ifp){ fread(&num, sizeof(int), 1, est_random_ifp); return (num & INT_MAX) / (double)INT_MAX; } return rand() / (double)RAND_MAX; } /* Get the random number in normal distribution. */ double est_random_nd(void){ double d; d = (sqrt(-2 * log(1.0 - est_random())) * cos(3.1415926535 * 2 * est_random()) + 6.0) / 12.0; if(d > 1.0) d = 1.0; if(d < 0.0) d = 0.0; return d; } /* Get an MD5 hash string of a key string. */ char *est_make_crypt(const char *key){ md5_state_t ms; char digest[32], str[64], *wp; int i; assert(key); md5_init(&ms); md5_append(&ms, (md5_byte_t *)key, strlen(key)); md5_finish(&ms, (md5_byte_t *)digest); wp = str; for(i = 0; i < 16; i++){ wp += sprintf(wp, "%02x", ((unsigned char *)digest)[i]); } return cbmemdup(str, -1); } /* Check whether a key matches an MD5 hash string. */ int est_match_crypt(const char *key, const char *hash){ char *khash; int rv; assert(key && hash); khash = est_make_crypt(key); rv = !strcmp(khash, hash); free(khash); return rv; } /* Create a regular expression object. */ void *est_regex_new(const char *str){ regex_t regex; int options; assert(str); options = REG_EXTENDED | REG_NOSUB; if(str[0] == '*' && str[1] == 'I' && str[2] == ':'){ options |= REG_ICASE; str += 3; } if(regcomp(®ex, str, options) != 0) return NULL; return cbmemdup((char *)®ex, sizeof(regex_t)); } /* Delete a regular expression object. */ void est_regex_delete(void *regex){ assert(regex); regfree(regex); free(regex); } /* Check whether a regular expression matches a string. */ int est_regex_match(const void *regex, const char *str){ assert(regex && str); return regexec(regex, str, 0, NULL, 0) == 0; } /* Check whether a regular expression matches a string. */ int est_regex_match_str(const char *rstr, const char *tstr){ void *regex; int rv; assert(rstr && tstr); if(!(regex = est_regex_new(rstr))) return FALSE; rv = est_regex_match(regex, tstr); est_regex_delete(regex); return rv; } /* Replace each substring matching a regular expression string. */ char *est_regex_replace(const char *str, const char *bef, const char *aft){ regex_t regex; regmatch_t subs[256]; CBDATUM *datum; const char *sp, *rp; int options, first, num; assert(str && bef && aft); options = REG_EXTENDED; if(bef[0] == '*' && bef[1] == 'I' && bef[2] == ':'){ options |= REG_ICASE; bef += 3; } if(bef[0] == '\0' || regcomp(®ex, bef, options) != 0) return cbmemdup(str, -1); if(regexec(®ex, str, ESTREGSUBMAX, subs, 0) != 0){ regfree(®ex); return cbmemdup(str, -1); } sp = str; CB_DATUMOPEN(datum); first = TRUE; while(sp[0] != '\0' && regexec(®ex, sp, 10, subs, first ? 0 : REG_NOTBOL) == 0){ first = FALSE; if(subs[0].rm_so == -1) break; CB_DATUMCAT(datum, sp, subs[0].rm_so); for(rp = aft; *rp != '\0'; rp++){ if(*rp == '\\'){ if(rp[1] >= '0' && rp[1] <= '9'){ num = rp[1] - '0'; if(subs[num].rm_so != -1 && subs[num].rm_eo != -1) CB_DATUMCAT(datum, sp + subs[num].rm_so, subs[num].rm_eo - subs[num].rm_so); ++rp; } else if(rp[1] != '\0'){ CB_DATUMCAT(datum, ++rp, 1); } } else if(*rp == '&'){ CB_DATUMCAT(datum, sp + subs[0].rm_so, subs[0].rm_eo - subs[0].rm_so); } else { CB_DATUMCAT(datum, rp, 1); } } sp += subs[0].rm_eo; if(subs[0].rm_eo < 1) break; } CB_DATUMCAT(datum, sp, strlen(sp)); regfree(®ex); return cbdatumtomalloc(datum, NULL); } /* Duplicate a document object. */ ESTDOC *est_doc_dup(ESTDOC *doc){ ESTDOC *ndoc; assert(doc); CB_MALLOC(ndoc, sizeof(ESTDOC)); ndoc->id = doc->id; ndoc->attrs = doc->attrs ? cbmapdup(doc->attrs) : NULL; ndoc->dtexts = doc->dtexts ? cblistdup(doc->dtexts) : NULL; ndoc->kwords = doc->kwords ? cbmapdup(doc->kwords) : NULL; return ndoc; } /* Set the ID number of a document object. */ void est_doc_set_id(ESTDOC *doc, int id){ assert(doc); doc->id = id; } /* Get the hidden texts of a document object. */ const char *est_doc_hidden_texts(ESTDOC *doc){ const char *rv; assert(doc); rv = doc->attrs ? cbmapget(doc->attrs, "", 0, NULL) : NULL; return rv ? rv : ""; } /* Reduce the texts to fit to the specified size. */ void est_doc_slim(ESTDOC *doc, int len){ const char *vbuf; unsigned char *tbuf; int i, vsiz, tsiz; assert(doc && len >= 0); if(!doc->dtexts) return; if(doc->attrs && cbmapget(doc->attrs, "", 0, &vsiz)) len -= vsiz; for(i = 0; i < CB_LISTNUM(doc->dtexts); i++){ vbuf = CB_LISTVAL2(doc->dtexts, i, vsiz); len -= vsiz; if(len < 0){ tbuf = (unsigned char *)cbmemdup(vbuf, vsiz); tsiz = vsiz > -len ? vsiz + len : 0; if(tsiz > 0){ while(tsiz < vsiz){ if(tbuf[tsiz] <= ' ' || (tbuf[tsiz] & 0xf0) == 0xe0) break; tsiz++; } } while(CB_LISTNUM(doc->dtexts) > i){ CB_LISTDROP(doc->dtexts); } CB_LISTPUSHBUF(doc->dtexts, (char *)tbuf, tsiz); break; } } } /* Check whether a docuemnt object is empty. */ int est_doc_is_empty(ESTDOC *doc){ assert(doc); if((!doc->dtexts || CB_LISTNUM(doc->dtexts) < 1) && (!doc->attrs || !cbmapget(doc->attrs, "", 0, NULL))) return TRUE; return FALSE; } /* Duplicate a condition object. */ ESTCOND *est_cond_dup(ESTCOND *cond){ ESTCOND *ncond; assert(cond); CB_MALLOC(ncond, sizeof(ESTCOND)); ncond->phrase = cond->phrase ? cbmemdup(cond->phrase, -1) : NULL; ncond->gstep = cond->gstep; ncond->tfidf = cond->tfidf; ncond->pmode = cond->pmode; ncond->cbxpn = cond->cbxpn; ncond->attrs = cond->attrs ? cblistdup(cond->attrs) : NULL; ncond->order = cond->order ? cbmemdup(cond->order, -1) : NULL; ncond->max = cond->max; ncond->skip = cond->skip; ncond->auxmin = cond->auxmin; ncond->auxwords = cond->auxwords ? cbmapdup(cond->auxwords) : NULL; ncond->scfb = cond->scfb; ncond->scores = cond->scores ? (int *)cbmemdup((char *)cond->scores, cond->snum * sizeof(int)) : NULL; ncond->snum = cond->snum; ncond->nscores = cond->nscores; ncond->nsnum = cond->nsnum; ncond->opts = cond->opts; ncond->ecllim = cond->ecllim; ncond->shadows = cond->shadows ? cbmapdup(cond->shadows) : NULL; ncond->distinct = cond->distinct ? cbmemdup(cond->distinct, -1) : NULL; ncond->mask = cond->mask; return ncond; } /* Get the phrase of a condition object. */ const char *est_cond_phrase(ESTCOND *cond){ assert(cond); return cond->phrase; } /* Get a list object of attribute expressions of a condition object. */ const CBLIST *est_cond_attrs(ESTCOND *cond){ assert(cond); return cond->attrs; } /* Get the order expression of a condition object. */ const char *est_cond_order(ESTCOND *cond){ assert(cond); return cond->order; } /* Get the maximum number of retrieval of a condition object. */ int est_cond_max(ESTCOND *cond){ assert(cond); return cond->max; } /* Get the number of skipped documents of a condition object. */ int est_cond_skip(ESTCOND *cond){ assert(cond); return cond->skip; } /* Get the options of a condition object. */ int est_cond_options(ESTCOND *cond){ assert(cond); return cond->opts; } /* Get permission to adopt result of the auxiliary index. */ int est_cond_auxiliary(ESTCOND *cond){ assert(cond); return cond->auxmin; } /* Get the attribute distinction filter. */ const char *est_cond_distinct(ESTCOND *cond){ assert(cond); return cond->distinct; } /* Get the mask of targets of meta search. */ int est_cond_mask(ESTCOND *cond){ assert(cond); return cond->mask; } /* Get the score of a document corresponding to a condition object. */ int est_cond_score(ESTCOND *cond, int index){ assert(cond); if(!cond->scores || index < 0 || index >= cond->snum) return -1; return cond->scores[index]; } /* Get the score array of corresponding documents of a condition object. */ const int *est_cond_scores(ESTCOND *cond, int *nump){ assert(cond && nump); *nump = cond->snum; return cond->scores; } /* Set the narrowing scores of a condition object. */ void est_cond_set_narrowing_scores(ESTCOND *cond, const int *scores, int num){ assert(cond && scores && num >= 0); cond->nscores = scores; cond->nsnum = num; } /* Check whether a condition object has used the auxiliary index. */ int est_cond_auxiliary_word(ESTCOND *cond, const char *word){ assert(cond && word); if(!cond->auxwords) return FALSE; if(word[0] != '\0') return cbmapget(cond->auxwords, word, -1, NULL) != NULL; return cbmaprnum(cond->auxwords) > 0; } /* Get an array of ID numbers of eclipsed docuemnts of a document in a condition object. */ const int *est_cond_shadows(ESTCOND *cond, int id, int *np){ const char *vbuf; int vsiz; assert(cond && id > 0 && np); if(!cond->shadows || !(vbuf = cbmapget(cond->shadows, (char *)&id, sizeof(int), &vsiz))){ *np = 0; return (int *)""; } *np = vsiz / sizeof(int); return (int *)vbuf; } /* Set the callback function for query expansion. */ void est_cond_set_expander(ESTCOND *cond, void (*func)(const char *, CBLIST *)){ assert(cond && func); cond->cbxpn = func; } /* Set the error code of a database. */ void est_db_set_ecode(ESTDB *db, int ecode){ assert(db); est_set_ecode(&(db->ecode), ecode, __LINE__); } /* Check whether an option is set. */ int est_db_check_option(ESTDB *db, int option){ assert(db); switch(option){ case ESTDBREADER: return !dpwritable(db->metadb); case ESTDBWRITER: return dpwritable(db->metadb); case ESTDBCREAT: return -1; case ESTDBTRUNC: return -1; case ESTDBNOLCK: return -1; case ESTDBLCKNB: return -1; case ESTDBPERFNG: return db->amode == ESTDFPERFNG; case ESTDBCHRCAT: return db->amode == ESTDFCHRCAT; case ESTDBSMALL: return -1; case ESTDBLARGE: return -1; case ESTDBHUGE: return -1; case ESTDBHUGE2: return -1; case ESTDBHUGE3: return -1; case ESTDBSCVOID: return db->smode == ESTDFSCVOID; case ESTDBSCINT: return db->smode == ESTDFSCINT; case ESTDBSCASIS: return db->smode == ESTDFSCASIS; default: break; } return -1; } /* Get the inode number of a database. */ int est_db_inode(ESTDB *db){ assert(db); return db->inode; } /* Set the entity data of a document in a database. */ int est_db_set_doc_entity(ESTDB *db, int id, const char *ptr, int size){ int err; assert(db && id > 0); if(!dpwritable(db->metadb)){ est_set_ecode(&(db->ecode), ESTEACCES, __LINE__); return FALSE; } err = FALSE; if(ptr){ if(!crputlob(db->textdb, (char *)&id, sizeof(int), ptr, size, CR_DOVER)){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); err = TRUE; } } else { if(!croutlob(db->textdb, (char *)&id, sizeof(int))){ est_set_ecode(&(db->ecode), dpecode == DP_ENOITEM ? ESTENOITEM : ESTEDB, __LINE__); err = TRUE; } } return err ? FALSE : TRUE; } /* Set the maximum number of expansion of wild cards. */ void est_db_set_wildmax(ESTDB *db, int num){ assert(db && num >= 0); db->wildmax = num; } /* Get the entity data of a document in a database. */ char *est_db_get_doc_entity(ESTDB *db, int id, int *sp){ char *ptr; assert(db && id > 0 && sp); if(!(ptr = crgetlob(db->textdb, (char *)&id, sizeof(int), 0, -1, sp))){ est_set_ecode(&(db->ecode), dpecode == DP_ENOITEM ? ESTENOITEM : ESTEDB, __LINE__); return NULL; } return ptr; } /* Add a piece of meta data to a database. */ void est_db_add_meta(ESTDB *db, const char *name, const char *value){ assert(db && name); if(!dpwritable(db->metadb)){ est_set_ecode(&(db->ecode), ESTEACCES, __LINE__); return; } if(!db->metacc) est_db_prepare_meta(db); if(value){ cbmapput(db->metacc, name, -1, value, -1, TRUE); } else { cbmapout(db->metacc, name, -1); } } /* Get a list of names of meta data of a database. */ CBLIST *est_db_meta_names(ESTDB *db){ assert(db); if(!db->metacc) est_db_prepare_meta(db); return cbmapkeys(db->metacc); } /* Get the value of a piece of meta data of a database. */ char *est_db_meta(ESTDB *db, const char *name){ const char *vbuf; int vsiz; assert(db && name); if(!db->metacc) est_db_prepare_meta(db); if(!(vbuf = cbmapget(db->metacc, name, -1, &vsiz))) return NULL; return cbmemdup(vbuf, vsiz); } /* Extract keywords of a document object. */ CBMAP *est_db_etch_doc(ESTDB *db, ESTDOC *doc, int max){ ESTKEYSC *scores; CBMAP *keys, *umap; CBLIST *words; const char *text, *word, *vbuf; const unsigned char *uword; char numbuf[ESTNUMBUFSIZ]; int i, wsiz, num, smax, snum, vsiz; assert(doc && max >= 0); if(!doc->dtexts) return cbmapopenex(1); keys = cbmapopenex(max * 2 + 1); CB_LISTOPEN(words); for(i = -1; i < CB_LISTNUM(doc->dtexts); i++){ if(i < 0){ if(!doc->attrs || !(text = cbmapget(doc->attrs, "", 0, NULL))) continue; } else { text = CB_LISTVAL(doc->dtexts, i); } if(db){ switch(db->amode){ case ESTDFPERFNG: est_break_text_perfng(text, words, FALSE, FALSE); break; case ESTDFCHRCAT: est_break_text_chrcat(text, words, FALSE); break; default: est_break_text(text, words, FALSE, FALSE); break; } } else { est_break_text(text, words, FALSE, FALSE); } } umap = cbmapopenex(CB_LISTNUM(words) + 1); for(i = 0; i < CB_LISTNUM(words); i++){ word = CB_LISTVAL2(words, i, wsiz); if(wsiz > ESTWORDMAXLEN) continue; num = (vbuf = cbmapget(umap, word, wsiz, NULL)) ? *(int *)vbuf + 1 : 1; cbmapput(umap, word, wsiz, (char *)&num, sizeof(int), TRUE); } CB_MALLOC(scores, cbmaprnum(umap) * sizeof(ESTKEYSC) + 1); snum = 0; cbmapiterinit(umap); while((uword = (unsigned char *)cbmapiternext(umap, &wsiz)) != NULL){ scores[snum].word = (char *)uword; scores[snum].wsiz = wsiz; scores[snum].pt = (vbuf = cbmapiterval((char *)uword, NULL)) ? *(int *)vbuf : 0; if(uword[0] >= 0xe3){ if(wsiz <= 3){ scores[snum].pt /= 2; if((uword[0] == 0xe3 && (uword[1] == 0x80 || uword[1] == 0x81 || (uword[1] == 0x82 && uword[2] <= 0x9f))) || (uword[0] == 0xef && uword[1] >= 0xbc)) scores[snum].pt /= 2; } else { if((uword[0] == 0xe3 && (uword[1] == 0x80 || uword[1] == 0x81 || (uword[1] == 0x82 && uword[2] <= 0x9f))) || (uword[0] == 0xef && uword[1] >= 0xbc)) scores[snum].pt /= 2; if((uword[3] == 0xe3 && (uword[4] == 0x80 || uword[4] == 0x81 || (uword[4] == 0x82 && uword[5] <= 0x9f))) || (uword[3] == 0xef && uword[4] >= 0xbc)) scores[snum].pt /= 2; } } else if((uword[0] > '\0' && uword[0] <= '/') || (uword[0] >= ':' && uword[0] <= '@') || (uword[0] >= '[' && uword[0] <= '`') || (uword[0] >= '{' && uword[0] <= '~')){ scores[snum].pt /= 25; if(wsiz <= 1) scores[snum].pt /= 2; } else { switch(wsiz){ case 1: scores[snum].pt /= 9; break; case 2: scores[snum].pt /= 5; break; case 3: scores[snum].pt /= 3; break; case 4: scores[snum].pt /= 2; break; case 5: scores[snum].pt /= 1.5; break; case 6: scores[snum].pt /= 1.25; break; } } snum++; } qsort(scores, snum, sizeof(ESTKEYSC), est_keysc_compare); smax = max * (db ? ESTKEYSCALW : 1) + 1; snum = snum > smax ? smax : snum; if(db){ for(i = 0; i < snum; i++){ if((vbuf = cbmapget(db->keycc, scores[i].word, scores[i].wsiz, NULL)) != NULL){ cbmapmove(db->keycc, scores[i].word, scores[i].wsiz, FALSE); vsiz = *(int *)vbuf; } else { if(db->dfdb){ if((vsiz = dpgetwb(db->dfdb, scores[i].word, scores[i].wsiz, 0, ESTNUMBUFSIZ - 1, numbuf)) > 0){ numbuf[vsiz] = '\0'; vsiz = atoi(numbuf); } else { vsiz = 0; } } else { vsiz = est_idx_vsiz(db->idxdb, scores[i].word, scores[i].wsiz); if(cbmapget(db->idxcc, scores[i].word, scores[i].wsiz, &num)) vsiz += num; } cbmapput(db->keycc, scores[i].word, scores[i].wsiz, (char *)&vsiz, sizeof(int), FALSE); } scores[i].pt *= 100000.0 / pow(vsiz + 64, 0.6); } if(db->kcmnum >= 0 && cbmaprnum(db->keycc) > db->kcmnum){ num = db->kcmnum * 0.1 + 1; cbmapiterinit(db->keycc); for(i = 0; i < num && (word = cbmapiternext(db->keycc, &wsiz)) != NULL; i++){ cbmapout(db->keycc, word, wsiz); } } qsort(scores, snum, sizeof(ESTKEYSC), est_keysc_compare); } for(i = 0; i < snum && i < max; i++){ vsiz = sprintf(numbuf, "%d", scores[i].pt > 0 ? scores[i].pt : 1); cbmapput(keys, scores[i].word, scores[i].wsiz, numbuf, vsiz, FALSE); } free(scores); cbmapclose(umap); CB_LISTCLOSE(words); return keys; } /* Retrieve a map object of keywords. */ int est_db_put_keywords(ESTDB *db, int id, CBMAP *kwords, double weight){ const char *kbuf; char *mbuf; int err, ksiz, pair[2], msiz; assert(db && id > 0 && kwords && weight >= 0.0); if(!dpwritable(db->metadb)){ est_set_ecode(&(db->ecode), ESTEACCES, __LINE__); return FALSE; } if(crvsiz(db->attrdb, (char *)&id, sizeof(int)) == -1){ est_set_ecode(&(db->ecode), ESTENOITEM, __LINE__); return FALSE; } err = FALSE; if(!est_db_out_keywords(db, id) && db->ecode != ESTENOITEM) err = TRUE; pair[0] = id; cbmapiterinit(kwords); while((kbuf = cbmapiternext(kwords, &ksiz)) != NULL){ if(ksiz < 1 || (kbuf[0] >= '\0' && kbuf[0] <= ' ')) continue; pair[1] = (int)(atoi(cbmapiterval(kbuf, NULL)) * weight); cbmapputcat(db->auxcc, kbuf, ksiz, (char *)pair, sizeof(pair)); db->icsiz += sizeof(pair); } mbuf = cbmapdump(kwords, &msiz); if(!est_crput(db->kwddb, db->zmode, id, mbuf, msiz, CR_DOVER)){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; err = TRUE; } free(mbuf); return err ? FALSE : TRUE; } /* Remove keywords of a document. */ int est_db_out_keywords(ESTDB *db, int id){ CBMAP *kwords; const char *word; char wbuf[ESTWORDMAXLEN+3], *tbuf; int wsiz; assert(db && id > 0); if(!dpwritable(db->metadb)){ est_set_ecode(&(db->ecode), ESTEACCES, __LINE__); return FALSE; } if(id >= ESTPDOCIDMIN){ est_set_ecode(&(db->ecode), ESTEINVAL, __LINE__); return FALSE; } if((kwords = est_db_get_keywords(db, id)) != NULL){ cbmapiterinit(kwords); while((word = cbmapiternext(kwords, &wsiz)) != NULL){ if(wsiz > ESTWORDMAXLEN){ tbuf = cbsprintf(" %s", word); cbmapput(db->outcc, tbuf, wsiz + 1, "", 0, FALSE); free(tbuf); } else { sprintf(wbuf, " %s", word); cbmapput(db->outcc, wbuf, wsiz + 1, "", 0, FALSE); } } cbmapclose(kwords); } if(!est_crout(db->kwddb, id)){ if(dpecode == DP_ENOITEM){ est_set_ecode(&(db->ecode), ESTENOITEM, __LINE__); } else { est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; } return FALSE; } cbmapout(db->veccc, (char *)&id, sizeof(int)); return TRUE; } /* Retrieve a map object of keywords. */ CBMAP *est_db_get_keywords(ESTDB *db, int id){ CBMAP *kwords; const char *cbuf; char *mbuf; int i, csiz, msiz, num; assert(db && id > 0); if((cbuf = cbmapget(db->veccc, (char *)&id, sizeof(int), &csiz)) != NULL){ cbmapmove(db->veccc, (char *)&id, sizeof(int), FALSE); return cbmapload(cbuf, csiz); } if(!(mbuf = est_crget(db->kwddb, db->zmode, id, &msiz))){ est_set_ecode(&(db->ecode), ESTENOITEM, __LINE__); return NULL; } kwords = cbmapload(mbuf, msiz); if(db->vcmnum > 0) cbmapput(db->veccc, (char *)&id, sizeof(int), mbuf, msiz, TRUE); free(mbuf); if(cbmaprnum(db->veccc) > db->vcmnum){ num = cbmaprnum(db->veccc) * 0.1 + 1; cbmapiterinit(db->veccc); for(i = 0; i < num && (cbuf = cbmapiternext(db->veccc, NULL)) != NULL; i++){ cbmapout(db->veccc, cbuf, sizeof(int)); } } return kwords; } /* Mesure the total size of each inner records of a stored document. */ int est_db_measure_doc(ESTDB *db, int id, int parts){ int sum, num; assert(db && id > 0); sum = 0; if((parts & ESTMDATTR) && (num = crvsiz(db->attrdb, (char *)&id, sizeof(int))) > 0) sum += num; if((parts & ESTMDTEXT) && (num = crvsiz(db->textdb, (char *)&id, sizeof(int))) > 0) sum += num; if((parts & ESTMDKWD) && (num = crvsiz(db->kwddb, (char *)&id, sizeof(int))) > 0) sum += num; return sum; } /* Initialize the iterator of a database. */ int est_db_iter_init(ESTDB *db, const char *prev){ char *vbuf; assert(db); if(prev){ if(!vlcurjump(db->listdb, prev, -1, VL_JFORWARD)) return dpecode == DP_ENOITEM; if((vbuf = vlcurkey(db->listdb, NULL)) != NULL){ if(strcmp(prev, vbuf) >= 0) vlcurnext(db->listdb); free(vbuf); } return TRUE; } return vlcurfirst(db->listdb) || dpecode == DP_ENOITEM; } /* Get the next ID of the iterator of a database. */ int est_db_iter_next(ESTDB *db){ char *vbuf; int id; assert(db); if(!(vbuf = vlcurval(db->listdb, NULL))){ if(dpecode == DP_ENOITEM){ est_set_ecode(&(db->ecode), ESTENOITEM, __LINE__); return 0; } else { est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; return -1; } } id = atoi(vbuf); free(vbuf); vlcurnext(db->listdb); return id; } /* Initialize the word iterator of a database. */ int est_db_word_iter_init(ESTDB *db){ assert(db); if(!vlcurfirst(db->fwmdb) && dpecode != DP_ENOITEM){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; return FALSE; } return TRUE; } /* Get the next word of the word iterator of a database. */ char *est_db_word_iter_next(ESTDB *db){ char *word; assert(db); if(!(word = vlcurkey(db->fwmdb, NULL))){ if(dpecode == DP_ENOITEM){ est_set_ecode(&(db->ecode), ESTENOITEM, __LINE__); } else { est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; } return NULL; } vlcurnext(db->fwmdb); return word; } /* Get the size of the record of a word. */ int est_db_word_rec_size(ESTDB *db, const char *word){ int num; assert(db && word); if(!cbmapget(db->idxcc, word, -1, &num)) num = 0; return est_idx_vsiz(db->idxdb, word, strlen(word)) + num; } /* Get the number of unique keywords in a database. */ int est_db_keyword_num(ESTDB *db){ int wnum; assert(db); wnum = vlrnum(db->xfmdb); return wnum > 0 ? wnum : 0; } /* Initialize the keyword iterator of a database. */ int est_db_keyword_iter_init(ESTDB *db){ assert(db); if(!vlcurfirst(db->xfmdb) && dpecode != DP_ENOITEM){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; return FALSE; } return TRUE; } /* Get the next keyword of the word iterator of a database. */ char *est_db_keyword_iter_next(ESTDB *db){ char *word; assert(db); if(!(word = vlcurkey(db->xfmdb, NULL))){ if(dpecode == DP_ENOITEM){ est_set_ecode(&(db->ecode), ESTENOITEM, __LINE__); } else { est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; } return NULL; } vlcurnext(db->xfmdb); return word; } /* Get the size of the record of a keyword. */ int est_db_keyword_rec_size(ESTDB *db, const char *word){ const char *kbuf; assert(db && word); return (kbuf = vlgetcache(db->xfmdb, word, -1, NULL)) != NULL ? atoi(kbuf) : 0; } /* Search documents corresponding a keyword for a database. */ int *est_db_keyword_search(ESTDB *db, const char *word, int *nump){ int i, *res, rnum; assert(db && word && nump); if(!(res = (int *)vlget(db->auxdb, word, -1, &rnum))){ *nump = 0; CB_MALLOC(res, 1); return res; } rnum /= sizeof(int) * 2; for(i = 0; i < rnum; i++){ res[i] = res[i*2]; } *nump = rnum; return res; } /* Get the number of records in the cache memory of a database. */ int est_db_cache_num(ESTDB *db){ assert(db); return cbmaprnum(db->idxcc); } /* Get the size of used cache region. */ int est_db_used_cache_size(ESTDB *db){ assert(db); return (db->icsiz + (cbmaprnum(db->idxcc) + cbmaprnum(db->auxcc)) * (sizeof(CBMAPDATUM) + ESTWORDAVGLEN)) * ESTMEMIRATIO; } /* Set the special cache for narrowing and sorting with document attributes. */ void est_db_set_special_cache(ESTDB *db, const char *name, int num){ assert(db && name && num >= 0); if(db->spacc){ free(db->scname); cbmapclose(db->spacc); } db->spacc = cbmapopenex(num + 1); db->scmnum = num; db->scname = cbmemdup(name, -1); } /* Set the callback function for database events. */ void est_db_set_informer(ESTDB *db, void (*func)(const char *, void *), void *opaque){ assert(db && func); db->infocb = func; db->infoop = opaque; est_db_inform(db, "status"); } /* Fill the cache for keys for TF-IDF. */ void est_db_fill_key_cache(ESTDB *db){ const char *kbuf; char *msg; int i, ksiz, vsiz; assert(db); vlcurfirst(db->fwmdb); for(i = 0; (kbuf = vlcurkeycache(db->fwmdb, &ksiz)) != NULL; i++){ vsiz = est_idx_vsiz(db->idxdb, kbuf, ksiz); cbmapput(db->keycc, kbuf, ksiz, (char *)&vsiz, sizeof(int), TRUE); vlcurnext(db->fwmdb); if(i % ESTCCCBFREQ == 0){ msg = cbsprintf("filling the key cache for TF-IDF (%d)", i + 1); est_db_inform(db, msg); free(msg); } } db->kcmnum = -1; } /* Set the database of document frequency. */ void est_db_set_dfdb(ESTDB *db, DEPOT *dfdb){ assert(db); db->dfdb = dfdb; } /* Clear the result cache. */ void est_db_refresh_rescc(ESTDB *db){ ESTSCORE sc; const char *word; int size; assert(db); sc.id = -1; sc.score = 0; sc.value = NULL; cbmapiterinit(db->rescc); while((word = cbmapiternext(db->rescc, &size)) != NULL){ cbmapput(db->rescc, word, size, (char *)&sc, sizeof(ESTSCORE), TRUE); } } /* Charge the result cache. */ void est_db_charge_rescc(ESTDB *db, int max){ CBLIST *words; const char *word, *vbuf; int i, num, size, vsiz; assert(db); if(max < 0) max = INT_MAX; CB_LISTOPEN(words); cbmapiterinit(db->rescc); while((word = cbmapiternext(db->rescc, &size)) != NULL){ CB_MAPITERVAL(vbuf, word, vsiz); if(vsiz == sizeof(ESTSCORE) && ((ESTSCORE *)vbuf)->id == -1) CB_LISTPUSH(words, word, size); } num = CB_LISTNUM(words); for(i = 0; i < max && i < num; i++){ word = cblistval(words, num - i - 1, &size); free(est_search_union(db, word, 1, NULL, &size, NULL, TRUE, -1, NULL)); } CB_LISTCLOSE(words); } /* Get a list of words in the result cache. */ CBLIST *est_db_list_rescc(ESTDB *db){ CBLIST *words; const char *word; int size; assert(db); CB_LISTOPEN(words); cbmapiterinit(db->rescc); while((word = cbmapiternext(db->rescc, &size)) != NULL){ cblistunshift(words, word, size); } return words; } /* Get the number of pseudo documents in a database. */ int est_db_pseudo_doc_num(ESTDB *db){ assert(db); return cblistnum(db->pdocs); } /* Get a list of expressions of attribute indexes of a database. */ CBLIST *est_db_attr_index_exprs(ESTDB *db){ ESTATTRIDX *attridx; CBLIST *list; const char *kbuf; char *expr; assert(db); list = cblistopen(); cbmapiterinit(db->aidxs); while((kbuf = cbmapiternext(db->aidxs, NULL)) != NULL){ attridx = (ESTATTRIDX *)cbmapiterval(kbuf, NULL); switch(attridx->type){ case ESTIDXATTRSTR: expr = cbsprintf("%s=str", kbuf); break; case ESTIDXATTRNUM: expr = cbsprintf("%s=num", kbuf); break; default: expr = cbsprintf("%s=seq", kbuf); break; } CB_LISTPUSHBUF(list, expr, strlen(expr)); } return list; } /* Interrupt long time processing. */ void est_db_interrupt(ESTDB *db){ assert(db); db->intflag = TRUE; } /* Repair a broken database directory. */ int est_db_repair(const char *name, int options, int *ecp){ ESTDB *db; DEPOT *depot, *metadb; CURIA *curia, *attrdb, *textdb, *kwddb; VILLA *villa, *listdb; CBLIST *list; CBMAP *aidxs, *attrs; ESTATTRIDX attridx, *attridxp; void *aidxdb; const char *elem, *abuf; char path[ESTPATHBUFSIZ], *kbuf, vbuf[ESTNUMBUFSIZ], *dec, *mbuf; int i, err, idmax, flags, zmode, dnum, dseq, ksiz, vsiz, type, id, msiz, esiz, asiz; assert(name && ecp); sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTMETADBNAME); if(est_inode(path) == -1){ est_set_ecode(ecp, ESTEIO, __LINE__); return FALSE; } if(!(options & ESTRPSTRICT) && (depot= dpopen(path, DP_OWRITER, -1)) != NULL){ dpclose(depot); } else { dprepair(path); } sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTIDXDBNAME); if(est_inode(path) == -1){ est_set_ecode(ecp, ESTEIO, __LINE__); return FALSE; } if((list = cbdirlist(path)) != NULL){ for(i = 1; i < CB_LISTNUM(list); i++){ elem = CB_LISTVAL(list, i); if(elem[0] < '0' || elem[0] > '9') continue; sprintf(path, "%s%c%s%c%s", name, ESTPATHCHR, ESTIDXDBNAME, ESTPATHCHR, elem); if(!(options & ESTRPSTRICT) && (villa = vlopen(path, VL_OWRITER, VL_CMPLEX)) != NULL){ vlclose(villa); } else { vlrepair(path, VL_CMPLEX); } } CB_LISTCLOSE(list); } sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTFWMDBNAME); if(est_inode(path) == -1){ est_set_ecode(ecp, ESTEIO, __LINE__); return FALSE; } if(!(options & ESTRPSTRICT) && (villa = vlopen(path, VL_OWRITER, VL_CMPLEX)) != NULL){ vlclose(villa); } else { vlrepair(path, VL_CMPLEX); } sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTAUXDBNAME); if(est_inode(path) == -1){ est_set_ecode(ecp, ESTEIO, __LINE__); return FALSE; } if(!(options & ESTRPSTRICT) && (villa = vlopen(path, VL_OWRITER, VL_CMPLEX)) != NULL){ vlclose(villa); } else { vlrepair(path, VL_CMPLEX); } sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTXFMDBNAME); if(est_inode(path) == -1){ est_set_ecode(ecp, ESTEIO, __LINE__); return FALSE; } if(!(options & ESTRPSTRICT) && (villa = vlopen(path, VL_OWRITER, VL_CMPLEX)) != NULL){ vlclose(villa); } else { vlrepair(path, VL_CMPLEX); } sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTATTRDBNAME); if(est_inode(path) == -1){ est_set_ecode(ecp, ESTEIO, __LINE__); return FALSE; } if(!(options & ESTRPSTRICT) && (curia = cropen(path, CR_OWRITER, -1, -1)) != NULL){ crclose(curia); } else { crrepair(path); } sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTTEXTDBNAME); if(est_inode(path) == -1){ est_set_ecode(ecp, ESTEIO, __LINE__); return FALSE; } if(!(options & ESTRPSTRICT) && (curia = cropen(path, CR_OWRITER, -1, -1)) != NULL){ crclose(curia); } else { crrepair(path); } sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTKWDDBNAME); if(est_inode(path) == -1){ est_set_ecode(ecp, ESTEIO, __LINE__); return FALSE; } if(!(options & ESTRPSTRICT) && (curia = cropen(path, CR_OWRITER, -1, -1)) != NULL){ crclose(curia); } else { crrepair(path); } sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTLISTDBNAME); if(est_inode(path) == -1){ est_set_ecode(ecp, ESTEIO, __LINE__); return FALSE; } if(!(options & ESTRPSTRICT) && (villa = vlopen(path, VL_OWRITER, VL_CMPLEX)) != NULL){ vlclose(villa); } else { vlrepair(path, VL_CMPLEX); } if((list = cbdirlist(name)) != NULL){ for(i = 0; i < CB_LISTNUM(list); i++){ elem = CB_LISTVAL(list, i); if(cbstrfwmatch(elem, ESTAISEQPREF)){ sprintf(path, "%s%c%s", name, ESTPATHCHR, elem); if(!(options & ESTRPSTRICT) && (depot = dpopen(path, DP_OWRITER, -1)) != NULL){ dpclose(depot); } else { dprepair(path); } } else if(cbstrfwmatch(elem, ESTAISTRPREF)){ sprintf(path, "%s%c%s", name, ESTPATHCHR, elem); if(!(options & ESTRPSTRICT) && (villa = vlopen(path, VL_OWRITER, VL_CMPLEX)) != NULL){ vlclose(villa); } else { vlrepair(path, VL_CMPLEX); } } else if(cbstrfwmatch(elem, ESTAINUMPREF)){ sprintf(path, "%s%c%s", name, ESTPATHCHR, elem); if(!(options & ESTRPSTRICT) && (villa = vlopen(path, VL_OWRITER, VL_CMPLEX)) != NULL){ vlclose(villa); } else { vlrepair(path, VL_CMPLEX); } } } CB_LISTCLOSE(list); } if((options & ESTRPSHODDY) && (db = est_db_open(name, ESTDBWRITER, ecp)) != NULL){ if(!est_db_close(db, ecp)) return FALSE; return TRUE; } sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTMETADBNAME); metadb = dpopen(path, DP_OWRITER, -1); sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTATTRDBNAME); attrdb = cropen(path, CR_OWRITER, -1, -1); sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTTEXTDBNAME); textdb = cropen(path, CR_OWRITER, -1, -1); sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTKWDDBNAME); kwddb = cropen(path, CR_OWRITER, -1, -1); sprintf(path, "%s%c%s", name, ESTPATHCHR, ESTLISTDBNAME); listdb = vlopen(path, VL_OWRITER, VL_CMPLEX); if(!attrdb || !textdb || !kwddb || !listdb){ if(listdb) vlclose(listdb); if(kwddb) crclose(kwddb); if(textdb) crclose(textdb); if(attrdb) crclose(attrdb); if(metadb) dpclose(metadb); est_set_ecode(ecp, ESTEDB, __LINE__); return FALSE; } aidxs = cbmapopenex(ESTMINIBNUM); if((list = cbdirlist(name)) != NULL){ for(i = 0; i < CB_LISTNUM(list); i++){ elem = CB_LISTVAL(list, i); dec = NULL; type = -1; if(cbstrfwmatch(elem, ESTAISEQPREF)){ dec = est_hex_decode(elem + strlen(ESTAISEQPREF)); type = ESTIDXATTRSEQ; } else if(cbstrfwmatch(elem, ESTAISTRPREF)){ dec = est_hex_decode(elem + strlen(ESTAISTRPREF)); type = ESTIDXATTRSTR; } else if(cbstrfwmatch(elem, ESTAINUMPREF)){ dec = est_hex_decode(elem + strlen(ESTAINUMPREF)); type = ESTIDXATTRNUM; } if(dec){ sprintf(path, "%s%c%s", name, ESTPATHCHR, elem); switch(type){ case ESTIDXATTRSTR: if((aidxdb = vlopen(path, VL_OWRITER, VL_CMPLEX)) != NULL){ vlsettuning(aidxdb, ESTAIDXLRM, ESTAIDXNIM, ESTAIDXLCN, ESTAIDXNCN); vlsetfbpsiz(aidxdb, ESTAIDXVLFBP); attridx.db = aidxdb; attridx.type = type; cbmapput(aidxs, dec, -1, (char *)&attridx, sizeof(ESTATTRIDX), FALSE); } break; case ESTIDXATTRNUM: if((aidxdb = vlopen(path, VL_OWRITER, est_aidx_numcmp)) != NULL){ vlsettuning(aidxdb, ESTAIDXLRM, ESTAIDXNIM, ESTAIDXLCN, ESTAIDXNCN); vlsetfbpsiz(aidxdb, ESTAIDXVLFBP); attridx.db = aidxdb; attridx.type = type; cbmapput(aidxs, dec, -1, (char *)&attridx, sizeof(ESTATTRIDX), FALSE); } break; default: if((aidxdb = dpopen(path, DP_OWRITER, crbnum(attrdb) / ESTAIBDIAM)) != NULL){ dpsetfbpsiz(aidxdb, ESTAIDXDPFBP); attridx.db = aidxdb; attridx.type = type; cbmapput(aidxs, dec, -1, (char *)&attridx, sizeof(ESTATTRIDX), FALSE); } break; } free(dec); } } CB_LISTCLOSE(list); } err = FALSE; idmax = 0; if((vsiz = dpgetwb(metadb, ESTKEYDNUM, -1, 0, ESTNUMBUFSIZ - 1, vbuf)) > 0){ vbuf[vsiz] = '\0'; idmax = atoi(vbuf); } flags = dpgetflags(metadb); zmode = 0; if(flags & ESTDFZLIB){ zmode = ESTDFZLIB; } else if(flags & ESTDFLZO){ zmode = ESTDFLZO; } else if(flags & ESTDFBZIP){ zmode = ESTDFBZIP; } dnum = 0; dseq = 0; CB_LISTOPEN(list); if(!criterinit(attrdb)) err = TRUE; while((kbuf = criternext(attrdb, &ksiz)) != NULL){ if(ksiz == sizeof(int) && (id = *(int *)kbuf) > 0 && id <= idmax && crvsiz(attrdb, kbuf, ksiz) > 0 && crvsiz(textdb, kbuf, ksiz) > 0){ dnum++; if(dseq < id) dseq = id; if(options & ESTRPSTRICT){ if((mbuf = est_crget(attrdb, zmode, id, &msiz)) != NULL){ attrs = cbmapload(mbuf, msiz); if((elem = cbmapget(attrs, ESTDATTRURI, -1, &esiz)) != NULL){ vsiz = sprintf(vbuf, "%d", id); vlput(listdb, elem, esiz, vbuf, vsiz, VL_DKEEP); } if(cbmaprnum(aidxs) > 0){ cbmapiterinit(aidxs); while((abuf = cbmapiternext(aidxs, &asiz)) != NULL){ if(!(elem = cbmapget(attrs, abuf, asiz, &esiz))) continue; attridxp = (ESTATTRIDX *)cbmapiterval(abuf, NULL); switch(attridxp->type){ case ESTIDXATTRSTR: case ESTIDXATTRNUM: est_aidx_attr_put(attridxp->db, id, elem, esiz); break; default: est_aidx_seq_put(attridxp->db, id, elem, esiz); break; } } } cbmapclose(attrs); free(mbuf); } } } else { CB_LISTPUSH(list, kbuf, ksiz); } free(kbuf); } if(dpecode != DP_ENOITEM) err = TRUE; for(i = 0; i < CB_LISTNUM(list); i++){ elem = CB_LISTVAL2(list, i, esiz); crout(attrdb, elem, esiz); crout(textdb, elem, esiz); crout(kwddb, elem, esiz); } CB_LISTCLOSE(list); sprintf(vbuf, "%d", dseq); if(!dpput(metadb, ESTKEYDSEQ, -1, vbuf, -1, DP_DOVER)) err = TRUE; sprintf(vbuf, "%d", dnum); if(!dpput(metadb, ESTKEYDNUM, -1, vbuf, -1, DP_DOVER)) err = TRUE; cbmapiterinit(aidxs); while((elem = cbmapiternext(aidxs, NULL)) != NULL){ attridxp = (ESTATTRIDX *)cbmapiterval(elem, NULL); switch(attridxp->type){ case ESTIDXATTRSTR: case ESTIDXATTRNUM: if(!vlclose(attridxp->db)) err = TRUE; break; default: if(!dpclose(attridxp->db)) err = TRUE; break; } } cbmapclose(aidxs); if(!vlclose(listdb)) err = TRUE; if(!crclose(kwddb)) err = TRUE; if(!crclose(textdb)) err = TRUE; if(!crclose(attrdb)) err = TRUE; if(!dpclose(metadb)) err = TRUE; if(err){ est_set_ecode(ecp, ESTEDB, __LINE__); return FALSE; } return err ? FALSE : TRUE; } /* Extract words for snippet from hints of search. */ CBLIST *est_hints_to_words(CBMAP *hints){ CBLIST *words; const char *kbuf; int ksiz; assert(hints); CB_LISTOPEN(words); cbmapiterinit(hints); while((kbuf = cbmapiternext(hints, &ksiz)) != NULL){ if(ksiz < 1 || atoi(cbmapget(hints, kbuf, ksiz, NULL)) < 0) continue; CB_LISTPUSH(words, kbuf, ksiz); } return words; } /* Add a record into a result map for logical operation. */ void est_resmap_add(CBMAP *map, const char *key, int score, int method){ int elem[2], *ep, size; assert(map && key); size = strlen(key); if((ep = (int *)cbmapget(map, key, size, NULL)) != NULL){ elem[0] = ep[0] + 1; switch(method){ case ESTRMLOSUM: elem[1] = ep[1] + score; break; case ESTRMLOMAX: elem[1] = score > ep[1] ? score : ep[1]; break; case ESTRMLOMIN: elem[1] = score < ep[1] ? score : ep[1]; break; case ESTRMLOAVG: elem[1] = (ep[1] * (ep[0] - 1) + score) / ep[0]; break; default: elem[1] = score; break; } } else { elem[0] = 1; elem[1] = score; } cbmapput(map, key, size, (char *)&elem, sizeof(int) * 2, TRUE); } /* Compare two result elements by score. `ap' specifies the pointer to one element. `bp' specifies the pointer to the other element. The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int est_resmapelem_compare(const void *ap, const void *bp){ assert(ap && bp); return ((ESTRESMAPELEM *)bp)->score - ((ESTRESMAPELEM *)ap)->score; } /* Dump a result list of a result map for logical operation. */ ESTRESMAPELEM *est_resmap_dump(CBMAP *map, int min, int *nump){ ESTRESMAPELEM *elems; const char *key, *vbuf; int num, vsiz; assert(map && min >= 0 && nump); CB_MALLOC(elems, cbmaprnum(map) * sizeof(ESTRESMAPELEM) + 1); num = 0; cbmapiterinit(map); while((key = cbmapiternext(map, NULL)) != NULL){ CB_MAPITERVAL(vbuf, key, vsiz); if(((int *)vbuf)[0] < min) continue; elems[num].key = key; elems[num].score = ((int *)vbuf)[1]; num++; } qsort(elems, num, sizeof(ESTRESMAPELEM), est_resmapelem_compare); *nump = num; return elems; } /* Reset the environment of the process. */ void est_proc_env_reset(void){ char *value, *pbuf; cbstdiobin(); putenv("LANG=C"); putenv("LANGUAGE=C"); putenv("LC_CTYPE=C"); putenv("LC_COLLATE=C"); putenv("LC_TIME=C"); putenv("LC_NUMERIC=C"); putenv("LC_MONETARY=C"); putenv("LC_ALL=C"); putenv("EST_VERSION=" _EST_VERSION); if((value = getenv("PATH")) != NULL){ if(ESTPATHCHR == '\\'){ pbuf = cbsprintf("PATH=%s;C:\\hyperestraier;D:\\hyperestraier;E:\\hyperestraier", value); } else { pbuf = cbsprintf("PATH=%s:/bin:/sbin:/usr/bin:/usr/sbin:" "/usr/local/bin:/usr/local/sbin", value); } putenv(pbuf); cbglobalgc(pbuf, free); } } /* Make a directory. */ int est_mkdir(const char *path){ #if defined(_SYS_MSVC_) || defined(_SYS_MINGW_) assert(path); return mkdir(path) == 0 ? TRUE : FALSE; #else assert(path); return mkdir(path, ESTDIRMODE) == 0 ? TRUE : FALSE; #endif } /* Remove a directory and its contents recursively. */ int est_rmdir_rec(const char *path){ CBLIST *files; const char *file; char pbuf[ESTPATHBUFSIZ]; int i; assert(path); if((files = cbdirlist(path)) != NULL){ for(i = 0; i < CB_LISTNUM(files); i++){ file = CB_LISTVAL(files, i); if(!strcmp(file, ESTCDIRSTR) || !strcmp(file, ESTPDIRSTR)) continue; sprintf(pbuf, "%s%c%s", path, ESTPATHCHR, file); if(unlink(pbuf) == -1) est_rmdir_rec(pbuf); } CB_LISTCLOSE(files); } return rmdir(path) == 0; } /* Get the canonicalized absolute pathname of a file. */ char *est_realpath(const char *path){ #if defined(_SYS_MSVC_) || defined(_SYS_MINGW_) char pbuf[ESTPATHBUFSIZ*2], *p; assert(path); if(GetFullPathName(path, ESTPATHBUFSIZ, pbuf, &p) == 0){ if((((path[0] >= 'A' && path[0] <= 'Z') || (path[0] >= 'a' && path[0] <= 'z')) && path[1] == ':' && path[2] == ESTPATHCHR) || path[0] == ESTPATHCHR || GetFullPathName(ESTCDIRSTR, ESTPATHBUFSIZ, pbuf, &p) == 0){ sprintf(pbuf, "%s", path); } else { sprintf(pbuf + strlen(pbuf), "%c%s", ESTPATHCHR, path); } } return cbmemdup(pbuf, -1); #else char pbuf[ESTPATHBUFSIZ*2]; assert(path); if(!realpath(path, pbuf)){ if(path[0] == ESTPATHCHR || !realpath(ESTCDIRSTR, pbuf)){ sprintf(pbuf, "%s", path); } else { sprintf(pbuf + strlen(pbuf), "%c%s", ESTPATHCHR, path); } } return cbmemdup(pbuf, -1); #endif } /* Get the inode number of a file. */ int est_inode(const char *path){ #if defined(_SYS_MSVC_) || defined(_SYS_MINGW_) char pbuf[ESTPATHBUFSIZ*2], *p; int inode; struct stat sbuf; assert(path); if(stat(path, &sbuf) == -1) return -1; if(GetFullPathName(path, ESTPATHBUFSIZ*2, pbuf, &p) != 0){ inode = 11003; for(p = pbuf; *p != '\0'; p++){ inode = inode * 31 + *(unsigned char *)p; } return (inode * 911) & 0x7FFF; } return -1; #else struct stat sbuf; assert(path); if(stat(path, &sbuf) == -1) return -1; return sbuf.st_ino & INT_MAX; #endif } /* Change modification time of a file. */ int est_utime(const char *path, time_t mtime){ struct utimbuf buf; assert(path); if(mtime < 0) return utime(path, NULL) == 0; buf.actime = mtime; buf.modtime = mtime; return utime(path, &buf) == 0; } /* Get the time of day in milliseconds. */ double est_gettimeofday(void){ #if defined(_SYS_MSVC_) || defined(_SYS_MINGW_) SYSTEMTIME st; struct tm ts; GetLocalTime(&st); memset(&ts, 0, sizeof(ts)); ts.tm_year = st.wYear - 1900; ts.tm_mon = st.wMonth - 1; ts.tm_mday = st.wDay; ts.tm_hour = st.wHour; ts.tm_min = st.wMinute; ts.tm_sec = st.wSecond; return (double)mktime(&ts) * 1000 + (double)st.wMilliseconds; #else struct timeval tv; struct timezone tz; if(gettimeofday(&tv, &tz) == -1) return 0.0; return (double)tv.tv_sec * 1000 + (double)tv.tv_usec / 1000; #endif } /* Suspend execution for microsecond intervals. */ void est_usleep(unsigned long usec){ #if defined(_SYS_MSVC_) || defined(_SYS_MINGW_) Sleep(usec / 1000); #else usleep(usec); #endif } /* Set a signal handler. */ void est_signal(int signum, void (*sighandler)(int)){ #if defined(_SYS_MSVC_) || defined(_SYS_MINGW_) static int first = TRUE; int i; assert(signum >= 0 && sighandler); if(first){ for(i = 1; i < ESTSIGNUM; i++){ est_signal_handlers[i] = NULL; } SetConsoleCtrlHandler((PHANDLER_ROUTINE)est_signal_dispatch, TRUE); first = FALSE; } if(signum >= ESTSIGNUM) return; if(sighandler == SIG_IGN){ signal(signum, SIG_IGN); } else if(sighandler == SIG_DFL){ signal(signum, SIG_DFL); } else { signal(signum, (void (*)(int))est_signal_dispatch); est_signal_handlers[signum] = sighandler; } #else static int first = TRUE; struct sigaction act; int i; assert(signum >= 0 && sighandler); if(first){ for(i = 1; i < ESTSIGNUM; i++){ est_signal_handlers[i] = NULL; } first = FALSE; } if(signum >= ESTSIGNUM) return; memset(&act, 0, sizeof(act)); if(sighandler == SIG_IGN){ act.sa_handler = SIG_IGN; } else if(sighandler == SIG_DFL){ act.sa_handler = SIG_DFL; } else { act.sa_handler = (void (*)(int))est_signal_dispatch; est_signal_handlers[signum] = sighandler; } sigemptyset(&act.sa_mask); act.sa_flags = 0; sigaction(signum, &act, NULL); #endif } /* Send a signal to a process. */ int est_kill(int pid, int sig){ #if defined(_SYS_MSVC_) || defined(_SYS_MINGW_) return FALSE; #else return kill(pid, sig) == 0; #endif } /* Get the load ratio of the physical memory. */ double est_memory_usage(void){ #if defined(_SYS_MSVC_) || defined(_SYS_MINGW_) || defined(_SYS_CYGWIN_) MEMORYSTATUS sbuf; sbuf.dwLength = sizeof(MEMORYSTATUS); GlobalMemoryStatus(&sbuf); return sbuf.dwMemoryLoad / 100.0; #else return 0.0; #endif } /* get the media type of an extention */ const char *est_ext_type(const char *ext){ static const char *list[] = { ".txt", "text/plain", ".txt.en", "text/plain", ".txt.ja", "text/plain", ".asc", "text/plain", ".in", "text/plain", ".c", "text/plain", ".h", "text/plain", ".cc", "text/plain", ".java", "text/plain", ".sh", "text/plain", ".pl", "text/plain", ".py", "text/plain", ".rb", "text/plain", ".idl", "text/plain", ".csv", "text/plain", ".log", "text/plain", ".conf", "text/plain", ".rc", "text/plain", ".ini", "text/plain", ".html", "text/html", ".htm", "text/html", ".xhtml", "text/html", ".xht", "text/html", ".css", "text/css", ".js", "text/javascript", ".tsv", "text/tab-separated-values", ".eml", "message/rfc822", ".mime", "message/rfc822", ".mht", "message/rfc822", ".mhtml", "message/rfc822", ".sgml", "application/sgml", ".sgm", "application/sgml", ".xml", "application/xml", ".xsl", "application/xml", ".xslt", "application/xslt+xml", ".xhtml", "application/xhtml+xml", ".xht", "application/xhtml+xml", ".rdf", "application/rdf+xml", ".rss", "application/rss+xml", ".dtd", "application/xml-dtd", ".rtf", "application/rtf", ".pdf", "application/pdf", ".ps", "application/postscript", ".eps", "application/postscript", ".doc", "application/msword", ".xls", "application/vnd.ms-excel", ".ppt", "application/vnd.ms-powerpoint", ".xdw", "application/vnd.fujixerox.docuworks", ".swf", "application/x-shockwave-flash", ".zip", "application/zip", ".tar", "application/x-tar", ".gz", "application/x-gzip", ".bz2", "application/octet-stream", ".z", "application/octet-stream", ".lha", "application/octet-stream", ".lzh", "application/octet-stream", ".cab", "application/octet-stream", ".rar", "application/octet-stream", ".sit", "application/octet-stream", ".bin", "application/octet-stream", ".o", "application/octet-stream", ".so", "application/octet-stream", ".exe", "application/octet-stream", ".dll", "application/octet-stream", ".class", "application/octet-stream", ".png", "image/png", ".gif", "image/gif", ".jpg", "image/jpeg", ".jpeg", "image/jpeg", ".tif", "image/tiff", ".tiff", "image/tiff", ".bmp", "image/bmp", ".au", "audio/basic", ".snd", "audio/basic", ".mid", "audio/midi", ".midi", "audio/midi", ".mp2", "audio/mpeg", ".mp3", "audio/mpeg", ".wav", "audio/x-wav", ".mpg", "video/mpeg", ".mpeg", "video/mpeg", ".qt", "video/quicktime", ".mov", "video/quicktime", ".avi", "video/x-msvideo", NULL }; int i; assert(ext); for(i = 0; list[i]; i++){ if(!cbstricmp(ext, list[i])) return list[i+1]; } return "application/octet-stream"; } /* Set a seed vector from a map object. */ void est_vector_set_seed(CBMAP *svmap, int *svec, int vnum){ const char *kbuf; int nnum, ksiz; assert(svmap && svec && vnum > 0); cbmapiterinit(svmap); nnum = 0; while(nnum < vnum){ if((kbuf = cbmapiternext(svmap, &ksiz)) != NULL){ if(ksiz < 1) continue; svec[nnum++] = atoi(cbmapiterval(kbuf, NULL)); } else { svec[nnum++] = 0; } } } /* Set a target vector from a map object. */ void est_vector_set_target(CBMAP *svmap, CBMAP *tvmap, int *tvec, int vnum){ const char *kbuf, *vbuf; int i, ksiz; assert(svmap && tvmap && tvec && vnum > 0); cbmapiterinit(svmap); for(i = 0; i < vnum; i++){ if((kbuf = cbmapiternext(svmap, &ksiz)) != NULL){ vbuf = cbmapget(tvmap, kbuf, ksiz, NULL); tvec[i] = vbuf ? atoi(vbuf) : 0; } else { tvec[i] = 0; } } } /* Get the cosine of the angle of two vectors. */ double est_vector_cosine(const int *avec, const int *bvec, int vnum){ int i; double iprod, aabs, babs; assert(avec && bvec && vnum >= 0); iprod = 0.0; for(i = 0; i < vnum; i++){ iprod += (double)avec[i] * (double)bvec[i]; } aabs = 0.0; for(i = 0; i < vnum; i++){ aabs += (double)avec[i] * (double)avec[i]; } aabs = sqrt(aabs); babs = 0.0; for(i = 0; i < vnum; i++){ babs += (double)bvec[i] * (double)bvec[i]; } babs = sqrt(babs); if(iprod <= 0.0 || aabs < 1.0 || babs < 1.0) return 0.0; return iprod / (aabs * babs); } /************************************************************************************************* * private objects *************************************************************************************************/ /* Set the error code. `ecp' specifies the pointer to a variable to be assigned. `value' specifies the error code to be assgined. `line' specifies the number of the line where the error happened. */ static void est_set_ecode(int *ecp, int value, int line){ char buf[ESTPATHBUFSIZ]; assert(ecp && line > 0); *ecp = value; if(dpdbgfd >= 0){ fflush(stdout); fflush(stderr); sprintf(buf, "* est_set_ecode: %d: [%d] %s\n", line, value, est_err_msg(value)); write(dpdbgfd, buf, strlen(buf)); } } /* Encode a string into hexadecimal. `str' specifies a string. The return value is the result hexadecimal string. */ static char *est_hex_encode(const char *str){ char *res, *wp; assert(str); CB_MALLOC(res, strlen(str) * 2 + 1); wp = res; while(*str != '\0'){ wp += sprintf(wp, "%02X", *(unsigned char *)str); str++; } *wp = '\0'; return res; } /* Decode a hexadecimal string into original one. `str' specifies a hexadecimal string. The return value is the original string. */ static char *est_hex_decode(const char *str){ char *res, *wp; int i, len; assert(str); len = strlen(str); CB_MALLOC(res, len + 1); wp = res; for(i = 0; i < len; i += 2){ *(wp++) = (str[i] >= 'A' ? str[i] - 'A' + 10 : str[i] - '0') * 16 + (str[i+1] >= 'A' ? str[i+1] - 'A' + 10 : str[i+1] - '0'); } *wp = '\0'; return res; } /* Count the number of missing characters when converting. `ptr' specifies the pointer to a region. `size' specifies the size of the region. `icode' specifies the name of encoding of the input string. `ocode' specifies the name of encoding of the output string. The return value is the number of missing characters. */ static int est_enc_miss(const char *ptr, int size, const char *icode, const char *ocode){ iconv_t ic; char obuf[ESTICCHECKSIZ], *wp, *rp; size_t isiz, osiz; int miss; assert(ptr && size >= 0 && icode && ocode); isiz = size; if((ic = iconv_open(ocode, icode)) == (iconv_t)-1) return ESTICMISSMAX; miss = 0; rp = (char *)ptr; while(isiz > 0){ osiz = ESTICCHECKSIZ; wp = obuf; if(iconv(ic, (void *)&rp, &isiz, &wp, &osiz) == -1){ if(errno == EILSEQ || errno == EINVAL){ rp++; isiz--; miss++; if(miss >= ESTICMISSMAX) break; } else { break; } } } if(iconv_close(ic) == -1) return ESTICMISSMAX; return miss; } /* Normalize a text. `utext' specifies a text whose encoding is UTF-16BE. `size' specifies the size of the text. `sp' specifies the pointer to a variable to which the size of the result is assigned. */ static void est_normalize_text(unsigned char *utext, int size, int *sp){ int i, wi, b1, b2; assert(utext && size >= 0 && sp); wi = 0; for(i = 0; i < size - 1; i += 2){ b1 = utext[i]; b2 = utext[i+1]; if(b1 == 0x0){ if(b2 <= 0x8 || (b2 >= 0x0e && b2 <= 0x1f)){ /* control characters */ utext[wi++] = 0x0; utext[wi++] = 0x20; } else if(b2 == 0xa0){ /* no-break space */ utext[wi++] = 0x0; utext[wi++] = 0x20; } else { /* (otherwise) */ utext[wi++] = b1; utext[wi++] = b2; } } else if(b1 == 0x20){ if(b2 == 0x2){ /* en space */ utext[wi++] = 0x0; utext[wi++] = 0x20; } else if(b2 == 0x3){ /* em space */ utext[wi++] = 0x0; utext[wi++] = 0x20; } else if(b2 == 0x9){ /* thin space */ utext[wi++] = 0x0; utext[wi++] = 0x20; } else if(b2 == 0x10){ /* hyphen */ utext[wi++] = 0x0; utext[wi++] = 0x2d; } else if(b2 == 0x15){ /* fullwidth horizontal line */ utext[wi++] = 0x0; utext[wi++] = 0x2d; } else if(b2 == 0x19){ /* apostrophe */ utext[wi++] = 0x0; utext[wi++] = 0x27; } else if(b2 == 0x33){ /* double quotes */ utext[wi++] = 0x0; utext[wi++] = 0x22; } else { /* (otherwise) */ utext[wi++] = b1; utext[wi++] = b2; } } else if(b1 == 0x22){ if(b2 == 0x12){ /* minus sign */ utext[wi++] = 0x0; utext[wi++] = 0x2d; } else { /* (otherwise) */ utext[wi++] = b1; utext[wi++] = b2; } } else if(b1 == 0x30){ if(b2 == 0x0){ /* fullwidth space */ utext[wi++] = 0x0; utext[wi++] = 0x20; } else { /* (otherwise) */ utext[wi++] = b1; utext[wi++] = b2; } } else if(b1 == 0xff){ if(b2 == 0x01){ /* fullwidth exclamation */ utext[wi++] = 0x0; utext[wi++] = 0x21; } else if(b2 == 0x03){ /* fullwidth igeta */ utext[wi++] = 0x0; utext[wi++] = 0x23; } else if(b2 == 0x04){ /* fullwidth dollar */ utext[wi++] = 0x0; utext[wi++] = 0x24; } else if(b2 == 0x05){ /* fullwidth parcent */ utext[wi++] = 0x0; utext[wi++] = 0x25; } else if(b2 == 0x06){ /* fullwidth ampersand */ utext[wi++] = 0x0; utext[wi++] = 0x26; } else if(b2 == 0x0a){ /* fullwidth asterisk */ utext[wi++] = 0x0; utext[wi++] = 0x2a; } else if(b2 == 0x0b){ /* fullwidth plus */ utext[wi++] = 0x0; utext[wi++] = 0x2b; } else if(b2 == 0x0c){ /* fullwidth comma */ utext[wi++] = 0x0; utext[wi++] = 0x2c; } else if(b2 == 0x0e){ /* fullwidth period */ utext[wi++] = 0x0; utext[wi++] = 0x2e; } else if(b2 == 0x0f){ /* fullwidth slash */ utext[wi++] = 0x0; utext[wi++] = 0x2f; } else if(b2 == 0x1a){ /* fullwidth colon */ utext[wi++] = 0x0; utext[wi++] = 0x3a; } else if(b2 == 0x1b){ /* fullwidth semicolon */ utext[wi++] = 0x0; utext[wi++] = 0x3b; } else if(b2 == 0x1d){ /* fullwidth equal */ utext[wi++] = 0x0; utext[wi++] = 0x3d; } else if(b2 == 0x1f){ /* fullwidth question */ utext[wi++] = 0x0; utext[wi++] = 0x3f; } else if(b2 == 0x20){ /* fullwidth atmark */ utext[wi++] = 0x0; utext[wi++] = 0x40; } else if(b2 == 0x3c){ /* fullwidth backslash */ utext[wi++] = 0x0; utext[wi++] = 0x5c; } else if(b2 == 0x3e){ /* fullwidth circumflex */ utext[wi++] = 0x0; utext[wi++] = 0x5e; } else if(b2 == 0x3f){ /* fullwidth underscore */ utext[wi++] = 0x0; utext[wi++] = 0x5f; } else if(b2 == 0x5c){ /* fullwidth vertical line */ utext[wi++] = 0x0; utext[wi++] = 0x7c; } else if(b2 >= 0x21 && b2 <= 0x3a){ /* fullwidth alphabets */ utext[wi++] = 0x0; utext[wi++] = b2 - 0x21 + 0x41; } else if(b2 >= 0x41 && b2 <= 0x5a){ /* fullwidth small alphabets */ utext[wi++] = 0x0; utext[wi++] = b2 - 0x41 + 0x61; } else if(b2 >= 0x10 && b2 <= 0x19){ /* fullwidth numbers */ utext[wi++] = 0x0; utext[wi++] = b2 - 0x10 + 0x30; } else if(b2 == 0x61){ /* halfwidth full stop */ utext[wi++] = 0x30; utext[wi++] = 0x2; } else if(b2 == 0x62){ /* halfwidth left corner */ utext[wi++] = 0x30; utext[wi++] = 0xc; } else if(b2 == 0x63){ /* halfwidth right corner */ utext[wi++] = 0x30; utext[wi++] = 0xd; } else if(b2 == 0x64){ /* halfwidth comma */ utext[wi++] = 0x30; utext[wi++] = 0x1; } else if(b2 == 0x65){ /* halfwidth middle dot */ utext[wi++] = 0x30; utext[wi++] = 0xfb; } else if(b2 == 0x66){ /* halfwidth wo */ utext[wi++] = 0x30; utext[wi++] = 0xf2; } else if(b2 >= 0x67 && b2 <= 0x6b){ /* halfwidth small a-o */ utext[wi++] = 0x30; utext[wi++] = (b2 - 0x67) * 2 + 0xa1; } else if(b2 >= 0x6c && b2 <= 0x6e){ /* halfwidth small ya-yo */ utext[wi++] = 0x30; utext[wi++] = (b2 - 0x6c) * 2 + 0xe3; } else if(b2 == 0x6f){ /* halfwidth small tu */ utext[wi++] = 0x30; utext[wi++] = 0xc3; } else if(b2 == 0x70){ /* halfwidth prolonged mark */ utext[wi++] = 0x30; utext[wi++] = 0xfc; } else if(b2 >= 0x71 && b2 <= 0x75){ /* halfwidth a-o */ utext[wi++] = 0x30; utext[wi++] = (b2 - 0x71) * 2 + 0xa2; if(i + 2 < size - 1 && b2 == 0x73 && utext[i+2] == 0xff && utext[i+3] == 0x9e){ utext[wi-1] = 0xf4; i += 2; } } else if(b2 >= 0x76 && b2 <= 0x7a){ /* halfwidth ka-ko */ utext[wi++] = 0x30; utext[wi++] = (b2 - 0x76) * 2 + 0xab; if(i + 2 < size - 1 && utext[i+2] == 0xff && utext[i+3] == 0x9e){ utext[wi-1] += 1; i += 2; } } else if(b2 >= 0x7b && b2 <= 0x7f){ /* halfwidth sa-so */ utext[wi++] = 0x30; utext[wi++] = (b2 - 0x7b) * 2 + 0xb5; if(i + 2 < size - 1 && utext[i+2] == 0xff && utext[i+3] == 0x9e){ utext[wi-1] += 1; i += 2; } } else if(b2 >= 0x80 && b2 <= 0x84){ /* halfwidth ta-to */ utext[wi++] = 0x30; utext[wi++] = (b2 - 0x80) * 2 + 0xbf + (b2 >= 0x82 ? 1 : 0); if(i + 2 < size - 1 && utext[i+2] == 0xff && utext[i+3] == 0x9e){ utext[wi-1] += 1; i += 2; } } else if(b2 >= 0x85 && b2 <= 0x89){ /* halfwidth na-no */ utext[wi++] = 0x30; utext[wi++] = b2 - 0x85 + 0xca; } else if(b2 >= 0x8a && b2 <= 0x8e){ /* halfwidth ha-ho */ utext[wi++] = 0x30; utext[wi++] = (b2 - 0x8a) * 3 + 0xcf; if(i + 2 < size - 1){ if(utext[i+2] == 0xff && utext[i+3] == 0x9e){ utext[wi-1] += 1; i += 2; } else if(utext[i+2] == 0xff && utext[i+3] == 0x9f){ utext[wi-1] += 2; i += 2; } } } else if(b2 >= 0x8f && b2 <= 0x93){ /* halfwidth ma-mo */ utext[wi++] = 0x30; utext[wi++] = b2 - 0x8f + 0xde; } else if(b2 >= 0x94 && b2 <= 0x96){ /* halfwidth ya-yo */ utext[wi++] = 0x30; utext[wi++] = (b2 - 0x94) * 2 + 0xe4; } else if(b2 >= 0x97 && b2 <= 0x9b){ /* halfwidth ra-ro */ utext[wi++] = 0x30; utext[wi++] = b2 - 0x97 + 0xe9; } else if(b2 == 0x9c){ /* halfwidth wa */ utext[wi++] = 0x30; utext[wi++] = 0xef; } else if(b2 == 0x9d){ /* halfwidth wo */ utext[wi++] = 0x30; utext[wi++] = 0xf3; } else { /* (otherwise) */ utext[wi++] = b1; utext[wi++] = b2; } } else { /* (otherwise) */ utext[wi++] = b1; utext[wi++] = b2; } } *sp = wi; } /* Canonicalize a text for search keys. `utext' specifies a text whose encoding is UTF-16BE. `size' specifies the size of the text. `funcspc' specifies whether to allow functional space characters. */ static void est_canonicalize_text(unsigned char *utext, int size, int funcspc){ int i; for(i = 0; i < size; i += 2){ if(utext[i] == 0x0){ if(utext[i+1] < ' '){ /* functional spaces */ if(!funcspc) utext[i+1] = ' '; } else if(utext[i+1] >= 'A' && utext[i+1] <= 'Z'){ /* ascii */ utext[i+1] += 'a' - 'A'; } else if(utext[i+1] >= 0xc0){ /* latin-1 supplement */ if((utext[i+1] >= 0xc0 && utext[i+1] <= 0xd6) || (utext[i+1] >= 0xd8 && utext[i+1] <= 0xde)) utext[i+1] += 0x20; if(utext[i+1] >= 0xe0 && utext[i+1] <= 0xe5){ utext[i+1] = 'a'; } else if(utext[i+1] == 0xe7){ utext[i+1] = 'c'; } else if(utext[i+1] >= 0xe8 && utext[i+1] <= 0xeb){ utext[i+1] = 'e'; } else if(utext[i+1] >= 0xec && utext[i+1] <= 0xef){ utext[i+1] = 'i'; } else if(utext[i+1] == 0xf1){ utext[i+1] = 'n'; } else if((utext[i+1] >= 0xf2 && utext[i+1] <= 0xf6) || utext[i+1] == 0xf8){ utext[i+1] = 'o'; } else if(utext[i+1] >= 0xf9 && utext[i+1] <= 0xfc){ utext[i+1] = 'u'; } else if(utext[i+1] == 0xfd || utext[i+1] == 0xff){ utext[i+1] = 'y'; } } } else if(utext[i] == 0x1){ /* latin extended-a */ if((utext[i+1] <= 0x36 && utext[i+1] % 2 == 0) || (utext[i+1] >= 0x39 && utext[i+1] <= 0x47 && utext[i+1] % 2 == 1) || (utext[i+1] >= 0x4a && utext[i+1] <= 0x76 && utext[i+1] % 2 == 0) || (utext[i+1] >= 0x79 && utext[i+1] <= 0x7d && utext[i+1] % 2 == 1)) utext[i+1] += 0x1; if(utext[i+1] <= 0x05){ utext[i] = 0x0; utext[i+1] = 'a'; } else if(utext[i+1] >= 0x06 && utext[i+1] <= 0x0d){ utext[i] = 0x0; utext[i+1] = 'c'; } else if(utext[i+1] >= 0x0e && utext[i+1] <= 0x11){ utext[i] = 0x0; utext[i+1] = 'd'; } else if(utext[i+1] >= 0x12 && utext[i+1] <= 0x1b){ utext[i] = 0x0; utext[i+1] = 'e'; } else if(utext[i+1] >= 0x1c && utext[i+1] <= 0x23){ utext[i] = 0x0; utext[i+1] = 'g'; } else if(utext[i+1] >= 0x24 && utext[i+1] <= 0x27){ utext[i] = 0x0; utext[i+1] = 'h'; } else if(utext[i+1] >= 0x28 && utext[i+1] <= 0x31){ utext[i] = 0x0; utext[i+1] = 'i'; } else if(utext[i+1] >= 0x34 && utext[i+1] <= 0x35){ utext[i] = 0x0; utext[i+1] = 'j'; } else if(utext[i+1] >= 0x36 && utext[i+1] <= 0x38){ utext[i] = 0x0; utext[i+1] = 'k'; } else if(utext[i+1] >= 0x39 && utext[i+1] <= 0x42){ utext[i] = 0x0; utext[i+1] = 'l'; } else if(utext[i+1] >= 0x43 && utext[i+1] <= 0x4b){ utext[i] = 0x0; utext[i+1] = 'n'; } else if(utext[i+1] >= 0x4c && utext[i+1] <= 0x51){ utext[i] = 0x0; utext[i+1] = 'o'; } else if(utext[i+1] >= 0x54 && utext[i+1] <= 0x59){ utext[i] = 0x0; utext[i+1] = 'r'; } else if((utext[i+1] >= 0x5a && utext[i+1] <= 0x61) || utext[i+1] == 0x7f){ utext[i] = 0x0; utext[i+1] = 's'; } else if(utext[i+1] >= 0x62 && utext[i+1] <= 0x67){ utext[i] = 0x0; utext[i+1] = 't'; } else if(utext[i+1] >= 0x68 && utext[i+1] <= 0x73){ utext[i] = 0x0; utext[i+1] = 'u'; } else if(utext[i+1] >= 0x74 && utext[i+1] <= 0x75){ utext[i] = 0x0; utext[i+1] = 'w'; } else if(utext[i+1] >= 0x76 && utext[i+1] <= 0x78){ utext[i] = 0x0; utext[i+1] = 'y'; } else if(utext[i+1] >= 0x79 && utext[i+1] <= 0x7e){ utext[i] = 0x0; utext[i+1] = 'z'; } } else if(utext[i] == 0x3){ /* greek */ if(utext[i+1] >= 0x91 && utext[i+1] <= 0xa9) utext[i+1] += 0x20; } else if(utext[i] == 0x4){ /* cyrillic */ if(utext[i+1] >= 0x10 && utext[i+1] <= 0x2f){ utext[i+1] += 0x20; } else if(utext[i+1] <= 0x0f){ utext[i+1] += 0x50; } } else if(utext[i] == 0xff){ /* special */ if(utext[i+1] >= 0xf0){ utext[i] = 0x0; utext[i+1] = ' '; } } } } /* Categorize a character. `c' specifies the UCS number of a character. The return value is the category of the character. */ static int est_char_category(int c){ /* ascii space */ if(c <= 0x0020) return ESTSPACECHR; /* ascii alnum */ if((c >= 0x0030 && c <= 0x0039) || (c >= 0x0041 && c <= 0x005a) || (c >= 0x0061 && c <= 0x007a)) return ESTWESTALPH; /* latin */ if((c >= 0x00c0 && c <= 0x00ff && c != 0x00d7 && c != 0x00f7) || (c >= 0x0100 && c <= 0x017f)) return ESTWESTALPH; /* arabic and syrian */ if(c >= 0x0600 && c <= 0x08ff) return ESTEASTALPH; /* south and south east asia */ if((c >= 0x0900 && c <= 0x109f) || (c >= 0x1700 && c <= 0x1cff)) return ESTEASTALPH; /* cjk and surrogates */ if((c >= 0x1100 && c <= 0x11ff) || (c >= 0x2e80 && c <= 0xdfff) || (c >= 0xf900 && c <= 0xfaff) || (c >= 0xff00 && c <= 0xffef)) return ESTEASTALPH; /* asian presentation forms */ if((c >= 0xfb50 && c <= 0xfdff) || (c >= 0xfe30 && c <= 0xfe4f) || (c >= 0xfe70 && c <= 0xfeff)) return ESTEASTALPH; /* others */ return ESTDELIMCHR; } /* Categorize a character for perfect N-gram analyzer. `c' specifies the UCS number of a character. The return value is the category of the character. */ static int est_char_category_perfng(int c){ if(c <= 0x0020) return ESTSPACECHR; return ESTEASTALPH; } /* Categorize a character for character category analyzer. `c' specifies the UCS number of a character. The return value is the category of the character. */ static int est_char_category_chrcat(int c){ /* ascii space */ if(c <= 0x0020) return ESTSPACECHR; /* ascii alnum */ if((c >= 0x0030 && c <= 0x0039) || (c >= 0x0041 && c <= 0x005a) || (c >= 0x0061 && c <= 0x007a)) return ESTWESTALPH; /* latin */ if((c >= 0x00c0 && c <= 0x00ff && c != 0x00d7 && c != 0x00f7) || (c >= 0x0100 && c <= 0x017f)) return ESTWESTALPH; /* arabic and syrian */ if(c >= 0x0600 && c <= 0x08ff) return ESTEASTALPH; /* south and south east asia */ if((c >= 0x0900 && c <= 0x109f) || (c >= 0x1700 && c <= 0x1cff)) return ESTEASTALPH; /* hiragana */ if(c >= 0x3040 && c <= 0x309f) return ESTHIRAGANA; /* katakana */ if(c >= 0x30a0 && c <= 0x30ff) return ESTKATAKANA; /* hangul */ if((c >= 0x1100 && c <= 0x11ff) || (c >= 0x3130 && c <= 0x318f) || (c >= 0xac00 && c <= 0xd7af)) return ESTHANGUL; /* kanji */ if(c >= 0x4e00 && c <= 0x9faf) return ESTKANJI; /* other cjk and surrogates */ if((c >= 0x2e80 && c <= 0xdfff) || (c >= 0xf900 && c <= 0xfaff) || (c >= 0xff00 && c <= 0xffef)) return ESTEASTALPH; /* asian presentation forms */ if((c >= 0xfb50 && c <= 0xfdff) || (c >= 0xfe30 && c <= 0xfe4f) || (c >= 0xfe70 && c <= 0xfeff)) return ESTEASTALPH; /* others */ return ESTDELIMCHR; } /* Make a snippet of an arbitrary string. `word' specifies a list object of words to be highlight. `wwidth' specifies whole width of the result. `hwidth' specifies width of strings picked up from the beginning of the text. `awidth' specifies width of strings picked up around each highlighted word. The return value is a snippet string of the string. */ static char *est_make_snippet(const char *str, int len, const CBLIST *words, int wwidth, int hwidth, int awidth){ CBDATUM *res; CBMAP *counts; CBLIST *rwords; const char *word, *cval; const unsigned char *rword; unsigned char *rtext, *ctext; int i, j, k, bi, size, wsiz, rwsiz, mywidth, awsiz, csiz; assert(str && len >= 0 && words && wwidth >= 0 && hwidth >= 0 && awidth >= 0); CB_DATUMOPEN(res); CB_LISTOPEN(rwords); for(i = 0; i < CB_LISTNUM(words); i++){ word = CB_LISTVAL2(words, i, wsiz); if(wsiz < 1 || !strcmp(word, ESTOPUVSET)) continue; rtext = (unsigned char *)est_uconv_in(word, wsiz, &size); est_canonicalize_text(rtext, size, TRUE); CB_LISTPUSHBUF(rwords, (char *)rtext, size); } rtext = (unsigned char *)est_uconv_in(str, len, &size); ctext = (unsigned char *)cbmemdup((char *)rtext, size); est_canonicalize_text(ctext, size, FALSE); mywidth = hwidth; if(CB_LISTNUM(rwords) < 1) mywidth *= 3; if(mywidth > wwidth) mywidth = wwidth; for(i = 0; i < size && mywidth > 0; i += 2){ mywidth -= est_char_category(rtext[i] * 0x100 + rtext[i+1]) == ESTEASTALPH ? 2 : 1; } awsiz = size - i; if(awsiz > ESTWORDMAXLEN) awsiz = ESTWORDMAXLEN; est_snippet_add_text(rtext, ctext, i, awsiz, res, rwords); wwidth -= hwidth; bi = i + 2; CB_DATUMCAT(res, "\n", 1); if(awidth > 0){ counts = cbmapopenex(ESTMINIBNUM); for(i = bi; i < size && wwidth >= 0; i += 2){ for(j = 0; j < CB_LISTNUM(rwords); j++){ rword = (unsigned char *)CB_LISTVAL2(rwords, j, rwsiz); if(est_str_fwmatch_wide(ctext + i, size - i, rword, rwsiz) > 0 && (!(cval = cbmapget(counts, (char *)rword, rwsiz, &csiz)) || csiz < (wwidth > awidth * 1.2 ? 2 : 1))){ cbmapputcat(counts, (char *)rword, rwsiz, "*", 1); if(cbmaprnum(counts) >= CB_LISTNUM(rwords)){ cbmapclose(counts); counts = cbmapopenex(ESTMINIBNUM); } mywidth = awidth / 2 + 1; for(k = i - 2; k >= bi && mywidth >= 0; k -= 2){ mywidth -= est_char_category(rtext[k] * 0x100 + rtext[k+1]) == ESTEASTALPH ? 2 : 1; } bi = k; mywidth = awidth / 2 + 1; for(k = i + rwsiz + 2; k < size && mywidth >= 0; k += 2){ mywidth -= est_char_category(rtext[k] * 0x100 + rtext[k+1]) == ESTEASTALPH ? 2 : 1; } if(k > size) k = size; est_snippet_add_text(rtext + bi, ctext + bi, k - bi, 0, res, rwords); wwidth -= awidth + rwsiz / 2; bi = k + 2; i = bi - 2; CB_DATUMCAT(res, "\n", 1); break; } } } cbmapclose(counts); } free(ctext); free(rtext); CB_LISTCLOSE(rwords); return cbdatumtomalloc(res, NULL); } /* Check whether a string is compsed of CJK characters only. `str' specifies a string of UTF-8. The return value is whether the string is compsed of CJK characters only. */ static int est_check_cjk_only(const char *str){ const unsigned char *rp; int size; rp = (unsigned char *)str; size = strlen(str); while(rp < (unsigned char *)str + size){ if(*rp < 0x7f){ return FALSE; } else if(*rp < 0xdf){ return FALSE; } else if(*rp < 0xf0){ if(rp >= (unsigned char *)str + size - 2) break; rp += 3; } else if(*rp < 0xf8){ if(rp >= (unsigned char *)str + size - 3) break; rp += 4; } else if(*rp < 0xfb){ if(rp >= (unsigned char *)str + size - 4) break; rp += 5; } else if(*rp < 0xfd){ if(rp >= (unsigned char *)str + size - 5) break; rp += 6; } else { break; } } return TRUE; } /* Convert a simplified phrase into complete form. `sphrase' specifies a simplified phrase. The return value is the complete form of the phrase. */ static char *est_phrase_from_simple(const char *sphrase){ CBDATUM *datum; const char *oper, *rp, *pv; unsigned char *utext; char *rtext; int size, quote, lw; assert(sphrase); CB_DATUMOPEN(datum); utext = (unsigned char *)est_uconv_in(sphrase, strlen(sphrase), &size); est_normalize_text(utext, size, &size); est_canonicalize_text(utext, size, FALSE); rtext = est_uconv_out((char *)utext, size, NULL); cbstrsqzspc(rtext); quote = FALSE; oper = NULL; lw = FALSE; for(rp = rtext; *rp != '\0'; rp++){ if(*rp == '"'){ if(oper){ CB_DATUMCAT(datum, oper, strlen(oper)); oper = NULL; } quote = !quote; continue; } if(quote){ CB_DATUMCAT(datum, rp, 1); continue; } switch(*rp){ case ' ': if(!oper) oper = " AND "; lw = FALSE; break; case '&': oper = " AND "; lw = FALSE; break; case '|': oper = " OR "; lw = FALSE; break; case '!': oper = " ANDNOT "; lw = FALSE; break; default: if(oper){ CB_DATUMCAT(datum, oper, strlen(oper)); oper = NULL; } if(!lw){ pv = rp; while(*pv != '\0' && *pv != ' '){ pv++; } if(pv > rp + 1 && pv[-1] == '*'){ if(rp[0] == '*'){ CB_DATUMCAT(datum, ESTOPWCRX " ", strlen(ESTOPWCRX) + 1); } else { CB_DATUMCAT(datum, ESTOPWCBW " ", strlen(ESTOPWCBW) + 1); } } else if(pv > rp + 1 && rp[0] == '*'){ if(pv[-1] == '*'){ CB_DATUMCAT(datum, ESTOPWCRX " ", strlen(ESTOPWCRX) + 1); } else { CB_DATUMCAT(datum, ESTOPWCEW " ", strlen(ESTOPWCEW) + 1); } } } if(*rp != '*' || (lw && rp[1] != '\0' && rp[1] != ' ')) CB_DATUMCAT(datum, rp, 1); lw = TRUE; } } free(rtext); free(utext); return cbdatumtomalloc(datum, NULL); } /* Convert a rough phrase into complete form. `rphrase' specifies a simplified phrase. The return value is the complete form of the phrase. */ static char *est_phrase_from_rough(const char *rphrase){ CBDATUM *datum; const char *oper, *rp; unsigned char *utext; char *rtext; int size, quote, lw; assert(rphrase); CB_DATUMOPEN(datum); utext = (unsigned char *)est_uconv_in(rphrase, strlen(rphrase), &size); est_normalize_text(utext, size, &size); est_canonicalize_text(utext, size, FALSE); rtext = est_uconv_out((char *)utext, size, NULL); cbstrsqzspc(rtext); quote = FALSE; oper = NULL; lw = FALSE; for(rp = rtext; *rp != '\0'; rp++){ if(*rp == '"'){ if(oper){ CB_DATUMCAT(datum, oper, strlen(oper)); oper = NULL; } quote = !quote; continue; } if(quote){ CB_DATUMCAT(datum, rp, 1); continue; } switch(*rp){ case ' ': if(!oper) oper = " AND "; lw = FALSE; break; case '&': oper = " AND "; lw = FALSE; break; case '|': oper = " OR "; lw = FALSE; break; case '-': if(lw){ CB_DATUMCAT(datum, rp, 1); } else { oper = " ANDNOT "; } break; default: if(oper){ CB_DATUMCAT(datum, oper, strlen(oper)); oper = NULL; } CB_DATUMCAT(datum, rp, 1); lw = TRUE; } } free(rtext); free(utext); return cbdatumtomalloc(datum, NULL); } /* Convert a union phrase into complete form. `uphrase' specifies a simplified phrase. The return value is the complete form of the phrase. */ static char *est_phrase_from_union(const char *uphrase){ CBDATUM *datum; CBLIST *terms; const char *term; unsigned char *utext; char *rtext; int i, size; assert(uphrase); CB_DATUMOPEN(datum); utext = (unsigned char *)est_uconv_in(uphrase, strlen(uphrase), &size); est_normalize_text(utext, size, &size); est_canonicalize_text(utext, size, FALSE); rtext = est_uconv_out((char *)utext, size, NULL); cbstrsqzspc(rtext); terms = cbsplit(rtext, -1, " "); for(i = 0; i < CB_LISTNUM(terms); i++){ term = CB_LISTVAL2(terms, i, size); if(size < 1) continue; if(CB_DATUMSIZE(datum) > 0) CB_DATUMCAT(datum, " OR ", 4); CB_DATUMCAT(datum, term, size); } CB_LISTCLOSE(terms); free(rtext); free(utext); return cbdatumtomalloc(datum, NULL); } /* Convert a intersection phrase into complete form. `iphrase' specifies a simplified phrase. The return value is the complete form of the phrase. */ static char *est_phrase_from_isect(const char *iphrase){ CBDATUM *datum; CBLIST *terms; const char *term; unsigned char *utext; char *rtext; int i, size; assert(iphrase); CB_DATUMOPEN(datum); utext = (unsigned char *)est_uconv_in(iphrase, strlen(iphrase), &size); est_normalize_text(utext, size, &size); est_canonicalize_text(utext, size, FALSE); rtext = est_uconv_out((char *)utext, size, NULL); cbstrsqzspc(rtext); terms = cbsplit(rtext, -1, " "); for(i = 0; i < CB_LISTNUM(terms); i++){ term = CB_LISTVAL2(terms, i, size); if(size < 1) continue; if(CB_DATUMSIZE(datum) > 0) CB_DATUMCAT(datum, " AND ", 5); CB_DATUMCAT(datum, term, size); } CB_LISTCLOSE(terms); free(rtext); free(utext); return cbdatumtomalloc(datum, NULL); } /* Add a string to a snippet. `rtext' specifies a raw text. `ctext' specifies a canonicalized text. `size' specifies the size of the raw text and the canonicalized text. `awsiz' specifies the size of allowance for matching words. `res' specifies a datum object for the result. `rwords' specifies a list object of raw words. */ static void est_snippet_add_text(const unsigned char *rtext, const unsigned char *ctext, int size, int awsiz, CBDATUM *res, const CBLIST *rwords){ const unsigned char *rword; char *orig; int i, j, bi, rwsiz, step, osiz; bi = 0; for(i = 0; i < size; i += 2){ for(j = 0; j < CB_LISTNUM(rwords); j++){ rword = (unsigned char *)CB_LISTVAL2(rwords, j, rwsiz); if((step = est_str_fwmatch_wide(ctext + i, size + awsiz - i, rword, rwsiz)) > 0){ if(i - bi > 0){ orig = est_uconv_out((char *)rtext + bi, i - bi, &osiz); CB_DATUMCAT(res, orig, osiz); CB_DATUMCAT(res, "\n", 1); free(orig); } orig = est_uconv_out((char *)rtext + i, step, &osiz); CB_DATUMCAT(res, orig, osiz); free(orig); CB_DATUMCAT(res, "\t", 1); orig = est_uconv_out((char *)rword, rwsiz, &osiz); CB_DATUMCAT(res, orig, osiz); free(orig); CB_DATUMCAT(res, "\n", 1); bi = i + step; i = bi - 2; break; } } } if(i - bi > 0){ orig = est_uconv_out((char *)rtext + bi, i - bi, &osiz); CB_DATUMCAT(res, orig, osiz); CB_DATUMCAT(res, "\n", 1); free(orig); } } /* Check whether a string begins with a key. `string' specifies a target string whose encoding is UTF-16BE. `size' specifies the size of the target string. `key' specifies a key string whose encoding is UTF-16BE. `ksiz' specifies the size of the key string. `key' specifies the pointer The return value is the number of characters of the corresponding string, or 0 if the target string does not begin with the key. */ static int est_str_fwmatch_wide(const unsigned char *str, int size, const unsigned char *key, int ksiz){ int si, ki; assert(str && size >= 0 && key && ksiz >= 0); if(size < 2 || ksiz < 2 || (str[0] == 0x0 && str[1] <= 0x20)) return 0; si = 0; ki = 0; while(ki < ksiz){ if(si >= size) return 0; if(str[si] == 0x0 && str[si+1] <= 0x20){ si += 2; continue; } if(key[ki] == 0x0 && key[ki+1] <= 0x20){ ki += 2; continue; } if(str[si] != key[ki] || str[si+1] != key[ki+1]) return 0; si += 2; ki += 2; } return si; } /* Find the first occurrence of a substring ignoring space characters. `haystack' specifies a target string. `needle' specifies a substring. The the pointer to the first occurrence. */ static char *est_strstr_sparse(const char *haystack, const char *needle){ const char *hp, *np; assert(haystack && needle); while(*needle > '\0' && *needle <= ' '){ needle++; } if(needle[0] == '\0') return (char *)haystack; while((haystack = strchr(haystack, *needle)) != NULL){ hp = haystack; np = needle; while(TRUE){ while(*hp > '\0' && *hp <= ' '){ hp++; } while(*np > '\0' && *np <= ' '){ np++; } if(*np == '\0') return (char *)haystack; if(*hp != *np || *hp == '\0') break; hp++; np++; } haystack++; } return NULL; } /* Get the last ID number in an index record. `vbuf' specifies the pointer to the value of a record. `vsiz' specifies the size of the value. `smode' specifies a mode of score type. The return value is the last ID number in a record. */ static int est_idx_rec_last_id(const char *vbuf, int vsiz, int smode){ const char *rp, *ep, *sp; int cid, vnum, vstep; assert(vbuf && vsiz >= 0); cid = 0; rp = vbuf; ep = vbuf + vsiz; while(rp < ep){ EST_READ_VNUMBUF(rp, vnum, vstep); cid += vnum + 1; rp += vstep; sp = rp; switch(smode){ case ESTDFSCVOID: break; default: rp++; break; case ESTDFSCINT: case ESTDFSCASIS: rp += sizeof(int); break; } while(*rp != 0x00){ rp += 2; } rp++; } return cid; } /* Encode a raw index record into a gap form. `datum' specifies a datum to store the result. `vbuf' specifies the pointer to the value of a raw index record. `vsiz' specifies the size of the value of the record. `lid' specifies the last ID number in the existing record. `smode' specifies a mode of score type. */ static void est_encode_idx_rec(CBDATUM *datum, const char *vbuf, int vsiz, int lid, int smode){ const char *rp, *ep, *sp; char nbuf[ESTNUMBUFSIZ]; int cid, vstep; assert(datum && vbuf && vsiz >= 0); rp = vbuf; ep = vbuf + vsiz; while(rp < ep){ EST_READ_VNUMBUF(rp, cid, vstep); rp += vstep; sp = rp; switch(smode){ case ESTDFSCVOID: break; default: rp++; break; case ESTDFSCINT: case ESTDFSCASIS: rp += sizeof(int); break; } while(*rp != 0x00){ rp += 2; } rp++; EST_SET_VNUMBUF(vstep, nbuf, cid - lid - 1); CB_DATUMCAT(datum, nbuf, vstep); CB_DATUMCAT(datum, sp, rp - sp); lid = cid; } } /* Decode a gap index record into a raw form. `datum' specifies a datum to store the result. `vbuf' specifies the pointer to the value of a gap index record. `vsiz' specifies the size of the value of the record. `smode' specifies a mode of score type. */ static void est_decode_idx_rec(CBDATUM *datum, const char *vbuf, int vsiz, int smode){ const char *rp, *ep, *sp; char nbuf[ESTNUMBUFSIZ]; int cid, vnum, vstep; assert(datum && vbuf && vsiz >= 0); rp = vbuf; ep = vbuf + vsiz; cid = 0; while(rp < ep){ EST_READ_VNUMBUF(rp, vnum, vstep); cid += vnum + 1; rp += vstep; sp = rp; switch(smode){ case ESTDFSCVOID: break; default: rp++; break; case ESTDFSCINT: case ESTDFSCASIS: rp += sizeof(int); break; } while(*rp != 0x00){ rp += 2; } rp++; EST_SET_VNUMBUF(vstep, nbuf, cid); CB_DATUMCAT(datum, nbuf, vstep); CB_DATUMCAT(datum, sp, rp - sp); } } /* Open the inverted index. `name' specifies the name of a directory. `omode' specifies an open mode of Villa. `dnum' specifies the number of database files. The return value is a database object of the database. */ static ESTIDX *est_idx_open(const char *name, int omode, int dnum){ ESTIDX *idx; CBLIST *files; const char *file; char path[ESTPATHBUFSIZ]; int i, crdnum; assert(name && dnum > 0); if(dnum > ESTIDXDMAX) dnum = ESTIDXDMAX; CB_MALLOC(idx, sizeof(ESTIDX)); if((omode & VL_OCREAT) && !est_mkdir(name) && errno != EEXIST) return NULL; if((omode & VL_OTRUNC) && (files = cbdirlist(name)) != NULL){ for(i = 0; i < CB_LISTNUM(files); i++){ file = CB_LISTVAL(files, i); if(!strcmp(file, ESTCDIRSTR) || !strcmp(file, ESTPDIRSTR)) continue; sprintf(path, "%s%c%s", name, ESTPATHCHR, file); if(unlink(path) == -1) est_rmdir_rec(path); } CB_LISTCLOSE(files); } for(i = 0; i < dnum; i++){ sprintf(path, "%s%c%04d", name, ESTPATHCHR, i + 1); crdnum = vlcrdnum; vlcrdnum = ESTVLCRDNUM; if(!(idx->dbs[i] = vlopen(path, omode, VL_CMPLEX))){ while(--i >= 0){ vlclose(idx->dbs[i]); } vlcrdnum = crdnum; return NULL; } vlcrdnum = crdnum; } idx->name = cbmemdup(name, -1); idx->omode = omode; idx->dnum = dnum; idx->cdb = idx->dbs[dnum-1]; return idx; } /* Close the inverted index. `idx' specifies an object of the inverted index. The return value is true if success, else it is false. */ static int est_idx_close(ESTIDX *idx){ int i, err; assert(idx); err = FALSE; for(i = 0; i < idx->dnum; i++){ if(!vlclose(idx->dbs[i])) err = TRUE; } free(idx->name); free(idx); return err ? FALSE : TRUE; } /* Set the tuning parameters of the inverted index. `idx' specifies an object of the inverted index. `lrecmax' specifies the max number of records in a leaf node of B+ tree. `nidxmax' specifies the max number of indexes in a non-leaf node of B+ tree. `lcnum' specifies the max number of caching leaf nodes. `ncnum' specifies the max number of caching non-leaf nodes. `fbpsiz' specifies the size of the free block pool. Other parameters are same with `vlsettuning' of Villa. */ static void est_idx_set_tuning(ESTIDX *idx, int lrecmax, int nidxmax, int lcnum, int ncnum, int fbpsiz){ int i; assert(idx); for(i = 0; i < idx->dnum; i++){ vlsettuning(idx->dbs[i], lrecmax, nidxmax, lcnum, ncnum); if(fbpsiz > 0) vlsetfbpsiz(idx->dbs[i], fbpsiz); } } /* Increment the inverted index. `idx' specifies an object of the inverted index. */ static void est_idx_increment(ESTIDX *idx){ char path[ESTPATHBUFSIZ]; int i, min, size, crdnum; assert(idx); min = INT_MAX; for(i = 0; i < idx->dnum; i++){ size = vlfsiz(idx->cdb); if(size < min) min = size; } if(idx->dnum >= ESTIDXDMAX || (idx->dnum >= ESTIDXDSTD && min < ESTIDXDBMAX)){ est_idx_set_current(idx); return; } sprintf(path, "%s%c%04d", idx->name, ESTPATHCHR, idx->dnum + 1); crdnum = vlcrdnum; vlcrdnum = ESTVLCRDNUM; if((idx->dbs[idx->dnum] = vlopen(path, idx->omode | VL_OCREAT | VL_OTRUNC, VL_CMPLEX)) != NULL){ idx->cdb = idx->dbs[idx->dnum]; idx->dnum++; } vlcrdnum = crdnum; } /* Get the number of files of the inverted index. The return the number of files of the inverted index. */ static int est_idx_dnum(ESTIDX *idx){ assert(idx); return idx->dnum; } /* Add a record to the inverted index. `idx' specifies an object of the inverted index. `word' specifies a word. `vbuf' specifies the pointer to the value of a record. `vsiz' specifies the size of the value. `smode' specifies a mode of score type. The return value is true if success, else it is false. */ static int est_idx_add(ESTIDX *idx, const char *word, int wsiz, const char *vbuf, int vsiz, int smode){ CBDATUM *datum; const char *obuf; int rv, lid, osiz; assert(idx && word && wsiz >= 0 && vbuf && vsiz >= 0); CB_DATUMOPEN(datum); lid = 0; if((obuf = vlgetcache(idx->cdb, word, wsiz, &osiz)) != NULL) lid = est_idx_rec_last_id(obuf, osiz, smode); est_encode_idx_rec(datum, vbuf, vsiz, lid, smode); rv = vlput(idx->cdb, word, wsiz, CB_DATUMPTR(datum), CB_DATUMSIZE(datum), VL_DCAT); CB_DATUMCLOSE(datum); return rv; } /* Store a record to a file of the inverted index. `idx' specifies an object of the inverted index. `inum' specifies the index of a file of the inverted index. `word' specifies a word. `vbuf' specifies the pointer to the value of a record. `vsiz' specifies the size of the value. The return value is true if success, else it is false. */ static int est_idx_put_one(ESTIDX *idx, int inum, const char *word, int wsiz, const char *vbuf, int vsiz){ assert(idx && inum >= 0 && word && wsiz >= 0 && vbuf && vsiz >= 0); return vsiz > 0 ? vlput(idx->dbs[inum], word, wsiz, vbuf, vsiz, VL_DOVER) : (vlout(idx->dbs[inum], word, wsiz) || dpecode == DP_ENOITEM); } /* Remove a record from the inverted index. `idx' specifies an object of the inverted index. `word' specifies a word. `wsiz' specifies the size of the word. The return value is true if success, else it is false. Even if no item correspongs, it is success. */ static int est_idx_out(ESTIDX *idx, const char *word, int wsiz){ int i, err; assert(idx && word && wsiz >= 0); err = FALSE; for(i = 0; i < idx->dnum; i++){ if(!vlout(idx->dbs[i], word, wsiz) && dpecode != DP_ENOITEM) err = TRUE; } return err ? FALSE : TRUE; } /* Get a record from the inverted index. `idx' specifies an object of the inverted index. `word' specifies a word. `wsiz' specifies the size of the word. `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned. `smode' specifies a mode of score type. The return value is the pointer to the region of the value of the corresponding record. if no item correspongs, empty region is returned. */ static char *est_idx_scan(ESTIDX *idx, const char *word, int wsiz, int *sp, int smode){ CBDATUM *datum; const char *vbuf; int i, vsiz; assert(idx && word && wsiz >= 0 && sp); CB_DATUMOPEN(datum); for(i = 0; i < idx->dnum; i++){ if(!(vbuf = vlgetcache(idx->dbs[i], word, wsiz, &vsiz))) continue; est_decode_idx_rec(datum, vbuf, vsiz, smode); } return cbdatumtomalloc(datum, sp); } /* Get a record from a file of the inverted index. `idx' specifies an object of the inverted index. `inum' specifies the index of a file of the inverted index. `word' specifies a word. `wsiz' specifies the size of the word. `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned. The return value is the pointer to the region of the value of the corresponding record. if no item correspongs, `NULL' is returned. Because the region of the return value is volatile, it sould be copied immediately. */ static const char *est_idx_get_one(ESTIDX *idx, int inum, const char *word, int wsiz, int *sp){ assert(idx && inum >= 0 && word && wsiz >= 0 && sp); return vlgetcache(idx->dbs[inum], word, wsiz, sp); } /* Get the size of the value of a record in the inverted index. `idx' specifies an object of the inverted index. `word' specifies a word. `wsiz' specifies the size of the word. The return value is the size of the value of the corresponding record. if no item correspongs, 0 is returned. */ static int est_idx_vsiz(ESTIDX *idx, const char *word, int wsiz){ int i, sum, vsiz; assert(idx && word && wsiz >= 0); sum = 0; for(i = 0; i < idx->dnum; i++){ if((vsiz = vlvsiz(idx->dbs[i], word, wsiz)) < 1) continue; sum += vsiz; } return sum; } /* Get the number of division of the inverted index. `idx' specifies an object of the inverted index. The return value is the number of division of the inverted index. */ static int est_idx_num(ESTIDX *idx){ assert(idx); return idx->dnum; } /* Get the size of the inverted index. `idx' specifies an object of the inverted index. The return value is the size of the inverted index. */ static double est_idx_size(ESTIDX *idx){ int i; double size; assert(idx); size = 0; for(i = 0; i < idx->dnum; i++){ size += vlfsiz(idx->dbs[i]); } return size; } /* Get the size of the current file of the inverted index. `idx' specifies an object of the inverted index. The return value is the size of the current file of the inverted index. */ static int est_idx_size_current(ESTIDX *idx){ assert(idx); return vlfsiz(idx->cdb); } /* Synchronize updating contents of the inverted index on memory. `idx' specifies an object of the inverted index. The return value is true if success, else it is false. */ static int est_idx_memflush(ESTIDX *idx){ int i; assert(idx); for(i = 0; i < idx->dnum; i++){ if(!vlmemflush(idx->dbs[i])) return FALSE; } return TRUE; } /* Syncronize the inverted index. `idx' specifies an object of the inverted index. The return value is true if success, else it is false. */ static int est_idx_sync(ESTIDX *idx){ int i; assert(idx); for(i = 0; i < idx->dnum; i++){ if(!vlsync(idx->dbs[i])) return FALSE; } return TRUE; } /* Optimize the inverted index. `idx' specifies an object of the inverted index. The return value is true if success, else it is false. */ static int est_idx_optimize(ESTIDX *idx){ int i; assert(idx); for(i = 0; i < idx->dnum; i++){ if(!vloptimize(idx->dbs[i])) return FALSE; } return TRUE; } /* Set the current database to the smallest one in the inverted index. `idx' specifies an object of the inverted index. */ static void est_idx_set_current(ESTIDX *idx){ int i, size, min; assert(idx); min = vlfsiz(idx->cdb); for(i = 0; i < idx->dnum; i++){ if((size = vlfsiz(idx->dbs[i])) < min){ idx->cdb = idx->dbs[i]; min = size; } } } /* Store a record related to the ID number of a document. `curia' specifies a database object. `zmode' specifies a compression mode. `id' specifies the ID number of a document. `vbuf' specifies the pointer to the value of a record. `vsiz' specifies the size of the value. The return value is true if success, else it is false. */ static int est_crput(CURIA *curia, int zmode, int id, const char *vbuf, int vsiz, int dmode){ char *zbuf; int zsiz; assert(curia && id > 0 && vbuf && vsiz >= 0); switch(zmode){ case ESTDFZLIB: if(!(zbuf = est_deflate(vbuf, vsiz, &zsiz, -1))){ dpecode = ESTEMISC; return FALSE; } if(!crput(curia, (char *)&id, sizeof(int), zbuf, zsiz, dmode)){ free(zbuf); return FALSE; } free(zbuf); break; case ESTDFLZO: if(!(zbuf = est_lzoencode(vbuf, vsiz, &zsiz))){ dpecode = ESTEMISC; return FALSE; } if(!crput(curia, (char *)&id, sizeof(int), zbuf, zsiz, dmode)){ free(zbuf); return FALSE; } free(zbuf); break; case ESTDFBZIP: if(!(zbuf = est_bzencode(vbuf, vsiz, &zsiz))){ dpecode = ESTEMISC; return FALSE; } if(!crput(curia, (char *)&id, sizeof(int), zbuf, zsiz, dmode)){ free(zbuf); return FALSE; } free(zbuf); break; default: if(!crput(curia, (char *)&id, sizeof(int), vbuf, vsiz, dmode)) return FALSE; break; } return TRUE; } /* Remove a record related to the ID number of a document. `curia' specifies a database object. `id' specifies the ID number of a document. The return value is true if success, else it is false. */ static int est_crout(CURIA *curia, int id){ assert(curia && id > 0); return crout(curia, (char *)&id, sizeof(int)); } /* Get a record related to the ID number of a document. `curia' specifies a database object. `zmode' specifies a compression mode. `id' specifies the ID number of a document. `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned. The return value is the pointer to the region of the value of the corresponding record. */ static char *est_crget(CURIA *curia, int zmode, int id, int *sp){ char *zbuf, *vbuf; int zsiz; assert(curia && id > 0 && sp); switch(zmode){ case ESTDFZLIB: if(!(zbuf = crget(curia, (char *)&id, sizeof(int), 0, -1, &zsiz))) return NULL; if(!(vbuf = est_inflate(zbuf, zsiz, sp, -1))){ free(zbuf); return NULL; } free(zbuf); break; case ESTDFLZO: if(!(zbuf = crget(curia, (char *)&id, sizeof(int), 0, -1, &zsiz))) return NULL; if(!(vbuf = est_lzodecode(zbuf, zsiz, sp))){ free(zbuf); return NULL; } free(zbuf); break; case ESTDFBZIP: if(!(zbuf = crget(curia, (char *)&id, sizeof(int), 0, -1, &zsiz))) return NULL; if(!(vbuf = est_bzdecode(zbuf, zsiz, sp))){ free(zbuf); return NULL; } free(zbuf); break; default: if(!(vbuf = crget(curia, (char *)&id, sizeof(int), 0, -1, sp))) return NULL; break; } return vbuf; } /* Add an attribute of a document to a sequencial attribute index. `db' specifies a handle of a sequencial attribute index. `id' specifies the ID number of a document. `vbuf' specifies the pointer to the attribute value. `vsiz' specifies the size of the attribute value. The return value is true if success, else it is false. */ static int est_aidx_seq_put(DEPOT *db, int id, const char *vbuf, int vsiz){ int err; assert(db && id >= 0 && vbuf && vsiz >= 0); err = FALSE; if(!dpput(db, (char *)&id, sizeof(int), vbuf, vsiz, DP_DKEEP)) err = TRUE; return err ? FALSE : TRUE; } /* Remove an attribute of a document from a sequencial attribute index. `db' specifies a handle of a sequencial attribute index. `id' specifies the ID number of a document. The return value is true if success, else it is false. */ static int est_aidx_seq_out(DEPOT *db, int id){ int err; assert(db && id >= 0); err = FALSE; if(!dpout(db, (char *)&id, sizeof(int))) err = TRUE; return err ? FALSE : TRUE; } /* Retrieve the value of an attribute of a document in a sequencial attribute index. `db' specifies a handle of a sequencial attribute index. `id' specifies the ID number of a document. The return value is the value of the attribute or `NULL' if no attribute. */ static char *est_aidx_seq_get(DEPOT *db, int id, int *sp){ assert(db && id >= 0 && sp); return dpget(db, (char *)&id, sizeof(int), 0, -1, sp); } /* Narrow scores of search candidates with a sequencial attribute index. `db' specifies a handle of a sequencial attribute index. `pdocs' specifies a list of pseudo documents. `cop' specifies the pointer to the operator. `sign' specifies the sign of operation. `oval' specifies the operation value. `osiz' specifies the size of the operation value `sval' specifies the operation value of small cases. `ssiz' specifies the size of the operation value of small cases. `regex' specifies the regular expressions. `onum' specifies the numeric value. `scores' specifies an array of scores of search candidates. `snum' specifies the number of the array. `limit' specifies the limit number to check. `restp' specifies the pointer to a variable to which rest number to be checked is assigned. The return value is the new number of the array. */ static int est_aidx_seq_narrow(DEPOT *db, const CBLIST *pdocs, const char *cop, int sign, const char *oval, int osiz, const char *sval, int ssiz, const void *regex, int onum, ESTSCORE *scores, int snum, int limit, int *restp){ char vbuf[ESTAIKBUFSIZ]; int i, nnum, vsiz; assert(db && cop && oval && osiz >= 0 && scores && snum >= 0 && limit >= 0 && restp); nnum = 0; for(i = 0; i < snum; i++){ if(nnum >= limit){ *restp = snum - i; break; } if(scores[i].id >= ESTPDOCIDMIN){ scores[nnum].id = scores[i].id; scores[nnum].score = scores[i].score; nnum++; continue; } if((vsiz = dpgetwb(db, (char *)&(scores[i].id), sizeof(int), 0, ESTAIKBUFSIZ - 1, vbuf)) < 0) continue; vbuf[vsiz] = '\0'; if(est_match_attr(vbuf, vsiz, cop, sign, oval, osiz, sval, ssiz, regex, onum)){ scores[nnum].id = scores[i].id; scores[nnum].score = scores[i].score; nnum++; } } return nnum; } /* Compare two record in numeric order. `aptr' specifies the pointer to the region of one key. `asiz' specifies the size of the region of one key. `bptr' specifies the pointer to the region of the other key. `bsiz' specifies the size of the region of the other key. The return value is positive if the former is big, negative if the latter is big, 0 if both are equivalent. */ static int est_aidx_numcmp(const char *aptr, int asiz, const char *bptr, int bsiz){ int rv; if((rv = cbstrmktime(aptr) - cbstrmktime(bptr)) != 0) return rv; return VL_CMPLEX(aptr, asiz, bptr, bsiz); } /* Add an attribute of a document to an attribute narrowing index. `db' specifies a handle of an attribute narrowing index. `id' specifies the ID number of a document. `vbuf' specifies the pointer to the attribute value. `vsiz' specifies the size of the attribute value. The return value is true if success, else it is false. */ static int est_aidx_attr_put(VILLA *db, int id, const char *vbuf, int vsiz){ char *tbuf; int err, tsiz; assert(db && id >= 0 && vbuf && vsiz >= 0); err = FALSE; tsiz = vsiz + sizeof(int) + 1; CB_MALLOC(tbuf, tsiz); memcpy(tbuf, vbuf, vsiz + 1); memcpy(tbuf + vsiz + 1, &id, sizeof(int)); if(!vlput(db, tbuf, tsiz, "", 0, VL_DKEEP)) err = TRUE; free(tbuf); return err ? FALSE : TRUE; } /* Remove an attribute of a document from an attribute narrowing index. `db' specifies a handle of an attribute narrowing index. `id' specifies the ID number of a document. `vbuf' specifies the pointer to the attribute value. `vsiz' specifies the size of the attribute value. The return value is true if success, else it is false. */ static int est_aidx_attr_out(VILLA *db, int id, const char *vbuf, int vsiz){ char *tbuf; int err, tsiz; assert(db && id >= 0 && vbuf && vsiz >= 0); err = FALSE; tsiz = vsiz + sizeof(int) + 1; CB_MALLOC(tbuf, tsiz); memcpy(tbuf, vbuf, vsiz + 1); memcpy(tbuf + vsiz + 1, &id, sizeof(int)); if(!vlout(db, tbuf, tsiz)) err = TRUE; free(tbuf); return err ? FALSE : TRUE; } /* Narrow scores of search candidates with an attribute narrowing index. `db' specifies a handle of an attribute narrowing index. `pdocs' specifies a list of pseudo documents. `cop' specifies the pointer to the operator. `sign' specifies the sign of operation. `oval' specifies the operation value. `osiz' specifies the size of the operation value `sval' specifies the operation value of small cases. `ssiz' specifies the size of the operation value of small cases. `regex' specifies the regular expressions. `onum' specifies the numeric value. `scores' specifies an array of scores of search candidates. `snum' specifies the number of the array. The return value is the new number of the array. */ static int est_aidx_attr_narrow(VILLA *db, const CBLIST *pdocs, const char *cop, int sign, const char *oval, int osiz, const char *sval, int ssiz, const void *regex, int onum, ESTSCORE *scores, int snum){ CBDATUM *abuf; CBLIST *tokens; const char *kbuf; char numbuf[ESTNUMBUFSIZ], *tmp, *wp; int i, j, ksiz, len, esc, jmp, id, nnum, *ary, anum; time_t lower, upper; assert(db && pdocs && cop && oval && osiz >= 0 && scores && snum >= 0); CB_DATUMOPEN(abuf); if(cop == ESTOPSTROREQ && sign && !sval){ tokens = cbsplit(oval, osiz, " ,"); cblistsort(tokens); for(i = 0; i < CB_LISTNUM(tokens); i++){ oval = CB_LISTVAL2(tokens, i, osiz); if(osiz < 1) continue; vlcurjump(db, oval, osiz, VL_JFORWARD); while((kbuf = vlcurkeycache(db, &ksiz)) != NULL && !strcmp(kbuf, oval)){ CB_DATUMCAT(abuf, kbuf + ksiz - sizeof(int), sizeof(int)); vlcurnext(db); } } CB_LISTCLOSE(tokens); } else if(cop == ESTOPNUMBT && sign && !sval){ CB_MEMDUP(tmp, oval, osiz); if((wp = strchr(tmp, ' ')) != NULL || (wp = strchr(tmp, '\t')) != NULL){ *(wp++) = '\0'; while(*wp == ' ' || *wp == '\t'){ wp++; } lower = cbstrmktime(tmp); upper = cbstrmktime(wp); } else { lower = cbstrmktime(tmp); upper = INT_MAX; } len = sprintf(numbuf, "%.0f", (double)lower); vlcurjump(db, numbuf, len, VL_JFORWARD); while((kbuf = vlcurkeycache(db, &ksiz)) != NULL && cbstrmktime(kbuf) <= upper){ CB_DATUMCAT(abuf, kbuf + ksiz - sizeof(int), sizeof(int)); vlcurnext(db); } free(tmp); } else if(!sign || sval){ esc = INT_MAX; jmp = INT_MAX; if(sign && (cop == ESTOPSTREQ || cop == ESTOPSTRBW) && osiz > 0){ if(*sval > 0x0 && *sval < 0x7f){ numbuf[0] = *sval; numbuf[1] = '\0'; esc = *(unsigned char *)sval; if(*sval >= 'a' && *sval <= 'z'){ numbuf[0] -= 'a' - 'A'; jmp = *sval - 'a' + 'A'; } vlcurjump(db, numbuf, 1, VL_JFORWARD); } else if(*(unsigned char *)sval >= 0xc0){ numbuf[0] = *sval; numbuf[1] = '\0'; esc = *(unsigned char *)sval; vlcurjump(db, numbuf, 1, VL_JFORWARD); } else { vlcurfirst(db); } } else { vlcurfirst(db); } while((kbuf = vlcurkeycache(db, &ksiz)) != NULL){ if(est_match_attr(kbuf, ksiz - sizeof(int) - 1, cop, sign, oval, osiz, sval, ssiz, regex, onum)) CB_DATUMCAT(abuf, kbuf + ksiz - sizeof(int), sizeof(int)); if(*(unsigned char *)kbuf > jmp && *(unsigned char *)kbuf < *(unsigned char *)sval){ numbuf[0] = *sval; numbuf[1] = '\0'; vlcurjump(db, numbuf, 1, VL_JFORWARD); jmp = INT_MAX; } else if(*(unsigned char *)kbuf > esc){ break; } else { vlcurnext(db); } } } else { if(cop == ESTOPSTREQ || cop == ESTOPSTRBW || cop == ESTOPNUMEQ || cop == ESTOPNUMGT || cop == ESTOPNUMGE){ vlcurjump(db, oval, osiz, VL_JFORWARD); if(cop == ESTOPNUMGT){ while((kbuf = vlcurkeycache(db, NULL)) != NULL && cbstrmktime(kbuf) <= onum){ vlcurnext(db); } } } else if(cop == ESTOPNUMLT || cop == ESTOPNUMLE){ len = sprintf(numbuf, "%.0f", (double)cbstrmktime(oval) + 1); vlcurjump(db, numbuf, len, VL_JBACKWARD); if(cop == ESTOPNUMLT){ while((kbuf = vlcurkeycache(db, NULL)) != NULL && cbstrmktime(kbuf) >= onum){ vlcurprev(db); } } } else { vlcurfirst(db); } while((kbuf = vlcurkeycache(db, &ksiz)) != NULL){ if(est_match_attr(kbuf, ksiz - sizeof(int) - 1, cop, TRUE, oval, osiz, sval, ssiz, regex, onum)){ CB_DATUMCAT(abuf, kbuf + ksiz - sizeof(int), sizeof(int)); } else if(cop == ESTOPSTREQ || cop == ESTOPSTRBW || cop == ESTOPNUMEQ){ break; } if(cop == ESTOPNUMLT || cop == ESTOPNUMLE){ vlcurprev(db); } else { vlcurnext(db); } } } for(i = 0; i < CB_LISTNUM(pdocs); i++){ id = ESTPDOCIDMIN + i; CB_DATUMCAT(abuf, &id, sizeof(int)); } nnum = 0; ary = (int *)CB_DATUMPTR(abuf); anum = CB_DATUMSIZE(abuf) / sizeof(int); qsort(scores, snum, sizeof(ESTSCORE), est_score_compare_by_id_asc); qsort(ary, anum, sizeof(int), est_int_compare); for(i = 0, j = 0; i < snum; i++){ while(j < anum && ary[j] < scores[i].id){ j++; } if(j < anum && scores[i].id == ary[j]){ scores[nnum].id = scores[i].id; scores[nnum].score = scores[i].score; nnum++; } } CB_DATUMCLOSE(abuf); return nnum; } /* Compare two integers. `ap' specifies the pointer to one element. `bp' specifies the pointer to the other element. The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int est_int_compare(const void *ap, const void *bp){ assert(ap && bp); return *(int *)ap - *(int *)bp; } /* Compare elements of a record for effective compression. `ap' specifies the pointer to one element. `bp' specifies the pointer to the other element. The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int est_short_compare(const void *ap, const void *bp){ assert(ap && bp); return ((((unsigned char *)ap)[0] << 8) + ((unsigned char *)ap)[1]) - ((((unsigned char *)bp)[0] << 8) + ((unsigned char *)bp)[1]); } /* Clean up the inode map. `arg' specifies a dummy argument. */ static void est_inodes_delete(void *arg){ #if defined(NDEBUG) ESTDB *db; const char *kbuf; int ecode; assert(arg); if(cbmaprnum(est_inodes) > 0){ cbmapiterinit(est_inodes); while((kbuf = cbmapiternext(est_inodes, NULL)) != NULL){ db = *(ESTDB **)cbmapiterval(kbuf, NULL); est_db_set_informer(db, est_inodes_delete_informer, NULL); est_db_close(db, &ecode); } } cbmapclose(est_inodes); #else ESTDB *db; const char *kbuf; int ecode; assert(arg); if(cbmaprnum(est_inodes) > 0){ cbmapiterinit(est_inodes); while((kbuf = cbmapiternext(est_inodes, NULL)) != NULL){ db = *(ESTDB **)cbmapiterval(kbuf, NULL); fprintf(stderr, "\nWARNING: %s is not closed.\n\n", cbmemdup(est_db_name(db), -1)); est_db_set_informer(db, est_inodes_delete_informer, NULL); est_db_close(db, &ecode); } } cbmapclose(est_inodes); #endif } /* Inform a database event while clening up database handles. `msg' specifies the message of each event. `opaque' is ignored. */ static void est_inodes_delete_informer(const char *msg, void *opaque){ #if !defined(NDEBUG) fprintf(stderr, "estraier: %s\n", msg); #endif } /* Write meta data to the database. `db' specifies a database object. The return value is true if success, else it is false. */ static int est_db_write_meta(ESTDB *db){ char vbuf[ESTNUMBUFSIZ], *sbuf; int err, ssiz; assert(db); err = FALSE; sprintf(vbuf, "%d", est_idx_num(db->idxdb)); if(!dpput(db->metadb, ESTKEYIDXNUM, -1, vbuf, -1, DP_DOVER)) err = TRUE; sprintf(vbuf, "%d", db->dseq); if(!dpput(db->metadb, ESTKEYDSEQ, -1, vbuf, -1, DP_DOVER)) err = TRUE; sprintf(vbuf, "%d", db->dnum); if(!dpput(db->metadb, ESTKEYDNUM, -1, vbuf, -1, DP_DOVER)) err = TRUE; if(db->metacc){ sbuf = cbmapdump(db->metacc, &ssiz); if(!dpput(db->metadb, ESTKEYMETA, -1, sbuf, ssiz, DP_DOVER)) err = TRUE; free(sbuf); } if(err){ est_set_ecode(&(db->ecode), ESTEDB, __LINE__); db->fatal = TRUE; } return err ? FALSE : TRUE; } /* Call the callback function of a database. `db' specifies a database object. `info' specifies an extra message. */ static void est_db_inform(ESTDB *db, const char *info){ char *msg; assert(db && info); if(!db->infocb) return; msg = cbsprintf("%s: name=%s dnum=%d wnum=%d fsiz=%.0f crnum=%d csiz=%d dknum=%d", info, db->name, db->dnum, vlrnum(db->fwmdb), (double)est_db_size(db), cbmaprnum(db->idxcc) + cbmaprnum(db->auxcc), est_db_used_cache_size(db), cbmaprnum(db->outcc)); db->infocb(msg, db->infoop); free(msg); } /* Prepare cache for meta data. `db' specifies a database object. */ static void est_db_prepare_meta(ESTDB *db){ char *sbuf; int ssiz; assert(db); if((sbuf = dpget(db->metadb, ESTKEYMETA, -1, 0, -1, &ssiz)) != NULL){ db->metacc = cbmapload(sbuf, ssiz); free(sbuf); } else { db->metacc = cbmapopenex(ESTMINIBNUM); } } /* Score a document object matching the phrase of a search condition object definitely. `db' specifies a database object. `doc' specifies a document object. `cond' specifies a search condition object. `scp' specifies the pointer to a variable to which the score is assigned. The return value is true if the document matches the phrase of the condition object definitely, else it is false. */ static int est_db_score_doc(ESTDB *db, ESTDOC *doc, ESTCOND *cond, int *scp){ struct { char *word; int num; } wsets[ESTSCANWNUM], nsets[ESTSCANWNUM]; CBLIST *terms, *words; const char *term, *text, *rp; unsigned char *rbuf; char *tmp; int i, j, k, sc, wsnum, nsnum, asiz, tsiz, add, rsiz, hit; double tune; assert(db && doc && cond && scp); *scp = 0; if(!cond->phrase || cbstrfwmatch(cond->phrase, ESTOPSIMILAR) || cbstrfwmatch(cond->phrase, ESTOPID) || cbstrfwmatch(cond->phrase, ESTOPURI)) return FALSE; if(!doc->dtexts) CB_LISTOPEN(doc->dtexts); switch(cond->pmode){ default: terms = est_phrase_terms(cond->phrase); break; case ESTPMSIMPLE: tmp = est_phrase_from_simple(cond->phrase); terms = est_phrase_terms(tmp); free(tmp); break; case ESTPMROUGH: tmp = est_phrase_from_rough(cond->phrase); terms = est_phrase_terms(tmp); free(tmp); break; case ESTPMUNION: tmp = est_phrase_from_union(cond->phrase); terms = est_phrase_terms(tmp); free(tmp); break; case ESTPMISECT: tmp = est_phrase_from_isect(cond->phrase); terms = est_phrase_terms(tmp); free(tmp); break; } wsnum = 0; nsnum = 0; add = TRUE; for(i = 0; i < CB_LISTNUM(terms); i++){ term = CB_LISTVAL(terms, i); if(!strcmp(term, ESTOPISECT)){ add = TRUE; } else if(!strcmp(term, ESTOPDIFF)){ add = FALSE; } else if(strcmp(term, ESTOPUVSET)){ if(term[0] == ' '){ term++; if(term[0] == 'b'){ term++; } else if(term[0] == 'e'){ term++; } } words = cbsplit(term, -1, "\t"); if(add){ while(wsnum < ESTSCANWNUM && CB_LISTNUM(words) > 0){ wsets[wsnum].word = cblistshift(words, NULL); wsets[wsnum].num = i; wsnum++; } } else { while(nsnum < ESTSCANWNUM && CB_LISTNUM(words) > 0){ nsets[nsnum].word = cblistshift(words, NULL); nsets[nsnum].num = i; nsnum++; } } CB_LISTCLOSE(words); } } asiz = 0; sc = 0; if((rp = cbmapget(doc->attrs, "\t", 1, NULL)) != NULL) sc = -1 - atoi(rp); for(i = -1; i < CB_LISTNUM(doc->dtexts); i++){ if(i < 0){ if(!doc->attrs || !(text = cbmapget(doc->attrs, "", 0, NULL))) continue; asiz += strlen(text); } else { text = CB_LISTVAL2(doc->dtexts, i, tsiz); asiz += tsiz; } rbuf = (unsigned char *)est_uconv_in(text, strlen(text), &rsiz); est_canonicalize_text(rbuf, rsiz, FALSE); tmp = est_uconv_out((char *)rbuf, rsiz, &rsiz); for(j = 0; j < wsnum; j++){ if(!wsets[j].word) continue; if((rp = est_strstr_sparse(tmp, wsets[j].word)) != NULL){ if(sc >= 0){ do { sc += 16; rp += strlen(wsets[j].word); } while((rp = est_strstr_sparse(rp, wsets[j].word)) != NULL); } for(k = 0; k < wsnum; k++){ if(!wsets[k].word) continue; if(wsets[k].num == wsets[j].num){ free(wsets[k].word); wsets[k].word = NULL; } } } } for(j = 0; j < nsnum; j++){ if(!nsets[j].word) continue; if((rp = est_strstr_sparse(tmp, nsets[j].word)) != NULL){ for(k = 0; k < nsnum; k++){ if(!nsets[k].word) continue; if(nsets[k].num == nsets[j].num){ free(nsets[k].word); nsets[k].word = NULL; } } } } free(tmp); free(rbuf); } hit = TRUE; for(i = 0; i < wsnum; i++){ if(!wsets[i].word) continue; free(wsets[i].word); hit = FALSE; } for(i = 0; i < nsnum; i++){ if(!nsets[i].word){ hit = FALSE; continue; } free(nsets[i].word); } CB_LISTCLOSE(terms); if(sc < 0) sc = -1 - sc; tune = sqrt(asiz / 8.0 + 128) / 16.0; switch(db->smode){ case ESTDFSCVOID: sc = 0; break; default: sc /= tune; if(sc >= 0x80) sc += (0x80 - sc) * 0.75; if(sc >= 0xc0) sc += (0xc0 - sc) * 0.75; sc = sc < 0xff ? sc : 0xff; break; case ESTDFSCINT: sc /= tune; break; case ESTDFSCASIS: break; } *scp = sc; return hit; } /* Get the ID of a document specified by URI from pseudo indexes. `db' specifies a database object. `uri' specifies the URI of a registered document. The return value is the ID of the document. On error, -1 is returned. */ static int est_pidx_uri_to_id(ESTDB *db, const char *uri){ ESTDOC *doc; const char *vbuf; int i, vsiz; assert(db && uri); if(!db->puris){ db->puris = cbmapopenex(CB_LISTNUM(db->pdocs) + 1); for(i = 0; i < CB_LISTNUM(db->pdocs); i++){ if((doc = est_db_get_doc(db, ESTPDOCIDMIN + i, 0)) != NULL){ if((vbuf = cbmapget(doc->attrs, ESTDATTRURI, -1, &vsiz)) != NULL) cbmapput(db->puris, vbuf, vsiz, (char *)&(doc->id), sizeof(int), FALSE); est_doc_delete(doc); } } } if((vbuf = cbmapget(db->puris, uri, -1, NULL)) != NULL) return *(int *)vbuf; return -1; } /* Create a list of terms for search. `phrase' specifies a search phrase. The return value is a list object of the terms of the phrase. */ static CBLIST *est_phrase_terms(const char *phrase){ CBLIST *terms, *elems; CBDATUM *datum; const char *elem; char *tbuf, *pbuf; int i, tsiz, psiz, lw; assert(phrase); CB_LISTOPEN(terms); tbuf = est_uconv_in(phrase, strlen(phrase), &tsiz); est_normalize_text((unsigned char *)tbuf, tsiz, &tsiz); pbuf = est_uconv_out(tbuf, tsiz, &psiz); elems = cbsplit(pbuf, psiz, "\a\b\t\n\v\f\r "); CB_DATUMOPEN(datum); lw = FALSE; for(i = 0; i < CB_LISTNUM(elems); i++){ elem = CB_LISTVAL(elems, i); if(elem[0] == '\0') continue; if(!strcmp(elem, ESTOPUNION)){ if(CB_DATUMSIZE(datum) < 1) continue; if(lw) CB_DATUMCAT(datum, "\t", 1); lw = FALSE; } else if(!strcmp(elem, ESTOPWCBW)){ if(!lw) CB_DATUMCAT(datum, " b", 2); } else if(!strcmp(elem, ESTOPWCEW)){ if(!lw) CB_DATUMCAT(datum, " e", 2); } else if(!strcmp(elem, ESTOPWCRX)){ if(!lw) CB_DATUMCAT(datum, " r", 2); } else if(!strcmp(elem, ESTOPISECT) || !strcmp(elem, ESTOPDIFF)){ if(CB_DATUMSIZE(datum) < 1) continue; CB_LISTPUSH(terms, CB_DATUMPTR(datum), CB_DATUMSIZE(datum)); CB_DATUMSETSIZE(datum, 0); CB_LISTPUSH(terms, elem, strlen(elem)); lw = FALSE; } else { if(CB_DATUMSIZE(datum) > 0 && lw) CB_DATUMCAT(datum, " ", 1); CB_DATUMCAT(datum, elem, strlen(elem)); lw = TRUE; } } if(CB_DATUMSIZE(datum) > 0) CB_LISTPUSH(terms, CB_DATUMPTR(datum), CB_DATUMSIZE(datum)); CB_DATUMCLOSE(datum); CB_LISTCLOSE(elems); free(pbuf); free(tbuf); for(i = 0; i < CB_LISTNUM(terms); i++){ elem = CB_LISTVAL(terms, i); if(!strcmp(elem, ESTOPUVSET) || !strcmp(elem, ESTOPISECT) || !strcmp(elem, ESTOPDIFF)) continue; tbuf = est_uconv_in(elem, strlen(elem), &tsiz); est_canonicalize_text((unsigned char *)tbuf, tsiz, TRUE); pbuf = est_uconv_out(tbuf, tsiz, &psiz); cblistover(terms, i, pbuf, -1); free(pbuf); free(tbuf); } for(i = CB_LISTNUM(terms) - 1; i >= 0; i--){ elem = CB_LISTVAL(terms, i); if(strcmp(elem, ESTOPISECT) && strcmp(elem, ESTOPDIFF)) break; CB_LISTDROP(terms); } return terms; } /* Compare two scores by each ID for ascending order. `ap' specifies the pointer to one score. `bp' specifies the pointer to the other score. The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int est_score_compare_by_id_asc(const void *ap, const void *bp){ assert(ap && bp); return ((ESTSCORE *)ap)->id - ((ESTSCORE *)bp)->id; } /* Compare two scores by each ID for descending order. `ap' specifies the pointer to one score. `bp' specifies the pointer to the other score. The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int est_score_compare_by_id_desc(const void *ap, const void *bp){ assert(ap && bp); return ((ESTSCORE *)bp)->id - ((ESTSCORE *)ap)->id; } /* Compare two scores by each score point for ascending order. `ap' specifies the pointer to one score. `bp' specifies the pointer to the other score. The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int est_score_compare_by_score_asc(const void *ap, const void *bp){ assert(ap && bp); return ((ESTSCORE *)ap)->score - ((ESTSCORE *)bp)->score; } /* Compare two scores by each score point for descending order. `ap' specifies the pointer to one score. `bp' specifies the pointer to the other score. The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int est_score_compare_by_score_desc(const void *ap, const void *bp){ assert(ap && bp); return ((ESTSCORE *)bp)->score - ((ESTSCORE *)ap)->score; } /* Compare two scores by attributes of strings for ascending order. `ap' specifies the pointer to one score. `bp' specifies the pointer to the other score. The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int est_score_compare_by_str_asc(const void *ap, const void *bp){ assert(ap && bp); return strcmp(((ESTSCORE *)ap)->value, ((ESTSCORE *)bp)->value); } /* Compare two scores by attributes of strings for descending order. `ap' specifies the pointer to one score. `bp' specifies the pointer to the other score. The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int est_score_compare_by_str_desc(const void *ap, const void *bp){ assert(ap && bp); return strcmp(((ESTSCORE *)bp)->value, ((ESTSCORE *)ap)->value); } /* Compare two scores by attributes of numbers for ascending order. `ap' specifies the pointer to one score. `bp' specifies the pointer to the other score. The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int est_score_compare_by_num_asc(const void *ap, const void *bp){ assert(ap && bp); return (time_t)((ESTSCORE *)ap)->value - (time_t)((ESTSCORE *)bp)->value; } /* Compare two scores by attributes of numbers for descending order. `ap' specifies the pointer to one score. `bp' specifies the pointer to the other score. The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int est_score_compare_by_num_desc(const void *ap, const void *bp){ assert(ap && bp); return (time_t)((ESTSCORE *)bp)->value - (time_t)((ESTSCORE *)ap)->value; } /* Compare two meta scores by each ID for ascending order. `ap' specifies the pointer to one meta score `bp' specifies the pointer to the other meta score The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int est_metascore_compare_by_id_asc(const void *ap, const void *bp){ assert(ap && bp); return ((ESTMETASCORE *)ap)->id - ((ESTMETASCORE *)bp)->id; } /* Compare two meta scores by each ID for descending order. `ap' specifies the pointer to one meta score `bp' specifies the pointer to the other meta score The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int est_metascore_compare_by_id_desc(const void *ap, const void *bp){ assert(ap && bp); return ((ESTMETASCORE *)bp)->id - ((ESTMETASCORE *)ap)->id; } /* Compare two meta scores by each score point for ascending order. `ap' specifies the pointer to one meta score `bp' specifies the pointer to the other meta score The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int est_metascore_compare_by_score_asc(const void *ap, const void *bp){ assert(ap && bp); return ((ESTMETASCORE *)ap)->score - ((ESTMETASCORE *)bp)->score; } /* Compare two meta scores by each score point for descending order. `ap' specifies the pointer to one meta score `bp' specifies the pointer to the other meta score The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int est_metascore_compare_by_score_desc(const void *ap, const void *bp){ assert(ap && bp); return ((ESTMETASCORE *)bp)->score - ((ESTMETASCORE *)ap)->score; } /* Compare two meta scores by attributes of strings for ascending order. `ap' specifies the pointer to one meta score `bp' specifies the pointer to the other meta score The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int est_metascore_compare_by_str_asc(const void *ap, const void *bp){ assert(ap && bp); return strcmp(((ESTMETASCORE *)ap)->value, ((ESTMETASCORE *)bp)->value); } /* Compare two meta scores by attributes of strings for descending order. `ap' specifies the pointer to one meta score `bp' specifies the pointer to the other meta score The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int est_metascore_compare_by_str_desc(const void *ap, const void *bp){ assert(ap && bp); return strcmp(((ESTMETASCORE *)bp)->value, ((ESTMETASCORE *)ap)->value); } /* Compare two meta scores by attributes of numbers for ascending order. `ap' specifies the pointer to one meta score `bp' specifies the pointer to the other meta score The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int est_metascore_compare_by_num_asc(const void *ap, const void *bp){ assert(ap && bp); return (time_t)((ESTMETASCORE *)ap)->value - (time_t)((ESTMETASCORE *)bp)->value; } /* Compare two meta scores by attributes of numbers for descending order. `ap' specifies the pointer to one meta score `bp' specifies the pointer to the other meta score The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int est_metascore_compare_by_num_desc(const void *ap, const void *bp){ assert(ap && bp); return (time_t)((ESTMETASCORE *)bp)->value - (time_t)((ESTMETASCORE *)ap)->value; } /* Get the universal set of documents in a database. `db' specifies a database object. `nump' specifies the pointer to which the number of elements in the result is assigned. `hints' specifies a list object. If it is `NULL', it is not used. `add' specifies whether the result to be treated in union or difference. The return value is an array of score structures of corresponding documents. */ static ESTSCORE *est_search_uvset(ESTDB *db, int *nump, CBMAP *hints, int add){ ESTSCORE *scores; char *vbuf, numbuf[ESTNUMBUFSIZ]; int snum, smax; assert(db && nump); smax = ESTALLOCUNIT; CB_MALLOC(scores, smax * sizeof(ESTSCORE)); snum = 0; vlcurfirst(db->listdb); while((vbuf = vlcurval(db->listdb, NULL)) != NULL){ if(snum >= smax){ smax *= 2; CB_REALLOC(scores, smax * sizeof(ESTSCORE)); } scores[snum].id = atoi(vbuf); scores[snum].score = 0; scores[snum].value = NULL; snum++; free(vbuf); vlcurnext(db->listdb); } *nump = snum; if(hints){ sprintf(numbuf, "%d", snum * (add ? 1 : -1)); cbmapput(hints, ESTOPUVSET, -1, numbuf, -1, TRUE); } return scores; } /* Expand a word to words which begins with it. `db' specifies a database object. `word' specifies a word. `list' specifies a list object to contain the results. */ static void est_expand_word_bw(ESTDB *db, const char *word, CBLIST *list){ const char *kbuf; int num, ksiz; assert(db && word && list); num = 0; vlcurjump(db->fwmdb, word, -1, VL_JFORWARD); while((kbuf = vlcurkeycache(db->fwmdb, &ksiz)) != NULL){ if(!cbstrfwmatch(kbuf, word)) break; CB_LISTPUSH(list, kbuf, ksiz); if(++num >= db->wildmax) break; vlcurnext(db->fwmdb); } } /* Expand a word to words which ends with it. `db' specifies a database object. `word' specifies a word. `list' specifies a list object to contain the results. */ static void est_expand_word_ew(ESTDB *db, const char *word, CBLIST *list){ const char *kbuf; int num, wsiz, ksiz; assert(db && word && list); num = 0; wsiz = strlen(word); vlcurfirst(db->fwmdb); while((kbuf = vlcurkeycache(db->fwmdb, &ksiz)) != NULL){ if(ksiz >= wsiz && !memcmp(kbuf + ksiz - wsiz, word, wsiz)){ CB_LISTPUSH(list, kbuf, ksiz); if(++num >= db->wildmax) break; } vlcurnext(db->fwmdb); } } /* Expand regular expressios to words which matches them. `db' specifies a database object. `word' specifies regular expressions. `list' specifies a list object to contain the results. */ static void est_expand_word_rx(ESTDB *db, const char *word, CBLIST *list){ void *regex; const char *kbuf; int num, ksiz; assert(db && word && list); if(!(regex = est_regex_new(word))) return; num = 0; vlcurfirst(db->fwmdb); while((kbuf = vlcurkeycache(db->fwmdb, &ksiz)) != NULL){ if(est_regex_match(regex, kbuf)){ CB_LISTPUSH(list, kbuf, ksiz); if(++num >= db->wildmax) break; } vlcurnext(db->fwmdb); } est_regex_delete(regex); } /* Expand a keyword to keywords which begins with it. `db' specifies a database object. `word' specifies a word. `list' specifies a list object to contain the results. */ static void est_expand_keyword_bw(ESTDB *db, const char *word, CBLIST *list){ const char *kbuf; int num, ksiz; assert(db && word && list); num = 0; vlcurjump(db->xfmdb, word, -1, VL_JFORWARD); while((kbuf = vlcurkeycache(db->xfmdb, &ksiz)) != NULL){ if(!cbstrfwmatch(kbuf, word)) break; CB_LISTPUSH(list, kbuf, ksiz); if(++num >= db->wildmax) break; vlcurnext(db->xfmdb); } } /* Expand a keyword to keywords which ends with it. `db' specifies a database object. `word' specifies a word. `list' specifies a list object to contain the results. */ static void est_expand_keyword_ew(ESTDB *db, const char *word, CBLIST *list){ const char *kbuf; int num, wsiz, ksiz; assert(db && word && list); num = 0; wsiz = strlen(word); vlcurfirst(db->xfmdb); while((kbuf = vlcurkeycache(db->xfmdb, &ksiz)) != NULL){ if(ksiz >= wsiz && !memcmp(kbuf + ksiz - wsiz, word, wsiz)){ CB_LISTPUSH(list, kbuf, ksiz); if(++num >= db->wildmax) break; } vlcurnext(db->xfmdb); } } /* Expand regular expressios to keywords which matches them. `db' specifies a database object. `word' specifies regular expressions. `list' specifies a list object to contain the results. */ static void est_expand_keyword_rx(ESTDB *db, const char *word, CBLIST *list){ void *regex; const char *kbuf; int num, ksiz; assert(db && word && list); if(!(regex = est_regex_new(word))) return; num = 0; vlcurfirst(db->xfmdb); while((kbuf = vlcurkeycache(db->xfmdb, &ksiz)) != NULL){ if(est_regex_match(regex, kbuf)){ CB_LISTPUSH(list, kbuf, ksiz); if(++num >= db->wildmax) break; } vlcurnext(db->xfmdb); } est_regex_delete(regex); } /* Get a correspinding set of documents in a database. `db' specifies a database object. `term' specifies a union term. `gstep' specifies number of steps of N-gram. `xpn' specifies the pointer to a function for query expansion. If it is `NULL', it is not used. `nump' specifies the pointer to which the number of elements in the result is assigned. `hints' specifies a list object. If it is `NULL', it is not used. `add' specifies whether the result to be treated in union or difference. `auxmin' specifies the minimum hits to adopt the auxiliary index. If it is not more than 0, the auxiliary index is not used. `auxwords' specifies a map object where keywords used with the auxiliary index are stored. If it is `NULL', it is not used. The return value is an array of score structures of corresponding documents. */ static ESTSCORE *est_search_union(ESTDB *db, const char *term, int gstep, void (*xpn)(const char *, CBLIST *), int *nump, CBMAP *hints, int add, int auxmin, CBMAP *auxwords){ const ESTSCORE *cscores; ESTSCORE *scores, *tscores, *nscores; CBMAP *umap; CBLIST *words, *grams, *tgrams; const char *ckey, *word, *gram, *rp, *fnext, *snext, *cbuf; char *vbuf, *wbuf, numbuf[ESTNUMBUFSIZ]; int i, j, k, snum, smax, cksiz, single, tsmax, tsnum, nsnum, vsiz, gcnum; int gsiz, csiz, wgstep, nnum, west, wild, mfsiz, mssiz, mfhash, mshash, tfhash, tshash; int id, vstep, score, hit, hnum; double avg, sd, dif; assert(db && term && gstep > 0 && nump); smax = ESTALLOCUNIT; CB_MALLOC(scores, smax * sizeof(ESTSCORE)); snum = 0; words = cbsplit(term, -1, "\t"); if(xpn){ umap = cbmapopenex(ESTMINIBNUM); for(i = 0; i < CB_LISTNUM(words); i++){ word = CB_LISTVAL(words, i); if(word[0] == '\0' || word[0] == ' ') continue; CB_LISTOPEN(grams); xpn(word, grams); for(j = 0; j < CB_LISTNUM(grams); j++){ word = CB_LISTVAL(grams, j); cbmapput(umap, word, -1, "", 0, FALSE); } CB_LISTCLOSE(grams); } CB_LISTCLOSE(words); words = cbmapkeys(umap); cbmapclose(umap); } for(i = 0; i < CB_LISTNUM(words); i++){ ckey = CB_LISTVAL2(words, i, cksiz); if(cksiz < 1) continue; word = ckey; wbuf = NULL; if((cscores = est_rescc_get(db, ckey, cksiz, &tsnum)) != NULL){ if(word[0] == ' '){ word++; if(word[0] != '\0') word++; } if(hints){ sprintf(numbuf, "%d", tsnum * (add ? 1 : -1)); cbmapput(hints, word, -1, numbuf, -1, TRUE); } for(j = 0; j < tsnum; j++){ if(snum >= smax){ smax *= 2; CB_REALLOC(scores, smax * sizeof(ESTSCORE)); } scores[snum].id = cscores[j].id; scores[snum].score = cscores[j].score; snum++; } } else if(!strchr(word + 1, ' ') && auxmin > 0 && (tscores = est_search_keywords(db, word, auxmin, &tsnum)) != NULL){ if(word[0] == ' '){ word++; if(word[0] != '\0') word++; } if(hints){ sprintf(numbuf, "%d", tsnum * (add ? 1 : -1)); cbmapput(hints, word, -1, numbuf, -1, TRUE); } if(auxwords) cbmapput(auxwords, word, -1, "", 0, FALSE); for(j = 0; j < tsnum; j++){ if(snum >= smax){ smax *= 2; CB_REALLOC(scores, smax * sizeof(ESTSCORE)); } scores[snum].id = tscores[j].id; scores[snum].score = tscores[j].score; snum++; } free(tscores); } else { wild = '\0'; if(word[0] == ' '){ word++; if(word[0] == 'b'){ wild = 'b'; word++; } else if(word[0] == 'e'){ wild = 'e'; word++; } else if(word[0] == 'r'){ wild = 'r'; word++; } } west = ((unsigned char *)word)[0] <= 0xdf; if(!west || db->amode) wild = '\0'; single = FALSE; CB_LISTOPEN(grams); switch(wild){ case 'b': est_break_text(word, grams, TRUE, FALSE); CB_LISTPUSH(grams, word, strlen(word)); while(CB_LISTNUM(grams) > 1){ CB_LISTDROP(grams); } wbuf = cbmemdup(CB_LISTVAL(grams, 0), -1); word = wbuf; est_expand_word_bw(db, word, grams); single = TRUE; break; case 'e': est_break_text(word, grams, TRUE, FALSE); cblistunshift(grams, word, -1); while(CB_LISTNUM(grams) > 1){ free(cblistshift(grams, NULL)); } wbuf = cbmemdup(CB_LISTVAL(grams, 0), -1); word = wbuf; est_expand_word_ew(db, word, grams); single = TRUE; break; case 'r': est_break_text(word, grams, TRUE, FALSE); while(CB_LISTNUM(grams) > 0){ free(cblistshift(grams, NULL)); } est_expand_word_rx(db, word, grams); single = TRUE; break; default: switch(db->amode){ case ESTDFPERFNG: est_break_text_perfng(word, grams, TRUE, FALSE); break; case ESTDFCHRCAT: est_break_text_chrcat(word, grams, TRUE); break; default: est_break_text(word, grams, TRUE, FALSE); break; } if(CB_LISTNUM(grams) < 1){ est_expand_word_bw(db, word, grams); single = TRUE; } break; } tsmax = ESTALLOCUNIT; CB_MALLOC(tscores, tsmax * sizeof(ESTSCORE)); tsnum = 0; gcnum = 0; wgstep = !single && (CB_LISTNUM(grams) > 2 || gstep > 2) ? gstep : 1; if(west && gstep <= 2) wgstep = 1; for(j = 0; j < CB_LISTNUM(grams); j += wgstep){ gcnum++; gram = CB_LISTVAL2(grams, j, gsiz); fnext = cblistval(grams, j + 1, &mfsiz); snext = cblistval(grams, j + 2, &mssiz); mfhash = fnext ? dpinnerhash(fnext, mfsiz) % ESTJHASHNUM + 1: 0xff; mshash = snext ? dpouterhash(snext, mssiz) % ESTJHASHNUM + 1: 0xff; vbuf = est_idx_scan(db->idxdb, gram, gsiz, &vsiz, db->smode); if((cbuf = cbmapget(db->idxcc, gram, gsiz, &csiz)) != NULL){ CB_REALLOC(vbuf, vsiz + csiz + 1); memcpy(vbuf + vsiz, cbuf, csiz); vsiz += csiz; } rp = vbuf; while(rp < vbuf + vsiz){ EST_READ_VNUMBUF(rp, id, vstep); rp += vstep; switch(db->smode){ case ESTDFSCVOID: score = 0; break; default: score = *(unsigned char *)rp; rp++; break; case ESTDFSCINT: case ESTDFSCASIS: memcpy(&score, rp, sizeof(int)); rp += sizeof(int); break; } hit = mfhash == 0xff && mshash == 0xff; while(rp < vbuf + vsiz && *(unsigned char *)rp != 0x00){ tfhash = *(unsigned char *)rp; rp++; tshash = *(unsigned char *)rp; rp++; if((mfhash == 0xff || mfhash == tfhash) && (mshash == 0xff || mshash == tshash)) hit = TRUE; } rp++; if(hit || single){ if(tsnum >= tsmax){ tsmax *= 2; CB_REALLOC(tscores, tsmax * sizeof(ESTSCORE)); } tscores[tsnum].id = id; switch(db->smode){ case ESTDFSCVOID: tscores[tsnum].score = rp - vbuf; break; default: tscores[tsnum].score = score * 100 + 10; break; case ESTDFSCASIS: tscores[tsnum].score = score; break; } tsnum++; } } free(vbuf); } if(CB_LISTNUM(grams) == 1 && !single && db->amode == 0 && *(unsigned char *)word < 0xe0){ CB_LISTOPEN(tgrams); est_break_text(word, tgrams, TRUE, TRUE); if(CB_LISTNUM(tgrams) == 2){ gram = CB_LISTVAL(tgrams, 1); nscores = est_search_union(db, gram, 1, NULL, &nsnum, NULL, TRUE, -1, NULL); for(j = 0; j < nsnum; j++){ if(tsnum >= tsmax){ tsmax *= 2; CB_REALLOC(tscores, tsmax * sizeof(ESTSCORE)); } tscores[tsnum].id = nscores[j].id; tscores[tsnum].score = nscores[j].score; tsnum++; } free(nscores); gcnum++; } CB_LISTCLOSE(tgrams); } if(gcnum > 1){ qsort(tscores, tsnum, sizeof(ESTSCORE), est_score_compare_by_id_asc); nnum = 0; for(j = 0; j < tsnum; j++){ id = tscores[j].id; score = tscores[j].score; hnum = 1; if(db->smode == ESTDFSCASIS){ for(k = j + 1; k < tsnum && tscores[k].id == id; k++){ hnum++; } if(hnum >= gcnum || single){ tscores[nnum].id = id; tscores[nnum].score = score; nnum++; } } else { for(k = j + 1; k < tsnum && tscores[k].id == id; k++){ score += tscores[k].score; hnum++; } if(hnum >= gcnum || single){ tscores[nnum].id = id; tscores[nnum].score = score / hnum; nnum++; } } j = k - 1; } tsnum = nnum; } if(hints){ sprintf(numbuf, "%d", tsnum * (add ? 1 : -1)); cbmapput(hints, word, -1, numbuf, -1, TRUE); } CB_LISTCLOSE(grams); if(db->smode != ESTDFSCASIS && !strchr(word, ' ') && auxmin > 0) est_weight_keywords(db, word, tscores, tsnum); for(j = 0; j < tsnum; j++){ if(snum >= smax){ smax *= 2; CB_REALLOC(scores, smax * sizeof(ESTSCORE)); } scores[snum].id = tscores[j].id; scores[snum].score = tscores[j].score; snum++; } est_rescc_put(db, ckey, cksiz, tscores, tsnum); } free(wbuf); } CB_LISTCLOSE(words); qsort(scores, snum, sizeof(ESTSCORE), est_score_compare_by_id_asc); nnum = 0; for(i = 0; i < snum; i++){ id = scores[i].id; score = scores[i].score; hnum = 1; for(j = i + 1; j < snum && scores[j].id == id; j++){ score += scores[j].score; hnum++; } scores[nnum].id = id; scores[nnum].score = score / hnum; scores[nnum].value = NULL; nnum++; i = j - 1; } *nump = nnum; if(db->smode != ESTDFSCASIS && nnum > 0){ avg = 0.0; for(i = 0; i < nnum; i++){ avg += scores[i].score; } avg /= nnum; sd = 0.0; for(i = 0; i < nnum; i++){ dif = avg - scores[i].score; sd += dif * dif; } sd /= nnum; sd = sqrt(sd); if(sd < 0.1){ for(i = 0; i < nnum; i++){ scores[i].score = ESTSCOREUNIT / 2; } } else { for(i = 0; i < nnum; i++){ scores[i].score = (int)(((scores[i].score - avg) * (ESTSCOREUNIT / 10.0) / sd) + ESTSCOREUNIT / 2.0); } } } return scores; } /* Get scores in the result cache. `db' specifies a database object. `word' specifies a search word. `size' specifies the size of the word. `nump' specifies the pointer to which the number of elements in the result is assigned. The return value is an array whose elements are ID numbers of corresponding documents. */ static const ESTSCORE *est_rescc_get(ESTDB *db, const char *word, int size, int *nump){ const char *vbuf; int vsiz; assert(db && word && size >= 0 && nump); if(!(vbuf = cbmapget(db->rescc, word, size, &vsiz))) return NULL; if(vsiz == sizeof(ESTSCORE) && ((ESTSCORE *)vbuf)->id == -1) return NULL; cbmapmove(db->rescc, word, size, FALSE); *nump = vsiz / sizeof(ESTSCORE); return (ESTSCORE *)vbuf; } /* Add scores into the result cache. `db' specifies a database object. `word' specifies a search word. `size' specifies the size of the word. `scores' specifies an array of scores. It is released in this function. `num' specifies the number of elements of the score array. */ static void est_rescc_put(ESTDB *db, const char *word, int size, ESTSCORE *scores, int num){ int i; assert(db && word && size >= 0 && scores && num >= 0); if(db->rcmnum < 1){ free(scores); return; } cbmapput(db->rescc, word, size, (char *)scores, num * sizeof(ESTSCORE), TRUE); free(scores); if(cbmaprnum(db->rescc) > db->rcmnum){ num = db->rcmnum * 0.1 + 1; cbmapiterinit(db->rescc); for(i = 0; i < num && (word = cbmapiternext(db->rescc, &size)) != NULL; i++){ cbmapout(db->rescc, word, size); } } } /* Search the auxiliary index. `db' specifies a database object. `word' specifies a search word. `min' specifies the minimum hits to adopt the auxiliary index. `nump' specifies the pointer to which the number of elements in the result is assigned. The return value is an array of score structures of corresponding documents. */ static ESTSCORE *est_search_keywords(ESTDB *db, const char *word, int min, int *nump){ ESTSCORE *scores; CBLIST *words; CBDATUM *rbuf; const int *res; int i, rnum, snum, wsiz, nnum, lid; assert(db && word && min >= 0 && nump); if(*word != ' ' && (res = (int *)vlgetcache(db->auxdb, word, -1, &rnum)) != NULL && (rnum /= sizeof(int)) / 2 >= min){ CB_MALLOC(scores, (rnum / 2) * sizeof(ESTSCORE) + 1); snum = 0; for(i = 0; i < rnum; i += 2){ scores[snum].id = res[i]; scores[snum].score = res[i+1]; snum++; } *nump = snum; return scores; } CB_LISTOPEN(words); if(*word == ' '){ word++; if(*word == 'b'){ est_expand_keyword_bw(db, word + 1, words); } else if(*word == 'e'){ est_expand_keyword_ew(db, word + 1, words); } else if(*word == 'r'){ est_expand_keyword_rx(db, word + 1, words); } } else if(*(unsigned char *)word >= 0xe3){ est_expand_keyword_bw(db, word, words); } CB_DATUMOPEN(rbuf); for(i = 0; i < CB_LISTNUM(words) && CB_DATUMSIZE(rbuf) <= sizeof(int) * 2 * min * ESTAUXEXRAT; i++){ word = CB_LISTVAL2(words, i, wsiz); if(!(res = (int *)vlgetcache(db->auxdb, word, wsiz, &rnum))) continue; CB_DATUMCAT(rbuf, (char *)res, rnum); } res = (int *)CB_DATUMPTR(rbuf); rnum = CB_DATUMSIZE(rbuf); if((rnum /= sizeof(int)) / 2 < min){ CB_DATUMCLOSE(rbuf); CB_LISTCLOSE(words); return NULL; } CB_MALLOC(scores, (rnum / 2) * sizeof(ESTSCORE) + 1); snum = 0; for(i = 0; i < rnum; i += 2){ scores[snum].id = res[i]; scores[snum].score = res[i+1]; snum++; } qsort(scores, snum, sizeof(ESTSCORE), est_score_compare_by_id_asc); nnum = 0; lid = -1; for(i = 0; i < snum; i++){ if(nnum > 0 && scores[i].id == lid){ scores[nnum-1].score += scores[i].score; continue; } scores[nnum].id = scores[i].id; scores[nnum].score = scores[i].score; nnum++; lid = scores[i].id; } CB_DATUMCLOSE(rbuf); CB_LISTCLOSE(words); *nump = nnum; return scores; } /* Weight scores with the auxiliary index. `db' specifies a database object. `word' specifies a search word. `scores' specifies an array of scores of search candidates. `snum' specifies the number of the array. */ static void est_weight_keywords(ESTDB *db, const char *word, ESTSCORE *scores, int snum){ ESTSCORE *kscores; const int *res; int i, knum, nnum; double rank; if(!(res = (int *)vlgetcache(db->auxdb, word, -1, &knum)) || knum < 2) return; knum /= sizeof(int); CB_MALLOC(kscores, knum / 2 * sizeof(ESTSCORE)); rank = knum / 2 + 1; nnum = 0; for(i = 0; i < knum; i += 2){ kscores[nnum].id = res[i]; kscores[nnum].score = (pow(rank, 0.7) / 8.0 + 1.0) * 10000.0; nnum++; rank -= 1.0; } knum = nnum; qsort(scores, snum, sizeof(ESTSCORE), est_score_compare_by_id_asc); qsort(kscores, knum, sizeof(ESTSCORE), est_score_compare_by_id_asc); nnum = 0; for(i = 0; i < snum; i++){ while(nnum < knum && kscores[nnum].id < scores[i].id){ nnum++; } if(nnum < knum && kscores[nnum].id == scores[i].id) scores[i].score *= kscores[nnum].score / 10000.0; } free(kscores); } /* Get scores correspinding a ranking search with an attribute narrowing index. `db' specifies a database object. `name' specifies the name of an attribute. `nump' specifies the pointer to which the number of elements in the result is assigned. The return value is an array of score structures of corresponding documents. */ static ESTSCORE *est_search_rank(ESTDB *db, const char *name, int top, int *nump){ ESTATTRIDX *attridx; ESTSCORE *scores; const char *kbuf; int snum, ksiz, id; assert(db && name && nump); if(top == 0 || !(attridx = (ESTATTRIDX *)cbmapget(db->aidxs, name, -1, NULL)) || (attridx->type != ESTIDXATTRSTR && attridx->type != ESTIDXATTRNUM)){ *nump = 0; return cbmalloc(1); } snum = abs(top); if(snum > db->dnum) snum = db->dnum; CB_MALLOC(scores, snum * sizeof(ESTSCORE) + 1); snum = 0; if(top > 0){ vlcurfirst(attridx->db); while(snum < top && (kbuf = vlcurkeycache(attridx->db, &ksiz)) != NULL){ if(ksiz < sizeof(int)){ vlcurnext(attridx->db); continue; } memcpy(&id, kbuf + ksiz - sizeof(int), sizeof(int)); if(id < 1){ vlcurnext(attridx->db); continue; } scores[snum].id = id; scores[snum].score = 0; scores[snum].value = NULL; snum++; vlcurnext(attridx->db); } } else { top *= -1; vlcurlast(attridx->db); while(snum < top && (kbuf = vlcurkeycache(attridx->db, &ksiz)) != NULL){ if(ksiz < sizeof(int)){ vlcurprev(attridx->db); continue; } memcpy(&id, kbuf + ksiz - sizeof(int), sizeof(int)); if(id < 1){ vlcurprev(attridx->db); continue; } scores[snum].id = id; scores[snum].score = 0; scores[snum].value = NULL; snum++; vlcurprev(attridx->db); } } *nump = snum; return scores; } /* Get scores correspinding an attribute expression with an attribute narrowing index. `db' specifies a database object. `expr' specifies an attribute search expression. `nump' specifies the pointer to which the number of elements in the result is assigned. The return value is an array of score structures of corresponding documents or `NULL' if no index is available. */ static ESTSCORE *est_search_aidx_attr(ESTDB *db, const char *expr, int *nump){ ESTATTRIDX *attridx; ESTSCORE *scores; CBDATUM *abuf; CBLIST *tokens; void *regex; const char *cop, *pv, *kbuf, *tbuf; unsigned char *utmp; char *name, *oper, *val, *sval, *wp, numbuf[ESTNUMBUFSIZ]; int i, nsiz, vsiz, ksiz, tsiz, sign, ic, ssiz, esc, jmp, len, *ary, anum; time_t num, lower, upper; assert(db && expr && nump); name = NULL; oper = NULL; val = NULL; nsiz = 0; vsiz = 0; while(*expr > 0 && *expr <= ' '){ expr++; } if((pv = strchr(expr, ' ')) != NULL){ nsiz = pv - expr; name = cbmemdup(expr, nsiz); expr = pv; while(*expr > 0 && *expr <= ' '){ expr++; } if((pv = strchr(expr, ' ')) != NULL){ oper = cbmemdup(expr, pv - expr); expr = pv; while(*expr > 0 && *expr <= ' '){ expr++; } vsiz = strlen(expr); val = cbmemdup(expr, vsiz); } else { oper = cbmemdup(expr, -1); } } else { nsiz = strlen(expr); name = cbmemdup(expr, nsiz); } if(!oper){ oper = cbmemdup("", 0); } if(!val){ vsiz = 0; val = cbmemdup("", 0); } cop = oper; if(*cop == '!'){ sign = FALSE; cop++; } else { sign = TRUE; } if(*cop == 'I' || *cop == 'i'){ ic = !est_check_cjk_only(val); cop++; } else { ic = FALSE; } regex = NULL; if(!cbstricmp(cop, ESTOPSTREQ)){ cop = ESTOPSTREQ; } else if(!cbstricmp(cop, ESTOPSTRNE)){ cop = ESTOPSTRNE; } else if(!cbstricmp(cop, ESTOPSTRINC)){ cop = ESTOPSTRINC; } else if(!cbstricmp(cop, ESTOPSTRBW)){ cop = ESTOPSTRBW; } else if(!cbstricmp(cop, ESTOPSTREW)){ cop = ESTOPSTREW; } else if(!cbstricmp(cop, ESTOPSTRAND)){ cop = ESTOPSTRAND; } else if(!cbstricmp(cop, ESTOPSTROR)){ cop = ESTOPSTROR; } else if(!cbstricmp(cop, ESTOPSTROREQ)){ cop = ESTOPSTROREQ; } else if(!cbstricmp(cop, ESTOPSTRRX)){ cop = ESTOPSTRRX; regex = est_regex_new(val); } else if(!cbstricmp(cop, ESTOPNUMEQ)){ cop = ESTOPNUMEQ; } else if(!cbstricmp(cop, ESTOPNUMNE)){ cop = ESTOPNUMNE; } else if(!cbstricmp(cop, ESTOPNUMGT)){ cop = ESTOPNUMGT; } else if(!cbstricmp(cop, ESTOPNUMGE)){ cop = ESTOPNUMGE; } else if(!cbstricmp(cop, ESTOPNUMLT)){ cop = ESTOPNUMLT; } else if(!cbstricmp(cop, ESTOPNUMLE)){ cop = ESTOPNUMLE; } else if(!cbstricmp(cop, ESTOPNUMBT)){ cop = ESTOPNUMBT; } else { cop = ESTOPSTRINC; val[0] = '\0'; vsiz = 0; } num = cbstrmktime(val); if(!(attridx = (ESTATTRIDX *)cbmapget(db->aidxs, name, nsiz, NULL)) || (attridx->type != ESTIDXATTRSTR && attridx->type != ESTIDXATTRNUM) || (attridx->type == ESTIDXATTRNUM && cop != ESTOPNUMEQ && cop != ESTOPNUMNE && cop != ESTOPNUMGT && cop != ESTOPNUMGE && cop != ESTOPNUMLT && cop != ESTOPNUMLE && cop != ESTOPNUMBT)){ if(regex) est_regex_delete(regex); free(val); free(oper); free(name); return NULL; } CB_DATUMOPEN(abuf); if(!sign || ic){ if(ic){ utmp = (unsigned char *)est_uconv_in(val, vsiz, &tsiz); est_normalize_text(utmp, tsiz, &tsiz); est_canonicalize_text(utmp, tsiz, FALSE); sval = (char *)est_uconv_out((char *)utmp, tsiz, &ssiz); free(utmp); } else { sval = NULL; ssiz = 0; } esc = INT_MAX; jmp = INT_MAX; if(sign && (cop == ESTOPSTREQ || cop == ESTOPSTRBW) && vsiz > 0){ if(*sval > 0x0 && *sval < 0x7f){ numbuf[0] = *sval; numbuf[1] = '\0'; esc = *(unsigned char *)sval; if(*sval >= 'a' && *sval <= 'z'){ numbuf[0] -= 'a' - 'A'; jmp = *sval - 'a' + 'A'; } vlcurjump(attridx->db, numbuf, 1, VL_JFORWARD); } else if(*(unsigned char *)sval >= 0xc0){ numbuf[0] = *sval; numbuf[1] = '\0'; esc = *(unsigned char *)sval; vlcurjump(attridx->db, numbuf, 1, VL_JFORWARD); } else { vlcurfirst(attridx->db); } } else { vlcurfirst(attridx->db); } while((kbuf = vlcurkeycache(attridx->db, &ksiz)) != NULL){ if(est_match_attr(kbuf, ksiz - sizeof(int) - 1, cop, sign, val, vsiz, sval, ssiz, regex, num)) CB_DATUMCAT(abuf, kbuf + ksiz - sizeof(int), sizeof(int)); if(*(unsigned char *)kbuf > jmp && *(unsigned char *)kbuf < *(unsigned char *)sval){ numbuf[0] = *sval; numbuf[1] = '\0'; vlcurjump(attridx->db, numbuf, 1, VL_JFORWARD); jmp = INT_MAX; } else if(*(unsigned char *)kbuf > esc){ break; } else { vlcurnext(attridx->db); } } if(sval) free(sval); } else if(cop == ESTOPSTROREQ){ tokens = cbsplit(val, vsiz, " ,"); cblistsort(tokens); for(i = 0; i < CB_LISTNUM(tokens); i++){ tbuf = CB_LISTVAL2(tokens, i, tsiz); vlcurjump(attridx->db, tbuf, tsiz, VL_JFORWARD); while((kbuf = vlcurkeycache(attridx->db, &ksiz)) != NULL && !strcmp(kbuf, tbuf)){ CB_DATUMCAT(abuf, kbuf + ksiz - sizeof(int), sizeof(int)); vlcurnext(attridx->db); } } CB_LISTCLOSE(tokens); } else if(cop == ESTOPNUMBT){ if((wp = strchr(val, ' ')) != NULL || (wp = strchr(val, '\t')) != NULL){ *(wp++) = '\0'; while(*wp == ' ' || *wp == '\t'){ wp++; } lower = cbstrmktime(val); upper = cbstrmktime(wp); } else { lower = cbstrmktime(val); upper = INT_MAX; } len = sprintf(numbuf, "%.0f", (double)lower); vlcurjump(attridx->db, numbuf, len, VL_JFORWARD); while((kbuf = vlcurkeycache(attridx->db, &ksiz)) != NULL && cbstrmktime(kbuf) <= upper){ CB_DATUMCAT(abuf, kbuf + ksiz - sizeof(int), sizeof(int)); vlcurnext(attridx->db); } } else { if(cop == ESTOPSTREQ || cop == ESTOPSTRBW || cop == ESTOPNUMEQ || cop == ESTOPNUMGT || cop == ESTOPNUMGE){ vlcurjump(attridx->db, val, vsiz, VL_JFORWARD); if(cop == ESTOPNUMGT){ while((kbuf = vlcurkeycache(attridx->db, NULL)) != NULL && cbstrmktime(kbuf) <= num){ vlcurnext(attridx->db); } } } else if(cop == ESTOPNUMLT || cop == ESTOPNUMLE){ len = sprintf(numbuf, "%.0f", (double)cbstrmktime(val) + 1); vlcurjump(attridx->db, numbuf, len, VL_JBACKWARD); if(cop == ESTOPNUMLT){ while((kbuf = vlcurkeycache(attridx->db, NULL)) != NULL && cbstrmktime(kbuf) >= num){ vlcurprev(attridx->db); } } } else { vlcurfirst(attridx->db); } while((kbuf = vlcurkeycache(attridx->db, &ksiz)) != NULL){ if(est_match_attr(kbuf, ksiz - sizeof(int) - 1, cop, TRUE, val, vsiz, NULL, 0, regex, num)){ CB_DATUMCAT(abuf, kbuf + ksiz - sizeof(int), sizeof(int)); } else if(cop == ESTOPSTREQ || cop == ESTOPSTRBW || cop == ESTOPNUMEQ){ break; } if(cop == ESTOPNUMLT || cop == ESTOPNUMLE){ vlcurprev(attridx->db); } else { vlcurnext(attridx->db); } } } ary = (int *)CB_DATUMPTR(abuf); anum = CB_DATUMSIZE(abuf) / sizeof(int); CB_MALLOC(scores, anum * sizeof(ESTSCORE) + 1); for(i = 0; i < anum; i++){ scores[i].id = ary[i]; scores[i].score = 0; scores[i].value = NULL; } *nump = anum; CB_DATUMCLOSE(abuf); if(regex) est_regex_delete(regex); free(val); free(oper); free(name); return scores; } /* Get a correspinding set of documents in pseudo indexes. `db' specifies a database object. `cond' specifies a search condition object. `scores' specifies an array of scores of search candidates. `nump' specifies the pointer to which the number of elements in the parameter and result is assigned. `ordattrs' specifies a map object into which ordering attributes are stored. The return value is an array of re-allocated score structures. */ static ESTSCORE *est_search_pidxs(ESTDB *db, ESTCOND *cond, ESTSCORE *scores, int *nump, CBMAP *ordattrs){ ESTCATTR *list; ESTDOC *doc; const char *otype, *lbuf, *vbuf; char *oname, *wp; int i, j, k, snum, anum, id, hit, sc, miss, lsiz, vsiz; double avg, sd, dif, tune; assert(db && cond && scores && nump && ordattrs); snum = *nump; CB_REALLOC(scores, (snum + CB_LISTNUM(db->pdocs)) * sizeof(ESTSCORE) + 1); if(cond->phrase){ if(cbstrfwmatch(cond->phrase, ESTOPID)){ return scores; } else if(cbstrfwmatch(cond->phrase, ESTOPURI)){ return scores; } else if(cbstrfwmatch(cond->phrase, ESTOPSIMILAR)){ return scores; } } oname = NULL; otype = NULL; if(cond->order){ oname = cbmemdup(cond->order, -1); cbstrtrim(oname); otype = ESTORDSTRA; if((wp = strchr(oname, ' ')) != NULL){ *(wp++) = '\0'; while(*wp == ' '){ wp++; } otype = wp; } } list = NULL; anum = -1; if(cond->attrs) list = est_make_cattr_list(cond->attrs, &anum); for(i = 0; i < CB_LISTNUM(db->pdocs); i++){ id = ESTPDOCIDMIN + i; hit = FALSE; sc = 0; doc = NULL; if(!cond->phrase || cond->phrase[0] == '\0'){ hit = cond->attrs ? TRUE : FALSE; } else if(cbstrfwmatch(cond->phrase, ESTOPUVSET)){ hit = TRUE; } else { if((doc = est_db_get_doc(db, id, 0)) != NULL){ hit = est_db_score_doc(db, doc, cond, &sc); } else { hit = FALSE; } } if(hit && list){ if(!doc && !(doc = est_db_get_doc(db, id, 0))){ hit = FALSE; } else { miss = FALSE; for(j = 0; !miss && j < anum; j++){ if(list[j].nsiz < 1) continue; if(list[j].nlist){ hit = FALSE; for(k = 0; k < CB_LISTNUM(list[j].nlist); k++){ lbuf = CB_LISTVAL2(list[j].nlist, k, lsiz); if(lsiz < 1) continue; if(!(vbuf = cbmapget(doc->attrs, lbuf, lsiz, &vsiz))) continue; if(est_match_attr(vbuf, vsiz, list[j].cop, list[j].sign, list[j].val, list[j].vsiz, list[j].sval, list[j].ssiz, list[j].regex, list[j].num)){ hit = TRUE; break; } } if(!hit) miss = TRUE; } else if(!(vbuf = cbmapget(doc->attrs, list[j].name, list[j].nsiz, &vsiz))){ miss = TRUE; } else if(!est_match_attr(vbuf, vsiz, list[j].cop, list[j].sign, list[j].val, list[j].vsiz, list[j].sval, list[j].ssiz, list[j].regex, list[j].num)){ miss = TRUE; } } hit = !miss; } } if(hit){ scores[snum].id = id; scores[snum].score = sc; scores[snum].value = NULL; snum++; if(oname && (doc || (doc = est_db_get_doc(db, id, 0)) != NULL)){ if(!(vbuf = cbmapget(doc->attrs, oname, -1, &vsiz))){ vbuf = ""; vsiz = 0; } cbmapput(ordattrs, (char *)&id, sizeof(int), vbuf, vsiz, FALSE); } } if(doc) est_doc_delete(doc); } if(list) est_free_cattr_list(list, anum); if(oname) free(oname); if(db->smode != ESTDFSCASIS && snum > *nump){ avg = 0.0; for(i = *nump; i < snum; i++){ avg += scores[i].score; } avg /= snum - *nump; sd = 0.0; for(i = *nump; i < snum; i++){ dif = avg - scores[i].score; sd += dif * dif; } sd /= snum - *nump; sd = sqrt(sd); if(sd < 0.1){ for(i = *nump; i < snum; i++){ scores[i].score = ESTSCOREUNIT / 2; } } else { for(i = *nump; i < snum; i++){ scores[i].score = (int)(((scores[i].score - avg) * (ESTSCOREUNIT / 10.0) / sd) + ESTSCOREUNIT / 2.0); } } if(cond->tfidf){ tune = pow(snum - *nump + 64, 0.4); for(i = *nump; i < snum; i++){ scores[i].score *= 100.0 / tune; } } else { for(i = *nump; i < snum; i++){ scores[i].score *= 10; } } } *nump = snum; return scores; } /* Narrow and sort scores of search candidates. `db' specifies a database object. `attrs' specifies a list object of narrowing attributes. `ign' specifies the offset of an attribute to be ignored. `order' specifies an expression for sorting. `distinct' specifies the name of the distinct attribute. `scores' specifies an array of scores of search candidates. `snum' specifies the number of the array. `limit' specifies the limit number to check. `restp' specifies the pointer to a variable to which rest number to be checked is assigned. `ordattrs' specifies a map object of cached ordering attributes. The return value is the new number of the array. */ static int est_narrow_scores(ESTDB *db, const CBLIST *attrs, int ign, const char *order, const char *distinct, ESTSCORE *scores, int snum, int limit, int *restp, CBMAP *ordattrs){ ESTCATTR *list; ESTATTRIDX *attridx; CBMAP *umap; const char *otype, *cbuf, *ibuf, *lbuf; char *oname, *wp, *mbuf, *vbuf; int i, j, k, ci, oi, anum, done, mixed, nnum, csiz, msiz; int miss, vsiz, num, isiz, lsiz, hit, onlen, dnlen; time_t tval; assert(db && scores && snum >= 0 && limit >= 0 && restp && ordattrs); *restp = 0; ci = -1; oi = -1; oname = NULL; otype = NULL; if(order){ oname = cbmemdup(order, -1); cbstrtrim(oname); otype = ESTORDSTRA; if((wp = strchr(oname, ' ')) != NULL){ *(wp++) = '\0'; while(*wp == ' '){ wp++; } otype = wp; } } if(attrs){ list = est_make_cattr_list(attrs, &anum); if(cbmaprnum(db->aidxs) > 0){ done = TRUE; mixed = FALSE; for(i = 0; i < anum; i++){ if(i == ign) continue; if(!(attridx = (ESTATTRIDX *)cbmapget(db->aidxs, list[i].name, list[i].nsiz, NULL)) || (attridx->type == ESTIDXATTRNUM && list[i].cop != ESTOPNUMEQ && list[i].cop != ESTOPNUMNE && list[i].cop != ESTOPNUMGT && list[i].cop != ESTOPNUMGE && list[i].cop != ESTOPNUMLT && list[i].cop != ESTOPNUMLE && list[i].cop != ESTOPNUMBT) || (attridx->type != ESTIDXATTRSEQ && snum < ESTAISNUMMIN)){ done = FALSE; continue; } switch(attridx->type){ case ESTIDXATTRSTR: case ESTIDXATTRNUM: snum = est_aidx_attr_narrow(attridx->db, db->pdocs, list[i].cop, list[i].sign, list[i].val, list[i].vsiz, list[i].sval, list[i].ssiz, list[i].regex, list[i].num, scores, snum); mixed = TRUE; break; default: if(done && i == anum - 1 && !order && mixed){ qsort(scores, snum, sizeof(ESTSCORE), est_score_compare_by_score_desc); mixed = FALSE; } snum = est_aidx_seq_narrow(attridx->db, db->pdocs, list[i].cop, list[i].sign, list[i].val, list[i].vsiz, list[i].sval, list[i].ssiz, list[i].regex, list[i].num, scores, snum, done && i == anum - 1 ? limit : INT_MAX, restp); break; } list[i].cop = ESTOPDUMMY; } if(mixed && !order) qsort(scores, snum, sizeof(ESTSCORE), est_score_compare_by_score_desc); } else { done = FALSE; } if(db->spacc){ for(i = 0; i < anum; i++){ if(!strcmp(list[i].name, db->scname)){ ci = i; break; } } } if(oname){ for(i = 0; i < anum; i++){ if(!strcmp(list[i].name, oname)){ oi = i; break; } } } if(!done){ nnum = 0; for(i = 0; i < snum; i++){ if(nnum >= limit){ *restp = snum - i; break; } scores[i].value = NULL; if(ci >= 0){ if((cbuf = cbmapget(db->spacc, (char *)&(scores[i].id), sizeof(int), &csiz)) != NULL) cbmapmove(db->spacc, (char *)&(scores[i].id), sizeof(int), FALSE); } else { cbuf = NULL; csiz = 0; } mbuf = NULL; if(scores[i].id >= ESTPDOCIDMIN){ scores[nnum++] = scores[i]; } else if((cbuf && anum == 1) || (mbuf = est_crget(db->attrdb, db->zmode, scores[i].id, &msiz)) != NULL){ miss = FALSE; for(j = 0; !miss && j < anum; j++){ if(list[j].nsiz < 1) continue; if(list[j].nlist){ hit = FALSE; for(k = 0; k < CB_LISTNUM(list[j].nlist); k++){ lbuf = CB_LISTVAL2(list[j].nlist, k, lsiz); if(lsiz < 1) continue; if(!(vbuf = cbmaploadone(mbuf, msiz, lbuf, lsiz, &vsiz))) continue; if(est_match_attr(vbuf, vsiz, list[j].cop, list[j].sign, list[j].val, list[j].vsiz, list[j].sval, list[j].ssiz, list[j].regex, list[j].num)){ hit = TRUE; free(vbuf); break; } free(vbuf); } if(!hit) miss = TRUE; vbuf = NULL; } else { if(mbuf){ vbuf = cbmaploadone(mbuf, msiz, list[j].name, list[j].nsiz, &vsiz); } else if(csiz != 1 || cbuf[0] != '\0'){ vbuf = cbmemdup(cbuf, csiz); vsiz = csiz; } else { vbuf = NULL; } if(list[j].oper[0] == '\0'){ if(!vbuf) miss = TRUE; } else { if(!vbuf){ vbuf = cbmemdup("", 0); vsiz = 0; } if(!est_match_attr(vbuf, vsiz, list[j].cop, list[j].sign, list[j].val, list[j].vsiz, list[j].sval, list[j].ssiz, list[j].regex, list[j].num)) miss = TRUE; } } if(j == ci && !cbuf){ if(vbuf){ cbmapput(db->spacc, (char *)&(scores[i].id), sizeof(int), vbuf, vsiz, FALSE); } else { cbmapput(db->spacc, (char *)&(scores[i].id), sizeof(int), "", 1, FALSE); } if(cbmaprnum(db->spacc) > db->scmnum){ num = db->scmnum * 0.1 + 1; cbmapiterinit(db->spacc); for(k = 0; k < num && (ibuf = cbmapiternext(db->spacc, &isiz)) != NULL; k++){ cbmapout(db->spacc, ibuf, isiz); } } } if(j == oi){ scores[i].value = vbuf; } else { free(vbuf); } } if(miss){ free(scores[i].value); } else { scores[nnum++] = scores[i]; } } free(mbuf); } snum = nnum; } else { for(i = 0; i < snum; i++){ scores[i].value = NULL; } } est_free_cattr_list(list, anum); } else { for(i = 0; i < snum; i++){ scores[i].value = NULL; } } if(oname){ if(!cbstricmp(oname, ESTORDIDA)){ qsort(scores, snum, sizeof(ESTSCORE), est_score_compare_by_id_asc); } else if(!cbstricmp(oname, ESTORDIDD)){ qsort(scores, snum, sizeof(ESTSCORE), est_score_compare_by_id_desc); } else if(!cbstricmp(oname, ESTORDSCA)){ qsort(scores, snum, sizeof(ESTSCORE), est_score_compare_by_score_asc); } else if(!cbstricmp(oname, ESTORDSCD)){ qsort(scores, snum, sizeof(ESTSCORE), est_score_compare_by_score_desc); } else { ci = db->spacc && !strcmp(oname, db->scname); onlen = strlen(oname); attridx = (ESTATTRIDX *)cbmapget(db->aidxs, oname, onlen, NULL); if(attridx && attridx->type != ESTIDXATTRSEQ) attridx = NULL; for(i = 0; i < snum; i++){ if(scores[i].value) continue; if(ci && (cbuf = cbmapget(db->spacc, (char *)&(scores[i].id), sizeof(int), &csiz)) != NULL){ cbmapmove(db->spacc, (char *)&(scores[i].id), sizeof(int), FALSE); if(csiz == 1 && cbuf[0] == '\0'){ scores[i].value = cbmemdup("", 0); } else { scores[i].value = cbmemdup(cbuf, csiz); } continue; } if((cbuf = cbmapget(ordattrs, (char *)&(scores[i].id), sizeof(int), &csiz)) != NULL){ scores[i].value = cbmemdup(cbuf, csiz); continue; } if(attridx){ if(!(vbuf = est_aidx_seq_get(attridx->db, scores[i].id, &vsiz))) vbuf = cbmemdup("", 0); scores[i].value = vbuf; continue; } if((mbuf = est_crget(db->attrdb, db->zmode, scores[i].id, &msiz)) != NULL){ if((vbuf = cbmaploadone(mbuf, msiz, oname, onlen, &vsiz)) != NULL){ if(ci) cbmapput(db->spacc, (char *)&(scores[i].id), sizeof(int), vbuf, vsiz, FALSE); scores[i].value = vbuf; } else { if(ci) cbmapput(db->spacc, (char *)&(scores[i].id), sizeof(int), "", 1, FALSE); scores[i].value = cbmemdup("", 0); } if(ci && cbmaprnum(db->spacc) > db->scmnum){ num = db->scmnum * 0.1 + 1; cbmapiterinit(db->spacc); for(j = 0; j < num && (ibuf = cbmapiternext(db->spacc, &isiz)) != NULL; j++){ cbmapout(db->spacc, ibuf, isiz); } } free(mbuf); } else { scores[i].value = cbmemdup("", 0); } } if(!cbstricmp(otype, ESTORDSTRA)){ qsort(scores, snum, sizeof(ESTSCORE), est_score_compare_by_str_asc); } else if(!cbstricmp(otype, ESTORDSTRD)){ qsort(scores, snum, sizeof(ESTSCORE), est_score_compare_by_str_desc); } else if(!cbstricmp(otype, ESTORDNUMA)){ for(i = 0; i < snum; i++){ tval = cbstrmktime(scores[i].value); free(scores[i].value); scores[i].value = (void *)tval; } qsort(scores, snum, sizeof(ESTSCORE), est_score_compare_by_num_asc); for(i = 0; i < snum; i++){ scores[i].value = NULL; } } else if(!cbstricmp(otype, ESTORDNUMD)){ for(i = 0; i < snum; i++){ tval = cbstrmktime(scores[i].value); free(scores[i].value); scores[i].value = (void *)tval; } qsort(scores, snum, sizeof(ESTSCORE), est_score_compare_by_num_desc); for(i = 0; i < snum; i++){ scores[i].value = NULL; } } for(i = 0; i < snum; i++){ free(scores[i].value); } } free(oname); } if(distinct){ if(!order && *distinct != '~') qsort(scores, snum, sizeof(ESTSCORE), est_score_compare_by_score_desc); if(*distinct == '~') distinct++; dnlen = strlen(distinct); umap = cbmapopenex(snum + 1); attridx = (ESTATTRIDX *)cbmapget(db->aidxs, distinct, dnlen, NULL); if(attridx && attridx->type != ESTIDXATTRSEQ) attridx = NULL; nnum = 0; for(i = 0; i < snum; i++){ if(scores[i].id >= ESTPDOCIDMIN){ if(!(vbuf = est_db_get_doc_attr(db, scores[i].id, distinct))) vbuf = cbmemdup("", 0); vsiz = strlen(vbuf); } else if(attridx){ if(!(vbuf = est_aidx_seq_get(attridx->db, scores[i].id, &vsiz))){ vbuf = cbmemdup("", 0); vsiz = 0; } } else { if((mbuf = est_crget(db->attrdb, db->zmode, scores[i].id, &msiz)) != NULL){ if(!(vbuf = cbmaploadone(mbuf, msiz, distinct, dnlen, &vsiz))){ vbuf = cbmemdup("", 0); vsiz = 0; } free(mbuf); } else { vbuf = cbmemdup("", 0); vsiz = 0; } } if(cbmapput(umap, vbuf, vsiz, "", 0, FALSE)) scores[nnum++] = scores[i]; free(vbuf); } snum = nnum; cbmapclose(umap); } return snum; } /* Make a list of condition attributes. `attrs' specifies a list object of attribute expressions. `nump' specifies the pointer to which the number of elements in the result is assigned. The return value is a list of condition attributes. */ static ESTCATTR *est_make_cattr_list(const CBLIST *attrs, int *nump){ ESTCATTR *list; const char *rp, *pv; unsigned char *utmp; int i, anum, tsiz; assert(attrs && nump); anum = CB_LISTNUM(attrs); CB_MALLOC(list, sizeof(ESTCATTR) * anum + 1); for(i = 0; i < anum; i++){ list[i].name = NULL; list[i].oper = NULL; list[i].val = NULL; rp = CB_LISTVAL(attrs, i); while(*rp > 0 && *rp <= ' '){ rp++; } if((pv = strchr(rp, ' ')) != NULL){ list[i].nsiz = pv - rp; list[i].name = cbmemdup(rp, list[i].nsiz); rp = pv; while(*rp > 0 && *rp <= ' '){ rp++; } if((pv = strchr(rp, ' ')) != NULL){ list[i].oper = cbmemdup(rp, pv - rp); rp = pv; while(*rp > 0 && *rp <= ' '){ rp++; } list[i].vsiz = strlen(rp); list[i].val = cbmemdup(rp, list[i].vsiz); } else { list[i].oper = cbmemdup(rp, -1); } } else { list[i].nsiz = strlen(rp); list[i].name = cbmemdup(rp, list[i].nsiz); } if(strchr(list[i].name, ',')){ list[i].nlist = cbsplit(list[i].name, list[i].nsiz, ","); } else { list[i].nlist = NULL; } if(!list[i].oper){ list[i].oper = cbmemdup("", 0); } if(!list[i].val){ list[i].vsiz = 0; list[i].val = cbmemdup("", 0); } } for(i = 0; i < anum; i++){ rp = list[i].oper; if(*rp == '!'){ list[i].sign = FALSE; rp++; } else { list[i].sign = TRUE; } if(*rp == 'I' || *rp == 'i'){ if(est_check_cjk_only(list[i].val)){ list[i].sval = NULL; list[i].ssiz = 0; } else { utmp = (unsigned char *)est_uconv_in(list[i].val, list[i].vsiz, &tsiz); est_normalize_text(utmp, tsiz, &tsiz); est_canonicalize_text(utmp, tsiz, FALSE); list[i].sval = (char *)est_uconv_out((char *)utmp, tsiz, &(list[i].ssiz)); free(utmp); } rp++; } else { list[i].sval = NULL; list[i].ssiz = 0; } list[i].regex = NULL; list[i].num = cbstrmktime(list[i].val); if(!cbstricmp(rp, ESTOPSTREQ)){ list[i].cop = ESTOPSTREQ; } else if(!cbstricmp(rp, ESTOPSTRNE)){ list[i].cop = ESTOPSTRNE; } else if(!cbstricmp(rp, ESTOPSTRINC)){ list[i].cop = ESTOPSTRINC; } else if(!cbstricmp(rp, ESTOPSTRBW)){ list[i].cop = ESTOPSTRBW; } else if(!cbstricmp(rp, ESTOPSTREW)){ list[i].cop = ESTOPSTREW; } else if(!cbstricmp(rp, ESTOPSTRAND)){ list[i].cop = ESTOPSTRAND; } else if(!cbstricmp(rp, ESTOPSTROR)){ list[i].cop = ESTOPSTROR; } else if(!cbstricmp(rp, ESTOPSTROREQ)){ list[i].cop = ESTOPSTROREQ; } else if(!cbstricmp(rp, ESTOPSTRRX)){ list[i].cop = ESTOPSTRRX; list[i].regex = list[i].sval ? est_regex_new(list[i].sval) : est_regex_new(list[i].val); } else if(!cbstricmp(rp, ESTOPNUMEQ)){ list[i].cop = ESTOPNUMEQ; } else if(!cbstricmp(rp, ESTOPNUMNE)){ list[i].cop = ESTOPNUMNE; } else if(!cbstricmp(rp, ESTOPNUMGT)){ list[i].cop = ESTOPNUMGT; } else if(!cbstricmp(rp, ESTOPNUMGE)){ list[i].cop = ESTOPNUMGE; } else if(!cbstricmp(rp, ESTOPNUMLT)){ list[i].cop = ESTOPNUMLT; } else if(!cbstricmp(rp, ESTOPNUMLE)){ list[i].cop = ESTOPNUMLE; } else if(!cbstricmp(rp, ESTOPNUMBT)){ list[i].cop = ESTOPNUMBT; } else { list[i].cop = ESTOPSTRINC; list[i].val[0] = '\0'; list[i].vsiz = 0; if(list[i].sval){ list[i].sval[0] = '\0'; list[i].ssiz = 0; } } } *nump = anum; return list; } /* Release resources of a list of condition attributes. `list' specifies a list of condition attributes. `anum' specifies the number of elements of the list. */ static void est_free_cattr_list(ESTCATTR *list, int anum){ int i; assert(list && anum >= 0); for(i = 0; i < anum; i++){ if(list[i].regex) est_regex_delete(list[i].regex); free(list[i].sval); free(list[i].val); free(list[i].oper); if(list[i].nlist) CB_LISTCLOSE(list[i].nlist); free(list[i].name); } free(list); } /* Narrow and sort scores of search candidates. `db' specifies a database object. `scores' specifies an array of scores of search candidates. `snum' specifies the number of the array. `num' specifies the number of documents to be shown. `max' specifies the maximum number of shown documents. `vnum' specifies the number of dimensions of the vector. `tfidf' specifies whether to perform TF-IDF tuning. `limit' specifies the upper limit of similarity for documents to survive. `opts' specifies optoins for eclipse. `shadows' specifies a map object to store shadow document information. The return value is the new number of the array. */ static int est_eclipse_scores(ESTDB *db, ESTSCORE *scores, int snum, int num, int vnum, int tfidf, double limit, CBMAP *shadows){ CBMAP *svmap, *tvmap; const char *suri, *turi; char *tmp; int i, j, ubase, simurl, max, *svec, *tvec, pair[2], nnum; double dval; assert(db && scores && snum >= 0 && num >= 0 && vnum > 0 && limit > 0.0 && shadows); ubase = FALSE; simurl = FALSE; if(limit == ESTECLSERV || limit == ESTECLDIR || limit == ESTECLFILE){ ubase = TRUE; } else if(limit >= ESTECLSIMURL){ simurl = TRUE; limit -= ESTECLSIMURL; if(limit < 0.01) limit = 0.01; if(limit > 1.0) limit = 1.0; } nnum = 0; if(ubase){ if(limit == ESTECLSERV){ max = num * 14.8 + 8; } else if(limit == ESTECLDIR){ max = num * 6.8 + 8; } else { max = num * 4.8 + 8; } if(max > snum) max = snum; for(i = 0; i < max; i++){ scores[i].value = est_db_get_doc_attr(db, scores[i].id, ESTDATTRURI); } for(i = 0; i < max; i++){ if(!scores[i].value) continue; for(j = i + 1; j < max; j++){ dval = 0.0; if(scores[j].value){ switch(est_url_sameness(scores[i].value, scores[j].value)){ case 1: dval = ESTECLSERV; break; case 2: dval = ESTECLDIR; break; case 3: dval = ESTECLFILE; break; } } if(dval >= limit){ free(scores[j].value); scores[j].value = NULL; pair[0] = scores[j].id; pair[1] = 0; cbmapputcat(shadows, (char *)&(scores[i].id), sizeof(int), (char *)pair, sizeof(int) * 2); } } } for(i = 0; i < max; i++){ if(scores[i].value){ free(scores[i].value); scores[nnum++] = scores[i]; } } for(i = max; i < snum; i++){ scores[nnum++] = scores[i]; } } else { max = limit < 0.1 ? snum : num * ((2.4 / (limit - 0.05)) + 0.8) + 8; if(simurl) max *= 1.4; if(max > snum) max = snum; CB_MALLOC(svec, vnum * sizeof(int)); CB_MALLOC(tvec, vnum * sizeof(int)); for(i = 0; i < max; i++){ if((svmap = est_get_tvmap(db, scores[i].id, vnum, tfidf)) != NULL){ scores[i].value = (char *)svmap; if(simurl && (tmp = est_db_get_doc_attr(db, scores[i].id, ESTDATTRURI)) != NULL){ cbmapput(svmap, "", 0, tmp, -1, TRUE); free(tmp); } } else { scores[i].value = NULL; } } for(i = 0; i < max; i++){ svmap = (CBMAP *)(scores[i].value); if(!svmap || cbmaprnum(svmap) < 1) continue; suri = cbmapget((CBMAP *)scores[i].value, "", -1, NULL); if(num-- < 1) continue; est_vector_set_seed(svmap, svec, vnum); for(j = i + 1; j < max; j++){ tvmap = (CBMAP *)(scores[j].value); if(!tvmap || cbmaprnum(tvmap) < 1) continue; est_vector_set_target(svmap, tvmap, tvec, vnum); dval = est_vector_cosine(svec, tvec, vnum); if(dval > 0.01 && suri && (turi = cbmapget((CBMAP *)scores[j].value, "", -1, NULL)) != NULL){ switch(est_url_sameness(suri, turi)){ default: dval = pow(cos(acos(dval) * (1.0 - pow(dval, 9.9))), 1.07); break; case 1: dval = pow(cos(acos(dval) * (1.0 - pow(dval, 4.1))), 1.05); break; case 2: dval = pow(cos(acos(dval) * (1.0 - pow(dval, 2.9))), 1.03); break; case 3: dval = pow(cos(acos(dval) * (1.0 - pow(dval, 2.1))), 1.01); break; } } if(dval > limit){ cbmapclose(tvmap); scores[j].value = NULL; pair[0] = scores[j].id; pair[1] = (int)(dval * 10000.0); cbmapputcat(shadows, (char *)&(scores[i].id), sizeof(int), (char *)pair, sizeof(int) * 2); } } } for(i = 0; i < max; i++){ if(scores[i].value){ cbmapclose((CBMAP *)(scores[i].value)); scores[nnum++] = scores[i]; } } for(i = max; i < snum; i++){ scores[nnum++] = scores[i]; } free(tvec); free(svec); } return nnum; } /* Check whether a score matches an attribute condition. `tval' specifies the target value; `tsiz' specifies the size of the target value `cop' specifies the pointer to the operator. `sign' specifies the sign of operation. `oval' specifies the operation value. `osiz' specifies the size of the operation value `sval' specifies the operation value of small cases. `ssiz' specifies the size of the operation value of small cases. `regex' specifies the regular expressions. `onum' specifies the numeric value. The return value is true if it does match, else it is false. */ static int est_match_attr(const char *tval, int tsiz, const char *cop, int sign, const char *oval, int osiz, const char *sval, int ssiz, const void *regex, int onum){ unsigned char *eval; char *cval; int csiz, esiz, hit; assert(tval && tsiz >= 0 && oval && osiz >= 0); cval = NULL; if(sval){ eval = (unsigned char *)est_uconv_in(tval, tsiz, &esiz); est_normalize_text(eval, esiz, &esiz); est_canonicalize_text(eval, esiz, FALSE); cval = (char *)est_uconv_out((char *)eval, esiz, &csiz); free(eval); tval = cval; tsiz = csiz; oval = sval; osiz = ssiz; } if(cop == ESTOPSTREQ){ hit = !strcmp(tval, oval); } else if(cop == ESTOPSTRNE){ hit = strcmp(tval, oval) != 0; } else if(cop == ESTOPSTRINC){ hit = strstr(tval, oval) != NULL; } else if(cop == ESTOPSTRBW){ hit = cbstrfwmatch(tval, oval); } else if(cop == ESTOPSTREW){ hit = cbstrbwmatch(tval, oval); } else if(cop == ESTOPSTRAND){ hit = est_check_strand(tval, oval); } else if(cop == ESTOPSTROR){ hit = est_check_stror(tval, oval); } else if(cop == ESTOPSTROREQ){ hit = est_check_stroreq(tval, oval); } else if(cop == ESTOPSTRRX){ hit = regex ? est_regex_match(regex, tval) : FALSE; } else if(cop == ESTOPNUMEQ){ hit = cbstrmktime(tval) == onum; } else if(cop == ESTOPNUMNE){ hit = cbstrmktime(tval) != onum; } else if(cop == ESTOPNUMGT){ hit = cbstrmktime(tval) > onum; } else if(cop == ESTOPNUMGE){ hit = cbstrmktime(tval) >= onum; } else if(cop == ESTOPNUMLT){ hit = cbstrmktime(tval) < onum; } else if(cop == ESTOPNUMLE){ hit = cbstrmktime(tval) <= onum; } else if(cop == ESTOPNUMBT){ hit = est_check_numbt(tval, oval); } else if(cop == ESTOPDUMMY){ hit = TRUE; } else { hit = FALSE; } free(cval); return sign ? hit : !hit; } /* Check whether a string includes all tokens in another string. `tval' specifies the target value; `oval' specifies the operation value; The return value is the result of the check. */ static int est_check_strand(const char *tval, const char *oval){ const char *sp, *ep, *rp, *pp, *qp; int hit; assert(tval && oval); sp = oval; while(*sp != '\0'){ while(*sp == ' ' || *sp == ','){ sp++; } ep = sp; while(*ep != '\0' && *ep != ' ' && *ep != ','){ ep++; } if(ep > sp){ hit = FALSE; for(rp = tval; *rp != '\0'; rp++){ for(pp = sp, qp = rp; pp < ep; pp++, qp++){ if(*pp != *qp) break; } if(pp == ep && (*qp == '\0' || *qp == ' ' || *qp == ',')){ hit = TRUE; break; } } if(!hit) return FALSE; } sp = ep; } return TRUE; } /* Check whether a string includes at least one token in another string. `tval' specifies the target value; `oval' specifies the operation value; The return value is the result of the check. */ static int est_check_stror(const char *tval, const char *oval){ const char *sp, *ep, *rp, *pp, *qp; int hit; assert(tval && oval); sp = oval; while(*sp != '\0'){ while(*sp == ' ' || *sp == ','){ sp++; } ep = sp; while(*ep != '\0' && *ep != ' ' && *ep != ','){ ep++; } if(ep > sp){ hit = FALSE; for(rp = tval; *rp != '\0'; rp++){ for(pp = sp, qp = rp; pp < ep; pp++, qp++){ if(*pp != *qp) break; } if(pp == ep && (*qp == '\0' || *qp == ' ' || *qp == ',')){ hit = TRUE; break; } } if(hit) return TRUE; } sp = ep; } return FALSE; } /* Check whether a string is equal to at least one token in another string. `tval' specifies the target value; `oval' specifies the operation value; The return value is the result of the check. */ static int est_check_stroreq(const char *tval, const char *oval){ const char *sp, *ep, *rp; assert(tval && oval); sp = oval; while(*sp != '\0'){ while(*sp == ' ' || *sp == ','){ sp++; } ep = sp; while(*ep != '\0' && *ep != ' ' && *ep != ','){ ep++; } if(ep > sp){ for(rp = tval; *rp != '\0'; rp++){ if(*sp != *rp || sp >= ep) break; sp++; } if(*rp == '\0' && sp == ep) return TRUE; } sp = ep; } return FALSE; } /* Check whether a decimal string is between two tokens in another string. `tval' specifies the target value; `oval' specifies the operation value; The return value is the result of the check. */ static int est_check_numbt(const char *tval, const char *oval){ time_t val, lower, upper, swap; char numbuf[ESTNUMBUFSIZ]; int i; for(i = 0; i < ESTNUMBUFSIZ && oval[i] != '\0' && oval[i] != ' ' && oval[i] != '\t'; i++){ numbuf[i] = oval[i]; } numbuf[i] = '\0'; oval += i; while(*oval == ' ' || *oval == '\t'){ oval++; } if(*oval == '\0') return FALSE; val = cbstrmktime(tval); lower = cbstrmktime(numbuf); upper = cbstrmktime(oval); if(lower > upper){ swap = lower; lower = upper; upper = swap; } return val >= lower && val <= upper; } /* Compare two keywords by scores in descending order. `ap' specifies the pointer to one keyword. `bp' specifies the pointer to the other keyword. The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int est_keysc_compare(const void *ap, const void *bp){ assert(ap && bp); return ((ESTKEYSC *)bp)->pt - ((ESTKEYSC *)ap)->pt; } /* Get a similar set of documents in a database. `db' specifies a database object. `svmap' specifies a map object of a seed vector. `nump' specifies the pointer to which the number of elements in the result is assigned. `knum' specifies the number of keywords to get candidates. `unum' specifies the number of adopted documents for a keyword. `tfidf' specifies whether to perform TF-IDF tuning. `nmin' specifies the minimum value for narrowing. `auxmin' specifies the minimum hits to adopt the auxiliary index. If it is not more than 0, the auxiliary index is not used. `auxwords' specifies a map object where keywords used with the auxiliary index are stored. If it is `NULL', it is not used. The return value is an array of score structures of corresponding documents. */ static ESTSCORE *est_search_similar(ESTDB *db, CBMAP *svmap, int *nump, int knum, int unum, int mnum, int tfidf, double nmin, int auxmin, CBMAP *auxwords){ ESTSCORE *scores, *tscores; CBMAP *tvmap; const char *word; int i, j, vnum, snum, tmax, tsnum, nnum, lid, *svec, *tvec; double dval; assert(db && svmap && nump && knum >= 0 && unum >= 0 && nmin >= 0.0); CB_MALLOC(scores, sizeof(ESTSCORE) * (unum * knum + CB_LISTNUM(db->pdocs)) + 1); snum = 0; if((vnum = cbmaprnum(svmap)) < 1) vnum = 1; cbmapiterinit(svmap); tmax = unum; for(i = 0; (i < knum || (i < knum * 2 && snum < unum * 2)) && (word = cbmapiternext(svmap, NULL)) != NULL; i++){ while(*word > '\0' && *word <= ' '){ word++; } tscores = est_search_union(db, word, 1, NULL, &tsnum, NULL, TRUE, auxmin, auxwords); qsort(tscores, tsnum, sizeof(ESTSCORE), est_score_compare_by_score_desc); for(j = 0; j < tmax && j < tsnum; j++){ scores[snum].id = tscores[j].id; scores[snum].score = tscores[j].score * (knum * 2.2 - i); snum++; } free(tscores); tmax -= unum / knum / 1.25; if(tmax < unum / 4) tmax = unum / 4; } for(i = 0; i < CB_LISTNUM(db->pdocs); i++){ scores[snum].id = ESTPDOCIDMIN + i; scores[snum].score = 1; snum++; } qsort(scores, snum, sizeof(ESTSCORE), est_score_compare_by_id_asc); nnum = 0; lid = -1; for(i = 0; i < snum; i++){ if(nnum > 0 && scores[i].id == lid){ scores[nnum-1].score += scores[i].score; continue; } scores[nnum].id = scores[i].id; scores[nnum].score = scores[i].score; nnum++; lid = scores[i].id; } snum = nnum; qsort(scores, snum, sizeof(ESTSCORE), est_score_compare_by_score_desc); nnum = 0; CB_MALLOC(svec, vnum * sizeof(int)); CB_MALLOC(tvec, vnum * sizeof(int)); est_vector_set_seed(svmap, svec, vnum); for(i = 0; i < snum && nnum < mnum; i++){ tvmap = est_get_tvmap(db, scores[i].id, vnum, tfidf); if(tvmap){ est_vector_set_target(svmap, tvmap, tvec, vnum); if((dval = est_vector_cosine(svec, tvec, vnum)) >= nmin){ scores[nnum].id = scores[i].id; scores[nnum].score = (int)(dval * 10000); if(scores[nnum].score == 9999) scores[nnum].score = 10000; scores[nnum].value = NULL; nnum++; } cbmapclose(tvmap); } } free(tvec); free(svec); snum = nnum; *nump = snum; return scores; } /* Create a map object of a vector for similar search from a phrase. `phrase' specifies a search phrase for similar search. The return value is a map object of the seed vector. */ static CBMAP *est_phrase_vector(const char *phrase){ ESTKEYSC *scores; CBMAP *svmap; CBLIST *list; const char *pv, *rp; char *utext, *rtext; int i, num, len, size; svmap = cbmapopenex(ESTMINIBNUM); CB_LISTOPEN(list); while(*phrase != '\0'){ if(*phrase == ESTOPWITH[0] && cbstrfwmatch(phrase, ESTOPWITH)){ phrase += strlen(ESTOPWITH); pv = phrase; while(*phrase != '\0'){ if(*phrase <= ' ' && cbstrfwmatch(phrase + 1, ESTOPWITH)){ phrase++; break; } phrase++; } CB_LISTPUSH(list, pv, phrase - pv); } else { phrase++; } } for(i = 0; i < CB_LISTNUM(list); i++){ pv = CB_LISTVAL(list, i); while(*pv > '\0' && *pv <= ' '){ pv++; } num = strtol(pv, (char **)&rp, 10); if(rp && (len = rp - pv) > 0 && num >= 0){ utext = est_uconv_in(rp, strlen(rp), &size); est_normalize_text((unsigned char *)utext, size, &size); est_canonicalize_text((unsigned char *)utext, size, FALSE); rtext = est_uconv_out(utext, size, NULL); cbstrsqzspc(rtext); if(rtext[0] != '\0') cbmapput(svmap, rtext, -1, pv, len, FALSE); free(rtext); free(utext); } } CB_LISTCLOSE(list); CB_MALLOC(scores, cbmaprnum(svmap) * sizeof(ESTKEYSC) + 1); cbmapiterinit(svmap); for(i = 0; (rp = cbmapiternext(svmap, &len)) != NULL; i++){ scores[i].word = rp; scores[i].wsiz = len; scores[i].pt = atoi(cbmapiterval(rp, NULL)); } qsort(scores, i, sizeof(ESTKEYSC), est_keysc_compare); for(i--; i >= 0; i--){ cbmapmove(svmap, scores[i].word, scores[i].wsiz, TRUE); } free(scores); return svmap; } /* Get the target vector of a document dynamically. `db' specifies a database object. `id' specifies the ID of a document. `vnum' specifies the number of dimensions of the vector. `tfidf' specifies whether to perform TF-IDF tuning. The return value is a map object of the target vector. */ static CBMAP *est_get_tvmap(ESTDB *db, int id, int vnum, int tfidf){ ESTDOC *doc; CBMAP *tvmap; assert(db && id > 0); if((tvmap = est_db_get_keywords(db, id)) != NULL) return tvmap; if(!(doc = est_db_get_doc(db, id, 0))) return NULL; tvmap = est_db_etch_doc(tfidf ? db : NULL, doc, vnum); est_doc_delete(doc); if(dpwritable(db->metadb)) est_db_put_keywords(db, id, tvmap, 1.0); return tvmap; } /* Calculate sameness of two URLs. The return value is 0 if the both have different servers, 1 if the both have the same server, 2 if the both have the same parent directory, 3 if the both have the same file. */ static int est_url_sameness(const char *aurl, const char *burl){ const char *apv, *bpv; int i, alen, blen; assert(aurl && burl); if((apv = strstr(aurl, "://")) != NULL){ aurl = apv + 3; } else { return 0; } if((bpv = strstr(burl, "://")) != NULL){ burl = bpv + 3; } else { return 0; } if(!(apv = strchr(aurl, '/'))) apv = aurl + strlen(aurl); if(!(bpv = strchr(burl, '/'))) bpv = burl + strlen(burl); alen = apv - aurl; blen = bpv - burl; if(alen != blen || memcmp(aurl, burl, alen)) return 0; aurl = *apv == '\0' ? "/" : apv; burl = *bpv == '\0' ? "/" : bpv; if(!(apv = strchr(aurl, '?'))) apv = aurl + strlen(aurl); if(!(bpv = strchr(burl, '?'))) bpv = burl + strlen(burl); alen = apv - aurl; blen = bpv - burl; if(alen == blen && !memcmp(aurl, burl, alen)) return 3; apv = aurl; for(i = 0; i < alen; i++){ if(aurl[i] == '/') apv = aurl + i; } bpv = burl; for(i = 0; i < blen; i++){ if(burl[i] == '/') bpv = burl + i; } alen = apv - aurl; blen = bpv - burl; if(alen == blen && !memcmp(aurl, burl, alen)) return 2; return 1; } /* Close the handle to the file of random number generator. */ static void est_random_fclose(void){ if(est_random_ifp) fclose(est_random_ifp); } /* Dispatch a signal to the corresponding handler. Signum specifies the number of catched signal. */ static int est_signal_dispatch(int signum){ #if defined(_SYS_MSVC_) || defined(_SYS_MINGW_) switch(signum){ case CTRL_C_EVENT: case CTRL_BREAK_EVENT: case CTRL_CLOSE_EVENT: signum = 2; break; case CTRL_LOGOFF_EVENT: case CTRL_SHUTDOWN_EVENT: signum = 15; break; } if(est_signal_handlers[signum]) est_signal_handlers[signum](signum); return TRUE; #else assert(signum >= 0); if(est_signal_handlers[signum]) est_signal_handlers[signum](signum); return TRUE; #endif } /* END OF FILE */ hyperestraier-1.4.13/estraier.h000066400000000000000000002217541125261632700164750ustar00rootroot00000000000000/************************************************************************************************* * The core API of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #ifndef _ESTRAIER_H /* duplication check */ #define _ESTRAIER_H #if defined(__cplusplus) /* export for C++ */ extern "C" { #endif /************************************************************************************************* * common settings *************************************************************************************************/ /* version of Hyper Estraier */ extern const char *est_version; /************************************************************************************************* * underlying headers *************************************************************************************************/ #include #include #include #include #include /************************************************************************************************* * API for document *************************************************************************************************/ #define ESTDATTRID "@id" /* name of the attribute of the ID number */ #define ESTDATTRURI "@uri" /* name of the attribute of the URI */ #define ESTDATTRDIGEST "@digest" /* name of the attribute of message digest */ #define ESTDATTRCDATE "@cdate" /* name of the attribute of creation date */ #define ESTDATTRMDATE "@mdate" /* name of the attribute of modification date */ #define ESTDATTRADATE "@adate" /* name of the attribute of access date */ #define ESTDATTRTITLE "@title" /* name of the attribute of title */ #define ESTDATTRAUTHOR "@author" /* name of the attribute of author */ #define ESTDATTRTYPE "@type" /* name of the attribute of content type */ #define ESTDATTRLANG "@lang" /* name of the attribute of language */ #define ESTDATTRGENRE "@genre" /* name of the attribute of genre */ #define ESTDATTRSIZE "@size" /* name of the attribute of entity size */ #define ESTDATTRWEIGHT "@weight" /* name of the attribute of scoring weight */ #define ESTDATTRMISC "@misc" /* name of the attribute of miscellaneous information */ #define ESTDCNTLVECTOR "%VECTOR" /* name of the control code for keyword vector */ #define ESTDCNTLSCORE "%SCORE" /* name of the control code for substitute score */ #define ESTDCNTLSHADOW "%SHADOW" /* name of the control code for shadow document */ typedef struct { /* type of structure for a document */ int id; /* identification number */ CBMAP *attrs; /* map of attributes */ CBLIST *dtexts; /* list of shown text */ CBMAP *kwords; /* map of keywords */ } ESTDOC; /* Create a document object. The return value is an object of a document. */ ESTDOC *est_doc_new(void); /* Create a document object made from draft data. `draft' specifies a string of draft data. The return value is an object of a document. */ ESTDOC *est_doc_new_from_draft(const char *draft); /* Destroy a document object. `doc' specifies a document object. */ void est_doc_delete(ESTDOC *doc); /* Add an attribute to a document object. `doc' specifies a document object. `name' specifies the name of an attribute. `value' specifies the value of the attribute. If it is `NULL', the attribute is removed. */ void est_doc_add_attr(ESTDOC *doc, const char *name, const char *value); /* Add a sentence of text to a document object. `doc' specifies a document object. `text' specifies a sentence of text. */ void est_doc_add_text(ESTDOC *doc, const char *text); /* Add a hidden sentence to a document object. `doc' specifies a document object. `text' specifies a hidden sentence. */ void est_doc_add_hidden_text(ESTDOC *doc, const char *text); /* Attach keywords to a document object. `doc' specifies a document object. `kwords' specifies a map object of keywords. Keys of the map should be keywords of the document and values should be their scores in decimal string. The map object is copied internally. */ void est_doc_set_keywords(ESTDOC *doc, CBMAP *kwords); /* Set the substitute score of a document object. `doc' specifies a document object. `score' specifies the substitute score. It it is negative, the substitute score setting is nullified. */ void est_doc_set_score(ESTDOC *doc, int score); /* Get the ID number of a document object. `doc' specifies a document object. The return value is the ID number of the document object. If the object has not been registered, -1 is returned. */ int est_doc_id(ESTDOC *doc); /* Get a list of attribute names of a document object. `doc' specifies a document object. The return value is a new list object of attribute names of the document object. Because the object of the return value is opened with the function `cblistopen', it should be closed with the function `cblistclose' if it is no longer in use. */ CBLIST *est_doc_attr_names(ESTDOC *doc); /* Get the value of an attribute of a document object. `doc' specifies a document object. `name' specifies the name of an attribute. The return value is the value of the attribute or `NULL' if it does not exist. The life duration of the returned string is synchronous with the one of the document object. */ const char *est_doc_attr(ESTDOC *doc, const char *name); /* Get a list of sentences of the text of a document object. `doc' specifies a document object. The return value is a list object of sentences of the text of the document object. The life duration of the returned object is synchronous with the one of the document object. */ const CBLIST *est_doc_texts(ESTDOC *doc); /* Concatenate sentences of the text of a document object. `doc' specifies a document object. The return value is concatenated sentences of the document object. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_doc_cat_texts(ESTDOC *doc); /* Get attached keywords of a document object. `doc' specifies a document object. The return value is a map object of keywords and their scores in decimal string. If no keyword is attached, `NULL' is returned. The life duration of the returned object is synchronous with the one of the document object. */ CBMAP *est_doc_keywords(ESTDOC *doc); /* Get the substitute score of a document object. `doc' specifies a document object. The return value is the substitute score or -1 if it is not set. */ int est_doc_score(ESTDOC *doc); /* Dump draft data of a document object. `doc' specifies a document object. The return value is draft data of the document object. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_doc_dump_draft(ESTDOC *doc); /* Make a snippet of the body text of a document object. `doc' specifies a document object. `word' specifies a list object of words to be highlight. `wwidth' specifies whole width of the result. `hwidth' specifies width of strings picked up from the beginning of the text. `awidth' specifies width of strings picked up around each highlighted word. The return value is a snippet string of the body text of the document object. There are tab separated values. Each line is a string to be shown. Though most lines have only one field, some lines have two fields. If the second field exists, the first field is to be shown with highlighted, and the second field means its normalized form. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_doc_make_snippet(ESTDOC *doc, const CBLIST *words, int wwidth, int hwidth, int awidth); /************************************************************************************************* * API for search conditions *************************************************************************************************/ #define ESTOPUVSET "[UVSET]" /* universal set */ #define ESTOPID "[ID]" /* ID matching search */ #define ESTOPURI "[URI]" /* URI matching search */ #define ESTOPSIMILAR "[SIMILAR]" /* similarity search */ #define ESTOPRANK "[RANK]" /* ranking search */ #define ESTOPUNION "OR" /* union (conjunction) */ #define ESTOPISECT "AND" /* intersection (disjunction) */ #define ESTOPDIFF "ANDNOT" /* difference (intersection with negation) */ #define ESTOPWCBW "[BW]" /* wild card for words beginning with a string */ #define ESTOPWCEW "[EW]" /* wild card for words ending with a string */ #define ESTOPWCRX "[RX]" /* wild card for words matching regular expressions */ #define ESTOPWITH "WITH" /* delimiter for elements */ #define ESTOPSTREQ "STREQ" /* string is equal */ #define ESTOPSTRNE "STRNE" /* string is not equal */ #define ESTOPSTRINC "STRINC" /* string is included in */ #define ESTOPSTRBW "STRBW" /* string begins with */ #define ESTOPSTREW "STREW" /* string ends with */ #define ESTOPSTRAND "STRAND" /* string includes all tokens in */ #define ESTOPSTROR "STROR" /* string includes at least one token in */ #define ESTOPSTROREQ "STROREQ" /* string is equal at least one token in */ #define ESTOPSTRRX "STRRX" /* string matches regular expressions of */ #define ESTOPNUMEQ "NUMEQ" /* number or date is equal */ #define ESTOPNUMNE "NUMNE" /* number or date is not equal */ #define ESTOPNUMGT "NUMGT" /* number or date is greater than */ #define ESTOPNUMGE "NUMGE" /* number or date is greater than or equal to */ #define ESTOPNUMLT "NUMLT" /* number or date is less than */ #define ESTOPNUMLE "NUMLE" /* number or date is less than or equal to */ #define ESTOPNUMBT "NUMBT" /* number or date is between two tokens of */ #define ESTORDIDA "[IDA]" /* ID numbers in ascending order */ #define ESTORDIDD "[IDD]" /* ID numbers in descending order */ #define ESTORDSCA "[SCA]" /* scores in ascending order */ #define ESTORDSCD "[SCD]" /* scores in descending order */ #define ESTORDSTRA "STRA" /* strings in ascending order */ #define ESTORDSTRD "STRD" /* strings in descending order */ #define ESTORDNUMA "NUMA" /* numbers in ascending order */ #define ESTORDNUMD "NUMD" /* numbers in descending order */ #define ESTECLSIMURL 10.0 /* eclipse considering similarity and URL */ #define ESTECLSERV 100.0 /* eclipse on server basis */ #define ESTECLDIR 101.0 /* eclipse on directory basis */ #define ESTECLFILE 102.0 /* eclipse on file basis */ typedef struct { /* type of structure for search conditions */ char *phrase; /* search phrase */ int gstep; /* step of N-gram */ int tfidf; /* whether with TF-IDF tuning */ int pmode; /* mode of phrase form */ void (*cbxpn)(const char *, CBLIST *); /* callback function for query expansion */ CBLIST *attrs; /* conditions with attributes */ char *order; /* sorting order */ int max; /* maximum number of retrieval */ int skip; /* number of documents to be skipped */ int auxmin; /* minimum hits to adopt the auxiliary index */ CBMAP *auxwords; /* words which the auxiliary index has been used */ int scfb; /* whether to feed back scores */ int *scores; /* array of scores */ int snum; /* number of elemnts of the score array */ const int *nscores; /* array of narrowing scores */ int nsnum; /* number of elemnts of the narrowing score array */ int opts; /* options for preservation */ double ecllim; /* lower limit of similarity eclipse */ CBMAP *shadows; /* map of eclipsed documents */ char *distinct; /* distinct attribute */ int mask; /* mask for meta search */ } ESTCOND; enum { /* enumeration for options */ ESTCONDSURE = 1 << 0, /* check every N-gram key */ ESTCONDUSUAL = 1 << 1, /* check N-gram keys skipping by one */ ESTCONDFAST = 1 << 2, /* check N-gram keys skipping by two */ ESTCONDAGITO = 1 << 3, /* check N-gram keys skipping by three */ ESTCONDNOIDF = 1 << 4, /* without TF-IDF tuning */ ESTCONDSIMPLE = 1 << 10, /* with the simplified phrase */ ESTCONDROUGH = 1 << 11, /* with the rough phrase */ ESTCONDUNION = 1 << 15, /* with the union phrase */ ESTCONDISECT = 1 << 16, /* with the intersection phrase */ ESTCONDSCFB = 1 << 30 /* feed back scores (for debug) */ }; /* Create a condition object. The return value is an object of search conditions. */ ESTCOND *est_cond_new(void); /* Destroy a condition object. `cond' specifies a condition object. */ void est_cond_delete(ESTCOND *cond); /* Set the search phrase to a condition object. `cond' specifies a condition object. `phrase' specifies a search phrase. */ void est_cond_set_phrase(ESTCOND *cond, const char *phrase); /* Add an expression for an attribute to a condition object. `cond' specifies a condition object. `expr' specifies an expression for an attribute. */ void est_cond_add_attr(ESTCOND *cond, const char *expr); /* Set the order of a condition object. `cond' specifies a condition object. `expr' specifies an expression for the order. By default, the order is by score descending. */ void est_cond_set_order(ESTCOND *cond, const char *expr); /* Set the maximum number of retrieval of a condition object. `cond' specifies a condition object. `max' specifies the maximum number of retrieval. By default, the number of retrieval is not limited. */ void est_cond_set_max(ESTCOND *cond, int max); /* Set the number of skipped documents of a condition object. `cond' specifies a condition object. `skip' specifies the number of documents to be skipped in the search result. */ void est_cond_set_skip(ESTCOND *cond, int skip); /* Set options of retrieval of a condition object. `cond' specifies a condition object. `options' specifies options: `ESTCONDSURE' specifies that it checks every N-gram key, `ESTCONDUSUAL', which is the default, specifies that it checks N-gram keys with skipping one key, `ESTCONDFAST' skips two keys, `ESTCONDAGITO' skips three keys, `ESTCONDNOIDF' specifies not to perform TF-IDF tuning, `ESTCONDSIMPLE' specifies to use simplified phrase, `ESTCONDROUGH' specifies to use rough phrase, `ESTCONDUNION' specifies to use union phrase, `ESTCONDISECT' specifies to use intersection phrase, `ESTCONDSCFB' specifies to feed back scores (only for debugging). Each option can be specified at the same time by bitwise or. If keys are skipped, though search speed is improved, the relevance ratio grows less. */ void est_cond_set_options(ESTCOND *cond, int options); /* Set permission to adopt result of the auxiliary index. `cond' specifies a condition object. `min' specifies the minimum hits to adopt result of the auxiliary index. If it is not more than 0, the auxiliary index is not used. By default, it is 32. */ void est_cond_set_auxiliary(ESTCOND *cond, int min); /* Set the lower limit of similarity eclipse. `cond' specifies a condition object. `limit' specifies the lower limit of similarity for documents to be eclipsed. Similarity is between 0.0 and 1.0. If the limit is added by `ESTECLSIMURL', similarity is weighted by URL. If the limit is `ESTECLSERV', similarity is ignored and documents in the same server are eclipsed. If the limit is `ESTECLDIR', similarity is ignored and documents in the same directory are eclipsed. If the limit is `ESTECLFILE', similarity is ignored and documents of the same file are eclipsed. */ void est_cond_set_eclipse(ESTCOND *cond, double limit); /* Set the attribute distinction filter. `cond' specifies a condition object. `name' specifies the name of an attribute to be distinct. If this filter is set, candidates which have same value of the attribute is omitted. */ void est_cond_set_distinct(ESTCOND *cond, const char *name); /* Set the mask of targets of meta search. `cond' specifies a condition object. `mask' specifies a masking number. 1 means the first target, 2 means the second target, 4 means the third target, and power values of 2 and their summation compose the mask. */ void est_cond_set_mask(ESTCOND *cond, int mask); /************************************************************************************************* * API for database *************************************************************************************************/ #define ESTIDXDMAX 256 /* max number of the inverted index */ #define ESTIDXDSTD 16 /* standard number of the inverted index */ #define ESTPDOCIDMIN 2000000001 /* minimum ID number of pseudo documents */ typedef struct { /* type of structure for the inverted index */ char *name; /* name of the database */ int omode; /* open mode */ VILLA *dbs[ESTIDXDMAX]; /* database handles */ int dnum; /* number of division */ VILLA *cdb; /* current database handle */ } ESTIDX; typedef struct { /* type of structure for a database object */ char *name; /* name of the database */ int inode; /* inode of the database */ DEPOT *metadb; /* handle of the meta database */ ESTIDX *idxdb; /* handles of the inverted indexs */ VILLA *fwmdb; /* handle of the database for forward matching */ VILLA *auxdb; /* handle of the auxiliary index */ VILLA *xfmdb; /* handle of the database for aux forward matching */ CURIA *attrdb; /* handle of the database for attrutes */ CURIA *textdb; /* handle of the database for texts */ CURIA *kwddb; /* handle of the database for keywords */ VILLA *listdb; /* handle of the database for document list */ CBMAP *aidxs; /* map of attribute indexes */ CBLIST *pdocs; /* list of pseudo documents */ CBMAP *puris; /* map of URIs of pseudo documents */ int ecode; /* last happened error code */ int fatal; /* whether to have a fatal error */ int dseq; /* sequence for document IDs */ int dnum; /* number of the documents */ int amode; /* mode of text analyzer */ int zmode; /* mode of data compression */ int smode; /* mode of score type */ CBMAP *idxcc; /* cache for the inverted index */ CBMAP *auxcc; /* cache for the auxiliary index */ size_t icsiz; /* power of the cache */ size_t icmax; /* max size of the cache */ CBMAP *outcc; /* cache for deleted documents */ CBMAP *keycc; /* cache for keys for TF-IDF */ int kcmnum; /* max number of the key cache */ CBMAP *attrcc; /* cache for attributes */ int acmnum; /* max number of the attribute cache */ CBMAP *textcc; /* cache for texts */ int tcmnum; /* max number of the text cache */ CBMAP *veccc; /* cache for keyword vectors */ int vcmnum; /* max number of the vector cache */ CBMAP *rescc; /* cache for results */ int rcmnum; /* max number of the result cache */ CBMAP *spacc; /* special cache for attributes */ int scmnum; /* max number of the special cache */ char *scname; /* name of the attribute for the special cache */ void (*infocb)(const char *, void *); /* callback function to inform of events */ void *infoop; /* opaque for the informing callback */ DEPOT *dfdb; /* handle of the database for document frequency */ int wildmax; /* maximum number of expansion of wild cards */ CBMAP *metacc; /* cache for meta data */ int flsflag; /* flag of flushing */ int intflag; /* flag of thread interruption */ } ESTDB; enum { /* enumeration for error codes */ ESTENOERR, /* no error */ ESTEINVAL, /* invalid argument */ ESTEACCES, /* access forbidden */ ESTELOCK, /* lock failure */ ESTEDB, /* database problem */ ESTEIO, /* I/O problem */ ESTENOITEM, /* no item */ ESTEMISC = 9999 /* miscellaneous */ }; enum { /* enumeration for open modes */ ESTDBREADER = 1 << 0, /* open as a reader */ ESTDBWRITER = 1 << 1, /* open as a writer */ ESTDBCREAT = 1 << 2, /* a writer creating */ ESTDBTRUNC = 1 << 3, /* a writer truncating */ ESTDBNOLCK = 1 << 4, /* open without locking */ ESTDBLCKNB = 1 << 5, /* lock without blocking */ ESTDBPERFNG = 1 << 10, /* use perfect N-gram analyzer */ ESTDBCHRCAT = 1 << 11, /* use character category analyzer */ ESTDBSMALL = 1 << 20, /* small tuning */ ESTDBLARGE = 1 << 21, /* large tuning */ ESTDBHUGE = 1 << 22, /* huge tuning */ ESTDBHUGE2 = 1 << 23, /* huge tuning second */ ESTDBHUGE3 = 1 << 24, /* huge tuning third */ ESTDBSCVOID = 1 << 25, /* store scores as void */ ESTDBSCINT = 1 << 26, /* store scores as integer */ ESTDBSCASIS = 1 << 27 /* refrain from adjustment of scores */ }; enum { /* enumeration for data types of attribute index */ ESTIDXATTRSEQ, /* for multipurpose sequencial access method */ ESTIDXATTRSTR, /* for narrowing with attributes as strings */ ESTIDXATTRNUM /* for narrowing with attributes as numbers */ }; enum { /* enumeration for options of optimization */ ESTOPTNOPURGE = 1 << 0, /* omit purging dispensable region of deleted */ ESTOPTNODBOPT = 1 << 1 /* omit optimization of the database files */ }; enum { /* enumeration for options of document merger */ ESTMGCLEAN = 1 << 0 /* clean up dispensable regions */ }; enum { /* enumeration for options of document registration */ ESTPDCLEAN = 1 << 0, /* clean up dispensable regions */ ESTPDWEIGHT = 1 << 1 /* weight scores statically when indexing */ }; enum { /* enumeration for options of document deletion */ ESTODCLEAN = 1 << 0 /* clean up dispensable regions */ }; enum { /* enumeration for options of document retrieval */ ESTGDNOATTR = 1 << 0, /* no attributes */ ESTGDNOTEXT = 1 << 1, /* no text */ ESTGDNOKWD = 1 << 2 /* no keywords */ }; /* Get the string of an error code. `ecode' specifies an error code. The return value is the string of the error code. */ const char *est_err_msg(int ecode); /* Open a database. `name' specifies the name of a database directory. `omode' specifies open modes: `ESTDBWRITER' as a writer, `ESTDBREADER' as a reader. If the mode is `ESTDBWRITER', the following may be added by bitwise or: `ESTDBCREAT', which means it creates a new database if not exist, `ESTDBTRUNC', which means it creates a new database regardless if one exists. Both of `ESTDBREADER' and `ESTDBWRITER' can be added to by bitwise or: `ESTDBNOLCK', which means it opens a database file without file locking, or `ESTDBLCKNB', which means locking is performed without blocking. If `ESTDBNOLCK' is used, the application is responsible for exclusion control. `ESTDBCREAT' can be added to by bitwise or: `ESTDBPERFNG', which means N-gram analysis is performed against European text also, `ESTDBCHRCAT', which means character category analysis is performed instead of N-gram analysis, `ESTDBSMALL', which means the index is tuned to register less than 50000 documents, `ESTDBLARGE', which means the index is tuned to register more than 300000 documents, `ESTDBHUGE', which means the index is tuned to register more than 1000000 documents, `ESTDBHUGE2', which means the index is tuned to register more than 5000000 documents, `ESTDBHUGE3', which means the index is tuned to register more than 10000000 documents, `ESTDBSCVOID', which means scores are stored as void, `ESTDBSCINT', which means scores are stored as 32-bit integer, `ESTDBSCASIS', which means scores are stored as-is and marked not to be tuned when search. `ecp' specifies the pointer to a variable to which the error code is assigned. The return value is a database object of the database or `NULL' if failure. */ ESTDB *est_db_open(const char *name, int omode, int *ecp); /* Close a database. `db' specifies a database object. `ecp' specifies the pointer to a variable to which the error code is assigned. The return value is true if success, else it is false. */ int est_db_close(ESTDB *db, int *ecp); /* Get the last happened error code of a database. `db' specifies a database object. The return value is the last happened error code of the database. */ int est_db_error(ESTDB *db); /* Check whether a database has a fatal error. `db' specifies a database object. The return value is true if the database has fatal erroor, else it is false. */ int est_db_fatal(ESTDB *db); /* Add an index for narrowing or sorting with document attributes. `db' specifies a database object connected as a writer. `name' specifies the name of an attribute. `type' specifies the data type of attribute index; `ESTIDXATTRSEQ' for multipurpose sequencial access method, `ESTIDXATTRSTR' for narrowing with attributes as strings, `ESTIDXATTRNUM' for narrowing with attributes as numbers. The return value is true if success, else it is false. Note that this function should be called before the first document is registered. */ int est_db_add_attr_index(ESTDB *db, const char *name, int type); /* Flush index words in the cache of a database. `db' specifies a database object connected as a writer. `max' specifies the maximum number of words to be flushed. If it not more than zero, all words are flushed. The return value is true if success, else it is false. */ int est_db_flush(ESTDB *db, int max); /* Synchronize updating contents of a database. `db' specifies a database object connected as a writer. The return value is true if success, else it is false. */ int est_db_sync(ESTDB *db); /* Optimize a database. `db' specifies a database object connected as a writer. `options' specifies options: `ESTOPTNOPURGE' to omit purging dispensable region of deleted documents, `ESTOPTNODBOPT' to omit optimization of the database files. The two can be specified at the same time by bitwise or. The return value is true if success, else it is false. */ int est_db_optimize(ESTDB *db, int options); /* Merge another database. `db' specifies a database object connected as a writer. `name' specifies the name of another database directory. `options' specifies options: `ESTMGCLEAN' to clean up dispensable regions of the deleted document. The return value is true if success, else it is false. Creation options of the two databases should be same entirely. ID numbers of imported documents are changed within the sequence of the desitination database. If URIs of imported documents conflict ones of exsisting documents, existing documents are removed. */ int est_db_merge(ESTDB *db, const char *name, int options); /* Add a document to a database. `db' specifies a database object connected as a writer. `doc' specifies a document object. The document object should have the URI attribute. `options' specifies options: `ESTPDCLEAN' to clean up dispensable regions of the overwritten document, `ESTPDWEIGHT' to weight scores statically with score weighting attribute. The return value is true if success, else it is false. If the URI attribute is same with an existing document in the database, the existing one is deleted. */ int est_db_put_doc(ESTDB *db, ESTDOC *doc, int options); /* Remove a document from a database. `db' specifies a database object connected as a writer. `id' specifies the ID number of a registered document. `options' specifies options: `ESTODCLEAN' to clean up dispensable regions of the deleted document. The return value is true if success, else it is false. */ int est_db_out_doc(ESTDB *db, int id, int options); /* Edit attributes of a document in a database. `db' specifies a database object connected as a writer. `doc' specifies a document object. The return value is true if success, else it is false. The ID can not be changed. If the URI is changed and it overlaps the URI of another registered document, this function fails. */ int est_db_edit_doc(ESTDB *db, ESTDOC *doc); /* Retrieve a document in a database. `db' specifies a database object. `id' specifies the ID number of a registered document. `options' specifies options: `ESTGDNOATTR' to ignore attributes, `ESTGDNOTEXT' to ignore the body text, `ESTGDNOKWD' to ignore keywords. The three can be specified at the same time by bitwise or. The return value is a document object. It should be deleted with `est_doc_delete' if it is no longer in use. On error, `NULL' is returned. */ ESTDOC *est_db_get_doc(ESTDB *db, int id, int options); /* Retrieve the value of an attribute of a document in a database. `db' specifies a database object. `id' specifies the ID number of a registered document. `name' specifies the name of an attribute. The return value is the value of the attribute or `NULL' if it does not exist. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_db_get_doc_attr(ESTDB *db, int id, const char *name); /* Get the ID of a document specified by URI. `db' specifies a database object. `uri' specifies the URI of a registered document. The return value is the ID of the document. On error, -1 is returned. */ int est_db_uri_to_id(ESTDB *db, const char *uri); /* Get the name of a database. `db' specifies a database object. The return value is the name of the database. The life duration of the returned string is synchronous with the one of the database object. */ const char *est_db_name(ESTDB *db); /* Get the number of documents in a database. `db' specifies a database object. The return value is the number of documents in the database. */ int est_db_doc_num(ESTDB *db); /* Get the number of unique words in a database. `db' specifies a database object. The return value is the number of unique words in the database. */ int est_db_word_num(ESTDB *db); /* Get the size of a database. `db' specifies a database object. The return value is the size of the database. */ double est_db_size(ESTDB *db); /* Search a database for documents corresponding a condition. `db' specifies a database object. `cond' specifies a condition object. `nump' specifies the pointer to a variable to which the number of elements in the result is assigned. `hints' specifies a map object into which the number of documents corresponding to each word is stored. If a word is in a negative condition, the number is negative. The element whose key is an empty string specifies the number of whole result. If it is `NULL', it is not used. The return value is an array whose elements are ID numbers of corresponding documents. This function does never fail. Even if no document corresponds or an error occurs, an empty array is returned. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ int *est_db_search(ESTDB *db, ESTCOND *cond, int *nump, CBMAP *hints); /* Search plural databases for documents corresponding a condition. `dbs' specifies an array whose elements are database objects. `dbnum' specifies the number of elements of the array. `cond' specifies a condition object. `nump' specifies the pointer to a variable to which the number of elements in the result is assigned. `hints' specifies a map object into which the number of documents corresponding to each word is stored. If a word is in a negative condition, the number is negative. The element whose key is an empty string specifies the number of whole result. If it is `NULL', it is not used. The return value is an array whose elements are indexes of container databases and ID numbers of in each database alternately. This function does never fail. Even if no document corresponds or an error occurs, an empty array is returned. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ int *est_db_search_meta(ESTDB **dbs, int dbnum, ESTCOND *cond, int *nump, CBMAP *hints); /* Check whether a document object matches the phrase of a search condition object definitely. `db' specifies a database object. `doc' specifies a document object. `cond' specifies a search condition object. The return value is true if the document matches the phrase of the condition object definitely, else it is false. */ int est_db_scan_doc(ESTDB *db, ESTDOC *doc, ESTCOND *cond); /* Set the maximum size of the cache memory of a database. `db' specifies a database object. `size' specifies the maximum size of the index cache. By default, it is 64MB. If it is negative, the current size is not changed. `anum' specifies the maximum number of cached records for document attributes. By default, it is 8192. If it is negative, the current size is not changed. `tnum' specifies the maximum number of cached records for document texts. By default, it is 1024. If it is negative, the current size is not changed. `rnum' specifies the maximum number of cached records for occurrence results. By default, it is 256. If it is negative, the current size is not changed. */ void est_db_set_cache_size(ESTDB *db, size_t size, int anum, int tnum, int rnum); /* Add a pseudo index directory to a database. `db' specifies a database object. `path' specifies the path of a pseudo index directory. The return value is true if success, else it is false. */ int est_db_add_pseudo_index(ESTDB *db, const char *path); /************************************************************************************************* * features for experts *************************************************************************************************/ #define _EST_VERSION "1.4.13" #define _EST_LIBVER 838 #define _EST_PROTVER "1.0" #define _EST_PROJURL "http://hyperestraier.sourceforge.net/" #define _EST_XNSEARCH "http://hyperestraier.sourceforge.net/xmlns/search" #define _EST_XNNODE "http://hyperestraier.sourceforge.net/xmlns/node" enum { /* enumeration for languages */ ESTLANGEN, /* English */ ESTLANGJA, /* Japanese */ ESTLANGZH, /* Chinese */ ESTLANGKO, /* Korean */ ESTLANGMISC /* miscellaneous */ }; enum { /* enumeration for document parts */ ESTMDATTR = 1 << 0, /* attributes */ ESTMDTEXT = 1 << 1, /* texts */ ESTMDKWD = 1 << 2 /* keywords */ }; enum { /* enumeration for database repair */ ESTRPSTRICT = 1 << 0, /* perform strict consistency check */ ESTRPSHODDY = 1 << 1 /* omit consistency check */ }; typedef struct { /* type of structure for an element of result map */ const char *key; /* pointer to the key string */ int score; /* total score */ } ESTRESMAPELEM; enum { /* enumeration for scoring for result map */ ESTRMLOSUM, /* summation */ ESTRMLOMAX, /* maximum */ ESTRMLOMIN, /* minimum */ ESTRMLOAVG /* average */ }; /* Break a sentence of text and extract words. `text' specifies a sentence of text. `list' specifies a list object to which extract words are added. `norm' specifies whether to normalize the text. `tail' specifies whether to pick up oddness N-gram at the end. */ void est_break_text(const char *text, CBLIST *list, int norm, int tail); /* Break a sentence of text and extract words using perfect N-gram analyzer. `text' specifies a sentence of text. `list' specifies a list object to which extract words are added. `norm' specifies whether to normalize the text. `tail' specifies whether to pick up oddness N-gram at the end. */ void est_break_text_perfng(const char *text, CBLIST *list, int norm, int tail); /* Break a sentence of text and extract words, using character category analyzer. `text' specifies a sentence of text. `list' specifies a list object to which extract words are added. `norm' specifies whether to normalize the text. */ void est_break_text_chrcat(const char *text, CBLIST *list, int norm); /* Make a snippet of an arbitrary string. `word' specifies a list object of words to be highlight. `wwidth' specifies whole width of the result. `hwidth' specifies width of strings picked up from the beginning of the text. `awidth' specifies width of strings picked up around each highlighted word. The return value is a snippet string of the string. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_str_make_snippet(const char *str, const CBLIST *words, int wwidth, int hwidth, int awidth); /* Convert the character encoding of a string. `ptr' specifies the pointer to a region. `size' specifies the size of the region. If it is negative, the size is assigned with `strlen(ptr)'. `icode' specifies the name of encoding of the input string. `ocode' specifies the name of encoding of the output string. `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned. If it is `NULL', it is not used. `mp' specifies the pointer to a variable to which the number of missing characters by failure of conversion is assigned. If it is `NULL', it is not used. If successful, the return value is the pointer to the result object, else, it is `NULL'. Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_iconv(const char *ptr, int size, const char *icode, const char *ocode, int *sp, int *mp); /* Detect the encoding of a string automatically. `ptr' specifies the pointer to a region. `size' specifies the size of the region. If it is negative, the size is assigned with `strlen(ptr)'. `plang' specifies a preferred language. As for now, `ESTLANGEN', `ESTLANGJA', `ESTLANGZH', and `ESTLANGKO' are supported. The return value is the string of the encoding name of the string. */ const char *est_enc_name(const char *ptr, int size, int plang); /* Convert a UTF-8 string into UTF-16BE. `ptr' specifies the pointer to a region. `size' specifies the size of the region. `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned. The return value is the pointer to the result object. Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_uconv_in(const char *ptr, int size, int *sp); /* Convert a UTF-16BE string into UTF-8. `ptr' specifies the pointer to a region. `size' specifies the size of the region. `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned. If it is `NULL', it is not used. The return value is the pointer to the result object. Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_uconv_out(const char *ptr, int size, int *sp); /* Compress a serial object with ZLIB. `ptr' specifies the pointer to a region. `size' specifies the size of the region. If it is negative, the size is assigned with `strlen(ptr)'. `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned. `mode' specifies detail behavior. 0 specifies using the standard deflate encoding, -1 specifies the raw deflate encoding, and 1 specifies the GZIP encoding. If successful, the return value is the pointer to the result object, else, it is `NULL'. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_deflate(const char *ptr, int size, int *sp, int mode); /* Decompress a serial object compressed with ZLIB. `ptr' specifies the pointer to a region. `size' specifies the size of the region. `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned. If it is `NULL', it is not used. `mode' specifies detail behavior. 0 specifies using the standard deflate encoding, -1 specifies the raw deflate encoding, and 1 specifies the GZIP encoding. If successful, the return value is the pointer to the result object, else, it is `NULL'. Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_inflate(const char *ptr, int size, int *sp, int mode); /* Compress a serial object with LZO. `ptr' specifies the pointer to a region. `size' specifies the size of the region. If it is negative, the size is assigned with `strlen(ptr)'. `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned. If successful, the return value is the pointer to the result object, else, it is `NULL'. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_lzoencode(const char *ptr, int size, int *sp); /* Decompress a serial object compressed with LZO. `ptr' specifies the pointer to a region. `size' specifies the size of the region. `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned. If it is `NULL', it is not used. If successful, the return value is the pointer to the result object, else, it is `NULL'. Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_lzodecode(const char *ptr, int size, int *sp); /* Compress a serial object with BZIP2. `ptr' specifies the pointer to a region. `size' specifies the size of the region. If it is negative, the size is assigned with `strlen(ptr)'. `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned. If successful, the return value is the pointer to the result object, else, it is `NULL'. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_bzencode(const char *ptr, int size, int *sp); /* Decompress a serial object compressed with BZIP2. `ptr' specifies the pointer to a region. `size' specifies the size of the region. `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned. If it is `NULL', it is not used. If successful, the return value is the pointer to the result object, else, it is `NULL'. Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_bzdecode(const char *ptr, int size, int *sp); /* Get the border string for draft data of documents. The return value is the border string for draft data of documents. */ const char *est_border_str(void); /* Get the real random number. The return value is the real random number between 0.0 and 1.0. */ double est_random(void); /* Get the random number in normal distribution. The return value is the random number in normal distribution between 0.0 and 1.0. */ double est_random_nd(void); /* Get an MD5 hash string of a key string. `key' specifies a string to be encrypted. The return value is an MD5 hash string of the key string. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_make_crypt(const char *key); /* Check whether a key matches an MD5 hash string. `key' specifies a string to be checked. `hash' specifies an MD5 hash string. The return value is true if the key matches the hash string, else it is false. */ int est_match_crypt(const char *key, const char *hash); /* Create a regular expression object. `str' specifies a string of regular expressions. The return value is a regular expression object or `NULL' if failure. If the expression is leaded by "*I:", the pattern is case insensitive. */ void *est_regex_new(const char *str); /* Delete a regular expression object. `regex' specifies a regular expression object. */ void est_regex_delete(void *regex); /* Check whether a regular expression matches a string. `regex' specifies a regular expression object. `str' specifies a string. The return value is true if the regular expression object matchs the string. */ int est_regex_match(const void *regex, const char *str); /* Check whether a regular expression matches a string. `rstr' specifies a regular expression string. `tstr' specifies a target string. The return value is true if the regular expression string matchs the target string. */ int est_regex_match_str(const char *rstr, const char *tstr); /* Replace each substring matching a regular expression string. `str' specifies a target string. `bef' specifies a string of regular expressions for substrings. `aft' specifies a string with which each substrings are replaced. Each "&" in the string is replaced with the matched substring. Each "\" in the string escapes the following character. Special escapes "\1" through "\9" referring to the corresponding matching sub-expressions in the regular expression string are supported. The return value is a new converted string. Even if the regular expression is invalid, a copy of the original string is returned. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_regex_replace(const char *str, const char *bef, const char *aft); /* Duplicate a document object. `doc' specifies a document object. The return value is a duplicated document object. */ ESTDOC *est_doc_dup(ESTDOC *doc); /* Set the ID number of a document object. `doc' specifies a document object. `id' specifies the ID number to set. */ void est_doc_set_id(ESTDOC *doc, int id); /* Get the hidden texts of a document object. `doc' specifies a document object. The return value is concatenated sentences of the hidden text of the document object. The life duration of the returned string is synchronous with the one of the document object. */ const char *est_doc_hidden_texts(ESTDOC *doc); /* Reduce the texts to fit to the specified size. `doc' specifies a document object. `len' specifies the total size of the texts. */ void est_doc_slim(ESTDOC *doc, int size); /* Check whether a docuemnt object is empty. `doc' specifies a document object. The return value is true the document is empty, else it is false. */ int est_doc_is_empty(ESTDOC *doc); /* Duplicate a condition object. `cond' specifies a condition object. The return value is a duplicated condition object. */ ESTCOND *est_cond_dup(ESTCOND *cond); /* Get the phrase of a condition object. `cond' specifies a condition object. The return value is the phrase of the condition object or `NULL' if it is not specified. The life duration of the returned string is synchronous with the one of the condition object. */ const char *est_cond_phrase(ESTCOND *cond); /* Get a list object of attribute expressions of a condition object. `cond' specifies a condition object. The return value is a list object of attribute expressions of the condition object or `NULL' if it is not specified. The life duration of the returned object is synchronous with the one of the condition object. */ const CBLIST *est_cond_attrs(ESTCOND *cond); /* Get the order expression of a condition object. `cond' specifies a condition object. The return value is the order expression of the condition object or `NULL' if it is not specified. The life duration of the returned string is synchronous with the one of the condition object. */ const char *est_cond_order(ESTCOND *cond); /* Get the maximum number of retrieval of a condition object. `cond' specifies a condition object. The return value is the maximum number of retrieval of the condition object or -1 if it is not specified. */ int est_cond_max(ESTCOND *cond); /* Get the number of skipped documents of a condition object. `cond' specifies a condition object. The return value is the number of documents to be skipped in the search result. */ int est_cond_skip(ESTCOND *cond); /* Get the options of a condition object. `cond' specifies a condition object. The return value is the options of the condition object. */ int est_cond_options(ESTCOND *cond); /* Get permission to adopt result of the auxiliary index. `cond' specifies a condition object. The return value is permission to adopt result of the auxiliary index. */ int est_cond_auxiliary(ESTCOND *cond); /* Get the attribute distinction filter. `cond' specifies a condition object. The return value is the name of the distinct attribute or `NULL' if it is not specified. The life duration of the returned string is synchronous with the one of the condition object. */ const char *est_cond_distinct(ESTCOND *cond); /* Get the mask of targets of meta search. `cond' specifies a condition object. The return value is the mask of targets of meta search. */ int est_cond_mask(ESTCOND *cond); /* Get the score of a document corresponding to a condition object. `cond' specifies a condition object. `index' specifies the index of an element of the result array of `est_db_search'. The return value is the score of the element or -1 if the index is out of bounds. */ int est_cond_score(ESTCOND *cond, int index); /* Get the score array of corresponding documents of a condition object. `cond' specifies a condition object. `nump' specifies the pointer to a variable to which the number of elements in the score array is assigned. The return value is the score array of corresponding documents. */ const int *est_cond_scores(ESTCOND *cond, int *nump); /* Set the narrowing scores of a condition object. `cond' specifies a condition object. `scores' specifies the pointer to an array of narrowing scores. The life duration of the array should be equal to or longer than the condition object itself. `num' specifies the number of the array. */ void est_cond_set_narrowing_scores(ESTCOND *cond, const int *scores, int num); /* Check whether a condition object has used the auxiliary index. `cond' specifies a condition object. `word' specifies a keyword to be checked. If it is an empty string, whether at least one keyword is used is checked. The return value is true if the condition object has used the auxiliary index, else it is false */ int est_cond_auxiliary_word(ESTCOND *cond, const char *word); /* Get an array of ID numbers of eclipsed docuemnts of a document in a condition object. `cond' specifies a condition object. `id' specifies the ID number of a parent document. `np' specifies the pointer to a variable to which the number of elements of the return value is assigned. The return value is an array whose elements expresse the ID numbers and their scores alternately. */ const int *est_cond_shadows(ESTCOND *cond, int id, int *np); /* Set the callback function for query expansion. `cond' specifies a condition object. `func' specifies the pointer to a function. The first argument of the callback specifies a word to be expand. The second argument speciifes a list object into which renewed words to be stored. */ void est_cond_set_expander(ESTCOND *cond, void (*func)(const char *, CBLIST *)); /* Set the error code of a database. `db' specifies a database object. `ecode' specifies a error code to set. */ void est_db_set_ecode(ESTDB *db, int ecode); /* Check whether an option is set. `db' specifies a database object. `option' specifies an option used when opening the database. The return value is 1 if the option is set, 0 if the option is not set, or -1 if it is unknown. */ int est_db_check_option(ESTDB *db, int option); /* Get the inode number of a database. `db' specifies a database object. The return value is the inode number of the database. */ int est_db_inode(ESTDB *db); /* Set the entity data of a document in a database. `db' specifies a database object connected as a writer. `id' specifies the ID number of a registered document. `ptr' specifies the pointer to a region of entity data. If it is `NULL', the entity data is removed. `size' specifies the size of the region. The return value is true if success, else it is false. */ int est_db_set_doc_entity(ESTDB *db, int id, const char *ptr, int size); /* Get the entity data of a document in a database. `db' specifies a database object. `id' specifies the ID number of a registered document. `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned. The return value is the value of the entity data or `NULL' if it does not exist. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_db_get_doc_entity(ESTDB *db, int id, int *sp); /* Set the maximum number of expansion of wild cards. `db' specifies a database object. `num' specifies the maximum number of expansion of wild cards. */ void est_db_set_wildmax(ESTDB *db, int num); /* Add a piece of meta data to a database. `db' specifies a database object connected as a writer. `name' specifies the name of a piece of meta data. `value' specifies the value of the meta data. If it is `NULL', the meta data is removed. */ void est_db_add_meta(ESTDB *db, const char *name, const char *value); /* Get a list of names of meta data of a database. `db' specifies a database object. The return value is a new list object of meta data names of the document object. Because the object of the return value is opened with the function `cblistopen', it should be closed with the function `cblistclose' if it is no longer in use. */ CBLIST *est_db_meta_names(ESTDB *db); /* Get the value of a piece of meta data of a database. `db' specifies a database object. `name' specifies the name of a piece of meta data. The return value is the value of the meta data or `NULL' if it does not exist. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_db_meta(ESTDB *db, const char *name); /* Extract keywords of a document object. `db' specifies a database object for TF-IDF tuning. If it is `NULL', it is not used. `doc' specifies a document object. `max' specifies the maximum number of keywords to be extracted. The return value is a new map object of keywords and their scores in decimal string. Because the object of the return value is opened with the function `cbmapopen', it should be closed with the function `cbmapclose' if it is no longer in use. */ CBMAP *est_db_etch_doc(ESTDB *db, ESTDOC *doc, int max); /* Store a map object of keywords. `db' specifies a database object connected as a writer. `id' specifies the ID number of a document. `kwords' specifies a map object of keywords of the document. `weight' specifies weighting bias of scores. The return value is true if success, else it is false. */ int est_db_put_keywords(ESTDB *db, int id, CBMAP *kwords, double weight); /* Remove keywords of a document. `db' specifies a database object connected as a writer. `id' specifies the ID number of a document. The return value is true if success, else it is false. */ int est_db_out_keywords(ESTDB *db, int id); /* Retrieve a map object of keywords. `db' specifies a database object. `id' specifies the ID number of a document. The return value is a new map object of keywords and their scores in decimal string. If keywords of the document is not stored, `NULL' is returned. Because the object of the return value is opened with the function `cbmapopen', it should be closed with the function `cbmapclose' if it is no longer in use. */ CBMAP *est_db_get_keywords(ESTDB *db, int id); /* Mesure the total size of each inner records of a stored document. `db' specifies a database object. `id' specifies the ID number of a document. `parts' specifies document parts: `ESTMDATTR' for attributes, `ESTMDTEXT' for texts, and `ESTMDKWD' for keywords. They can be specified at the same time by bitwise or. The return value is the total size of each inner records of a stored document. */ int est_db_measure_doc(ESTDB *db, int id, int parts); /* Initialize the document iterator of a database. `db' specifies a database object. `prev' specifies the URI of the previous element of iteration. If it is `NULL', it is not used. The return value is true if success, else it is false. */ int est_db_iter_init(ESTDB *db, const char *prev); /* Get the next ID of the document iterator of a database. `db' specifies a database object. The return value is the next ID. If there is no more document, 0 is returned. On error, -1 is returned. */ int est_db_iter_next(ESTDB *db); /* Initialize the word iterator of a database. `db' specifies a database object. The return value is true if success, else it is false. */ int est_db_word_iter_init(ESTDB *db); /* Get the next word of the word iterator of a database. `db' specifies a database object. The return value is the next word. If there is no more word, `NULL' is returned. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_db_word_iter_next(ESTDB *db); /* Get the size of the record of a word. `db' specifies a database object. `word' specifies a word. The return value is the size of the record of the word. If there is no corresponding record, 0 is returned. */ int est_db_word_rec_size(ESTDB *db, const char *word); /* Get the number of unique keywords in a database. `db' specifies a database object. The return value is the number of unique keywords in the database. */ int est_db_keyword_num(ESTDB *db); /* Initialize the keyword iterator of a database. `db' specifies a database object. The return value is true if success, else it is false. */ int est_db_keyword_iter_init(ESTDB *db); /* Get the next keyword of the word iterator of a database. `db' specifies a database object. The return value is the next word. If there is no more keyword, `NULL' is returned. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_db_keyword_iter_next(ESTDB *db); /* Get the size of the record of a keyword. `db' specifies a database object. `word' specifies a keyword. The return value is the size of the record of the keyword. If there is no corresponding record, 0 is returned. */ int est_db_keyword_rec_size(ESTDB *db, const char *word); /* Search documents corresponding a keyword for a database. `db' specifies a database object. `word' specifies a keyword. `nump' specifies the pointer to a variable to which the number of elements in the result is assigned. The return value is an array whose elements are ID numbers of corresponding documents. This function does never fail. Even if no document corresponds or an error occurs, an empty array is returned. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ int *est_db_keyword_search(ESTDB *db, const char *word, int *nump); /* Get the number of records in the cache memory of a database. `db' specifies a database object. The return value is the cache memory of a database. */ int est_db_cache_num(ESTDB *db); /* Get the size of used cache region. `db' specifies a database object. The return value is the size of used cache region. */ int est_db_used_cache_size(ESTDB *db); /* Set the special cache for narrowing and sorting with document attributes. `db' specifies a database object. `name' specifies the name of a document. `num' specifies the maximum number of cached records. */ void est_db_set_special_cache(ESTDB *db, const char *name, int num); /* Set the callback function to inform of database events. `db' specifies a database object. `func' specifies the pointer to a function. The first argument of the callback specifies a message of each event. The second argument specifies an arbitrary pointer of a opaque data. `opaque' specifies the pointer of the second argument of the callback. */ void est_db_set_informer(ESTDB *db, void (*func)(const char *, void *), void *opaque); /* Fill the cache for keys for TF-IDF. `db' specifies a database object. */ void est_db_fill_key_cache(ESTDB *db); /* Set the database of document frequency. `db' specifies a database object. `dfdb' specifies a database object of `DEPOT'. If it is `NULL', the setting is cleared. */ void est_db_set_dfdb(ESTDB *db, DEPOT *dfdb); /* Clear the result cache. `db' specifies a database object. */ void est_db_refresh_rescc(ESTDB *db); /* Charge the result cache. `db' specifies a database object. `max' specifies the maximum number of words to be charged. If it not more than zero, all words are charged. */ void est_db_charge_rescc(ESTDB *db, int max); /* Get a list of words in the result cache. `db' specifies a database object. The return value is a new list object of words in the result cache. Because the object of the return value is opened with the function `cblistopen', it should be closed with the function `cblistclose' if it is no longer in use. */ CBLIST *est_db_list_rescc(ESTDB *db); /* Get the number of pseudo documents in a database. `db' specifies a database object. The return value is the number of pseudo documents in the database. */ int est_db_pseudo_doc_num(ESTDB *db); /* Get a list of expressions of attribute indexes of a database. `db' specifies a database object. The return value is a new list object of expressions of attribute indexes. Because the object of the return value is opened with the function `cblistopen', it should be closed with the function `cblistclose' if it is no longer in use. */ CBLIST *est_db_attr_index_exprs(ESTDB *db); /* Interrupt long time processing. `db' specifies a database object. */ void est_db_interrupt(ESTDB *db); /* Repair a broken database directory. `name' specifies the name of a database directory. `options' specifies options: `ESTRPSTRICT' to perform strict consistency check, `ESTRPSHODDY' to omit consistency check. `ecp' specifies the pointer to a variable to which the error code is assigned. The return value is true if success, else it is false. */ int est_db_repair(const char *name, int options, int *ecp); /* Extract words for snippet from hints of search. `hints' specifies a map object whose records were set by `est_db_search'. The return value is a new list object of words to be highlighted. Because the object of the return value is opened with the function `cblistopen', it should be closed with the function `cblistclose' if it is no longer in use. */ CBLIST *est_hints_to_words(CBMAP *hints); /* Add a record into a result map for logical operation. `map' specifies a map object. `key' specifies the key of a record. `score' specifies the score of the record. `method' specifies a scoring method when logical operation. As for now, `ESTRMLOSUM', `ESTRMLOMAX', `ESTRMLOMIN', and `ESTRMLOAVG'. */ void est_resmap_add(CBMAP *map, const char *key, int score, int method); /* Dump a result list of a result map for logical operation. `map' specifies a map object. `min' specifies the minimum number of times for which each element of the result occurs. `nump' specifies the pointer to a variable to which the number of elements in the result is assigned. The return value is an array whose elements are structures of keys and scores. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ ESTRESMAPELEM *est_resmap_dump(CBMAP *map, int min, int *nump); /* Reset the environment of the process. This function sets the standard streams as binary mode and resets environment variables for locale. */ void est_proc_env_reset(void); /* Make a directory. `path' specifies the path of a new directory. The return value is true if success, else it is false. */ int est_mkdir(const char *path); /* Remove a directory and its contents recursively. `path' specifies the path of a directory. The return value is true if success, else it is false. */ int est_rmdir_rec(const char *path); /* Get the canonicalized absolute pathname of a file. `path' specifies the path of a file. The return value is the canonicalized absolute pathname of a file. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *est_realpath(const char *path); /* Get the inode number of a file. `path' specifies the path of a file. The return value is the inode number of a file or -1 on error. */ int est_inode(const char *path); /* Change modification time of a file. `path' specifies the path of a file. `mtime' specifies modification time. If it is negative, the current time is set. The return value is true if success, else it is false. */ int est_utime(const char *path, time_t mtime); /* Get the time of day in milliseconds. The return value is the time of day in milliseconds. */ double est_gettimeofday(void); /* Suspend execution for microsecond intervals. `usec' specifies microseconds to sleep for. */ void est_usleep(unsigned long usec); /* Set a signal handler. `signum' specifies the number of a target signal. `sighandler' specifies the pointer to a function. The argument of the handler specifies the number of the catched signal. If it is `SIG_IGN', the signal is ignored. */ void est_signal(int signum, void (*sighandler)(int)); /* Send a signal to a process. `pid' specifies the PID of a target process. `sig' specifies a signal code. The return value is true if success, else it is false. */ int est_kill(int pid, int sig); /* Get the load ratio of the physical memory. The return value is the load ratio of the physical memory. As for now, this function returns 0.0 on platforms except for Windows. */ double est_memory_usage(void); /* Get the media type of an extention. `ext' specifies the extension of a file path. The return value is the media time of the extension. */ const char *est_ext_type(const char *ext); /* Set a seed vector from a map object. `svmap' specifies a map object of a seed vector. `svec' specifies a vector object. `vnum' specifies the number of dimensions of the vector. */ void est_vector_set_seed(CBMAP *svmap, int *svec, int vnum); /* Set a target vector from a map object. `svmap' specifies a map object of a seed vector. `tvmap' specifies a map object of a target vector. `tvec' specifies a vector object. `vnum' specifies the number of dimensions of the vector. */ void est_vector_set_target(CBMAP *svmap, CBMAP *tvmap, int *tvec, int vnum); /* Get the cosine of the angle of two vectors. `avec' specifies a vector object. `bvec' specifies the other vector object. `vnum' specifies the number of dimensions of the vector. The return value is the cosine of the angle of two vectors. */ double est_vector_cosine(const int *avec, const int *bvec, int vnum); #if defined(__cplusplus) /* export for C++ */ } #endif #endif /* duplication check */ /* END OF FILE */ hyperestraier-1.4.13/estraier.idl000066400000000000000000000154761125261632700170200ustar00rootroot00000000000000/************************************************************************************************* * IDL for bindings of scripting languages * Copyright (C) 2004-2005 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ /** * namespace of Hyper Estraier */ module estraier { //---------------------------------------------------------------- // data structures for utility //---------------------------------------------------------------- /** * List of strings (to be substituted for by the native list mechanism). */ interface List { string get(in long index); }; /** * Map of strings (to be substituted for by the native map mechanism). */ interface Map { List keys(); string get(in string key); }; //---------------------------------------------------------------- // core API //---------------------------------------------------------------- /** * Abstraction of document. */ interface Document { void add_attr(in string name, in string value); void add_text(in string text); void add_hidden_text(in string text); void set_keywords(in Map kwords); void set_score(in long score); long id(); List attr_names(); string attr(in string name); List texts(); string cat_texts(); Map keywords(); long score(); string dump_draft(); string make_snippet(in List words, in long wwidth, in long hwidth, in long awidth); }; /** * Abstraction of search condition. */ interface Condition { const long SURE = 1 << 0; const long USUAL = 1 << 1; const long FAST = 1 << 2; const long AGITO = 1 << 3; const long NOIDF = 1 << 4; const long SIMPLE = 1 << 10; const long ROUGH = 1 << 11; const long UNION = 1 << 15; const long ISECT = 1 << 16; void set_phrase(in string phrase); void add_attr(in string expr); void set_order(in string expr); void set_max(in long max); void set_skip(in long skip); void set_options(in long options); void set_auxiliary(in long min); void set_distinct(in string name); }; /** * Abstraction of result set from database. */ interface Result { long doc_num(); long get_doc_id(in long index); List hint_words(); string hint(in string word); }; /** * Abstraction of database. */ interface Database { const long ERRNOERR = 0; const long ERRINVAL = 1; const long ERRACCES = 2; const long ERRLOCK = 3; const long ERRDB = 4; const long ERRIO = 5; const long ERRNOITEM = 6; const long ERRMISC = 9999; const long DBREADER = 1 << 0; const long DBWRITER = 1 << 1; const long DBCREAT = 1 << 2; const long DBTRUNC = 1 << 3; const long DBNOLCK = 1 << 4; const long DBLCKNB = 1 << 5; const long DBPERFNG = 1 << 10; const long DBCHRCAT = 1 << 11; const long DBSMALL = 1 << 20; const long DBLARGE = 1 << 21; const long DBHUGE = 1 << 22; const long DBSCVOID = 1 << 25; const long DBSCINT = 1 << 26; const long DBSCASIS = 1 << 27; const long IDXATTRSEQ = 0; const long IDXATTRSTR = 1; const long IDXATTRNUM = 2; const long OPTNOPURGE = 1 << 0; const long OPTNODBOPT = 1 << 1; const long MGCLEAN = 1 << 0; const long PDCLEAN = 1 << 0; const long PDWEIGHT = 1 << 1; const long ODCLEAN = 1 << 0; const long GDNOATTR = 1 << 0; const long GDNOTEXT = 1 << 1; const long GDNOKWD = 1 << 2; string err_msg(in long ecode); boolean open(in string name, in long omode); boolean close(); long error(); boolean fatal(); boolean add_attr_index(in string name, in long type); boolean flush(in long max); boolean sync(); boolean optimize(in long options); boolean merge(in string name, in long options); boolean put_doc(in Document doc, in long options); boolean out_doc(in long id, in long options); boolean edit_doc(in Document doc); Document get_doc(in long id, in long options); string get_doc_attr(in long id, in string name); long uri_to_id(in string uri); string name(); long doc_num(); long word_num(); double size(); Result search(in Condition cond); boolean scan_doc(in Document doc, in Condition cond); void set_cache_size(in double size, in long anum, in long tnum); boolean add_pseudo_index(in string path); }; //---------------------------------------------------------------- // node API //---------------------------------------------------------------- /** * Abstraction of document in result set. */ interface ResultDocument { string uri(); List attr_names(); string attr(in string name); string snippet(); string keywords(); }; /** * Abstraction of result set from node. */ interface NodeResult { long doc_num(); ResultDocument get_doc(in long index); string hint(in string key); }; /** * Abstraction of connection to P2P node. */ interface Node { long status(); void set_url(in string url); void set_proxy(in string host, in long port); void set_timeout(in long msec); void set_auth(in string name, in string password); boolean sync(); boolean optimize(); boolean put_doc(in Document doc); boolean out_doc(in long id); boolean out_doc_by_uri(in string uri); Document get_doc(in long id); Document get_doc_by_uri(in string uri); string get_doc_attr(in long id, in string name); string get_doc_attr_by_uri(in string uri, in string name); Map etch_doc(in long id); Map etch_doc_by_uri(in string uri); long uri_to_id(in string uri); string name(); string label(); long doc_num(); long word_num(); double size(); double cache_usage(); List admins(); List users(); List links(); NodeResult search(in Condition cond, in long depth); void set_snippet_width(in long wwidth, in long hwidth, in long awidth); boolean set_user(in string name, in long mode); boolean set_link(in string url, in string label, in long credit); }; }; /* END OF FILE */ hyperestraier-1.4.13/estresult.dtd000066400000000000000000000072251125261632700172300ustar00rootroot00000000000000 hyperestraier-1.4.13/estscout.c000066400000000000000000000754331125261632700165240ustar00rootroot00000000000000/************************************************************************************************* * A intersection meta searcher of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #if defined(MYFCGI) #include #endif #include "estraier.h" #include "estmtdb.h" #include "estnode.h" #include "myconf.h" #define CONFSUFFIX ".conf" /* suffix of the configuration file */ #define CACHESUFFIX ".ecc" /* suffix of temporary files */ #define NUMBUFSIZ 32 /* size of a buffer for a number */ #define OUTBUFSIZ 262144 /* size of the output buffer */ #define MINIBNUM 31 /* bucket number of map for trivial use */ #define CONDATTRMAX 9 /* maximum number of attribute conditions */ #define SEARCHMAX 10 /* maximum number of shown documents */ #define DUPCHKMAX 65536 /* maximum number of duplication checked documents */ #define LOCKRETRYNUM 8 /* number of retries when locking failure */ #define CCPURGEFREQ 512 /* frequency of purging temporary files */ #define CCSCVOIDMAX 1024 /* maximum number of narrowing scores to void cache */ #define CCGENMINTIME 1978 /* minimum elapsed milliseconds to generate cache */ typedef struct { /* type of structure for a search thread */ ESTMTDB *db; /* database object */ ESTCOND *cond; /* condition object */ const int *scores; /* array of narrowing scores */ int snum; /* number of the score array */ CBMAP *rmap; /* result object */ time_t now; /* the current time */ int hnum; /* number of corresponding documents */ int alive; /* whether to be alive */ } TARGSRCH; /* global variables for configurations */ int g_runcnt = 0; /* count of running */ const char *g_conffile = NULL; /* path of the configuration file */ const CBLIST *g_indexlist = NULL; /* list of real indexes */ int g_lockindex = FALSE; /* whether to perform file locking to the database */ int g_condgstep = -1; /* step of N-gram */ int g_dotfidf = FALSE; /* whether to do TF-IDF tuning */ int g_scancheck = -1; /* number of checked documents by scanning */ int g_phraseform = 0; /* mode of phrase form */ int g_wildmax = -1; /* maximum number of extension of wild cards */ int g_stmode = FALSE; /* whether to be single thread mode */ const char *g_idattr = NULL; /* attribute for identification */ const CBLIST *g_idsuflist = NULL; /* list of suffixes for identification */ const char *g_ordexpr = NULL; /* attribute for ordering when attribute search */ int g_dupcheck = FALSE; /* whether to check duplication of identifiers */ int g_union = FALSE; /* whether to perform union meta search */ int g_score = -1; /* scoring method when logical operation */ const char *g_tmpdir = NULL; /* path of the directory for temporary files */ int g_cclife = 0; /* lifetime of cache files */ const char *g_logfile = NULL; /* path of the log file */ const char *g_logformat = NULL; /* format of the log */ /* global variables for parameters */ const CBLIST *p_phraselist = NULL; /* list of phrase conditions */ const CBLIST *p_attrlist = NULL; /* list of attribute conditions */ int p_max = -1; /* number of output documents */ const char *p_distinct = NULL; /* name of distinction attribute */ int p_fresh = FALSE; /* whether to retrieve fresh result */ int p_stmode = FALSE; /* whether to be single thread mode */ const char *p_logmsg = ""; /* additional log message */ /* other global variables */ char g_outbuf[OUTBUFSIZ]; /* output buffer */ const char *g_scriptname = NULL; /* name of the script */ ESTMTDB **g_dbs = NULL; /* database handles */ int g_metamin = 0; /* minimum number of occurence times */ int g_sort = FALSE; /* whether to sort explicitrly */ int g_hnum = 0; /* number of corresponding documents */ int g_cache = FALSE; /* whether cache was used */ /* function prototypes */ int main(int argc, char **argv); static int realmain(int argc, char **argv); static void showerror(const char *msg); static const char *skiplabel(const char *str); static CBMAP *getparameters(void); static void showresult(void); static void *procsearch(void *targ); static char *myencode(ESTCOND *cond); static char *caturisuffixes(ESTMTDB *db, int id, const char *uri); static void outputlog(void); /* main routine */ int main(int argc, char **argv){ #if defined(MYFCGI) int i, ecode; while(FCGI_Accept() >= 0){ g_runcnt++; p_phraselist = NULL; p_attrlist = NULL; p_max = -1; p_distinct = NULL; p_fresh = FALSE; p_stmode = FALSE; p_logmsg = ""; g_metamin = 0; g_sort = FALSE; g_hnum = 0; g_cache = FALSE; realmain(argc, argv); fflush(stdout); if(g_runcnt >= 64){ for(i = 0; i < cblistnum(g_indexlist); i++){ if(g_dbs[i]){ est_mtdb_close(g_dbs[i], &ecode); } } exit(0); } } return 0; #else int i, rv, ecode; est_proc_env_reset(); rv = realmain(argc, argv); fflush(stdout); for(i = 0; i < cblistnum(g_indexlist); i++){ if(g_dbs[i]){ est_mtdb_close(g_dbs[i], &ecode); } } return rv; #endif } /* main routine */ static int realmain(int argc, char **argv){ CBLIST *lines, *ilist, *slist, *plist, *alist; CBMAP *params; const char *rp; char *tmp, *wp, numbuf[NUMBUFSIZ]; int i, j, len, omode, ecode; /* set configurations */ setvbuf(stdout, g_outbuf, _IOFBF, OUTBUFSIZ); g_scriptname = argv[0]; if((rp = getenv("SCRIPT_NAME")) != NULL) g_scriptname = rp; if((rp = strrchr(g_scriptname, '/')) != NULL) g_scriptname = rp + 1; tmp = cbmalloc(strlen(g_scriptname) + strlen(CONFSUFFIX) + 1); sprintf(tmp, "%s", g_scriptname); cbglobalgc(tmp, free); if(!(wp = strrchr(tmp, '.'))) wp = tmp + strlen(tmp); sprintf(wp, "%s", CONFSUFFIX); g_conffile = tmp; if(!(lines = cbreadlines(g_conffile))) showerror("the configuration file is missing."); cbglobalgc(lines, (void (*)(void *))cblistclose); ilist = cblistopen(); cbglobalgc(ilist, (void (*)(void *))cblistclose); slist = cblistopen(); cbglobalgc(slist, (void (*)(void *))cblistclose); for(i = 0; i < cblistnum(lines); i++){ rp = cblistval(lines, i, NULL); if(cbstrfwimatch(rp, "indexname:")){ rp = skiplabel(rp); if(*rp != '\0') cblistpush(ilist, rp, -1); } else if(cbstrfwimatch(rp, "lockindex:")){ g_lockindex = atoi(skiplabel(rp)) > 0; } else if(cbstrfwimatch(rp, "condgstep:")){ g_condgstep = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "dotfidf:")){ g_dotfidf = atoi(skiplabel(rp)) > 0; } else if(cbstrfwimatch(rp, "scancheck:")){ g_scancheck = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "phraseform:")){ g_phraseform = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "wildmax:")){ g_wildmax = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "stmode:")){ g_stmode = atoi(skiplabel(rp)) > 0; } else if(cbstrfwimatch(rp, "idattr:")){ g_idattr = skiplabel(rp); } else if(cbstrfwimatch(rp, "idsuffix:")){ rp = skiplabel(rp); if(*rp != '\0') cblistpush(slist, rp, -1); } else if(cbstrfwimatch(rp, "ordexpr:")){ g_ordexpr = skiplabel(rp); } else if(cbstrfwimatch(rp, "dupcheck:")){ g_dupcheck = atoi(skiplabel(rp)) > 0; } else if(cbstrfwimatch(rp, "union:")){ g_union = atoi(skiplabel(rp)) > 0; } else if(cbstrfwimatch(rp, "score:")){ g_score = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "tmpdir:")){ g_tmpdir = skiplabel(rp); } else if(cbstrfwimatch(rp, "cclife:")){ g_cclife = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "logfile:")){ g_logfile = skiplabel(rp); } else if(cbstrfwimatch(rp, "logformat:")){ g_logformat = skiplabel(rp); } } if(cblistnum(ilist) < 1) showerror("indexname is undefined."); g_indexlist = ilist; if(g_condgstep < 1) showerror("condgstep is undefined."); if(g_scancheck < 0) showerror("scancheck is undefined."); if(g_phraseform < 1) showerror("phraseform is undefined."); if(g_wildmax < 0) showerror("wildmax is undefined."); if(!g_idattr) showerror("idattr is undefined."); g_idsuflist = slist; if(!g_ordexpr) showerror("ordexpr is undefined."); if(g_score < 0) showerror("score is undefined."); if(!g_tmpdir) showerror("tmpdir is undefined."); if(!g_logfile) showerror("logfile is undefined."); if(!g_logformat) showerror("logformat is undefined."); /* read parameters */ params = getparameters(); cbglobalgc(params, (void (*)(void *))cbmapclose); plist = cblistopen(); cbglobalgc(plist, (void (*)(void *))cblistclose); alist = cblistopen(); cbglobalgc(alist, (void (*)(void *))cblistclose); if(g_union && ((rp = cbmapget(params, "phrase", -1, NULL)) || (rp = cbmapget(params, "phrase1", -1, NULL)))){ while(*rp == ' ' || *rp == '\t'){ rp++; } for(i = 0; i < cblistnum(g_indexlist); i++){ cblistpush(plist, rp, -1); } } else { for(i = 1; i <= cblistnum(g_indexlist); i++){ len = sprintf(numbuf, "phrase%d", i); rp = cbmapget(params, numbuf, len, NULL); if(!rp && i == 1) rp = cbmapget(params, "phrase", -1, NULL); if(!rp) rp = ""; while(*rp == ' ' || *rp == '\t'){ rp++; } cblistpush(plist, rp, -1); } } if((rp = cbmapget(params, "attr", -1, NULL)) != NULL) cblistpush(alist, rp, -1); for(i = 1; i <= CONDATTRMAX; i++){ len = sprintf(numbuf, "attr%d", i); rp = cbmapget(params, numbuf, len, NULL); if(!rp && i == 1) rp = cbmapget(params, "attr", -1, NULL); if(!rp) rp = ""; while(*rp == ' ' || *rp == '\t'){ rp++; } if(*rp != '\0') cblistpush(alist, rp, -1); } if((rp = cbmapget(params, "max", -1, NULL)) != NULL) p_max = atoi(rp); if(p_max < 0) p_max = SEARCHMAX; if(!(p_distinct = cbmapget(params, "distinct", -1, NULL))) p_distinct = ""; if((rp = cbmapget(params, "fresh", -1, NULL)) != NULL) p_fresh = atoi(rp) > 0; if((rp = cbmapget(params, "stmode", -1, NULL)) != NULL) p_stmode = atoi(rp) > 0; if(!(p_logmsg = cbmapget(params, "logmsg", -1, NULL))) p_logmsg = ""; p_phraselist = plist; p_attrlist = alist; /* open databases */ if(!g_dbs){ g_dbs = cbmalloc(cblistnum(g_indexlist) * sizeof(ESTMTDB)); cbglobalgc(g_dbs, free); for(i = 0; i < cblistnum(g_indexlist); i++){ g_dbs[i] = NULL; } } g_metamin = 0; g_sort = TRUE; omode = ESTDBREADER; if(!g_lockindex) omode |= ESTDBNOLCK; for(i = 0; i < cblistnum(g_indexlist); i++){ if((rp = cblistval(p_phraselist, i, NULL)) != NULL && *rp != '\0'){ if(!g_dbs[i]){ for(j = 0; j <= LOCKRETRYNUM; j++){ if((g_dbs[i] = est_mtdb_open(cblistval(g_indexlist, i, NULL), omode, &ecode)) != NULL) break; est_usleep(1000 * 1000); } if(!g_dbs[i]) showerror("one of the indexes is missing or broken or being updated."); est_mtdb_set_cache_size(g_dbs[i], -1, 512, 128, 0); est_mtdb_set_wildmax(g_dbs[i], g_wildmax); } g_metamin++; g_sort = FALSE; } } rp = cblistval(p_phraselist, 0, NULL); if(*rp == '\0' && cblistnum(p_attrlist) > 0){ if(!g_dbs[0]){ for(j = 0; j <= LOCKRETRYNUM; j++){ if((g_dbs[0] = est_mtdb_open(cblistval(g_indexlist, 0, NULL), omode, &ecode)) != NULL) break; est_usleep(1000 * 1000); } if(!g_dbs[0]) showerror("one of the indexes is missing or broken or being updated."); est_mtdb_set_cache_size(g_dbs[0], -1, 512, 128, 0); est_mtdb_set_wildmax(g_dbs[0], g_wildmax); } g_metamin++; } if(g_union) g_metamin = 1; /* show the result */ showresult(); /* output the log message */ outputlog(); return 0; } /* show the error page and exit */ static void showerror(const char *msg){ printf("Status: 500 Internal Server Error\r\n"); printf("Content-Type: text/plain; charset=UTF-8\r\n"); printf("\r\n"); printf("Error: %s\n", msg); exit(1); } /* skip the label of a line */ static const char *skiplabel(const char *str){ if(!(str = strchr(str, ':'))) return ""; str++; while(*str != '\0' && (*str == ' ' || *str == '\t')){ str++; } return str; } /* get CGI parameters */ static CBMAP *getparameters(void){ int maxlen = 1024 * 1024 * 32; CBMAP *map, *attrs; CBLIST *pairs, *parts; const char *rp, *body; char *buf, *key, *val, *dkey, *dval, *wp, *bound, *fbuf, *aname; int i, len, c, blen, flen; map = cbmapopenex(37); buf = NULL; len = 0; if((rp = getenv("REQUEST_METHOD")) != NULL && !strcmp(rp, "POST") && (rp = getenv("CONTENT_LENGTH")) != NULL && (len = atoi(rp)) > 0){ if(len > maxlen) len = maxlen; buf = cbmalloc(len + 1); for(i = 0; i < len && (c = getchar()) != EOF; i++){ buf[i] = c; } buf[i] = '\0'; if(i != len){ free(buf); buf = NULL; } } else if((rp = getenv("QUERY_STRING")) != NULL){ buf = cbmemdup(rp, -1); len = strlen(buf); } if(buf && len > 0){ if((rp = getenv("CONTENT_TYPE")) != NULL && cbstrfwmatch(rp, "multipart/form-data") && (rp = strstr(rp, "boundary=")) != NULL){ rp += 9; bound = cbmemdup(rp, -1); if((wp = strchr(bound, ';')) != NULL) *wp = '\0'; parts = cbmimeparts(buf, len, bound); for(i = 0; i < cblistnum(parts); i++){ body = cblistval(parts, i, &blen); attrs = cbmapopen(); fbuf = cbmimebreak(body, blen, attrs, &flen); if((rp = cbmapget(attrs, "NAME", -1, NULL)) != NULL){ cbmapput(map, rp, -1, fbuf, flen, FALSE); aname = cbsprintf("%s-filename", rp); if((rp = cbmapget(attrs, "FILENAME", -1, NULL)) != NULL) cbmapput(map, aname, -1, rp, -1, FALSE); free(aname); } free(fbuf); cbmapclose(attrs); } cblistclose(parts); free(bound); } else { pairs = cbsplit(buf, -1, "&"); for(i = 0; i < cblistnum(pairs); i++){ key = cbmemdup(cblistval(pairs, i, NULL), -1); if((val = strchr(key, '=')) != NULL){ *(val++) = '\0'; dkey = cburldecode(key, NULL); dval = cburldecode(val, NULL); cbmapput(map, dkey, -1, dval, -1, FALSE); free(dval); free(dkey); } free(key); } cblistclose(pairs); } } free(buf); return map; } /* show the result */ static void showresult(void){ pthread_t *thlist; TARGSRCH *arglist; ESTRESMAPELEM *elems; ESTCOND *cond; CBMAP *rmap; CBLIST *list; const char *rp; char tmppath[PATH_MAX], *expr; int i, j, num, hnum, max; struct stat sbuf; time_t now; printf("Content-Type: text/plain\r\n"); printf("Cache-Control: no-cache, must-revalidate, no-transform\r\n"); printf("Pragma: no-cache\r\n"); printf("X-Run-Count: %d\r\n", g_runcnt); printf("\r\n"); now = time(NULL); if(*g_tmpdir != '\0' && *g_tmpdir != '@' && g_cclife >= 0 && (now + g_runcnt) % CCPURGEFREQ == 1 && (list = cbdirlist(g_tmpdir)) != NULL){ for(i = 0; i < cblistnum(list); i++){ rp = cblistval(list, i, NULL); if(!cbstrbwmatch(rp, CACHESUFFIX)) continue; sprintf(tmppath, "%s%c%s", g_tmpdir, ESTPATHCHR, rp); if(stat(tmppath, &sbuf) != -1 && now - sbuf.st_mtime > g_cclife) unlink(tmppath); } cblistclose(list); } rmap = cbmapopen(); thlist = cbmalloc(cblistnum(g_indexlist) * sizeof(pthread_t)); arglist = cbmalloc(cblistnum(g_indexlist) * sizeof(TARGSRCH)); max = p_max * 1.3 + 1; for(i = 0; i < cblistnum(g_indexlist); i++){ arglist[i].db = g_dbs[i]; cond = est_cond_new(); if((rp = cblistval(p_phraselist, i, NULL)) != NULL && *rp != '\0') est_cond_set_phrase(cond, rp); if(g_union || i == 0){ for(j = 0; j < cblistnum(p_attrlist); j++){ est_cond_add_attr(cond, cblistval(p_attrlist, j, NULL)); } } if(*g_ordexpr == '$'){ expr = cbsprintf("%s %s", g_ordexpr + 1, ESTORDNUMD); est_cond_set_order(cond, expr); free(expr); } else if(*g_ordexpr != '\0' && g_sort){ est_cond_set_order(cond, g_ordexpr); } if(g_metamin < 2 && cblistnum(p_attrlist) < 1) est_cond_set_max(cond, max); switch(g_condgstep){ case 1: est_cond_set_options(cond, ESTCONDSURE); break; case 2: est_cond_set_options(cond, ESTCONDUSUAL); break; case 3: est_cond_set_options(cond, ESTCONDFAST); break; case 4: est_cond_set_options(cond, ESTCONDAGITO); break; } if(!g_dotfidf) est_cond_set_options(cond, ESTCONDNOIDF); switch(g_phraseform){ case 2: est_cond_set_options(cond, ESTCONDSIMPLE); break; case 3: est_cond_set_options(cond, ESTCONDROUGH); break; case 4: est_cond_set_options(cond, ESTCONDUNION); break; case 5: est_cond_set_options(cond, ESTCONDISECT); break; } est_cond_set_options(cond, ESTCONDSCFB); if(*p_distinct != '\0') est_cond_set_distinct(cond, p_distinct); arglist[i].cond = cond; arglist[i].scores = NULL; arglist[i].snum = -1; arglist[i].rmap = rmap; arglist[i].now = now; arglist[i].hnum = 0; } if(g_stmode || (!g_union && g_metamin < 2) || p_stmode){ for(i = cblistnum(g_indexlist) - 1; i >= 0; i--){ if(i < cblistnum(g_indexlist) - 1){ arglist[i].scores = arglist[i+1].scores; arglist[i].snum = arglist[i+1].snum; } procsearch(arglist + i); if(!g_union && arglist[i].hnum == 0) break; } } else { for(i = 0; i < cblistnum(g_indexlist); i++){ arglist[i].alive = TRUE; if(pthread_create(thlist + i, NULL, procsearch, arglist + i) != 0) arglist[i].alive = FALSE; } for(i = 0; i < cblistnum(g_indexlist); i++){ if(arglist[i].alive) pthread_join(thlist[i], NULL); } } hnum = 0; for(i = 0; i < cblistnum(g_indexlist); i++){ est_cond_delete(arglist[i].cond); if(arglist[i].hnum > 0) hnum += arglist[i].hnum; } free(arglist); free(thlist); elems = est_resmap_dump(rmap, g_metamin, &num); if(num < max && num < hnum) hnum = num; g_hnum = g_metamin < 2 ? hnum : num; printf("%d\n", g_hnum); for(i = 0; i < num && i < p_max; i++){ printf("%s\t%d\n", elems[i].key, elems[i].score); } free(elems); cbmapclose(rmap); } /* search an index */ static void *procsearch(void *targ){ static pthread_mutex_t mymutex = PTHREAD_MUTEX_INITIALIZER; TARGSRCH *argp; FILE *ofp; ESTMTDB *db; ESTCOND *cond; ESTDOC *doc; CBMAP *rmap, *hints, *umap; CBLIST *list; const char *rp, *uri; char tmppath[PATH_MAX], *value, *expr, *ord, *enc, *pv, *mp, numbuf[NUMBUFSIZ]; const int *scores; int i, *res, rnum, snum, check, len, num; struct stat sbuf; double etime; time_t now; argp = (TARGSRCH *)targ; db = argp->db; cond = argp->cond; rmap = argp->rmap; now = argp->now; if(!db || (!est_cond_phrase(cond) && !est_cond_attrs(cond))){ argp->hnum = -1; return NULL; } if(*g_tmpdir != '\0' && !p_fresh && !est_cond_phrase(cond) && (!argp->scores || argp->snum > CCSCVOIDMAX)){ enc = myencode(cond); if(*g_tmpdir == '@'){ num = dpinnerhash(enc, -1) % 0x100; if(g_cclife >= 0 && (now + g_runcnt) % (CCPURGEFREQ / 16) == 0){ sprintf(tmppath, "%s%c%02x", g_tmpdir + 1, ESTPATHCHR, num); if((list = cbdirlist(tmppath)) != NULL){ for(i = 0; i < cblistnum(list); i++){ rp = cblistval(list, i, NULL); if(!cbstrbwmatch(rp, CACHESUFFIX)) continue; sprintf(tmppath, "%s%c%02x%c%s", g_tmpdir + 1, ESTPATHCHR, num, ESTPATHCHR, rp); if(stat(tmppath, &sbuf) != -1 && now - sbuf.st_mtime > g_cclife) unlink(tmppath); } cblistclose(list); } } sprintf(tmppath, "%s%c%02x%c%s%s", g_tmpdir + 1, ESTPATHCHR, num, ESTPATHCHR, enc, CACHESUFFIX); } else { sprintf(tmppath, "%s%c%s%s", g_tmpdir, ESTPATHCHR, enc, CACHESUFFIX); } free(enc); } else { *tmppath = '\0'; } if(*tmppath != '\0' && stat(tmppath, &sbuf) != -1){ if((g_cclife < 0 || now - sbuf.st_mtime <= g_cclife) && (value = cbreadfile(tmppath, &len)) != NULL){ if(pthread_mutex_lock(&mymutex) == 0){ rp = value; if((pv = strchr(rp, '\n')) != NULL){ argp->hnum += atoi(rp); rp = pv + 1; } while((pv = strchr(rp, '\n')) != NULL){ *pv = '\0'; if((mp = strchr(rp, '\t')) != NULL){ *mp = '\0'; est_resmap_add(rmap, rp, atoi(mp + 1), ESTRMLOMAX); } rp = pv + 1; } pthread_mutex_unlock(&mymutex); } free(value); if(g_cclife >= 0){ if(now % 4 == 0 && getpid() % 4 == 0 && est_random() < 0.1){ unlink(tmppath); } else { est_utime(tmppath, sbuf.st_mtime + (now - sbuf.st_mtime) / 2); } } g_cache = TRUE; return NULL; } else { unlink(tmppath); } } if(argp->scores && *g_idattr == '\0' && !g_union) est_cond_set_narrowing_scores(cond, argp->scores, argp->snum); hints = cbmapopenex(MINIBNUM); etime = est_gettimeofday(); res = est_mtdb_search(db, cond, &rnum, hints); etime = est_gettimeofday() - etime; if((scores = est_cond_scores(cond, &snum)) != NULL && (!argp->scores || snum < argp->snum)){ argp->scores = scores; argp->snum = snum; } check = (rp = est_cond_phrase(cond)) != NULL && *rp != '\0' && *rp != '[' && *rp != '*' ? g_scancheck : 0; ofp = *tmppath != '\0' && etime >= CCGENMINTIME ? fopen(tmppath, "w") : NULL; num = (rp = cbmapget(hints, "", 0, NULL)) != NULL ? atoi(rp) : 0; if(rnum < est_cond_max(cond) && num < rnum) num = rnum; argp->hnum += num; if(ofp) fprintf(ofp, "%d\n", num); if(pthread_mutex_lock(&mymutex) == 0){ umap = g_dupcheck && g_metamin > 1 ? cbmapopenex(DUPCHKMAX - 1) : NULL; if(*g_idattr == '\0'){ for(i = 0; i < rnum; i++){ if(check > 0){ if(!(doc = est_mtdb_get_doc(db, res[i], 0))) continue; if(!est_mtdb_scan_doc(db, doc, cond)){ est_doc_delete(doc); continue; } est_doc_delete(doc); check--; } if((num = est_cond_score(cond, i)) > 0){ sprintf(numbuf, "%d", num); if(!umap || cbmaprnum(umap) > DUPCHKMAX || cbmapput(umap, numbuf, -1, "", 0, FALSE)){ if(cblistnum(g_idsuflist) > 0){ expr = caturisuffixes(db, res[i], numbuf); uri = expr; } else { expr = NULL; uri = numbuf; } if(*g_ordexpr == '$'){ ord = est_mtdb_get_doc_attr(db, res[i], g_ordexpr + 1); num = ord ? cbstrmktime(ord) : 0; free(ord); } est_resmap_add(rmap, uri, num, g_score); if(ofp) fprintf(ofp, "%s\t%d\n", uri, num); free(expr); } } else if((value = est_mtdb_get_doc_attr(db, res[i], ESTDATTRURI)) != NULL){ if(!umap || cbmaprnum(umap) > DUPCHKMAX || cbmapput(umap, value, -1, "", 0, FALSE)){ if(cblistnum(g_idsuflist) > 0){ expr = caturisuffixes(db, res[i], value); uri = expr; } else { expr = NULL; uri = value; } if(*g_ordexpr == '$'){ ord = est_mtdb_get_doc_attr(db, res[i], g_ordexpr + 1); num = ord ? cbstrmktime(ord) : 0; free(ord); } else { num = atoi(value); } est_resmap_add(rmap, uri, num, g_score); if(ofp) fprintf(ofp, "%s\t%d\n", uri, num); free(expr); } free(value); } } } else { for(i = 0; i < rnum; i++){ if(check > 0){ if(!(doc = est_mtdb_get_doc(db, res[i], 0))) continue; if(!est_mtdb_scan_doc(db, doc, cond)){ est_doc_delete(doc); continue; } if((rp = est_doc_attr(doc, g_idattr)) != NULL){ num = est_cond_score(cond, i); if(cblistnum(g_idsuflist) > 0){ expr = caturisuffixes(db, res[i], rp); uri = expr; } else { expr = NULL; uri = rp; } if(*g_ordexpr == '$'){ ord = est_mtdb_get_doc_attr(db, res[i], g_ordexpr + 1); num = ord ? cbstrmktime(ord) : 0; free(ord); } est_resmap_add(rmap, uri, num, g_score); if(ofp) fprintf(ofp, "%s\t%d\n", uri, num); free(expr); } est_doc_delete(doc); check--; } else if((value = est_mtdb_get_doc_attr(db, res[i], g_idattr)) != NULL){ num = est_cond_score(cond, i); if(cblistnum(g_idsuflist) > 0){ expr = caturisuffixes(db, res[i], value); uri = expr; } else { expr = NULL; uri = value; } if(*g_ordexpr == '$'){ ord = est_mtdb_get_doc_attr(db, res[i], g_ordexpr + 1); num = ord ? cbstrmktime(ord) : 0; free(ord); } else if(num < 1){ num = atoi(value); } est_resmap_add(rmap, uri, num, g_score); if(ofp) fprintf(ofp, "%s\t%d\n", uri, num); free(expr); free(value); } } } if(umap) cbmapclose(umap); pthread_mutex_unlock(&mymutex); } if(ofp) fclose(ofp); free(res); cbmapclose(hints); return NULL; } /* encode a string for file name */ static char *myencode(ESTCOND *cond){ const CBLIST *attrs; CBDATUM *sbuf; const char *phrase, *order; char *mp, *rp, *wp, *ep; int i; sbuf = cbdatumopen(NULL, -1); if((phrase = est_cond_phrase(cond)) != NULL) cbdatumprintf(sbuf, "phrase=%s\n", phrase); if((attrs = est_cond_attrs(cond)) != NULL){ for(i = 0; i < cblistnum(attrs); i++){ cbdatumprintf(sbuf, "attr[%d]=%s\n", i + 1, cblistval(attrs, i, NULL)); } } if((order = est_cond_order(cond)) != NULL) cbdatumprintf(sbuf, "order=%s\n", order); cbdatumprintf(sbuf, "max=%d\n", est_cond_max(cond)); cbdatumprintf(sbuf, "options=%d\n", est_cond_options(cond)); mp = est_make_crypt(cbdatumptr(sbuf)); rp = mp; wp = mp; while(*rp != '\0'){ if(*rp <= '0' && *rp >= '9'){ *wp = (*rp - '0') * 16; } else { *wp = (*rp - 'a' + 10) * 16; } rp++; if(*rp <= '0' && *rp >= '9'){ *wp += (*rp - '0'); } else { *wp += *rp - 'a' + 10; } if(*rp != '\0') rp++; wp++; } ep = cbbaseencode(mp, wp - mp); wp = ep; while(*wp != '\0'){ if(*wp == '/' || *wp == '+'){ *wp = '_'; } else if(*wp == '='){ *wp = '\0'; } wp++; } free(mp); cbdatumclose(sbuf); return ep; } /* concatenate suffixes after URI */ static char *caturisuffixes(ESTMTDB *db, int id, const char *uri){ CBDATUM *buf; char *value; int i; buf = cbdatumopen(uri, -1); for(i = 0; i < cblistnum(g_idsuflist); i++){ cbdatumcat(buf, "@", 1); if((value = est_mtdb_get_doc_attr(db, id, cblistval(g_idsuflist, i, NULL))) != NULL){ cbdatumcat(buf, value, -1); free(value); } } return cbdatumtomalloc(buf, NULL); } /* output the log message */ static void outputlog(void){ FILE *ofp; CBDATUM *condbuf; const char *rp, *pv; char *name, *value; int i; if(g_logfile[0] == '\0') return; condbuf = cbdatumopen(NULL, -1); for(i = 0; i < cblistnum(p_phraselist); i++){ cbdatumcat(condbuf, "{{p:", -1); cbdatumcat(condbuf, cblistval(p_phraselist, i, NULL), -1); cbdatumcat(condbuf, "}}", -1); } for(i = 0; i < cblistnum(p_attrlist); i++){ cbdatumcat(condbuf, "{{a:", -1); cbdatumcat(condbuf, cblistval(p_attrlist, i, NULL), -1); cbdatumcat(condbuf, "}}", -1); } if(cbdatumsize(condbuf) < 1 || !(ofp = fopen(g_logfile, "ab"))){ cbdatumclose(condbuf); return; } rp = g_logformat; while(*rp != '\0'){ switch(*rp){ case '\\': if(rp[1] != '\0') rp++; switch(*rp){ case 't': fputc('\t', ofp); break; case 'n': fputc('\n', ofp); break; default: fputc(*rp, ofp); break; } break; case '{': if(cbstrfwmatch(rp, "{cond}")){ pv = cbdatumptr(condbuf); while(*pv != '\0'){ if(*pv > '\0' && *pv < ' '){ fputc(' ', ofp); } else { fputc(*pv, ofp); } pv++; } rp += 5; } else if(cbstrfwmatch(rp, "{time}")){ value = cbdatestrwww(-1, 0); fprintf(ofp, "%s", value); free(value); rp += 5; } else if(cbstrfwmatch(rp, "{hnum}")){ fprintf(ofp, "%d", g_hnum); rp += 5; } else if(cbstrfwmatch(rp, "{cache}")){ fprintf(ofp, "%d", g_cache); rp += 6; } else if(cbstrfwmatch(rp, "{metamin}")){ fprintf(ofp, "%d", g_metamin); rp += 8; } else if(cbstrfwmatch(rp, "{logmsg}")){ fprintf(ofp, "%s", p_logmsg); rp += 7; } else if((pv = strchr(rp, '}')) != NULL){ rp++; name = cbmemdup(rp, pv - rp); value = getenv(name); if(value) fprintf(ofp, "%s", value); free(name); rp = pv; } else { fputc(*rp, ofp); } break; default: fputc(*rp, ofp); break; } rp++; } fclose(ofp); cbdatumclose(condbuf); } /* END OF FILE */ hyperestraier-1.4.13/estscout.conf000066400000000000000000000005171125261632700172160ustar00rootroot00000000000000indexname: casket-1 indexname: casket-2 indexname: casket-3 lockindex: 1 condgstep: 2 dotfidf: 1 scancheck: 3 phraseform: 2 wildmax: 256 stmode: 0 idattr: @uri idsuffix: ordexpr: @uri STRA dupcheck: 0 union: 0 score: 0 tmpdir: /tmp cclife: 300 logfile: logformat: {time}\t{REMOTE_ADDR}:{REMOTE_PORT}\t{cond}\t{hnum}\n hyperestraier-1.4.13/estseek.c000066400000000000000000002220741125261632700163110ustar00rootroot00000000000000/************************************************************************************************* * A sample searcher of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #if defined(MYFCGI) #include #endif #include "estraier.h" #include "myconf.h" #define CONFSUFFIX ".conf" /* suffix of the configuration file */ #define DATTRLREAL "_lreal" /* name of the attribute of the real path */ #define DATTRLFILE "_lfile" /* name of the attribute of the file name */ #define DATTRSCORE "#score" /* name of the pseudo-attribute of score */ #define NUMBUFSIZ 32 /* size of a buffer for a number */ #define OUTBUFSIZ 262144 /* size of the output buffer */ #define MINIBNUM 31 /* bucket number of map for trivial use */ #define CONDATTRMAX 9 /* maximum number of attribute conditions */ #define LOCKRETRYNUM 16 /* number of retries when locking failure */ #define MISSRETRYNUM 3 /* number of retries when missing documents */ #define MISSINCRATIO 8 /* ratio of increment number when missing */ #define NAVIPAGES 10 /* number of pages in paging navigation */ #define SPCACHEMNUM 1048576 /* max number of the special cache */ typedef struct { /* type of structure for a hitting object */ const char *word; /* face of keyword */ int pt; /* score tuned by TF-IDF */ } KEYSC; enum { /* enumeration for form type */ FT_NORMAL = 0, /* normal */ FT_WEB = 1, /* for web site */ FT_FILE = 2, /* for file system */ FT_MAIL = 3 /* for mail box */ }; enum { /* enumeration for navigation type */ NM_NORMAL = 0, /* normal */ NM_ADVANCED = 1, /* advanced */ NM_HELP = 2 /* help */ }; /* global variables for configurations */ const char *g_conffile = NULL; /* path of the configuration file */ const char *g_indexname = NULL; /* name of the index */ const char *g_tmplfile = NULL; /* path of the template file */ const char *g_topfile = NULL; /* path of the top page file */ const char *g_helpfile = NULL; /* path of the help page file */ int g_lockindex = FALSE; /* whether to perform file locking to the database */ const CBLIST *g_replexprs = NULL; /* list of URI replacement expressions */ int g_showlreal = FALSE; /* wether to show local real paths */ const char *g_deftitle = NULL; /* default title string */ int g_formtype = FT_NORMAL; /* form type */ const char *g_perpage = NULL; /* parameters for the per-page select box */ int g_attrselect = FALSE; /* whether to use select boxes for extension form */ const CBLIST *g_genrechecks = NULL; /* list of checkboxes of genre attributes */ int g_attrwidth = -1; /* maximum width of each shown attribute */ int g_showscore = FALSE; /* whether to show scores */ const CBLIST *g_extattrs = NULL; /* list of extra attributes of each document */ int g_snipwwidth = -1; /* whole width of the snippet */ int g_sniphwidth = -1; /* width of beginning of the text */ int g_snipawidth = -1; /* width around each highlighted word */ int g_condgstep = -1; /* step of N-gram */ int g_dotfidf = FALSE; /* whether to do TF-IDF tuning */ int g_scancheck = -1; /* number of checked documents by scanning */ int g_phraseform = 0; /* mode of phrase form */ const char *g_dispproxy = NULL; /* proxy for marking display */ int g_candetail = FALSE; /* whether to show detail link */ int g_candir = FALSE; /* whether to show dir link */ int g_auxmin = -1; /* minimum hits to adopt the auxiliary index */ int g_smlrvnum = -1; /* number of elements of a vecter for similarity */ const char *g_smlrtune = NULL; /* tuning parameters for similarity search */ int g_clipview = -1; /* number of clipped documents to be shown */ double g_clipweight = 0.0; /* weighting algorithm of documents clipping */ int g_relkeynum = -1; /* number of related keywords to be shown */ const char *g_spcache = NULL; /* name of the attribute of special cache */ int g_wildmax = -1; /* maximum number of extension of wild cards */ const char *g_qxpndcmd = NULL; /* command for query expansion */ const char *g_logfile = NULL; /* path of the log file */ const char *g_logformat = NULL; /* format of the log */ /* global variables for parameters */ int p_navi = NM_NORMAL; /* navigation mode */ const char *p_phrase = NULL; /* search phrase */ const char *p_attr = NULL; /* narrowing attribute */ const char *p_attrval = NULL; /* separated value of narrowing attribute */ const char *p_order = NULL; /* ordering expression */ int p_perpage = 0; /* number of shown documents per page */ int p_clip = 0; /* lower limit of similarity eclipse */ int p_qxpnd = FALSE; /* whether to perform query expansion */ int p_gmasks = 0; /* masks for genre attributes */ int p_cinc = 0; /* ID of the parent of shown clipped documents */ int p_prec = FALSE; /* whether to search more precisely */ int p_pagenum = 0; /* number of the page */ int p_detail = 0; /* ID of the document to be detailed */ int p_similar = 0; /* ID of the seed document of similarity search */ /* other global variables */ char g_outbuf[OUTBUFSIZ]; /* output buffer */ const char *g_scriptname = NULL; /* name of the script */ const char *g_tmpltext = NULL; /* text of the template */ ESTDB *g_db = NULL; /* main database object */ double g_etime = 0.0; /* elepsed time */ int g_tabidx = 0; /* counter of tab indexes */ const CBLIST *g_attrlist = NULL; /* list of advanced attributes */ int g_hnum = -1; /* number of corresponding documents */ /* function prototypes */ int main(int argc, char **argv); static int realmain(int argc, char **argv); static void showerror(const char *msg); static const char *skiplabel(const char *str); static CBMAP *getparameters(void); static void myestdbclose(ESTDB *db); static void xmlprintf(const char *format, ...); static void setsimilarphrase(void); static void showpage(void); static void showtitle(void); static void shownaviform(void); static void showperpageform(const char *onchange); static void showclipform(const char *onchange); static void showgenreform(void); static void showformnormal(void); static void showformforweb(void); static void showformforfile(void); static void showformformail(void); static void showtop(void); static void expandquery(const char *word, CBLIST *result); static int keysc_compare(const void *ap, const void *bp); static void showresult(ESTDOC **docs, int dnum, CBMAP *hints, ESTCOND *cond, int hits, int miss, KEYSC *scores, int scnum); static void showdoc(ESTDOC *doc, const CBLIST *words, CBMAP *cnames, int detail, const int *shadows, int snum, int *clipp); static char *makeshownuri(const char *uri); static void showinfo(void); static void outputlog(void); /* main routine */ int main(int argc, char **argv){ #if defined(MYFCGI) static int cnt = 0; est_proc_env_reset(); while(FCGI_Accept() >= 0){ p_navi = NM_NORMAL; p_phrase = NULL; p_attr = NULL; p_attrval = NULL; p_order = NULL; p_perpage = 0; p_clip = 0; p_qxpnd = FALSE; p_gmasks = 0; p_cinc = 0; p_prec = FALSE; p_pagenum = 0; p_detail = 0; p_similar = 0; g_attrlist = NULL; g_hnum = -1; realmain(argc, argv); fflush(stdout); if(++cnt >= 256) exit(0); } return 0; #else est_proc_env_reset(); return realmain(argc, argv); #endif } /* real main routine */ static int realmain(int argc, char **argv){ CBLIST *lines, *plist, *rlist, *glist, *alist, *vlist, *tlist; CBMAP *params; const char *rp; char *tmp, *wp, numbuf[NUMBUFSIZ]; int i, len, ecode; /* set configurations */ setvbuf(stdout, g_outbuf, _IOFBF, OUTBUFSIZ); g_scriptname = argv[0]; if((rp = getenv("SCRIPT_NAME")) != NULL) g_scriptname = rp; if((rp = strrchr(g_scriptname, '/')) != NULL) g_scriptname = rp + 1; tmp = cbmalloc(strlen(g_scriptname) + strlen(CONFSUFFIX) + 1); sprintf(tmp, "%s", g_scriptname); cbglobalgc(tmp, free); if(!(wp = strrchr(tmp, '.'))) wp = tmp + strlen(tmp); sprintf(wp, "%s", CONFSUFFIX); g_conffile = tmp; if(!(lines = cbreadlines(g_conffile))) showerror("the configuration file is missing."); cbglobalgc(lines, (void (*)(void *))cblistclose); plist = cblistopen(); cbglobalgc(plist, (void (*)(void *))cblistclose); rlist = cblistopen(); cbglobalgc(rlist, (void (*)(void *))cblistclose); glist = cblistopen(); cbglobalgc(glist, (void (*)(void *))cblistclose); alist = cblistopen(); cbglobalgc(alist, (void (*)(void *))cblistclose); for(i = 0; i < cblistnum(lines); i++){ rp = cblistval(lines, i, NULL); if(cbstrfwimatch(rp, "indexname:")){ g_indexname = skiplabel(rp); } else if(cbstrfwimatch(rp, "tmplfile:")){ g_tmplfile = skiplabel(rp); } else if(cbstrfwimatch(rp, "topfile:")){ g_topfile = skiplabel(rp); } else if(cbstrfwimatch(rp, "helpfile:")){ g_helpfile = skiplabel(rp); } else if(cbstrfwimatch(rp, "lockindex:")){ if(!cbstricmp(skiplabel(rp), "true")) g_lockindex = TRUE; } else if(cbstrfwimatch(rp, "pseudoindex:")){ rp = skiplabel(rp); if(*rp != '\0') cblistpush(plist, rp, -1); } else if(cbstrfwimatch(rp, "replace:")){ rp = skiplabel(rp); if(*rp != '\0') cblistpush(rlist, rp, -1); } else if(cbstrfwimatch(rp, "deftitle:")){ g_deftitle = skiplabel(rp); } else if(cbstrfwimatch(rp, "showlreal:")){ if(!cbstricmp(skiplabel(rp), "true")) g_showlreal = TRUE; } else if(cbstrfwimatch(rp, "formtype:")){ rp = skiplabel(rp); if(!cbstricmp(rp, "web")){ g_formtype = FT_WEB; } else if(!cbstricmp(rp, "file")){ g_formtype = FT_FILE; } else if(!cbstricmp(rp, "mail")){ g_formtype = FT_MAIL; } else { g_formtype = FT_NORMAL; } } else if(cbstrfwimatch(rp, "perpage:")){ g_perpage = skiplabel(rp); } else if(cbstrfwimatch(rp, "attrselect:")){ if(!cbstricmp(skiplabel(rp), "true")) g_attrselect = TRUE; } else if(cbstrfwimatch(rp, "genrecheck:")){ rp = skiplabel(rp); if(*rp != '\0') cblistpush(glist, rp, -1); } else if(cbstrfwimatch(rp, "attrwidth:")){ g_attrwidth = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "showscore:")){ if(!cbstricmp(skiplabel(rp), "true")) g_showscore = TRUE; } else if(cbstrfwimatch(rp, "extattr:")){ rp = skiplabel(rp); if(*rp != '\0') cblistpush(alist, rp, -1); } else if(cbstrfwimatch(rp, "snipwwidth:")){ g_snipwwidth = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "sniphwidth:")){ g_sniphwidth = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "snipawidth:")){ g_snipawidth = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "condgstep:")){ g_condgstep = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "dotfidf:")){ if(!cbstricmp(skiplabel(rp), "true")) g_dotfidf = TRUE; } else if(cbstrfwimatch(rp, "scancheck:")){ g_scancheck = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "phraseform:")){ g_phraseform = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "dispproxy:")){ g_dispproxy = skiplabel(rp); } else if(cbstrfwimatch(rp, "candetail:")){ if(!cbstricmp(skiplabel(rp), "true")) g_candetail = TRUE; } else if(cbstrfwimatch(rp, "candir:")){ if(!cbstricmp(skiplabel(rp), "true")) g_candir = TRUE; } else if(cbstrfwimatch(rp, "auxmin:")){ g_auxmin = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "smlrvnum:")){ g_smlrvnum = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "smlrtune:")){ g_smlrtune = skiplabel(rp); } else if(cbstrfwimatch(rp, "clipview:")){ g_clipview = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "clipweight:")){ rp = skiplabel(rp); if(!cbstricmp(rp, "url")) g_clipweight = ESTECLSIMURL; } else if(cbstrfwimatch(rp, "relkeynum:")){ g_relkeynum = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "spcache:")){ g_spcache = skiplabel(rp); } else if(cbstrfwimatch(rp, "wildmax:")){ g_wildmax = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "qxpndcmd:")){ g_qxpndcmd = skiplabel(rp); } else if(cbstrfwimatch(rp, "logfile:")){ g_logfile = skiplabel(rp); } else if(cbstrfwimatch(rp, "logformat:")){ g_logformat = skiplabel(rp); } } if(!g_indexname) showerror("indexname is undefined."); if(!g_tmplfile) showerror("tmplfile is undefined."); if(!g_topfile) showerror("topfile is undefined."); if(!g_helpfile) showerror("helpfile is undefined."); g_replexprs = rlist; if(!g_deftitle) showerror("deftitle is undefined."); if(!g_perpage) showerror("perpage is undefined."); if(g_attrwidth < 0) showerror("attrwidth is undefined."); g_genrechecks = glist; g_extattrs = alist; if(g_snipwwidth < 0) showerror("snipwwidth is undefined."); if(g_sniphwidth < 0) showerror("sniphwidth is undefined."); if(g_snipawidth < 0) showerror("snipawidth is undefined."); if(g_condgstep < 1) showerror("condgstep is undefined."); if(g_scancheck < 0) showerror("scancheck is undefined."); if(g_phraseform < 1) showerror("phraseform is undefined."); if(!g_dispproxy) showerror("dispproxy is undefined."); if(!g_smlrtune) showerror("smlrtune is undefined."); if(!g_spcache) showerror("spcache is undefined."); if(g_wildmax < 0) showerror("wildmax is undefined."); if(!g_qxpndcmd) showerror("qxpndcmd is undefined."); if(!g_logfile) showerror("logfile is undefined."); if(!g_logformat) showerror("logformat is undefined."); /* read parameters */ params = getparameters(); cbglobalgc(params, (void (*)(void *))cbmapclose); if((rp = cbmapget(params, "navi", -1, NULL)) != NULL) p_navi = atoi(rp); if(!(p_phrase = cbmapget(params, "phrase", -1, NULL))) p_phrase = ""; while(*p_phrase == ' ' || *p_phrase == '\t'){ p_phrase++; } if(!(p_attr = cbmapget(params, "attr", -1, NULL))) p_attr = ""; while(*p_attr == ' ' || *p_attr == '\t'){ p_attr++; } if(!(p_attrval = cbmapget(params, "attrval", -1, NULL))) p_attrval = ""; while(*p_attrval == ' ' || *p_attrval == '\t'){ p_attrval++; } if(cbstrfwmatch(p_attr, "gstep=")){ g_condgstep = atoi(p_attr + 6); p_attr = ""; } if(cbstrfwmatch(p_attr, "tfidf=")){ g_dotfidf = !cbstricmp(p_attr + 6, "true"); p_attr = ""; } if(cbstrfwmatch(p_attr, "scan=")){ g_scancheck = atoi(p_attr + 5); p_attr = ""; } if(!(p_order = cbmapget(params, "order", -1, NULL))) p_order = ""; while(*p_order == ' ' || *p_order == '\t'){ p_order++; } if((rp = cbmapget(params, "perpage", -1, NULL)) != NULL) p_perpage = atoi(rp); if(p_perpage < 1) p_perpage = atoi(g_perpage); if((rp = cbmapget(params, "clip", -1, NULL)) != NULL) p_clip = atoi(rp); if((rp = cbmapget(params, "qxpnd", -1, NULL)) != NULL) p_qxpnd = atoi(rp); for(i = 0; i < sizeof(int) * 8 - 1; i++){ len = sprintf(numbuf, "genre%d", i + 1); if((rp = cbmapget(params, numbuf, len, NULL)) != NULL) p_gmasks |= 1 << i; } if((rp = cbmapget(params, "gmasks", -1, NULL)) != NULL) p_gmasks = atoi(rp); if(p_gmasks == 0) p_gmasks = -1; if((rp = cbmapget(params, "cinc", -1, NULL)) != NULL) p_cinc = atoi(rp); if((rp = cbmapget(params, "prec", -1, NULL)) != NULL) p_prec = atoi(rp) > 0; if((rp = cbmapget(params, "detail", -1, NULL)) != NULL) p_detail = atoi(rp); if(p_detail < 1) p_detail = 0; if((rp = cbmapget(params, "similar", -1, NULL)) != NULL) p_similar = atoi(rp); if(p_similar < 1) p_similar = 0; if((rp = cbmapget(params, "pagenum", -1, NULL)) != NULL) p_pagenum = atoi(rp); if(p_pagenum < 1) p_pagenum = 1; if((rp = cbmapget(params, "enc", -1, NULL)) != NULL){ if((tmp = est_iconv(p_phrase, -1, rp, "UTF-8", NULL, NULL)) != NULL){ p_phrase = tmp; cbglobalgc(tmp, free); } if((tmp = est_iconv(p_attr, -1, rp, "UTF-8", NULL, NULL)) != NULL){ p_attr = tmp; cbglobalgc(tmp, free); } if((tmp = est_iconv(p_attrval, -1, rp, "UTF-8", NULL, NULL)) != NULL){ p_attrval = tmp; cbglobalgc(tmp, free); } if((tmp = est_iconv(p_order, -1, rp, "UTF-8", NULL, NULL)) != NULL){ p_order = tmp; cbglobalgc(tmp, free); } } if(p_navi == NM_ADVANCED){ vlist = cblistopen(); cbglobalgc(vlist, (void (*)(void *))cblistclose); for(i = 0; i <= CONDATTRMAX; i++){ sprintf(numbuf, "attr%d", i); if((rp = cbmapget(params, numbuf, -1, NULL)) != NULL){ while(*rp == ' ' || *rp == '\t'){ rp++; } if(*rp != '\0') cblistpush(vlist, rp, -1); } } tlist = cbsplit(p_attr, -1, "\t"); for(i = 0; i < cblistnum(tlist); i++){ cblistpush(vlist, cblistval(tlist, i, NULL), -1); } cblistclose(tlist); g_attrlist = vlist; } /* read the other files and the database */ if(!g_db){ if(!(tmp = cbreadfile(g_tmplfile, NULL))) showerror("the template file is missing."); cbglobalgc(tmp, free); g_tmpltext = tmp; for(i = 0; i <= LOCKRETRYNUM; i++){ if((g_db = est_db_open(g_indexname, ESTDBREADER | (g_lockindex ? ESTDBLCKNB : ESTDBNOLCK), &ecode)) != NULL) break; if(ecode != ESTELOCK) showerror("the index is missing or broken."); est_usleep(1000 * 1000); } if(!g_db) showerror("the index is being updated now."); cbglobalgc(g_db, (void (*)(void *))myestdbclose); for(i = 0; i < cblistnum(plist); i++){ est_db_add_pseudo_index(g_db, cblistval(plist, i, NULL)); } if(g_spcache[0] != '\0') est_db_set_special_cache(g_db, g_spcache, SPCACHEMNUM); est_db_set_wildmax(g_db, g_wildmax); } if(p_phrase[0] == '\0' || p_detail > 0) g_scancheck = 0; setsimilarphrase(); /* show the page */ showpage(); /* output the log message */ outputlog(); return 0; } /* show the error page and exit */ static void showerror(const char *msg){ printf("Status: 500 Internal Server Error\r\n"); printf("Content-Type: text/plain; charset=UTF-8\r\n"); printf("\r\n"); printf("Error: %s\n", msg); exit(1); } /* skip the label of a line */ static const char *skiplabel(const char *str){ if(!(str = strchr(str, ':'))) return ""; str++; while(*str != '\0' && (*str == ' ' || *str == '\t')){ str++; } return str; } /* get CGI parameters */ static CBMAP *getparameters(void){ int maxlen = 1024 * 1024 * 32; CBMAP *map, *attrs; CBLIST *pairs, *parts; const char *rp, *body; char *buf, *key, *val, *dkey, *dval, *wp, *bound, *fbuf, *aname; int i, len, c, blen, flen; map = cbmapopenex(37); buf = NULL; len = 0; if((rp = getenv("REQUEST_METHOD")) != NULL && !strcmp(rp, "POST") && (rp = getenv("CONTENT_LENGTH")) != NULL && (len = atoi(rp)) > 0){ if(len > maxlen) len = maxlen; buf = cbmalloc(len + 1); for(i = 0; i < len && (c = getchar()) != EOF; i++){ buf[i] = c; } buf[i] = '\0'; if(i != len){ free(buf); buf = NULL; } } else if((rp = getenv("QUERY_STRING")) != NULL){ buf = cbmemdup(rp, -1); len = strlen(buf); } if(buf && len > 0){ if((rp = getenv("CONTENT_TYPE")) != NULL && cbstrfwmatch(rp, "multipart/form-data") && (rp = strstr(rp, "boundary=")) != NULL){ rp += 9; bound = cbmemdup(rp, -1); if((wp = strchr(bound, ';')) != NULL) *wp = '\0'; parts = cbmimeparts(buf, len, bound); for(i = 0; i < cblistnum(parts); i++){ body = cblistval(parts, i, &blen); attrs = cbmapopen(); fbuf = cbmimebreak(body, blen, attrs, &flen); if((rp = cbmapget(attrs, "NAME", -1, NULL)) != NULL){ cbmapput(map, rp, -1, fbuf, flen, FALSE); aname = cbsprintf("%s-filename", rp); if((rp = cbmapget(attrs, "FILENAME", -1, NULL)) != NULL) cbmapput(map, aname, -1, rp, -1, FALSE); free(aname); } free(fbuf); cbmapclose(attrs); } cblistclose(parts); free(bound); } else { pairs = cbsplit(buf, -1, "&"); for(i = 0; i < cblistnum(pairs); i++){ key = cbmemdup(cblistval(pairs, i, NULL), -1); if((val = strchr(key, '=')) != NULL){ *(val++) = '\0'; dkey = cburldecode(key, NULL); dval = cburldecode(val, NULL); cbmapput(map, dkey, -1, dval, -1, FALSE); free(dval); free(dkey); } free(key); } cblistclose(pairs); } } free(buf); return map; } /* close the database */ static void myestdbclose(ESTDB *db){ int ecode; est_db_close(db, &ecode); } /* output escaped string */ static void xmlprintf(const char *format, ...){ va_list ap; const char *rp; char *tmp, cbuf[32], *ebuf; unsigned char c; int cblen, cnt, mlen; va_start(ap, format); while(*format != '\0'){ if(*format == '%'){ cbuf[0] = '%'; cblen = 1; format++; while(strchr("0123456789 .+-", *format) && *format != '\0' && cblen < sizeof(cbuf) - 1){ cbuf[cblen++] = *format; format++; } cbuf[cblen++] = *format; cbuf[cblen] = '\0'; switch(*format){ case 's': tmp = va_arg(ap, char *); if(!tmp) tmp = "(null)"; printf(cbuf, tmp); break; case 'd': printf(cbuf, va_arg(ap, int)); break; case 'o': case 'u': case 'x': case 'X': case 'c': printf(cbuf, va_arg(ap, unsigned int)); break; case 'e': case 'E': case 'f': case 'g': case 'G': printf(cbuf, va_arg(ap, double)); break; case '@': tmp = va_arg(ap, char *); if(!tmp) tmp = "(null)"; ebuf = NULL; if(cblen > 2){ mlen = atoi(cbuf + 1) * 10; cnt = 0; rp = tmp; while(*rp != '\0'){ if((*rp & 0x80) == 0x00){ cnt += 10; } else if((*rp & 0xe0) == 0xc0){ cnt += 15; } else if((*rp & 0xf0) == 0xe0 || (*rp & 0xf8) == 0xf0){ cnt += 20; } if(cnt > mlen){ ebuf = cbmemdup(tmp, rp - tmp); tmp = ebuf; break; } rp++; } } while(*tmp){ switch(*tmp){ case '&': printf("&"); break; case '<': printf("<"); break; case '>': printf(">"); break; case '"': printf("""); break; default: if(!((*tmp >= 0 && *tmp <= 0x8) || (*tmp >= 0x0e && *tmp <= 0x1f))) putchar(*tmp); break; } tmp++; } if(ebuf){ free(ebuf); printf("..."); } break; case '?': tmp = va_arg(ap, char *); if(!tmp) tmp = "(null)"; while(*tmp){ c = *(unsigned char *)tmp; if((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || (c != '\0' && strchr("_-.", c))){ putchar(c); } else { printf("%%%02X", c); } tmp++; } break; case '$': tmp = va_arg(ap, char *); if(!tmp) tmp = "null"; while(*tmp){ c = *(unsigned char *)tmp; if((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9')) putchar(c); tmp++; } break; case '%': putchar('%'); break; } } else { putchar(*format); } format++; } va_end(ap); } /* set the phrase for similarity search */ static void setsimilarphrase(void){ ESTDOC *doc; CBMAP *svmap; CBDATUM *datum; const char *kbuf, *vbuf; char *ptr; int ksiz, vsiz; if(!cbstrfwimatch(p_phrase, ESTOPSIMILAR) && p_similar < 1) return; g_scancheck = 0; if(g_smlrvnum < 1){ p_phrase = ""; return; } if(p_similar < 1) return; svmap = est_db_get_keywords(g_db, p_similar); if(!svmap && (doc = est_db_get_doc(g_db, p_similar, 0)) != NULL){ svmap = est_db_etch_doc(g_dotfidf ? g_db : NULL, doc, g_smlrvnum); est_doc_delete(doc); } else if(!svmap){ return; } datum = cbdatumopen(ESTOPSIMILAR " ", -1); cbdatumcat(datum, g_smlrtune, -1); cbmapiterinit(svmap); while((kbuf = cbmapiternext(svmap, &ksiz)) != NULL){ vbuf = cbmapget(svmap, kbuf, ksiz, &vsiz); cbdatumcat(datum, " WITH ", -1); cbdatumcat(datum, vbuf, vsiz); cbdatumcat(datum, " ", 1); cbdatumcat(datum, kbuf, ksiz); } ptr = cbdatumtomalloc(datum, NULL); cbglobalgc(ptr, free); p_phrase = ptr; cbmapclose(svmap); } /* show the page */ static void showpage(void){ KEYSC *scores; ESTCOND *cond; ESTDOC **docs; CBMAP *hints, *allkwd, *dockwd; CBLIST *elems; CBDATUM *datum; const char *rp, *pv, *vbuf; char *tmp, numbuf[NUMBUFSIZ]; int i, tnum, max, *res, rnum, hits, sc, dnum, miss, check, len, scnum; printf("Cache-Control: no-cache, must-revalidate, no-transform\r\n"); printf("Pragma: no-cache\r\n"); printf("Content-Disposition: inline; filename=%s\r\n", g_scriptname); printf("Content-Type: text/html; charset=UTF-8\r\n"); printf("\r\n"); g_etime = est_gettimeofday(); g_tabidx = 0; cond = est_cond_new(); if(g_qxpndcmd[0] != '\0' && p_qxpnd) est_cond_set_expander(cond, expandquery); if(!strcmp(p_attr, "_fpath_")){ if(p_phrase[0] != '\0'){ tmp = cbsprintf(DATTRLREAL " ISTRINC %s", p_phrase); est_cond_add_attr(cond, tmp); free(tmp); } g_scancheck = 0; } else if(!strcmp(p_attr, "_subj_")){ if(p_phrase[0] != '\0'){ tmp = cbsprintf("subject ISTRINC %s", p_phrase); est_cond_add_attr(cond, tmp); free(tmp); } g_scancheck = 0; } else if(!strcmp(p_attr, "_from_")){ if(p_phrase[0] != '\0'){ tmp = cbsprintf("from ISTRINC %s", p_phrase); est_cond_add_attr(cond, tmp); free(tmp); } g_scancheck = 0; } else if(!strcmp(p_attr, "_toc_")){ if(p_phrase[0] != '\0'){ tmp = cbsprintf("to,cc ISTRINC %s", p_phrase); est_cond_add_attr(cond, tmp); free(tmp); } g_scancheck = 0; } else if(!strcmp(p_attr, "_titleB_")){ if(p_phrase[0] != '\0'){ tmp = cbsprintf("@title ISTRBW %s", p_phrase); est_cond_add_attr(cond, tmp); free(tmp); } g_scancheck = 0; } else if(!strcmp(p_attr, "_titleI_")){ if(p_phrase[0] != '\0'){ tmp = cbsprintf("@title ISTRINC %s", p_phrase); est_cond_add_attr(cond, tmp); free(tmp); } g_scancheck = 0; } else { if(p_phrase[0] != '\0') est_cond_set_phrase(cond, p_phrase); if(g_attrlist){ for(i = 0; i < cblistnum(g_attrlist); i++){ est_cond_add_attr(cond, cblistval(g_attrlist, i, NULL)); } } else if(p_attr[0] != '\0'){ if(p_attrval[0] != '\0'){ tmp = cbsprintf("%s %s", p_attr, p_attrval); est_cond_add_attr(cond, tmp); free(tmp); } else { est_cond_add_attr(cond, p_attr); } } } if(cblistnum(g_genrechecks) > 0){ for(i = 0; i < cblistnum(g_genrechecks); i++){ if(!(p_gmasks & (1 << i))){ datum = cbdatumopen("@genre STROREQ", -1); for(i = 0; i < cblistnum(g_genrechecks); i++){ if(p_gmasks & (1 << i)){ rp = cblistval(g_genrechecks, i, NULL); cbdatumcat(datum, " ", 1); if((pv = strstr(rp, "{{!}}")) != NULL){ cbdatumcat(datum, rp, pv - rp); } else { cbdatumcat(datum, rp, -1); } } } est_cond_add_attr(cond, cbdatumptr(datum)); cbdatumclose(datum); break; } } } if(!strcmp(p_order, "_date_")){ est_cond_set_order(cond, ESTDATTRMDATE " " ESTORDNUMD); } else if(!strcmp(p_order, "_size_")){ est_cond_set_order(cond, ESTDATTRSIZE " " ESTORDNUMD); } else if(p_order[0] != '\0'){ est_cond_set_order(cond, p_order); } switch(g_condgstep){ case 1: est_cond_set_options(cond, ESTCONDSURE); break; case 2: est_cond_set_options(cond, ESTCONDUSUAL); break; case 3: est_cond_set_options(cond, ESTCONDFAST); break; case 4: est_cond_set_options(cond, ESTCONDAGITO); break; } if(!g_dotfidf) est_cond_set_options(cond, ESTCONDNOIDF); switch(g_phraseform){ case 2: est_cond_set_options(cond, ESTCONDSIMPLE); break; case 3: est_cond_set_options(cond, ESTCONDROUGH); break; case 4: est_cond_set_options(cond, ESTCONDUNION); break; case 5: est_cond_set_options(cond, ESTCONDISECT); break; } if(g_showscore) est_cond_set_options(cond, ESTCONDSCFB); est_cond_set_auxiliary(cond, p_prec ? -1 : (g_auxmin > p_perpage * 1.3 + 1 ? g_auxmin : p_perpage * 1.3 + 1)); if(p_clip > 0) est_cond_set_eclipse(cond, p_clip / 10.0 + (p_clip <= 10 ? g_clipweight: 0)); tnum = 0; max = p_pagenum * p_perpage * 1.3 + 1; hits = 0; do { est_cond_set_max(cond, max); hints = cbmapopenex(MINIBNUM); res = est_db_search(g_db, cond, &rnum, hints); hits = (rp = cbmapget(hints, "", 0, NULL)) ? atoi(rp) : rnum; if(g_candetail && p_detail > 0){ if(rnum < 1) cbmapput(hints, "", 0, "1", 1, TRUE); free(res); res = cbmalloc(sizeof(int)); res[0] = p_detail; rnum = 1; } docs = cbmalloc(rnum * sizeof(ESTDOC *) + 1); dnum = 0; miss = 0; check = p_phrase[0] == '\0' || p_phrase[0] == '[' || p_phrase[0] == '*' ? 0 : g_scancheck; for(i = 0; i < rnum; i++){ docs[dnum] = est_db_get_doc(g_db, res[i], dnum < p_pagenum * p_perpage || check > 0 ? 0 : ESTGDNOATTR | ESTGDNOTEXT | ESTGDNOKWD); if(!docs[dnum]){ miss++; continue; } if(check > 0 && !est_db_scan_doc(g_db, docs[dnum], cond)){ est_doc_delete(docs[dnum]); miss++; continue; } if((sc = est_cond_score(cond, i)) >= 0){ sprintf(numbuf, "%d", sc); est_doc_add_attr(docs[dnum], DATTRSCORE, numbuf); } dnum++; check--; } if((tnum <= MISSRETRYNUM && miss > 0 && max <= rnum && dnum < p_pagenum * p_perpage + 1) || (p_pagenum == 1 && tnum == 0 && (hits < g_auxmin || hits < p_perpage) && est_cond_auxiliary_word(cond, ""))){ for(i = 0; i < dnum; i++){ est_doc_delete(docs[i]); } free(docs); free(res); cbmapclose(hints); max *= MISSINCRATIO; if(p_pagenum == 1) est_cond_set_auxiliary(cond, -1); tnum++; continue; } break; } while(TRUE); if(g_relkeynum > 0){ allkwd = cbmapopenex(MINIBNUM); for(i = 0; i < dnum; i++){ if(!(dockwd = est_doc_keywords(docs[i]))) continue; cbmapiterinit(dockwd); while((rp = cbmapiternext(dockwd, &len)) != NULL){ sc = ((vbuf = cbmapget(allkwd, rp, len, NULL)) != NULL ? atoi(vbuf) : 0) + pow((atoi(cbmapget(dockwd, rp, len, NULL)) + 100) * 10, 0.7); sprintf(numbuf, "%d", sc); cbmapput(allkwd, rp, len, numbuf, -1, TRUE); } } scores = cbmalloc(cbmaprnum(allkwd) * sizeof(KEYSC) + 1); scnum = 0; cbmapiterinit(allkwd); while((rp = cbmapiternext(allkwd, &len)) != NULL){ scores[scnum].word = rp; scores[scnum].pt = atoi(cbmapget(allkwd, rp, len, NULL)); scnum++; } qsort(scores, scnum, sizeof(KEYSC), keysc_compare); } else { allkwd = NULL; scores = NULL; scnum = 0; } g_etime = est_gettimeofday() - g_etime; elems = cbxmlbreak(g_tmpltext, FALSE); for(i = 0; i < cblistnum(elems); i++){ rp = cblistval(elems, i, NULL); if(!strcmp(rp, "")){ showtitle(); } else if(!strcmp(rp, "")){ switch(g_formtype){ default: showformnormal(); break; case FT_WEB: showformforweb(); break; case FT_FILE: showformforfile(); break; case FT_MAIL: showformformail(); break; } } else if(!strcmp(rp, "")){ if(p_phrase[0] == '\0' && p_attr[0] == '\0' && p_detail < 1){ showtop(); } else { showresult(docs, dnum, hints, cond, hits, miss, scores, scnum); } } else if(!strcmp(rp, "")){ showinfo(); } else { printf("%s", rp); } } for(i = 0; i < dnum; i++){ est_doc_delete(docs[i]); } cblistclose(elems); if(scores) free(scores); if(allkwd) cbmapclose(allkwd); free(docs); free(res); cbmapclose(hints); est_cond_delete(cond); } /* show the page title */ static void showtitle(void){ if(*p_phrase != '\0'){ xmlprintf("Search Result: %48@", p_phrase); } else if(*p_attr != '\0'){ xmlprintf("Search Result: %48@", p_attr); } else { xmlprintf("%@", g_deftitle); } } /* show the navigation form */ static void shownaviform(void){ xmlprintf("
    \n"); if(p_navi == NM_ADVANCED){ xmlprintf("advanced\n"); } else { xmlprintf("advanced\n", g_scriptname, NM_ADVANCED); } if(p_navi == NM_HELP){ xmlprintf("help\n"); } else { xmlprintf("help\n", g_scriptname, NM_HELP); } xmlprintf("
    \n"); } /* show the per page form */ static void showperpageform(const char *onchange){ const char *rp; int i, start, end, step; start = atoi(g_perpage); if((rp = strchr(g_perpage, ' ')) != NULL || (rp = strchr(g_perpage, '\t')) != NULL){ while(*rp == ' ' || *rp == '\t'){ rp++; } end = atoi(rp); if((rp = strchr(rp, ' ')) != NULL || (rp = strchr(rp, '\t')) != NULL){ while(*rp == ' ' || *rp == '\t'){ rp++; } step = atoi(rp); } else { step = start; } } else { end = start * 10; step = start; } xmlprintf("\n"); } /* show the clip form */ static void showclipform(const char *onchange){ int i; xmlprintf("\n"); } /* show the genre form */ static void showgenreform(void){ const char *rp, *pv; int i; for(i = 0; i < cblistnum(g_genrechecks); i++){ rp = cblistval(g_genrechecks, i, NULL); if((pv = strstr(rp, "{{!}}")) != NULL) rp = pv + 5; xmlprintf("", i + 1, p_gmasks & (1 << i) ? " checked=\"checked\"" : "", i + 1, ++g_tabidx); xmlprintf("\n", i + 1, rp); } } /* show the advanced form */ static void showadvancedform(void){ const char *rp; int i; xmlprintf("
    \n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); for(i = 0; i < 3; i++){ xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); } xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); if(cblistnum(g_genrechecks) > 0){ xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); } xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("
    phrase:\n"); xmlprintf("\n", p_phrase, ++g_tabidx); xmlprintf("
    attribute:\n"); if(!(rp = cblistval(g_attrlist, i, NULL))) rp = ""; xmlprintf("\n", i, rp, i, ++g_tabidx, i); xmlprintf("
    order:\n"); xmlprintf("\n", p_order, ++g_tabidx); xmlprintf("
    genre:\n"); showgenreform(); xmlprintf("
    per page:\n"); showperpageform(NULL); xmlprintf("
    clip:\n"); showclipform(NULL); xmlprintf("
    action:\n"); xmlprintf("\n", ++g_tabidx); xmlprintf("\n", ++g_tabidx); xmlprintf("
    \n"); xmlprintf("\n"); xmlprintf("\n", p_navi); xmlprintf("\n"); xmlprintf("
    \n"); } /* show the normal form */ static void showformnormal(void){ xmlprintf("
    \n"); xmlprintf("
    \n", g_scriptname); shownaviform(); if(p_navi == NM_ADVANCED){ showadvancedform(); } else { xmlprintf("
    \n"); xmlprintf("\n", p_phrase, ++g_tabidx); xmlprintf("\n", ++g_tabidx); xmlprintf("
    \n"); xmlprintf("
    \n"); showperpageform(NULL); xmlprintf("per page,\n"); if(g_attrselect){ xmlprintf("with\n"); xmlprintf("\n"); xmlprintf("\n", p_attrval, ++g_tabidx); xmlprintf(", order by\n"); xmlprintf("\n"); } else { xmlprintf("with\n"); xmlprintf("\n", p_attr, ++g_tabidx); xmlprintf(", order by\n"); xmlprintf("\n", p_order, ++g_tabidx); } if(g_clipview >= 0){ xmlprintf(", clip by\n"); showclipform(NULL); } if(g_qxpndcmd[0] != '\0'){ xmlprintf(", expansion:\n"); xmlprintf("\n", p_qxpnd ? " checked=\"checked\"" : "", ++g_tabidx); } xmlprintf("\n"); xmlprintf("\n", p_navi); xmlprintf("\n"); xmlprintf("
    \n"); if(cblistnum(g_genrechecks) > 0){ xmlprintf("
    \n"); showgenreform(); xmlprintf("
    \n"); } } xmlprintf("
    \n"); xmlprintf("
    \n"); } /* show the form for web site */ static void showformforweb(void){ xmlprintf("
    \n"); xmlprintf("
    \n", g_scriptname); shownaviform(); if(p_navi == NM_ADVANCED){ showadvancedform(); } else { xmlprintf("
    \n"); xmlprintf("\n"); xmlprintf("phrase:\n"); xmlprintf("\n", p_phrase, ++g_tabidx); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("max:\n"); showperpageform("changemax();"); xmlprintf("\n"); if(g_clipview >= 0){ xmlprintf("\n"); xmlprintf("clip:\n"); showclipform("changeclip();"); xmlprintf("\n"); } xmlprintf("
    \n"); xmlprintf("
    \n"); xmlprintf("\n"); xmlprintf("target:\n"); xmlprintf("\n", p_attr[0] == '\0' ? " abutton" : "", ++g_tabidx); xmlprintf("\n", !strcmp(p_attr, "_titleB_") ? " abutton" : "", ++g_tabidx); xmlprintf("\n", !strcmp(p_attr, "_titleI_") ? " abutton" : "", ++g_tabidx); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("order:\n"); xmlprintf("\n", p_order[0] == '\0' ? " abutton" : "", ++g_tabidx); xmlprintf("\n", !strcmp(p_order, "_date_") ? " abutton" : "", ++g_tabidx); xmlprintf("\n", !strcmp(p_order, "_size_") ? " abutton" : "", ++g_tabidx); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n", p_navi); xmlprintf("\n", p_attr); xmlprintf("\n", p_order); xmlprintf("\n"); xmlprintf("
    \n"); if(cblistnum(g_genrechecks) > 0){ xmlprintf("
    \n"); xmlprintf("\n"); xmlprintf("genre:\n"); showgenreform(); xmlprintf("\n"); xmlprintf("
    \n"); } } xmlprintf("
    \n"); xmlprintf("
    \n"); } /* show the form for file system */ static void showformforfile(void){ xmlprintf("
    \n"); xmlprintf("
    \n", g_scriptname); shownaviform(); if(p_navi == NM_ADVANCED){ showadvancedform(); } else { xmlprintf("
    \n"); xmlprintf("\n"); xmlprintf("phrase:\n"); xmlprintf("\n", p_phrase, ++g_tabidx); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("max:\n"); showperpageform("changemax();"); xmlprintf("\n"); if(g_clipview >= 0){ xmlprintf("\n"); xmlprintf("clip:\n"); showclipform("changeclip();"); xmlprintf("\n"); } xmlprintf("
    \n"); xmlprintf("
    \n"); xmlprintf("\n"); xmlprintf("target:\n"); xmlprintf("\n", p_attr[0] == '\0' ? " abutton" : "", ++g_tabidx); xmlprintf("\n", p_attr[0] != '\0' ? " abutton" : "", ++g_tabidx); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("order:\n"); xmlprintf("\n", p_order[0] == '\0' ? " abutton" : "", ++g_tabidx); xmlprintf("\n", !strcmp(p_order, "_date_") ? " abutton" : "", ++g_tabidx); xmlprintf("\n", !strcmp(p_order, "_size_") ? " abutton" : "", ++g_tabidx); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n", p_navi); xmlprintf("\n", p_attr); xmlprintf("\n", p_order); xmlprintf("\n"); xmlprintf("
    \n"); if(cblistnum(g_genrechecks) > 0){ xmlprintf("
    \n"); xmlprintf("\n"); xmlprintf("genre:\n"); showgenreform(); xmlprintf("\n"); xmlprintf("
    \n"); } } xmlprintf("
    \n"); xmlprintf("
    \n"); } /* show the form for mail box */ static void showformformail(void){ xmlprintf("
    \n"); xmlprintf("
    \n", g_scriptname); shownaviform(); if(p_navi == NM_ADVANCED){ showadvancedform(); } else { xmlprintf("
    \n"); xmlprintf("\n"); xmlprintf("phrase:\n"); xmlprintf("\n", p_phrase, ++g_tabidx); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("max:\n"); showperpageform("changemax();"); xmlprintf("\n"); if(g_clipview >= 0){ xmlprintf("\n"); xmlprintf("clip:\n"); showclipform("changeclip();"); xmlprintf("\n"); } xmlprintf("
    \n"); xmlprintf("
    \n"); xmlprintf("\n"); xmlprintf("target:\n"); xmlprintf("\n", p_attr[0] == '\0' ? " abutton" : "", ++g_tabidx); xmlprintf("\n", !strcmp(p_attr, "_subj_") ? " abutton" : "", ++g_tabidx); xmlprintf("\n", !strcmp(p_attr, "_from_") ? " abutton" : "", ++g_tabidx); xmlprintf("\n", !strcmp(p_attr, "_toc_") ? " abutton" : "", ++g_tabidx); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("order:\n"); xmlprintf("\n", p_order[0] == '\0' ? " abutton" : "", ++g_tabidx); xmlprintf("\n", !strcmp(p_order, "_date_") ? " abutton" : "", ++g_tabidx); xmlprintf("\n", !strcmp(p_order, "_size_") ? " abutton" : "", ++g_tabidx); xmlprintf("\n"); xmlprintf("\n"); xmlprintf("\n", p_navi); xmlprintf("\n", p_attr); xmlprintf("\n", p_order); xmlprintf("\n"); xmlprintf("
    \n"); if(cblistnum(g_genrechecks) > 0){ xmlprintf("
    \n"); xmlprintf("\n"); xmlprintf("genre:\n"); showgenreform(); xmlprintf("\n"); xmlprintf("
    \n"); } } xmlprintf("
    \n"); xmlprintf("
    \n"); } /* show the top message */ static void showtop(void){ const char *path; char *text; if(p_navi == NM_ADVANCED) return; path = p_navi == NM_HELP ? g_helpfile : g_topfile; if((text = cbreadfile(path, NULL)) != NULL){ printf("%s", text); free(text); } else { xmlprintf("

    The file \"%@\" is not found.

    \n", path); } } /* perform query expansion */ static void expandquery(const char *word, CBLIST *result){ CBLIST *words; const char *tmpdir; char oname[PATH_MAX], cmd[PATH_MAX], *ebuf; int i; cblistpush(result, word, -1); tmpdir = getenv("TMP"); if(!tmpdir) tmpdir = getenv("TEMP"); if(!tmpdir) tmpdir = ESTPATHSTR "tmp"; sprintf(oname, "%s%c%s.%08d", tmpdir, ESTPATHCHR, g_scriptname, (int)getpid()); sprintf(cmd, "%s > %s", g_qxpndcmd, oname); ebuf = cbsprintf("ESTWORD=%s", word); putenv(ebuf); system(cmd); free(ebuf); if((words = cbreadlines(oname)) != NULL){ for(i = 0; i < cblistnum(words); i++){ word = cblistval(words, i, NULL); if(word[0] != '\0') cblistpush(result, word, -1); } cblistclose(words); } unlink(oname); } /* compare two keywords by scores in descending order */ static int keysc_compare(const void *ap, const void *bp){ return ((KEYSC *)bp)->pt - ((KEYSC *)ap)->pt; } /* show the result */ static void showresult(ESTDOC **docs, int dnum, CBMAP *hints, ESTCOND *cond, int hits, int miss, KEYSC *scores, int scnum){ CBMAP *cnames; CBLIST *words; CBDATUM *abuf; const char *myphrase, *kbuf; char cname[NUMBUFSIZ], *myattr; const int *ary; int i, ksiz, snum, start, end, cnum, clip, anum, pnum; myphrase = p_similar > 0 ? "" : p_phrase; if(g_attrlist){ abuf = cbdatumopen(NULL, -1); for(i = 0; i < cblistnum(g_attrlist); i++){ if(i > 0) cbdatumcat(abuf, "\t", 1); cbdatumcat(abuf, cblistval(g_attrlist, i, NULL), -1); } myattr = cbdatumtomalloc(abuf, NULL); } else { myattr = cbmemdup(p_attr, -1); } xmlprintf("
    \n"); hits -= miss; g_hnum = hits; start = (p_pagenum - 1) * p_perpage; end = p_pagenum * p_perpage; if(end > dnum) end = dnum; xmlprintf("
    "); xmlprintf("Results of %d - %d", start + (hits > 0 ? 1 : 0), end); xmlprintf(" of about %d", hits); if(est_cond_auxiliary_word(cond, "")) xmlprintf(" or more"); if(p_phrase[0] != '\0') xmlprintf(" for %48@", p_phrase); if(g_etime > 0.0) xmlprintf(" (%.3f sec.)", g_etime / 1000.0); if(miss > p_perpage * p_pagenum) xmlprintf("*"); xmlprintf("
    \n"); if(cbmaprnum(hints) > 2 || (p_phrase[0] != '\0' && myattr[0] != '\0')){ xmlprintf("
    "); cbmapiterinit(hints); i = 0; while((kbuf = cbmapiternext(hints, &ksiz)) != NULL){ if(ksiz < 1) continue; if(i++ > 0) xmlprintf(", "); xmlprintf("%@ (%@%@)", kbuf, cbmapget(hints, kbuf, ksiz, NULL), est_cond_auxiliary_word(cond, kbuf) ? "+" : ""); } xmlprintf("
    \n"); } if(scores && scnum > 0){ xmlprintf("
    Related terms: "); for(i = 0; i < scnum && i < g_relkeynum; i++){ if(i > 0) xmlprintf(", "); xmlprintf("%@", g_scriptname, p_navi, scores[i].word, myattr, p_attrval, p_order, p_perpage, p_clip, p_qxpnd, p_gmasks, p_prec, scores[i].word); } xmlprintf("
    \n"); } words = est_hints_to_words(hints); cnames = cbmapopenex(MINIBNUM); cnum = 0; for(i = 0; i < cblistnum(words); i++){ sprintf(cname, "key%d", ++cnum); cbmapput(cnames, cblistval(words, i, NULL), -1, cname, -1, FALSE); } clip = 0; if(p_clip > 0){ for(i = 0; i < start && i < dnum; i++){ est_cond_shadows(cond, est_doc_id(docs[i]), &anum); hits -= anum / 2; } } for(snum = start; snum < end; snum++){ ary = est_cond_shadows(cond, est_doc_id(docs[snum]), &anum); showdoc(docs[snum], words, cnames, g_candetail && p_detail > 0, ary, anum, &clip); hits -= anum / 2; } cbmapclose(cnames); cblistclose(words); if(dnum < 1) xmlprintf("

    Your search did not match any documents.

    \n"); xmlprintf("
    \n"); if(clip > 0) xmlprintf("" "Include %d Clipped\n", g_scriptname, p_navi, myphrase, myattr, p_attrval, p_order, p_perpage, p_clip, p_qxpnd, p_gmasks, p_prec, p_pagenum, p_similar, clip); if(p_pagenum > 1){ xmlprintf("PREV\n", g_scriptname, p_navi, myphrase, myattr, p_attrval, p_order, p_perpage, p_clip, p_qxpnd, p_gmasks, p_prec, p_pagenum - 1, p_similar); } else { xmlprintf("PREV\n"); } pnum = (hits - 1 - (hits - 1) % p_perpage + p_perpage) / p_perpage; if(hits > 0 && p_detail < 1){ for(i = p_pagenum > NAVIPAGES ? p_pagenum - NAVIPAGES + 1 : 1; i == 1 || (i <= pnum && i < p_pagenum + NAVIPAGES); i++){ if(i == p_pagenum){ printf("%d\n", i); } else { xmlprintf("%d\n", g_scriptname, p_navi, myphrase, myattr, p_attrval, p_order, p_perpage, p_clip, p_qxpnd, p_gmasks, p_prec, i, p_similar, i); } } } if(snum < dnum){ xmlprintf("NEXT\n", g_scriptname, p_navi, myphrase, myattr, p_attrval, p_order, p_perpage, p_clip, p_qxpnd, p_gmasks, p_prec, p_pagenum + 1, p_similar); } else { xmlprintf("NEXT\n"); if(est_cond_auxiliary_word(cond, "")) xmlprintf("Search More Precisely\n", g_scriptname, p_navi, myphrase, myattr, p_attrval, p_order, p_perpage, p_clip, p_qxpnd, p_gmasks, p_similar); } xmlprintf("
    \n"); xmlprintf("
    \n"); free(myattr); } /* show a document */ static void showdoc(ESTDOC *doc, const CBLIST *words, CBMAP *cnames, int detail, const int *shadows, int snum, int *clipp){ ESTDOC *tdoc; CBMAP *kwords; CBLIST *names, *lines; const char *uri, *title, *score, *val, *name, *line, *cname; char *turi, *tsv, *pv, *str, numbuf[NUMBUFSIZ]; int i, id, wwidth, hwidth, awidth; id = est_doc_id(doc); if(g_showlreal){ if(!(uri = est_doc_attr(doc, DATTRLREAL)) && !(uri = est_doc_attr(doc, ESTDATTRURI))) uri = "."; } else { if(!(uri = est_doc_attr(doc, ESTDATTRURI))) uri = "."; } turi = makeshownuri(uri); if(!(title = est_doc_attr(doc, ESTDATTRTITLE))) title = ""; if(title[0] == '\0' && !(title = est_doc_attr(doc, DATTRLFILE))) title = ""; if(title[0] == '\0' && ((pv = strrchr(uri, '/')) != NULL)) title = pv + 1; if(title[0] == '\0') title = "(no title)"; if(!(score = est_doc_attr(doc, DATTRSCORE))) score = ""; xmlprintf("
    \n", id); xmlprintf("
    "); xmlprintf("", turi); sprintf(numbuf, "%%%d@", detail ? 9999 : g_attrwidth); xmlprintf(numbuf, title); xmlprintf(""); if(score[0] != '\0' && p_detail < 1) xmlprintf(" %@", score); xmlprintf("
    \n"); if(detail){ names = est_doc_attr_names(doc); for(i = 0; i < cblistnum(names); i++){ name = cblistval(names, i, NULL); if(name[0] != '_' && strcmp(name, ESTDATTRURI) && strcmp(name, ESTDATTRTITLE) && (val = est_doc_attr(doc, name)) != NULL && val[0] != '\0'){ xmlprintf("
    "); xmlprintf("%@: %@", name, name, val); xmlprintf("
    \n"); } } cblistclose(names); if(g_smlrvnum > 0){ xmlprintf("
    "); xmlprintf("#keywords: "); kwords = est_db_get_keywords(g_db, id); if(!kwords) kwords = est_db_etch_doc(g_db, doc, g_smlrvnum); cbmapiterinit(kwords); for(i = 0; (name = cbmapiternext(kwords, NULL)) != NULL; i++){ if(i > 0) xmlprintf(", "); xmlprintf("%@ (%@)", name, cbmapget(kwords, name, -1, NULL)); } cbmapclose(kwords); xmlprintf(""); xmlprintf("
    \n"); } } else { for(i = 0; i < cblistnum(g_extattrs); i++){ str = cbmemdup(cblistval(g_extattrs, i, NULL), -1); if((pv = strchr(str, '|')) != NULL){ *pv = '\0'; pv++; if((val = est_doc_attr(doc, str)) != NULL && val[0] != '\0'){ xmlprintf("
    "); xmlprintf("%@: ", pv, str); sprintf(numbuf, "%%%d@", g_attrwidth); xmlprintf(numbuf, val); xmlprintf(""); xmlprintf("
    \n"); } } free(str); } } xmlprintf("
    "); if(detail){ wwidth = INT_MAX; hwidth = INT_MAX; awidth = 0; } else if(shadows){ wwidth = g_snipwwidth; hwidth = g_sniphwidth; awidth = g_snipawidth; } else { wwidth = g_snipwwidth * 0.7; hwidth = g_sniphwidth * 0.8; awidth = g_snipawidth * 0.6; } tsv = est_doc_make_snippet(doc, words, wwidth, hwidth, awidth); lines = cbsplit(tsv, -1, "\n"); for(i = 0; i < cblistnum(lines); i++){ line = cblistval(lines, i, NULL); if(line[0] == '\0'){ if(i < cblistnum(lines) - 1) xmlprintf(" ... "); } else if((pv = strchr(line, '\t')) != NULL){ str = cbmemdup(line, pv - line); if(!(cname = cbmapget(cnames, pv + 1, -1, NULL))) cname = "key0"; xmlprintf("%@", cname, str); free(str); } else { xmlprintf("%@", line); } } cblistclose(lines); free(tsv); xmlprintf("
    \n"); xmlprintf("
    \n"); xmlprintf(""); sprintf(numbuf, "%%%d@", detail ? 9999 : g_attrwidth); xmlprintf(numbuf, turi); xmlprintf("\n"); if(*g_dispproxy != '\0'){ if(!strcmp(g_dispproxy, "[URI]")){ xmlprintf("- [display]\n"); } if(g_candetail) xmlprintf("- [detail]\n", g_scriptname, p_navi, p_similar > 0 ? "" : p_phrase, id, p_perpage, p_clip, p_qxpnd, p_gmasks, p_prec); if(g_smlrvnum > 0) xmlprintf("- [similar]\n", g_scriptname, p_navi, id, p_perpage, p_clip, p_qxpnd, p_gmasks, p_prec); if(g_candir){ str = cbmemdup(turi, -1); if((str[0] == '\\' && str[1] == '\\') || (((str[0] >= 'A' && str[1] <= 'Z') || (str[0] >= 'a' && str[1] <= 'z')) && str[1] == ':' && str[2] == '\\')){ if((pv = strrchr(str, '\\')) != NULL) pv[1] = '\0'; } else if((pv = strrchr(str, '/')) != NULL){ pv[1] = '\0'; } xmlprintf("- [dir]\n", str); free(str); } xmlprintf("
    \n"); xmlprintf("
    \n"); if(!detail && shadows && snum > 0){ for(i = 0; i < snum; i += 2){ if(p_cinc >= 0 && p_cinc != id && i >= g_clipview * 2){ xmlprintf("
    \n"); xmlprintf("

    %d more documents clipped ... ", (snum - i) / 2); xmlprintf("" "[include]", g_scriptname, p_navi, p_similar > 0 ? "" : p_phrase, p_attr, p_attrval, p_order, p_perpage, p_clip, p_qxpnd, p_gmasks, id, p_prec, p_pagenum, p_similar, id); xmlprintf("

    \n"); xmlprintf("
    \n"); *clipp += (snum - i) / 2; break; } if(!(tdoc = est_db_get_doc(g_db, shadows[i], 0))) continue; if(g_showscore){ sprintf(numbuf, "%1.3f", shadows[i+1] >= 9999 ? 1.0 : shadows[i+1] / 10000.0); est_doc_add_attr(tdoc, DATTRSCORE, numbuf); } xmlprintf("
    \n"); showdoc(tdoc, words, cnames, FALSE, NULL, 0, NULL); xmlprintf("
    \n"); est_doc_delete(tdoc); } } free(turi); } /* make a URI to be shown */ static char *makeshownuri(const char *uri){ char *turi, *bef, *aft, *pv, *nuri; int i; turi = cbmemdup(uri, -1); for(i = 0; i < cblistnum(g_replexprs); i++){ bef = cbmemdup(cblistval(g_replexprs, i, NULL), -1); if((pv = strstr(bef, "{{!}}")) != NULL){ *pv = '\0'; aft = pv + 5; } else { aft = ""; } nuri = est_regex_replace(turi, bef, aft); free(turi); turi = nuri; free(bef); } return turi; } /* show the top */ static void showinfo(void){ xmlprintf("
    "); xmlprintf("Powered by Hyper Estraier %@, with %d documents and %d words.", _EST_PROJURL, est_version, est_db_doc_num(g_db), est_db_word_num(g_db)); xmlprintf("
    \n"); } /* output the log message */ static void outputlog(void){ FILE *ofp; CBDATUM *condbuf; const char *rp, *pv; char *name, *value; if(g_logfile[0] == '\0' || p_pagenum > 1) return; condbuf = cbdatumopen(NULL, -1); if(*p_phrase != '\0') cbdatumcat(condbuf, p_phrase, -1); if(*p_attr != '\0'){ if(cbdatumsize(condbuf) > 0) cbdatumcat(condbuf, " ", 1); cbdatumcat(condbuf, "{{attr:", -1); cbdatumcat(condbuf, p_attr, -1); cbdatumcat(condbuf, "}}", -1); } if(*p_order != '\0'){ if(cbdatumsize(condbuf) > 0) cbdatumcat(condbuf, " ", 1); cbdatumcat(condbuf, "{{order:", -1); cbdatumcat(condbuf, p_order, -1); cbdatumcat(condbuf, "}}", -1); } if(cbdatumsize(condbuf) < 1 || !(ofp = fopen(g_logfile, "ab"))){ cbdatumclose(condbuf); return; } rp = g_logformat; while(*rp != '\0'){ switch(*rp){ case '\\': if(rp[1] != '\0') rp++; switch(*rp){ case 't': fputc('\t', ofp); break; case 'n': fputc('\n', ofp); break; default: fputc(*rp, ofp); break; } break; case '{': if(cbstrfwmatch(rp, "{cond}")){ pv = cbdatumptr(condbuf); while(*pv != '\0'){ if(*pv > '\0' && *pv < ' '){ fputc(' ', ofp); } else { fputc(*pv, ofp); } pv++; } rp += 5; } else if(cbstrfwmatch(rp, "{time}")){ value = cbdatestrwww(-1, 0); fprintf(ofp, "%s", value); free(value); rp += 5; } else if(cbstrfwmatch(rp, "{hnum}")){ fprintf(ofp, "%d", g_hnum); rp += 5; } else if((pv = strchr(rp, '}')) != NULL){ rp++; name = cbmemdup(rp, pv - rp); value = getenv(name); if(value) fprintf(ofp, "%s", value); free(name); rp = pv; } else { fputc(*rp, ofp); } break; default: fputc(*rp, ofp); break; } rp++; } fclose(ofp); cbdatumclose(condbuf); } /* END OF FILE */ hyperestraier-1.4.13/estseek.conf000066400000000000000000000016601125261632700170100ustar00rootroot00000000000000indexname: casket tmplfile: estseek.tmpl topfile: estseek.top helpfile: estseek.help lockindex: true pseudoindex: replace: ^file:///home/mikio/public_html/{{!}}http://localhost/ replace: /index\.html?${{!}}/ showlreal: false deftitle: Hyper Estraier: a full-text search system for communities formtype: normal perpage: 10 100 10 attrselect: false #genrecheck: private{{!}}private #genrecheck: business{{!}}business #genrecheck: misc{{!}}miscellaneous attrwidth: 80 showscore: true extattr: author|Author extattr: from|From extattr: to|To extattr: cc|Cc extattr: date|Date snipwwidth: 480 sniphwidth: 96 snipawidth: 96 condgstep: 2 dotfidf: true scancheck: 3 phraseform: 2 dispproxy: candetail: true candir: false auxmin: 32 smlrvnum: 32 smlrtune: 16 1024 4096 clipview: 2 clipweight: none relkeynum: 0 spcache: wildmax: 256 qxpndcmd: logfile: logformat: {time}\t{REMOTE_ADDR}:{REMOTE_PORT}\t{cond}\t{hnum}\n hyperestraier-1.4.13/estseek.help000066400000000000000000000121631125261632700170130ustar00rootroot00000000000000

    Help

    What is This?

    This is a full-text search system. You can search for documents including some specified words.

    How to Use

    Input search phrase into the field at the top of the page. For example, if you search for documents including "computer", input the following.

    computer
    

    If you search for documents including both of "network" and "socket", input the following.

    network socket
    

    It is the same as the following.

    network & socket
    

    If you search for documents including "network" followed by "socket", input the following.

    "network socket"
    

    If you search for documents including one or both of "network" and "socket", input the following.

    network | socket
    

    If you search for documents including "network" but without "socket", input the following.

    network ! socket
    

    Note that the priority of "|" is higher than that of space, "&", and "!". So, the following is to search for documents including one of "F1", "F-1", "Formula One", and including one of "champion" and "victory".

    F1 | F-1 | "Formula One" & champion | victory
    

    If you search for documents including some words beginning with "inter", input the following.

    inter*
    

    If you search for documents including some words ending with "sphere", input the following.

    *sphere
    

    If you search for documents matching some words matching regular expressions of "^un.*able$", input the following.

    *^un.*able$*
    

    Search with an Attribute

    If you search for documents whose title includes "introduction", input the following into "with [...]" field.

    @title STRINC introduction
    

    If you want to ignore case, input the following.

    @title ISTRINC introduction
    

    If you search for documents whose size is less than 10000 bytes, input the following.

    @size NUMLT 10000
    

    The following attributes are supported.

    • @uri : the URI (URL)
    • @title : the title, as with "Subject" of mail
    • @author : the name of the author, as with "From" of mail
    • @cdate : the creation date, as with "Date" of mail
    • @mdate : the modification date, as with "Date" of mail
    • @size : the size (file size)

    The following operators for attributes are supported.

    • STREQ : is equal to the string
    • STRNE : is not equal to the string
    • STRINC : includes the string
    • STRBW : begins with the string
    • STREW : ends with the string
    • STRAND : includes all tokens in the string
    • STROR : includes at least one token in the string
    • STROREQ : is equal to at least one token in the string
    • STRRX : matches regular expressions of the string
    • NUMEQ : is equal to the number or date
    • NUMNE : is not equal to the number or date
    • NUMGT : is greater than the number or date
    • NUMGE : is greater than or equal to the number or date
    • NUMLT : is less than the number or date
    • NUMLE : is less than or equal to the number or date
    • NUMBT : is between the two numbers or dates

    If an operator is leaded by "!", the meaning is inverted. If an operator is leaded by "I", case of the value is ignored. If no operator is specified, all documents with the attribute correspond regardless of the value. STRAND, STROR, STROREQ, and NUMBT take plural parameters separated by space. Range of NUMBT is inclusive of border values. Two or more attribute names can be listed with separated by "," to mean logical addition.

    Order of the Result

    By default, the order of the result is descending by score. If you want ascending order of title, input the following into the "order by [...]" field.

    @title STRA
    

    If you want descending order of the size, input the following.

    @size NUMD
    

    The following operators for order are supported.

    • STRA : ascending by string
    • STRD : descending by string
    • NUMA : ascending by number or date
    • NUMD : descending by number or date

    Other Faculties

    "[...] per page" specifies the number of shown documents per page. If documents over one page correspond, you can move to another page via anchors of "PREV" and "NEXT" at the bottom of the page.

    "clip by [...]" specifies strength of clipping similar documents. It is useful if too similar documents occupy the page.

    Each of "[detail]" links in the result is to show detail information. Each of "[similar]" links in the result is to search for similar documents. Each of "[include]" links in the result is to include clipped documents.

    Information

    See the project site for more detail.

    hyperestraier-1.4.13/estseek.tmpl000066400000000000000000000150541125261632700170410ustar00rootroot00000000000000 <!--ESTTITLE--> hyperestraier-1.4.13/estseek.top000066400000000000000000000002051125261632700166570ustar00rootroot00000000000000 hyperestraier-1.4.13/estsupt.c000066400000000000000000000622021125261632700163500ustar00rootroot00000000000000/************************************************************************************************* * A union meta searcher of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #if defined(MYFCGI) #include #endif #include "estraier.h" #include "estnode.h" #include "myconf.h" #define CONFSUFFIX ".conf" /* suffix of the configuration file */ #define CACHESUFFIX ".ecc" /* suffix of temporary files */ #define NUMBUFSIZ 32 /* size of a buffer for a number */ #define OUTBUFSIZ 262144 /* size of the output buffer */ #define MINIBNUM 31 /* bucket number of map for trivial use */ #define CONDPHRASEMAX 9 /* maximum number of phrase conditions */ #define CONDATTRMAX 9 /* maximum number of attribute conditions */ #define SEARCHMAX 10 /* maximum number of shown documents */ #define CCPURGEFREQ 512 /* frequency of purging temporary files */ typedef struct { /* type of structure for a search thread */ const char *url; /* target URL */ CBMAP *rmap; /* result object */ int hnum; /* number of corresponding documents */ int alive; /* whether to be alive */ } TARGSRCH; /* global variables for configurations */ int g_runcnt = 0; /* count of running */ const char *g_conffile = NULL; /* path of the configuration file */ const CBLIST *g_targetlist = NULL; /* list of real indexes */ int g_stmode = FALSE; /* whether to be single thread mode */ int g_score = -1; /* scoring method when logical operation */ const char *g_tmpdir = NULL; /* path of the directory for temporary files */ int g_cclife = 0; /* lifetime of cache files */ const CBLIST *g_sharelist = NULL; /* list of cache sharing hosts */ const char *g_failfile = NULL; /* path of the fail rate file */ const char *g_logfile = NULL; /* path of the log file */ const char *g_logformat = NULL; /* format of the log */ /* global variables for parameters */ const char *p_querykey = ""; /* unique key for the query string */ const char *p_shareurl = ""; /* URL of shared cache */ const CBLIST *p_phraselist = NULL; /* list of phrase conditions */ const CBLIST *p_attrlist = NULL; /* list of attribute conditions */ const char *p_distinct = NULL; /* name of distinction attribute */ int p_max = -1; /* number of output documents */ int p_fresh = FALSE; /* whether to retrieve fresh result */ int p_stmode = FALSE; /* whether to be single thread mode */ const char *p_cache = ""; /* key of read cache */ const char *p_logmsg = ""; /* additional log message */ /* other global variables */ char g_outbuf[OUTBUFSIZ]; /* output buffer */ const char *g_scriptname = NULL; /* name of the script */ const char *g_scripturl = NULL; /* URL of the script */ int g_hnum = 0; /* number of corresponding documents */ int g_cache = FALSE; /* whether cache was used */ int g_error = FALSE; /* whether an error has occured */ double g_speed = 0.0; /* speed of response */ /* function prototypes */ int main(int argc, char **argv); static int realmain(int argc, char **argv); static void showerror(const char *msg); static const char *skiplabel(const char *str); static void savecache(const char *key); static CBMAP *getparameters(void); static char *myencode(const char *str); static void showcache(void); static void showresult(void); static void *procsearch(void *targ); static void outputlog(void); /* main routine */ int main(int argc, char **argv){ #if defined(MYFCGI) est_proc_env_reset(); est_init_net_env(); while(FCGI_Accept() >= 0){ g_runcnt++; p_querykey = ""; p_shareurl = ""; p_phraselist = NULL; p_attrlist = NULL; p_max = -1; p_distinct = NULL; p_fresh = FALSE; p_stmode = FALSE; p_cache = ""; p_logmsg = ""; g_scripturl = NULL; g_hnum = 0; g_cache = FALSE; g_error = FALSE; g_speed = 0.0; realmain(argc, argv); fflush(stdout); } est_free_net_env(); return 0; #else int rv; est_proc_env_reset(); est_init_net_env(); rv = realmain(argc, argv); est_free_net_env(); return rv; #endif } /* main routine */ static int realmain(int argc, char **argv){ CBLIST *lines, *tlist, *slist, *plist, *alist; CBMAP *params; const char *rp; char *tmp, *wp, numbuf[NUMBUFSIZ]; int i, len; double failrate; /* set configurations */ setvbuf(stdout, g_outbuf, _IOFBF, OUTBUFSIZ); g_scriptname = argv[0]; if((rp = getenv("SCRIPT_NAME")) != NULL){ g_scriptname = rp; if((rp = getenv("HTTP_HOST")) != NULL){ tmp = cbsprintf("http://%s%s", rp, g_scriptname); cbglobalgc(tmp, free); g_scripturl = tmp; } } if((rp = strrchr(g_scriptname, '/')) != NULL) g_scriptname = rp + 1; tmp = cbmalloc(strlen(g_scriptname) + strlen(CONFSUFFIX) + 1); sprintf(tmp, "%s", g_scriptname); cbglobalgc(tmp, free); if(!(wp = strrchr(tmp, '.'))) wp = tmp + strlen(tmp); sprintf(wp, "%s", CONFSUFFIX); g_conffile = tmp; if(!(lines = cbreadlines(g_conffile))) showerror("the configuration file is missing."); cbglobalgc(lines, (void (*)(void *))cblistclose); tlist = cblistopen(); cbglobalgc(tlist, (void (*)(void *))cblistclose); slist = cblistopen(); cbglobalgc(slist, (void (*)(void *))cblistclose); for(i = 0; i < cblistnum(lines); i++){ rp = cblistval(lines, i, NULL); if(cbstrfwimatch(rp, "targeturl:")){ rp = skiplabel(rp); if(*rp != '\0') cblistpush(tlist, rp, -1); } else if(cbstrfwimatch(rp, "stmode:")){ g_stmode = atoi(skiplabel(rp)) > 0; } else if(cbstrfwimatch(rp, "score:")){ g_score = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "failfile:")){ g_failfile = skiplabel(rp); } else if(cbstrfwimatch(rp, "tmpdir:")){ g_tmpdir = skiplabel(rp); } else if(cbstrfwimatch(rp, "cclife:")){ g_cclife = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "shareurl:")){ rp = skiplabel(rp); if(*rp != '\0') cblistpush(slist, rp, -1); } else if(cbstrfwimatch(rp, "logfile:")){ g_logfile = skiplabel(rp); } else if(cbstrfwimatch(rp, "logformat:")){ g_logformat = skiplabel(rp); } } if(cblistnum(tlist) < 1) showerror("targeturl is undefined."); g_targetlist = tlist; if(g_score < 0) showerror("score is undefined."); if(!g_failfile) showerror("failfile is undefined."); if(!g_tmpdir) showerror("tmpdir is undefined."); g_sharelist = slist; if(!g_logfile) showerror("logfile is undefined."); if(!g_logformat) showerror("logformat is undefined."); if(*g_failfile != '\0' && (tmp = cbreadfile(g_failfile, NULL)) != NULL){ failrate = strtod(tmp, NULL); free(tmp); } else { failrate = 0.0; } if(failrate > 0.0 && failrate > est_random()){ /* show failure */ printf("Status: 503 Service Unavailable\r\n"); printf("Content-Type: text/plain\r\n"); printf("Cache-Control: no-cache, must-revalidate, no-transform\r\n"); printf("Pragma: no-cache\r\n"); printf("\r\n"); printf("The clients are too busy now (%f).\n", failrate); } else if(*g_tmpdir != '\0' && (rp = getenv("PATH_INFO")) != NULL && *rp == '/' && (++rp) != '\0' && !strchr(rp, '/') && !strchr(rp, '\\') && strcmp(rp, ESTCDIRSTR) && strcmp(rp, ESTPDIRSTR)){ /* save cache data */ savecache(rp); } else { /* read parameters */ params = getparameters(); cbglobalgc(params, (void (*)(void *))cbmapclose); plist = cblistopen(); cbglobalgc(plist, (void (*)(void *))cblistclose); alist = cblistopen(); cbglobalgc(alist, (void (*)(void *))cblistclose); for(i = 1; i <= CONDPHRASEMAX; i++){ len = sprintf(numbuf, "phrase%d", i); rp = cbmapget(params, numbuf, len, NULL); if(!rp && i == 1) rp = cbmapget(params, "phrase", -1, NULL); if(!rp) rp = ""; while(*rp == ' ' || *rp == '\t'){ rp++; } cblistpush(plist, rp, -1); } for(i = 1; i <= CONDATTRMAX; i++){ len = sprintf(numbuf, "attr%d", i); rp = cbmapget(params, numbuf, len, NULL); if(!rp && i == 1) rp = cbmapget(params, "attr", -1, NULL); if(!rp) rp = ""; while(*rp == ' ' || *rp == '\t'){ rp++; } if(*rp != '\0') cblistpush(alist, rp, -1); } if((rp = cbmapget(params, "max", -1, NULL)) != NULL) p_max = atoi(rp); if(p_max < 0) p_max = SEARCHMAX; if(!(p_distinct = cbmapget(params, "distinct", -1, NULL))) p_distinct = ""; if(!(p_cache = cbmapget(params, "cache", -1, NULL))) p_cache = ""; if((rp = cbmapget(params, "fresh", -1, NULL)) != NULL) p_fresh = atoi(rp) > 0; if((rp = cbmapget(params, "stmode", -1, NULL)) != NULL) p_stmode = atoi(rp) > 0; if(!(p_logmsg = cbmapget(params, "logmsg", -1, NULL))) p_logmsg = ""; p_phraselist = plist; p_attrlist = alist; if(*p_cache != '\0' && *g_tmpdir != '\0'){ /* show the cache */ showcache(); } else { /* show the result */ showresult(); /* output the log message */ outputlog(); } } return 0; } /* show the error page and exit */ static void showerror(const char *msg){ printf("Status: 500 Internal Server Error\r\n"); printf("Content-Type: text/plain; charset=UTF-8\r\n"); printf("\r\n"); printf("Error: %s\n", msg); exit(1); } /* skip the label of a line */ static const char *skiplabel(const char *str){ if(!(str = strchr(str, ':'))) return ""; str++; while(*str != '\0' && (*str == ' ' || *str == '\t')){ str++; } return str; } /* save cache data */ static void savecache(const char *key){ int maxlen = 1024 * 1024 * 32; const char *rp; char *buf, tmppath[PATH_MAX]; int i, len, c; buf = NULL; len = 0; if((rp = getenv("REQUEST_METHOD")) != NULL && !strcmp(rp, "POST") && (rp = getenv("CONTENT_LENGTH")) != NULL && (len = atoi(rp)) > 0){ if(len > maxlen) len = maxlen; buf = cbmalloc(len + 1); for(i = 0; i < len && (c = getchar()) != EOF; i++){ buf[i] = c; } buf[i] = '\0'; if(i != len){ free(buf); buf = NULL; } } else if((rp = getenv("QUERY_STRING")) != NULL){ buf = cbmemdup(rp, -1); len = strlen(buf); } if(*g_tmpdir == '@'){ sprintf(tmppath, "%s%c%02x%c%s%s", g_tmpdir + 1, ESTPATHCHR, dpinnerhash(key, -1) % 0x100, ESTPATHCHR, key, CACHESUFFIX); } else { sprintf(tmppath, "%s%c%s%s", g_tmpdir, ESTPATHCHR, key, CACHESUFFIX); } if(buf && cbwritefile(tmppath, buf, len)){ printf("Content-Type: text/plain\r\n"); printf("Cache-Control: no-cache, must-revalidate, no-transform\r\n"); printf("Pragma: no-cache\r\n"); printf("\r\n"); printf("saved a cache file as \"%s\"\n", key); } else { printf("Status: 400 Bad Request\r\n"); printf("Content-Type: text/plain\r\n"); printf("Cache-Control: no-cache, must-revalidate, no-transform\r\n"); printf("Pragma: no-cache\r\n"); printf("\r\n"); printf("invalid parameter\n"); } free(buf); } /* get CGI parameters */ static CBMAP *getparameters(void){ int maxlen = 1024 * 1024 * 32; CBMAP *map, *attrs; CBLIST *pairs, *parts; const char *rp, *body; char *buf, *key, *val, *dkey, *dval, *wp, *bound, *fbuf, *aname; int i, len, c, blen, flen; map = cbmapopenex(37); buf = NULL; len = 0; if((rp = getenv("REQUEST_METHOD")) != NULL && !strcmp(rp, "POST") && (rp = getenv("CONTENT_LENGTH")) != NULL && (len = atoi(rp)) > 0){ if(len > maxlen) len = maxlen; buf = cbmalloc(len + 1); for(i = 0; i < len && (c = getchar()) != EOF; i++){ buf[i] = c; } buf[i] = '\0'; if(i != len){ free(buf); buf = NULL; } } else if((rp = getenv("QUERY_STRING")) != NULL){ buf = cbmemdup(rp, -1); len = strlen(buf); } if(buf && len > 0){ key = myencode(buf); cbglobalgc(key, free); p_querykey = key; if(cblistnum(g_sharelist) > 0) p_shareurl = cblistval(g_sharelist, dpouterhash(p_querykey, -1) % cblistnum(g_sharelist), NULL); if((rp = getenv("CONTENT_TYPE")) != NULL && cbstrfwmatch(rp, "multipart/form-data") && (rp = strstr(rp, "boundary=")) != NULL){ rp += 9; bound = cbmemdup(rp, -1); if((wp = strchr(bound, ';')) != NULL) *wp = '\0'; parts = cbmimeparts(buf, len, bound); for(i = 0; i < cblistnum(parts); i++){ body = cblistval(parts, i, &blen); attrs = cbmapopen(); fbuf = cbmimebreak(body, blen, attrs, &flen); if((rp = cbmapget(attrs, "NAME", -1, NULL)) != NULL){ cbmapput(map, rp, -1, fbuf, flen, FALSE); aname = cbsprintf("%s-filename", rp); if((rp = cbmapget(attrs, "FILENAME", -1, NULL)) != NULL) cbmapput(map, aname, -1, rp, -1, FALSE); free(aname); } free(fbuf); cbmapclose(attrs); } cblistclose(parts); free(bound); } else { pairs = cbsplit(buf, -1, "&"); for(i = 0; i < cblistnum(pairs); i++){ key = cbmemdup(cblistval(pairs, i, NULL), -1); if((val = strchr(key, '=')) != NULL){ *(val++) = '\0'; dkey = cburldecode(key, NULL); dval = cburldecode(val, NULL); cbmapput(map, dkey, -1, dval, -1, FALSE); free(dval); free(dkey); } free(key); } cblistclose(pairs); } } free(buf); return map; } /* encode a string for file name */ static char *myencode(const char *str){ char *mp, *rp, *wp, *ep; mp = est_make_crypt(str); rp = mp; wp = mp; while(*rp != '\0'){ if(*rp <= '0' && *rp >= '9'){ *wp = (*rp - '0') * 16; } else { *wp = (*rp - 'a' + 10) * 16; } rp++; if(*rp <= '0' && *rp >= '9'){ *wp += (*rp - '0'); } else { *wp += *rp - 'a' + 10; } if(*rp != '\0') rp++; wp++; } ep = cbbaseencode(mp, wp - mp); wp = ep; while(*wp != '\0'){ if(*wp == '/' || *wp == '+'){ *wp = '_'; } else if(*wp == '='){ *wp = '\0'; } wp++; } free(mp); return ep; } /* show the cache */ static void showcache(void){ char tmppath[PATH_MAX], *str; int len; struct stat sbuf; if(*g_tmpdir == '@'){ sprintf(tmppath, "%s%c%02x%c%s%s", g_tmpdir + 1, ESTPATHCHR, dpinnerhash(p_cache, -1) % 0x100, ESTPATHCHR, p_cache, CACHESUFFIX); } else { sprintf(tmppath, "%s%c%s%s", g_tmpdir, ESTPATHCHR, p_cache, CACHESUFFIX); } if(stat(tmppath, &sbuf) != -1){ if(g_cclife < 0 || time(NULL) - sbuf.st_mtime <= g_cclife){ if((str = cbreadfile(tmppath, &len)) != NULL){ printf("Content-Type: text/plain\r\n"); printf("Content-Length: %d\r\n", len); printf("Cache-Control: no-cache, must-revalidate, no-transform\r\n"); printf("Pragma: no-cache\r\n"); printf("\r\n"); fwrite(str, 1, len, stdout); free(str); return; } } else { unlink(tmppath); } } printf("Status: 404 Not Found\r\n"); printf("Content-Type: text/plain\r\n"); printf("Cache-Control: no-cache, must-revalidate, no-transform\r\n"); printf("Pragma: no-cache\r\n"); printf("\r\n"); printf("the cache was not found\n"); } /* show the result */ static void showresult(void){ pthread_t *thlist; TARGSRCH *arglist; ESTRESMAPELEM *elems; CBMAP *rmap; CBLIST *list; CBDATUM *obuf; const char *rp; char tmppath[PATH_MAX], *str; int i, len, code, hnum, num; struct stat sbuf; time_t now; printf("Content-Type: text/plain\r\n"); printf("Cache-Control: no-cache, must-revalidate, no-transform\r\n"); printf("Pragma: no-cache\r\n"); printf("X-Run-Count: %d\r\n", g_runcnt); printf("\r\n"); now = time(NULL); if(*g_tmpdir != '\0' && *g_tmpdir != '@' && g_cclife >= 0 && (now + g_runcnt) % CCPURGEFREQ == 0 && (list = cbdirlist(g_tmpdir)) != NULL){ for(i = 0; i < cblistnum(list); i++){ rp = cblistval(list, i, NULL); if(!cbstrbwmatch(rp, CACHESUFFIX)) continue; sprintf(tmppath, "%s%c%s", g_tmpdir, ESTPATHCHR, rp); if(stat(tmppath, &sbuf) != -1 && now - sbuf.st_mtime > g_cclife) unlink(tmppath); } cblistclose(list); } if(*g_tmpdir != '\0' && !p_fresh && *p_querykey != '\0'){ if(*g_tmpdir == '@'){ num = dpinnerhash(p_querykey, -1) % 0x100; if(g_cclife >= 0 && (now + g_runcnt) % (CCPURGEFREQ / 16) == 0){ sprintf(tmppath, "%s%c%02x", g_tmpdir + 1, ESTPATHCHR, num); if((list = cbdirlist(tmppath)) != NULL){ for(i = 0; i < cblistnum(list); i++){ rp = cblistval(list, i, NULL); if(!cbstrbwmatch(rp, CACHESUFFIX)) continue; sprintf(tmppath, "%s%c%02x%c%s", g_tmpdir + 1, ESTPATHCHR, num, ESTPATHCHR, rp); if(stat(tmppath, &sbuf) != -1 && now - sbuf.st_mtime > g_cclife) unlink(tmppath); } cblistclose(list); } } sprintf(tmppath, "%s%c%02x%c%s%s", g_tmpdir + 1, ESTPATHCHR, num, ESTPATHCHR, p_querykey, CACHESUFFIX); } else { sprintf(tmppath, "%s%c%s%s", g_tmpdir, ESTPATHCHR, p_querykey, CACHESUFFIX); } } else { *tmppath = '\0'; } if(*tmppath != '\0' && stat(tmppath, &sbuf) != -1){ if((g_cclife < 0 || now - sbuf.st_mtime <= g_cclife) && (str = cbreadfile(tmppath, &len)) != NULL){ g_hnum = atoi(str); fwrite(str, 1, len, stdout); if(g_cclife >= 0){ if(now % 4 == 0 && getpid() % 4 == 0 && est_random() < 0.1){ unlink(tmppath); } else { est_utime(tmppath, sbuf.st_mtime + (now - sbuf.st_mtime) / 2); } } free(str); g_cache = TRUE; return; } else { unlink(tmppath); } } else if(!p_fresh && *p_querykey != '\0' && *p_shareurl != '\0' && strcmp(p_shareurl, g_scripturl)){ str = cbsprintf("%s?cache=%s", p_shareurl, p_querykey); obuf = cbdatumopen(NULL, -1); if(est_url_shuttle(str, NULL, -1, -1, -1, NULL, NULL, NULL, -1, &code, NULL, obuf) && code == 200){ g_hnum = atoi(cbdatumptr(obuf)); fwrite(cbdatumptr(obuf), 1, cbdatumsize(obuf), stdout); if(*tmppath != '\0') cbwritefile(tmppath, cbdatumptr(obuf), cbdatumsize(obuf)); cbdatumclose(obuf); free(str); return; } cbdatumclose(obuf); free(str); } rmap = cbmapopen(); thlist = cbmalloc(cblistnum(g_targetlist) * sizeof(pthread_t)); arglist = cbmalloc(cblistnum(g_targetlist) * sizeof(TARGSRCH)); for(i = 0; i < cblistnum(g_targetlist); i++){ arglist[i].url = cblistval(g_targetlist, i, NULL); arglist[i].rmap = rmap; arglist[i].hnum = 0; } g_speed = est_gettimeofday(); for(i = 0; i < cblistnum(g_targetlist); i++){ if(g_stmode || p_stmode){ arglist[i].alive = FALSE; procsearch(arglist + i); } else { arglist[i].alive = TRUE; if(pthread_create(thlist + i, NULL, procsearch, arglist + i) != 0) arglist[i].alive = FALSE; } } hnum = 0; for(i = 0; i < cblistnum(g_targetlist); i++){ if(arglist[i].alive) pthread_join(thlist[i], NULL); hnum += arglist[i].hnum; } g_speed = est_gettimeofday() - g_speed; free(arglist); free(thlist); elems = est_resmap_dump(rmap, 1, &num); if(num < p_max + 1 && num < hnum) hnum = num; g_hnum = hnum; obuf = cbdatumopen(NULL, -1); cbdatumprintf(obuf, "%d\n", g_hnum); for(i = 0; i < num && i < p_max; i++){ cbdatumprintf(obuf, "%s\t%d\n", elems[i].key, elems[i].score); } fwrite(cbdatumptr(obuf), 1, cbdatumsize(obuf), stdout); if(*p_querykey != '\0' && !g_error){ if(*p_shareurl != '\0'){ str = cbsprintf("%s/%s", p_shareurl, p_querykey); est_url_shuttle(str, NULL, -1, -1, -1, NULL, NULL, cbdatumptr(obuf), cbdatumsize(obuf), NULL, NULL, NULL); free(str); } else { cbwritefile(tmppath, cbdatumptr(obuf), cbdatumsize(obuf)); } } cbdatumclose(obuf); free(elems); cbmapclose(rmap); } /* search an index */ static void *procsearch(void *targ){ static pthread_mutex_t mymutex = PTHREAD_MUTEX_INITIALIZER; TARGSRCH *argp; CBMAP *rmap; CBLIST *fields; CBDATUM *url, *body; const char *rp, *pv, *key; int i, code, num, rnum; argp = (TARGSRCH *)targ; url = cbdatumopen(argp->url, -1); rmap = argp->rmap; cbdatumprintf(url, "?", -1); for(i = 0; i < cblistnum(p_phraselist); i++){ rp = cblistval(p_phraselist, i, NULL); if(*rp != '\0') cbdatumprintf(url, "phrase%d=%?&", i + 1, rp); } for(i = 0; i < cblistnum(p_attrlist); i++){ rp = cblistval(p_attrlist, i, NULL); if(*rp != '\0') cbdatumprintf(url, "attr%d=%?&", i + 1, rp); } cbdatumprintf(url, "max=%d", p_max + 1); if(*p_distinct != '\0') cbdatumprintf(url, "&distinct=%?", p_distinct); if(p_fresh) cbdatumprintf(url, "&fresh=1"); if(p_stmode) cbdatumprintf(url, "&stmode=1"); if(*p_logmsg) cbdatumprintf(url, "&logmsg=%?", p_logmsg); body = cbdatumopen(NULL, -1); if(est_url_shuttle(cbdatumptr(url), NULL, -1, -1, -1, NULL, NULL, NULL, -1, &code, NULL, body) && code == 200){ rp = cbdatumptr(body); num = atoi(rp); if(num > 0 && (rp = strchr(rp, '\n')) != NULL){ argp->hnum = num; if(pthread_mutex_lock(&mymutex) == 0){ rnum = 0; while((pv = strchr(rp, '\n')) != NULL){ fields = cbsplit(rp, pv - rp, "\t"); if(cblistnum(fields) > 1){ key = cblistval(fields, 0, NULL); num = atoi(cblistval(fields, 1, NULL)); if(*key != '\0'){ est_resmap_add(rmap, key, num, g_score); rnum++; } } cblistclose(fields); rp = pv + 1; } if(rnum < p_max + 1 && rnum < argp->hnum) argp->hnum = rnum; pthread_mutex_unlock(&mymutex); } } } else { g_error = TRUE; } cbdatumclose(body); cbdatumclose(url); return NULL; } /* output the log message */ static void outputlog(void){ FILE *ofp; CBDATUM *condbuf; const char *rp, *pv; char *name, *value; int i; if(g_logfile[0] == '\0') return; condbuf = cbdatumopen(NULL, -1); for(i = 0; i < cblistnum(p_phraselist); i++){ cbdatumcat(condbuf, "{{p:", -1); cbdatumcat(condbuf, cblistval(p_phraselist, i, NULL), -1); cbdatumcat(condbuf, "}}", -1); } for(i = 0; i < cblistnum(p_attrlist); i++){ cbdatumcat(condbuf, "{{a:", -1); cbdatumcat(condbuf, cblistval(p_attrlist, i, NULL), -1); cbdatumcat(condbuf, "}}", -1); } if(cbdatumsize(condbuf) < 1 || !(ofp = fopen(g_logfile, "ab"))){ cbdatumclose(condbuf); return; } rp = g_logformat; while(*rp != '\0'){ switch(*rp){ case '\\': if(rp[1] != '\0') rp++; switch(*rp){ case 't': fputc('\t', ofp); break; case 'n': fputc('\n', ofp); break; default: fputc(*rp, ofp); break; } break; case '{': if(cbstrfwmatch(rp, "{cond}")){ pv = cbdatumptr(condbuf); while(*pv != '\0'){ if(*pv > '\0' && *pv < ' '){ fputc(' ', ofp); } else { fputc(*pv, ofp); } pv++; } rp += 5; } else if(cbstrfwmatch(rp, "{time}")){ value = cbdatestrwww(-1, 0); fprintf(ofp, "%s", value); free(value); rp += 5; } else if(cbstrfwmatch(rp, "{hnum}")){ fprintf(ofp, "%d", g_hnum); rp += 5; } else if(cbstrfwmatch(rp, "{cache}")){ fprintf(ofp, "%d", g_cache); rp += 6; } else if(cbstrfwmatch(rp, "{error}")){ fprintf(ofp, "%d", g_error); rp += 6; } else if(cbstrfwmatch(rp, "{speed}")){ fprintf(ofp, "%.3f", g_speed / 1000); rp += 6; } else if(cbstrfwmatch(rp, "{logmsg}")){ fprintf(ofp, "%s", p_logmsg); rp += 7; } else if((pv = strchr(rp, '}')) != NULL){ rp++; name = cbmemdup(rp, pv - rp); value = getenv(name); if(value) fprintf(ofp, "%s", value); free(name); rp = pv; } else { fputc(*rp, ofp); } break; default: fputc(*rp, ofp); break; } rp++; } fclose(ofp); cbdatumclose(condbuf); } /* END OF FILE */ hyperestraier-1.4.13/estsupt.conf000066400000000000000000000004471125261632700170560ustar00rootroot00000000000000targeturl: http://searcher1/estscout.cgi targeturl: http://searcher2/estscout.cgi stmode: 0 score: 0 tmpdir: /tmp cclife: 1800 #shareurl: http://merger1/estsupt.cgi #shareurl: http://merger2/estsupt.cgi failfile: logfile: logformat: {time}\t{REMOTE_ADDR}:{REMOTE_PORT}\t{cond}\t{hnum}\n hyperestraier-1.4.13/estwaver.c000066400000000000000000001076161125261632700165120ustar00rootroot00000000000000/************************************************************************************************* * The command line interface of web crawler * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #include "wavermod.h" #define SLEEPUSEC 100000 /* sleep time in micro seconds */ #define MINPRIOR 0.01 /* minimal priority of non-seed documents */ #define NODERTTNUM 5000 /* number of documents for node rotation */ enum { /* enumeration for crawling modes */ CM_CONTINUE, /* continue */ CM_RESTART, /* restart */ CM_REVISIT, /* revisit */ CM_REVCONT /* revisit and continue */ }; typedef struct { /* type of structure for interaction of a URL */ int thid; /* thread ID number */ WAVER *waver; /* waver handle */ char *url; /* URL */ int depth; /* depth */ int pid; /* ID number of the parent document */ double psim; /* similarity of the parent document */ time_t mdate; /* last-modified date */ } TARGSURL; /* global variables */ pthread_mutex_t g_mutex = PTHREAD_MUTEX_INITIALIZER; /* global mutex */ int g_thnum = 0; /* number of running threads */ int g_thseq = 0; /* sequence of thread ID */ CBMAP *g_tasks = NULL; /* URLs of running tasks */ const char *g_progname; /* program name */ int g_sigterm = FALSE; /* flag for termination signal */ const char *g_pxhost = NULL; /* host name of the proxy */ int g_pxport = 0; /* host name of the proxy */ int g_timeout = -1; /* timeout in seconds */ int g_inputlang = ESTLANGEN; /* prefered language */ /* function prototypes */ int main(int argc, char **argv); static void usage(void); static void setsignals(void); static void sigtermhandler(int num); static char *dequeue(WAVER *waver, int *depthp, int *pidp, double *psimp); static void enqueuelinks(WAVER *waver, const char *base, CBLIST *links, CBMAP *kwords, int depth, int id, int pid, double psim); static int runinit(int argc, char **argv); static int runcrawl(int argc, char **argv); static int rununittest(int argc, char **argv); static int runfetch(int argc, char **argv); static int procinit(const char *rootdir, int opts); static int proccrawl(const char *rootdir, int mode); static int procunittest(const char *rootdir); static int procfetch(const char *url); static int strtolang(const char *str); static char *capitalize(const char *str); static void seedurldocs(WAVER *waver, const char *url, int depth, double bias, CBMAP *ulinks); static int accessthnum(int inc); static int puttask(const char *url); static void outtask(const char *url); static void *geturldoc(void *args); static char *urltosavepath(const char *savedir, const char *url); /* main routine */ int main(int argc, char **argv){ const char *tmp; int rv; if((tmp = getenv("ESTDBGFD")) != NULL) dpdbgfd = atoi(tmp); est_proc_env_reset(); g_progname = argv[0]; g_sigterm = FALSE; g_tasks = cbmapopenex(MINIBNUM); cbglobalgc(g_tasks, (void (*)(void *))cbmapclose); if(!est_init_net_env()){ log_print(LL_ERROR, "could not initialize network environment"); exit(1); } atexit(est_free_net_env); if(argc < 2) usage(); rv = 0; if(!strcmp(argv[1], "init")){ rv = runinit(argc, argv); } else if(!strcmp(argv[1], "crawl")){ setsignals(); rv = runcrawl(argc, argv); } else if(!strcmp(argv[1], "unittest")){ rv = rununittest(argc, argv); } else if(!strcmp(argv[1], "fetch")){ rv = runfetch(argc, argv); } else { usage(); } return rv; } /* print the usage and exit */ static void usage(void){ fprintf(stderr, "%s: command line interface of web crawler\n", g_progname); fprintf(stderr, "\n"); fprintf(stderr, "usage:\n"); fprintf(stderr, " %s init [-apn|-acc] [-xs|-xl|-xh] [-sv|-si|-sa] rootdir\n", g_progname); fprintf(stderr, " %s crawl [-restart|-revisit|-revcont] rootdir\n", g_progname); fprintf(stderr, " %s unittest rootdir\n", g_progname); fprintf(stderr, " %s fetch [-proxy host port] [-tout num] [-il lang] url\n", g_progname); fprintf(stderr, "\n"); exit(1); } /* set signal handlers */ static void setsignals(void){ est_signal(1, sigtermhandler); est_signal(2, sigtermhandler); est_signal(3, sigtermhandler); est_signal(13, SIG_IGN); est_signal(14, SIG_IGN); est_signal(15, sigtermhandler); g_sigterm = FALSE; } /* handler of termination signal */ static void sigtermhandler(int num){ g_sigterm = TRUE; fprintf(stderr, "%s: the termination signal %d catched\n", g_progname, num); } /* dequeue a URL from the priority queue (it has a critical section inside) */ static char *dequeue(WAVER *waver, int *depthp, int *pidp, double *psimp){ char *buf, *rp, *rv; if(time(NULL) > waver->stime + waver->period) return NULL; if(pthread_mutex_lock(&g_mutex) != 0){ log_print(LL_ERROR, "could not get mutex"); return NULL; } if(waver->curnum > waver->docnum){ pthread_mutex_unlock(&g_mutex); return NULL; } while(queue_rnum(waver->queue) < 1 && g_thnum > 0){ pthread_mutex_unlock(&g_mutex); est_usleep(SLEEPUSEC); if(pthread_mutex_lock(&g_mutex) != 0){ log_print(LL_ERROR, "could not get mutex"); return NULL; } } rv = NULL; *depthp = 0; *pidp = 0; *psimp = 0.0; while(TRUE){ if(!(buf = queue_dequeue(waver->queue))) break; if((rp = strchr(buf, '\t')) != NULL && (*depthp = atoi(buf)) >= 0){ rp++; rv = cbmemdup(rp, -1); if((rp = strchr(buf, ':')) != NULL){ rp++; *pidp = atoi(rp); if((rp = strchr(rp, ':')) != NULL){ rp++; *psimp = strtod(rp, NULL); } } free(buf); break; } free(buf); } pthread_mutex_unlock(&g_mutex); return rv; } /* add traced URLs (it should be called in a critical section) */ static void enqueuelinks(WAVER *waver, const char *base, CBLIST *links, CBMAP *kwords, int depth, int id, int pid, double psim){ PMRULE *pmrule; CBMAP *pkwords, *ulinks; const char *vbuf; char numbuf[NUMBUFSIZ], *ubuf, *pv, *benc, *tenc; int i, j, vsiz, lnum, llen, slash, vnum, *svec, *tvec, num, allow; double similarity, lnumtune, depthtune, masstune, priority, remoteness; if(depth >= waver->maxdepth) return; if(!kwords || cbmaprnum(waver->kwords) < 1){ similarity = psim * 0.7; psim = similarity; } else { vnum = waver->seedkeynum; svec = cbmalloc(vnum * sizeof(int)); tvec = cbmalloc(vnum * sizeof(int)); est_vector_set_seed(waver->kwords, svec, vnum); est_vector_set_target(waver->kwords, kwords, tvec, vnum); similarity = est_vector_cosine(svec, tvec, vnum) * 0.9 + 0.1; similarity = similarity * (1.0 - waver->inherit) + psim * waver->inherit; psim = similarity; free(tvec); free(svec); if(pid > 0 && (pkwords = est_mtdb_get_keywords(waver->index, pid))){ vnum = waver->savekeynum; svec = cbmalloc(vnum * sizeof(int)); tvec = cbmalloc(vnum * sizeof(int)); est_vector_set_seed(pkwords, svec, vnum); est_vector_set_target(pkwords, kwords, tvec, vnum); similarity *= 1.0 - pow(est_vector_cosine(svec, tvec, vnum), 3.14) * 0.8; cbmapclose(pkwords); free(tvec); free(svec); } } if((pv = strstr(base, "://")) != NULL && (pv = strchr(pv + 3, '/')) != NULL){ vbuf = cbmapget(waver->sites, base, pv - base + 1, NULL); num = (vbuf ? atoi(vbuf) : 0) + 1; sprintf(numbuf, "%d", num); cbmapput(waver->sites, base, pv - base + 1, numbuf, -1, TRUE); if(cbmaprnum(waver->sites) > (waver->queuesize / 3.0 + 1) * 1.4){ log_print(LL_INFO, "site map sliming: %d", cbmaprnum(waver->sites)); kwords_reduce(waver->sites, waver->queuesize / 3.0 + 1, TRUE); } } ulinks = cbmapopenex(MINIBNUM); cbmapput(ulinks, base, -1, "", 0, FALSE); lnum = cblistnum(links) + 4; lnumtune = pow(lnum, 0.7); depthtune = pow(depth + 7, 0.8); for(i = 0; i < cblistnum(links) && i < 1024; i++){ vbuf = cblistval(links, i, &vsiz); ubuf = cbmemdup(vbuf, vsiz); if((pv = strchr(ubuf, '#')) != NULL) *pv = '\0'; llen = strlen(ubuf); if(llen > 1024 || cbmapget(ulinks, ubuf, llen, NULL)){ free(ubuf); continue; } cbmapput(ulinks, ubuf, -1, "", 0, FALSE); allow = FALSE; for(j = 0; j < cblistnum(waver->pmrules); j++){ pmrule = (PMRULE *)cblistval(waver->pmrules, j, NULL); switch(pmrule->visit){ case 1: if(est_regex_match(pmrule->regex, ubuf)) allow = TRUE; break; case -1: if(est_regex_match(pmrule->regex, ubuf)) allow = FALSE; break; } } if(!allow){ free(ubuf); continue; } masstune = 1.0; if((pv = strstr(ubuf, "://")) != NULL && (pv = strchr(pv + 3, '/')) != NULL){ vbuf = cbmapget(waver->sites, ubuf, pv - ubuf + 1, NULL); num = (vbuf ? atoi(vbuf) : 0) + 1; if(num > waver->masscheck) masstune /= sqrt((double)num / waver->masscheck); } slash = 6; for(pv = ubuf; *pv != '\0'; pv++){ switch(*pv){ case '/': slash += 1; break; case '?': slash += 5; break; case '&': slash += 1; break; case ';': slash += 1; break; } } remoteness = 8.0; benc = cbmemdup(base, -1); tenc = cbmemdup(ubuf, -1); if((pv = strchr(benc, '?')) != NULL) pv[0] = '\0'; if((pv = strchr(tenc, '?')) != NULL) pv[0] = '\0'; if(!strcmp(tenc, benc)){ priority *= 0.7; remoteness = 1.5; } else { if((pv = strrchr(benc, '/')) != NULL) pv[1] = '\0'; if((pv = strrchr(tenc, '/')) != NULL) pv[1] = '\0'; if(cbstrfwmatch(tenc, benc)){ priority *= 0.9; remoteness = 4.0; } } free(tenc); free(benc); switch(waver->strategy){ case CS_BALANCED: priority = (similarity * 128 * masstune) / depthtune / lnumtune / slash; priority *= (lnum - (i / remoteness)) / lnum; if(llen > 80) priority /= pow(llen / 80.0, 0.7); break; case CS_SIMILARITY: priority = similarity; priority *= 0.9 + ((lnum - i) / (double)lnum) / 50; break; case CS_DEPTH: priority = (depth + 1) * 0.001; priority = priority > 1.0 ? 1.0 : priority; priority *= 0.9 + ((lnum - i) / (double)lnum) / 50; break; case CS_WIDTH: priority = 1.0 / (depth + 1); priority *= 0.9 + ((lnum - i) / (double)lnum) / 50; break; case CS_RANDOM: priority = (est_random() * 128 * masstune) / depthtune / lnumtune / slash; priority *= (lnum - (i / remoteness)) / lnum; if(llen > 80) priority /= pow(llen / 80.0, 0.7); break; default: priority = (128 * masstune) / depthtune / lnumtune / slash; priority *= (lnum - (i / remoteness)) / lnum; if(llen > 80) priority /= pow(llen / 80.0, 0.7); break; } tenc = cbsprintf("%d:%d:%.5f\t%s", depth + 1, id, psim, ubuf); queue_enqueue(waver->queue, tenc, 1.0 - priority); free(tenc); free(ubuf); } cbmapclose(ulinks); if(queue_rnum(waver->queue) > waver->queuesize * 1.4){ log_print(LL_INFO, "queue sliming: %d", queue_rnum(waver->queue)); if(!queue_slim(waver->queue, waver->queuesize)) log_print(LL_ERROR, "queue sliming failed"); } } /* parse arguments of the init command */ static int runinit(int argc, char **argv){ char *rootdir; int i, opts, rv; rootdir = NULL; opts = 0; for(i = 2; i < argc; i++){ if(!rootdir && argv[i][0] == '-'){ if(!strcmp(argv[i], "-apn")){ opts |= WI_PERFNG; } else if(!strcmp(argv[i], "-acc")){ opts |= WI_CHRCAT; } else if(!strcmp(argv[i], "-xs")){ opts |= WI_SMALL; } else if(!strcmp(argv[i], "-xl")){ opts |= WI_LARGE; } else if(!strcmp(argv[i], "-xh")){ opts |= WI_HUGE; } else if(!strcmp(argv[i], "-sv")){ opts |= WI_SCVOID; } else if(!strcmp(argv[i], "-si")){ opts |= WI_SCINT; } else if(!strcmp(argv[i], "-sa")){ opts |= WI_SCASIS; } else { usage(); } } else if(!rootdir){ rootdir = argv[i]; } else { usage(); } } if(!rootdir) usage(); rv = procinit(rootdir, opts); return rv; } /* parse arguments of the crawl command */ static int runcrawl(int argc, char **argv){ char *rootdir; int i, mode, rv; rootdir = NULL; mode = CM_CONTINUE; for(i = 2; i < argc; i++){ if(!rootdir && argv[i][0] == '-'){ if(!strcmp(argv[i], "-restart")){ mode = CM_RESTART; } else if(!strcmp(argv[i], "-revisit")){ mode = CM_REVISIT; } else if(!strcmp(argv[i], "-revcont")){ mode = CM_REVCONT; } else { usage(); } } else if(!rootdir){ rootdir = argv[i]; } else { usage(); } } if(!rootdir) usage(); rv = proccrawl(rootdir, mode); return rv; } /* parse arguments of the unittest command */ static int rununittest(int argc, char **argv){ char *rootdir; int i, rv; rootdir = NULL; for(i = 2; i < argc; i++){ if(!rootdir && argv[i][0] == '-'){ usage(); } else if(!rootdir){ rootdir = argv[i]; } else { usage(); } } if(!rootdir) usage(); rv = procunittest(rootdir); return rv; } /* parse arguments of the fetch command */ static int runfetch(int argc, char **argv){ char *url; int i, rv; url = NULL; for(i = 2; i < argc; i++){ if(!url && argv[i][0] == '-'){ if(!strcmp(argv[i], "-proxy")){ if(++i >= argc) usage(); g_pxhost = argv[i]; if(++i >= argc) usage(); g_pxport = atoi(argv[i]); } else if(!strcmp(argv[i], "-tout")){ if(++i >= argc) usage(); g_timeout = atoi(argv[i]); } else if(!strcmp(argv[i], "-il")){ if(++i >= argc) usage(); g_inputlang = strtolang(argv[i]); } else { usage(); } } else if(!url){ url = argv[i]; } else { usage(); } } if(!url) usage(); rv = procfetch(url); return rv; } /* perform the init command */ static int procinit(const char *rootdir, int opts){ if(!waver_init(rootdir, opts)){ log_print(LL_ERROR, "initializing the root directory failed"); return 1; } log_open(rootdir, LOGFILE, LL_INFO, FALSE); log_print(LL_INFO, "the root directory created"); return 0; } /* perform the init command */ static int proccrawl(const char *rootdir, int mode){ pthread_t th; TARGSURL *targs; WAVER *waver; CBDATUM *kwbuf; CBMAP *ulinks; const char *kbuf, *rp; char *url, *rec, *tmp, *endurl; int i, err, depth, pid, thid, locked, ended; double psim; time_t t, mdate; if(!(waver = waver_open(rootdir))){ log_print(LL_ERROR, "%s: could not open", rootdir); return 1; } err = FALSE; switch(mode){ default: log_print(LL_INFO, "crawling started (continue)"); break; case CM_RESTART: log_print(LL_INFO, "crawling started (restart)"); break; case CM_REVISIT: log_print(LL_INFO, "crawling started (revisit)"); break; case CM_REVCONT: log_print(LL_INFO, "crawling started (revcont)"); break; } if(mode == CM_RESTART){ while((tmp = queue_dequeue(waver->queue)) != NULL){ free(tmp); } } endurl = NULL; if(mode == CM_REVISIT || mode == CM_REVCONT){ t = time(NULL); criterinit(waver->trace); while((url = criternext(waver->trace, NULL)) != NULL){ if((rec = crget(waver->trace, url, -1, 0, -1, NULL)) != NULL){ if(est_mtdb_uri_to_id(waver->index, url) > 0){ mdate = (time_t)strtod(rec, NULL); depth = 0; pid = 0; psim = 0.0; if((rp = strchr(rec, ':')) != NULL){ rp++; depth = atoi(rp); if((rp = strchr(rp, ':')) != NULL){ rp++; pid = atoi(rp); if((rp = strchr(rp, ':')) != NULL){ rp++; psim = strtod(rp, NULL); } } } tmp = cbsprintf("%d:%d:%.5f\t%s", depth, pid, psim, url); queue_enqueue(waver->queue, tmp, (mdate / t) * MINPRIOR); free(tmp); } free(rec); } free(endurl); endurl = url; } } if(mode == CM_RESTART){ criterinit(waver->trace); while((url = criternext(waver->trace, NULL)) != NULL){ crout(waver->trace, url, -1); free(url); } } cbmapiterinit(waver->seeds); ulinks = cbmapopen(); while((kbuf = cbmapiternext(waver->seeds, NULL)) != NULL){ seedurldocs(waver, kbuf, 0, strtod(cbmapget(waver->seeds, kbuf, -1, NULL), NULL), ulinks); } cbmapclose(ulinks); kwords_reduce(waver->kwords, waver->seedkeynum, FALSE); kwbuf = cbdatumopen(NULL, -1); cbmapiterinit(waver->kwords); for(i = 0; (kbuf = cbmapiternext(waver->kwords, NULL)) != NULL; i++){ if(i > 0) cbdatumprintf(kwbuf, ", "); cbdatumprintf(kwbuf, "%s (%s)", kbuf, cbmapget(waver->kwords, kbuf, -1, NULL)); } log_print(LL_DEBUG, "seed keywords: %s", cbdatumptr(kwbuf)); cbdatumclose(kwbuf); ended = FALSE; thid = 0; while(!g_sigterm && !ended && (tmp = dequeue(waver, &depth, &pid, &psim)) != NULL){ if(endurl && !strcmp(tmp, endurl)){ est_usleep(SLEEPUSEC); if(mode == CM_REVISIT){ ended = TRUE; } else { log_print(LL_INFO, "waiting for threads: %d", accessthnum(0)); t = time(NULL); while(accessthnum(0) > 0 && time(NULL) < t + waver->timeout * 2 + 1){ est_usleep(SLEEPUSEC); } free(endurl); endurl = NULL; } } mdate = 0; if(pthread_mutex_lock(&g_mutex) == 0){ if((rec = crget(waver->trace, tmp, -1, 0, -1, NULL)) != NULL){ mdate = (time_t)strtod(rec, NULL); free(rec); } pthread_mutex_unlock(&g_mutex); if(mdate + waver->revisit >= time(NULL)){ log_print(LL_DEBUG, "not modified: %s", tmp); free(tmp); continue; } } else { log_print(LL_ERROR, "could not get mutex"); } if(cbmaprnum(waver->nodes) > 0 && (waver->curnode < 1 || waver->minload >= 1.0 || thid % NODERTTNUM == 0 || (thid % (NODERTTNUM / 10) == 0 && waver_current_node_load(waver) > 0.85))){ waver_set_current_node(waver); log_print(LL_INFO, "current node changed: %d: %f", waver->curnode, waver->minload); } thid++; targs = cbmalloc(sizeof(TARGSURL)); targs->thid = thid; targs->waver = waver; targs->url = tmp; targs->depth = depth; targs->pid = pid; targs->psim = psim; targs->mdate = mdate; if(waver->thnum > 1){ while(accessthnum(0) >= waver->thnum){ est_usleep(SLEEPUSEC); } if(pthread_create(&th, NULL, geturldoc, targs) == 0){ pthread_detach(th); if(thid <= waver->thnum) est_usleep(SLEEPUSEC); } else { geturldoc(targs); } } else { geturldoc(targs); } if(thid % 256 == 0){ locked = pthread_mutex_lock(&g_mutex) == 0; log_print(LL_INFO, "status: dnum=%d, wnum=%d, size=%.0f, queue=%d", est_mtdb_doc_num(waver->index), est_mtdb_word_num(waver->index), est_mtdb_size(waver->index), queue_rnum(waver->queue) + 1); if(locked) pthread_mutex_unlock(&g_mutex); est_usleep(SLEEPUSEC); } } est_usleep(SLEEPUSEC); if(waver->thnum > 1){ log_print(LL_INFO, "waiting for threads: %d", accessthnum(0)); t = time(NULL); while(accessthnum(0) > 0){ if(time(NULL) > t + waver->timeout * 8 + 60){ log_print(LL_WARN, "thread waiting timed out: %d", accessthnum(0)); raise(3); est_usleep(1000 * 1000 * 5); break; } est_usleep(SLEEPUSEC); } } free(endurl); log_print(LL_INFO, "crawling finished"); locked = pthread_mutex_lock(&g_mutex) == 0; g_sigterm = TRUE; if(!waver_close(waver)){ log_print(LL_ERROR, "%s: closing failed", rootdir); err = TRUE; } if(locked) pthread_mutex_unlock(&g_mutex); if(!err) log_print(LL_INFO, "finished successfully"); return err ? 1 : 0; } /* perform the unittest command */ static int procunittest(const char *rootdir){ WAVER *waver; QUEUE *queue; CBMAP *seeds, *kwords; char uri[URIBUFSIZ], *vbuf; int i, err; log_print(LL_INFO, "initializing the waver handle"); if(!waver_init(rootdir, 0)){ log_print(LL_ERROR, "%s: initializing failed", rootdir); return FALSE; } log_print(LL_INFO, "opening the waver handle"); if(!(waver = waver_open(rootdir))){ log_print(LL_ERROR, "%s: opening failed", rootdir); return FALSE; } err = FALSE; log_print(LL_INFO, "checking seeding"); seeds = waver->seeds; for(i = 0; i < 100; i++){ sprintf(uri, "http://%05d/%x/%x.html", i + 1, (int)(est_random() * 0x1000000), (int)(est_random() * 0x1000000)); cbmapput(seeds, uri, -1, "", 0, TRUE); } log_print(LL_INFO, "checking priority queue"); queue = waver->queue; for(i = 0; i < 100; i++){ sprintf(uri, "0:0:0.0\thttp://%05d/%x/%x.html", i + 1, (int)(est_random() * 0x1000000), (int)(est_random() * 0x1000000)); if(!queue_enqueue(queue, uri, est_random())){ err = TRUE; break; } if(i % 10 == 0) queue_set_range(queue, i); } if(queue_rnum(queue) != 100) err = TRUE; if(err) log_print(LL_ERROR, "%s: enqueue failed", rootdir); if(!queue_slim(queue, 60)) err = TRUE; if(err) log_print(LL_ERROR, "%s: slim failed", rootdir); for(i = 0; (vbuf = queue_dequeue(queue)) != NULL; i++){ free(vbuf); } if(i != 60){ err = TRUE; log_print(LL_ERROR, "%s: dequeue failed", rootdir); } log_print(LL_INFO, "checking keyword map"); kwords = waver->kwords; for(i = 0; i < 10000; i++){ sprintf(uri, "%d", (int)(est_random() * 1000)); kwords_add(kwords, uri, (int)(est_random() * 1000)); } kwords_reduce(kwords, 100, TRUE); log_print(LL_INFO, "closing the waver handle"); if(!waver_close(waver)){ log_print(LL_ERROR, "%s: closing failed", rootdir); err = TRUE; } if(!err) log_print(LL_INFO, "finished successfully"); return err ? 1 : 0; } /* perform the fetch command */ static int procfetch(const char *url){ CBMAP *heads; CBLIST *links; CBDATUM *raw; ESTDOC *doc; const char *border, *vbuf; char *str; int i, code, vsiz; raw = cbdatumopen(NULL, -1); heads = cbmapopen(); links = cblistopen(); doc = est_doc_new(); if(!fetch_document(url, g_pxhost, g_pxport, g_timeout, -1, NULL, NULL, &code, raw, heads, links, NULL, doc, g_inputlang)){ log_print(LL_WARN, "could not get: %d: %s", code, url); est_doc_delete(doc); cblistclose(links); cbmapclose(heads); cbdatumclose(raw); return 1; } border = est_border_str(); printf("URL: %s\r\n", url); str = cbdatestrhttp(time(NULL), 0); printf("Date: %s\r\n", str); free(str); str = cbmimeencode((vbuf = est_doc_attr(doc, ESTDATTRTITLE)) ? vbuf : url, "UTF-8", TRUE); printf("Subject: [estwaver] %s\r\n", str); free(str); printf("Content-Type: multipart/mixed; boundary=%s\r\n", border); printf("\r\n"); printf("This is a multi-part message in MIME format.\n"); printf("\r\n"); printf("--%s\r\n", border); printf("Content-Type: text/x-estraier-draft\r\n"); printf("X-Estwaver-Role: draft\r\n"); printf("\r\n"); str = est_doc_dump_draft(doc); printf("%s", str); free(str); printf("\r\n"); printf("--%s\r\n", border); printf("Content-Type: text/plain\r\n"); printf("X-Estwaver-Role: links\r\n"); printf("\r\n"); for(i = 0; i < cblistnum(links); i++){ printf("%s\n", cblistval(links, i, NULL)); } printf("\r\n"); printf("--%s\r\n", border); cbmapiterinit(heads); while((vbuf = cbmapiternext(heads, &vsiz)) != NULL){ if(vsiz < 1){ printf("X-Original-HTTP-Response: %s\r\n", cbmapget(heads, vbuf, vsiz, NULL)); } else if(!strcmp(vbuf, "content-encoding")){ printf("X-Original-Content-Encoding: %s\r\n", cbmapget(heads, vbuf, vsiz, NULL)); } else { str = capitalize(vbuf); printf("%s: %s\r\n", str, cbmapget(heads, vbuf, vsiz, NULL)); free(str); } } printf("X-Estwaver-Role: raw\r\n"); printf("\r\n"); fwrite(cbdatumptr(raw), 1, cbdatumsize(raw), stdout); printf("\r\n"); printf("--%s--\r\n", border); est_doc_delete(doc); cblistclose(links); cbmapclose(heads); cbdatumclose(raw); return 0; } /* get the language value */ static int strtolang(const char *str){ if(!cbstricmp(str, "en")) return ESTLANGEN; if(!cbstricmp(str, "ja")) return ESTLANGJA; if(!cbstricmp(str, "zh")) return ESTLANGZH; if(!cbstricmp(str, "ko")) return ESTLANGKO; return ESTLANGMISC; } /* make a capitalized string */ static char *capitalize(const char *str){ char *buf; int i, cap; buf = cbmemdup(str, -1); cap = TRUE; for(i = 0; buf[i] != '\0'; i++){ if(cap && buf[i] >= 'a' && buf[i] <= 'z'){ buf[i] -= 'a' - 'A'; } cap = buf[i] == ' ' || buf[i] == '-'; } return buf; } /* get keywords of a seed document */ static void seedurldocs(WAVER *waver, const char *url, int depth, double bias, CBMAP *ulinks){ PMRULE *pmrule; ESTDOC *doc; CBMAP *kwords; CBLIST *links; const char *kbuf; char *ubuf, *pv; int i, j, code, ksiz, num, len, allow; double lnumtune; if(g_sigterm) return; ubuf = cbsprintf("%d:0:1.0\t%s", depth, url); queue_enqueue(waver->queue, ubuf, depth * MINPRIOR); free(ubuf); links = cblistopen(); doc = est_doc_new(); log_print(LL_INFO, "fetching: %d: %s", depth, url); fetch_document(url, waver->pxhost, waver->pxport, waver->timeout * 2, 0, waver->urlrules, waver->mtrules, &code, NULL, NULL, links, waver->unrules, doc, waver->language); if(code == 200 && !est_doc_is_empty(doc)){ log_print(LL_INFO, "seeding: %.3f: %s", bias, url); kwords = est_morph_etch_doc(doc, waver->seedkeynum); cbmapiterinit(kwords); while((kbuf = cbmapiternext(kwords, &ksiz)) != NULL){ num = atoi(cbmapget(kwords, kbuf, ksiz, NULL)) * bias; if(num > 0) kwords_add(waver->kwords, kbuf, num); } if(depth < waver->seeddepth && bias > 0.0){ lnumtune = pow(cblistnum(links) + 2, 0.5); for(i = 0; i < cblistnum(links); i++){ ubuf = cbmemdup(cblistval(links, i, NULL), -1); if((pv = strchr(ubuf, '#')) != NULL) *pv = '\0'; len = strlen(ubuf); if(len > 1024 || cbmapget(ulinks, ubuf, len, NULL) || cbmapget(waver->seeds, ubuf, len, NULL)){ free(ubuf); continue; } cbmapput(ulinks, ubuf, -1, "", 0, FALSE); allow = FALSE; for(j = 0; j < cblistnum(waver->pmrules); j++){ pmrule = (PMRULE *)cblistval(waver->pmrules, j, NULL); switch(pmrule->visit){ case 1: if(est_regex_match(pmrule->regex, ubuf)) allow = TRUE; break; case -1: if(est_regex_match(pmrule->regex, ubuf)) allow = FALSE; break; } } if(allow) seedurldocs(waver, ubuf, depth + 1, bias / lnumtune, ulinks); free(ubuf); } } cbmapclose(kwords); } else { log_print(LL_INFO, "ignored: %d: %s", code, url); } est_doc_delete(doc); cblistclose(links); } /* access the number of threads */ static int accessthnum(int inc){ static pthread_mutex_t mymutex = PTHREAD_MUTEX_INITIALIZER; int thnum; if(pthread_mutex_lock(&mymutex) != 0){ log_print(LL_ERROR, "could not get mutex"); return INT_MAX; } g_thnum += inc; thnum = g_thnum; pthread_mutex_unlock(&mymutex); return thnum; } /* put the current task */ static int puttask(const char *url){ if(pthread_mutex_lock(&g_mutex) != 0){ log_print(LL_ERROR, "could not get mutex"); return FALSE; } if(!cbmapput(g_tasks, url, -1, "", 0, FALSE)){ pthread_mutex_unlock(&g_mutex); return FALSE; } pthread_mutex_unlock(&g_mutex); return TRUE; } /* put the current task */ static void outtask(const char *url){ if(pthread_mutex_lock(&g_mutex) != 0){ log_print(LL_ERROR, "could not get mutex"); return; } cbmapout(g_tasks, url, -1); pthread_mutex_unlock(&g_mutex); return; } /* get a document of URL */ static void *geturldoc(void *args){ TARGSURL *myargs; PMRULE *pmrule; WAVER *waver; CBMAP *heads, *kwords; CBLIST *links; CBDATUM *raw; ESTDOC *doc; char *url, *rec, *dpath, *epath; char numbuf[NUMBUFSIZ], *tmp; int i, thid, id, alive, code, allow; double now; accessthnum(1); myargs = args; thid = myargs->thid; waver = myargs->waver; url = myargs->url; if(!puttask(url)){ log_print(LL_DEBUG, "[%d]: early collision: %s", thid, url); free(url); free(myargs); accessthnum(-1); return NULL; } if(waver->interval > 0) est_usleep(waver->interval * 1000); alive = FALSE; raw = cbdatumopen(NULL, -1); heads = cbmapopen(); links = cblistopen(); doc = est_doc_new(); log_print(LL_INFO, "[%d]: fetching: %d: %s", thid, myargs->depth, url); fetch_document(url, waver->pxhost, waver->pxport, waver->timeout, myargs->mdate, waver->urlrules, waver->mtrules, &code, raw, heads, links, waver->unrules, doc, waver->language); if(g_sigterm){ log_print(LL_WARN, "[%d]: terminated: %s", thid, url); if(pthread_mutex_lock(&g_mutex) == 0){ tmp = cbsprintf("%d:%d:%.5f\t%s", myargs->depth, myargs->pid, myargs->psim, url); queue_enqueue(waver->queue, tmp, MINPRIOR); free(tmp); pthread_mutex_unlock(&g_mutex); } est_doc_delete(doc); cblistclose(links); cbmapclose(heads); cbdatumclose(raw); outtask(url); free(url); free(myargs); accessthnum(-1); return NULL; } if(pthread_mutex_lock(&g_mutex) == 0){ now = time(NULL); if((rec = crget(waver->trace, url, -1, 0, -1, NULL)) != NULL){ if(strtod(rec, NULL) + waver->revisit >= now){ log_print(LL_DEBUG, "[%d]: late collision: %s", thid, url); free(rec); pthread_mutex_unlock(&g_mutex); est_doc_delete(doc); cblistclose(links); cbmapclose(heads); cbdatumclose(raw); outtask(url); free(url); free(myargs); accessthnum(-1); return NULL; } free(rec); } sprintf(numbuf, "%.0f:%d:%d:%.5f#%d", now, myargs->depth, myargs->pid, myargs->psim, waver->curnode); crput(waver->trace, url, -1, numbuf, -1, CR_DOVER); if(code == 200 && est_doc_attr(doc, ESTDATTRURI)){ alive = TRUE; est_doc_slim(doc, waver->textlimit); kwords = est_morph_etch_doc(doc, waver->seedkeynum); id = 0; allow = FALSE; for(i = 0; i < cblistnum(waver->pmrules); i++){ pmrule = (PMRULE *)cblistval(waver->pmrules, i, NULL); switch(pmrule->index){ case 1: if(est_regex_match(pmrule->regex, url)) allow = TRUE; break; case -1: if(est_regex_match(pmrule->regex, url)) allow = FALSE; break; } } if(allow && !est_doc_is_empty(doc)){ est_doc_set_keywords(doc, kwords); kwords_reduce(est_doc_keywords(doc), waver->savekeynum, FALSE); if(waver->curnode > 0){ if(waver_node_put_doc(waver, doc, &code)){ log_print(LL_DEBUG, "[%d]: registered: %s", thid, url); waver->curnum++; } else { log_print(LL_ERROR, "[%d]: registration failed: %s: %d", thid, url, code); } } else { if(est_mtdb_put_doc(waver->index, doc, ESTPDCLEAN)){ log_print(LL_DEBUG, "[%d]: registered: %s", thid, url); id = est_doc_id(doc); waver->curnum++; } else { log_print(LL_ERROR, "[%d]: registration failed: %s: %s", thid, url, dperrmsg(dpecode)); } } } else { log_print(LL_DEBUG, "[%d]: not to be indexed: %s", thid, url); } enqueuelinks(waver, url, links, kwords, myargs->depth, id, myargs->pid, myargs->psim); cbmapclose(kwords); } else if(cblistnum(links) > 0){ enqueuelinks(waver, url, links, NULL, myargs->depth, myargs->pid, myargs->pid, myargs->psim); log_print(LL_INFO, "[%d]: redirected: %d: %s", thid, code, url); } else { log_print(LL_INFO, "[%d]: ignored: %d: %s", thid, code, url); } if(!alive && code != 304){ if(cbmaprnum(waver->nodes) > 0){ if(waver_node_out_doc(waver, url, &code)){ log_print(LL_DEBUG, "[%d]: deleted: %s", thid, url); } else { if(code != 400) log_print(LL_ERROR, "[%d]: deletion failed: %s: %d", thid, url, code); } } else if((id = est_mtdb_uri_to_id(waver->index, url)) > 0){ if(est_mtdb_out_doc(waver->index, id, ESTODCLEAN)){ log_print(LL_DEBUG, "[%d]: deleted: %s", thid, url); } else { log_print(LL_ERROR, "[%d]: deletion failed: %s: %s", thid, url, dperrmsg(dpecode)); } } } pthread_mutex_unlock(&g_mutex); } else { log_print(LL_ERROR, "[%d]: could not get mutex", thid); } if(code == 200){ dpath = NULL; epath = NULL; if(waver->postproc){ dpath = cbsprintf("%s%c%s%c%08d.est", waver->rootdir, ESTPATHCHR, MYTMPDIR, ESTPATHCHR, thid); epath = cbsprintf("%s%c%s%c%08d.dat", waver->rootdir, ESTPATHCHR, MYTMPDIR, ESTPATHCHR, thid); } if(waver->draftdir){ free(dpath); dpath = urltosavepath(waver->draftdir, url); } if(waver->entitydir){ free(epath); epath = urltosavepath(waver->entitydir, url); } if(dpath){ log_print(LL_DEBUG, "[%d]: saving: %s", thid, dpath); tmp = est_doc_dump_draft(doc); if(!cbwritefile(dpath, tmp, -1)) log_print(LL_ERROR, "[%d]: saving failed: %s", thid, dpath); free(tmp); } if(epath){ log_print(LL_DEBUG, "[%d]: saving: %s", thid, epath); if(!cbwritefile(epath, cbdatumptr(raw), cbdatumsize(raw))) log_print(LL_ERROR, "[%d]: saving failed: %s", thid, epath); } if(waver->postproc){ tmp = cbsprintf("%s \"%s\" \"%s\"", waver->postproc, dpath, epath); system(tmp); free(tmp); } if(epath && !waver->entitydir) unlink(epath); if(dpath && !waver->draftdir) unlink(dpath); free(dpath); free(epath); } est_doc_delete(doc); cblistclose(links); cbmapclose(heads); cbdatumclose(raw); outtask(url); free(url); free(myargs); accessthnum(-1); return NULL; } /* get the saving path of a URL */ static char *urltosavepath(const char *savedir, const char *url){ CBDATUM *buf; CBLIST *elems; const char *rp; int i; if((rp = strstr(url, "://")) != NULL) url = rp + 3; buf = cbdatumopen(NULL, -1); elems = cbsplit(url, -1, "/"); if(cbstrbwmatch(url, "/")) cblistpush(elems, "index.html", -1); cbdatumprintf(buf, "%s", savedir); for(i = 0; i < cblistnum(elems); i++){ rp = cblistval(elems, i, NULL); if(rp[0] == '\0') continue; est_mkdir(cbdatumptr(buf)); unlink(cbdatumptr(buf)); cbdatumprintf(buf, "%c%?", ESTPATHCHR, rp); } cblistclose(elems); return cbdatumtomalloc(buf, NULL); } /* END OF FILE */ hyperestraier-1.4.13/estwolefind000077500000000000000000000047531125261632700167550ustar00rootroot00000000000000#! /bin/sh #================================================================ # estwolels # List the path of cache files of wwwoffle #================================================================ # set variables LANG=C ; export LANG LC_ALL=C ; export LC_ALL PATH="$PATH:/usr/local/bin:$HOME/bin" ; export PATH progname="estwolels" spooldir="/var/spool/wwwoffle" conffile="/etc/wwwoffle/wwwoffle.conf" denysufs="css|js|csv|tsv|log|md5|crc|conf|ini|inf|lnk|sys|tmp|bak" denysufs="$denysufs|xml|xsl|xslt|rdf|rss|dtd|sgml|sgm" denysufs="$denysufs|pgp|sig|cer|csr|pem|b64|uu|uue|[0-9]" denysufs="$denysufs|rtf|pdf|ps|eps|ai|doc|xls|ppt|sxw|sxc|sxi" denysufs="$denysufs|xdw|jtd|oas|swf|mht|mhtml|mime|eml|msg" denysufs="$denysufs|zip|tar|tgz|gz|bz2|tbz2|z|lha|lzh" denysufs="$denysufs|7z|lzo|lzma|cpio|shar|cab|rar|sit|ace|hqx" denysufs="$denysufs|bin|o|a|so|exe|dll|lib|obj|ocx|class|jar|war" denysufs="$denysufs|rpm|deb|qdb|qdb|dbx|dbf|dat|bat|com" denysufs="$denysufs|png|gif|jpg|jpeg|tif|tiff|bmp|ico|pbm|pgm|ppm|xbm|xpm|dvi" denysufs="$denysufs|au|snd|mid|midi|kar|smf|mp2|mp3|m3u|wav|wma|wmp|asx|at3|aif" sizemax="1048576" # show help message if [ "$1" = "--help" ] then printf 'List the path and the URL of cache files of wwwoffle\n' printf '\n' printf 'Usage:\n' printf ' %s [spooldir]\n' "$progname" printf '\n' exit 0 fi # check the spool directory if [ -n "$1" ] then spooldir="$1" fi if [ -d "$spooldir/http" ] && [ -r "$spooldir/http" ] && [ -x "$spooldir/http" ] then true else printf '%s: cannot scan %s\n' "$progname" "$spooldir/http" 1>&2 exit 1 fi # check the configuration file confopt="" if [ -f "$conffile" ] then confopt="-c $conffile" fi # function to output URL list outputlist(){ \ls "$spooldir/http" | while read domain do wwwoffle-ls $confopt "http/$domain" done \ls "$spooldir/ftp" | while read domain do wwwoffle-ls $confopt "ftp/$domain" done } # list the path and the URL of cache files outputlist | egrep " (http|ftp)://" | egrep -i -v "\.($denysufs)$" | awk -F ' ' -v sdir="$spooldir" -v sizemax="$sizemax" ' { if($2 < 1 || $2 > sizemax) next path = $0 sub(/ .*/, "", path) prot = "http" if($0 ~ / ftp:\/\//) prot = "ftp" domain = $0 sub(/.* [A-Za-z]+:\/\//, "", domain) sub(/\/.*/, "", domain) url = $0 sub(/.* [A-Za-z]+:\/\//, "", url) lfile = url sub(/\?.*/, "", lfile) sub(/.*\//, "", lfile) printf("%s/%s/%s/%s\t%s://%s\t%s\n", sdir, prot, domain, path, prot, url, lfile) } ' # exit normally exit 0 # END OF FILE hyperestraier-1.4.13/example/000077500000000000000000000000001125261632700161265ustar00rootroot00000000000000hyperestraier-1.4.13/example/Makefile000066400000000000000000000030771125261632700175750ustar00rootroot00000000000000# Makefile for sample programs of Hyper Estraier #================================================================ # Setting Variables #================================================================ # Generic settings SHELL = /bin/sh # Targets MYBINS = coreexample001 coreexample002 nodeexample001 nodeexample002 # Building binaries CC = gcc CFLAGS = -I. -I.. `../estconfig --cflags` LDFLAGS = `../estconfig --ldflags` LIBS = -L. -L.. `../estconfig --libs` LDENV = LD_RUN_PATH=/lib:/usr/lib:$(HOME)/lib:/usr/local/lib:.:.. #================================================================ # Suffix rules #================================================================ .SUFFIXES : .SUFFIXES : .c .o .c.o : $(CC) -c $(CFLAGS) $< #================================================================ # Actions #================================================================ all : $(MYBINS) clean : rm -rf $(MYBINS) *.exe *.o a.out check.out gmon.out leak.log casket *~ .PHONY : all clean #================================================================ # Building binaries #================================================================ coreexample001 : coreexample001.o $(LDENV) $(CC) $(CFLAGS) -o $@ coreexample001.o $(LDFLAGS) $(LIBS) coreexample002 : coreexample002.o $(LDENV) $(CC) $(CFLAGS) -o $@ coreexample002.o $(LDFLAGS) $(LIBS) nodeexample001 : nodeexample001.o $(LDENV) $(CC) $(CFLAGS) -o $@ nodeexample001.o $(LDFLAGS) $(LIBS) nodeexample002 : nodeexample002.o $(LDENV) $(CC) $(CFLAGS) -o $@ nodeexample002.o $(LDFLAGS) $(LIBS) # END OF FILE hyperestraier-1.4.13/example/coreexample001.c000066400000000000000000000021461125261632700210220ustar00rootroot00000000000000#include #include #include #include int main(int argc, char **argv){ ESTDB *db; ESTDOC *doc; int ecode; /* open the database */ if(!(db = est_db_open("casket", ESTDBWRITER | ESTDBCREAT, &ecode))){ fprintf(stderr, "error: %s\n", est_err_msg(ecode)); return 1; } /* create a document object */ doc = est_doc_new(); /* add attributes to the document object */ est_doc_add_attr(doc, "@uri", "http://estraier.gov/example.txt"); est_doc_add_attr(doc, "@title", "Over the Rainbow"); /* add the body text to the document object */ est_doc_add_text(doc, "Somewhere over the rainbow. Way up high."); est_doc_add_text(doc, "There's a land that I heard of once in a lullaby."); /* register the document object to the database */ if(!est_db_put_doc(db, doc, ESTPDCLEAN)) fprintf(stderr, "error: %s\n", est_err_msg(est_db_error(db))); /* destroy the document object */ est_doc_delete(doc); /* close the database */ if(!est_db_close(db, &ecode)){ fprintf(stderr, "error: %s\n", est_err_msg(ecode)); return 1; } return 0; } hyperestraier-1.4.13/example/coreexample002.c000066400000000000000000000030361125261632700210220ustar00rootroot00000000000000#include #include #include #include int main(int argc, char **argv){ ESTDB *db; ESTCOND *cond; ESTDOC *doc; const CBLIST *texts; int ecode, *result, resnum, i, j; const char *value; /* open the database */ if(!(db = est_db_open("casket", ESTDBREADER, &ecode))){ fprintf(stderr, "error: %s\n", est_err_msg(ecode)); return 1; } /* create a search condition object */ cond = est_cond_new(); /* set the search phrase to the search condition object */ est_cond_set_phrase(cond, "rainbow AND lullaby"); /* get the result of search */ result = est_db_search(db, cond, &resnum, NULL); /* for each document in the result */ for(i = 0; i < resnum; i++){ /* retrieve the document object */ if(!(doc = est_db_get_doc(db, result[i], 0))) continue; /* display attributes */ if((value = est_doc_attr(doc, "@uri")) != NULL) printf("URI: %s\n", value); if((value = est_doc_attr(doc, "@title")) != NULL) printf("Title: %s\n", value); /* display the body text */ texts = est_doc_texts(doc); for(j = 0; j < cblistnum(texts); j++){ value = cblistval(texts, j, NULL); printf("%s\n", value); } /* destroy the document object */ est_doc_delete(doc); } /* free the result of search */ free(result); /* destroy the search condition object */ est_cond_delete(cond); /* close the database */ if(!est_db_close(db, &ecode)){ fprintf(stderr, "error: %s\n", est_err_msg(ecode)); return 1; } return 0; } hyperestraier-1.4.13/example/nodeexample001.c000066400000000000000000000023141125261632700210140ustar00rootroot00000000000000#include #include #include #include #include int main(int argc, char **argv){ ESTNODE *node; ESTDOC *doc; /* initialize the network environment */ if(!est_init_net_env()){ fprintf(stderr, "error: network is unavailable\n"); return 1; } /* create and configure the node connection object */ node = est_node_new("http://localhost:1978/node/test1"); est_node_set_auth(node, "admin", "admin"); /* create a document object */ doc = est_doc_new(); /* add attributes to the document object */ est_doc_add_attr(doc, "@uri", "http://estraier.gov/example.txt"); est_doc_add_attr(doc, "@title", "Over the Rainbow"); /* add the body text to the document object */ est_doc_add_text(doc, "Somewhere over the rainbow. Way up high."); est_doc_add_text(doc, "There's a land that I heard of once in a lullaby."); /* register the document object to the node */ if(!est_node_put_doc(node, doc)) fprintf(stderr, "error: %d\n", est_node_status(node)); /* destroy the document object */ est_doc_delete(doc); /* destroy the node object */ est_node_delete(node); /* free the networking environment */ est_free_net_env(); return 0; } hyperestraier-1.4.13/example/nodeexample002.c000066400000000000000000000030601125261632700210140ustar00rootroot00000000000000#include #include #include #include #include int main(int argc, char **argv){ ESTNODE *node; ESTCOND *cond; ESTNODERES *nres; ESTRESDOC *rdoc; int i; const char *value; /* initialize the network environment */ if(!est_init_net_env()){ fprintf(stderr, "error: network is unavailable\n"); return 1; } /* create the node connection object */ node = est_node_new("http://localhost:1978/node/test1"); /* create a search condition object */ cond = est_cond_new(); /* set the search phrase to the search condition object */ est_cond_set_phrase(cond, "rainbow AND lullaby"); /* get the result of search */ nres = est_node_search(node, cond, 0); if(nres){ /* for each document in the result */ for(i = 0; i < est_noderes_doc_num(nres); i++){ /* get a result document object */ rdoc = est_noderes_get_doc(nres, i); /* display attributes */ if((value = est_resdoc_attr(rdoc, "@uri")) != NULL) printf("URI: %s\n", value); if((value = est_resdoc_attr(rdoc, "@title")) != NULL) printf("Title: %s\n", value); /* display the snippet text */ printf("%s", est_resdoc_snippet(rdoc)); } /* delete the node result object */ est_noderes_delete(nres); } else { fprintf(stderr, "error: %d\n", est_node_status(node)); } /* destroy the search condition object */ est_cond_delete(cond); /* destroy the node object */ est_node_delete(node); /* free the networking environment */ est_free_net_env(); return 0; } hyperestraier-1.4.13/filter/000077500000000000000000000000001125261632700157605ustar00rootroot00000000000000hyperestraier-1.4.13/filter/estfxasis000077500000000000000000000021361125261632700177210ustar00rootroot00000000000000#! /bin/sh #================================================================ # extfxasis # Filter for Hyper Estraier, just through #================================================================ # set variables PATH="$PATH:/usr/local/bin:$HOME/bin:." ; export PATH progname="estfxasis" # check arguments if [ $# -lt 1 ] then printf '%s: usage: %s infile [outfile]\n' "$progname" "$progname" 1>&2 exit 1 fi infile="$1" outfile="$2" if [ -n "$ESTORIGFILE" ] && [ -f "$ESTORIGFILE" ] then infile="$ESTORIGFILE" fi # check the input if [ "!" -f "$infile" ] then printf '%s: %s: no such file\n' "$progname" "$infile" 1>&2 exit 1 fi # initialize the output file if [ -n "$outfile" ] then rm -f "$outfile" fi # function to output output(){ if [ -n "$outfile" ] then cat >> "$outfile" else cat fi } # limit the resource ulimit -v 262144 -t 10 2> "/dev/null" # output the result printf 'infile: %s\n' "$infile" 1>&2 printf 'outfile: %s\n' "$outfile" 1>&2 printf 'ESTORIGFILE: %s\n' "$ESTORIGFILE" 1>&2 cat "$infile" 2> "/dev/null" | output # exit normally exit 0 # END OF FILE hyperestraier-1.4.13/filter/estfxmantotxt000077500000000000000000000020471125261632700206410ustar00rootroot00000000000000#! /bin/sh #================================================================ # extfxmantotxt # Convert man (troff-andoc) into plain text. #================================================================ # set variables PATH="$PATH:/usr/local/bin:$HOME/bin:." ; export PATH MANWIDTH=262144 ; export MANWIDTH progname="estfxmantotxt" # check arguments if [ $# -lt 1 ] then printf '%s: usage: %s infile [outfile]\n' "$progname" "$progname" 1>&2 exit 1 fi infile="$1" outfile="$2" if [ -n "$ESTORIGFILE" ] && [ -f "$ESTORIGFILE" ] then infile="$ESTORIGFILE" fi # check the input if [ "!" -f "$infile" ] then printf '%s: %s: no such file\n' "$progname" "$infile" 1>&2 exit 1 fi # initialize the output file if [ -n "$outfile" ] then rm -f "$outfile" fi # function to output output(){ if [ -n "$outfile" ] then cat >> "$outfile" else cat fi } # limit the resource ulimit -v 262144 -t 10 2> "/dev/null" # output the result man "$infile" 2> "/dev/null" | col -b | tr '\t' ' ' | output # exit normally exit 0 # END OF FILE hyperestraier-1.4.13/filter/estfxmsotohtml000077500000000000000000000023571125261632700210150ustar00rootroot00000000000000#! /bin/sh #================================================================ # extfxmsotohtml # Convert MS-Word, MS-Excel, or MS-PowerPoint into HTML #================================================================ # set variables PATH="$PATH:/usr/local/bin:$HOME/bin:." ; export PATH progname="estfxmsotohtml" # check arguments if [ $# -lt 1 ] then printf '%s: usage: %s infile [outfile]\n' "$progname" "$progname" 1>&2 exit 1 fi infile="$1" outfile="$2" if [ -n "$ESTORIGFILE" ] && [ -f "$ESTORIGFILE" ] then infile="$ESTORIGFILE" fi # check the input if [ "!" -f "$infile" ] then printf '%s: %s: no such file\n' "$progname" "$infile" 1>&2 exit 1 fi # initialize the output file if [ -n "$outfile" ] then rm -f "$outfile" fi # function to output output(){ if [ -n "$outfile" ] then cat >> "$outfile" else cat fi } # limit the resource ulimit -v 262144 -t 10 2> "/dev/null" # output the result case "$infile" in *.doc) wvWare --charset=UTF-8 --nographics "$infile" 2> "/dev/null" | output ;; *.xls) xlhtml "$infile" 2> "/dev/null" | output ;; *.ppt) ppthtml "$infile" 2> "/dev/null" | output ;; *) printf '
    !!! UNKNOWN FORMAT !!!
    \n' | output ;; esac # exit normally exit 0 # END OF FILE hyperestraier-1.4.13/filter/estfxpdftohtml000077500000000000000000000017701125261632700207660ustar00rootroot00000000000000#! /bin/sh #================================================================ # extfxpdftohtml # Convert PDF into HTML #================================================================ # set variables PATH="$PATH:/usr/local/bin:$HOME/bin:." ; export PATH progname="estfxpdftohtml" # check arguments if [ $# -lt 1 ] then printf '%s: usage: %s infile [outfile]\n' "$progname" "$progname" 1>&2 exit 1 fi infile="$1" outfile="$2" if [ -n "$ESTORIGFILE" ] && [ -f "$ESTORIGFILE" ] then infile="$ESTORIGFILE" fi # check the input if [ "!" -f "$infile" ] then printf '%s: %s: no such file\n' "$progname" "$infile" 1>&2 exit 1 fi # initialize the output file if [ -n "$outfile" ] then rm -f "$outfile" fi # function to output output(){ if [ -n "$outfile" ] then cat >> "$outfile" else cat fi } # limit the resource ulimit -v 262144 -t 10 2> "/dev/null" # output the result pdftotext -enc UTF-8 -htmlmeta "$infile" - 2> "/dev/null" | output # exit normally exit 0 # END OF FILE hyperestraier-1.4.13/filter/estfxxdwtotxt000077500000000000000000000017571125261632700206770ustar00rootroot00000000000000#! /bin/sh #================================================================ # extfxxdwtotxt # Convert DocuWorks into plain text. #================================================================ # set variables PATH="$PATH:/usr/local/bin:$HOME/bin:." ; export PATH progname="estfxxdwtotxt" # check arguments if [ $# -lt 1 ] then printf '%s: usage: %s infile [outfile]\n' "$progname" "$progname" 1>&2 exit 1 fi infile="$1" outfile="$2" if [ -n "$ESTORIGFILE" ] && [ -f "$ESTORIGFILE" ] then infile="$ESTORIGFILE" fi # check the input if [ "!" -f "$infile" ] then printf '%s: %s: no such file\n' "$progname" "$infile" 1>&2 exit 1 fi # initialize the output file if [ -n "$outfile" ] then rm -f "$outfile" fi # function to output output(){ if [ -n "$outfile" ] then cat >> "$outfile" else cat fi } # limit the resource ulimit -v 262144 -t 10 2> "/dev/null" # output the result xdw2text -p "$infile" "/tmp/dummy.$$" | output # exit normally exit 0 # END OF FILE hyperestraier-1.4.13/filter/estwnetxpnd000077500000000000000000000020411125261632700202660ustar00rootroot00000000000000#! /bin/sh #================================================================ # estwnetsyno # List synonyms of a word using WordNet #================================================================ # set variables LANG=C ; export LANG LC_ALL=C ; export LC_ALL PATH="$PATH:/usr/local/bin:$HOME/bin:/usr/WordNet-*/bin:/usr/local/WordNet-*/bin" ; export PATH progname="estwnetsyno" word="$1" if [ -z "$word" ] then word="$ESTWORD" fi # show help message if [ "$1" = "--help" ] then printf 'List synonyms of a word using WordNet\n' printf '\n' printf 'Usage:\n' printf ' %s word\n' "$progname" printf '\n' exit 0 fi # limit the resource ulimit -v 262144 -t 30 2> "/dev/null" # list synonyms wn "$word" -o -synsn -synsv -synsa -synsr | awk ' /^{[0-9]*} */ { sub(/^{[0-9]*} */, "") gsub(/\([^)]*\)/, "") split($0, terms, /,/) for(i in terms){ term = tolower(terms[i]) sub(/^ +/, "", term) sub(/ +$/, "", term) if(length(term) > 0) printf("%s\n", term) } } ' | sort | uniq # exit normally exit 0 # END OF FILE hyperestraier-1.4.13/hyperestraier.pc.in000066400000000000000000000005661125261632700203210ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ libdir=@libdir@ libexecdir=@libexecdir@ includedir=@includedir@ datadir=@datadir@ Name: Hyper Estraier Description: a full-text search system for communities Version: @PACKAGE_VERSION@ Requires: qdbm >= 1.8.75 Libs: -L${libdir} @MYLDOPTS@ -lestraier @MYSKLIBS@ @MYMTLIBS@ @LIBS@ Cflags: -I${includedir} @MYCPPOPTS@ hyperestraier-1.4.13/increm/000077500000000000000000000000001125261632700157505ustar00rootroot00000000000000hyperestraier-1.4.13/increm/estseek-form.html000066400000000000000000000035341125261632700212470ustar00rootroot00000000000000 Hyper Estraier: a full-text search system for communities
    hyperestraier-1.4.13/increm/estseek-frame.html000066400000000000000000000015771125261632700214030ustar00rootroot00000000000000 Incremental Search with Hyper Estraier <body> <p>See this page with a browser supporting frameset.</p> </body> hyperestraier-1.4.13/javanative/000077500000000000000000000000001125261632700166235ustar00rootroot00000000000000hyperestraier-1.4.13/javanative/Cmd.java000066400000000000000000000534521125261632700202020ustar00rootroot00000000000000/************************************************************************************************* * Java binding of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ package estraier; import java.util.*; import java.io.*; import java.net.*; /** * Command line utility for the core API. */ public class Cmd { //---------------------------------------------------------------- // class fields //---------------------------------------------------------------- /* class constants */ private static final String PROTVER = "1.0"; private static final int SEARCHMAX = 10; private static final int SEARCHAUX = 32; private static final int SNIPWWIDTH = 480; private static final int SNIPHWIDTH = 96; private static final int SNIPAWIDTH = 96; private static final int VM_ID = 0; private static final int VM_URI = 1; private static final int VM_ATTR = 2; private static final int VM_FULL = 3; private static final int VM_SNIP = 4; private static final PrintStream stdout = System.out; private static final PrintStream stderr = System.err; //---------------------------------------------------------------- // public static methods //---------------------------------------------------------------- /** * Main routine of the command. * @param args command line arguments. The first argument specifies the name of the sub * command. "put", "out", "edit", "get", "uriid", "inform", "optimize", "merge", "search" are * provided. */ public static void main(String[] args){ int rv = 0; if(args.length < 1) usage(); if(args[0].equals("put")){ rv = runput(args); } else if(args[0].equals("out")){ rv = runout(args); } else if(args[0].equals("edit")){ rv = runedit(args); } else if(args[0].equals("get")){ rv = runget(args); } else if(args[0].equals("uriid")){ rv = runuriid(args); } else if(args[0].equals("inform")){ rv = runinform(args); } else if(args[0].equals("optimize")){ rv = runoptimize(args); } else if(args[0].equals("merge")){ rv = runmerge(args); } else if(args[0].equals("search")){ rv = runsearch(args); } else { usage(); } System.exit(rv); } //---------------------------------------------------------------- // private static methods //---------------------------------------------------------------- /* print the usage and exit */ private static void usage(){ stderr.println("command line utility for the core API of Hyper Estraier"); stderr.println(""); stderr.println("synopsis:"); stderr.println(" java " + Cmd.class.getName() + " arguments..."); stderr.println(""); stderr.println("arguments:"); stderr.println(" put [-cl] [-ws] db [file]"); stderr.println(" out [-cl] db expr"); stderr.println(" edit db expr name [value]"); stderr.println(" get db expr [attr]"); stderr.println(" uriid db uri"); stderr.println(" inform db"); stderr.println(" optimize [-onp] [-ond] db"); stderr.println(" merge [-cl] db target"); stderr.println(" search [-vu|-va|-vf|-vs] [-gs|-gf|-ga] [-cd] [-ni] [-sf|-sfr|-sfu|-sfi]" + " [-attr expr] [-ord expr] [-max num] [-sk num] [-aux num] [-dis name]" + " db [phrase]"); stderr.println(""); System.exit(1); } /* print error string and flush the buffer */ private static void printerror(String msg){ stderr.println(Cmd.class.getName() + ": " + msg); stderr.flush(); } /* parse arguments of the put command */ private static int runput(String[] args){ String dbname = null; String file = null; int opts = 0; for(int i = 1; i < args.length; i++){ String arg = args[i]; if(dbname == null && arg.startsWith("-")){ if(arg.equals("-cl")){ opts |= Database.PDCLEAN; } else if(arg.equals("-ws")){ opts |= Database.PDWEIGHT; } else { usage(); } } else if(dbname == null){ dbname = arg; } else if(file == null){ file = arg; } else { usage(); } } if(dbname == null) usage(); return procput(dbname, file, opts); } /* parse arguments of the out command */ private static int runout(String[] args){ String dbname = null; String expr = null; int opts = 0; for(int i = 1; i < args.length; i++){ String arg = args[i]; if(dbname == null && arg.startsWith("-")){ if(arg.equals("-cl")){ opts |= Database.ODCLEAN; } else { usage(); } } else if(dbname == null){ dbname = arg; } else if(expr == null){ expr = arg; } else { usage(); } } if(dbname == null || expr == null) usage(); return procout(dbname, expr, opts); } /* parse arguments of the edit command */ private static int runedit(String[] args){ String dbname = null; String expr = null; String name = null; String value = null; for(int i = 1; i < args.length; i++){ String arg = args[i]; if(dbname == null && arg.startsWith("-")){ usage(); } else if(dbname == null){ dbname = arg; } else if(expr == null){ expr = arg; } else if(name == null){ name = arg; } else if(value == null){ value = arg; } else { usage(); } } if(dbname == null || expr == null || name == null) usage(); return procedit(dbname, expr, name, value); } /* parse arguments of the get command */ private static int runget(String[] args){ String dbname = null; String expr = null; String attr = null; for(int i = 1; i < args.length; i++){ String arg = args[i]; if(dbname == null && arg.startsWith("-")){ usage(); } else if(dbname == null){ dbname = arg; } else if(expr == null){ expr = arg; } else if(attr == null){ attr = arg; } else { usage(); } } if(dbname == null || expr == null) usage(); return procget(dbname, expr, attr); } /* parse arguments of the uriid command */ private static int runuriid(String[] args){ String dbname = null; String uri = null; for(int i = 1; i < args.length; i++){ String arg = args[i]; if(dbname == null && arg.startsWith("-")){ usage(); } else if(dbname == null){ dbname = arg; } else if(uri == uri){ uri = arg; } else { usage(); } } if(dbname == null || uri == null) usage(); return procuriid(dbname, uri); } /* parse arguments of the inform command */ private static int runinform(String[] args){ String dbname = null; for(int i = 1; i < args.length; i++){ String arg = args[i]; if(dbname == null && arg.startsWith("-")){ usage(); } else if(dbname == null){ dbname = arg; } else { usage(); } } if(dbname == null) usage(); return procinform(dbname); } /* parse arguments of the optimize command */ private static int runoptimize(String[] args){ String dbname = null; int opts = 0; for(int i = 1; i < args.length; i++){ String arg = args[i]; if(dbname == null && arg.startsWith("-")){ if(arg.equals("-onp")){ opts |= Database.OPTNOPURGE; } else if(arg.equals("-ond")){ opts |= Database.OPTNODBOPT; } else { usage(); } } else if(dbname == null){ dbname = arg; } else { usage(); } } if(dbname == null) usage(); return procoptimize(dbname, opts); } /* parse arguments of the merge command */ private static int runmerge(String[] args){ String dbname = null; String tgname = null; int opts = 0; for(int i = 1; i < args.length; i++){ String arg = args[i]; if(dbname == null && arg.startsWith("-")){ if(arg.equals("-cl")){ opts |= Database.MGCLEAN; } else { usage(); } } else if(dbname == null){ dbname = arg; } else if(tgname == null){ tgname = arg; } else { usage(); } } if(dbname == null || tgname == null) usage(); return procmerge(dbname, tgname, opts); } /* parse arguments of the search command */ private static int runsearch(String[] args){ String dbname = null; String phrase = null; List attrs = new ArrayList(3); String ord = null; int max = SEARCHMAX; int skip = 0; int opts = 0; int aux = SEARCHAUX; String dis = null; boolean cd = false; int view = VM_ID; for(int i = 1; i < args.length; i++){ String arg = args[i]; if(dbname == null && arg.startsWith("-")){ if(arg.equals("-vu")){ view = VM_URI; } else if(arg.equals("-va")){ view = VM_ATTR; } else if(arg.equals("-vf")){ view = VM_FULL; } else if(arg.equals("-vs")){ view = VM_SNIP; } else if(arg.equals("-gs")){ opts |= Condition.SURE; } else if(arg.equals("-gf")){ opts |= Condition.FAST; } else if(arg.equals("-ga")){ opts |= Condition.AGITO; } else if(arg.equals("-cd")){ cd = true; } else if(arg.equals("-ni")){ opts |= Condition.NOIDF; } else if(arg.equals("-sf")){ opts |= Condition.SIMPLE; } else if(arg.equals("-sfr")){ opts |= Condition.ROUGH; } else if(arg.equals("-sfu")){ opts |= Condition.UNION; } else if(arg.equals("-sfi")){ opts |= Condition.ISECT; } else if(arg.equals("-attr")){ if(++i >= args.length) usage(); attrs.add(args[i]); } else if(arg.equals("-ord")){ if(++i >= args.length) usage(); ord = args[i]; } else if(arg.equals("-max")){ if(++i >= args.length) usage(); max = Integer.parseInt(args[i]); } else if(arg.equals("-sk")){ if(++i >= args.length) usage(); skip = Integer.parseInt(args[i]); } else if(arg.equals("-aux")){ if(++i >= args.length) usage(); aux = Integer.parseInt(args[i]); } else if(arg.equals("-dis")){ if(++i >= args.length) usage(); dis = args[i]; } else { usage(); } } else if(dbname == null){ dbname = arg; } else if(phrase == null){ phrase = arg; } else { phrase = phrase + " " + arg; } } if(dbname == null) usage(); return procsearch(dbname, phrase, attrs, ord, max, skip, opts, aux, dis, cd, view); } /* perform the put command */ private static int procput(String dbname, String file, int opts){ byte[] data = null; if(file != null){ FileInputStream fis = null; try { fis = new FileInputStream(file); data = Utility.read_all(fis); } catch(IOException e){ printerror(e.toString()); return 1; } finally { try { if(fis != null) fis.close(); } catch(IOException e){} } } else { try { data = Utility.read_all(System.in); } catch(IOException e){ printerror(e.toString()); return 1; } } String draft = null; try { draft = new String(data, "UTF-8"); } catch(UnsupportedEncodingException e){ printerror(e.toString()); return 1; } Document doc = new Document(draft); Database db = new Database(); if(!db.open(dbname, Database.DBWRITER | Database.DBCREAT)){ printerror(dbname + ": " + db.err_msg(db.error())); return 1; } db.set_informer(new DatabaseInformerImpl()); if(!db.put_doc(doc, opts)){ printerror(dbname + ": " + db.err_msg(db.error())); db.close(); return 1; } if(!db.close()){ printerror(dbname + ": " + db.err_msg(db.error())); return 1; } return 0; } /* perform the out command */ private static int procout(String dbname, String expr, int opts){ Database db = new Database(); if(!db.open(dbname, Database.DBWRITER)){ printerror(dbname + ": " + db.err_msg(db.error())); return 1; } db.set_informer(new DatabaseInformerImpl()); int id = -1; try { id = Integer.parseInt(expr); } catch(NumberFormatException e){ id = -1; } if(id < 1 && (id = db.uri_to_id(expr)) < 1){ printerror(dbname + ": " + db.err_msg(db.error())); db.close(); return 1; } if(!db.out_doc(id, opts)){ printerror(dbname + ": " + db.err_msg(db.error())); db.close(); return 1; } if(!db.close()){ printerror(dbname + ": " + db.err_msg(db.error())); return 1; } return 0; } /* perform the edit command */ private static int procedit(String dbname, String expr, String name, String value){ Database db = new Database(); if(!db.open(dbname, Database.DBWRITER)){ printerror(dbname + ": " + db.err_msg(db.error())); return 1; } db.set_informer(new DatabaseInformerImpl()); int id = -1; try { id = Integer.parseInt(expr); } catch(NumberFormatException e){ id = -1; } if(id < 1 && (id = db.uri_to_id(expr)) < 1){ printerror(dbname + ": " + db.err_msg(db.error())); db.close(); return 1; } Document doc = db.get_doc(id, Database.GDNOTEXT); if(doc == null){ printerror(dbname + ": " + db.err_msg(db.error())); db.close(); return 1; } doc.add_attr(name, value); if(!db.edit_doc(doc)){ printerror(dbname + ": " + db.err_msg(db.error())); db.close(); return 1; } if(!db.close()){ printerror(dbname + ": " + db.err_msg(db.error())); return 1; } return 0; } /* perform the get command */ private static int procget(String dbname, String expr, String attr){ Database db = new Database(); if(!db.open(dbname, Database.DBREADER)){ printerror(dbname + ": " + db.err_msg(db.error())); return 1; } int id = -1; try { id = Integer.parseInt(expr); } catch(NumberFormatException e){ id = -1; } if(id < 1 && (id = db.uri_to_id(expr)) < 1){ printerror(dbname + ": " + db.err_msg(db.error())); db.close(); return 1; } if(attr != null){ String value = db.get_doc_attr(id, attr); if(value == null){ printerror(dbname + ": " + db.err_msg(db.error())); db.close(); return 1; } stdout.println(value); } else { Document doc = db.get_doc(id, 0); if(doc == null){ printerror(dbname + ": " + db.err_msg(db.error())); db.close(); return 1; } stdout.print(doc.dump_draft()); } if(!db.close()){ printerror(dbname + ": " + db.err_msg(db.error())); return 1; } return 0; } /* perform the uriid command */ private static int procuriid(String dbname, String uri){ Database db = new Database(); if(!db.open(dbname, Database.DBREADER)){ printerror(dbname + ": " + db.err_msg(db.error())); return 1; } int id = db.uri_to_id(uri); if(id < 1){ printerror(dbname + ": " + db.err_msg(db.error())); db.close(); return 1; } stdout.println(id); if(!db.close()){ printerror(dbname + ": " + db.err_msg(db.error())); return 1; } return 0; } /* perform the inform command */ private static int procinform(String dbname){ Database db = new Database(); if(!db.open(dbname, Database.DBREADER)){ printerror(dbname + ": " + db.err_msg(db.error())); return 1; } stdout.println("number of documents: " + db.doc_num()); stdout.println("number of words: " + db.word_num()); stdout.println("file size: " + (long)db.size()); if(!db.close()){ printerror(dbname + ": " + db.err_msg(db.error())); return 1; } return 0; } /* perform the optimize command */ private static int procoptimize(String dbname, int opts){ Database db = new Database(); if(!db.open(dbname, Database.DBWRITER)){ printerror(dbname + ": " + db.err_msg(db.error())); return 1; } db.set_informer(new DatabaseInformerImpl()); if(!db.optimize(opts)){ printerror(dbname + ": " + db.err_msg(db.error())); db.close(); return 1; } if(!db.close()){ printerror(dbname + ": " + db.err_msg(db.error())); return 1; } return 0; } /* perform the merge command */ private static int procmerge(String dbname, String tgname, int opts){ Database db = new Database(); if(!db.open(dbname, Database.DBWRITER)){ printerror(dbname + ": " + db.err_msg(db.error())); return 1; } db.set_informer(new DatabaseInformerImpl()); if(!db.merge(tgname, opts)){ printerror(dbname + ": " + db.err_msg(db.error())); db.close(); return 1; } if(!db.close()){ printerror(dbname + ": " + db.err_msg(db.error())); return 1; } return 0; } /* perform the search command */ private static int procsearch(String dbname, String phrase, List attrs, String ord, int max, int skip, int opts, int aux, String dis, boolean cd, int view){ Database db = new Database(); if(!db.open(dbname, Database.DBREADER)){ printerror(dbname + ": " + db.err_msg(db.error())); return 1; } Condition cond = new Condition(); if(phrase != null) cond.set_phrase(phrase); Iterator attrsit = attrs.iterator(); while(attrsit.hasNext()){ cond.add_attr((String)attrsit.next()); } if(ord != null) cond.set_order(ord); if(max >= 0) cond.set_max(max); if(skip >= 0) cond.set_skip(skip); cond.set_options(opts); cond.set_auxiliary(aux); if(dis != null) cond.set_distinct(dis); long stime = new GregorianCalendar().getTimeInMillis(); Result res = db.search(cond); long etime = new GregorianCalendar().getTimeInMillis(); String border = "--------[" + stime + "]--------"; stdout.println(border); stdout.println("VERSION\t" + PROTVER); stdout.println("NODE\tlocal"); stdout.println("HIT\t" + res.hint("")); List snwords = new ArrayList(); Iterator wordsit = res.hint_words().iterator(); for(int i = 1; wordsit.hasNext(); i++){ String word = (String)wordsit.next(); int hits = res.hint(word); if(hits > 0) snwords.add(word); stdout.println("HINT#" + i + "\t" + word + "\t" + hits); } stdout.println("TIME\t" + ((etime - stime) / 1000.0)); stdout.println("DOCNUM\t" + db.doc_num()); stdout.println("WORDNUM\t" + db.word_num()); if(view == VM_URI){ stdout.println("VIEW\tURI"); } else if(view == VM_ATTR){ stdout.println("VIEW\tATTRIBUTE"); } else if(view == VM_FULL){ stdout.println("VIEW\tFULL"); } else if(view == VM_SNIP){ stdout.println("VIEW\tSNIPPET"); } else { stdout.println("VIEW\tID"); } stdout.println(""); if(view != VM_ATTR && view != VM_FULL && view != VM_SNIP) stdout.println(border); int dnum = res.doc_num(); for(int i = 0; i < dnum; i++){ int id = res.get_doc_id(i); if(view == VM_URI){ Document doc = db.get_doc(id, cd ? 0 : Database.GDNOTEXT); if(doc == null) continue; if(cd && !db.scan_doc(doc, cond)) continue; stdout.println(id + "\t" + doc.attr("@uri")); } else if(view == VM_ATTR){ Document doc = db.get_doc(id, cd ? 0 : Database.GDNOTEXT); if(doc == null) continue; if(cd && !db.scan_doc(doc, cond)) continue; stdout.println(border); Iterator it = doc.attr_names().iterator(); while(it.hasNext()){ String name = (String)it.next(); stdout.println(name + "=" + doc.attr(name)); } stdout.println(""); } else if(view == VM_FULL){ Document doc = db.get_doc(id, 0); if(doc == null) continue; if(cd && !db.scan_doc(doc, cond)) continue; stdout.println(border); stdout.print(doc.dump_draft()); } else if(view == VM_SNIP){ Document doc = db.get_doc(id, 0); if(doc == null) continue; if(cd && !db.scan_doc(doc, cond)) continue; stdout.println(border); Iterator it = doc.attr_names().iterator(); while(it.hasNext()){ String name = (String)it.next(); stdout.println(name + "=" + doc.attr(name)); } stdout.println(""); stdout.print(doc.make_snippet(snwords, SNIPWWIDTH, SNIPHWIDTH, SNIPAWIDTH)); } else { stdout.println(id); } } stdout.println(border + ":END"); if(!db.close()){ printerror(dbname + ": " + db.err_msg(db.error())); return 1; } return 0; } /* dummy method: hide the constructor */ private Cmd(){} } /** * Command line utility for the core API. */ class DatabaseInformerImpl implements DatabaseInformer { /* inform of a database event */ public void inform(String message){ System.out.println(Cmd.class.getName() + ": INFO: " + message); } } /* END OF FILE */ hyperestraier-1.4.13/javanative/Condition.java000066400000000000000000000151461125261632700214230ustar00rootroot00000000000000/************************************************************************************************* * Java binding of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ package estraier; import java.util.*; import java.io.*; import java.net.*; /** * Abstraction of search condition. */ public class Condition { //---------------------------------------------------------------- // static initializer //---------------------------------------------------------------- static { Utility.init(); } //---------------------------------------------------------------- // public constants //---------------------------------------------------------------- /** option: check every N-gram key */ public static final int SURE = 1 << 0; /** option: check N-gram keys skipping by one */ public static final int USUAL = 1 << 1; /** option: check N-gram keys skipping by two */ public static final int FAST = 1 << 2; /** option: check N-gram keys skipping by three */ public static final int AGITO = 1 << 3; /** option: without TF-IDF tuning */ public static final int NOIDF = 1 << 4; /** option: with the simplified phrase */ public static final int SIMPLE = 1 << 10; /** option: with the rough phrase */ public static final int ROUGH = 1 << 11; /** option: with the union phrase */ public static final int UNION = 1 << 15; /** option: with the intersection phrase */ public static final int ISECT = 1 << 16; /** eclipse tuning: consider URL */ public static final double ECLSIMURL = 10.0; /** eclipse tuning: on server basis */ public static final double ECLSERV = 100.0; /** eclipse tuning: on directory basis */ public static final double ECLDIR = 101.0; /** eclipse tuning: on file basis */ public static final double ECLFILE = 102.0; //---------------------------------------------------------------- // private fields //---------------------------------------------------------------- /** pointer to the native object */ private long coreptr; //---------------------------------------------------------------- // constructors and finalizers //---------------------------------------------------------------- /** * Create a search condition object. */ public Condition(){ initialize(); } /** * Release resources. */ protected void finalize(){ destroy(); } //---------------------------------------------------------------- // public methods //---------------------------------------------------------------- /** * Set the search phrase. * @param phrase a search phrase. */ public native void set_phrase(String phrase); /** * Add an expression for an attribute. * @param expr an expression for an attribute. */ public native void add_attr(String expr); /** * Set the order. * @param expr an expression for the order. By default, the order is by score descending. */ public native void set_order(String expr); /** * Set the maximum number of retrieval. * @param max the maximum number of retrieval. By default, the number of retrieval is not * limited. */ public native void set_max(int max); /** * Set the number of skipped documents. * @param skip the number of documents to be skipped in the search result. */ public native void set_skip(int skip); /** * Set options of retrieval. * @param options options: `Condition.SURE' specifies that it checks every N-gram key, * `Condition.USUAL', which is the default, specifies that it checks N-gram keys with skipping * one key, `Condition.FAST' skips two keys, `Condition.AGITO' skips three keys, * `Condition.NOIDF' specifies not to perform TF-IDF tuning, `Condition.SIMPLE' specifies to * use simplified phrase, `Condition.ROUGH' specifies to use rough phrase, `Condition.UNION' * specifies to use union phrase, `Condition.ISECT' specifies to use intersection phrase. Each * option can be specified at the same time by bitwise or. If keys are skipped, though search * speed is improved, the relevance ratio grows less. */ public native void set_options(int options); /** * Set permission to adopt result of the auxiliary index. * @param min the minimum hits to adopt result of the auxiliary index. If it is not more * than 0, the auxiliary index is not used. By default, it is 32. */ public native void set_auxiliary(int min); /** * Set the lower limit of similarity eclipse. * @param limit the lower limit of similarity for documents to be eclipsed. Similarity is * between 0.0 and 1.0. If the limit is added by `Condition.ECLSIMURL', similarity is * weighted by URL. If the limit is `Condition.ECLSERV', similarity is ignored and documents * in the same server are eclipsed. If the limit is `Condition.ECLDIR', similarity is ignored * and documents in the same directory are eclipsed. If the limit is `Condition.ECLFILE', * similarity is ignored and documents of the same file are eclipsed. */ public native void set_eclipse(double limit); /** * Set the attribute distinction filter. * @param name the name of an attribute to be distinct. */ public native void set_distinct(String name); /** * Set the mask of targets of meta search. * @param mask a masking number. 1 means the first target, 2 means the second target, 4 means * the third target and, power values of 2 and their summation compose the mask. */ public native void set_mask(int mask); //---------------------------------------------------------------- // private methods //---------------------------------------------------------------- /** * Set the native object. */ private native void initialize(); /** * Delete the native object. */ private native void destroy(); } /* END OF FILE */ hyperestraier-1.4.13/javanative/Database.java000066400000000000000000000346261125261632700212050ustar00rootroot00000000000000/************************************************************************************************* * Java binding of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ package estraier; import java.util.*; import java.io.*; import java.net.*; /** * Abstraction of database */ public class Database { //---------------------------------------------------------------- // static initializer //---------------------------------------------------------------- static { Utility.init(); } //---------------------------------------------------------------- // public constants //---------------------------------------------------------------- /** version of Hyper Estraier */ public static final String VERSION = version(); /** error code: no error */ public static final int ERRNOERR = 0; /** error code: invalid argument */ public static final int ERRINVAL = 1; /** error code: access forbidden */ public static final int ERRACCES = 2; /** error code: lock failure */ public static final int ERRLOCK = 3; /** error code: database problem */ public static final int ERRDB = 4; /** error code: I/O problem */ public static final int ERRIO = 5; /** error code: no item */ public static final int ERRNOITEM = 6; /** error code: miscellaneous */ public static final int ERRMISC = 9999; /** open mode: open as a reader */ public static final int DBREADER = 1 << 0; /** open mode: open as a writer */ public static final int DBWRITER = 1 << 1; /** open mode: a writer creating */ public static final int DBCREAT = 1 << 2; /** open mode: a writer truncating */ public static final int DBTRUNC = 1 << 3; /** open mode: open without locking */ public static final int DBNOLCK = 1 << 4; /** open mode: lock without blocking */ public static final int DBLCKNB = 1 << 5; /** open mode: use perfect N-gram analyzer */ public static final int DBPERFNG = 1 << 10; /** open mode: use character category analyzer */ public static final int DBCHRCAT = 1 << 11; /** open mode: small tuning */ public static final int DBSMALL = 1 << 20; /** open mode: large tuning */ public static final int DBLARGE = 1 << 21; /** open mode: huge tuning */ public static final int DBHUGE = 1 << 22; /** open mode: huge tuning second */ public static final int DBHUGE2 = 1 << 23; /** open mode: huge tuning third */ public static final int DBHUGE3 = 1 << 24; /** open mode: store scores as void */ public static final int DBSCVOID = 1 << 25; /** open mode: store scores as integer */ public static final int DBSCINT = 1 << 26; /** open mode: refrain from adjustment of scores */ public static final int DBSCASIS = 1 << 27; /** attribute index type: for multipurpose sequencial access method */ public static final int IDXATTRSEQ = 0; /** attribute index type: for narrowing with attributes as strings */ public static final int IDXATTRSTR = 1; /** attribute index type: for narrowing with attributes as numbers */ public static final int IDXATTRNUM = 2; /** optimize option: omit purging dispensable region of deleted */ public static final int OPTNOPURGE = 1 << 0; /** optimize option: omit optimization of the database files */ public static final int OPTNODBOPT = 1 << 1; /** merge option: clean up dispensable regions */ public static final int MGCLEAN = 1 << 0; /** put_doc option: clean up dispensable regions */ public static final int PDCLEAN = 1 << 0; /** put_doc option: weight scores statically when indexing */ public static final int PDWEIGHT = 1 << 1; /** out_doc option: clean up dispensable regions */ public static final int ODCLEAN = 1 << 0; /** get_doc option: no attributes */ public static final int GDNOATTR = 1 << 0; /** get_doc option: no text */ public static final int GDNOTEXT = 1 << 1; /** get_doc option: no keywords */ public static final int GDNOKWD = 1 << 2; //---------------------------------------------------------------- // public static methods //---------------------------------------------------------------- /** * Search plural databases for documents corresponding a condition. * @param dbs an array whose elements are database objects. * @param cond a condition object. * @return a result object. On error, `null' is returned. */ public static native Result search_meta(Database[] dbs, Condition cond); //---------------------------------------------------------------- // private static methods //---------------------------------------------------------------- /** * Get the version of Hyper Estraier. * @return the version of Hyper Estraier. */ private static native String version(); //---------------------------------------------------------------- // private fields //---------------------------------------------------------------- /** pointer to the native object */ private long coreptr; /** last happened error code */ private int ecode; /** callback function to inform of database events */ private DatabaseInformer informer; //---------------------------------------------------------------- // constructors and finalizers //---------------------------------------------------------------- /** * Create a database object. */ public Database(){ coreptr = 0; ecode = ERRNOERR; } /** * Release resources. */ protected void finalize(){ if(coreptr != 0) close(); } //---------------------------------------------------------------- // public methods //---------------------------------------------------------------- /** * Get the string of an error code. * @param ecode an error code. * @return the string of the error code. */ public native String err_msg(int ecode); /** * Open the database. * @param name the name of a database directory. * @param omode open modes: `Database.DBWRITER' as a writer, `Database.DBREADER' as a reader. * If the mode is `Database.DBWRITER', the following may be added by bitwise or: * `Database.DBCREAT', which means it creates a new database if not exist, `Database.DBTRUNC', * which means it creates a new database regardless if one exists. Both of `Database.DBREADER' * and `Database.DBWRITER' can be added to by bitwise or: `Database.DBNOLCK', which means it * opens a database file without file locking, or `Database.DBLCKNB', which means locking is * performed without blocking. If `Database.DBNOLCK' is used, the application is responsible * for exclusion control. `Database.DBCREAT' can be added to by bitwise or: * `Database.DBPERFNG', which means N-gram analysis is performed against European text also, * `Database.DBCHACAT', which means character category analysis is performed instead of N-gram * analysis, `Database.DBSMALL', which means the index is tuned to register less than 50000 * documents, `Database.DBLARGE', which means the index is tuned to register more than 300000 * documents, `Database.DBHUGE', which means the index is tuned to register more than 1000000 * documents, `Database.DBHUGE2', which means the index is tuned to register more than 5000000 * documents, `Database.DBHUGE3', which means the index is tuned to register more than 10000000 * documents, `Database.DBSCVOID', which means scores are stored as void, `Database.DBSCINT', * which means scores are stored as 32-bit integer, `Database.DBSCASIS', which means scores * are stored as-is and marked not to be tuned when search. * @return true if success, else it is false. */ public native boolean open(String name, int omode); /** * Close the database. * @return true if success, else it is false. */ public native boolean close(); /** * Get the last happened error code. * @return the last happened error code. */ public native int error(); /** * Check whether the database has a fatal error. * @return true if the database has fatal erroor, else it is false. */ public native boolean fatal(); /** * Add an index for narrowing or sorting with document attributes. * @param name the name of an attribute. * @param type the data type of attribute index; `Database.IDXATTRSEQ' for multipurpose * sequencial access method, `Database.IDXATTRSTR' for narrowing with attributes as strings, * `Database.IDXATTRNUM' for narrowing with attributes as numbers. * @return true if success, else it is false. */ public native boolean add_attr_index(String name, int type); /** * Flush index words in the cache. * @param max the maximum number of words to be flushed. If it not more than zero, all words * are flushed. * @return true if success, else it is false. */ public native boolean flush(int max); /** * Synchronize updating contents. * @return true if success, else it is false. */ public native boolean sync(); /** * Optimize the database. * @param options options: `Database.OPTNOPURGE' to omit purging dispensable region of deleted * documents, `Database.OPTNODBOPT' to omit optimization of the database files. The two can be * specified at the same time by bitwise or. * @return true if success, else it is false. */ public native boolean optimize(int options); /** * Merge another database. * @param name the name of another database directory. * @param options options: `Database.MGCLEAN' to clean up dispensable regions of the deleted * document. * @return true if success, else it is false. */ public native boolean merge(String name, int options); /** * Add a document. * @param doc a document object. The document object should have the URI attribute. * @param options options: `Database.PDCLEAN' to clean up dispensable regions of the * overwritten document. * @return true if success, else it is false. */ public native boolean put_doc(Document doc, int options); /** * Remove a document. * @param id the ID number of a registered document. * @param options options: `Database.ODCLEAN' to clean up dispensable regions of the deleted * document. * @return true if success, else it is false. */ public native boolean out_doc(int id, int options); /** * Edit attributes of a document. * @param doc a document object. * @return true if success, else it is false. */ public native boolean edit_doc(Document doc); /** * Retrieve a document. * @param id the ID number of a registered document. * @param options options: `Database.GDNOATTR' to ignore attributes, `Database.GDNOTEXT' to * ignore the body text, `Database.GDNOKWD' to ignore keywords. The three can be specified at # the same time by bitwise or. * @return a document object. On error, `null' is returned. */ public native Document get_doc(int id, int options); /** * Retrieve the value of an attribute of a document. * @param id the ID number of a registered document. * @param name the name of an attribute. * @return the value of the attribute or `null' if it does not exist. */ public native String get_doc_attr(int id, String name); /** * Get the ID of a document specified by URI. * @param uri the URI of a registered document. * @return the ID of the document. On error, -1 is returned. */ public native int uri_to_id(String uri); /** * Get the name. * @return the name of the database. */ public native String name(); /** * Get the number of documents. * @return the number of documents in the database. */ public native int doc_num(); /** * Get the number of unique words. * @return the number of unique words in the database. */ public native int word_num(); /** * Get the size. * @return the size of the database. */ public native double size(); /** * Search for documents corresponding a condition. * @param cond a condition object. * @return a result object. On error, `null' is returned. */ public native Result search(Condition cond); /** * Check whether a document object matches the phrase of a search condition object definitely. * @param doc a document object. * @param cond a search condition object. * @return true if the document matches the phrase of the condition object definitely, else it * is false. */ public native boolean scan_doc(Document doc, Condition cond); /** * Set the maximum size of the cache memory. * @param size the maximum size of the index cache. By default, it is 64MB. If it is not * more than 0, the current size is not changed. * @param anum the maximum number of cached records for document attributes. By default, it * is 8192. If it is not more than 0, the current size is not changed. * @param tnum the maximum number of cached records for document texts. By default, it is * 1024. If it is not more than 0, the current size is not changed. * @param rnum the maximum number of cached records for occurrence results. By default, it * is 256. If it is not more than 0, the current size is not changed. */ public native void set_cache_size(double size, int anum, int tnum, int rnum); /** * Add a pseudo index directory. * @param path the path of a pseudo index directory. * @return true if success, else it is false. */ public native boolean add_pseudo_index(String path); /** * Set the maximum number of expansion of wild cards. * @param num the maximum number of expansion of wild cards. */ public native void set_wildmax(int num); /** * Set the callback function to inform of database events. * @param informer an arbitrary object with a method named as `inform'. */ public synchronized native void set_informer(DatabaseInformer informer); } /* END OF FILE */ hyperestraier-1.4.13/javanative/DatabaseInformer.java000066400000000000000000000030101125261632700226660ustar00rootroot00000000000000/************************************************************************************************* * Java binding of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ package estraier; import java.util.*; import java.io.*; import java.net.*; /** * Interface of database informer */ public interface DatabaseInformer { //---------------------------------------------------------------- // public methods //---------------------------------------------------------------- /** * Inform of a database event. * @param message a message of each event. */ void inform(String message); } /* END OF FILE */ hyperestraier-1.4.13/javanative/Document.java000066400000000000000000000126531125261632700212530ustar00rootroot00000000000000/************************************************************************************************* * Java binding of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ package estraier; import java.util.*; import java.io.*; import java.net.*; /** * Abstraction of document. */ public class Document { //---------------------------------------------------------------- // static initializer //---------------------------------------------------------------- static { Utility.init(); } //---------------------------------------------------------------- // private fields //---------------------------------------------------------------- /** pointer to the native object */ private long coreptr; //---------------------------------------------------------------- // constructors and finalizers //---------------------------------------------------------------- /** * Create a document object. */ public Document(){ initialize(); } /** * Create a document object made from draft data. * @param draft a string of draft data. */ public Document(String draft){ initialize(draft); } /** * Release resources. */ protected void finalize(){ destroy(); } //---------------------------------------------------------------- // public methods //---------------------------------------------------------------- /** * Add an attribute. * @param name the name of an attribute. * @param value the value of the attribute. If it is `null', the attribute is removed. */ public native void add_attr(String name, String value); /** * Add a sentence of text. * @param text sentence of text. */ public native void add_text(String text); /** * Add a hidden sentence. * @param text a hidden sentence. */ public native void add_hidden_text(String text); /** * Attach keywords. * @param kwords a map object of keywords. Keys of the map should be keywords of the document * and values should be their scores in decimal string. */ public native void set_keywords(Map kwords); /** * Set the substitute score. * @param score the substitute score. It it is negative, the substitute score setting is * nullified. */ public native void set_score(int score); /** * Get the ID number. * @return the ID number. If this object has never been registered, -1 is returned. */ public native int id(); /** * Get a list of attribute names. * @return a list object of attribute names. */ public native List attr_names(); /** * Get the value of an attribute. * @param name the name of an attribute. * @return the value of the attribute or `null' if it does not exist. */ public native String attr(String name); /** * Get a list of sentences of the text. * @return a list object of sentences of the text. */ public native List texts(); /** * Concatenate sentences of the text. * @return concatenated sentences. */ public native String cat_texts(); /** * Get attached keywords. * @return a map object of keywords and their scores in decimal string. If no keyword is * attached, `null' is returned. */ public native Map keywords(); /** * Get the substitute score. * @return the substitute score or -1 if it is not set. */ public native int score(); /** * Dump draft data. * @return draft data. */ public native String dump_draft(); /** * Make a snippet of the body text. * @param words a list object of words to be highlight. * @param wwidth whole width of the result. * @param hwidth width of strings picked up from the beginning of the text. * @param awidth width of strings picked up around each highlighted word. * @return a snippet string of the body text. There are tab separated values. Each line is a * string to be shown. Though most lines have only one field, some lines have two fields. If * the second field exists, the first field is to be shown with highlighted, and the second * field means its normalized form. */ public native String make_snippet(java.util.List words, int wwidth, int hwidth, int awidth); //---------------------------------------------------------------- // private methods //---------------------------------------------------------------- /** * Set the native object. */ private native void initialize(); /** * Set the native object with draft data. */ private native void initialize(String draft); /** * Delete the native object. */ private native void destroy(); } /* END OF FILE */ hyperestraier-1.4.13/javanative/Makefile.in000066400000000000000000000161321125261632700206730ustar00rootroot00000000000000# Makefile for the Java binding of Hyper Estraier #================================================================ # Setting Variables #================================================================ # Generic settings SHELL = @SHELL@ # Packaging PACKAGE = @PACKAGE_NAME@ VERSION = @PACKAGE_VERSION@ LIBVER = @LIBVER@ LIBREV = @LIBREV@ # Targets MYJARS = estraier.jar MYJAVAS = Document.java Condition.java Database.java DatabaseInformer.java \ Result.java Utility.java Cmd.java MYLIBOBJS = document.o condition.o database.o result.o myconf.o MYLIBS = libjestraier.so.$(LIBVER).$(LIBREV).0 \ libjestraier.so.$(LIBVER) libjestraier.so MYMACLIBS = libjestraier.$(LIBVER).$(LIBREV).0.dylib \ libjestraier.$(LIBVER).dylib libjestraier.dylib MYHPUXLIBS = libjestraier.sl MYWINLIBS = libjestraier.dll.a # Install destinations prefix = @prefix@ exec_prefix = @exec_prefix@ MYHEADDIR = @includedir@ MYLIBDIR = @libdir@ DESTDIR = # Building binaries MYJAVAHOME = @MYJAVAHOME@ JVMPLATFORM = @JVMPLATFORM@ JAVAC = @JAVAC@ JAVACFLAGS = -d . JAR = @JAR@ JAVAH = @JAVAH@ JAVADOC = @JAVADOC@ JAVARUN = @JAVARUN@ CC = @CC@ CPPFLAGS = @CPPFLAGS@ -I. -I.. -I$(MYHEADDIR) \ -I$(HOME)/include -I/usr/local/include -I/usr/include/qdbm @MYCPPOPTS@ \ -I$(MYJAVAHOME)/include -I$(MYJAVAHOME)/include/$(JVMPLATFORM) -I$(MYJAVAHOME)/Headers \ -D_XOPEN_SOURCE_EXTENDED=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__=1 -D_HPUX_SOURCE=1 \ -DPIC=1 -D_THREAD_SAFE=1 -D_REENTRANT=1 @DEFS@ CFLAGS = @MYCFLAGS@ LDFLAGS = @LDFLAGS@ -L. -L.. -L$(MYLIBDIR) -L$(HOME)/lib -L/usr/local/lib @MYLDOPTS@ LIBS = @LIBS@ MTLIBS = @MYMTLIBS@ SKLIBS = @MYSKLIBS@ RUNENV = LD_LIBRARY_PATH=.:..:/lib:/usr/lib:$(MYLIBDIR):$(HOME)/lib:/usr/local/lib:@MYRUNPATH@ #================================================================ # Suffix rules #================================================================ .SUFFIXES : .SUFFIXES : .c .o .java .class .c.o : $(CC) $(CPPFLAGS) $(CFLAGS) -c $< #================================================================ # Actions #================================================================ all : $(MYJARS) $(MYLIBS) @printf '\n' @printf '#================================================================\n' @printf '# Ready to install.\n' @printf '#================================================================\n' clean : rm -rf estraier *.class $(MYJARS) $(MYLIBS) *.jar *.o *.a *.so \ *.exe *.dll.a *.dll *.dylib *.jnilib *.sl a.out check.out *.log casket *~ install : mkdir -p $(DESTDIR)$(MYLIBDIR) cp -Rf $(MYJARS) $(MYLIBS) $(DESTDIR)$(MYLIBDIR) @printf '\n' @printf '#================================================================\n' @printf '# Thanks for using Hyper Estraier for Java.\n' @printf '#================================================================\n' uninstall : cd $(DESTDIR)$(MYLIBDIR) && rm -f $(MYJARS) $(MYLIBS) dist : autoconf make doc make distclean distclean : clean cd example && make clean rm -rf Makefile config.cache config.log config.status autom4te.cache head : estraier.jar CLASSPATH=estraier.jar $(JAVAH) -jni \ estraier.Document estraier.Condition estraier.Database estraier.Result check : rm -rf casket $(RUNENV) $(JAVARUN) -cp estraier.jar estraier.Cmd put casket ../misc/test001.est $(RUNENV) $(JAVARUN) -cp estraier.jar estraier.Cmd put casket ../misc/test002.est $(RUNENV) $(JAVARUN) -cp estraier.jar estraier.Cmd put casket ../misc/test003.est $(RUNENV) $(JAVARUN) -cp estraier.jar estraier.Cmd put casket ../misc/test004.est $(RUNENV) $(JAVARUN) -cp estraier.jar estraier.Cmd put casket ../misc/test005.est $(RUNENV) $(JAVARUN) -cp estraier.jar estraier.Cmd put casket ../misc/test006.est $(RUNENV) $(JAVARUN) -cp estraier.jar estraier.Cmd edit casket 1 "@title" "java" $(RUNENV) $(JAVARUN) -cp estraier.jar estraier.Cmd get casket 1 $(RUNENV) $(JAVARUN) -cp estraier.jar estraier.Cmd get casket 1 "@title" $(RUNENV) $(JAVARUN) -cp estraier.jar estraier.Cmd out casket 1 $(RUNENV) $(JAVARUN) -cp estraier.jar estraier.Cmd inform casket $(RUNENV) $(JAVARUN) -cp estraier.jar estraier.Cmd optimize casket $(RUNENV) $(JAVARUN) -cp estraier.jar estraier.Cmd search \ -vf -cd casket "estraier" > check.out $(RUNENV) $(JAVARUN) -cp estraier.jar estraier.Cmd search \ -vs -gs -attr "@uri" -ord "@mdate NUMD" -max 1 casket "estraier OR mikio" > check.out rm -rf casket mac : make MYLIBS="$(MYMACLIBS)" CFLAGS="-Wall -fsigned-char -fno-common -O2 -DNDEBUG" check-mac : make RUNENV="DYLD_LIBRARY_PATH=." check install-mac : make MYLIBS="$(MYMACLIBS)" install hpux : make MYLIBS="$(MYHPUXLIBS)" check-hpux : make RUNENV="SHLIB_PATH=." check install-hpux : make MYLIBS="$(MYHPUXLIBS)" install uninstall-hpux : make MYLIBS="$(MYHPUXLIBS)" uninstall win : make CC="gcc -mno-cygwin" MYLIBS="$(MYWINLIBS)" \ CFLAGS="-Wall -fsigned-char -O0 -DNDEBUG" LIBS="-lestraier -lqdbm -lz -liconv" \ MTLIBS="-lpthreadGC2" SKLIBS="-lws2_32" doc : make docclean mkdir -p ../doc/javanativeapi $(JAVADOC) -locale en -windowtitle estraier -overview overview.html \ -tag note:a:"Note:" -d ../doc/javanativeapi -nodeprecated -nohelp -quiet *.java docclean : rm -rf ../doc/javanativeapi .PHONY : all clean install casket check #================================================================ # Building binaries #================================================================ estraier.jar : $(MYJAVAS) $(JAVAC) $(JAVACFLAGS) $(MYJAVAS) $(JAR) cvf $@ estraier/*.class libjestraier.so.$(LIBVER).$(LIBREV).0 : $(MYLIBOBJS) if $(CC) --print-prog-name=ld | egrep -i '(solaris|/ccs/|/ucb/)' > /dev/null ; \ then \ $(CC) -shared -Wl,-G,-h,libjestraier.so.$(LIBVER) -o $@ $(MYLIBOBJS) \ $(LDFLAGS) $(SKLIBS) $(MTLIBS) $(LIBS) ; \ else \ $(CC) -shared -Wl,-soname,libjestraier.so.$(LIBVER) -o $@ $(MYLIBOBJS) \ $(LDFLAGS) $(SKLIBS) $(MTLIBS) $(LIBS) ; \ fi libjestraier.so.$(LIBVER) : libjestraier.so.$(LIBVER).$(LIBREV).0 ln -f -s libjestraier.so.$(LIBVER).$(LIBREV).0 $@ libjestraier.so : libjestraier.so.$(LIBVER).$(LIBREV).0 ln -f -s libjestraier.so.$(LIBVER).$(LIBREV).0 $@ libjestraier.$(LIBVER).$(LIBREV).0.dylib : $(MYLIBOBJS) $(CC) -dynamiclib -o $@ \ -install_name $(MYLIBDIR)/libjestraier.$(LIBVER).dylib \ -current_version $(LIBVER).$(LIBREV).0 \ -compatibility_version $(LIBVER) \ $(MYLIBOBJS) $(LDFLAGS) $(SKLIBS) $(MTLIBS) $(LIBS) libjestraier.$(LIBVER).dylib : libjestraier.$(LIBVER).$(LIBREV).0.dylib ln -f -s libjestraier.$(LIBVER).$(LIBREV).0.dylib $@ libjestraier.dylib : libjestraier.$(LIBVER).$(LIBREV).0.dylib ln -f -s libjestraier.$(LIBVER).$(LIBREV).0.dylib $@ libjestraier.sl : $(MYLIBOBJS) $(CC) -shared -Wl,-b -o $@ $(MYLIBOBJS) libjestraier.dll.a : jestraier.dll jestraier.dll : $(MYLIBOBJS) $(CC) -shared -o $@ \ -Wl,--out-implib=lib$@.a \ -Wl,--export-all-symbols \ -Wl,--enable-auto-import \ -Wl,--add-stdcall-alias \ -Wl,--whole-archive \ -Wl,--no-whole-archive \ $(MYLIBOBJS) $(LDFLAGS) $(SKLIBS) $(MTLIBS) $(LIBS) document.o : estraier_Document.h condition.o : estraier_Condition.h database.o : estraier_Database.h result.o : estraier_Result.h $(MYLIBOBJS) : myconf.h # END OF FILE hyperestraier-1.4.13/javanative/Result.java000066400000000000000000000113451125261632700207500ustar00rootroot00000000000000/************************************************************************************************* * Java binding of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ package estraier; import java.util.*; import java.io.*; import java.net.*; /** * Abstraction of result set from database. */ public class Result { //---------------------------------------------------------------- // private fields //---------------------------------------------------------------- /** ID numbers of corresponding documents */ private int[] ids; /** indexes of database array of meta search */ private int[] dbidxs; /** map for hints */ private Map hints; /** pointer to the native condition object */ private long condptr; //---------------------------------------------------------------- // constructors and finalizers //---------------------------------------------------------------- /** * Create a result set object. */ Result(int[] ids, Map hints, long condptr){ this.ids = ids; this.dbidxs = null; this.hints = hints; this.condptr = condptr; } /** * Create a result set object for meta search. */ Result(int[] ids, int[] dbidxs, Map hints, long condptr){ this.ids = ids; this.dbidxs = dbidxs; this.hints = hints; this.condptr = condptr; } /** * Release resources. */ protected void finalize(){ destroy(); } //---------------------------------------------------------------- // public methods //---------------------------------------------------------------- /** * Get the number of documents. * @return the number of documents in the result. */ public int doc_num(){ return ids.length; } /** * Get the ID number of a document. * @param index the index of a document. * @return the ID number of the document or -1 if the index is out of bounds. */ public int get_doc_id(int index){ if(index < 0 || index >= ids.length) return -1; return ids[index]; } /** * Get the index of the container database of a document. * @param index the index of a document. * @return the index of the container database of the document or -1 if the index is out of * bounds. */ public int get_dbidx(int index){ if(dbidxs == null || index < 0 || index >= dbidxs.length) return -1; return dbidxs[index]; } /** * Get a list of hint words. * @return a list of hint words. */ public List hint_words(){ List words = new ArrayList(hints.size()); Iterator it = hints.keySet().iterator(); while(it.hasNext()){ String word = (String)it.next(); if(word.length() > 0) words.add(word); } return words; } /** * Get the value of a hint word. * @param word a hint word. An empty string means the number of whole result. * @return the number of documents corresponding the hint word. If the word is in a negative * condition, the value is negative. */ public int hint(String word){ String value = (String)hints.get(word); if(value == null) return 0; int rv = 0; try { rv = Integer.parseInt(value); } catch(NumberFormatException e){} return rv; } /** * Get the score of a document. * @param index the index of a document. * @return the score of the document or -1 if the index is out of bounds. */ public native int get_score(int index); /** * Get an array of ID numbers of eclipsed docuemnts of a document. * @param id the ID number of a parent document. * @return an array whose elements expresse the ID numbers and their scores alternately. */ public native int[] get_shadows(int id); //---------------------------------------------------------------- // private methods //---------------------------------------------------------------- /** * Delete the native resources. */ private native void destroy(); } /* END OF FILE */ hyperestraier-1.4.13/javanative/Utility.java000066400000000000000000000033571125261632700211410ustar00rootroot00000000000000/************************************************************************************************* * Java binding of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ package estraier; import java.util.*; import java.io.*; import java.net.*; /** * Tool box of utility methods. */ final class Utility { /** * Initialize the runtime environment. */ static void init(){ System.loadLibrary("jestraier"); } /** * Read whole data from a stream. * @param is an input stream object. * @return an array of while data. */ static byte[] read_all(InputStream is) throws IOException { byte[] iobuf = new byte[8192]; ByteArrayOutputStream baos = new ByteArrayOutputStream(); int len; while((len = is.read(iobuf)) >= 0){ baos.write(iobuf, 0, len); } return baos.toByteArray(); } } /* END OF FILE */ hyperestraier-1.4.13/javanative/condition.c000066400000000000000000000157261125261632700207700ustar00rootroot00000000000000/************************************************************************************************* * Java binding of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #include "estraier_Condition.h" #include "myconf.h" /************************************************************************************************* * public objects *************************************************************************************************/ /* set_phrase */ JNIEXPORT void JNICALL Java_estraier_Condition_set_1phrase(JNIEnv *env, jobject obj, jstring phrase){ jclass cls; jfieldID fid; jlong coreptr; jboolean icphrase; const char *tphrase; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(!phrase || !isinstanceof(env, phrase, CLSSTRING)){ throwillarg(env); return; } if(!(tphrase = (*env)->GetStringUTFChars(env, phrase, &icphrase))){ throwoutmem(env); return; } est_cond_set_phrase((ESTCOND *)(PTRNUM)coreptr, tphrase); if(icphrase == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, phrase, tphrase); } /* add_attr */ JNIEXPORT void JNICALL Java_estraier_Condition_add_1attr(JNIEnv *env, jobject obj, jstring expr){ jclass cls; jfieldID fid; jlong coreptr; jboolean icexpr; const char *texpr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(!expr || !isinstanceof(env, expr, CLSSTRING)){ throwillarg(env); return; } if(!(texpr = (*env)->GetStringUTFChars(env, expr, &icexpr))){ throwoutmem(env); return; } est_cond_add_attr((ESTCOND *)(PTRNUM)coreptr, texpr); if(icexpr == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, expr, texpr); } /* set_order */ JNIEXPORT void JNICALL Java_estraier_Condition_set_1order(JNIEnv *env, jobject obj, jstring expr){ jclass cls; jfieldID fid; jlong coreptr; jboolean icexpr; const char *texpr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(!expr || !isinstanceof(env, expr, CLSSTRING)){ throwillarg(env); return; } if(!(texpr = (*env)->GetStringUTFChars(env, expr, &icexpr))){ throwoutmem(env); return; } est_cond_set_order((ESTCOND *)(PTRNUM)coreptr, texpr); if(icexpr == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, expr, texpr); } /* set_max */ JNIEXPORT void JNICALL Java_estraier_Condition_set_1max(JNIEnv *env, jobject obj, jint max){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(max < 0){ throwillarg(env); return; } est_cond_set_max((ESTCOND *)(PTRNUM)coreptr, max); } /* set_skip */ JNIEXPORT void JNICALL Java_estraier_Condition_set_1skip(JNIEnv *env, jobject obj, jint skip){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(skip < 0){ throwillarg(env); return; } est_cond_set_skip((ESTCOND *)(PTRNUM)coreptr, skip); } /* set_options */ JNIEXPORT void JNICALL Java_estraier_Condition_set_1options(JNIEnv *env, jobject obj, jint options){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); est_cond_set_options((ESTCOND *)(PTRNUM)coreptr, options); } /* set_auxiliary */ JNIEXPORT void JNICALL Java_estraier_Condition_set_1auxiliary(JNIEnv *env, jobject obj, jint min){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); est_cond_set_auxiliary((ESTCOND *)(PTRNUM)coreptr, min); } /* set_eclipse */ JNIEXPORT void JNICALL Java_estraier_Condition_set_1eclipse(JNIEnv *env, jobject obj, jdouble limit){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); est_cond_set_eclipse((ESTCOND *)(PTRNUM)coreptr, limit); } /* set_distinct */ JNIEXPORT void JNICALL Java_estraier_Condition_set_1distinct(JNIEnv *env, jobject obj, jstring name){ jclass cls; jfieldID fid; jlong coreptr; jboolean icname; const char *tname; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(!name || !isinstanceof(env, name, CLSSTRING)){ throwillarg(env); return; } if(!(tname = (*env)->GetStringUTFChars(env, name, &icname))){ throwoutmem(env); return; } est_cond_set_distinct((ESTCOND *)(PTRNUM)coreptr, tname); if(icname == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, name, tname); } /* set_mask */ JNIEXPORT void JNICALL Java_estraier_Condition_set_1mask(JNIEnv *env, jobject obj, jint mask){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); est_cond_set_mask((ESTCOND *)(PTRNUM)coreptr, mask); } /* initialize */ JNIEXPORT void JNICALL Java_estraier_Condition_initialize(JNIEnv *env, jobject obj){ jclass cls; jfieldID fid; ESTCOND *cond; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); cond = est_cond_new(); est_cond_set_options(cond, ESTCONDSCFB); (*env)->SetLongField(env, obj, fid, (PTRNUM)cond); } /* destroy */ JNIEXPORT void JNICALL Java_estraier_Condition_destroy(JNIEnv *env, jobject obj){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); est_cond_delete((ESTCOND *)(PTRNUM)coreptr); } /* END OF FILE */ hyperestraier-1.4.13/javanative/configure000077500000000000000000004553571125261632700205550ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for hyperestraier-javanative 1.0.0. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='hyperestraier-javanative' PACKAGE_TARNAME='hyperestraier-javanative' PACKAGE_VERSION='1.0.0' PACKAGE_STRING='hyperestraier-javanative 1.0.0' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP LIBVER LIBREV MYJAVAHOME JVMPLATFORM JAVAC JAR JAVAH JAVADOC JAVARUN MYCFLAGS MYCPPOPTS MYLDOPTS MYMTLIBS MYSKLIBS MYRUNPATH LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures hyperestraier-javanative 1.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of hyperestraier-javanative 1.0.0:";; esac cat <<\_ACEOF Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF hyperestraier-javanative configure 1.0.0 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by hyperestraier-javanative $as_me 1.0.0, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Export variables LIBVER=1 LIBREV=0 MYJAVAHOME="/usr/java" JVMPLATFORM="linux" JAVAC="javac" JAR="jar" JAVAH="javah" JAVADOC="javadoc" JAVARUN="java" MYCFLAGS="-Wall -fPIC -fsigned-char -O2 -fomit-frame-pointer -fforce-addr" MYCPPOPTS="-DNDEBUG" MYLDOPTS="" MYMTLIBS="" MYSKLIBS="" MYRUNPATH="" # Building paths pathtmp="$PATH" PATH="..:$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin" PATH="$PATH:/usr/ccs/bin:/usr/ucb:/usr/xpg4/bin:/usr/xpg6/bin:$pathtmp" LIBRARY_PATH="..:$HOME/lib:/usr/local/lib:$LIBRARY_PATH" LD_LIBRARY_PATH="..:$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH" CPATH="..:$HOME/include:/usr/local/include:$CPATH" PKG_CONFIG_PATH="..:$HOME/lib/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH if type pkg-config > /dev/null 2>&1 then PATH="$PATH:`pkg-config --variable=bindir qdbm`" PATH="$PATH:`pkg-config --variable=bindir hyperestraier`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir hyperestraier`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir hyperestraier`" CPATH="$CPATH:`pkg-config --variable=includedir qdbm`" CPATH="$CPATH:`pkg-config --variable=includedir hyperestraier`" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH fi #================================================================ # Checking Commands to Build with #================================================================ # Home directory of Java printf 'checking MYJAVAHOME... ' if test -d "$JAVA_HOME" then MYJAVAHOME="$JAVA_HOME" fi printf '%s\n' "$MYJAVAHOME" # Platform of Java printf 'checking JVMPLATFORM... ' if uname | grep Darwin > /dev/null then JVMPLATFORM="mac" else for file in `\ls $MYJAVAHOME/include` do if test -d "$MYJAVAHOME/include/$file" then JVMPLATFORM="$file" fi done fi printf '%s\n' "$JVMPLATFORM" # Java compiler printf 'checking JAVAC... ' JAVAC="$MYJAVAHOME/bin/javac" if uname | grep Darwin > /dev/null then if test -x "$MYJAVAHOME/Commands/javac" then JAVAC="$MYJAVAHOME/Commands/javac" else JAVAC="$MYJAVAHOME/bin/javac" fi fi if test -x "$JAVAC" then printf '%s\n' "$JAVAC" else printf 'no\n' printf '#================================================================\n' 1>&2 printf '# WARNING: %s is not found.\n' "$JAVAC" 1>&2 printf '#================================================================\n' 1>&2 fi # Other building tools if uname | grep Darwin > /dev/null then if test -x "$MYJAVAHOME/Commands/java" then JAR="$MYJAVAHOME/Commands/jar" JAVAH="$MYJAVAHOME/Commands/javah" JAVADOC="$MYJAVAHOME/Commands/javadoc" JAVARUN="$MYJAVAHOME/Commands/java" else JAR="$MYJAVAHOME/bin/jar" JAVAH="$MYJAVAHOME/bin/javah" JAVADOC="$MYJAVAHOME/bin/javadoc" JAVARUN="$MYJAVAHOME/bin/java" fi else JAR="$MYJAVAHOME/bin/jar" JAVAH="$MYJAVAHOME/bin/javah" JAVADOC="$MYJAVAHOME/bin/javadoc" JAVARUN="$MYJAVAHOME/bin/java" fi # C compiler ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if uname | egrep -i 'SunOS' > /dev/null 2>&1 then MYCFLAGS="-Wall -fPIC -fsigned-char -O1" fi if uname | egrep -i 'BSD' > /dev/null 2>&1 then MYCFLAGS="-Wall -fPIC -fsigned-char -O1" fi if gcc --version | egrep -i '^2\.(8|9)' > /dev/null 2>&1 then MYCFLAGS="-Wall -fPIC -fsigned-char -O1" fi # Data types if uname | grep '^SunOS' > /dev/null then MYCPPOPTS="$MYCPPOPTS -Dint64_t=long\ long" elif uname | grep '^CYGWIN' > /dev/null then MYCPPOPTS="$MYCPPOPTS -D__int64=long\ long" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for void *" >&5 echo $ECHO_N "checking for void *... $ECHO_C" >&6 if test "${ac_cv_type_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((void * *) 0) return 0; if (sizeof (void *)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_void_p=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_void_p=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 echo "${ECHO_T}$ac_cv_type_void_p" >&6 echo "$as_me:$LINENO: checking size of void *" >&5 echo $ECHO_N "checking size of void *... $ECHO_C" >&6 if test "${ac_cv_sizeof_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_void_p" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (void *))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (void *), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (void *)); } unsigned long ulongval () { return (long) (sizeof (void *)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (void *))) < 0) { long i = longval (); if (i != ((long) (sizeof (void *)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (void *)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_void_p=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (void *), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_void_p=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF echo "$as_me:$LINENO: checking for int" >&5 echo $ECHO_N "checking for int... $ECHO_C" >&6 if test "${ac_cv_type_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((int *) 0) return 0; if (sizeof (int)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_int=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 echo "${ECHO_T}$ac_cv_type_int" >&6 echo "$as_me:$LINENO: checking size of int" >&5 echo $ECHO_N "checking size of int... $ECHO_C" >&6 if test "${ac_cv_sizeof_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_int" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (int)); } unsigned long ulongval () { return (long) (sizeof (int)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (int))) < 0) { long i = longval (); if (i != ((long) (sizeof (int)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (int)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_int=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_int=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 echo "${ECHO_T}$ac_cv_sizeof_int" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF # Underlying libraries echo "$as_me:$LINENO: checking for main in -lc" >&5 echo $ECHO_N "checking for main in -lc... $ECHO_C" >&6 if test "${ac_cv_lib_c_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_c_main" >&5 echo "${ECHO_T}$ac_cv_lib_c_main" >&6 if test $ac_cv_lib_c_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBC 1 _ACEOF LIBS="-lc $LIBS" fi echo "$as_me:$LINENO: checking for main in -lm" >&5 echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6 if test "${ac_cv_lib_m_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_m_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5 echo "${ECHO_T}$ac_cv_lib_m_main" >&6 if test $ac_cv_lib_m_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi echo "$as_me:$LINENO: checking for main in -liconv" >&5 echo $ECHO_N "checking for main in -liconv... $ECHO_C" >&6 if test "${ac_cv_lib_iconv_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liconv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_iconv_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_iconv_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_main" >&5 echo "${ECHO_T}$ac_cv_lib_iconv_main" >&6 if test $ac_cv_lib_iconv_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBICONV 1 _ACEOF LIBS="-liconv $LIBS" fi echo "$as_me:$LINENO: checking for main in -lz" >&5 echo $ECHO_N "checking for main in -lz... $ECHO_C" >&6 if test "${ac_cv_lib_z_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_z_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_z_main" >&5 echo "${ECHO_T}$ac_cv_lib_z_main" >&6 if test $ac_cv_lib_z_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF LIBS="-lz $LIBS" fi echo "$as_me:$LINENO: checking for main in -llzo2" >&5 echo $ECHO_N "checking for main in -llzo2... $ECHO_C" >&6 if test "${ac_cv_lib_lzo2_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llzo2 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_lzo2_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_lzo2_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2_main" >&5 echo "${ECHO_T}$ac_cv_lib_lzo2_main" >&6 if test $ac_cv_lib_lzo2_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBLZO2 1 _ACEOF LIBS="-llzo2 $LIBS" fi echo "$as_me:$LINENO: checking for main in -lbz2" >&5 echo $ECHO_N "checking for main in -lbz2... $ECHO_C" >&6 if test "${ac_cv_lib_bz2_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbz2 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bz2_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bz2_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_bz2_main" >&5 echo "${ECHO_T}$ac_cv_lib_bz2_main" >&6 if test $ac_cv_lib_bz2_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBBZ2 1 _ACEOF LIBS="-lbz2 $LIBS" fi echo "$as_me:$LINENO: checking for main in -lqdbm" >&5 echo $ECHO_N "checking for main in -lqdbm... $ECHO_C" >&6 if test "${ac_cv_lib_qdbm_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lqdbm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_qdbm_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_qdbm_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_qdbm_main" >&5 echo "${ECHO_T}$ac_cv_lib_qdbm_main" >&6 if test $ac_cv_lib_qdbm_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBQDBM 1 _ACEOF LIBS="-lqdbm $LIBS" fi echo "$as_me:$LINENO: checking for main in -lestraier" >&5 echo $ECHO_N "checking for main in -lestraier... $ECHO_C" >&6 if test "${ac_cv_lib_estraier_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lestraier $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_estraier_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_estraier_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_estraier_main" >&5 echo "${ECHO_T}$ac_cv_lib_estraier_main" >&6 if test $ac_cv_lib_estraier_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBESTRAIER 1 _ACEOF LIBS="-lestraier $LIBS" fi # For libraries of pthreads echo "$as_me:$LINENO: checking for main in -lpthread" >&5 echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6 if test "${ac_cv_lib_pthread_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthread_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6 if test $ac_cv_lib_pthread_main = yes; then MYMTLIBS="-lpthread $MYMTLIBS" else echo "$as_me:$LINENO: checking for main in -lc_r" >&5 echo $ECHO_N "checking for main in -lc_r... $ECHO_C" >&6 if test "${ac_cv_lib_c_r_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_r_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_r_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_main" >&5 echo "${ECHO_T}$ac_cv_lib_c_r_main" >&6 if test $ac_cv_lib_c_r_main = yes; then MYMTLIBS="-lc_r $MYMTLIBS" fi fi # For libraries of socket echo "$as_me:$LINENO: checking for main in -lnsl" >&5 echo $ECHO_N "checking for main in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_main" >&6 if test $ac_cv_lib_nsl_main = yes; then MYSKLIBS="-lnsl $MYSKLIBS" fi echo "$as_me:$LINENO: checking for main in -lsocket" >&5 echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5 echo "${ECHO_T}$ac_cv_lib_socket_main" >&6 if test $ac_cv_lib_socket_main = yes; then MYSKLIBS="-lsocket $MYSKLIBS" fi echo "$as_me:$LINENO: checking for main in -lresolv" >&5 echo $ECHO_N "checking for main in -lresolv... $ECHO_C" >&6 if test "${ac_cv_lib_resolv_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_resolv_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_resolv_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_main" >&5 echo "${ECHO_T}$ac_cv_lib_resolv_main" >&6 if test $ac_cv_lib_resolv_main = yes; then MYSKLIBS="-lresolv $MYSKLIBS" fi # Checking the version of QDBM with pkg-config if type pkg-config > /dev/null 2>&1 && pkg-config --atleast-version=1.0.0 qdbm then MYCPPOPTS="$MYCPPOPTS -I`pkg-config --variable=includedir qdbm`" MYLDOPTS="$MYLDOPTS -L`pkg-config --variable=libdir qdbm`" MYRUNPATH="$MYRUNPATH:`pkg-config --variable=libdir qdbm`" fi #================================================================ # Generic Settings #================================================================ # Export variables # Targets ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by hyperestraier-javanative $as_me 1.0.0, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ hyperestraier-javanative config.status 1.0.0 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@LIBVER@,$LIBVER,;t t s,@LIBREV@,$LIBREV,;t t s,@MYJAVAHOME@,$MYJAVAHOME,;t t s,@JVMPLATFORM@,$JVMPLATFORM,;t t s,@JAVAC@,$JAVAC,;t t s,@JAR@,$JAR,;t t s,@JAVAH@,$JAVAH,;t t s,@JAVADOC@,$JAVADOC,;t t s,@JAVARUN@,$JAVARUN,;t t s,@MYCFLAGS@,$MYCFLAGS,;t t s,@MYCPPOPTS@,$MYCPPOPTS,;t t s,@MYLDOPTS@,$MYLDOPTS,;t t s,@MYMTLIBS@,$MYMTLIBS,;t t s,@MYSKLIBS@,$MYSKLIBS,;t t s,@MYRUNPATH@,$MYRUNPATH,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi # END OF FILE hyperestraier-1.4.13/javanative/configure.in000066400000000000000000000124321125261632700211360ustar00rootroot00000000000000# Source of configuration for the Java binding of Hyper Estraier #================================================================ # Generic Settings #================================================================ # Targets AC_INIT(hyperestraier-javanative, 1.0.0) # Export variables LIBVER=1 LIBREV=0 MYJAVAHOME="/usr/java" JVMPLATFORM="linux" JAVAC="javac" JAR="jar" JAVAH="javah" JAVADOC="javadoc" JAVARUN="java" MYCFLAGS="-Wall -fPIC -fsigned-char -O2 -fomit-frame-pointer -fforce-addr" MYCPPOPTS="-DNDEBUG" MYLDOPTS="" MYMTLIBS="" MYSKLIBS="" MYRUNPATH="" # Building paths pathtmp="$PATH" PATH="..:$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin" PATH="$PATH:/usr/ccs/bin:/usr/ucb:/usr/xpg4/bin:/usr/xpg6/bin:$pathtmp" LIBRARY_PATH="..:$HOME/lib:/usr/local/lib:$LIBRARY_PATH" LD_LIBRARY_PATH="..:$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH" CPATH="..:$HOME/include:/usr/local/include:$CPATH" PKG_CONFIG_PATH="..:$HOME/lib/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH if type pkg-config > /dev/null 2>&1 then PATH="$PATH:`pkg-config --variable=bindir qdbm`" PATH="$PATH:`pkg-config --variable=bindir hyperestraier`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir hyperestraier`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir hyperestraier`" CPATH="$CPATH:`pkg-config --variable=includedir qdbm`" CPATH="$CPATH:`pkg-config --variable=includedir hyperestraier`" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH fi #================================================================ # Checking Commands to Build with #================================================================ # Home directory of Java printf 'checking MYJAVAHOME... ' if test -d "$JAVA_HOME" then MYJAVAHOME="$JAVA_HOME" fi printf '%s\n' "$MYJAVAHOME" # Platform of Java printf 'checking JVMPLATFORM... ' if uname | grep Darwin > /dev/null then JVMPLATFORM="mac" else for file in `\ls $MYJAVAHOME/include` do if test -d "$MYJAVAHOME/include/$file" then JVMPLATFORM="$file" fi done fi printf '%s\n' "$JVMPLATFORM" # Java compiler printf 'checking JAVAC... ' JAVAC="$MYJAVAHOME/bin/javac" if uname | grep Darwin > /dev/null then if test -x "$MYJAVAHOME/Commands/javac" then JAVAC="$MYJAVAHOME/Commands/javac" else JAVAC="$MYJAVAHOME/bin/javac" fi fi if test -x "$JAVAC" then printf '%s\n' "$JAVAC" else printf 'no\n' printf '#================================================================\n' 1>&2 printf '# WARNING: %s is not found.\n' "$JAVAC" 1>&2 printf '#================================================================\n' 1>&2 fi # Other building tools if uname | grep Darwin > /dev/null then if test -x "$MYJAVAHOME/Commands/java" then JAR="$MYJAVAHOME/Commands/jar" JAVAH="$MYJAVAHOME/Commands/javah" JAVADOC="$MYJAVAHOME/Commands/javadoc" JAVARUN="$MYJAVAHOME/Commands/java" else JAR="$MYJAVAHOME/bin/jar" JAVAH="$MYJAVAHOME/bin/javah" JAVADOC="$MYJAVAHOME/bin/javadoc" JAVARUN="$MYJAVAHOME/bin/java" fi else JAR="$MYJAVAHOME/bin/jar" JAVAH="$MYJAVAHOME/bin/javah" JAVADOC="$MYJAVAHOME/bin/javadoc" JAVARUN="$MYJAVAHOME/bin/java" fi # C compiler AC_PROG_CC if uname | egrep -i 'SunOS' > /dev/null 2>&1 then MYCFLAGS="-Wall -fPIC -fsigned-char -O1" fi if uname | egrep -i 'BSD' > /dev/null 2>&1 then MYCFLAGS="-Wall -fPIC -fsigned-char -O1" fi if gcc --version | egrep -i '^2\.(8|9)' > /dev/null 2>&1 then MYCFLAGS="-Wall -fPIC -fsigned-char -O1" fi # Data types if uname | grep '^SunOS' > /dev/null then MYCPPOPTS="$MYCPPOPTS -Dint64_t=long\ long" elif uname | grep '^CYGWIN' > /dev/null then MYCPPOPTS="$MYCPPOPTS -D__int64=long\ long" fi AC_CHECK_SIZEOF(void *) AC_CHECK_SIZEOF(int) # Underlying libraries AC_CHECK_LIB(c, main) AC_CHECK_LIB(m, main) AC_CHECK_LIB(iconv, main) AC_CHECK_LIB(z, main) AC_CHECK_LIB(lzo2, main) AC_CHECK_LIB(bz2, main) AC_CHECK_LIB(qdbm, main) AC_CHECK_LIB(estraier, main) # For libraries of pthreads AC_CHECK_LIB(pthread, main, MYMTLIBS="-lpthread $MYMTLIBS", AC_CHECK_LIB(c_r, main, MYMTLIBS="-lc_r $MYMTLIBS")) # For libraries of socket AC_CHECK_LIB(nsl, main, MYSKLIBS="-lnsl $MYSKLIBS") AC_CHECK_LIB(socket, main, MYSKLIBS="-lsocket $MYSKLIBS") AC_CHECK_LIB(resolv, main, MYSKLIBS="-lresolv $MYSKLIBS") # Checking the version of QDBM with pkg-config if type pkg-config > /dev/null 2>&1 && pkg-config --atleast-version=1.0.0 qdbm then MYCPPOPTS="$MYCPPOPTS -I`pkg-config --variable=includedir qdbm`" MYLDOPTS="$MYLDOPTS -L`pkg-config --variable=libdir qdbm`" MYRUNPATH="$MYRUNPATH:`pkg-config --variable=libdir qdbm`" fi #================================================================ # Generic Settings #================================================================ # Export variables AC_SUBST(LIBVER) AC_SUBST(LIBREV) AC_SUBST(MYJAVAHOME) AC_SUBST(JVMPLATFORM) AC_SUBST(JAVAC) AC_SUBST(JAR) AC_SUBST(JAVAH) AC_SUBST(JAVADOC) AC_SUBST(JAVARUN) AC_SUBST(MYCFLAGS) AC_SUBST(MYCPPOPTS) AC_SUBST(MYLDOPTS) AC_SUBST(MYMTLIBS) AC_SUBST(MYSKLIBS) AC_SUBST(MYRUNPATH) AC_SUBST(CPPFLAGS) AC_SUBST(LDFLAGS) # Targets AC_OUTPUT(Makefile) # END OF FILE hyperestraier-1.4.13/javanative/database.c000066400000000000000000000546051125261632700205450ustar00rootroot00000000000000/************************************************************************************************* * Java binding of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #include "estraier_Database.h" #include "myconf.h" /* global variables */ JNIEnv *infoenv = NULL; /* private function prototypes */ static void setecode(JNIEnv *env, jobject obj, int ecode); static void dbinform(const char *message, void *opaque); /************************************************************************************************* * public objects *************************************************************************************************/ /* search_meta */ JNIEXPORT jobject JNICALL Java_estraier_Database_search_1meta(JNIEnv *env, jclass cls, jobjectArray dbary, jobject cond){ jfieldID fid; jmethodID mid; jobject dbobj, hintsobj, resobj; jlong coreptr, condptr; jintArray resary, idxary; jint *resaryptr, *idxaryptr; jboolean icresary, icidxary; ESTMTDB **dbs; CBMAP *hints; int i, dbnum, *res, rnum; fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); if(!dbary || !cond || !isinstanceof(env, cond, CLSCOND)){ throwillarg(env); return NULL; } dbnum = (int)((*env)->GetArrayLength(env, dbary)); dbs = cbmalloc(dbnum * sizeof(ESTMTDB) + 1); for(i = 0; i < dbnum; i++){ dbobj = (*env)->GetObjectArrayElement(env, dbary, i); if(!dbobj || !isinstanceof(env, dbobj, CLSDB)){ throwillarg(env); return NULL; } coreptr = (*env)->GetLongField(env, dbobj, fid); if(coreptr == 0){ throwillarg(env); return NULL; } dbs[i] = (ESTMTDB *)(PTRNUM)coreptr; } cls = (*env)->GetObjectClass(env, cond); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); condptr = (*env)->GetLongField(env, cond, fid); hints = cbmapopen(); res = est_mtdb_search_meta(dbs, dbnum, (ESTCOND *)(PTRNUM)condptr, &rnum, hints); if(!(resary = (*env)->NewIntArray(env, rnum / 2))){ throwoutmem(env); return NULL; } resaryptr = (*env)->GetIntArrayElements(env, resary, &icresary); for(i = 0; i < rnum; i += 2){ resaryptr[i/2] = res[i+1]; } if(icresary == JNI_TRUE) (*env)->ReleaseIntArrayElements(env, resary, resaryptr, 0); if(!(idxary = (*env)->NewIntArray(env, rnum / 2))){ throwoutmem(env); return NULL; } idxaryptr = (*env)->GetIntArrayElements(env, idxary, &icidxary); for(i = 0; i < rnum; i += 2){ idxaryptr[i/2] = res[i]; } if(icidxary == JNI_TRUE) (*env)->ReleaseIntArrayElements(env, idxary, idxaryptr, 0); cls = (*env)->FindClass(env, CLSRES); mid = (*env)->GetMethodID(env, cls, "", "([I[IL" CLSMAP ";J)V"); hintsobj = cbmaptoobj(env, hints); if(!(resobj = (*env)->NewObject(env, cls, mid, resary, idxary, hintsobj, (PTRNUM)est_cond_dup((ESTCOND *)(PTRNUM)condptr)))){ throwoutmem(env); return NULL; } free(res); cbmapclose(hints); return resobj; } /* version */ JNIEXPORT jstring JNICALL Java_estraier_Database_version(JNIEnv *env, jclass cls){ jstring ver; if(!(ver = (*env)->NewStringUTF(env, est_version))){ throwoutmem(env); return NULL; } return ver; } /* err_msg */ JNIEXPORT jstring JNICALL Java_estraier_Database_err_1msg(JNIEnv *env, jobject obj, jint ecode){ jstring msg; if(!(msg = (*env)->NewStringUTF(env, est_err_msg(ecode)))){ throwoutmem(env); return NULL; } return msg; } /* open */ JNIEXPORT jboolean JNICALL Java_estraier_Database_open(JNIEnv *env, jobject obj, jstring name, jint omode){ jclass cls; jfieldID fid; jlong coreptr; jboolean icname; ESTMTDB *db; const char *tname; int err, ecode; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr != 0 || !name || !isinstanceof(env, name, CLSSTRING)){ throwillarg(env); return FALSE; } if(!(tname = (*env)->GetStringUTFChars(env, name, &icname))){ throwoutmem(env); return FALSE; } err = FALSE; if((db = est_mtdb_open(tname, omode, &ecode)) != NULL){ (*env)->SetLongField(env, obj, fid, (PTRNUM)db); } else { setecode(env, obj, ecode); err = TRUE; } if(icname == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, name, tname); return err ? FALSE : TRUE; } /* close */ JNIEXPORT jboolean JNICALL Java_estraier_Database_close(JNIEnv *env, jobject obj){ jclass cls; jfieldID fid; jlong coreptr; jobject infoobj; int err, ecode; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0){ throwillarg(env); return FALSE; } err = FALSE; if(!est_mtdb_close((ESTMTDB *)(PTRNUM)coreptr, &ecode)){ setecode(env, obj, ecode); err = TRUE; } (*env)->SetLongField(env, obj, fid, 0); fid = (*env)->GetFieldID(env, cls, "informer", "L" CLSDBINFO ";"); if((infoobj = (*env)->GetObjectField(env, obj, fid)) != NULL) (*env)->DeleteGlobalRef(env, infoobj); (*env)->SetObjectField(env, obj, fid, NULL); return err ? FALSE : TRUE; } /* error */ JNIEXPORT jint JNICALL Java_estraier_Database_error(JNIEnv *env, jobject obj){ jclass cls; jfieldID fid; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "ecode", "I"); return (*env)->GetIntField(env, obj, fid); } /* fatal */ JNIEXPORT jboolean JNICALL Java_estraier_Database_fatal(JNIEnv *env, jobject obj){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0) return FALSE; return est_mtdb_fatal((ESTMTDB *)(PTRNUM)coreptr); } /* add_attr_index */ JNIEXPORT jboolean JNICALL Java_estraier_Database_add_1attr_1index(JNIEnv *env, jobject obj, jstring name, jint type){ jclass cls; jfieldID fid; jlong coreptr; jboolean icname; const char *tname; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0 || !name || !isinstanceof(env, name, CLSSTRING)){ throwillarg(env); return -1; } if(!(tname = (*env)->GetStringUTFChars(env, name, &icname))){ throwoutmem(env); return -1; } if(!est_mtdb_add_attr_index((ESTMTDB *)(PTRNUM)coreptr, tname, type)){ setecode(env, obj, est_mtdb_error((ESTMTDB *)(PTRNUM)coreptr)); if(icname == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, name, tname); return FALSE; } if(icname == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, name, tname); return TRUE; } /* flush */ JNIEXPORT jboolean JNICALL Java_estraier_Database_flush(JNIEnv *env, jobject obj, jint max){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0){ throwillarg(env); return FALSE; } if(!est_mtdb_flush((ESTMTDB *)(PTRNUM)coreptr, max)){ setecode(env, obj, est_mtdb_error((ESTMTDB *)(PTRNUM)coreptr)); return FALSE; } return TRUE; } /* sync */ JNIEXPORT jboolean JNICALL Java_estraier_Database_sync(JNIEnv *env, jobject obj){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0){ throwillarg(env); return FALSE; } if(!est_mtdb_sync((ESTMTDB *)(PTRNUM)coreptr)){ setecode(env, obj, est_mtdb_error((ESTMTDB *)(PTRNUM)coreptr)); return FALSE; } return TRUE; } /* optimize */ JNIEXPORT jboolean JNICALL Java_estraier_Database_optimize(JNIEnv *env, jobject obj, jint options){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0){ throwillarg(env); return FALSE; } if(!est_mtdb_optimize((ESTMTDB *)(PTRNUM)coreptr, options)){ setecode(env, obj, est_mtdb_error((ESTMTDB *)(PTRNUM)coreptr)); return FALSE; } return TRUE; } /* merge */ JNIEXPORT jboolean JNICALL Java_estraier_Database_merge(JNIEnv *env, jobject obj, jstring name, jint options){ jclass cls; jfieldID fid; jlong coreptr; jboolean icname; const char *tname; int err; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0){ throwillarg(env); return FALSE; } if(!name || !isinstanceof(env, name, CLSSTRING)){ throwillarg(env); return FALSE; } if(!(tname = (*env)->GetStringUTFChars(env, name, &icname))){ throwoutmem(env); return FALSE; } err = FALSE; if(!est_mtdb_merge((ESTMTDB *)(PTRNUM)coreptr, tname, options)){ setecode(env, obj, est_mtdb_error((ESTMTDB *)(PTRNUM)coreptr)); err = TRUE; } if(icname == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, name, tname); return err ? FALSE : TRUE; } /* put_doc */ JNIEXPORT jboolean JNICALL Java_estraier_Database_put_1doc(JNIEnv *env, jobject obj, jobject doc, jint options){ jclass cls; jfieldID fid; jlong coreptr, docptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0 || !doc || !isinstanceof(env, doc, CLSDOC)){ throwillarg(env); return FALSE; } cls = (*env)->GetObjectClass(env, doc); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); docptr = (*env)->GetLongField(env, doc, fid); if(!est_mtdb_put_doc((ESTMTDB *)(PTRNUM)coreptr, (ESTDOC *)(PTRNUM)docptr, options)){ setecode(env, obj, est_mtdb_error((ESTMTDB *)(PTRNUM)coreptr)); return FALSE; } return TRUE; } /* out_doc */ JNIEXPORT jboolean JNICALL Java_estraier_Database_out_1doc(JNIEnv *env, jobject obj, jint id, jint options){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0 || id < 1){ throwillarg(env); return FALSE; } if(!est_mtdb_out_doc((ESTMTDB *)(PTRNUM)coreptr, id, options)){ setecode(env, obj, est_mtdb_error((ESTMTDB *)(PTRNUM)coreptr)); return FALSE; } return TRUE; } /* edit_doc */ JNIEXPORT jboolean JNICALL Java_estraier_Database_edit_1doc(JNIEnv *env, jobject obj, jobject doc){ jclass cls; jfieldID fid; jlong coreptr, docptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0 || !doc || !isinstanceof(env, doc, CLSDOC)){ throwillarg(env); return FALSE; } cls = (*env)->GetObjectClass(env, doc); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); docptr = (*env)->GetLongField(env, doc, fid); if(!est_mtdb_edit_doc((ESTMTDB *)(PTRNUM)coreptr, (ESTDOC *)(PTRNUM)docptr)){ setecode(env, obj, est_mtdb_error((ESTMTDB *)(PTRNUM)coreptr)); return FALSE; } return TRUE; } /* get_doc */ JNIEXPORT jobject JNICALL Java_estraier_Database_get_1doc(JNIEnv *env, jobject obj, jint id, jint options){ jclass cls; jfieldID fid; jmethodID mid; jlong coreptr; ESTDOC *doc; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0 || id < 1){ throwillarg(env); return NULL; } if(!(doc = est_mtdb_get_doc((ESTMTDB *)(PTRNUM)coreptr, id, options))){ setecode(env, obj, est_mtdb_error((ESTMTDB *)(PTRNUM)coreptr)); return NULL; } cls = (*env)->FindClass(env, CLSDOC); mid = (*env)->GetMethodID(env, cls, "", "()V"); if(!(obj = (*env)->NewObject(env, cls, mid))){ throwoutmem(env); return NULL; } fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); (*env)->SetLongField(env, obj, fid, (PTRNUM)doc); return obj; } /* get_doc_attr */ JNIEXPORT jstring JNICALL Java_estraier_Database_get_1doc_1attr(JNIEnv *env, jobject obj, jint id, jstring name){ jclass cls; jfieldID fid; jlong coreptr; jstring value; jboolean icname; const char *tname; char *tvalue; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0 || id < 1 || !name || !isinstanceof(env, name, CLSSTRING)){ throwillarg(env); return NULL; } if(!(tname = (*env)->GetStringUTFChars(env, name, &icname))){ throwoutmem(env); return NULL; } if(!(tvalue = est_mtdb_get_doc_attr((ESTMTDB *)(PTRNUM)coreptr, id, tname))){ setecode(env, obj, est_mtdb_error((ESTMTDB *)(PTRNUM)coreptr)); if(icname == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, name, tname); return NULL; } if(icname == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, name, tname); if(!(value = (*env)->NewStringUTF(env, tvalue))){ throwoutmem(env); return NULL; } free(tvalue); return value; } /* uri_to_id */ JNIEXPORT jint JNICALL Java_estraier_Database_uri_1to_1id(JNIEnv *env, jobject obj, jstring uri){ jclass cls; jfieldID fid; jlong coreptr; jboolean icuri; const char *turi; int id; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0 || !uri || !isinstanceof(env, uri, CLSSTRING)){ throwillarg(env); return -1; } if(!(turi = (*env)->GetStringUTFChars(env, uri, &icuri))){ throwoutmem(env); return -1; } if((id = est_mtdb_uri_to_id((ESTMTDB *)(PTRNUM)coreptr, turi)) == -1){ setecode(env, obj, est_mtdb_error((ESTMTDB *)(PTRNUM)coreptr)); if(icuri == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, uri, turi); return -1; } if(icuri == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, uri, turi); return id; } /* name */ JNIEXPORT jstring JNICALL Java_estraier_Database_name(JNIEnv *env, jobject obj){ jclass cls; jfieldID fid; jlong coreptr; jstring name; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0){ throwillarg(env); return NULL; } if(!(name = (*env)->NewStringUTF(env, est_mtdb_name((ESTMTDB *)(PTRNUM)coreptr)))){ throwoutmem(env); return NULL; } return name; } /* doc_num */ JNIEXPORT jint JNICALL Java_estraier_Database_doc_1num(JNIEnv *env, jobject obj){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0){ throwillarg(env); return -1; } return est_mtdb_doc_num((ESTMTDB *)(PTRNUM)coreptr); } /* word_num */ JNIEXPORT jint JNICALL Java_estraier_Database_word_1num(JNIEnv *env, jobject obj){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0){ throwillarg(env); return -1; } return est_mtdb_word_num((ESTMTDB *)(PTRNUM)coreptr); } /* size */ JNIEXPORT jdouble JNICALL Java_estraier_Database_size(JNIEnv *env, jobject obj){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0){ throwillarg(env); return -1; } return est_mtdb_size((ESTMTDB *)(PTRNUM)coreptr); } /* search */ JNIEXPORT jobject JNICALL Java_estraier_Database_search(JNIEnv *env, jobject obj, jobject cond){ jclass cls; jfieldID fid; jmethodID mid; jlong coreptr, condptr; jintArray resary; jint *resaryptr; jobject hintsobj, resobj; jboolean icresary; CBMAP *hints; int i, *res, rnum; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0 || !cond || !isinstanceof(env, cond, CLSCOND)){ throwillarg(env); return NULL; } cls = (*env)->GetObjectClass(env, cond); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); condptr = (*env)->GetLongField(env, cond, fid); hints = cbmapopen(); res = est_mtdb_search((ESTMTDB *)(PTRNUM)coreptr, (ESTCOND *)(PTRNUM)condptr, &rnum, hints); if(!(resary = (*env)->NewIntArray(env, rnum))){ throwoutmem(env); return NULL; } resaryptr = (*env)->GetIntArrayElements(env, resary, &icresary); for(i = 0; i < rnum; i++){ resaryptr[i] = res[i]; } if(icresary == JNI_TRUE) (*env)->ReleaseIntArrayElements(env, resary, resaryptr, 0); cls = (*env)->FindClass(env, CLSRES); mid = (*env)->GetMethodID(env, cls, "", "([IL" CLSMAP ";J)V"); hintsobj = cbmaptoobj(env, hints); if(!(resobj = (*env)->NewObject(env, cls, mid, resary, hintsobj, (PTRNUM)est_cond_dup((ESTCOND *)(PTRNUM)condptr)))){ throwoutmem(env); return NULL; } free(res); cbmapclose(hints); return resobj; } /* scan_doc */ JNIEXPORT jboolean JNICALL Java_estraier_Database_scan_1doc(JNIEnv *env, jobject obj, jobject doc, jobject cond){ jclass cls; jfieldID fid; jlong coreptr, docptr, condptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0 || !doc || !isinstanceof(env, doc, CLSDOC) || !cond || !isinstanceof(env, cond, CLSCOND)){ throwillarg(env); return FALSE; } cls = (*env)->GetObjectClass(env, doc); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); docptr = (*env)->GetLongField(env, doc, fid); cls = (*env)->GetObjectClass(env, cond); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); condptr = (*env)->GetLongField(env, cond, fid); return est_mtdb_scan_doc((ESTMTDB *)(PTRNUM)coreptr, (ESTDOC *)(PTRNUM)docptr, (ESTCOND *)(PTRNUM)condptr); } /* set_cache_size */ JNIEXPORT void JNICALL Java_estraier_Database_set_1cache_1size(JNIEnv *env, jobject obj, jdouble size, jint anum, jint tnum, jint rnum){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0){ throwillarg(env); return; } est_mtdb_set_cache_size((ESTMTDB *)(PTRNUM)coreptr, size, anum, tnum, rnum); } /* add_pseudo_index */ JNIEXPORT jboolean JNICALL Java_estraier_Database_add_1pseudo_1index(JNIEnv *env, jobject obj, jstring path){ jclass cls; jfieldID fid; jlong coreptr; jboolean icpath; const char *tpath; int err; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0){ throwillarg(env); return FALSE; } if(!path || !isinstanceof(env, path, CLSSTRING)){ throwillarg(env); return FALSE; } if(!(tpath = (*env)->GetStringUTFChars(env, path, &icpath))){ throwoutmem(env); return FALSE; } err = FALSE; if(!est_mtdb_add_pseudo_index((ESTMTDB *)(PTRNUM)coreptr, tpath)){ setecode(env, obj, est_mtdb_error((ESTMTDB *)(PTRNUM)coreptr)); err = TRUE; } if(icpath == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, path, tpath); return err ? FALSE : TRUE; } /* set_wildmax */ JNIEXPORT void JNICALL Java_estraier_Database_set_1wildmax(JNIEnv *env, jobject obj, jint num){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0){ throwillarg(env); return; } est_mtdb_set_wildmax((ESTMTDB *)(PTRNUM)coreptr, num); } /* set_informer */ JNIEXPORT void JNICALL Java_estraier_Database_set_1informer(JNIEnv *env, jobject obj, jobject informer){ jclass cls; jfieldID fid; jlong coreptr; jobject oldobj; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(coreptr == 0){ throwillarg(env); return; } fid = (*env)->GetFieldID(env, cls, "informer", "L" CLSDBINFO ";"); if((oldobj = (*env)->GetObjectField(env, obj, fid)) != NULL) (*env)->DeleteGlobalRef(env, oldobj); (*env)->SetObjectField(env, obj, fid, NULL); if(!(informer = (*env)->NewGlobalRef(env, informer))){ throwoutmem(env); return; } (*env)->SetObjectField(env, obj, fid, informer); infoenv = env; est_mtdb_set_informer((ESTMTDB *)(PTRNUM)coreptr, dbinform, informer); } /************************************************************************************************* * public objects *************************************************************************************************/ /* set the error code */ static void setecode(JNIEnv *env, jobject obj, int ecode){ jclass cls; jfieldID fid; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "ecode", "I"); (*env)->SetIntField(env, obj, fid, ecode); } /* callback function for database events */ static void dbinform(const char *message, void *opaque){ jstring msgobj; jobject opobj; jclass cls; jmethodID mid; if(!(msgobj = (*infoenv)->NewStringUTF(infoenv, message))) return; opobj = (jobject)opaque; cls = (*infoenv)->GetObjectClass(infoenv, opobj); mid = (*infoenv)->GetMethodID(infoenv, cls, "inform", "(L" CLSSTRING ";)V"); (*infoenv)->CallVoidMethod(infoenv, opobj, mid, msgobj); } /* END OF FILE */ hyperestraier-1.4.13/javanative/document.c000066400000000000000000000246601125261632700206150ustar00rootroot00000000000000/************************************************************************************************* * Java binding of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #include "estraier_Document.h" #include "myconf.h" /************************************************************************************************* * public objects *************************************************************************************************/ /* add_attr */ JNIEXPORT void JNICALL Java_estraier_Document_add_1attr(JNIEnv *env, jobject obj, jstring name, jstring value){ jclass cls; jfieldID fid; jlong coreptr; jboolean icname, icvalue; const char *tname, *tvalue; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(!name || !isinstanceof(env, name, CLSSTRING)){ throwillarg(env); return; } if(value && !isinstanceof(env, value, CLSSTRING)){ throwillarg(env); return; } if(!(tname = (*env)->GetStringUTFChars(env, name, &icname))){ throwoutmem(env); return; } tvalue = value ? (*env)->GetStringUTFChars(env, value, &icvalue) : NULL; est_doc_add_attr((ESTDOC *)(PTRNUM)coreptr, tname, tvalue); if(tvalue && icvalue == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, value, tvalue); if(icname == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, name, tname); } /* add_text */ JNIEXPORT void JNICALL Java_estraier_Document_add_1text(JNIEnv *env, jobject obj, jstring text){ jclass cls; jfieldID fid; jlong coreptr; jboolean ictext; const char *ttext; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(!text || !isinstanceof(env, text, CLSSTRING)){ throwillarg(env); return; } if(!(ttext = (*env)->GetStringUTFChars(env, text, &ictext))){ throwoutmem(env); return; } est_doc_add_text((ESTDOC *)(PTRNUM)coreptr, ttext); if(ictext == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, text, ttext); } /* add_hidden_text */ JNIEXPORT void JNICALL Java_estraier_Document_add_1hidden_1text(JNIEnv *env, jobject obj, jstring text){ jclass cls; jfieldID fid; jlong coreptr; jboolean ictext; const char *ttext; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(!text || !isinstanceof(env, text, CLSSTRING)){ throwillarg(env); return; } if(!(ttext = (*env)->GetStringUTFChars(env, text, &ictext))){ throwoutmem(env); return; } est_doc_add_hidden_text((ESTDOC *)(PTRNUM)coreptr, ttext); if(ictext == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, text, ttext); } /* set_keywords */ JNIEXPORT void JNICALL Java_estraier_Document_set_1keywords(JNIEnv *env, jobject obj, jobject kwords){ jclass cls; jfieldID fid; jlong coreptr; CBMAP *tkwords; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(!kwords || !isinstanceof(env, kwords, CLSMAP)){ throwillarg(env); return; } tkwords = objtocbmap(env, kwords); est_doc_set_keywords((ESTDOC *)(PTRNUM)coreptr, tkwords); cbmapclose(tkwords); } /* set_score */ JNIEXPORT void JNICALL Java_estraier_Document_set_1score(JNIEnv *env, jobject obj, jint score){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); est_doc_set_score((ESTDOC *)(PTRNUM)coreptr, score); } /* id */ JNIEXPORT jint JNICALL Java_estraier_Document_id(JNIEnv *env, jobject obj){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); return est_doc_id((ESTDOC *)(PTRNUM)coreptr); } /* attr_names */ JNIEXPORT jobject JNICALL Java_estraier_Document_attr_1names(JNIEnv *env, jobject obj){ jclass cls; jfieldID fid; jlong coreptr; jobject names; CBLIST *tnames; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); tnames = est_doc_attr_names((ESTDOC *)(PTRNUM)coreptr); names = cblisttoobj(env, tnames); cblistclose(tnames); return names; } /* attr */ JNIEXPORT jstring JNICALL Java_estraier_Document_attr(JNIEnv *env, jobject obj, jstring name){ jclass cls; jfieldID fid; jlong coreptr; jboolean icname; jobject value; const char *tname, *tvalue; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(!name || !isinstanceof(env, name, CLSSTRING)){ throwillarg(env); return NULL; } if(!(tname = (*env)->GetStringUTFChars(env, name, &icname))){ throwoutmem(env); return NULL; } if(!(tvalue = est_doc_attr((ESTDOC *)(PTRNUM)coreptr, tname))){ if(icname == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, name, tname); return NULL; } if(!(value = (*env)->NewStringUTF(env, tvalue))){ throwoutmem(env); return NULL; } if(icname == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, name, tname); return value; } /* texts */ JNIEXPORT jobject JNICALL Java_estraier_Document_texts(JNIEnv *env, jobject obj){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); return cblisttoobj(env, est_doc_texts((ESTDOC *)(PTRNUM)coreptr)); } /* cat_texts */ JNIEXPORT jstring JNICALL Java_estraier_Document_cat_1texts(JNIEnv *env, jobject obj){ jclass cls; jfieldID fid; jlong coreptr; jobject texts; char *ttexts; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); ttexts = est_doc_cat_texts((ESTDOC *)(PTRNUM)coreptr); if(!(texts = (*env)->NewStringUTF(env, ttexts))){ throwoutmem(env); return NULL; } free(ttexts); return texts; } /* keywords */ JNIEXPORT jobject JNICALL Java_estraier_Document_keywords(JNIEnv *env, jobject obj){ jclass cls; jfieldID fid; jlong coreptr; CBMAP *kwords; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(!(kwords = est_doc_keywords((ESTDOC *)(PTRNUM)coreptr))) return NULL; return cbmaptoobj(env, kwords); } /* score */ JNIEXPORT jint JNICALL Java_estraier_Document_score(JNIEnv *env, jobject obj){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); return est_doc_score((ESTDOC *)(PTRNUM)coreptr); } /* dump_draft */ JNIEXPORT jstring JNICALL Java_estraier_Document_dump_1draft(JNIEnv *env, jobject obj){ jclass cls; jfieldID fid; jlong coreptr; jobject draft; char *tdraft; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); tdraft = est_doc_dump_draft((ESTDOC *)(PTRNUM)coreptr); if(!(draft = (*env)->NewStringUTF(env, tdraft))){ throwoutmem(env); return NULL; } free(tdraft); return draft; } /* make_snippet */ JNIEXPORT jstring JNICALL Java_estraier_Document_make_1snippet(JNIEnv *env, jobject obj, jobject words, jint wwidth, jint hwidth, jint awidth){ jclass cls; jfieldID fid; jlong coreptr; jobject snip; CBLIST *twords; char *tsnip; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(!words || !isinstanceof(env, words, CLSLIST)){ throwillarg(env); return NULL; } if(wwidth < 0 || hwidth < 0 || awidth < 0){ throwillarg(env); return NULL; } twords = objtocblist(env, words); tsnip = est_doc_make_snippet((ESTDOC *)(PTRNUM)coreptr, twords, wwidth, hwidth, awidth); if(!(snip = (*env)->NewStringUTF(env, tsnip))){ throwoutmem(env); return NULL; } free(tsnip); cblistclose(twords); return snip; } /* initialize */ JNIEXPORT void JNICALL Java_estraier_Document_initialize__(JNIEnv *env, jobject obj){ jclass cls; jfieldID fid; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); (*env)->SetLongField(env, obj, fid, (PTRNUM)est_doc_new()); } /* initialize */ JNIEXPORT void JNICALL Java_estraier_Document_initialize__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring draft){ jclass cls; jfieldID fid; jboolean icdraft; const char *tdraft; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); if(!draft || !isinstanceof(env, draft, CLSSTRING)){ throwillarg(env); return; } if(!(tdraft = (*env)->GetStringUTFChars(env, draft, &icdraft))){ throwoutmem(env); return; } (*env)->SetLongField(env, obj, fid, (PTRNUM)est_doc_new_from_draft(tdraft)); if(icdraft == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, draft, tdraft); } /* destroy */ JNIEXPORT void JNICALL Java_estraier_Document_destroy(JNIEnv *env, jobject obj){ jclass cls; jfieldID fid; jlong coreptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); est_doc_delete((ESTDOC *)(PTRNUM)coreptr); } /* END OF FILE */ hyperestraier-1.4.13/javanative/estraier_Condition.h000066400000000000000000000063671125261632700226340ustar00rootroot00000000000000/* DO NOT EDIT THIS FILE - it is machine generated */ #include /* Header for class estraier_Condition */ #ifndef _Included_estraier_Condition #define _Included_estraier_Condition #ifdef __cplusplus extern "C" { #endif #undef estraier_Condition_SURE #define estraier_Condition_SURE 1L #undef estraier_Condition_USUAL #define estraier_Condition_USUAL 2L #undef estraier_Condition_FAST #define estraier_Condition_FAST 4L #undef estraier_Condition_AGITO #define estraier_Condition_AGITO 8L #undef estraier_Condition_NOIDF #define estraier_Condition_NOIDF 16L #undef estraier_Condition_SIMPLE #define estraier_Condition_SIMPLE 1024L #undef estraier_Condition_ROUGH #define estraier_Condition_ROUGH 2048L #undef estraier_Condition_UNION #define estraier_Condition_UNION 32768L #undef estraier_Condition_ISECT #define estraier_Condition_ISECT 65536L #undef estraier_Condition_ECLSIMURL #define estraier_Condition_ECLSIMURL 10.0 #undef estraier_Condition_ECLSERV #define estraier_Condition_ECLSERV 100.0 #undef estraier_Condition_ECLDIR #define estraier_Condition_ECLDIR 101.0 #undef estraier_Condition_ECLFILE #define estraier_Condition_ECLFILE 102.0 /* * Class: estraier_Condition * Method: set_phrase * Signature: (Ljava/lang/String;)V */ JNIEXPORT void JNICALL Java_estraier_Condition_set_1phrase (JNIEnv *, jobject, jstring); /* * Class: estraier_Condition * Method: add_attr * Signature: (Ljava/lang/String;)V */ JNIEXPORT void JNICALL Java_estraier_Condition_add_1attr (JNIEnv *, jobject, jstring); /* * Class: estraier_Condition * Method: set_order * Signature: (Ljava/lang/String;)V */ JNIEXPORT void JNICALL Java_estraier_Condition_set_1order (JNIEnv *, jobject, jstring); /* * Class: estraier_Condition * Method: set_max * Signature: (I)V */ JNIEXPORT void JNICALL Java_estraier_Condition_set_1max (JNIEnv *, jobject, jint); /* * Class: estraier_Condition * Method: set_skip * Signature: (I)V */ JNIEXPORT void JNICALL Java_estraier_Condition_set_1skip (JNIEnv *, jobject, jint); /* * Class: estraier_Condition * Method: set_options * Signature: (I)V */ JNIEXPORT void JNICALL Java_estraier_Condition_set_1options (JNIEnv *, jobject, jint); /* * Class: estraier_Condition * Method: set_auxiliary * Signature: (I)V */ JNIEXPORT void JNICALL Java_estraier_Condition_set_1auxiliary (JNIEnv *, jobject, jint); /* * Class: estraier_Condition * Method: set_eclipse * Signature: (D)V */ JNIEXPORT void JNICALL Java_estraier_Condition_set_1eclipse (JNIEnv *, jobject, jdouble); /* * Class: estraier_Condition * Method: set_distinct * Signature: (Ljava/lang/String;)V */ JNIEXPORT void JNICALL Java_estraier_Condition_set_1distinct (JNIEnv *, jobject, jstring); /* * Class: estraier_Condition * Method: set_mask * Signature: (I)V */ JNIEXPORT void JNICALL Java_estraier_Condition_set_1mask (JNIEnv *, jobject, jint); /* * Class: estraier_Condition * Method: initialize * Signature: ()V */ JNIEXPORT void JNICALL Java_estraier_Condition_initialize (JNIEnv *, jobject); /* * Class: estraier_Condition * Method: destroy * Signature: ()V */ JNIEXPORT void JNICALL Java_estraier_Condition_destroy (JNIEnv *, jobject); #ifdef __cplusplus } #endif #endif hyperestraier-1.4.13/javanative/estraier_Database.h000066400000000000000000000176111125261632700224040ustar00rootroot00000000000000/* DO NOT EDIT THIS FILE - it is machine generated */ #include /* Header for class estraier_Database */ #ifndef _Included_estraier_Database #define _Included_estraier_Database #ifdef __cplusplus extern "C" { #endif #undef estraier_Database_ERRNOERR #define estraier_Database_ERRNOERR 0L #undef estraier_Database_ERRINVAL #define estraier_Database_ERRINVAL 1L #undef estraier_Database_ERRACCES #define estraier_Database_ERRACCES 2L #undef estraier_Database_ERRLOCK #define estraier_Database_ERRLOCK 3L #undef estraier_Database_ERRDB #define estraier_Database_ERRDB 4L #undef estraier_Database_ERRIO #define estraier_Database_ERRIO 5L #undef estraier_Database_ERRNOITEM #define estraier_Database_ERRNOITEM 6L #undef estraier_Database_ERRMISC #define estraier_Database_ERRMISC 9999L #undef estraier_Database_DBREADER #define estraier_Database_DBREADER 1L #undef estraier_Database_DBWRITER #define estraier_Database_DBWRITER 2L #undef estraier_Database_DBCREAT #define estraier_Database_DBCREAT 4L #undef estraier_Database_DBTRUNC #define estraier_Database_DBTRUNC 8L #undef estraier_Database_DBNOLCK #define estraier_Database_DBNOLCK 16L #undef estraier_Database_DBLCKNB #define estraier_Database_DBLCKNB 32L #undef estraier_Database_DBPERFNG #define estraier_Database_DBPERFNG 1024L #undef estraier_Database_DBCHRCAT #define estraier_Database_DBCHRCAT 2048L #undef estraier_Database_DBSMALL #define estraier_Database_DBSMALL 1048576L #undef estraier_Database_DBLARGE #define estraier_Database_DBLARGE 2097152L #undef estraier_Database_DBHUGE #define estraier_Database_DBHUGE 4194304L #undef estraier_Database_DBHUGE2 #define estraier_Database_DBHUGE2 8388608L #undef estraier_Database_DBHUGE3 #define estraier_Database_DBHUGE3 16777216L #undef estraier_Database_DBSCVOID #define estraier_Database_DBSCVOID 33554432L #undef estraier_Database_DBSCINT #define estraier_Database_DBSCINT 67108864L #undef estraier_Database_DBSCASIS #define estraier_Database_DBSCASIS 134217728L #undef estraier_Database_IDXATTRSEQ #define estraier_Database_IDXATTRSEQ 0L #undef estraier_Database_IDXATTRSTR #define estraier_Database_IDXATTRSTR 1L #undef estraier_Database_IDXATTRNUM #define estraier_Database_IDXATTRNUM 2L #undef estraier_Database_OPTNOPURGE #define estraier_Database_OPTNOPURGE 1L #undef estraier_Database_OPTNODBOPT #define estraier_Database_OPTNODBOPT 2L #undef estraier_Database_MGCLEAN #define estraier_Database_MGCLEAN 1L #undef estraier_Database_PDCLEAN #define estraier_Database_PDCLEAN 1L #undef estraier_Database_PDWEIGHT #define estraier_Database_PDWEIGHT 2L #undef estraier_Database_ODCLEAN #define estraier_Database_ODCLEAN 1L #undef estraier_Database_GDNOATTR #define estraier_Database_GDNOATTR 1L #undef estraier_Database_GDNOTEXT #define estraier_Database_GDNOTEXT 2L #undef estraier_Database_GDNOKWD #define estraier_Database_GDNOKWD 4L /* * Class: estraier_Database * Method: search_meta * Signature: ([Lestraier/Database;Lestraier/Condition;)Lestraier/Result; */ JNIEXPORT jobject JNICALL Java_estraier_Database_search_1meta (JNIEnv *, jclass, jobjectArray, jobject); /* * Class: estraier_Database * Method: version * Signature: ()Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_estraier_Database_version (JNIEnv *, jclass); /* * Class: estraier_Database * Method: err_msg * Signature: (I)Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_estraier_Database_err_1msg (JNIEnv *, jobject, jint); /* * Class: estraier_Database * Method: open * Signature: (Ljava/lang/String;I)Z */ JNIEXPORT jboolean JNICALL Java_estraier_Database_open (JNIEnv *, jobject, jstring, jint); /* * Class: estraier_Database * Method: close * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_estraier_Database_close (JNIEnv *, jobject); /* * Class: estraier_Database * Method: error * Signature: ()I */ JNIEXPORT jint JNICALL Java_estraier_Database_error (JNIEnv *, jobject); /* * Class: estraier_Database * Method: fatal * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_estraier_Database_fatal (JNIEnv *, jobject); /* * Class: estraier_Database * Method: add_attr_index * Signature: (Ljava/lang/String;I)Z */ JNIEXPORT jboolean JNICALL Java_estraier_Database_add_1attr_1index (JNIEnv *, jobject, jstring, jint); /* * Class: estraier_Database * Method: flush * Signature: (I)Z */ JNIEXPORT jboolean JNICALL Java_estraier_Database_flush (JNIEnv *, jobject, jint); /* * Class: estraier_Database * Method: sync * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_estraier_Database_sync (JNIEnv *, jobject); /* * Class: estraier_Database * Method: optimize * Signature: (I)Z */ JNIEXPORT jboolean JNICALL Java_estraier_Database_optimize (JNIEnv *, jobject, jint); /* * Class: estraier_Database * Method: merge * Signature: (Ljava/lang/String;I)Z */ JNIEXPORT jboolean JNICALL Java_estraier_Database_merge (JNIEnv *, jobject, jstring, jint); /* * Class: estraier_Database * Method: put_doc * Signature: (Lestraier/Document;I)Z */ JNIEXPORT jboolean JNICALL Java_estraier_Database_put_1doc (JNIEnv *, jobject, jobject, jint); /* * Class: estraier_Database * Method: out_doc * Signature: (II)Z */ JNIEXPORT jboolean JNICALL Java_estraier_Database_out_1doc (JNIEnv *, jobject, jint, jint); /* * Class: estraier_Database * Method: edit_doc * Signature: (Lestraier/Document;)Z */ JNIEXPORT jboolean JNICALL Java_estraier_Database_edit_1doc (JNIEnv *, jobject, jobject); /* * Class: estraier_Database * Method: get_doc * Signature: (II)Lestraier/Document; */ JNIEXPORT jobject JNICALL Java_estraier_Database_get_1doc (JNIEnv *, jobject, jint, jint); /* * Class: estraier_Database * Method: get_doc_attr * Signature: (ILjava/lang/String;)Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_estraier_Database_get_1doc_1attr (JNIEnv *, jobject, jint, jstring); /* * Class: estraier_Database * Method: uri_to_id * Signature: (Ljava/lang/String;)I */ JNIEXPORT jint JNICALL Java_estraier_Database_uri_1to_1id (JNIEnv *, jobject, jstring); /* * Class: estraier_Database * Method: name * Signature: ()Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_estraier_Database_name (JNIEnv *, jobject); /* * Class: estraier_Database * Method: doc_num * Signature: ()I */ JNIEXPORT jint JNICALL Java_estraier_Database_doc_1num (JNIEnv *, jobject); /* * Class: estraier_Database * Method: word_num * Signature: ()I */ JNIEXPORT jint JNICALL Java_estraier_Database_word_1num (JNIEnv *, jobject); /* * Class: estraier_Database * Method: size * Signature: ()D */ JNIEXPORT jdouble JNICALL Java_estraier_Database_size (JNIEnv *, jobject); /* * Class: estraier_Database * Method: search * Signature: (Lestraier/Condition;)Lestraier/Result; */ JNIEXPORT jobject JNICALL Java_estraier_Database_search (JNIEnv *, jobject, jobject); /* * Class: estraier_Database * Method: scan_doc * Signature: (Lestraier/Document;Lestraier/Condition;)Z */ JNIEXPORT jboolean JNICALL Java_estraier_Database_scan_1doc (JNIEnv *, jobject, jobject, jobject); /* * Class: estraier_Database * Method: set_cache_size * Signature: (DIII)V */ JNIEXPORT void JNICALL Java_estraier_Database_set_1cache_1size (JNIEnv *, jobject, jdouble, jint, jint, jint); /* * Class: estraier_Database * Method: add_pseudo_index * Signature: (Ljava/lang/String;)Z */ JNIEXPORT jboolean JNICALL Java_estraier_Database_add_1pseudo_1index (JNIEnv *, jobject, jstring); /* * Class: estraier_Database * Method: set_wildmax * Signature: (I)V */ JNIEXPORT void JNICALL Java_estraier_Database_set_1wildmax (JNIEnv *, jobject, jint); /* * Class: estraier_Database * Method: set_informer * Signature: (Lestraier/DatabaseInformer;)V */ JNIEXPORT void JNICALL Java_estraier_Database_set_1informer (JNIEnv *, jobject, jobject); #ifdef __cplusplus } #endif #endif hyperestraier-1.4.13/javanative/estraier_Document.h000066400000000000000000000064671125261632700224650ustar00rootroot00000000000000/* DO NOT EDIT THIS FILE - it is machine generated */ #include /* Header for class estraier_Document */ #ifndef _Included_estraier_Document #define _Included_estraier_Document #ifdef __cplusplus extern "C" { #endif /* * Class: estraier_Document * Method: add_attr * Signature: (Ljava/lang/String;Ljava/lang/String;)V */ JNIEXPORT void JNICALL Java_estraier_Document_add_1attr (JNIEnv *, jobject, jstring, jstring); /* * Class: estraier_Document * Method: add_text * Signature: (Ljava/lang/String;)V */ JNIEXPORT void JNICALL Java_estraier_Document_add_1text (JNIEnv *, jobject, jstring); /* * Class: estraier_Document * Method: add_hidden_text * Signature: (Ljava/lang/String;)V */ JNIEXPORT void JNICALL Java_estraier_Document_add_1hidden_1text (JNIEnv *, jobject, jstring); /* * Class: estraier_Document * Method: set_keywords * Signature: (Ljava/util/Map;)V */ JNIEXPORT void JNICALL Java_estraier_Document_set_1keywords (JNIEnv *, jobject, jobject); /* * Class: estraier_Document * Method: set_score * Signature: (I)V */ JNIEXPORT void JNICALL Java_estraier_Document_set_1score (JNIEnv *, jobject, jint); /* * Class: estraier_Document * Method: id * Signature: ()I */ JNIEXPORT jint JNICALL Java_estraier_Document_id (JNIEnv *, jobject); /* * Class: estraier_Document * Method: attr_names * Signature: ()Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_estraier_Document_attr_1names (JNIEnv *, jobject); /* * Class: estraier_Document * Method: attr * Signature: (Ljava/lang/String;)Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_estraier_Document_attr (JNIEnv *, jobject, jstring); /* * Class: estraier_Document * Method: texts * Signature: ()Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_estraier_Document_texts (JNIEnv *, jobject); /* * Class: estraier_Document * Method: cat_texts * Signature: ()Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_estraier_Document_cat_1texts (JNIEnv *, jobject); /* * Class: estraier_Document * Method: keywords * Signature: ()Ljava/util/Map; */ JNIEXPORT jobject JNICALL Java_estraier_Document_keywords (JNIEnv *, jobject); /* * Class: estraier_Document * Method: score * Signature: ()I */ JNIEXPORT jint JNICALL Java_estraier_Document_score (JNIEnv *, jobject); /* * Class: estraier_Document * Method: dump_draft * Signature: ()Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_estraier_Document_dump_1draft (JNIEnv *, jobject); /* * Class: estraier_Document * Method: make_snippet * Signature: (Ljava/util/List;III)Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_estraier_Document_make_1snippet (JNIEnv *, jobject, jobject, jint, jint, jint); /* * Class: estraier_Document * Method: initialize * Signature: ()V */ JNIEXPORT void JNICALL Java_estraier_Document_initialize__ (JNIEnv *, jobject); /* * Class: estraier_Document * Method: initialize * Signature: (Ljava/lang/String;)V */ JNIEXPORT void JNICALL Java_estraier_Document_initialize__Ljava_lang_String_2 (JNIEnv *, jobject, jstring); /* * Class: estraier_Document * Method: destroy * Signature: ()V */ JNIEXPORT void JNICALL Java_estraier_Document_destroy (JNIEnv *, jobject); #ifdef __cplusplus } #endif #endif hyperestraier-1.4.13/javanative/estraier_Result.h000066400000000000000000000013521125261632700221510ustar00rootroot00000000000000/* DO NOT EDIT THIS FILE - it is machine generated */ #include /* Header for class estraier_Result */ #ifndef _Included_estraier_Result #define _Included_estraier_Result #ifdef __cplusplus extern "C" { #endif /* * Class: estraier_Result * Method: get_score * Signature: (I)I */ JNIEXPORT jint JNICALL Java_estraier_Result_get_1score (JNIEnv *, jobject, jint); /* * Class: estraier_Result * Method: get_shadows * Signature: (I)[I */ JNIEXPORT jintArray JNICALL Java_estraier_Result_get_1shadows (JNIEnv *, jobject, jint); /* * Class: estraier_Result * Method: destroy * Signature: ()V */ JNIEXPORT void JNICALL Java_estraier_Result_destroy (JNIEnv *, jobject); #ifdef __cplusplus } #endif #endif hyperestraier-1.4.13/javanative/example/000077500000000000000000000000001125261632700202565ustar00rootroot00000000000000hyperestraier-1.4.13/javanative/example/Example001.java000066400000000000000000000017631125261632700227440ustar00rootroot00000000000000import estraier.*; public class Example001 { public static void main(String[] args){ // create the database object Database db = new Database(); // open the database if(!db.open("casket", Database.DBWRITER | Database.DBCREAT)){ System.err.println("error: " + db.err_msg(db.error())); return; } // create a document object Document doc = new Document(); // add attributes to the document object doc.add_attr("@uri", "http://estraier.gov/example.txt"); doc.add_attr("@title", "Over the Rainbow"); // add the body text to the document object doc.add_text("Somewhere over the rainbow. Way up high."); doc.add_text("There's a land that I heard of once in a lullaby."); // register the document object to the database if(!db.put_doc(doc, Database.PDCLEAN)) System.err.println("error: " + db.err_msg(db.error())); // close the database if(!db.close()) System.err.println("error: " + db.err_msg(db.error())); } } hyperestraier-1.4.13/javanative/example/Example002.java000066400000000000000000000024321125261632700227370ustar00rootroot00000000000000import estraier.*; import java.util.*; public class Example002 { public static void main(String[] args){ // create the database object Database db = new Database(); // open the database if(!db.open("casket", Database.DBREADER)){ System.err.println("error: " + db.err_msg(db.error())); return; } // create a search condition object Condition cond = new Condition(); // set the search phrase to the search condition object cond.set_phrase("rainbow AND lullaby"); // get the result of search Result result = db.search(cond); // for each document in the result for(int i = 0; i < result.doc_num(); i++){ // retrieve the document object Document doc = db.get_doc(result.get_doc_id(i), 0); if(doc == null) continue; // display attributes String uri = doc.attr("@uri"); if(uri != null) System.out.println("URI: " + uri); String title = doc.attr("@title"); if(title != null) System.out.println("Title: " + title); // display the body text Iterator it = doc.texts().iterator(); while(it.hasNext()){ System.out.println((String)it.next()); } } // close the database if(!db.close()) System.err.println("error: " + db.err_msg(db.error())); } } hyperestraier-1.4.13/javanative/example/Makefile000066400000000000000000000021041125261632700217130ustar00rootroot00000000000000# Makefile for sample programs of the Java binding #================================================================ # Setting Variables #================================================================ # Generic settings SHELL = /bin/sh # Targets MYCLASSES = Example001.class Example002.class # Building binaries JAVAC = javac JAVACFLAGS = -d . JAVACENV = CLASSPATH=.:../estraiernative.jar RUNENV = LD_LIBRARY_PATH=.:..:/lib:/usr/lib:$(HOME)/lib:/usr/local/lib #================================================================ # Actions #================================================================ all : $(MYCLASSES) clean : rm -rf $(MYCLASSES) *.exe *.o a.out check.out gmon.out leak.log casket *~ .PHONY : all clean #================================================================ # Building binaries #================================================================ Example001.class : Example001.java $(JAVACENV) $(JAVAC) $(JAVACFLAGS) Example001.java Example002.class : Example002.java $(JAVACENV) $(JAVAC) $(JAVACFLAGS) Example002.java # END OF FILE hyperestraier-1.4.13/javanative/myconf.c000066400000000000000000000131661125261632700202710ustar00rootroot00000000000000/************************************************************************************************* * Java binding of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #include "myconf.h" /************************************************************************************************* * common settings *************************************************************************************************/ int isinstanceof(JNIEnv *env, jobject obj, const char *name){ assert(env && name); if(!obj) return FALSE; return (*env)->IsInstanceOf(env, obj, (*env)->FindClass(env, name)); } void throwexception(JNIEnv *env, const char *name, const char *message){ jclass cls; assert(env && name && message); cls = (*env)->FindClass(env, name); (*env)->ThrowNew(env, cls, message); } void throwoutmem(JNIEnv *env){ assert(env); throwexception(env, CLSEOUTMEM, "out of memory"); } void throwillarg(JNIEnv *env){ assert(env); throwexception(env, CLSEILLARG, "illegal argument"); } jobject cblisttoobj(JNIEnv *env, const CBLIST *list){ jclass cls; jmethodID mid; jobject obj, kobj; int i; assert(list); cls = (*env)->FindClass(env, CLSARRAYLIST); mid = (*env)->GetMethodID(env, cls, "", "()V"); obj = (*env)->NewObject(env, cls, mid); mid = (*env)->GetMethodID(env, cls, "add", "(L" CLSOBJECT ";)Z"); for(i = 0; i < cblistnum(list); i++){ kobj = (*env)->NewStringUTF(env, cblistval(list, i, NULL)); (*env)->CallVoidMethod(env, obj, mid, kobj); (*env)->DeleteLocalRef(env, kobj); } return obj; } CBLIST *objtocblist(JNIEnv *env, jobject obj){ jclass list, it; jmethodID midit, midhn, midn; jobject itobj, eobj; jboolean icelem; CBLIST *tlist; const char *telem; assert(obj); tlist = cblistopen(); list = (*env)->GetObjectClass(env, obj); midit = (*env)->GetMethodID(env, list, "iterator", "()L" CLSITERATOR ";"); itobj = (*env)->CallObjectMethod(env, obj, midit); it = (*env)->GetObjectClass(env, itobj); midhn = (*env)->GetMethodID(env, it, "hasNext", "()Z"); midn = (*env)->GetMethodID(env, it, "next", "()L" CLSOBJECT ";"); while((*env)->CallBooleanMethod(env, itobj, midhn)){ eobj = (*env)->CallObjectMethod(env, itobj, midn); if(!isinstanceof(env, eobj, CLSSTRING)) continue; if(!(telem = (*env)->GetStringUTFChars(env, eobj, &icelem))) continue; cblistpush(tlist, telem, -1); if(icelem == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, eobj, telem); } return tlist; } jobject cbmaptoobj(JNIEnv *env, CBMAP *map){ jclass cls; jmethodID mid; jobject obj, kobj, vobj; const char *kbuf, *vbuf; assert(list); cls = (*env)->FindClass(env, CLSLHMAP); mid = (*env)->GetMethodID(env, cls, "", "()V"); obj = (*env)->NewObject(env, cls, mid); mid = (*env)->GetMethodID(env, cls, "put", "(L" CLSOBJECT ";L" CLSOBJECT ";)L" CLSOBJECT ";"); cbmapiterinit(map); while((kbuf = cbmapiternext(map, NULL)) != NULL){ vbuf = cbmapiterval(kbuf, NULL); kobj = (*env)->NewStringUTF(env, kbuf); vobj = (*env)->NewStringUTF(env, vbuf); (*env)->CallObjectMethod(env, obj, mid, kobj, vobj); (*env)->DeleteLocalRef(env, kobj); (*env)->DeleteLocalRef(env, vobj); } return obj; } CBMAP *objtocbmap(JNIEnv *env, jobject obj){ jclass map, set, it; jmethodID midks, midg, midit, midhn, midn; jobject ksobj, itobj, ekobj, evobj; jboolean ickey, icval; CBMAP *tmap; const char *tkey, *tval; assert(obj); tmap = cbmapopenex(31); map = (*env)->GetObjectClass(env, obj); midks = (*env)->GetMethodID(env, map, "keySet", "()L" CLSSET ";"); midg = (*env)->GetMethodID(env, map, "get", "(L" CLSOBJECT ";)L" CLSOBJECT ";"); ksobj = (*env)->CallObjectMethod(env, obj, midks); set = (*env)->GetObjectClass(env, ksobj); midit = (*env)->GetMethodID(env, set, "iterator", "()L" CLSITERATOR ";"); itobj = (*env)->CallObjectMethod(env, ksobj, midit); it = (*env)->GetObjectClass(env, itobj); midhn = (*env)->GetMethodID(env, it, "hasNext", "()Z"); midn = (*env)->GetMethodID(env, it, "next", "()L" CLSOBJECT ";"); while((*env)->CallBooleanMethod(env, itobj, midhn)){ ekobj = (*env)->CallObjectMethod(env, itobj, midn); if(!isinstanceof(env, ekobj, CLSSTRING)) continue; if(!(tkey = (*env)->GetStringUTFChars(env, ekobj, &ickey))) continue; evobj = (*env)->CallObjectMethod(env, obj, midg, ekobj); if(!isinstanceof(env, evobj, CLSSTRING) || !(tval = (*env)->GetStringUTFChars(env, evobj, &icval))){ if(ickey == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, ekobj, tkey); continue; } cbmapput(tmap, tkey, -1, tval, -1, TRUE); if(icval == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, evobj, tval); if(ickey == JNI_TRUE) (*env)->ReleaseStringUTFChars(env, ekobj, tkey); } return tmap; } /* END OF FILE */ hyperestraier-1.4.13/javanative/myconf.h000066400000000000000000000060451125261632700202740ustar00rootroot00000000000000/************************************************************************************************* * Java binding of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #ifndef _MYCONF_H /* duplication check */ #define _MYCONF_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /************************************************************************************************* * common settings *************************************************************************************************/ #undef TRUE #define TRUE 1 #undef FALSE #define FALSE 0 #if SIZEOF_VOID_P == SIZEOF_INT #define PTRNUM jint #else #define PTRNUM jlong #endif #define CLSOBJECT "java/lang/Object" #define CLSSTRING "java/lang/String" #define CLSLIST "java/util/List" #define CLSARRAYLIST "java/util/ArrayList" #define CLSMAP "java/util/Map" #define CLSLHMAP "java/util/LinkedHashMap" #define CLSITERATOR "java/util/Iterator" #define CLSSET "java/util/Set" #define CLSEILLARG "java/lang/IllegalArgumentException" #define CLSEOUTMEM "java/lang/OutOfMemoryError" #define CLSDOC "estraier/Document" #define CLSCOND "estraier/Condition" #define CLSDB "estraier/Database" #define CLSDBINFO "estraier/DatabaseInformer" #define CLSRES "estraier/Result" int isinstanceof(JNIEnv *env, jobject obj, const char *name); void throwexception(JNIEnv *env, const char *name, const char *message); void throwoutmem(JNIEnv *env); void throwillarg(JNIEnv *env); jobject cblisttoobj(JNIEnv *env, const CBLIST *list); CBLIST *objtocblist(JNIEnv *env, jobject obj); jobject cbmaptoobj(JNIEnv *env, CBMAP *map); CBMAP *objtocbmap(JNIEnv *env, jobject obj); #endif /* duplication check */ /* END OF FILE */ hyperestraier-1.4.13/javanative/overview.html000066400000000000000000000131731125261632700213640ustar00rootroot00000000000000 Java Binding of Hyper Estraier

    Java Binding of Hyper Estraier.

    Hyper Estraier is a full-text search system for communities.

    Introduction

    This is a package implementing the core API of Hyper Estraier, including native codes based on JNI. As it works on Linux, Mac OS X, Windows, and so on, native libraries for each environment are required to run programs. This package requires JRE 1.4.2 or later versions.

    Setting

    Install the latest version of Hyper Estraier.

    Enter the sub directory `javanative' in the extracted package then perform installation.

    cd javanative
    ./configure
    make
    su
    make install
    

    `estraiernative.jar' should be included in the class path. By default, the JAR file is installed in `/usr/local/lib'.

    `estraier.*' should be imported in each source file of application programs.

    Some native libraries should be found in the library search path.

    • On Linux and other UNIX systems: set the environment variable LD_LIBRARY_PATH to find libraries; "libestraier.so" and "libjestraier.so".
    • On Mac OS X: set the environment variable DYLD_LIBRARY_PATH to find libraries; "libestraier.dylib" and "libjestraier.dylib".
    • On Windows: set the environment variable PATH to find libraries; "estraier.dll" and "jestraier.dll".

    Example of Gatherer

    The following is the simplest implementation of a gatherer.

    import estraier.*;
    
    public class Example001 {
      public static void main(String[] args){
    
        // create the database object
        Database db = new Database();
    
        // open the database
        if(!db.open("casket", Database.DBWRITER | Database.DBCREAT)){
          System.err.println("error: " + db.err_msg(db.error()));
          return;
        }
    
        // create a document object
        Document doc = new Document();
    
        // add attributes to the document object
        doc.add_attr("@uri", "http://estraier.gov/example.txt");
        doc.add_attr("@title", "Over the Rainbow");
    
        // add the body text to the document object
        doc.add_text("Somewhere over the rainbow.  Way up high.");
        doc.add_text("There's a land that I heard of once in a lullaby.");
    
        // register the document object to the database
        if(!db.put_doc(doc, Database.PDCLEAN))
          System.err.println("error: " + db.err_msg(db.error()));
    
        // close the database
        if(!db.close())
          System.err.println("error: " + db.err_msg(db.error()));
    
      }
    }
    

    Example of Searcher

    The following is the simplest implementation of a searcher.

    import estraier.*;
    import java.util.*;
    
    public class Example002 {
      public static void main(String[] args){
    
        // create the database object
        Database db = new Database();
    
        // open the database
        if(!db.open("casket", Database.DBREADER)){
          System.err.println("error: " + db.err_msg(db.error()));
          return;
        }
    
        // create a search condition object
        Condition cond = new Condition();
    
        // set the search phrase to the search condition object
        cond.set_phrase("rainbow AND lullaby");
    
        // get the result of search
        Result result = db.search(cond);
    
        // for each document in the result
        for(int i = 0; i < result.doc_num(); i++){
          // retrieve the document object
          Document doc = db.get_doc(result.get_doc_id(i), 0);
          if(doc == null) continue;
          // display attributes
          String uri = doc.attr("@uri");
          if(uri != null) System.out.println("URI: " + uri);
          String title = doc.attr("@title");
          if(title != null) System.out.println("Title: " + title);
          // display the body text
          Iterator it = doc.texts().iterator();
          while(it.hasNext()){
            System.out.println((String)it.next());
          }
        }
    
        // close the database
        if(!db.close())
          System.err.println("error: " + db.err_msg(db.error()));
    
      }
    }
    

    License

    Copyright (C) 2004-2006 Mikio Hirabayashi

    The Java binding of Hyper Estraier 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 any later version. The Java binding of Hyper Estraier 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 the Java binding of Hyper Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

    hyperestraier-1.4.13/javanative/result.c000066400000000000000000000054671125261632700203210ustar00rootroot00000000000000/************************************************************************************************* * Java binding of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #include "estraier_Result.h" #include "myconf.h" /************************************************************************************************* * public objects *************************************************************************************************/ /* get_score */ JNIEXPORT jint JNICALL Java_estraier_Result_get_1score(JNIEnv *env, jobject obj, jint index){ jclass cls; jfieldID fid; jlong condptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "condptr", "J"); condptr = (*env)->GetLongField(env, obj, fid); return est_cond_score((ESTCOND *)(PTRNUM)condptr, index); } /* get_shadows */ JNIEXPORT jintArray JNICALL Java_estraier_Result_get_1shadows(JNIEnv *env, jobject obj, jint id){ jclass cls; jfieldID fid; jlong condptr; jintArray resary; jint *resaryptr; jboolean icresary; const int *ary; int i, anum; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "condptr", "J"); condptr = (*env)->GetLongField(env, obj, fid); ary = est_cond_shadows((ESTCOND *)(PTRNUM)condptr, id, &anum); if(!(resary = (*env)->NewIntArray(env, anum))){ throwoutmem(env); return NULL; } resaryptr = (*env)->GetIntArrayElements(env, resary, &icresary); for(i = 0; i < anum; i++){ resaryptr[i] = ary[i]; } if(icresary == JNI_TRUE) (*env)->ReleaseIntArrayElements(env, resary, resaryptr, 0); return resary; } /* destroy */ JNIEXPORT void JNICALL Java_estraier_Result_destroy(JNIEnv *env, jobject obj){ jclass cls; jfieldID fid; jlong condptr; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "condptr", "J"); condptr = (*env)->GetLongField(env, obj, fid); est_cond_delete((ESTCOND *)(PTRNUM)condptr); } /* END OF FILE */ hyperestraier-1.4.13/javapure/000077500000000000000000000000001125261632700163105ustar00rootroot00000000000000hyperestraier-1.4.13/javapure/Call.java000066400000000000000000000747631125261632700200470ustar00rootroot00000000000000/************************************************************************************************* * Pure Java interface of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * All rights reserved. * This file is part of Hyper Estraier. * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of Mikio Hirabayashi nor the names of its contributors may be used to * endorse or promote products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. *************************************************************************************************/ package estraier.pure; import java.util.*; import java.io.*; import java.net.*; /** * Command line utility for the node API. */ public class Call { //---------------------------------------------------------------- // class fields //---------------------------------------------------------------- /* class constants */ private static final int SEARCHMAX = 10; private static final int SEARCHAUX = 32; private static final PrintStream stdout = System.out; private static final PrintStream stderr = System.err; /* class variables */ private static String pxhost = null; private static int pxport = 0; private static int timeout = -1; private static String authname = null; private static String authpass = null; //---------------------------------------------------------------- // public static methods //---------------------------------------------------------------- /** * Main routine of the command. * @param args command line arguments. The first argument specifies the name of the sub * command. "put", "out", "edit", "get", "etch", "uriid", "inform", "sync", "optimize", "search", "setuser", and "setlink" are provided. */ public static void main(String[] args){ int rv = 0; if(args.length < 1) usage(); if(args[0].equals("put")){ rv = runput(args); } else if(args[0].equals("out")){ rv = runout(args); } else if(args[0].equals("edit")){ rv = runedit(args); } else if(args[0].equals("get")){ rv = runget(args); } else if(args[0].equals("etch")){ rv = runetch(args); } else if(args[0].equals("uriid")){ rv = runuriid(args); } else if(args[0].equals("inform")){ rv = runinform(args); } else if(args[0].equals("sync")){ rv = runsync(args); } else if(args[0].equals("optimize")){ rv = runoptimize(args); } else if(args[0].equals("search")){ rv = runsearch(args); } else if(args[0].equals("setuser")){ rv = runsetuser(args); } else if(args[0].equals("setlink")){ rv = runsetlink(args); } else { usage(); } System.exit(rv); } //---------------------------------------------------------------- // private static methods //---------------------------------------------------------------- /* print the usage and exit */ private static void usage(){ stderr.println("command line utility for the node API of Hyper Estraier"); stderr.println(""); stderr.println("synopsis:"); stderr.println(" java " + Call.class.getName() + " arguments..."); stderr.println(""); stderr.println("arguments:"); stderr.println(" put [-proxy host:port] [-tout num] [-auth user pass]" + " nurl [file]"); stderr.println(" out [-proxy host:port] [-tout num] [-auth user pass]" + " nurl expr"); stderr.println(" edit [-proxy host:port] [-tout num] [-auth user pass]" + " nurl expr name [value]"); stderr.println(" get [-proxy host:port] [-tout num] [-auth user pass]" + " nurl expr [attr]"); stderr.println(" etch [-proxy host:port] [-tout num] [-auth user pass]" + " nurl expr"); stderr.println(" uriid [-proxy host:port] [-tout num] [-auth user pass]" + " nurl uri"); stderr.println(" inform [-proxy host:port] [-tout num] [-auth user pass]" + " nurl"); stderr.println(" sync [-proxy host:port] [-tout num] [-auth user pass]" + " nurl"); stderr.println(" optimize [-proxy host:port] [-tout num] [-auth user pass]" + " nurl"); stderr.println(" search [-proxy host:port] [-tout num] [-auth user pass]" + " [-sf|-sfr|-sfu|-sfi] [-attr expr] [-ord expr] [-max num] [-sk num]" + " [-aux num] [-dis name] [-dpt num] [-mask num] nurl [phrase]"); stderr.println(" setuser [-proxy host:port] [-tout num] [-auth user pass]" + " nurl name mode"); stderr.println(" setlink [-proxy host:port] [-tout num] [-auth user pass]" + " nurl url label credit"); stderr.println(""); System.exit(1); } /* print error string and flush the buffer */ private static void printerror(String msg){ stderr.println(Call.class.getName() + ": " + msg); stderr.flush(); } /* parse arguments of the put command */ private static int runput(String[] args){ String nurl = null; String file = null; for(int i = 1; i < args.length; i++){ String arg = args[i]; if(nurl == null && arg.startsWith("-")){ if(arg.equals("-proxy")){ if(++i >= args.length) usage(); pxhost = args[i]; if(++i >= args.length) usage(); pxport = Integer.parseInt(args[i]); } else if(arg.equals("-tout")){ if(++i >= args.length) usage(); timeout = Integer.parseInt(args[i]); } else if(arg.equals("-auth")){ if(++i >= args.length) usage(); authname = args[i]; if(++i >= args.length) usage(); authpass = args[i]; } else { usage(); } } else if(nurl == null){ nurl = arg; } else if(file == null){ file = arg; } else { usage(); } } if(nurl == null) usage(); return procput(nurl, file); } /* parse arguments of the out command */ private static int runout(String[] args){ String nurl = null; String expr = null; for(int i = 1; i < args.length; i++){ String arg = args[i]; if(nurl == null && arg.startsWith("-")){ if(arg.equals("-proxy")){ if(++i >= args.length) usage(); pxhost = args[i]; if(++i >= args.length) usage(); pxport = Integer.parseInt(args[i]); } else if(arg.equals("-tout")){ if(++i >= args.length) usage(); timeout = Integer.parseInt(args[i]); } else if(arg.equals("-auth")){ if(++i >= args.length) usage(); authname = args[i]; if(++i >= args.length) usage(); authpass = args[i]; } else { usage(); } } else if(nurl == null){ nurl = arg; } else if(expr == null){ expr = arg; } else { usage(); } } if(nurl == null || expr == null) usage(); return procout(nurl, expr); } /* parse arguments of the edit command */ private static int runedit(String[] args){ String nurl = null; String expr = null; String name = null; String value = null; for(int i = 1; i < args.length; i++){ String arg = args[i]; if(nurl == null && arg.startsWith("-")){ if(arg.equals("-proxy")){ if(++i >= args.length) usage(); pxhost = args[i]; if(++i >= args.length) usage(); pxport = Integer.parseInt(args[i]); } else if(arg.equals("-tout")){ if(++i >= args.length) usage(); timeout = Integer.parseInt(args[i]); } else if(arg.equals("-auth")){ if(++i >= args.length) usage(); authname = args[i]; if(++i >= args.length) usage(); authpass = args[i]; } else { usage(); } } else if(nurl == null){ nurl = arg; } else if(expr == null){ expr = arg; } else if(name == null){ name = arg; } else if(value == null){ value = arg; } else { usage(); } } if(nurl == null || expr == null || name == null) usage(); return procedit(nurl, expr, name, value); } /* parse arguments of the get command */ private static int runget(String[] args){ String nurl = null; String expr = null; String attr = null; for(int i = 1; i < args.length; i++){ String arg = args[i]; if(nurl == null && arg.startsWith("-")){ if(arg.equals("-proxy")){ if(++i >= args.length) usage(); pxhost = args[i]; if(++i >= args.length) usage(); pxport = Integer.parseInt(args[i]); } else if(arg.equals("-tout")){ if(++i >= args.length) usage(); timeout = Integer.parseInt(args[i]); } else if(arg.equals("-auth")){ if(++i >= args.length) usage(); authname = args[i]; if(++i >= args.length) usage(); authpass = args[i]; } else { usage(); } } else if(nurl == null){ nurl = arg; } else if(expr == null){ expr = arg; } else if(attr == null){ attr = arg; } else { usage(); } } if(nurl == null || expr == null) usage(); return procget(nurl, expr, attr); } /* parse arguments of the etch command */ private static int runetch(String[] args){ String nurl = null; String expr = null; for(int i = 1; i < args.length; i++){ String arg = args[i]; if(nurl == null && arg.startsWith("-")){ if(arg.equals("-proxy")){ if(++i >= args.length) usage(); pxhost = args[i]; if(++i >= args.length) usage(); pxport = Integer.parseInt(args[i]); } else if(arg.equals("-tout")){ if(++i >= args.length) usage(); timeout = Integer.parseInt(args[i]); } else if(arg.equals("-auth")){ if(++i >= args.length) usage(); authname = args[i]; if(++i >= args.length) usage(); authpass = args[i]; } else { usage(); } } else if(nurl == null){ nurl = arg; } else if(expr == null){ expr = arg; } else { usage(); } } if(nurl == null || expr == null) usage(); return procetch(nurl, expr); } /* parse arguments of the uriid command */ private static int runuriid(String[] args){ String nurl = null; String uri = null; for(int i = 1; i < args.length; i++){ String arg = args[i]; if(nurl == null && arg.startsWith("-")){ if(arg.equals("-proxy")){ if(++i >= args.length) usage(); pxhost = args[i]; if(++i >= args.length) usage(); pxport = Integer.parseInt(args[i]); } else if(arg.equals("-tout")){ if(++i >= args.length) usage(); timeout = Integer.parseInt(args[i]); } else if(arg.equals("-auth")){ if(++i >= args.length) usage(); authname = args[i]; if(++i >= args.length) usage(); authpass = args[i]; } else { usage(); } } else if(nurl == null){ nurl = arg; } else if(uri == null){ uri = arg; } else { usage(); } } if(nurl == null || uri == null) usage(); return procuriid(nurl, uri); } /* parse arguments of the inform command */ private static int runinform(String[] args){ String nurl = null; for(int i = 1; i < args.length; i++){ String arg = args[i]; if(nurl == null && arg.startsWith("-")){ if(arg.equals("-proxy")){ if(++i >= args.length) usage(); pxhost = args[i]; if(++i >= args.length) usage(); pxport = Integer.parseInt(args[i]); } else if(arg.equals("-tout")){ if(++i >= args.length) usage(); timeout = Integer.parseInt(args[i]); } else if(arg.equals("-auth")){ if(++i >= args.length) usage(); authname = args[i]; if(++i >= args.length) usage(); authpass = args[i]; } else { usage(); } } else if(nurl == null){ nurl = arg; } else { usage(); } } if(nurl == null) usage(); return procinform(nurl); } /* parse arguments of the sync command */ private static int runsync(String[] args){ String nurl = null; for(int i = 1; i < args.length; i++){ String arg = args[i]; if(nurl == null && arg.startsWith("-")){ if(arg.equals("-proxy")){ if(++i >= args.length) usage(); pxhost = args[i]; if(++i >= args.length) usage(); pxport = Integer.parseInt(args[i]); } else if(arg.equals("-tout")){ if(++i >= args.length) usage(); timeout = Integer.parseInt(args[i]); } else if(arg.equals("-auth")){ if(++i >= args.length) usage(); authname = args[i]; if(++i >= args.length) usage(); authpass = args[i]; } else { usage(); } } else if(nurl == null){ nurl = arg; } else { usage(); } } if(nurl == null) usage(); return procsync(nurl); } /* parse arguments of the optimize command */ private static int runoptimize(String[] args){ String nurl = null; for(int i = 1; i < args.length; i++){ String arg = args[i]; if(nurl == null && arg.startsWith("-")){ if(arg.equals("-proxy")){ if(++i >= args.length) usage(); pxhost = args[i]; if(++i >= args.length) usage(); pxport = Integer.parseInt(args[i]); } else if(arg.equals("-tout")){ if(++i >= args.length) usage(); timeout = Integer.parseInt(args[i]); } else if(arg.equals("-auth")){ if(++i >= args.length) usage(); authname = args[i]; if(++i >= args.length) usage(); authpass = args[i]; } else { usage(); } } else if(nurl == null){ nurl = arg; } else { usage(); } } if(nurl == null) usage(); return procoptimize(nurl); } /* parse arguments of the search command */ private static int runsearch(String[] args){ String nurl = null; String phrase = null; List attrs = new ArrayList(3); String ord = null; int max = SEARCHMAX; int skip = 0; int opts = 0; int aux = SEARCHAUX; String dis = null; int depth = 0; int mask = 0; for(int i = 1; i < args.length; i++){ String arg = args[i]; if(nurl == null && arg.startsWith("-")){ if(arg.equals("-proxy")){ if(++i >= args.length) usage(); pxhost = args[i]; if(++i >= args.length) usage(); pxport = Integer.parseInt(args[i]); } else if(arg.equals("-tout")){ if(++i >= args.length) usage(); timeout = Integer.parseInt(args[i]); } else if(arg.equals("-auth")){ if(++i >= args.length) usage(); authname = args[i]; if(++i >= args.length) usage(); authpass = args[i]; } else if(arg.equals("-sf")){ opts |= Condition.SIMPLE; } else if(arg.equals("-sfr")){ opts |= Condition.ROUGH; } else if(arg.equals("-sfu")){ opts |= Condition.UNION; } else if(arg.equals("-sfi")){ opts |= Condition.ISECT; } else if(arg.equals("-attr")){ if(++i >= args.length) usage(); attrs.add(args[i]); } else if(arg.equals("-ord")){ if(++i >= args.length) usage(); ord = args[i]; } else if(arg.equals("-max")){ if(++i >= args.length) usage(); max = Integer.parseInt(args[i]); } else if(arg.equals("-sk")){ if(++i >= args.length) usage(); skip = Integer.parseInt(args[i]); } else if(arg.equals("-aux")){ if(++i >= args.length) usage(); aux = Integer.parseInt(args[i]); } else if(arg.equals("-dis")){ if(++i >= args.length) usage(); dis = args[i]; } else if(arg.equals("-dpt")){ if(++i >= args.length) usage(); depth = Integer.parseInt(args[i]); } else if(arg.equals("-mask")){ if(++i >= args.length) usage(); mask = Integer.parseInt(args[i]); } else { usage(); } } else if(nurl == null){ nurl = arg; } else if(phrase == null){ phrase = arg; } else { phrase = phrase + " " + arg; } } if(nurl == null) usage(); return procsearch(nurl, phrase, attrs, ord, max, skip, opts, aux, dis, depth, mask); } /* parse arguments of the setuser command */ private static int runsetuser(String[] args){ String nurl = null; String name = null; String mstr = null; for(int i = 1; i < args.length; i++){ String arg = args[i]; if(nurl == null && arg.startsWith("-")){ if(arg.equals("-proxy")){ if(++i >= args.length) usage(); pxhost = args[i]; if(++i >= args.length) usage(); pxport = Integer.parseInt(args[i]); } else if(arg.equals("-tout")){ if(++i >= args.length) usage(); timeout = Integer.parseInt(args[i]); } else if(arg.equals("-auth")){ if(++i >= args.length) usage(); authname = args[i]; if(++i >= args.length) usage(); authpass = args[i]; } else { usage(); } } else if(nurl == null){ nurl = arg; } else if(name == null){ name = arg; } else if(mstr == null){ mstr = arg; } else { usage(); } } if(nurl == null || name == null || mstr == null) usage(); int mode = Integer.parseInt(mstr); if(mode < 0) usage(); return procsetuser(nurl, name, mode); } /* parse arguments of the setlink command */ private static int runsetlink(String[] args){ String nurl = null; String url = null; String label = null; String cstr = null; for(int i = 1; i < args.length; i++){ String arg = args[i]; if(nurl == null && arg.startsWith("-")){ if(arg.equals("-proxy")){ if(++i >= args.length) usage(); pxhost = args[i]; if(++i >= args.length) usage(); pxport = Integer.parseInt(args[i]); } else if(arg.equals("-tout")){ if(++i >= args.length) usage(); timeout = Integer.parseInt(args[i]); } else if(arg.equals("-auth")){ if(++i >= args.length) usage(); authname = args[i]; if(++i >= args.length) usage(); authpass = args[i]; } else { usage(); } } else if(nurl == null){ nurl = arg; } else if(url == null){ url = arg; } else if(label == null){ label = arg; } else if(cstr == null){ cstr = arg; } else { usage(); } } if(nurl == null || url == null || label == null || cstr == null) usage(); int credit = Integer.parseInt(cstr); return procsetlink(nurl, url, label, credit); } /* perform the put command */ private static int procput(String nurl, String file){ byte[] data = null; if(file != null){ FileInputStream fis = null; try { fis = new FileInputStream(file); data = Utility.read_all(fis); } catch(IOException e){ printerror(e.toString()); return 1; } finally { try { if(fis != null) fis.close(); } catch(IOException e){} } } else { try { data = Utility.read_all(System.in); } catch(IOException e){ printerror(e.toString()); return 1; } } String draft = null; try { draft = new String(data, "UTF-8"); } catch(UnsupportedEncodingException e){ printerror(e.toString()); return 1; } Document doc = new Document(draft); Node node = new Node(); node.set_url(nurl); if(pxhost != null) node.set_proxy(pxhost, pxport); if(timeout > 0) node.set_timeout(timeout); if(authname != null) node.set_auth(authname, authpass); if(!node.put_doc(doc)){ printerror("failed: " + node.status()); return 1; } return 0; } /* perform the out command */ private static int procout(String nurl, String expr){ int id = -1; try { id = Integer.parseInt(expr); } catch(NumberFormatException e){ id = -1; } Node node = new Node(); node.set_url(nurl); if(pxhost != null) node.set_proxy(pxhost, pxport); if(timeout > 0) node.set_timeout(timeout); if(authname != null) node.set_auth(authname, authpass); if(id > 0){ if(!node.out_doc(id)){ printerror("failed: " + node.status()); return 1; } } else { if(!node.out_doc_by_uri(expr)){ printerror("failed: " + node.status()); return 1; } } return 0; } /* perform the edit command */ private static int procedit(String nurl, String expr, String name, String value){ int id = -1; try { id = Integer.parseInt(expr); } catch(NumberFormatException e){ id = -1; } Node node = new Node(); node.set_url(nurl); if(pxhost != null) node.set_proxy(pxhost, pxport); if(timeout > 0) node.set_timeout(timeout); if(authname != null) node.set_auth(authname, authpass); Document doc = id > 0 ? node.get_doc(id) : node.get_doc_by_uri(expr); if(doc == null){ printerror("failed: " + node.status()); return 1; } doc.add_attr(name, value); if(!node.edit_doc(doc)){ printerror("failed: " + node.status()); return 1; } return 0; } /* perform the get command */ private static int procget(String nurl, String expr, String attr){ int id = -1; try { id = Integer.parseInt(expr); } catch(NumberFormatException e){ id = -1; } Node node = new Node(); node.set_url(nurl); if(pxhost != null) node.set_proxy(pxhost, pxport); if(timeout > 0) node.set_timeout(timeout); if(authname != null) node.set_auth(authname, authpass); if(attr != null){ String value = id > 0 ? node.get_doc_attr(id, attr) : node.get_doc_attr_by_uri(expr, attr); if(value == null){ printerror("failed: " + node.status()); return 1; } stdout.println(value); } else { Document doc = id > 0 ? node.get_doc(id) : node.get_doc_by_uri(expr); if(doc == null){ printerror("failed: " + node.status()); return 1; } stdout.print(doc.dump_draft()); } return 0; } /* perform the etch command */ private static int procetch(String nurl, String expr){ int id = -1; try { id = Integer.parseInt(expr); } catch(NumberFormatException e){ id = -1; } Node node = new Node(); node.set_url(nurl); if(pxhost != null) node.set_proxy(pxhost, pxport); if(timeout > 0) node.set_timeout(timeout); if(authname != null) node.set_auth(authname, authpass); Map kwords = id > 0 ? node.etch_doc(id) : node.etch_doc_by_uri(expr); if(kwords == null){ printerror("failed: " + node.status()); return 1; } Iterator it = kwords.keySet().iterator(); while(it.hasNext()){ String key = (String)it.next(); stdout.println(key + "\t" + (String)kwords.get(key)); } return 0; } /* perform the uriid command */ private static int procuriid(String nurl, String uri){ Node node = new Node(); node.set_url(nurl); if(pxhost != null) node.set_proxy(pxhost, pxport); if(timeout > 0) node.set_timeout(timeout); if(authname != null) node.set_auth(authname, authpass); int id = node.uri_to_id(uri); if(id == -1){ printerror("failed: " + node.status()); return 1; } stdout.println(id); return 0; } /* perform the inform command */ private static int procinform(String nurl){ Node node = new Node(); node.set_url(nurl); if(pxhost != null) node.set_proxy(pxhost, pxport); if(timeout > 0) node.set_timeout(timeout); if(authname != null) node.set_auth(authname, authpass); String name = node.name(); String label = node.name(); int dnum = node.doc_num(); int wnum = node.word_num(); double size = node.size(); double ratio = node.cache_usage(); if(name == null || label == null || dnum < 0 || wnum < 0 || size < 0.0 || ratio < 0.0){ printerror("failed: " + node.status()); return 1; } stdout.println(name + "\t" + label + "\t" + dnum + "\t" + wnum + "\t" + (long)size + "\t" + ratio); return 0; } /* perform the sync command */ private static int procsync(String nurl){ Node node = new Node(); node.set_url(nurl); if(pxhost != null) node.set_proxy(pxhost, pxport); if(timeout > 0) node.set_timeout(timeout); if(authname != null) node.set_auth(authname, authpass); if(!node.sync()){ printerror("failed: " + node.status()); return 1; } return 0; } /* perform the optimize command */ private static int procoptimize(String nurl){ Node node = new Node(); node.set_url(nurl); if(pxhost != null) node.set_proxy(pxhost, pxport); if(timeout > 0) node.set_timeout(timeout); if(authname != null) node.set_auth(authname, authpass); if(!node.optimize()){ printerror("failed: " + node.status()); return 1; } return 0; } /* perform the search command */ private static int procsearch(String nurl, String phrase, List attrs, String ord, int max, int skip, int opts, int aux, String dis, int depth, int mask){ Node node = new Node(); node.set_url(nurl); if(pxhost != null) node.set_proxy(pxhost, pxport); if(timeout > 0) node.set_timeout(timeout); if(authname != null) node.set_auth(authname, authpass); Condition cond = new Condition(); if(phrase != null) cond.set_phrase(phrase); Iterator attrsit = attrs.iterator(); while(attrsit.hasNext()){ cond.add_attr((String)attrsit.next()); } if(ord != null) cond.set_order(ord); if(max >= 0) cond.set_max(max); if(skip >= 0) cond.set_skip(skip); cond.set_options(opts); cond.set_auxiliary(aux); if(dis != null) cond.set_distinct(dis); cond.set_mask(mask); NodeResult nres = node.search(cond, depth); Calendar cal = new GregorianCalendar(); String border = "--------[" + cal.getTimeInMillis() + "]--------"; if(nres != null){ stdout.println(border); String value; if((value = nres.hint("VERSION")) != null) stdout.println("VERSION\t" + value); if((value = nres.hint("NODE")) != null) stdout.println("NODE\t" + value); if((value = nres.hint("HIT")) != null) stdout.println("HIT\t" + value); for(int i = 1;; i++){ String key = "HINT#" + i; if((value = nres.hint(key)) != null){ stdout.println(key + "\t" + value); } else { break; } } if((value = nres.hint("DOCNUM")) != null) stdout.println("DOCNUM\t" + value); if((value = nres.hint("WORDNUM")) != null) stdout.println("WORDNUM\t" + value); if((value = nres.hint("TIME")) != null) stdout.println("TIME\t" + value); if((value = nres.hint("TIME#i")) != null) stdout.println("TIME#i\t" + value); for(int i = 0;; i++){ String key = "TIME#" + i; if((value = nres.hint(key)) != null){ stdout.println(key + "\t" + value); } else { break; } } for(int i = 0;; i++){ String key = "LINK#" + i; if((value = nres.hint(key)) != null){ stdout.println(key + "\t" + value); } else { break; } } if((value = nres.hint("VIEW")) != null) stdout.println("VIEW\t" + value); stdout.println(""); for(int i = 0; i < nres.doc_num(); i++){ stdout.println(border); ResultDocument rdoc = nres.get_doc(i); List names = rdoc.attr_names(); Iterator it = names.iterator(); while(it.hasNext()){ String name = (String)it.next(); stdout.println(name + "=" + rdoc.attr(name)); } String keywords = rdoc.keywords(); if(keywords.length() > 0) stdout.println("%VECTOR\t" + keywords); stdout.println(""); stdout.print(rdoc.snippet()); } stdout.println(border + ":END"); } else { printerror("failed: " + node.status()); return 1; } return 0; } /* perform the setuser command */ private static int procsetuser(String nurl, String name, int mode){ Node node = new Node(); node.set_url(nurl); if(pxhost != null) node.set_proxy(pxhost, pxport); if(timeout > 0) node.set_timeout(timeout); if(authname != null) node.set_auth(authname, authpass); if(!node.set_user(name, mode)){ printerror("failed: " + node.status()); return 1; } return 0; } /* perform the setlink command */ private static int procsetlink(String nurl, String url, String label, int credit){ Node node = new Node(); node.set_url(nurl); if(pxhost != null) node.set_proxy(pxhost, pxport); if(timeout > 0) node.set_timeout(timeout); if(authname != null) node.set_auth(authname, authpass); if(!node.set_link(url, label, credit)){ printerror("failed: " + node.status()); return 1; } return 0; } /* dummy method: hide the constructor */ private Call(){} } /* END OF FILE */ hyperestraier-1.4.13/javapure/Condition.java000066400000000000000000000176211125261632700211100ustar00rootroot00000000000000/************************************************************************************************* * Pure Java interface of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * All rights reserved. * This file is part of Hyper Estraier. * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of Mikio Hirabayashi nor the names of its contributors may be used to * endorse or promote products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. *************************************************************************************************/ package estraier.pure; import java.util.*; import java.io.*; import java.net.*; /** * Abstraction of search condition. */ public class Condition { //---------------------------------------------------------------- // public constants //---------------------------------------------------------------- /** option: check every N-gram key */ public static final int SURE = 1 << 0; /** option: check N-gram keys skipping by one */ public static final int USUAL = 1 << 1; /** option: check N-gram keys skipping by two */ public static final int FAST = 1 << 2; /** option: check N-gram keys skipping by three */ public static final int AGITO = 1 << 3; /** option: without TF-IDF tuning */ public static final int NOIDF = 1 << 4; /** option: with the simplified phrase */ public static final int SIMPLE = 1 << 10; /** option: with the rough phrase */ public static final int ROUGH = 1 << 11; /** option: with the union phrase */ public static final int UNION = 1 << 15; /** option: with the intersection phrase */ public static final int ISECT = 1 << 16; //---------------------------------------------------------------- // private fields //---------------------------------------------------------------- private String phrase; private List attrs; private String order; private int max; private int skip; private int options; private int auxiliary; private String distinct; private int mask; //---------------------------------------------------------------- // constructors //---------------------------------------------------------------- /** * Create a search condition object. */ public Condition(){ phrase = null; attrs = new ArrayList(31); order = null; max = -1; skip = 0; options = 0; auxiliary = 32; distinct = null; mask = 0; } //---------------------------------------------------------------- // public methods //---------------------------------------------------------------- /** * Set the search phrase. * @param phrase a search phrase. */ public void set_phrase(String phrase){ this.phrase = phrase; } /** * Add an expression for an attribute. * @param expr an expression for an attribute. */ public void add_attr(String expr){ attrs.add(expr); } /** * Set the order. * @param expr an expression for the order. By default, the order is by score descending. */ public void set_order(String expr){ order = expr; } /** * Set the maximum number of retrieval. * @param max the maximum number of retrieval. By default, the number of retrieval is not * limited. */ public void set_max(int max){ if(max >= 0) this.max = max; } /** * Set the number of skipped documents. * @param skip the number of documents to be skipped in the search result. */ public void set_skip(int skip){ if(skip >= 0) this.skip = skip; } /** * Set options of retrieval. * @param options options: `Condition.SURE' specifies that it checks every N-gram key, * `Condition.USUAL', which is the default, specifies that it checks N-gram keys with skipping * one key, `Condition.FAST' skips two keys, `Condition.AGITO' skips three keys, * `Condition.NOIDF' specifies not to perform TF-IDF tuning, `Condition.SIMPLE' specifies to * use simplified phrase, `Condition.ROUGH' specifies to use rough phrase, `Condition.UNION' * specifies to use union phrase, `Condition.ISECT' specifies to use intersection phrase. Each * option can be specified at the same time by bitwise or. If keys are skipped, though search * speed is improved, the relevance ratio grows less. */ public void set_options(int options){ this.options |= options; } /** * Set permission to adopt result of the auxiliary index. * @param min the minimum hits to adopt result of the auxiliary index. If it is not more * than 0, the auxiliary index is not used. By default, it is 32. */ public void set_auxiliary(int min){ this.auxiliary = min; } /** * Set the attribute distinction filter. * @param name the name of an attribute to be distinct. */ public void set_distinct(String name){ distinct = name; } /** * Set the mask of targets of meta search. * @param mask a masking number. 1 means the first target, 2 means the second target, 4 means * the third target and, power values of 2 and their summation compose the mask. */ public void set_mask(int mask){ this.mask = mask & 0x7fffffff; } //---------------------------------------------------------------- // package methods //---------------------------------------------------------------- /** * Get the search phrase. * @return the search phrase. */ String phrase(){ if(phrase == null) return ""; return phrase; } /** * Get expressions for attributes. * @return expressions for attributes. */ List attrs(){ return attrs; } /** * Get the order expression. * @return the order expression. */ String order(){ if(order == null) return ""; return order; } /** * Get the maximum number of retrieval. * @return the maximum number of retrieval. */ int max(){ return max; } /** * Get the number of skipped documents. * @return the number of documents to be skipped in the search result. */ int skip(){ return skip; } /** * Get options of retrieval. * @return options by bitwise or. */ int options(){ return options; } /** * Get permission to adopt result of the auxiliary index. * @return permission to adopt result of the auxiliary index. */ int auxiliary(){ return auxiliary; } /** * Get the attribute distinction filter. * @return the name of the distinct attribute. */ String distinct(){ if(distinct == null) return ""; return distinct; } /** * Get the mask of targets of meta search. * @return the mask of targets of meta search. */ int mask(){ return mask; } } /* END OF FILE */ hyperestraier-1.4.13/javapure/Document.java000066400000000000000000000200231125261632700207260ustar00rootroot00000000000000/************************************************************************************************* * Pure Java interface of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * All rights reserved. * This file is part of Hyper Estraier. * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of Mikio Hirabayashi nor the names of its contributors may be used to * endorse or promote products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. *************************************************************************************************/ package estraier.pure; import java.util.*; import java.io.*; import java.net.*; /** * Abstraction of document. */ public class Document { //---------------------------------------------------------------- // private fields //---------------------------------------------------------------- private int id; private Map attrs; private List dtexts; private List htexts; private Map kwords; private int score; //---------------------------------------------------------------- // constructors //---------------------------------------------------------------- /** * Create a document object. */ public Document(){ id = -1; attrs = new HashMap(31); dtexts = new ArrayList(31); htexts = new ArrayList(31); kwords = null; score = -1; } /** * Create a document object made from draft data. * @param draft a string of draft data. */ public Document(String draft){ this(); String[] lines = Utility.split_lines(draft); int lnum = 0; while(lnum < lines.length){ String line = lines[lnum++].trim(); if(line.length() < 1) break; if(line.startsWith("%")){ if(line.startsWith("%VECTOR\t")){ if(kwords == null) kwords = new HashMap(32); String[] fields = Utility.split_fields(line); for(int i = 1; i < fields.length - 1; i += 2){ if(fields[i].length() < 0 || fields[i+1].length() < 0 || fields[i].charAt(0) <= ' ') continue; kwords.put(fields[i], fields[i+1]); } } else if(line.startsWith("%SCORE\t")){ String[] fields = Utility.split_fields(line); score = Integer.parseInt(fields[1]); } continue; } int lidx = line.indexOf('='); if(lidx != -1) add_attr(line.substring(0, lidx), line.substring(lidx + 1, line.length())); } while(lnum < lines.length){ String line = lines[lnum++]; if(line.length() < 1) continue; if(line.charAt(0) == '\t'){ line = line.substring(1, line.length()); if(line.length() > 0) add_hidden_text(line); } else { add_text(line); } } } //---------------------------------------------------------------- // public methods //---------------------------------------------------------------- /** * Add an attribute. * @param name the name of an attribute. * @param value the value of the attribute. If it is `null', the attribute is removed. */ public void add_attr(String name, String value){ if(value != null){ attrs.put(name, value.trim()); } else { attrs.remove(name); } } /** * Add a sentence of text. * @param text sentence of text. */ public void add_text(String text){ text = text.trim(); if(text.length() > 0) dtexts.add(text); } /** * Add a hidden sentence. * @param text a hidden sentence. */ public void add_hidden_text(String text){ text = text.trim(); if(text.length() > 0) htexts.add(text); } /** * Attach keywords. * @param kwords a map object of keywords. Keys of the map should be keywords of the document * and values should be their scores in decimal string. */ public void set_keywords(Map kwords){ this.kwords = kwords; } /** * Set the substitute score. * @param score the substitute score. It it is negative, the substitute score setting is * nullified. */ private void set_score(int score){ this.score = score; } /** * Get the ID number. * @return the ID number. If this object has never been registered, -1 is returned. */ public int id(){ return id; } /** * Get a list of attribute names. * @return a list object of attribute names. */ public List attr_names(){ List names = new ArrayList(attrs.size()); Iterator it = attrs.keySet().iterator(); while(it.hasNext()){ names.add(it.next()); } Collections.sort(names); return names; } /** * Get the value of an attribute. * @param name the name of an attribute. * @return the value of the attribute or `null' if it does not exist. */ public String attr(String name){ return (String)attrs.get(name); } /** * Get a list of sentences of the text. * @return a list object of sentences of the text. */ public List texts(){ return dtexts; } /** * Concatenate sentences of the text. * @return concatenated sentences. */ public String cat_texts(){ StringBuffer sb = new StringBuffer(); Iterator it = dtexts.iterator(); for(int i = 0; it.hasNext(); i++){ if(i > 0) sb.append(" "); sb.append(it.next()); } return sb.toString(); } /** * Get attached keywords. * @return a map object of keywords and their scores in decimal string. If no keyword is * attached, `null' is returned. */ public Map keywords(){ return kwords; } /** * Get the substitute score. * @return the substitute score or -1 if it is not set. */ public int score(){ if(score < 0) return -1; return score; } /** * Dump draft data. * @return draft data. */ public String dump_draft(){ StringBuffer sb = new StringBuffer(); List names = attr_names(); Iterator attrit = names.iterator(); while(attrit.hasNext()){ String name = (String)attrit.next(); sb.append(name); sb.append("="); sb.append((String)attrs.get(name)); sb.append("\n"); } if(kwords != null){ sb.append("%VECTOR"); Iterator kwit = kwords.keySet().iterator(); while(kwit.hasNext()){ String key = (String)kwit.next(); sb.append("\t"); sb.append(key); sb.append("\t"); sb.append((String)kwords.get(key)); } sb.append("\n"); } if(score >= 0) sb.append("%SCORE\t" + score + "\n"); sb.append("\n"); Iterator dtit = dtexts.iterator(); while(dtit.hasNext()){ sb.append(dtit.next()); sb.append("\n"); } Iterator htit = htexts.iterator(); while(htit.hasNext()){ sb.append("\t"); sb.append(htit.next()); sb.append("\n"); } return sb.toString(); } } /* END OF FILE */ hyperestraier-1.4.13/javapure/Makefile.in000066400000000000000000000072131125261632700203600ustar00rootroot00000000000000# Makefile for the pure Java interface of Hyper Estraier #================================================================ # Setting Variables #================================================================ # Generic settings SHELL = @SHELL@ # Packaging PACKAGE = @PACKAGE_NAME@ VERSION = @PACKAGE_VERSION@ # Targets MYJARS = estraierpure.jar MYJAVAS = Document.java Condition.java ResultDocument.java NodeResult.java Node.java \ Utility.java Call.java # Install destinations prefix = @prefix@ exec_prefix = @exec_prefix@ MYLIBDIR = @libdir@ DESTDIR = # Building binaries MYJAVAHOME = @MYJAVAHOME@ JVMPLATFORM = @JVMPLATFORM@ JAVAC = @JAVAC@ JAVACFLAGS = -d . JAR = @JAR@ JAVAH = @JAVAH@ JAVADOC = @JAVADOC@ JAVARUN = @JAVARUN@ #================================================================ # Actions #================================================================ all : $(MYJARS) @printf '\n' @printf '#================================================================\n' @printf '# Ready to install.\n' @printf '#================================================================\n' clean : rm -rf estraier *.class $(MYJARS) *.jar *.o *.a *.so \ *.exe *.dll.a *.dll *.dylib *.jnilib *.sl a.out casket *~ install : mkdir -p $(DESTDIR)$(MYLIBDIR) cp -Rf $(MYJARS) $(DESTDIR)$(MYLIBDIR) @printf '\n' @printf '#================================================================\n' @printf '# Thanks for using Hyper Estraier for Java.\n' @printf '#================================================================\n' uninstall : cd $(DESTDIR)$(MYLIBDIR) && rm -f $(MYJARS) dist : autoconf make doc make distclean distclean : clean cd example && make clean rm -rf Makefile config.cache config.log config.status autom4te.cache check : $(JAVARUN) -cp estraierpure.jar estraier.pure.Call put -auth admin admin \ "http://localhost:1978/node/sample1" ../misc/test001.est $(JAVARUN) -cp estraierpure.jar estraier.pure.Call put -auth admin admin \ "http://localhost:1978/node/sample1" ../misc/test002.est $(JAVARUN) -cp estraierpure.jar estraier.pure.Call out -auth admin admin \ "http://localhost:1978/node/sample1" 1 $(JAVARUN) -cp estraierpure.jar estraier.pure.Call edit -auth admin admin \ "http://localhost:1978/node/sample1" 2 "@title" "Super Nova" $(JAVARUN) -cp estraierpure.jar estraier.pure.Call get \ "http://localhost:1978/node/sample1" 2 $(JAVARUN) -cp estraierpure.jar estraier.pure.Call etch \ "http://localhost:1978/node/sample1" 2 $(JAVARUN) -cp estraierpure.jar estraier.pure.Call inform \ "http://localhost:1978/node/sample1" $(JAVARUN) -cp estraierpure.jar estraier.pure.Call search \ "http://localhost:1978/node/sample1" "mikio" $(JAVARUN) -cp estraierpure.jar estraier.pure.Call search -attr "@uri" -ord "@title" \ "http://localhost:1978/node/sample1" "i" $(JAVARUN) -cp estraierpure.jar estraier.pure.Call setuser -auth admin admin \ "http://localhost:1978/node/sample1" mikio 1 $(JAVARUN) -cp estraierpure.jar estraier.pure.Call setlink -auth admin admin \ "http://localhost:1978/node/sample1" "http://localhost:1978/node/sample2" \ "Sample2" 10 doc : make docclean mkdir -p ../doc/javapureapi $(JAVADOC) -locale en -windowtitle estraier.pure -overview overview.html \ -tag note:a:"Note:" -d ../doc/javapureapi -nodeprecated -nohelp -quiet *.java docclean : rm -rf ../doc/javapureapi .PHONY : all clean install casket check #================================================================ # Building binaries #================================================================ estraierpure.jar : $(MYJAVAS) $(JAVAC) $(JAVACFLAGS) $(MYJAVAS) $(JAR) cvf $@ estraier/pure/*.class # END OF FILE hyperestraier-1.4.13/javapure/Node.java000066400000000000000000000774711125261632700200600ustar00rootroot00000000000000/************************************************************************************************* * Pure Java interface of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * All rights reserved. * This file is part of Hyper Estraier. * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of Mikio Hirabayashi nor the names of its contributors may be used to * endorse or promote products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. *************************************************************************************************/ package estraier.pure; import java.util.*; import java.io.*; import java.net.*; /** * Abstraction of connection to P2P node. */ public class Node { //---------------------------------------------------------------- // private static methods //---------------------------------------------------------------- /** * Serialize a condition object into a query string. * @param cond a condition object. * @param depth depth of meta search. * @param wwidth whole width of a snippet. * @param hwidth width of strings picked up from the beginning of the text. * @param awidth width of strings picked up around each highlighted word. * @return a serialized string of the condtion object. */ private static String cond_to_query(Condition cond, int depth, int wwidth, int hwidth, int awidth){ StringBuffer sb = new StringBuffer(); try { String phrase = cond.phrase(); sb.append("phrase="); if(phrase != null) sb.append(URLEncoder.encode(phrase, "UTF-8")); List attrs = cond.attrs(); Iterator it = cond.attrs().iterator(); for(int i = 1; it.hasNext(); i++){ sb.append("&attr"); sb.append(i); sb.append("="); sb.append(URLEncoder.encode((String)it.next(), "UTF-8")); } String order = cond.order(); if(order != null && order.length() > 0){ sb.append("&order="); sb.append(URLEncoder.encode(order, "UTF-8")); } int max = cond.max(); if(max >= 0){ sb.append("&max="); sb.append(max); } else { sb.append("&max="); sb.append(Integer.MAX_VALUE / 2); } int options = cond.options(); if(options > 0){ sb.append("&options="); sb.append(options); } int auxiliary = cond.auxiliary(); sb.append("&auxiliary="); sb.append(auxiliary); String distinct = cond.distinct(); if(distinct != null && distinct.length() > 0){ sb.append("&distinct="); sb.append(URLEncoder.encode(distinct, "UTF-8")); } if(depth > 0){ sb.append("&depth="); sb.append(depth); } sb.append("&wwidth="); sb.append(wwidth); sb.append("&hwidth="); sb.append(hwidth); sb.append("&awidth="); sb.append(awidth); sb.append("&skip="); sb.append(cond.skip()); sb.append("&mask="); sb.append(cond.mask()); } catch(UnsupportedEncodingException e){ throw new RuntimeException(e); } return sb.toString(); } //---------------------------------------------------------------- // private fields //---------------------------------------------------------------- private String url; private String pxhost; private int pxport; private int timeout; private String auth; private String name; private String label; private int dnum; private int wnum; private double size; private List admins; private List users; private List links; private int wwidth; private int hwidth; private int awidth; private int status; //---------------------------------------------------------------- // constructors //---------------------------------------------------------------- /** * Create a node connection object. */ public Node(){ url = null; pxhost = null; pxport = -1; timeout = -1; auth = null; name = null; label = null; dnum = -1; wnum = -1; size = -1.0; admins = null; users = null; links = null; wwidth = 480; hwidth = 96; awidth = 96; status = -1; } //---------------------------------------------------------------- // public methods //---------------------------------------------------------------- /** * Set the URL of a node server. * @param url the URL of a node server. */ public void set_url(String url){ this.url = url; } /** * Set the proxy information. * @param host the host name of a proxy server. * @param port the port number of the proxy server. */ public void set_proxy(String host, int port){ pxhost = host; pxport = port; } /** * Set timeout. * @param sec timeout in seconds. */ public void set_timeout(int sec){ timeout = sec; } /** * Set the authentication information. * @param name the name of authentication. * @param password the password of the authentication. */ public void set_auth(String name, String password){ auth = name + ":" + password; } /** * Get the status code of the last request. * @return the status code of the last request. -1 means failure of connection. */ public int status(){ return status; } /** * Synchronize updating contents of the database. * @return true if success, else it is false. */ public boolean sync(){ status = -1; if(url == null) return false; try { URL purl = new URL(url); URL eurl = new URL("http://" + purl.getHost() + ":" + purl.getPort() + purl.getPath() + "/sync"); List reqheads = new ArrayList(2); if(auth != null) reqheads.add("Authorization: Basic " + Utility.base_encode(auth.getBytes())); reqheads.add("Content-Type: application/x-www-form-urlencoded"); byte[] reqbody = new byte[0]; status = Utility.shuttle_url(eurl.toString(), pxhost, pxport, timeout, reqheads, reqbody, null, null); if(status != 200) return false; return true; } catch(Exception e){ return false; } } /** * Optimize the database. * @return true if success, else it is false. */ public boolean optimize(){ status = -1; if(url == null) return false; try { URL purl = new URL(url); URL eurl = new URL("http://" + purl.getHost() + ":" + purl.getPort() + purl.getPath() + "/optimize"); List reqheads = new ArrayList(2); if(auth != null) reqheads.add("Authorization: Basic " + Utility.base_encode(auth.getBytes())); reqheads.add("Content-Type: application/x-www-form-urlencoded"); byte[] reqbody = new byte[0]; status = Utility.shuttle_url(eurl.toString(), pxhost, pxport, timeout, reqheads, reqbody, null, null); if(status != 200) return false; return true; } catch(Exception e){ return false; } } /** * Add a document. * @param doc a document object to register. * @return true if success, else it is false. */ public boolean put_doc(Document doc){ status = -1; if(url == null) return false; try { URL purl = new URL(url); URL eurl = new URL("http://" + purl.getHost() + ":" + purl.getPort() + purl.getPath() + "/put_doc"); List reqheads = new ArrayList(2); if(auth != null) reqheads.add("Authorization: Basic " + Utility.base_encode(auth.getBytes())); reqheads.add("Content-Type: text/x-estraier-draft"); byte[] reqbody = doc.dump_draft().getBytes("UTF-8"); ByteArrayOutputStream resbody = new ByteArrayOutputStream(); status = Utility.shuttle_url(eurl.toString(), pxhost, pxport, timeout, reqheads, reqbody, null, resbody); if(status != 200) return false; return true; } catch(Exception e){ return false; } } /** * Remove a document. * @param id the ID number of a registered document. * @return true if success, else it is false. */ public boolean out_doc(int id){ status = -1; if(url == null) return false; try { URL purl = new URL(url); URL eurl = new URL("http://" + purl.getHost() + ":" + purl.getPort() + purl.getPath() + "/out_doc"); List reqheads = new ArrayList(2); if(auth != null) reqheads.add("Authorization: Basic " + Utility.base_encode(auth.getBytes())); reqheads.add("Content-Type: application/x-www-form-urlencoded"); byte[] reqbody = ("id=" + id).getBytes("ISO-8859-1"); status = Utility.shuttle_url(eurl.toString(), pxhost, pxport, timeout, reqheads, reqbody, null, null); if(status != 200) return false; return true; } catch(Exception e){ return false; } } /** * Remove a document specified by URI. * @param uri the URI of a registered document. * @return true if success, else it is false. */ public boolean out_doc_by_uri(String uri){ status = -1; if(url == null) return false; try { URL purl = new URL(url); URL eurl = new URL("http://" + purl.getHost() + ":" + purl.getPort() + purl.getPath() + "/out_doc"); List reqheads = new ArrayList(2); if(auth != null) reqheads.add("Authorization: Basic " + Utility.base_encode(auth.getBytes())); reqheads.add("Content-Type: application/x-www-form-urlencoded"); byte[] reqbody = ("uri=" + URLEncoder.encode(uri, "UTF-8")).getBytes("ISO-8859-1"); status = Utility.shuttle_url(eurl.toString(), pxhost, pxport, timeout, reqheads, reqbody, null, null); if(status != 200) return false; return true; } catch(Exception e){ return false; } } /** * Edit attributes of a document. * @param doc a document object. * @return true if success, else it is false. */ public boolean edit_doc(Document doc){ status = -1; if(url == null) return false; try { URL purl = new URL(url); URL eurl = new URL("http://" + purl.getHost() + ":" + purl.getPort() + purl.getPath() + "/edit_doc"); List reqheads = new ArrayList(2); if(auth != null) reqheads.add("Authorization: Basic " + Utility.base_encode(auth.getBytes())); reqheads.add("Content-Type: text/x-estraier-draft"); byte[] reqbody = doc.dump_draft().getBytes("UTF-8"); ByteArrayOutputStream resbody = new ByteArrayOutputStream(); status = Utility.shuttle_url(eurl.toString(), pxhost, pxport, timeout, reqheads, reqbody, null, resbody); if(status != 200) return false; return true; } catch(Exception e){ return false; } } /** * Retrieve a document. * @param id the ID number of a registered document. * @return a document object. On error, `null' is returned. */ public Document get_doc(int id){ status = -1; if(url == null) return null; try { URL purl = new URL(url); URL eurl = new URL("http://" + purl.getHost() + ":" + purl.getPort() + purl.getPath() + "/get_doc"); List reqheads = new ArrayList(2); if(auth != null) reqheads.add("Authorization: Basic " + Utility.base_encode(auth.getBytes())); reqheads.add("Content-Type: application/x-www-form-urlencoded"); byte[] reqbody = ("id=" + id).getBytes("ISO-8859-1"); ByteArrayOutputStream resbody = new ByteArrayOutputStream(); status = Utility.shuttle_url(eurl.toString(), pxhost, pxport, timeout, reqheads, reqbody, null, resbody); if(status != 200) return null; return new Document(resbody.toString("UTF-8")); } catch(Exception e){ return null; } } /** * Retrieve a document specified by URI. * @param uri the URI of a registered document. * @return a document object. On error, `null' is returned. */ public Document get_doc_by_uri(String uri){ status = -1; if(url == null) return null; try { URL purl = new URL(url); URL eurl = new URL("http://" + purl.getHost() + ":" + purl.getPort() + purl.getPath() + "/get_doc"); List reqheads = new ArrayList(2); if(auth != null) reqheads.add("Authorization: Basic " + Utility.base_encode(auth.getBytes())); reqheads.add("Content-Type: application/x-www-form-urlencoded"); byte[] reqbody = ("uri=" + URLEncoder.encode(uri, "UTF-8")).getBytes("ISO-8859-1"); ByteArrayOutputStream resbody = new ByteArrayOutputStream(); status = Utility.shuttle_url(eurl.toString(), pxhost, pxport, timeout, reqheads, reqbody, null, resbody); if(status != 200) return null; return new Document(resbody.toString("UTF-8")); } catch(Exception e){ return null; } } /** * Retrieve the value of an attribute of a document. * @param id the ID number of a registered document. * @param name the name of an attribute. * @return the value of the attribute or `null' if it does not exist. */ public String get_doc_attr(int id, String name){ status = -1; if(url == null) return null; try { URL purl = new URL(url); URL eurl = new URL("http://" + purl.getHost() + ":" + purl.getPort() + purl.getPath() + "/get_doc_attr"); List reqheads = new ArrayList(2); if(auth != null) reqheads.add("Authorization: Basic " + Utility.base_encode(auth.getBytes())); reqheads.add("Content-Type: application/x-www-form-urlencoded"); String qstr = "id=" + id + "&attr=" + URLEncoder.encode(name, "UTF-8"); byte[] reqbody = qstr.getBytes("ISO-8859-1"); ByteArrayOutputStream resbody = new ByteArrayOutputStream(); status = Utility.shuttle_url(eurl.toString(), pxhost, pxport, timeout, reqheads, reqbody, null, resbody); if(status != 200) return null; return resbody.toString("UTF-8").trim(); } catch(Exception e){ return null; } } /** * Retrieve the value of an attribute of a document specified by URI * @param uri the URI of a registered document. * @param name the name of an attribute. * @return the value of the attribute or `null' if it does not exist. */ public String get_doc_attr_by_uri(String uri, String name){ status = -1; if(url == null) return null; try { URL purl = new URL(url); URL eurl = new URL("http://" + purl.getHost() + ":" + purl.getPort() + purl.getPath() + "/get_doc_attr"); List reqheads = new ArrayList(2); if(auth != null) reqheads.add("Authorization: Basic " + Utility.base_encode(auth.getBytes())); reqheads.add("Content-Type: application/x-www-form-urlencoded"); String qstr = "uri=" + URLEncoder.encode(uri, "UTF-8") + "&attr=" + URLEncoder.encode(name, "UTF-8"); byte[] reqbody = qstr.getBytes("ISO-8859-1"); ByteArrayOutputStream resbody = new ByteArrayOutputStream(); status = Utility.shuttle_url(eurl.toString(), pxhost, pxport, timeout, reqheads, reqbody, null, resbody); if(status != 200) return null; return resbody.toString("UTF-8").trim(); } catch(Exception e){ return null; } } /** * Extract keywords of a document. * @param id the ID number of a registered document. * @return a map object of keywords and their scores in decimal string or `null' on error. */ public Map etch_doc(int id){ status = -1; if(url == null) return null; try { URL purl = new URL(url); URL eurl = new URL("http://" + purl.getHost() + ":" + purl.getPort() + purl.getPath() + "/etch_doc"); List reqheads = new ArrayList(2); if(auth != null) reqheads.add("Authorization: Basic " + Utility.base_encode(auth.getBytes())); reqheads.add("Content-Type: application/x-www-form-urlencoded"); String qstr = "id=" + id; byte[] reqbody = qstr.getBytes("ISO-8859-1"); ByteArrayOutputStream resbody = new ByteArrayOutputStream(); status = Utility.shuttle_url(eurl.toString(), pxhost, pxport, timeout, reqheads, reqbody, null, resbody); if(status != 200) return null; Map kwords = new HashMap(31); String[] lines = Utility.split_lines(resbody.toString("UTF-8")); for(int i = 0; i < lines.length; i++){ String[] pair = Utility.split_fields(lines[i]); if(pair.length < 2) continue; kwords.put(pair[0], pair[1]); } return kwords; } catch(Exception e){ return null; } } /** * Extract keywords of a document specified by URI. * @param uri the URI of a registered document. * @return a map object of keywords and their scores in decimal string or `null' on error. */ public Map etch_doc_by_uri(String uri){ status = -1; if(url == null) return null; try { URL purl = new URL(url); URL eurl = new URL("http://" + purl.getHost() + ":" + purl.getPort() + purl.getPath() + "/etch_doc"); List reqheads = new ArrayList(2); if(auth != null) reqheads.add("Authorization: Basic " + Utility.base_encode(auth.getBytes())); reqheads.add("Content-Type: application/x-www-form-urlencoded"); String qstr = "uri=" + URLEncoder.encode(uri, "UTF-8"); byte[] reqbody = qstr.getBytes("ISO-8859-1"); ByteArrayOutputStream resbody = new ByteArrayOutputStream(); status = Utility.shuttle_url(eurl.toString(), pxhost, pxport, timeout, reqheads, reqbody, null, resbody); if(status != 200) return null; Map kwords = new HashMap(31); String[] lines = Utility.split_lines(resbody.toString("UTF-8")); for(int i = 0; i < lines.length; i++){ String[] pair = Utility.split_fields(lines[i]); if(pair.length < 2) continue; kwords.put(pair[0], pair[1]); } return kwords; } catch(Exception e){ return null; } } /** * Get the ID of a document specified by URI. * @param uri the URI of a registered document. * @return the ID of the document. On error, -1 is returned. */ public int uri_to_id(String uri){ status = -1; if(url == null) return -1; try { URL purl = new URL(url); URL eurl = new URL("http://" + purl.getHost() + ":" + purl.getPort() + purl.getPath() + "/uri_to_id"); List reqheads = new ArrayList(2); if(auth != null) reqheads.add("Authorization: Basic " + Utility.base_encode(auth.getBytes())); reqheads.add("Content-Type: application/x-www-form-urlencoded"); byte[] reqbody = ("uri=" + URLEncoder.encode(uri, "UTF-8")).getBytes("ISO-8859-1"); ByteArrayOutputStream resbody = new ByteArrayOutputStream(); status = Utility.shuttle_url(eurl.toString(), pxhost, pxport, timeout, reqheads, reqbody, null, resbody); if(status != 200) return -1; return Integer.parseInt(resbody.toString("ISO-8859-1").trim()); } catch(Exception e){ return -1; } } /** * Get the name. * @return the name. On error, `null' is returned. */ public String name(){ if(name == null) set_info(); return name; } /** * Get the label. * @return the label. On error, `null' is returned. */ public String label(){ if(label == null) set_info(); return label; } /** * Get the number of documents. * @return the number of documents. On error, -1 is returned. */ public int doc_num(){ if(dnum < 0) set_info(); return dnum; } /** * Get the number of unique words. * @return the number of unique words. On error, -1 is returned. */ public int word_num(){ if(wnum < 0) set_info(); return wnum; } /** * Get the size of the datbase. * @return the size of the datbase. On error, -1.0 is returned. */ public double size(){ if(size < 0.0) set_info(); return size; } /** * Get the usage ratio of the cache. * @return the usage ratio of the cache. On error, -1.0 is returned. */ public double cache_usage(){ status = -1; if(url == null) return -1.0; try { URL purl = new URL(url); URL eurl = new URL("http://" + purl.getHost() + ":" + purl.getPort() + purl.getPath() + "/cacheusage"); List reqheads = new ArrayList(2); if(auth != null) reqheads.add("Authorization: Basic " + Utility.base_encode(auth.getBytes())); ByteArrayOutputStream resbody = new ByteArrayOutputStream(); status = Utility.shuttle_url(eurl.toString(), pxhost, pxport, timeout, reqheads, null, null, resbody); if(status != 200) return -1.0; return Double.parseDouble(resbody.toString("UTF-8").trim()); } catch(Exception e){ return -1.0; } } /** * Get a list of names of administrators. * @return a list object of names of administrators. On error, `null' is returned. */ public List admins(){ if(admins == null) set_info(); return admins; } /** * Get a list of names of users. * @return a list object of names of users. On error, `null' is returned. */ public List users(){ if(users == null) set_info(); return users; } /** * Get a list of expressions of links. * @return a list object of expressions of links. Each element is a TSV string and has three * fields of the URL, the label, and the score. On error, `null' is returned. */ public List links(){ if(links == null) set_info(); return links; } /** * Search for documents corresponding a condition. * @param cond a condition object. * @param depth the depth of meta search. * @return a node result object. On error, `null' is returned. */ public NodeResult search(Condition cond, int depth){ status = -1; if(url == null) return null; try { URL purl = new URL(url); URL eurl = new URL("http://" + purl.getHost() + ":" + purl.getPort() + purl.getPath() + "/search"); List reqheads = new ArrayList(2); if(auth != null) reqheads.add("Authorization: Basic " + Utility.base_encode(auth.getBytes())); reqheads.add("Content-Type: application/x-www-form-urlencoded"); byte[] reqbody = cond_to_query(cond, depth, wwidth, hwidth, awidth).getBytes("ISO-8859-1"); ByteArrayOutputStream resbody = new ByteArrayOutputStream(); status = Utility.shuttle_url(eurl.toString(), pxhost, pxport, timeout, reqheads, reqbody, null, resbody); if(status != 200) return null; String[] lines = Utility.split_lines(resbody.toString("UTF-8")); if(lines.length < 1) return null; List docs = new ArrayList(31); Map hints = new HashMap(31); NodeResult nres = new NodeResult(docs, hints); String border = lines[0]; boolean end = false; int lnum = 1; while(lnum < lines.length){ String line = lines[lnum++]; if(line.startsWith(border)){ if(line.substring(border.length(), line.length()).equals(":END")) end = true; break; } int lidx = line.indexOf('\t'); if(lidx != -1){ String key = line.substring(0, lidx); String value = line.substring(lidx + 1, line.length()); hints.put(key, value); } } int snum = lnum; while(!end && lnum < lines.length){ String line = lines[lnum++]; if(line.startsWith(border)){ if(lnum > snum){ Map rdattrs = new HashMap(31); StringBuffer sb = new StringBuffer(); String rdvector = ""; int rlnum = snum; while(rlnum < lnum - 1){ String rdline = lines[rlnum++].trim(); if(rdline.length() < 1) break; if(rdline.startsWith("%")){ int lidx = rdline.indexOf('\t'); if(rdline.startsWith("%VECTOR") && lidx != -1) rdvector = rdline.substring(lidx + 1, rdline.length()); } else { int lidx = rdline.indexOf('='); if(lidx != -1){ String key = rdline.substring(0, lidx); String value = rdline.substring(lidx + 1, rdline.length()); rdattrs.put(key, value); } } } while(rlnum < lnum - 1){ String rdline = lines[rlnum++]; sb.append(rdline); sb.append("\n"); } String rduri = (String)rdattrs.get("@uri"); String rdsnippet = sb.toString(); if(rduri != null){ ResultDocument rdoc = new ResultDocument(rduri, rdattrs, rdsnippet, rdvector); docs.add(rdoc); } } snum = lnum; if(line.substring(border.length(), line.length()).equals(":END")) end = true; } } if(!end) return null; return nres; } catch(Exception e){ return null; } } /** * Set width of snippet in the result. * @param wwidth whole width of a snippet. By default, it is 480. If it is 0, no snippet is * sent. If it is negative, whole body text is sent instead of snippet. * @param hwidth width of strings picked up from the beginning of the text. By default, it * is 96. If it is negative 0, the current setting is not changed. * @param awidth width of strings picked up around each highlighted word. By default, it is * 96. If it is negative, the current setting is not changed. */ public void set_snippet_width(int wwidth, int hwidth, int awidth){ this.wwidth = wwidth; if(hwidth >= 0) this.hwidth = hwidth; if(awidth >= 0) this.awidth = awidth; } /** * Manage a user account. * @param name the name of a user. * @param mode the operation mode. 0 means to delete the account. 1 means to set the * account as an administrator. 2 means to set the account as a guest. * @return true if success, else it is false. */ public boolean set_user(String name, int mode){ status = -1; if(url == null) return false; try { URL purl = new URL(url); URL eurl = new URL("http://" + purl.getHost() + ":" + purl.getPort() + purl.getPath() + "/_set_user"); List reqheads = new ArrayList(2); if(auth != null) reqheads.add("Authorization: Basic " + Utility.base_encode(auth.getBytes())); reqheads.add("Content-Type: application/x-www-form-urlencoded"); String qstr = "name=" + URLEncoder.encode(name, "UTF-8") + "&mode=" + mode; byte[] reqbody = qstr.getBytes("ISO-8859-1"); status = Utility.shuttle_url(eurl.toString(), pxhost, pxport, timeout, reqheads, reqbody, null, null); if(status != 200) return false; return true; } catch(Exception e){ return false; } } /** * Manage a link. * @param url the URL of the target node of a link. * @param label the label of the link. * @param credit the credit of the link. If it is negative, the link is removed. * @return true if success, else it is false. */ public boolean set_link(String url, String label, int credit){ status = -1; if(this.url == null) return false; try { URL purl = new URL(this.url); URL eurl = new URL("http://" + purl.getHost() + ":" + purl.getPort() + purl.getPath() + "/_set_link"); List reqheads = new ArrayList(2); if(auth != null) reqheads.add("Authorization: Basic " + Utility.base_encode(auth.getBytes())); reqheads.add("Content-Type: application/x-www-form-urlencoded"); String qstr = "url=" + URLEncoder.encode(url, "UTF-8") + "&label=" + URLEncoder.encode(label, "UTF-8"); if(credit >= 0) qstr = qstr + "&credit=" + credit; byte[] reqbody = qstr.getBytes("ISO-8859-1"); status = Utility.shuttle_url(eurl.toString(), pxhost, pxport, timeout, reqheads, reqbody, null, null); if(status != 200) return false; return true; } catch(Exception e){ return false; } } //---------------------------------------------------------------- // private methods //---------------------------------------------------------------- /** * Set information of the node. */ private void set_info(){ status = -1; if(url == null) return; try { URL purl = new URL(url); URL eurl = new URL("http://" + purl.getHost() + ":" + purl.getPort() + purl.getPath() + "/inform"); List reqheads = new ArrayList(2); if(auth != null) reqheads.add("Authorization: Basic " + Utility.base_encode(auth.getBytes())); ByteArrayOutputStream resbody = new ByteArrayOutputStream(); status = Utility.shuttle_url(eurl.toString(), pxhost, pxport, timeout, reqheads, null, null, resbody); if(status != 200) return; String resstr = resbody.toString("UTF-8"); String[] lines = Utility.split_lines(resstr); if(lines.length < 1) return; String[] fields = Utility.split_fields(lines[0]); if(fields.length != 5) return; name = fields[0]; label = fields[1]; dnum = Integer.parseInt(fields[2]); wnum = Integer.parseInt(fields[3]); size = Double.parseDouble(fields[4]); if(dnum < 0 || wnum < 0 || size < 0.0){ dnum = -1; wnum = -1; size = -1.0; } if(lines.length < 2) return; int lnum = 1; if(lnum < lines.length && lines[lnum].length() < 1) lnum++; admins = new ArrayList(); while(lnum < lines.length){ String line = lines[lnum]; if(line.length() < 1) break; admins.add(line); lnum++; } if(lnum < lines.length && lines[lnum].length() < 1) lnum++; users = new ArrayList(); while(lnum < lines.length){ String line = lines[lnum]; if(line.length() < 1) break; users.add(line); lnum++; } if(lnum < lines.length && lines[lnum].length() < 1) lnum++; links = new ArrayList(); while(lnum < lines.length){ String line = lines[lnum]; if(line.length() < 1) break; if(Utility.split_fields(line).length == 3) links.add(line); lnum++; } } catch(Exception e){ name = null; label = null; dnum = -1; wnum = -1; size = -1.0; admins = null; users = null; links = null; } } } /* END OF FILE */ hyperestraier-1.4.13/javapure/NodeResult.java000066400000000000000000000072371125261632700212500ustar00rootroot00000000000000/************************************************************************************************* * Pure Java interface of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * All rights reserved. * This file is part of Hyper Estraier. * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of Mikio Hirabayashi nor the names of its contributors may be used to * endorse or promote products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. *************************************************************************************************/ package estraier.pure; import java.util.*; import java.io.*; import java.net.*; /** * Abstraction of result set from node. */ public class NodeResult { //---------------------------------------------------------------- // private fields //---------------------------------------------------------------- private List docs; private Map hints; //---------------------------------------------------------------- // constructors //---------------------------------------------------------------- /** * Create a node result object. * @param docs a list object of result document objects. * @param hints a map object of hints. */ NodeResult(List docs, Map hints){ this.docs = docs; this.hints = hints; } //---------------------------------------------------------------- // public methods //---------------------------------------------------------------- /** * Get the number of documents. * @return the number of documents. */ public int doc_num(){ return docs.size(); } /** * Get a result document object * @param index the index of a document. * @return a result document object or `null' if the index is out of bounds. */ public ResultDocument get_doc(int index){ try { return (ResultDocument)docs.get(index); } catch(IndexOutOfBoundsException e){ return null; } } /** * Get the value of hint information. * @param key the key of a hint. "VERSION", "NODE", "HIT", "HINT#n", "DOCNUM", "WORDNUM", * "TIME", "TIME#n", "LINK#n", and "VIEW" are provided for keys. * @return the value of the hint or `null' if the key does not exist. */ public String hint(String key){ return (String)hints.get(key); } } /* END OF FILE */ hyperestraier-1.4.13/javapure/ResultDocument.java000066400000000000000000000105631125261632700221350ustar00rootroot00000000000000/************************************************************************************************* * Pure Java interface of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * All rights reserved. * This file is part of Hyper Estraier. * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of Mikio Hirabayashi nor the names of its contributors may be used to * endorse or promote products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. *************************************************************************************************/ package estraier.pure; import java.util.*; import java.io.*; import java.net.*; /** * Abstraction of document in result set. */ public class ResultDocument { //---------------------------------------------------------------- // private fields //---------------------------------------------------------------- private String uri; private Map attrs; private String snippet; private String keywords; //---------------------------------------------------------------- // constructors //---------------------------------------------------------------- /** * Create a result document object. * @param uri a string of the URI. * @param attrs a map object of attributes. * @param snippet a string of snippet. * @param keywords a string of keywords. */ ResultDocument(String uri, Map attrs, String snippet, String keywords){ this.uri = uri; this.attrs = attrs; this.snippet = snippet; this.keywords = keywords; } //---------------------------------------------------------------- // public methods //---------------------------------------------------------------- /** * Get the URI. * @return the URI. */ public String uri(){ return uri; } /** * Get a list of attribute names. * @return a list object of attribute names. */ public List attr_names(){ List names = new ArrayList(attrs.size()); Iterator it = attrs.keySet().iterator(); while(it.hasNext()){ names.add(it.next()); } Collections.sort(names); return names; } /** * Get the value of an attribute. * @param name the name of an attribute. * @return the value of the attribute or `null' if it does not exist. */ public String attr(String name){ return (String)attrs.get(name); } /** * Get the snippet. * @return a string of the snippet of the result document object. There are tab separated * values. Each line is a string to be shown. Though most lines have only one field, some * lines have two fields. If the second field exists, the first field is to be shown with * highlighted, and the second field means its normalized form. */ public String snippet(){ return snippet; } /** * Get keywords. * @return a string of serialized keywords of the result document object. There are tab * separated values. Keywords and their scores come alternately. */ public String keywords(){ return keywords; } } /* END OF FILE */ hyperestraier-1.4.13/javapure/Utility.java000066400000000000000000000255521125261632700206270ustar00rootroot00000000000000/************************************************************************************************* * Pure Java interface of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * All rights reserved. * This file is part of Hyper Estraier. * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of Mikio Hirabayashi nor the names of its contributors may be used to * endorse or promote products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. *************************************************************************************************/ package estraier.pure; import java.util.*; import java.util.zip.*; import java.io.*; import java.net.*; /** * Tool box of utility methods. */ class Utility { //---------------------------------------------------------------- // package static methods //---------------------------------------------------------------- static int shuttle_url(String url, String pxhost, int pxport, int outsec, List reqheads, byte[] reqbody, List resheads, OutputStream resbody){ int status = -1; ShuttleURLThread th = new ShuttleURLThread(url, pxhost, pxport, reqheads, reqbody, resheads, resbody); if(outsec >= 0){ try { th.start(); th.join(outsec < 1 ? 1 : outsec * 1000); if(th.is_end()){ th.join(); status = th.get_status(); } else { th.setDaemon(true); th.interrupt(); } } catch(InterruptedException e){ status = -1; } } else { th.run(); status = th.get_status(); } return status; } static String read_line(InputStream is) throws IOException { byte[] iobuf = new byte[8192]; int len = 0; int c; while(len < iobuf.length && (c = is.read()) >= 0){ if(c == '\n') break; if(c != '\r') iobuf[len++] = (byte)c; } return new String(iobuf, 0, len); } static byte[] read_all(InputStream is) throws IOException { byte[] iobuf = new byte[8192]; ByteArrayOutputStream baos = new ByteArrayOutputStream(); int len; while((len = is.read(iobuf)) >= 0){ baos.write(iobuf, 0, len); } return baos.toByteArray(); } static String[] split_lines(String str){ List list = new ArrayList(256); StringBuffer sb = new StringBuffer(); for(int i = 0; i < str.length(); i++){ char c = str.charAt(i); if(c == '\n'){ list.add(sb.toString()); sb = new StringBuffer(); } else if(c != '\r'){ sb.append(c); } } list.add(sb.toString()); String[] lines = new String[list.size()]; Iterator it = list.iterator(); for(int i = 0; it.hasNext(); i++){ lines[i] = (String)it.next(); } return lines; } static String[] split_fields(String str){ List list = new ArrayList(16); StringBuffer sb = new StringBuffer(); for(int i = 0; i < str.length(); i++){ char c = str.charAt(i); if(c == '\t'){ list.add(sb.toString()); sb = new StringBuffer(); } else { sb.append(c); } } list.add(sb.toString()); String[] lines = new String[list.size()]; Iterator it = list.iterator(); for(int i = 0; it.hasNext(); i++){ lines[i] = (String)it.next(); } return lines; } static String base_encode(byte[] data){ char[] tbl = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' }; StringBuffer sb = new StringBuffer(); for(int i = 0; i < data.length; i += 3){ switch(data.length - i){ case 1: sb.append(tbl[data[i] >> 2]); sb.append(tbl[(data[i] & 3) << 4]); sb.append('='); sb.append('='); break; case 2: sb.append(tbl[data[i] >> 2]); sb.append(tbl[((data[i] & 3) << 4) + (data[i+1] >> 4)]); sb.append(tbl[(data[i+1] & 0xf) << 2]); sb.append('='); break; default: sb.append(tbl[data[i] >> 2]); sb.append(tbl[((data[i] & 3) << 4) + (data[i+1] >> 4)]); sb.append(tbl[((data[i+1] & 0xf) << 2) + (data[i+2] >> 6)]); sb.append(tbl[data[i+2] & 0x3f]); break; } } return sb.toString(); } static byte[] deflate(byte[] buf){ try { ByteArrayOutputStream baos = new ByteArrayOutputStream(buf.length); DeflaterOutputStream dos = new DeflaterOutputStream(baos); dos.write(buf, 0, buf.length); dos.close(); return baos.toByteArray(); } catch(IOException e){ return null; } } static byte[] inflate(byte[] buf){ try { ByteArrayInputStream bais = new ByteArrayInputStream(buf); InflaterInputStream iis = new InflaterInputStream(bais); ByteArrayOutputStream baos = new ByteArrayOutputStream(buf.length * 4); byte[] ibuf = new byte[8192]; int len; while((len = iis.read(ibuf, 0, ibuf.length)) != -1){ baos.write(ibuf, 0, len); } iis.close(); return baos.toByteArray(); } catch(IOException e){ return null; } } /* dummy method: hide the constructor */ private Utility(){} //---------------------------------------------------------------- // private inner classes //---------------------------------------------------------------- private static class ShuttleURLThread extends Thread { private String url; private String pxhost; private int pxport; private List reqheads; private byte[] reqbody; private List resheads; private OutputStream resbody; private int status; private boolean end; ShuttleURLThread(String url, String pxhost, int pxport, List reqheads, byte[] reqbody, List resheads, OutputStream resbody){ this.url = url; this.pxhost = pxhost; this.pxport = pxport; this.reqheads = reqheads; this.reqbody = reqbody; this.resheads = resheads; this.resbody = resbody; this.status = -1; this.end = false; } int get_status(){ return status; } boolean is_end(){ return end; } public void run(){ try { URL purl = new URL(url); Socket sock = null; try { if(pxhost != null){ sock = new Socket(pxhost, pxport); } else { int port = purl.getPort(); if(port < 1) port = 80; sock = new Socket(purl.getHost(), port); } if(interrupted()) return; OutputStream os = sock.getOutputStream(); StringBuffer sb = new StringBuffer(); String method = "GET"; if(reqbody != null) method = "POST"; if(pxhost != null){ sb.append(method + " " + url + " HTTP/1.0\r\n"); } else { sb.append(method + " " + purl.getPath() + " HTTP/1.0\r\n"); } sb.append("Host: " + purl.getHost() + ":" + purl.getPort() + "\r\n"); sb.append("User-Agent: HyperEstraierForJava/1.0.0\r\n"); if(reqheads != null){ Iterator it = reqheads.iterator(); while(it.hasNext()){ String line = (String)it.next(); sb.append(line); sb.append("\r\n"); } } sb.append("Accept-Encoding: deflate\r\n"); if(reqbody != null) sb.append("Content-Length: " + reqbody.length + "\r\n"); sb.append("\r\n"); os.write(sb.toString().getBytes("ISO-8859-1")); if(reqbody != null) os.write(reqbody); os.flush(); if(interrupted()) return; InputStream is = sock.getInputStream(); String tline = read_line(is); int tidx = tline.indexOf(' '); if(tidx == -1) return; tline = tline.substring(tidx + 1, tline.length()); tidx = tline.indexOf(' '); if(tidx != -1) tline = tline.substring(0, tidx); status = Integer.parseInt(tline); if(resheads != null) resheads.add(tline); if(interrupted()) return; boolean defl = false; for(;;){ String line = read_line(is); if(line.length() < 1) break; if(resheads != null) resheads.add(line); String lower = line.toLowerCase(); if(lower.startsWith("content-encoding:") && lower.indexOf("deflate") != -1) defl = true; if(interrupted()) return; } if(defl && resbody != null){ ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] iobuf = new byte[8192]; int rsiz; while((rsiz = is.read(iobuf)) >= 0){ baos.write(iobuf, 0, rsiz); if(interrupted()) return; } byte[] rbuf = inflate(baos.toByteArray()); if(rbuf != null) resbody.write(rbuf, 0, rbuf.length); } else { byte[] iobuf = new byte[8192]; int rsiz; while((rsiz = is.read(iobuf)) >= 0){ if(resbody != null) resbody.write(iobuf, 0, rsiz); if(interrupted()) return; } } end = true; } finally { if(sock != null) sock.close(); } } catch(Exception e){ status = -1; } } } } /* END OF FILE */ hyperestraier-1.4.13/javapure/configure000077500000000000000000002062121125261632700202220ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for hyperestraier-javapure 1.0.0. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='hyperestraier-javapure' PACKAGE_TARNAME='hyperestraier-javapure' PACKAGE_VERSION='1.0.0' PACKAGE_STRING='hyperestraier-javapure 1.0.0' PACKAGE_BUGREPORT='' ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LIBVER LIBREV MYJAVAHOME JVMPLATFORM JAVAC JAR JAVAH JAVADOC JAVARUN LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures hyperestraier-javapure 1.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of hyperestraier-javapure 1.0.0:";; esac cat <<\_ACEOF _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF hyperestraier-javapure configure 1.0.0 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by hyperestraier-javapure $as_me 1.0.0, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Export variables LIBVER=1 LIBREV=0 MYJAVAHOME="/usr/java" JVMPLATFORM="linux" JAVAC="javac" JAR="jar" JAVAH="javah" JAVADOC="javadoc" JAVARUN="java" # Building paths pathtmp="$PATH" PATH="..:$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin" PATH="$PATH:/usr/ccs/bin:/usr/ucb:/usr/xpg4/bin:/usr/xpg6/bin:$pathtmp" LIBRARY_PATH="..:$HOME/lib:/usr/local/lib:$LIBRARY_PATH" LD_LIBRARY_PATH="..:$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH" CPATH="..:$HOME/include:/usr/local/include:$CPATH" PKG_CONFIG_PATH="..:$HOME/lib/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH if type pkg-config > /dev/null 2>&1 then PATH="$PATH:`pkg-config --variable=bindir qdbm`" PATH="$PATH:`pkg-config --variable=bindir hyperestraier`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir hyperestraier`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir hyperestraier`" CPATH="$CPATH:`pkg-config --variable=includedir qdbm`" CPATH="$CPATH:`pkg-config --variable=includedir hyperestraier`" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH fi #================================================================ # Checking Commands and Libraries #================================================================ # Home directory of Java printf 'checking MYJAVAHOME... ' if test -d "$JAVA_HOME" then MYJAVAHOME="$JAVA_HOME" fi printf '%s\n' "$MYJAVAHOME" # Platform of Java printf 'checking JVMPLATFORM... ' if uname | grep Darwin > /dev/null then JVMPLATFORM="mac" else for file in `\ls $MYJAVAHOME/include` do if test -d "$MYJAVAHOME/include/$file" then JVMPLATFORM="$file" fi done fi printf '%s\n' "$JVMPLATFORM" # Java compiler printf 'checking JAVAC... ' JAVAC="$MYJAVAHOME/bin/javac" if uname | grep Darwin > /dev/null then if test -x "$MYJAVAHOME/Commands/javac" then JAVAC="$MYJAVAHOME/Commands/javac" else JAVAC="$MYJAVAHOME/bin/javac" fi fi if test -x "$JAVAC" then printf '%s\n' "$JAVAC" else printf 'no\n' printf '#================================================================\n' 1>&2 printf '# WARNING: %s is not found.\n' "$JAVAC" 1>&2 printf '#================================================================\n' 1>&2 fi # Other building tools if uname | grep Darwin > /dev/null then if test -x "$MYJAVAHOME/Commands/java" then JAR="$MYJAVAHOME/Commands/jar" JAVAH="$MYJAVAHOME/Commands/javah" JAVADOC="$MYJAVAHOME/Commands/javadoc" JAVARUN="$MYJAVAHOME/Commands/java" else JAR="$MYJAVAHOME/bin/jar" JAVAH="$MYJAVAHOME/bin/javah" JAVADOC="$MYJAVAHOME/bin/javadoc" JAVARUN="$MYJAVAHOME/bin/java" fi else JAR="$MYJAVAHOME/bin/jar" JAVAH="$MYJAVAHOME/bin/javah" JAVADOC="$MYJAVAHOME/bin/javadoc" JAVARUN="$MYJAVAHOME/bin/java" fi #================================================================ # Generic Settings #================================================================ # Export variables # Targets ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by hyperestraier-javapure $as_me 1.0.0, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ hyperestraier-javapure config.status 1.0.0 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@LIBVER@,$LIBVER,;t t s,@LIBREV@,$LIBREV,;t t s,@MYJAVAHOME@,$MYJAVAHOME,;t t s,@JVMPLATFORM@,$JVMPLATFORM,;t t s,@JAVAC@,$JAVAC,;t t s,@JAR@,$JAR,;t t s,@JAVAH@,$JAVAH,;t t s,@JAVADOC@,$JAVADOC,;t t s,@JAVARUN@,$JAVARUN,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi # END OF FILE hyperestraier-1.4.13/javapure/configure.in000066400000000000000000000071171125261632700206270ustar00rootroot00000000000000# Source of configuration for the pure Java interface of Hyper Estraier #================================================================ # Generic Settings #================================================================ # Targets AC_INIT(hyperestraier-javapure, 1.0.0) # Export variables LIBVER=1 LIBREV=0 MYJAVAHOME="/usr/java" JVMPLATFORM="linux" JAVAC="javac" JAR="jar" JAVAH="javah" JAVADOC="javadoc" JAVARUN="java" # Building paths pathtmp="$PATH" PATH="..:$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin" PATH="$PATH:/usr/ccs/bin:/usr/ucb:/usr/xpg4/bin:/usr/xpg6/bin:$pathtmp" LIBRARY_PATH="..:$HOME/lib:/usr/local/lib:$LIBRARY_PATH" LD_LIBRARY_PATH="..:$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH" CPATH="..:$HOME/include:/usr/local/include:$CPATH" PKG_CONFIG_PATH="..:$HOME/lib/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH if type pkg-config > /dev/null 2>&1 then PATH="$PATH:`pkg-config --variable=bindir qdbm`" PATH="$PATH:`pkg-config --variable=bindir hyperestraier`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir hyperestraier`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir hyperestraier`" CPATH="$CPATH:`pkg-config --variable=includedir qdbm`" CPATH="$CPATH:`pkg-config --variable=includedir hyperestraier`" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH fi #================================================================ # Checking Commands and Libraries #================================================================ # Home directory of Java printf 'checking MYJAVAHOME... ' if test -d "$JAVA_HOME" then MYJAVAHOME="$JAVA_HOME" fi printf '%s\n' "$MYJAVAHOME" # Platform of Java printf 'checking JVMPLATFORM... ' if uname | grep Darwin > /dev/null then JVMPLATFORM="mac" else for file in `\ls $MYJAVAHOME/include` do if test -d "$MYJAVAHOME/include/$file" then JVMPLATFORM="$file" fi done fi printf '%s\n' "$JVMPLATFORM" # Java compiler printf 'checking JAVAC... ' JAVAC="$MYJAVAHOME/bin/javac" if uname | grep Darwin > /dev/null then if test -x "$MYJAVAHOME/Commands/javac" then JAVAC="$MYJAVAHOME/Commands/javac" else JAVAC="$MYJAVAHOME/bin/javac" fi fi if test -x "$JAVAC" then printf '%s\n' "$JAVAC" else printf 'no\n' printf '#================================================================\n' 1>&2 printf '# WARNING: %s is not found.\n' "$JAVAC" 1>&2 printf '#================================================================\n' 1>&2 fi # Other building tools if uname | grep Darwin > /dev/null then if test -x "$MYJAVAHOME/Commands/java" then JAR="$MYJAVAHOME/Commands/jar" JAVAH="$MYJAVAHOME/Commands/javah" JAVADOC="$MYJAVAHOME/Commands/javadoc" JAVARUN="$MYJAVAHOME/Commands/java" else JAR="$MYJAVAHOME/bin/jar" JAVAH="$MYJAVAHOME/bin/javah" JAVADOC="$MYJAVAHOME/bin/javadoc" JAVARUN="$MYJAVAHOME/bin/java" fi else JAR="$MYJAVAHOME/bin/jar" JAVAH="$MYJAVAHOME/bin/javah" JAVADOC="$MYJAVAHOME/bin/javadoc" JAVARUN="$MYJAVAHOME/bin/java" fi #================================================================ # Generic Settings #================================================================ # Export variables AC_SUBST(LIBVER) AC_SUBST(LIBREV) AC_SUBST(MYJAVAHOME) AC_SUBST(JVMPLATFORM) AC_SUBST(JAVAC) AC_SUBST(JAR) AC_SUBST(JAVAH) AC_SUBST(JAVADOC) AC_SUBST(JAVARUN) # Targets AC_OUTPUT(Makefile) # END OF FILE hyperestraier-1.4.13/javapure/example/000077500000000000000000000000001125261632700177435ustar00rootroot00000000000000hyperestraier-1.4.13/javapure/example/Example001.java000066400000000000000000000014511125261632700224230ustar00rootroot00000000000000import estraier.pure.*; public class Example001 { public static void main(String[] args){ // create and configure the node connecton object Node node = new Node(); node.set_url("http://localhost:1978/node/test1"); node.set_auth("admin", "admin"); // create a document object Document doc = new Document(); // add attributes to the document object doc.add_attr("@uri", "http://estraier.gov/example.txt"); doc.add_attr("@title", "Over the Rainbow"); // add the body text to the document object doc.add_text("Somewhere over the rainbow. Way up high."); doc.add_text("There's a land that I heard of once in a lullaby."); // register the document object to the node if(!node.put_doc(doc)) System.err.println("error: " + node.status()); } } hyperestraier-1.4.13/javapure/example/Example002.java000066400000000000000000000017331125261632700224270ustar00rootroot00000000000000import estraier.pure.*; public class Example002 { public static void main(String[] args){ // create the node connecton object Node node = new Node(); node.set_url("http://localhost:1978/node/test1"); // create a search condition object Condition cond = new Condition(); // set the search phrase to the search condition object cond.set_phrase("rainbow AND lullaby"); // get the result of search NodeResult nres = node.search(cond, 0); if(nres != null){ // for each document in the result for(int i = 0; i < nres.doc_num(); i++){ // get a result document object ResultDocument rdoc = nres.get_doc(i); // display attributes System.out.println("URI: " + rdoc.attr("@uri")); System.out.println("Title: " + rdoc.attr("@title")); // display the snippet text System.out.print(rdoc.snippet()); } } else { System.err.println("error: " + node.status()); } } } hyperestraier-1.4.13/javapure/example/Makefile000066400000000000000000000017751125261632700214150ustar00rootroot00000000000000# Makefile for sample programs of the Java interface #================================================================ # Setting Variables #================================================================ # Generic settings SHELL = /bin/sh # Targets MYCLASSES = Example001.class Example002.class # Building binaries JAVAC = javac JAVACFLAGS = -d . JAVACENV = CLASSPATH=.:../estraierpure.jar #================================================================ # Actions #================================================================ all : $(MYCLASSES) clean : rm -rf $(MYCLASSES) *.exe *.o a.out check.out gmon.out leak.log casket *~ .PHONY : all clean #================================================================ # Building binaries #================================================================ Example001.class : Example001.java $(JAVACENV) $(JAVAC) $(JAVACFLAGS) Example001.java Example002.class : Example002.java $(JAVACENV) $(JAVAC) $(JAVACFLAGS) Example002.java # END OF FILE hyperestraier-1.4.13/javapure/overview.html000066400000000000000000000130441125261632700210460ustar00rootroot00000000000000 Pure Java Interface of Hyper Estraier

    Pure Java Interface of Hyper Estraier.

    Hyper Estraier is a full-text search system for communities.

    Introduction

    This is a package implementing the node API of Hyper Estraier. This is a pure java package though it has not uncertified yet. So, it works on Linux, Mac OS X, Windows, and so on. It does not depend on the core library of Hyper Estraier. Applications are implemented as clients of node servers running on local or remote machines. This package requires JRE 1.4.2 or later versions.

    Though Hyper Estraier itself is released under the terms of the GNU LGPL, this package is released under the terms of a BSD-style license.

    Setting

    Get the package of the latest version of Hyper Estraier.

    Enter the sub directory `javapure' in the extracted package then perform installation.

    cd javapure
    ./configure
    make
    su
    make install
    

    `estraier.pure.*' should be imported in each source file of application programs.

    Example of Gatherer

    The following is the simplest implementation of a gatherer.

    import estraier.pure.*;
    
    public class Example001 {
      public static void main(String[] args){
    
        // create and configure the node connecton object
        Node node = new Node();
        node.set_url("http://localhost:1978/node/test1");
        node.set_auth("admin", "admin");
    
        // create a document object
        Document doc = new Document();
    
        // add attributes to the document object
        doc.add_attr("@uri", "http://estraier.gov/example.txt");
        doc.add_attr("@title", "Over the Rainbow");
    
        // add the body text to the document object
        doc.add_text("Somewhere over the rainbow.  Way up high.");
        doc.add_text("There's a land that I heard of once in a lullaby.");
    
        // register the document object to the node
        if(!node.put_doc(doc))
          System.err.println("error: " + node.status());
    
      }
    }
    

    Example of Searcher

    The following is the simplest implementation of a searcher.

    import estraier.pure.*;
    
    public class Example002 {
      public static void main(String[] args){
    
        // create the node connecton object
        Node node = new Node();
        node.set_url("http://localhost:1978/node/test1");
    
        // create a search condition object
        Condition cond = new Condition();
    
        // set the search phrase to the search condition object
        cond.set_phrase("rainbow AND lullaby");
    
        // get the result of search
        NodeResult nres = node.search(cond, 0);
        if(nres != null){
          // for each document in the result
          for(int i = 0; i < nres.doc_num(); i++){
            // get a result document object
            ResultDocument rdoc = nres.get_doc(i);
            // display attributes
            System.out.println("URI: " + rdoc.attr("@uri"));
            System.out.println("Title: " + rdoc.attr("@title"));
            // display the snippet text
            System.out.print(rdoc.snippet());
          }
        } else {
          System.err.println("error: " + node.status());
        }
    
      }
    }
    

    License

    Copyright (C) 2004-2006 Mikio Hirabayashi
    All rights reserved.

    Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
    • Neither the name of Mikio Hirabayashi nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

    hyperestraier-1.4.13/lab/000077500000000000000000000000001125261632700152315ustar00rootroot00000000000000hyperestraier-1.4.13/lab/diffcheck000077500000000000000000000020451125261632700170660ustar00rootroot00000000000000#! /bin/sh #================================================================ # diffcheck # List files different from ones of another version. #================================================================ # set variables LANG=C ; export LANG LC_ALL=C ; export LC_ALL PATH="$PATH:/usr/local/bin:.:.." ; export PATH LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib:.:..:../.." ; export LD_LIBRARY_PATH progname="diffcheck" progexts='\.in|\.h|\.c|\.cc|\.cpp|\.cxx|\.java|\.pl|\.pm|\.pod|\.rb|\.rd' docexts='\.[1-9]|spex\.html|\spex-ja\.html|\.txt' regex="($progexts|$docexts)\$" # check arguments if [ $# != 1 ] then printf '%s: usage: %s directory_of_oldversion\n' "$progname" "$progname" 1>&2 exit 1 fi # diff files find . -type f | egrep $regex | while read file do old=`printf '%s\n' "$file" | sed 's/^\.\///'` printf 'Checking %s and %s ... ' "$file" "$1/$old" res=`diff -q "$file" "$1/$old"` if [ -z "$res" ] then printf 'same\n' else printf '### !!! DIFFERENT !!! ###\n' fi done # exit normally exit 0 # END OF FILE hyperestraier-1.4.13/lab/edswap000077500000000000000000000010351125261632700164410ustar00rootroot00000000000000#! /bin/sh #================================================================ # edswap # Swap strings with ed command #================================================================ # check arguments if [ $# -lt 3 ] then printf 'edswap: usage: edswap regex string files...\n' 1>&2 exit 1 fi # make expressions bef=`printf "$1" | sed 's/\//\\\\\//g'` ; shift aft=$1 ; shift # edit files while [ -n "$1" ] do printf "== $1 ==\n" printf "1,\$ s/$bef/$aft/g\nw\n" | ed "$1" shift done # exit normally exit 0 # END OF FILE hyperestraier-1.4.13/lab/estdiet000077500000000000000000000023041125261632700166170ustar00rootroot00000000000000#! /bin/sh #================================================================ # estdiet # Reduce the size of an index directory #================================================================ # set variables LANG=C ; export LANG LC_ALL=C ; export LC_ALL PATH="$PATH:/usr/local/bin:.:.." ; export PATH LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib:.:..:../.." ; export LD_LIBRARY_PATH progname="estdiet" # check arguments if [ $# != 1 ] then printf '%s: usage: %s index\n' "$progname" "$progname" 1>&2 exit 1 fi # check the directory if ! [ -d "$1" ] then printf '%s: %s could not open\n' "$progname" "$1" 1>&2 exit 1 fi # squeeze the database [ -e "$1/_meta" ] && dpmgr optimize -na "$1/_meta" if [ -e "$1/_idx" ] then ls "$1/_idx" | while read file do dpmgr optimize -na "$1/_idx/$file" done fi [ -e "$1/_fwm" ] && dpmgr optimize -na "$1/_fwm" [ -e "$1/_aux" ] && dpmgr optimize -na "$1/_aux" [ -e "$1/_xfm" ] && dpmgr optimize -na "$1/_xfm" [ -e "$1/_attr" ] && crmgr optimize -na "$1/_attr" [ -e "$1/_text" ] && crmgr optimize -na "$1/_text" [ -e "$1/_kwd" ] && crmgr optimize -na "$1/_kwd" [ -e "$1/_list" ] && dpmgr optimize -na "$1/_list" # exit normally exit 0 # END OF FILE hyperestraier-1.4.13/lab/estmgtest000077500000000000000000000022721125261632700172010ustar00rootroot00000000000000#! /bin/sh #================================================================ # estmgtest # Test index merger function #================================================================ # set variables LANG=C ; export LANG LC_ALL=C ; export LC_ALL PATH="$PATH:/usr/local/bin:.:.." ; export PATH LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib:.:..:../.." ; export LD_LIBRARY_PATH progname="estmgtest" tmpfile="/tmp/$progname.$$" # check arguments if [ $# != 2 ] then printf '%s: usage: %s db dir\n' "$progname" "$progname" 1>&2 exit 1 fi db="$1" dir="$2" # function to remove temporary files cleanup(){ rm -f $tmpfile* rm -rf $db-* } trap 1 2 3 4 6 11 13 15 # register documents find "$dir" -type f -print | egrep -i '\.(est|html|htm)$' > $tmpfile split -l 1000 -a 3 $tmpfile $tmpfile- i=1 ls -d $tmpfile-* | while read file do name=`printf "%s-%03d" "$db" "$i"` estcmd gather -il ja -sd -cs 5 -kn 32 -um "$name" "$file" i=`expr $i + 1` done estcmd create -tr -xl -attr '@uri' seq -attr '@title' str \ -attr '@author' str -attr '@mdate' num -attr '@size' num "$db" ls -d $db-* | while read file do estcmd merge -cl "$db" "$file" done # exit normally cleanup exit 0 # END OF FILE hyperestraier-1.4.13/lab/estndgather000077500000000000000000000015121125261632700174660ustar00rootroot00000000000000#! /bin/sh #================================================================ # estndgather # Register documents into a node #================================================================ # set variables LANG=C ; export LANG LC_ALL=C ; export LC_ALL PATH="$PATH:/usr/local/bin:.:.." ; export PATH LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib:.:..:../.." ; export LD_LIBRARY_PATH progname="estndgather" user="admin" pass="admin" # check arguments if [ $# != 2 ] then printf '%s: usage: %s node dir\n' "$progname" "$progname" 1>&2 exit 1 fi node="$1" dir="$2" # register documents find "$dir" -type f -name '*.html' -print | while read file do printf '%s: registering %s\n' "$progname" "$file" estcmd draft -fh -il ja -bc "$file" | estcall put -auth "$user" "$pass" "$node" done # exit normally exit 0 # END OF FILE hyperestraier-1.4.13/lab/gencert000077500000000000000000000015301125261632700166050ustar00rootroot00000000000000#! /bin/sh #================================================================ # gencert # Generate a self signed certificate #================================================================ # set variables LANG=C ; export LANG LC_ALL=C ; export LC_ALL PATH="$PATH:/usr/local/bin:.:.." ; export PATH LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib:.:..:../.." ; export LD_LIBRARY_PATH name="selfish" # generate the private key openssl genrsa -out "$name.key" 1024 # generate the certificate signing request openssl req -new -days 1456 -key "$name.key" -out "$name.csr" <<__EOF JP Kanagawa Yokohama Hyper Estraier Development localhost.localdomain mikio@users.sourceforge.net __EOF # generate the self signed certificate openssl x509 -in "$name.csr" -out "$name.crt" -req -signkey "$name.key" -days 1456 # exit normally exit 0 # END OF FILE hyperestraier-1.4.13/lab/mktmpdirs000077500000000000000000000016151125261632700171740ustar00rootroot00000000000000#! /bin/sh #================================================================ # mktmpdirs # Make temporary directories #================================================================ # set variables LANG=C ; export LANG LC_ALL=C ; export LC_ALL PATH="$PATH:/usr/local/bin:.:.." ; export PATH LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib:.:..:../.." ; export LD_LIBRARY_PATH # parse options base="." rm=0 if [ "$1" = "-rm" ] then rm="1" shift fi if [ -n "$1" ] then base="$1" fi if [ ! -d "$base" ] then printf "%s is not a directory\n" "$base" 1>&2 exit 1 fi # process each file names i=0 while [ $i -lt 256 ] do path=`printf "%s/%02x" "$base" "$i"` if [ "$rm" = "1" ] then printf "deleting %s\n" "$path" rm -rf "$path" else printf "making %s\n" "$path" mkdir -p "$path" chmod 777 "$path" fi i=`expr $i + 1` done # exit normally exit 0 # END OF FILE hyperestraier-1.4.13/lab/objtoc000077500000000000000000000010771125261632700164440ustar00rootroot00000000000000#! /bin/sh #================================================================ # objtoc # dump binary data as C source code #================================================================ # set variables LANG=C ; export LANG LC_ALL=C ; export LC_ALL PATH="$PATH:/usr/local/bin:.:.." ; export PATH LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib:.:..:../.." ; export LD_LIBRARY_PATH # dump data cat | od -A n -v -t x1 | sed -e '1 i\ const unsigned char myobj[] = { s/\([0-9a-f][0-9a-f]\) */0x\1,/g $ s/,$// $ a\ }; /^ / s/^/ / ' # exit normally exit 0 # END OF FILE hyperestraier-1.4.13/lab/relwords.cgi000077500000000000000000000072441125261632700175700ustar00rootroot00000000000000#! /usr/bin/ruby #================================================================ # relwords.cgi # CGI script to dump related words #================================================================ # library requirement require "cgi" require "villa" # constants DBNAME = "relwords.qdb" # get parameters scriptname = ENV["SCRIPT_NAME"] scriptname = $0 unless scriptname scriptname = scriptname.gsub(/.*\//, "") cgi = CGI::new word = cgi["word"] word.downcase! word.strip! # show HTTP headers printf("Content-Type: text/html; charset=UTF-8\r\n\r\n") # show page header printf("%s", <<__EOF Related Word Extractor
    __EOF ); # show input form escword = CGI::escapeHTML(word) printf("%s", <<__EOF
    Word:

    __EOF ); # show result if word.length > 0 sum = 0 allkwd = {} begin db = Villa::new(DBNAME) terms = word.split(/[ \t]/) terms.each do |term| next if term.length < 1 begin line = db.get(term) rescue line = "0" end fields = line.split(/\t/) num = fields.shift.to_i sum = sum + num diam = 32 / ((num + 8) ** 0.6) for i in 0...fields.length next if i % 2 > 0 key = fields[i] val = fields[i+1].to_i * diam cur = allkwd[key] allkwd[key] = cur ? cur + val : val end end rescue ensure db.close if db end if sum > 0 && allkwd.size > 0 escword = CGI::escapeHTML(word) printf("

    Related words of \"%s\"" + \ " (%d).

    \n", escword, sum) scores = [] allkwd.each do |key, val| scores.push([key, val]) end scores.sort! do |a, b| b[1] - a[1] end printf("
      \n") i = 0 scores.each do |elem| key = elem[0] val = elem[1] printf("
    • %s" + \ " (%d)
    • \n", scriptname, CGI::escape(key), i / 2 + 1, CGI::escapeHTML(key), i / 2 + 1, val) i += 1 break if i >= 32 end printf("
    \n") else printf("

    There is no related word for \"%s\".

    \n", escword) printf("

    \"%s\" could not be opened.

    ", DBNAME) unless db end else printf("

    Input a source word of relation.

    \n") end printf("
    \n"); # show page footer printf("%s", <<__EOF __EOF ) # exit normally exit(0) # END OF FILE hyperestraier-1.4.13/lab/searchlist000077500000000000000000000062141125261632700173230ustar00rootroot00000000000000#! /bin/sh #================================================================ # searchlist # Search documents with a list #================================================================ # set variables LANG=C ; export LANG LC_ALL=C ; export LC_ALL PATH="$PATH:/usr/local/bin:.:.." ; export PATH LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib:.:..:../.." ; export LD_LIBRARY_PATH casket="casket" # set the casket if [ "$#" -ge 1 ] then casket="$1" fi # function to generate words wordlist(){ cat <<__EOF mikio unix gnu Estraier Hyper Estraier This is the simplest sample document draft. This This is This is the simplest document document draft draft. . My name is Mikio Hirabayashi 縺薙l縺ッ譛繧ょ腰邏斐↑譁譖ク繝峨Λ繝輔ヨ縺ァ縺吶 縺 縺薙l 縺薙l縺ッ 縺薙l縺ッ譛繧ょ腰邏 譁譖ク繝峨Λ繝輔ヨ 繝峨Λ繝輔ヨ 縺ァ縺吶 縲 縲 譯螟ェ驛 譯 縺昴%縺ォ 縺励°繧 讀懃エ「 讀懃エ「縺碁ォ倬 繝舌げ 譚・繧 譌・譛ャ 繝輔ぃ繧、繝ォ 繧、繝ウ繧ケ繝医シ繝ォ 驥守帥 AND 繧オ繝繧ォ繝シ Hyper AND Estraier 縺薙l AND 莠ャ驛ス 縺 AND 縺ァ縺 譛ャ譁 OR 繝繧ュ繧ケ繝 AND 繧 縺励°縺 AND 縺励°繧 OR 縺ァ繧 ANDNOT 縺縺 縺 OR 縺 OR 縺 OR 繧「 OR 繧、 OR 繧ヲ OR 陦 縲 ANDNOT 讀懃エ「 繧 OR 縺ォ OR 縺 OR 縺ク OR 繧 OR 縺ョ OR 縺九i OR 縺ァ OR 繧医j AND 繧ス繝輔ヨ繧ヲ繧ァ繧「 縺薙l縺ォ縺ヲ AND 荳莉カ AND 關ス逹 AND 螟ァ蟯。 AND 雜雁燕 OR 蠢逶ク 鬩壹″ AND 譯縺ョ譛ィ AND 螻ア讀偵ョ譛ィ 逡上l AND 蜈・隹キ AND 縺ョ AND 鬯シ蟄先ッ咲・ 縺ィ繧薙□ AND 縺ィ縺薙m AND 縺ォ AND 蛹玲搗螟ァ閹ウ a AND A a OR A a NOT A abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 \!\"#$%&'()~=~|\`\{+\*\}\<\>?_ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!"#$%&'()~=~|\`\{+\*\}\<\>?_ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\!\"#$%&'()~=~|\`\{+\*\}\<\>?_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\!\"#$%&'()~=~|\`\{+\*\}\<\>?_ [UVSET] AND 譁譖ク [UVSET] ANDNOT a OR the OR is [UVSET] ANDNOT 繧 OR 縺ォ OR 縺 OR 縺ク OR 繧 OR 縺ョ OR 縺九i OR 縺ァ OR 繧医j [SIMILAR] WITH 100000 髢狗匱 WITH 90000 蟷ウ譫 WITH 80000 蟷ケ髮 WITH 70000 estraier WITH 60000 hyper WITH 50000 qdbm WITH 40000 unix WITH 30000 蜈ィ譁讀懃エ「 WITH 20000 讀懃エ「 WITH 10000 繧キ繧ケ繝繝 WITH 9000 繝薙Ν繝 WITH 8000 繝輔ぃ繧、繝ォ WITH 7000 繧、繝ウ繧ケ繝医シ繝ォ WITH 6000 蛻謨」 WITH 5000 p2p WITH 4000 縺吶k WITH 3000 繧九 WITH 2000 縲 WITH 1000 雜霑キ蟄 WITH 90 繝舌き [SIMILAR] WITH 300 繧ー繝シ WITH 200 繝√Ι繧ュ WITH 100 繝代シ [SIMILAR] WITH 900 縺倥c縺倥c荳ク WITH 800 繝斐ャ繧ウ繝ュ WITH 700 繝昴Ο繝ェ [SIMILAR] WITH 3 繝峨Ο繝ウ繧ク繝ァ WITH 2 繝懊Ζ繝繧ュ繝シ WITH 1 繝医Φ繧コ繝ゥ繝シ [SIMILAR] WITH 300 逕キ WITH 200 螂ウ [SIMILAR] WITH 1 蜉辭ア WITH 1 蜀キ蜊エ [SIMILAR] WITH 100 Hyper Estraier WITH 100 Quick Database Manager [SIMILAR] WITH 10000000 縺ヲ繧√∴繧峨ョ陦縺ッ菴戊牡縺 WITH 100000 縺雁燕縺ッ繧ゅ≧豁サ繧薙〒縺繧 WITH 10000 謌代′逕滓カッ縺ォ荳迚縺ョ謔斐>辟。縺 WITH 1000 蟶晉視縺ッ蠑輔°縺ャ蟐壹ウ縺ャ逵√∩縺ャ WITH 300 蛹玲沫 WITH 200 蜊玲沫 WITH 100 蜈譁 [ID] 1 [URI] data001 __EOF } # perform test wordlist | while read word do printf '====[ %s ]====\n' "$word" estcmd search -gs -max 8 -vu "$casket" "$word" | egrep -v '^(TIME|----)' printf '\n\n' done # exit normally exit 0 # END OF FILE hyperestraier-1.4.13/lab/showload.cgi000077500000000000000000000012341125261632700175400ustar00rootroot00000000000000#! /bin/sh #================================================================ # relwords.cgi # CGI script to show load average #================================================================ # set variables LANG=C ; export LANG LC_ALL=C ; export LC_ALL PATH="$PATH:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:.:.." ; export PATH LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib:.:..:../.." ; export LD_LIBRARY_PATH progname="sizecheck" # show header printf 'Content-Type: text/plain\r\n' printf '\r\n' # show result uptime | grep 'load average' | sed -e 's/.*load average: *//' -e 's/^ *[0-9.]*, *//' -e 's/, .*//' # exit normally exit 0 # END OF FILE hyperestraier-1.4.13/lab/sizecheck000077500000000000000000000015761125261632700171400ustar00rootroot00000000000000#! /bin/sh #================================================================ # diffcheck # List files different from ones of another version. #================================================================ # set variables LANG=C ; export LANG LC_ALL=C ; export LC_ALL PATH="$PATH:/usr/local/bin:.:.." ; export PATH LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib:.:..:../.." ; export LD_LIBRARY_PATH progname="sizecheck" progexts='\.in|\.h|\.c|\.cc|\.cpp|\.cxx|\.java|\.pl|\.pm|\.pod|\.rb|\.rd' docexts='\.[1-9]|spex\.html|\spex-ja\.html|\.txt' regex="($progexts|$docexts)\$" # check arguments if [ $# != 1 ] || [ ! -d "$1" ] then printf '%s: usage: %s directory\n' "$progname" "$progname" 1>&2 exit 1 fi # output size sum=0 find "$1" -type f -printf '%s\n' | while read num do sum=$((sum + num)) printf '%d\t%d\n' "$num" "$sum" done # exit normally exit 0 # END OF FILE hyperestraier-1.4.13/lab/stepcount000077500000000000000000000010241125261632700172000ustar00rootroot00000000000000#! /bin/sh #================================================================ # stepcount # Find files including dispensable tab characters #================================================================ # set variables PATH="$PATH:/usr/local/bin:.:.." ; export PATH LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib:.:..:../.." ; export LD_LIBRARY_PATH regex='(\.h|\.c|\.cc|\.java|\.pl|\.pm|\.xs|\.rb|\.js)$' # count steps files=`find . -type f | egrep $regex` wc -l $files | sort -n # exit normally exit 0 # END OF FILE hyperestraier-1.4.13/lab/tabcheck000077500000000000000000000016121125261632700167230ustar00rootroot00000000000000#! /bin/sh #================================================================ # tabcheck # Find files including dispensable tab and space characters #================================================================ # set variables LANG=C ; export LANG LC_ALL=C ; export LC_ALL PATH="$PATH:/usr/local/bin:.:.." ; export PATH LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib:.:..:../.." ; export LD_LIBRARY_PATH regex='(\.h|\.c|\.cc|\.cpp|\.cxx|\.java|\.pl|\.pm|\.pod|\.rb|\.rd)$' tabcode=`printf '\t'` # find tab find . -type f | egrep $regex | while read file do printf 'Checking %s ... ' $file err=0 if grep "$tabcode" $file > /dev/null then printf '### !!! TAB FOUND !!! ###' err=1 fi if grep ' $' $file > /dev/null then printf '### !!! TAILING SPACE FOUND !!! ###' err=1 fi [ "$err" = 0 ] && printf 'ok' printf '\n' done # exit normally exit 0 # END OF FILE hyperestraier-1.4.13/lab/urlencode000077500000000000000000000005451125261632700171430ustar00rootroot00000000000000#! /usr/bin/ruby #================================================================ # urlencode # encode each line as URL #================================================================ # library requirement require "uri" # process each line while(line = gets) chomp printf("%s\n", URI.encode(line)) end # exit normally exit(0) # END OF FILE hyperestraier-1.4.13/lab/wpxmltoest000077500000000000000000000075721125261632700174200ustar00rootroot00000000000000#! /usr/bin/ruby #================================================================ # wpxmltoest # dump draft data from an XML archive of Wikipedia #================================================================ # library requirement require "stringio" require "uri" require "rexml/document" require "rexml/streamlistener" include REXML # listener for the parser class MyListener include StreamListener BASEURL = "http://ja.wikipedia.org/wiki/" TEXTMINSIZE = 256 def initialize @seq = 0 @buf = nil end def tag_start(name, attrs) if(name == "page") @buf = StringIO::new end return nil unless @buf @buf.printf("<%s", Text::normalize(name)) attrs.each do |pair| @buf.printf(" %s=\"%s\"", Text::normalize(pair[0]), Text::normalize(pair[1])) end @buf.printf(">") end def tag_end(name) return nil unless @buf @buf.printf("", Text::normalize(name)) if(name == "page") begin procpage(Document::new(@buf.string)) rescue return end end end def text(text) return nil unless @buf @buf.printf("%s", Text::normalize(text)) end def procpage(doc) elems = doc.elements title = nil elems.each("page/title") do |elem| title = elem.get_text.value break end mdate = nil elems.each("page/revision/timestamp") do |elem| mdate = elem.get_text.value break end author = nil elems.each("page/revision/contributor/username") do |elem| author = elem.get_text.value break end text = nil elems.each("page/revision/text") do |elem| text = elem.get_text.value break end return if !title || title.size < 1 return if title =~ /(Wikipedia|蛻ゥ逕ィ閠|繝弱シ繝) *(:|;|-|窶酢=|)/ return if !text || text.size < 1 text = text.gsub(/<[^>]+>/, "") text = Text::unnormalize(text) return if text =~ /^#REDIRECT/ || text.size < TEXTMINSIZE text = text.gsub(/^=+([^=]+)=+/, "\\1\n") text = text.gsub(/^ *[\*#:|;-]+ */, "") text = text.gsub(/\[\[[^\]\|]+\|([^\]]+)\]\]/, "\\1") text = text.gsub(/\[\[([a-zA-Z-]+:)?([^\]]+)\]\]/, "\\2") text = text.gsub(/\{\{([^\}\|]+)\|[^\}]+\}\}/, "\\1") text = text.gsub(/\{\{([^\}]+)\}\}/, "\\1") text = text.gsub(/\[http:[^ \]]+ ([^\]]+)\]/, "\\1") text = text.gsub(/''+/, "") text = text.gsub(/^ *\{?|/, "") text = text.gsub(/^ *[\!\|\}]/, "") text = text.gsub(/^\*+/, "") text = text.gsub(/[a-zA-Z]+=\"[^\"].*\"/, "") text = text.gsub(/[a-z][a-z]+=[0-9]+/, "") text = text.gsub(/.*border-style.*/, "") text = text.gsub(/.*valign=.*/, "") text = text.gsub(/\&[a-zA-Z]+;/, "") text = text.gsub(/.*(蛻ゥ逕ィ閠|莨夊ゥア|繝弱シ繝):.*/, "") text = text.gsub(/(Wikipedia|Category):/, "") text = text.gsub(/.*隱:/, "") text = text.gsub(/^thumb\|/, "") text = text.gsub(/逕サ蜒:/, "") text = text.gsub(/^[ +]*[\|]*/, "") text = text.gsub(/\|\|/, "\n") text = text.gsub(/\n\n+/, "\n") if(@seq % 1000 == 0) name = sprintf("%05d", @seq / 1000) printf("%s: making %s\n", $0, name) begin Dir::mkdir(name) rescue end end name = sprintf("%05d/%08d.est", @seq / 1000, @seq) printf("%s: saving %s\n", $0, name) File::open(name, "w") do |fp| fp.printf("@uri=%s%s\n", BASEURL, URI::encode(title)) fp.printf("@title=%s\n", title) fp.printf("@author=%s\n", author) if author && author.size > 0 fp.printf("@mdate=%s\n", mdate) if mdate && mdate.size > 0 fp.printf("@size=%d\n", text.size) fp.printf("\n") fp.printf("%s", text) fp.printf("\n") end @seq += 1 end end # check arguments if ARGV.size != 1 STDERR.printf("usage: %s file\n", $0) exit(1) end # perform parsing listener = MyListener::new source = File::new(ARGV[0]) Document::parse_stream(source, listener) # exit normally exit(0) # END OF FILE hyperestraier-1.4.13/locale/000077500000000000000000000000001125261632700157325ustar00rootroot00000000000000hyperestraier-1.4.13/locale/ja/000077500000000000000000000000001125261632700163245ustar00rootroot00000000000000hyperestraier-1.4.13/locale/ja/estseek.conf000066400000000000000000000016531125261632700206430ustar00rootroot00000000000000indexname: casket tmplfile: estseek.tmpl topfile: estseek.top helpfile: estseek.help lockindex: true pseudoindex: replace: ^file:///home/mikio/public_html/{{!}}http://localhost/ replace: /index\.html?${{!}}/ showlreal: false deftitle: 雜霑キ蟄: 蜈ア蜷御ス鍋噪蜈ィ譁讀懃エ「邉サ formtype: normal perpage: 10 100 10 attrselect: false #genrecheck: private{{!}}蛟倶ココ逕ィ #genrecheck: business{{!}}莉穂コ狗畑 #genrecheck: misc{{!}}縺昴ョ莉 attrwidth: 80 showscore: true extattr: author|闡苓 extattr: from|騾∽ソ。閠 extattr: to|螳帛 extattr: cc|隍陬ス extattr: date|譌・莉 snipwwidth: 480 sniphwidth: 96 snipawidth: 96 condgstep: 2 dotfidf: true scancheck: 3 phraseform: 2 dispproxy: candetail: true candir: false auxmin: 32 smlrvnum: 32 smlrtune: 16 1024 4096 clipview: 2 clipweight: none relkeynum: 0 spcache: wildmax: 256 qxpndcmd: logfile: logformat: {time}\t{REMOTE_ADDR}:{REMOTE_PORT}\t{cond}\t{hnum}\n hyperestraier-1.4.13/locale/ja/estseek.help000066400000000000000000000242211125261632700206420ustar00rootroot00000000000000

    繝倥Ν繝

    縺薙l縺ッ菴包シ

    蜈ィ譁讀懃エ「繧キ繧ケ繝繝縺ァ縺吶よ欠螳壹@縺溯ェ槫唱繧貞性繧譁譖ク繧呈爾縺吶%縺ィ縺後〒縺阪∪縺吶よ悽譁荳ュ縺ョ隱槫唱繧偵b縺ィ縺ォ縺励※讀懃エ「縺吶k縺縺代〒縺ェ縺上鬘悟錐縺ェ縺ゥ縺ョ螻樊ァ繧偵b縺ィ縺ォ讀懃エ「縺吶k縺薙→繧ゅ〒縺阪∪縺吶

    菴ソ縺譁ケ

    逕サ髱「譛荳企Κ縺ォ縺ゅk蜈・蜉帶ャ縺ォ縺ッ縲∵、懃エ「繝輔Ξ繝シ繧コ繧貞・蜉帙@縺セ縺吶ゆセ九∴縺ー縲√後さ繝ウ繝斐Η繝シ繧ソ縲阪→縺縺譁蟄怜励r蜷ォ繧譁譖ク繧呈爾縺励◆縺縺ェ繧峨√後さ繝ウ繝斐Η繝シ繧ソ縲阪→縺昴ョ縺セ縺セ蜈・蜉帙@縺ヲ縺上□縺輔>縲

    讀懃エ「隱槭r遨コ逋ス縺ァ謖溘s縺ァ荳ヲ縺ケ繧九→縲、ND讀懃エ「縺後〒縺阪∪縺吶ゆセ九∴縺ー縲√後う繝ウ繧ソ繝シ繝阪ャ繝 繧サ繧ュ繝・繝ェ繝繧」縲阪→蜈・蜉帙☆繧九→縲√後う繝ウ繧ソ繝シ繝阪ャ繝医阪→縲後そ繧ュ繝・繝ェ繝繧」縲阪ョ荳。譁ケ繧貞性繧譁譖ク繧呈、懃エ「縺励∪縺吶ゅ&縲阪r菴ソ縺」縺ヲ縲√後う繝ウ繧ソ繝シ繝阪ャ繝 & 繧サ繧ュ繝・繝ェ繝繧」縲阪→縺励※繧ょ酔縺倥〒縺吶

    隍謨ー縺ョ讀懃エ「隱槭r縲""縲阪〒諡ャ繧九→縲√ヵ繝ャ繝シ繧コ讀懃エ「縺後〒縺阪∪縺吶ゆセ九∴縺ー縲√"United Nations"縲阪→蜈・蜉帙☆繧九→縲√袈nited縲阪ョ逶エ蠕後↓縲君ations縲阪′蜃コ迴セ縺吶k譁譖ク繧呈、懃エ「縺励∪縺吶

    !縲阪r菴ソ縺縺ィANDNOT讀懃エ「縺後〒縺阪∪縺吶ゆセ九∴縺ー縲√後せ繧ュ繝シ ! 繧ケ繝弱懊シ縲阪→蜈・蜉帙☆繧九→縲√後せ繧ュ繝シ縲阪r蜷ォ繧縺後後せ繝弱懊シ縲阪r蜷ォ縺セ縺ェ縺譁譖ク繧呈、懃エ「縺励∪縺吶ANDNOT讀懃エ「縺ッ縲∵爾縺励◆縺隱槭′莉悶ョ隱槭ョ荳驛ィ縺ォ蜷ォ縺セ繧後※縺縺セ縺乗、懃エ「縺ァ縺阪↑縺蝣エ蜷医↓繧ゆセソ蛻ゥ縺ァ縺吶ゅ後ヵ繧。繧、繝ォ縲阪〒讀懃エ「縺吶k縺ィ縲後励Ο繝輔ぃ繧、繝ォ縲阪′繝偵ャ繝医@縺ヲ鬯ア髯カ縺励>蝣エ蜷医↓縺ッ縲√後ヵ繧。繧、繝ォ ! 繝励Ο繝輔ぃ繧、繝ォ縲阪→縺吶k縺ィ繧医>縺ァ縺励g縺縲

    |縲阪r菴ソ縺縺ィOR讀懃エ「縺後〒縺阪∪縺吶ゆセ九∴縺ー縲√後Ξ繝「繝ウ | 繝ゥ繧、繝縲阪→蜈・蜉帙☆繧九→縲√後Ξ繝「繝ウ縲阪°縲後Λ繧、繝縲阪ョ縺ゥ縺。繧峨°シ医∪縺溘ッ荳。譁ケシ峨r蜷ォ繧譁譖ク繧呈、懃エ「縺励∪縺吶0R讀懃エ「縺ッ縲鬘樒セゥ隱槭d陦ィ險倥ョ謠コ繧後↓蟇セ蠢懊@縺滓、懃エ「繧偵☆繧九ョ縺ォ萓ソ蛻ゥ縺ァ縺吶ゅ詣oman | women縲阪↑縺ゥ縺ィ縺励※闍ア蜊倩ェ槭ョ豢サ逕ィ繧貞精蜿弱@縺溘j縲√碁セ埼ヲャ | 遶憺ヲャ縲阪↑縺ゥ縺ィ縺励※貍「蟄苓。ィ險倥ョ謠コ繧後r蜷ク蜿弱@縺溘j縺吶k縺ィ繧医>縺ァ縺励g縺縲

    |縲阪ッ遨コ逋ス繧縲&縲阪d縲!縲阪h繧翫b蜆ェ蜈磯菴阪′鬮倥>縺薙→縺ォ豕ィ諢上@縺ヲ縺上□縺輔>縲ゆセ九∴縺ー縲√熊1 | F-1 | "Formula One" & 蜆ェ蜍 | 繝√Ε繝ウ繝斐が繝ウ縲阪→蜈・蜉帙@縺溷エ蜷医√熊1縲阪°縲熊-1縲阪°縲熊ormula One縲阪ョ縺ゥ繧後°繧貞性繧薙〒縲√°縺、縲悟━蜍昴阪°縲後メ繝」繝ウ繝斐が繝ウ縲阪ョ縺ゥ縺。繧峨°繧貞性繧譁譖ク繧呈爾縺励∪縺吶

    *縲阪r譁蟄怜励ョ蠕後↓鄂ョ縺上→縲√◎縺ョ譁蟄怜励〒蟋九∪繧句腰隱槭r蜷ォ繧譁譖ク繧呈爾縺励∪縺吶ゆセ九∴縺ー縲√景nter*縲阪→蜈・蜉帙☆繧九→縲√景nter縲阪〒蟋九∪繧句腰隱槭r蜷ォ繧譁譖ク繧呈爾縺励∪縺吶ゅ*縲阪r譁蟄怜励ョ蜑阪↓鄂ョ縺上→縲√◎縺ョ譁蟄怜励〒邨ゅo繧句腰隱槭r蜷ォ繧譁譖ク繧呈爾縺励∪縺吶ゆセ九∴縺ー縲√*sphere縲阪→蜈・蜉帙☆繧九→縲√茎phere縲阪〒邨ゅo繧句腰隱槭r蜷ォ繧譁譖ク繧呈爾縺励∪縺吶ゅ∪縺溘√*縲阪r譁蟄怜励ョ蜑榊セ後↓鄂ョ縺上→縲√◎縺ョ譁蟄怜励ョ豁」隕剰。ィ迴セ縺ォ蜷郁エ縺吶k蜊倩ェ槭r蜷ォ繧譁譖ク繧呈爾縺励∪縺吶ゆセ九∴縺ー縲√*^un.*able$*縲阪→蜈・蜉帙☆繧九→縲√蛍n縲阪〒蟋九∪縺」縺ヲ縲径ble縲阪〒邨ゅo繧句腰隱槭r蜷ォ繧譁譖ク繧呈爾縺励∪縺吶ゅ↑縺翫∝燕譁ケ荳閾エ繧蠕梧婿荳閾エ繧豁」隕剰。ィ迴セ縺ョ讎ょソオ縺ッ縲∬恭隱槭↑縺ゥ縲∫ゥコ逋ス縺ァ蜊倩ェ槭′蛹コ蛻繧峨l繧玖ィ隱槭↓蟇セ縺励※縺ョ縺ソ諢丞袖繧呈戟縺。縺セ縺吶

    螻樊ァ縺ォ繧医k邨槭j霎シ縺ソ

    with XXX縲阪ョXXX縺ッ縲∝ア樊ァ縺ォ繧医k邨槭j霎シ縺ソ譚。莉カ繧呈欠螳壹@縺セ縺吶ゆセ九∴縺ー縲√掘title STRINC 驥崎ヲ√阪→謖螳壹☆繧九→縲√ち繧、繝医Ν縺ォ縲碁崎ヲ√阪→縺縺譁蟄怜励r蜷ォ繧譁譖ク縺縺代↓邨槭j霎シ縺ソ縺セ縺吶ゅ掘title縲阪ッ繧ソ繧、繝医Ν繧堤、コ縺吝ア樊ァ蜷阪〒縺吶ょア樊ァ縺ォ縺ッ莉・荳九ョ繧ゅョ縺後≠繧翫∪縺吶

    • @uri : 譁譖ク縺ョURIシURLシ峨
    • @title : 譁譖ク縺ョ繧ソ繧、繝医Ν縲ゅΓ繝シ繝ォ縺ョ蝣エ蜷医ッSubject縺ョ蛟、縺ィ蜷後§縲
    • @author : 譁譖ク縺ョ菴懆縲ゅΓ繝シ繝ォ縺ョ蝣エ蜷医ッFrom縺ョ蛟、縺ィ蜷後§縲
    • @cdate : 譁譖ク縺ョ菴懈先凾髢薙ゅΓ繝シ繝ォ縺ョ蝣エ蜷医ッDate縺ョ蛟、縺ィ蜷後§縲
    • @mdate : 譁譖ク縺ョ譛邨よ峩譁ー譎る俣縲ゅΓ繝シ繝ォ縺ョ蝣エ蜷医ッDate縺ョ蛟、縺ィ蜷後§縲
    • @size : 譁譖クシ医ヵ繧。繧、繝ォシ峨ョ繧オ繧、繧コ縲

    縲郡TRINC縲阪ッ驛ィ蛻譁蟄怜励r蜷ォ繧縺九r蛻、螳壹☆繧区シ皮ョ怜ュ舌〒縺吶らオ槭j霎シ縺ソ逕ィ縺ョ貍皮ョ怜ュ舌↓縺ッ莉・荳九ョ繧ゅョ縺後≠繧翫∪縺吶

    • STREQ : 謖螳壹@縺滓枚蟄怜励→荳閾エ縺吶k縲
    • STRNE : 謖螳壹@縺滓枚蟄怜励→荳閾エ縺励↑縺縲
    • STRINC : 謖螳壹@縺滓枚蟄怜励r蜷ォ繧縲
    • STRBW : 謖螳壹@縺滓枚蟄怜励〒蟋九∪繧九
    • STREW : 謖螳壹@縺滓枚蟄怜励〒邨ゅo繧九
    • STRAND : 謖螳壹@縺滓枚蟄怜励ョ蜈ィ縺ヲ縺ョ繝医シ繧ッ繝ウ繧貞性繧縲
    • STROR : 謖螳壹@縺滓枚蟄怜励ョ荳縺、莉・荳翫ョ繝医シ繧ッ繝ウ繧貞性繧縲
    • STROREQ : 謖螳壹@縺滓枚蟄怜励ョ荳縺、莉・荳翫ョ繝医シ繧ッ繝ウ縺ィ荳閾エ縺吶k縲
    • STRRX : 謖螳壹@縺滓枚蟄怜励ョ豁」隕剰。ィ迴セ縺ォ蜷郁エ縺吶k縲
    • NUMEQ : 謨ー蛟、繧譌・莉倥′謖螳壹@縺溘b縺ョ縺ィ遲峨@縺縲
    • NUMNE : 謨ー蛟、繧譌・莉倥′謖螳壹@縺溘b縺ョ縺ィ遲峨@縺上↑縺縲
    • NUMGT : 謨ー蛟、繧譌・莉倥′謖螳壹@縺溘b縺ョ繧医j螟ァ縺阪>縲
    • NUMGE : 謨ー蛟、繧譌・莉倥′謖螳壹@縺溘b縺ョ縺ィ蜷後§縺九h繧雁、ァ縺阪>縲
    • NUMLT : 謨ー蛟、繧譌・莉倥′謖螳壹@縺溘b縺ョ繧医j蟆上&縺縲
    • NUMLE : 謨ー蛟、繧譌・莉倥′謖螳壹@縺溘b縺ョ縺ィ蜷後§縺九h繧雁ー上&縺縲
    • NUMBT : 謨ー蛟、繧譌・莉倥′謖螳壹@縺溘b縺ョ縺ョ髢薙〒縺ゅk縲

    貍皮ョ怜ュ舌ョ蜑阪↓縲!縲阪r鄂ョ縺縺ヲ縲!STREQ縲阪↑縺ゥ縺ィ縺吶k縺ィ縲∵擅莉カ縺ォ蠖薙※縺ッ縺セ繧峨↑縺繧ゅョ縺ォ邨槭j霎シ縺ソ縺セ縺吶よ枚蟄怜励ョ貍皮ョ怜ュ舌ョ蜑阪↓縲I縲阪r鄂ョ縺縺ヲ縲栗STREQ縲阪↑縺ゥ縺ィ縺吶k縺ィ縲∬恭蟄励↑縺ゥ縺ョ螟ァ譁蟄励→蟆乗枚蟄励ョ驕輔>繧堤┌隕悶@縺セ縺吶よシ皮ョ怜ュ舌r逵∫払縺励※螻樊ァ蜷阪ョ縺ソ繧呈欠螳壹@縺溷エ蜷医∝、縺ッ蝠上o縺壹↓縲√◎縺ョ螻樊ァ繧貞y縺医k譁譖ク繧定ゥイ蠖薙→縺ソ縺ェ縺励∪縺吶STRAND縺ィSTROR縺ィSTROREQ縺ィNUMBT縺ッ遨コ逋ス縺ァ蛹コ蛻縺」縺溯、謨ー縺ョ譁蟄怜励r蠑墓焚縺ォ蜿悶j縺セ縺吶ゅ君UMBT 51 100縲阪ッ縲√51縺九i100縺セ縺ァ縲阪→縺縺諢丞袖縺ァ縺ゅj縲∝「逡悟、繧らッ蝗イ縺ォ蜷ォ縺ソ縺セ縺吶

    螻樊ァ蜷阪r縲,縲阪〒蛹コ蛻縺」縺ヲ荳ヲ縺ケ繧九→縲∽クヲ縺ケ縺溷ア樊ァ縺ョ縺縺壹l縺九→縺縺諢丞袖縺ォ縺ェ繧翫∪縺吶ゆセ九∴縺ー縲掲rom,to,cc STRINC mikio縲阪ッ縲√掲rom縺逆o縺議c縺ョ縺ゥ繧後°縺ォmikio繧貞性繧縲阪→縺縺諢丞袖縺ォ縺ェ繧翫∪縺吶ゅ,縲阪ョ蜑榊セ後↓遨コ逋ス繧貞・繧後※縺ッ縺縺代∪縺帙s縲

    鬆蠎乗欠螳

    order by XXX縲阪ョXXX縺ッ縲∫オ先棡縺ョ陦ィ遉コ鬆蠎上r謖螳壹@縺セ縺吶ゆセ九∴縺ー縲√掘size NUMA縲阪→謖螳壹☆繧九→縲√し繧、繧コ縺悟ー上&縺譁譖ク縺九i荳ヲ縺ケ繧峨l縺セ縺吶ゅ掘size縲阪ッ螻樊ァ蜷阪〒縺吶ょア樊ァ蜷阪↓縺ッ邨槭j霎シ縺ソ譚。莉カ縺ョ繧ゅョ縺ィ蜷後§繧ゅョ縺梧欠螳壹〒縺阪∪縺吶ゅ君UMA縲阪ッ貍皮ョ怜ュ舌〒縺吶る蠎乗欠螳夂畑縺ョ貍皮ョ怜ュ舌↓縺ッ莉・荳九ョ繧ゅョ縺後≠繧翫∪縺吶

    • STRA : 譁蟄怜暦シ郁セ樊嶌鬆シ峨ョ譏鬆縲
    • STRD : 譁蟄怜暦シ郁セ樊嶌鬆シ峨ョ髯埼縲
    • NUMA : 謨ー蛟、縺セ縺溘ッ譌・莉倥ョ譏鬆縲
    • NUMD : 謨ー蛟、縺セ縺溘ッ譌・莉倥ョ髯埼縲

    鬆蠎乗欠螳壹r陦後o縺ェ縺九▲縺溷エ蜷医ッ縲√せ繧ウ繧「縺ョ髯埼縺ォ縺ェ繧翫∪縺吶ゅせ繧ウ繧「縺ッ縲∵、懃エ「隱槭′螟壹¥蜷ォ縺セ繧後k譁譖ク縺サ縺ゥ鬮倥¥縺ェ繧翫∪縺吶ょア樊ァ蜷阪□縺代r謖螳壹@縺ヲ貍皮ョ怜ュ舌r逵∫払縺励◆蝣エ蜷医ッ縲STRA縺梧欠螳壹&繧後◆縺ィ縺ソ縺ェ縺励∪縺吶

    縺昴ョ莉悶ョ讖溯ス

    XX per page縲阪ョXX縺ッ縲∫オ先棡縺ョ蜷繝壹シ繧ク縺ォ陦ィ遉コ縺吶k譁譖ク縺ョ謨ー繧呈欠螳壹@縺セ縺吶よ、懃エ「邨先棡縺1繝壹シ繧ク縺ォ蜿弱∪繧峨↑縺蝣エ蜷医ッ縲∵、懃エ「邨先棡縺ョ繝壹シ繧ク縺ョ荳狗ォッ縺ォ縺ゅk縲PREV縲阪→縲NEXT縲阪r驕ク謚槭☆繧九%縺ィ縺ァ縲∝燕蠕後ョ繝壹シ繧ク縺ォ遘サ蜍輔☆繧九%縺ィ縺後〒縺阪∪縺吶

    clip by XX縲阪ョXX縺ッ縲∫オ先棡縺ォ蜷ォ縺セ繧後k鬘樔シシ縺励◆譁譖ク繧偵∪縺ィ繧√k蜉帙ョ蠑キ縺輔r謖螳壹@縺セ縺吶よ、懃エ「邨先棡縺ォ蜷後§讒倥↑譁譖ク縺ー縺九j陦ィ遉コ縺輔l縺ヲ菴輔壹シ繧ク繧らァサ蜍輔☆繧九ョ縺碁擇蛟偵↑蝣エ蜷医↓菴ソ縺縺ィ繧医>縺ァ縺励g縺縲

    讀懃エ「邨先棡縺ョ縲[detail]縲阪r驕ク謚槭☆繧九→縲∝推縲縺ョ譁譖ク縺ョ隧ウ邏ー縺ェ諠蝣ア縺瑚。ィ遉コ縺輔l縺セ縺吶よ、懃エ「邨先棡縺ョ縲[similar]縲阪r驕ク謚槭☆繧九→縲∝推縲縺ョ譁譖ク縺ォ鬘樔シシ縺励◆譁譖ク縺梧、懃エ「縺輔l縺セ縺吶よ、懃エ「邨先棡縺ョ縲[include]縲阪r驕ク謚槭☆繧九→縲√◎縺薙↓逵∫払縺輔l縺ヲ縺縺滓枚譖ク縺瑚。ィ遉コ縺輔l縺セ縺吶

    陬懆カウ

    Hyper Estraier縺ッ縲∵律譛ャ隱槭□縺代〒縺ェ縺上∬恭隱槭√ラ繧、繝隱槭√ヵ繝ゥ繝ウ繧ケ隱槭∽クュ蝗ス隱槭↑縺ゥ縲∝、ァ謚オ縺ョ險隱槭r謇ア縺縺薙→縺後〒縺阪∪縺吶り恭蟄励ョ螟ァ譁蟄励→蟆乗枚蟄励ョ驕輔>縺ッ辟。隕悶&繧後∪縺吶ゅ繰apan縲阪桂apan縲阪繰APAN縲阪桂aPaN縲阪ッ蜈ィ縺ヲ蜷後§縺ァ縺吶ゅム繧、繧「繧ッ繝ェ繝繧」繧ォ繝ォ繝槭シ繧ッ莉倥″縺ョ繝ゥ繝繝ウ譁蟄暦シàéîõüシ峨d縲√ぐ繝ェ繧キ繧「譁蟄暦シαβγδεシ峨√く繝ェ繝ォ譁蟄暦シабвгдシ峨〒繧ょ酔讒倥〒縺吶

    谺ァ譁縺ッ蜊倩ェ槭r蜊倅ス阪↓縺励※讀懃エ「縺輔l縲√◎繧御サ・螟悶ョ險隱橸シ井クュ蝗ス隱槭∵律譛ャ隱槭髻灘嵜隱槭√い繝ゥ繝薙い隱槭↑縺ゥシ峨ッ譁蟄励r蜊倅ス阪↓縺励※讀懃エ「縺輔l縺セ縺呻シN-gram譁ケ蠑擾シ峨

    遨コ逋ス繧縲&縲阪!縲阪|縲阪*縲阪r讀懃エ「隱槭◎縺ョ繧ゅョ縺ィ縺励※謖螳壹@縺溘>蝣エ蜷医ッ縲√ヵ繝ャ繝シ繧コ讀懃エ「繧貞ソ懃畑縺励※縺上□縺輔>縲ゆセ九∴縺ー縲窟T&T縲阪r讀懃エ「縺励◆縺蝣エ蜷医ッ縲√"AT&T"縲阪→縺励∪縺吶

    讀懃エ「隱槭r蜈・蜉帙@縺ェ縺上※繧ゅ∝ア樊ァ譚。莉カ縺縺代〒讀懃エ「縺吶k縺薙→縺後〒縺阪∪縺吶ゅ◎縺ョ蝣エ蜷医∝ィ縺ヲ縺ョ譁譖ク縺ョ荳ュ縺九i縲∝ア樊ァ譚。莉カ縺ォ蜷郁エ縺吶k繧ゅョ縺梧、懃エ「縺輔l縺セ縺吶

    縺薙ョ繧オ繧、繝医ッHyper Estraier縺ョ譛繧ょ次蟋狗噪縺ェ繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ィ縺励※讒狗ッ峨&繧後※縺縺セ縺吶Hyper Estraier縺ッ繝励Ο繧ー繝ゥ繝槭ョ縺溘a縺ョ繝ゥ繧、繝悶Λ繝ェシAPIシ峨→縺励※謠蝉セ帙&繧後∪縺吶ョ縺ァ縲∵沐霆溘↑繧ォ繧ケ繧ソ繝槭う繧コ繧蠑キ蜉帙↑讖溯ス霑ス蜉縺悟庄閭ス縺ァ縺吶ゅ#闊亥袖縺ョ縺ゅk譁ケ縺ッ縲Hyper Estraier縺ョ繝帙シ繝繝壹シ繧ク繧偵#隕ァ縺上□縺輔>縲

    hyperestraier-1.4.13/locale/ja/estseek.tmpl000066400000000000000000000150541125261632700206720ustar00rootroot00000000000000 <!--ESTTITLE--> hyperestraier-1.4.13/locale/ja/estseek.top000066400000000000000000000002051125261632700205100ustar00rootroot00000000000000 hyperestraier-1.4.13/man/000077500000000000000000000000001125261632700152465ustar00rootroot00000000000000hyperestraier-1.4.13/man/estcall.1000066400000000000000000000147671125261632700167760ustar00rootroot00000000000000.TH ESTCALL 1 "2007-03-06" "Man Page" "Hyper Estraier" .SH NAME estcall \- command line interface of the node API .SH SYNOPSIS .PP .B estcall put [\-proxy host port] [\-tout num] [\-auth user pass] nurl [file] .PP .B estcall out [\-proxy host port] [\-tout num] [\-auth user pass] nurl expr .PP .B estcall edit [\-proxy host port] [\-tout num] [\-auth user pass] nurl expr name [value] .PP .B estcall get [\-proxy host port] [\-tout num] [\-auth user pass] nurl expr [attr] .PP .B estcall etch [\-proxy host port] [\-tout num] [\-auth user pass] nurl expr .PP .B estcall uriid [\-proxy host port] [\-tout num] [\-auth user pass] nurl uri .PP .B estcall inform [\-proxy host port] [\-tout num] [\-auth user pass] [\-ia|\-iu|\-il] nurl .PP .B estcall sync [\-proxy host port] [\-tout num] [\-auth user pass] nurl .PP .B estcall optimize [\-proxy host port] [\-tout num] [\-auth user pass] nurl .PP .B estcall search [\-proxy host port] [\-tout num] [\-auth user pass] [\-vx] [\-kw] [\-ec] [\-sf] [\-attr expr] [\-ord expr] [\-max num] [\-sk num] [\-aux num] [\-dis name] [\-dpt num] [\-mask num] nurl [phrase] .PP .B estcall setuser [\-proxy host port] [\-tout num] [\-auth user pass] nurl name mode .PP .B estcall setlink [\-proxy host port] [\-tout num] [\-auth user pass] nurl url label credit .PP .B estcall raw [\-proxy host port] [\-tout num] [\-auth user pass] [\-np] [\-eh expr] url [file] .SH DESCRIPTION .PP .B estcall is an aggregation of sub commands. The name of a sub command is specified by the first argument. Other arguments are parsed according to each sub command. The argument .I nurl specifies the URL of a node. The option .B \-proxy specifies the host name and the port number of a proxy server. The option .B \-tout specifies timeout in seconds. The option .B \-auth specifies the user name and the password of authentication information. .TP .B estcall put [\-proxy host port] [\-tout num] [\-auth user pass] nurl [file] Register a document of document draft to a node. .br .I file specifies a target file. If it is omitted, the standard input is read. .TP .B estcall out [\-proxy host port] [\-tout num] [\-auth user pass] nurl expr Remove information of a document from a node. .br .I expr specifies the ID number or the URI of a document. .TP .B estcall edit [\-proxy host port] [\-tout num] [\-auth user pass] nurl expr name [value] Edit an attribute of a document in a node. .br .I expr specifies the ID number or the URI of a document. .br .I name specifies the name of an attribute. .br .I value specifies the value of the attribute. If it is omitted, the attribute is removed. .TP .B estcall get [\-proxy host port] [\-tout num] [\-auth user pass] nurl expr [attr] Output document draft of a document in a node. .br .I expr specifies the ID number or the URI of a document. .br If .I attr is specified, only the value of the attribute is output. .TP .B estcall etch [\-proxy host port] [\-tout num] [\-auth user pass] nurl expr Output TSV of keywords and their scores of a document in a node. .br .I expr specifies the ID number or the URI of a document. .TP .B estcall uriid [\-proxy host port] [\-tout num] [\-auth user pass] nurl uri Output the ID number of a document specified by URI. .br .I uri specifies the URI of a document. .TP .B estcall inform [\-proxy host port] [\-tout num] [\-auth user pass] [\-ia|\-iu|\-il] nurl Output the name, the label, the number of documents, the number of unique words, and the cache usage of a node. .br If .B \-ia is specified, names of administrators are output. .br If .B \-iu is specified, names of users are output. .br If .B \-il is specified, expressions of links are output. .TP .B estcall sync [\-proxy host port] [\-tout num] [\-auth user pass] nurl Synchronize updating contents of the database of a node. .TP .B estcall optimize [\-proxy host port] [\-tout num] [\-auth user pass] nurl Optimize the database of a node. .TP .B estcall search [\-proxy host port] [\-tout num] [\-auth user pass] [\-vx] [\-kw] [\-ec] [\-sf] [\-attr expr] [\-ord expr] [\-max num] [\-sk num] [\-aux num] [\-dis name] [\-dpt num] [\-mask num] nurl [phrase] Search a node for documents. .br .I phrase specifies the search phrase. .br If .B \-vx is specified, XML including including attributes and snippets is output. .br If .B \-kw is specified, keyword vectors are retrieved. .br .B \-ec specifies lower limit of similarity eclipse. .br If .B \-sf is specified, the phrase is treated as a simplified form. .br .B \-attr specifies an attribute search condition. This option can be specified multiple times. .br .B \-ord specifies the order expression. By default, it is descending by score. .br .B \-max specifies the maximum number of show documents. Negative means unlimited. By default, it is 10. .br .B \-sk specifies the number of documents to be skipped. By default, it is 0. .br .B \-aux specifies permission to adopt result of the auxiliary index. If it is not more than 0, the auxiliary index is not used. By default, it is 32. .br .B -dis specifies the name of the distinct attribute. .br .B \-dpt specifies the depth of meta search. by default it is 0. .br .B \-mask specifies the mask of meta search. by default it is 0. .TP .B estcall setuser [\-proxy host port] [\-tout num] [\-auth user pass] nurl name mode Set permission of a user. .br .I name specifies the name of a user. .br .I mode specifies operation mode. 1 means to set the user as an administrator, 2 means to set the user as a guest, and 0 means to revoke the user account. .TP .B estcall setlink [\-proxy host port] [\-tout num] [\-auth user pass] nurl url label credit Set a link to another node. .br .I url specifies the URL of a destination node. .br .I label specifies the label of the link. .br .I credit specifies the credit of the link. If the value is negative, the link is removed. .TP .B estcall raw [\-proxy host port] [\-tout num] [\-auth user pass] [\-np] [\-eh expr] url [file] Output response of an HTTP request. .br .I url specifies the URL of a target. .br If .I file is specified, the content is sent by POST method. If not, GET method is used. If "\-" is specified, the standard input is read. .br If .B \-np is specified, output response headers also. .br .B \-eh specifies an additional HTTP header. By default, "Host", "Connection", "User\-Agent", and "Content\-Length" is added. .PP All sub commands return 0 if the operation is success, else return 1. .SH SEE ALSO .PP .BR estconfig (1), .BR estcmd (1), .BR estmaster (1), .BR estwaver (1), .BR estraier (3), .BR estnode (3) .PP Please see .B http://hyperestraier.sourceforge.net/nguide-en.html for detail. hyperestraier-1.4.13/man/estcmd.1000066400000000000000000000514441125261632700166170ustar00rootroot00000000000000.TH ESTCMD 1 "2007-03-06" "Man Page" "Hyper Estraier" .SH NAME estcmd \- command line interface of the core API .SH SYNOPSIS .PP .B estcmd create [\-tr] [\-apn|\-acc] [\-xs|\-xl|\-xh|\-xh2|\-xh3] [\-sv|\-si|\-sa] [\-attr name type] db .PP .B estcmd put [\-tr] [\-cl] [\-ws] [\-apn|\-acc] [\-xs|\-xl|\-xh||\-xh2|\-xh3] [\-sv|\-si|\-sa] db [file] .PP .B estcmd out [\-cl] [\-pc enc] db expr .PP .B estcmd edit [\-pc enc] db expr name [value] .PP .B estcmd get [\-nl|\-nb] [\-pidx path] [\-pc enc] db expr [attr] .PP .B estcmd list [\-nl|\-nb] [\-lp] db .PP .B estcmd uriid [\-nl|\-nb] [\-pidx path] [\-pc enc] db expr .PP .B estcmd meta db [name [value]] .PP .B estcmd inform [\-nl|\-nb] db .PP .B estcmd optimize [\-onp] [\-ond] db .PP .B estcmd merge [\-cl] db target .PP .B estcmd repair [\-rst|\-rsh] db .PP .B estcmd search [\-nl|\-nb] [\-pidx path] [\-ic enc] [\-vu|\-va|\-vf|\-vs|\-vh|\-vx|\-dd] [\-sn wnum hnum anum] [\-kn num] [\-um] [\-ec rn] [\-gs|\-gf|\-ga] [\-cd] [\-ni] [\-sf|\-sfr|\-sfu|\-sfi] [\-hs] [\-attr expr] [\-ord expr] [\-max num] [\-sk num] [\-aux num] [\-dis name] [\-sim id] db [phrase] .PP .B estcmd gather [\-tr] [\-cl] [\-ws] [\-no] [\-fe|\-ft|\-fh|\-fm] [\-fx sufs cmd] [\-fz] [\-fo] [\-rm sufs] [\-ic enc] [\-il lang] [\-bc] [\-lt num] [\-lf num] [\-pc enc] [\-px name] [\-aa name value] [\-apn|\-acc] [\-xs|\-xl|\-xh|\-xh2|\-xh3] [\-sv|\-si|\-sa] [\-ss name] [\-sd] [\-cm] [\-cs num] [\-ncm] [\-kn num] [\-um] db [file|dir] .PP .B estcmd purge [\-cl] [\-no] [\-fc] [\-pc enc] [\-attr expr] db [prefix] .PP .B estcmd extkeys [\-no] [\-fc] [\-dfdb file] [\-ncm] [\-ni] [\-kn num] [\-um] [\-attr expr] db [prefix] .PP .B estcmd words [\-nl|\-nb] [\-dfdb file] [\-kw|\-kt] db .PP .B estcmd draft [\-ft|\-fh|\-fm] [\-ic enc] [\-il lang] [\-bc] [\-lt num] [\-kn num] [\-um] [file] .PP .B estcmd break [\-ic enc] [\-il lang] [\-apn|\-acc] [\-wt] [file] .PP .B estcmd iconv [\-ic enc] [\-il lang] [\-oc enc] [file] .PP .B estcmd regex [\-inv] [\-repl str] expr [file] .PP .B estcmd scandir [\-tf|\-td] [\-pa|\-pu] [dir] .PP .B estcmd multi [\-db db] [\-nl|\-nb] [\-ic enc] [\-gs|\-gf|\-ga] [\-cd] [\-ni] [\-sf|\-sfr|\-sfu|\-sfi] [\-hs] [\-hu] [\-attr expr] [\-ord expr] [\-max num] [\-sk num] [\-aux num] [\-dis name] [phrase] .PP .B estcmd randput [\-ren|\-rla|\-reu|\-ror|\-rjp|\-rch] [\-cs num] db dnum .PP .B estcmd wicked db dnum .PP .B estcmd regression db .PP .B estcmd version .SH DESCRIPTION .PP .B estcmd is an aggregation of sub commands. The name of a sub command is specified by the first argument. Other arguments are parsed according to each sub command. The argument .I db specifies the path of an index. .TP .B estcmd create [\-tr] [\-apn|\-acc] [\-xs|\-xl|\-xh|\-xh2|\-xh3] [\-sv|\-si|\-sa] [\-attr name type] db Create an index. .br If .B \-tr is specified, a new index is created regardless if one exists. .br If .B \-apn is specified, N\-gram analysis is performed against European text also. .br If .B \-acc is specified, character category analysis is performed instead of N-gram analysis. .br If .B \-xs is specified, the index is tuned to register less than 50000 documents. .br If .B \-xl is specified, the index is tuned to register more than 300000 documents. .br If .B \-xh is specified, the index is tuned to register more than 1000000 documents. .br If .B \-xh2 is specified, the index is tuned to register more than 5000000 documents. .br If .B \-xh3 is specified, the index is tuned to register more than 10000000 documents. .br If .B \-sv is specified, scores are stored as void. .br If .B \-si is specified, scores are stored as 32-bit integer. .br If .B \-sa is specified, scores are stored as-is and marked not to be tuned when search. .br .B \-attr specifies an attribute index and its data type. This option can be specified multiple times. .TP .B estcmd put [\-tr] [\-cl] [\-apn|\-acc] [\-xs|\-xl|\-xh|\-xh2|\-xh3] [\-sv|\-si|\-sa] db [file] Register a document of document draft to an index. .br .I file specifies a target file. If it is omitted, the standard input is read. .br If .B \-tr is specified, a new index is created regardless if one exists. .br If .B \-cl is specified, regions of a overwritten document are cleaned up. .br If .B \-ws is specified, scores are weighted statically with score weighting attribute. .br If .B \-apn is specified, N\-gram analysis is performed against European text also. .br If .B \-acc is specified, character category analysis is performed instead of N-gram analysis. .br If .B \-xs is specified, the index is tuned to register less than 50000 documents. .br If .B \-xl is specified, the index is tuned to register more than 300000 documents. .br If .B \-xh is specified, the index is tuned to register more than 1000000 documents. .br If .B \-xh2 is specified, the index is tuned to register more than 5000000 documents. .br If .B \-xh3 is specified, the index is tuned to register more than 10000000 documents. .br If .B \-sv is specified, scores are stored as void. .br If .B \-si is specified, scores are stored as 32-bit integer. .br If .B \-sa is specified, scores are stored as-is and marked not to be tuned when search. .TP .B estcmd out [\-pc enc] [\-cl] db expr Remove information of a document from an index. .br .I expr specifies the ID number, the URI, or the local path of a document. .br If .B \-cl is specified, regions of the document are cleaned up. .br .B \-pc specifies the encoding of file paths. By default, it is ISO-8859-1. .TP .B estcmd edit [\-pc enc] db expr name [value] Edit an attribute of a document in an index. .br .I expr specifies the ID number, the URI, or the local path of a document. .br .I name specifies the name of an attribute. .br .I value specifies the value of the attribute. If it is omitted, the attribute is removed. .br .B \-pc specifies the encoding of the file path and the attribute value. By default, it is ISO-8859-1. .TP .B estcmd get [\-nl|\-nb] [\-pidx path] [\-pc enc] db expr [attr] Output document draft of a document in an index. .br .I expr specifies the ID number, the URI, or the local path of a document. .br If .I attr is specified, only the value of the attribute is output. .br If .B \-nl is specified, the index is opened without file locking. .br If .B \-nb is specified, file locking is performed without blocking. .br .B \-pidx specifies the path of a pseudo index. This option can be specified multiple times. .br .B \-pc specifies the encoding of file paths. By default, it is ISO-8859-1. .TP .B estcmd list [\-nl|\-nb] [\-lp] db Output a list of all document in an index. .br If .B \-nl is specified, the index is opened without file locking. .br If .B \-nb is specified, file locking is performed without blocking. .br If .B \-lp is specified, local path equivalent to URL of "file://" is output. .TP .B estcmd uriid [\-nl|\-nb] [\-pidx path] [\-pc enc] db expr Output the ID number of a document specified by URI. .br .I expr specifies the URI or the local path of a document. .br If .B \-nl is specified, the index is opened without file locking. .br If .B \-nb is specified, file locking is performed without blocking. .br .B \-pidx specifies the path of a pseudo index. This option can be specified multiple times. .br .B \-pc specifies the encoding of file paths. By default, it is ISO-8859-1. .TP .B estcmd meta db [name [value]] Handle meta data. .br .I name specifies the name of a piece of meta data. If it is omitted, a list of all names is output. .br .I value specifies the value of the meta data to be recorded. If it is omitted, the current value is output. If it is an empty string, the meta data is removed. .TP .B estcmd inform [\-nl|\-nb] db Output the number of documents and the number of unique words in an index. .br If .B \-nl is specified, the index is opened without file locking. .br If .B \-nb is specified, file locking is performed without blocking. .TP .B estcmd optimize [\-onp] [\-ond] db Optimize an index and clean up dispensable regions. .br If .B \-onp is specified, it is omitted to clean up dispensable regions. .br If .B \-ond is specified, it is omitted to optimize the database files. .TP .B estcmd merge [\-cl] db target Merge another index. .br .I target specifies the path of another index. .br If .B \-cl is specified, regions of overwritten documents are cleaned up. .TP .B estcmd repair [\-rst|\-rsh] db Repair a broken index. .br If .B \-rst is specified, strict consistency check is performed. .br If .B \-rsh is specified, consistency check is omitted. .TP .B estcmd search [\-nl|\-nb] [\-pidx path] [\-ic enc] [\-vu|\-va|\-vf|\-vs|\-vh|\-vx|\-dd] [\-sn wnum hnum anum] [\-kn num] [\-um] [\-ec rn] [\-gs|\-gf|\-ga] [\-cd] [\-ni] [\-sf|\-sfr|\-sfu|\-sfi] [\-hs] [\-attr expr] [\-ord expr] [\-max num] [\-sk num] [\-aux num] [\-dis name] [\-sim id] db [phrase] Search an index for documents. .br .I phrase specifies the search phrase. .br If .B \-nl is specified, the index is opened without file locking. .br If .B \-nb is specified, file locking is performed without blocking. .br .B \-pidx specifies the path of a pseudo index. This option can be specified multiple times. .br .B \-ic specifies the input encoding. By default, it is UTF\-8. .br If .B \-vu is specified, TSV of ID number and URI are output. .br If .B \-va is specified, multipart format including attributes is output. .br If .B \-vf is specified, multipart format including document draft is output. .br If .B \-vs is specified, multipart format including attributes and snippets is output. .br If .B \-vh is specified, human readable format including attributes and snippets is output. .br If .B \-vx is specified, XML including including attributes and snippets is output. .br If .B \-dd is specified, document draft data are dumped and saved into separated files. .br .B \-sn specifies the number of whole width of snippet and width of strings picked up from the beginning of the text and width of strings picked up around each highlighted word. .br .B \-kn specifies the number of keywords to be extracted. By default, keyword extraction is not performed. .br If .B \-um is specified, morphological analyzers are used for keyword extraction. .br .B \-ec specifies lower limit of similarity eclipse. .br If .B \-gs is specified, every key of N\-gram is checked. By default, it is alternately. .br If .B \-gf is specified, keys of N\-gram are checked every three. .br If .B \-ga is specified, keys of N\-gram are checked every four. .br If .B \-cd is specified, whether documents match the search phrase definitely is checked. .br If .B \-ni is specified, TF\-IDF tuning is omitted. .br If .B \-sf is specified, the phrase is treated as a simplified form. .br If .B \-sfr is specified, the phrase is treated as a rough form. .br If .B \-sfu is specified, the phrase is treated as a union form. .br If .B \-sfi is specified, the phrase is treated as an intersection form. .br If .B \-hs is specified, score information is output as an attribute. .br .B \-attr specifies an attribute search condition. This option can be specified multiple times. .br .B \-ord specifies the order expression. By default, it is descending by score. .br .B \-max specifies the maximum number of shown documents. Negative means unlimited. By default, it is 10. .br .B \-sk specifies the number of documents to be skipped. By default, it is 0. .br .B \-aux specifies permission to adopt result of the auxiliary index. If it is not more than 0, the auxiliary index is not used. By default, it is 32. .br .B -dis specifies the name of the distinct attribute. .br .B \-sim specifies the ID number of the seed document for similarity search. .TP .B estcmd gather [\-tr] [\-cl] [\-ws] [\-no] [\-fe|\-ft|\-fh|\-fm] [\-fx sufs cmd] [\-fz] [\-fo] [\-rm sufs] [\-ic enc] [\-il lang] [\-bc] [\-lt num] [\-lf num] [\-pc enc] [\-px name] [\-aa name value] [\-apn|\-acc] [\-xs|\-xl|\-xh|\-xh2|\-xh3] [\-sv|\-si|\-sa] [\-ss name] [\-sd] [\-cm] [\-cs num] [\-ncm] [\-kn num] [\-um] db [file|dir] Scan the local file system and register documents into an index. .br If the third argument is the name of a file, a list of paths of target documents are read from it. If it is "\-", the standard input is specified. .br If the third argument is the name of a directory. All files under the directory are treated as target documents. .br If .B \-tr is specified, a new index is created regardless if one exists. .br If .B \-cl is specified, regions of overwritten documents are cleaned up. .br If .B \-ws is specified, scores are weighted statically with score weighting attribute. .br If .B \-no is specified, operations are printed but not executed actually. .br If .B \-fe is specified, target files are treated as document draft. By default, the format is detected by the suffix of each document. .br If .B \-ft is specified, target files are treated as plain text. .br If .B \-fh is specified, target files are treated as HTML. .br If .B \-fm is specified, target files are treated as MIME. .br If .B \-fx is specified, target files with the specified suffixes are processed by the specified outer command. "*" matches any file. If the command is leaded by "T@", the output of the command is treated as plain text. If the command is leaded by "H@", the output of the command is treated as HTML. If the command is leaded by "M@", the output of the command is treated as MIME. Else, the output is treated as document draft. This option can be specified multiple times. .br If .B \-fz is specified, documents which do not corresponding to the condition of .B \-fx are ignored. .br If .B \-fo is specified, target files are not read. It is useful for efficient process of the outer command. .br If .B \-rm is specified, target files with the specified suffixes are removed. "*" matches any file. This option can be specified multiple times. .br .B \-ic specifies the input encoding. By default, it is detected automatically. .br .B \-il specifies the preferred input language. By default, English is preferred. .br If .B \-bc is specified, binary files are detected and ignored. .br .B \-lt specifies the text size limitation by kilo bytes. By default, it is 128KB. If it is negative, the size is unlimited. .br .B \-lf specifies the file size limitation by mega bytes. By default, it is 32MB. If it is negative, the size is unlimited. .br .B \-pc specifies the encoding of file paths. By default, it is ISO\-8859\-1. .br .B \-px specifies the name of an attribute read from the list of paths. As the list of paths can be in TSV format, the first field is treated as the path of a target document, the second field and the followers are definitions of attribute values. .B \-px specifies the name of each values of the second field and the followers. This option can be specified multiple times. .br .B \-aa specifies the name and the value of an additional attribute. This option can be specified multiple times. .br If .B \-apn is specified, N\-gram analysis is performed against European text also. .br If .B \-acc is specified, character category analysis is performed instead of N-gram analysis. .br If .B \-xs is specified, the index is tuned to register less than 50000 documents. .br If .B \-xl is specified, the index is tuned to register more than 300000 documents. .br If .B \-xh is specified, the index is tuned to register more than 1000000 documents. .br If .B \-xh2 is specified, the index is tuned to register more than 5000000 documents. .br If .B \-xh3 is specified, the index is tuned to register more than 10000000 documents. .br If .B \-sv is specified, scores are stored as void. .br If .B \-si is specified, scores are stored as 32-bit integer. .br If .B \-sa is specified, scores are stored as-is and marked not to be tuned when search. .br .B -ss specifies the name of an attribute for substitute score. .br If .B \-sd is specified, the modification date of each file is recorded as an attribute. .br If .B \-cm is specified, documents whose modification date has not changed are ignored. .br .B \-cs specifies the size of cache memory by mega bytes. By default, it is 64MB. .br If .B -ncm is specified, checking availability of the virtual memory is omitted. .br .B \-kn specifies the number of keywords to be extracted. By default, keyword extraction is not performed. .br If .B \-um is specified, morphological analyzers are used for keyword extraction. .TP .B estcmd purge [\-cl] [\-no] [\-fc] [\-pc enc] [\-attr expr] db [prefix] Purge information of documents which do not exist on the file system. .br If .I prefix is specified, only documents whose URIs are begins with it. It can be specified by the local path of a directory. .br If .B \-cl is specified, regions of the deleted documents are cleaned up. .br If .B \-no is specified, operations are printed but not executed actually. .br If .B \-fc is specified, information of all target documents are deleted. .br .B \-pc specifies the encoding of file paths. By default, it is ISO-8859-1. .br .B \-attr specifies an attribute search condition. This option can be specified multiple times. .TP .B estcmd extkeys [\-no] [\-fc] [\-dfdb file] [\-ncm] [\-ni] [\-kn num] [\-um] [\-attr expr] db [prefix] Create a database of keywords extracted from documents. .br If .I prefix is specified, only documents whose URIs are begins with it. .br If .B \-no is specified, operations are printed but not executed actually. .br If .B \-fc is specified, all target documents are processed whichever they have existing records or not. .br .B \-dfdb specifies an outher database of document frequency. By default, document frequency is calculated dynamically according to the index. .br If .B -ncm is specified, checking availability of the virtual memory is omitted. .br If .B \-ni is specified, TF\-IDF tuning is omitted. .br .B \-kn specifies the number of keywords to be extracted. By default, it is 32. .br If .B \-um is specified, morphological analyzers are used for keyword extraction. .br .B \-attr specifies an attribute search condition. This option can be specified multiple times. .TP .B estcmd words [\-nl|\-nb] [\-dfdb file] [\-kw|\-kt] db Output a list of all unique words and each record size which is treated as docuemnt frequency. .br If .B \-nl is specified, the index is opened without file locking. .br If .B \-nb is specified, file locking is performed without blocking. .br .B \-dfdb specifies an outer database where the result is stored. By default, the result is output to the standard output as TSV. If the outer database already exists, the value of each record is incremented. .br If .B \-kw is specified, keywords and numbers of corresponding documents are output. .br If .B \-kt is specified, keywords and their related terms are output. .TP .B estcmd draft [\-ft|\-fh|\-fm] [\-ic enc] [\-il lang] [\-bc] [\-lt num] [\-kn num] [\-um] [file] For test and debug. .TP .B estcmd break [\-ic enc] [\-il lang] [\-apn|\-acc] [\-wt] [file] For test and debug. .TP .B estcmd iconv [\-ic enc] [\-il lang] [\-oc enc] [file] For test and debug. .TP .B estcmd regex [\-inv] [\-repl str] expr [file] For test and debug. .TP .B estcmd scandir [\-tf|\-td] [\-pa|\-pu] [dir] For test and debug. .TP .B estcmd multi [\-db db] [\-nl|\-nb] [\-ic enc] [\-gs|\-gf|\-ga] [\-cd] [\-ni] [\-sf|\-sfr|\-sfu|\-sfi] [\-hs] [\-hu] [\-attr expr] [\-ord expr] [\-max num] [\-sk num] [\-aux num] [\-dis name] [phrase] For test and debug. .TP .B estcmd randput [\-ren|\-rla|\-reu|\-ror|\-rjp|\-rch] [\-cs num] db dnum For test and debug. .TP .B estcmd wicked db dnum For test and debug. .TP .B estcmd regression db For test and debug. .TP .B estcmd version Show the version information. .PP All sub commands return 0 if the operation is success, else return 1. As for put, out, gather, purge, randput, wicked, and regression, they finish with closing the database when they catch the signal 1 (SIGHUP), 2 (SIGINT), 3 (SIGQUIT), 13 (SIGPIPE), or 15 (SIGTERM). .PP The data type of attribute indexes specified by .B \-attr option of .B create sub command should be "seq" for sequencial type, "str" for string type, or "num" for number type. .PP Each pseudo index specified by .B \-pidx option of .B search sub command and so on is a directory containing files of document draft. If you search a main index with pseudo indexes, meta search of the main index and pseudo indexes is performed. .PP The encoding name specified by .B \-ic option should be such name registered to IETF as UTF\-8, ISO\-8859\-1, and so on. The language name specified by .B \-il option should be one of "en" (English), "ja" (Japanese, "zh" (Chinese), "ko" (Korean). .PP The outer command specified by \-fx option of gather receives the path of the target document by the first argument and the path for output by the second argument. The original path of the target document is given as the value of the environment variable `ESTORIGFILE'. .PP Note that similarity search is very slow, by default. To improve the performance of similarity search, running "estcmd extkeys" beforehand is strongly recommended. .SH SEE ALSO .PP .BR estconfig (1), .BR estmaster (1), .BR estcall (1), .BR estwaver (1), .BR estraier (3), .BR estnode (3) .PP Please see .B http://hyperestraier.sourceforge.net/uguide-en.html for detail. hyperestraier-1.4.13/man/estconfig.1000066400000000000000000000034571125261632700173220ustar00rootroot00000000000000.TH ESTCONFIG 1 "2007-03-06" "Man Page" "Hyper Estraier" .SH NAME estconfig \- configuration utility of Hyper Estraier .SH SYNOPSIS .PP .B estconfig \-\-version .PP .B estconfig \-\-prefix .PP .B estconfig \-\-execprefix .PP .B estconfig \-\-headdir .PP .B estconfig \-\-libdir .PP .B estconfig \-\-bindir .PP .B estconfig \-\-libexecdir .PP .B estconfig \-\-datadir .PP .B estconfig \-\-cflags .PP .B estconfig \-\-ldflags .PP .B estconfig \-\-libs .PP .B estconfig \-\-mtlibs .SH DESCRIPTION .PP .B estconfig is useful for integration of an application or a system using Hyper Estraier. It outputs setting and configurations of Hyper Estraier. .TP .B estconfig \-\-version to output version information. .TP .B estconfig \-\-prefix to output the prefix of the destination of installation. .TP .B estconfig \-\-execprefix to output the prefix of the files depending on the platform. .TP .B estconfig \-\-headdir to output the prefix of the headers. .TP .B estconfig \-\-libdir to output the prefix of the libraries. .TP .B estconfig \-\-bindir to output the prefix of the commands. .TP .B estconfig \-\-libexecdir to output the prefix of the CGI script. .TP .B estconfig \-\-datadir to output the prefix of the configuration files. .TP .B estconfig \-\-cflags to output the compiler options to be specified when building. .TP .B estconfig \-\-ldflags to output the linker options to be specified when building. .TP .B estconfig \-\-libs to output the libraries to be specified when building. .TP .B estconfig \-\-mtlibs to output the libraries for applications with multi thread. .PP estconfig always returns 0 as the exit status. .SH SEE ALSO .PP .BR estcmd (1), .BR estmaster (1), .BR estcall (1), .BR estwaver (1), .BR estraier (3) .BR estnode (3) .PP Please see .B http://hyperestraier.sourceforge.net/pguide-en.html for detail. hyperestraier-1.4.13/man/estmaster.1000066400000000000000000000041441125261632700173420ustar00rootroot00000000000000.TH ESTMASTER 1 "2007-03-06" "Man Page" "Hyper Estraier" .SH NAME estmaster \- master process of node servers .SH SYNOPSIS .PP .B estmaster init [\-ex] rootdir .PP .B estmaster start [\-bg] [\-ro] [\-st] rootdir .PP .B estmaster stop rootdir .PP .B estmaster unittest rootdir .PP .B estmaster crypt key [hash] .SH DESCRIPTION .PP .B estmaster is an aggregation of sub commands. The name of a sub command is specified by the first argument. Other arguments are parsed according to each sub command. The argument .I rootdir specifies the server root directory which contains configuration file and so on. .TP .B estmaster init [\-ex] rootdir Create the server root directory. .br If .B \-ex is specified, some users and some nodes are set for example. By default, only a super user whose name and password are both "admin" is set. .TP .B estmaster start [\-bg] [\-ro] [\-st] rootdir Start the node master. .br If .B \-bg is specified, the server runs in background as a daemon process. .br If .B \-ro is specified, the server runs in read-only mode regardless of the configuration. .br If .B \-st is specified, the server runs in single thread mode. .TP .B estmaster stop rootdir Stop the running node master. .TP .B estmaster unittest rootdir Perform unit tests. .TP .B estmaster crypt key [hash] Output an encrypted string of a string. .br .I key specifies a target string. .br If .I hash is specified, it checks whether the key and the hash matches. .PP All sub commands return 0 if the operation is success, else return 1. A running node master finishes with closing the database when it catches the signal 1 (SIGHUP), 2 (SIGINT), 3 (SIGQUIT), or 15 (SIGTERM). Moreover, when a node master running as a daemon catches the signal 1 (SIGHUP), the process is re\-start and re\-read the configuration files. .PP A running node server should be finished by valid means by command line or via network. Otherwise, the index may be broken. .SH SEE ALSO .PP .BR estconfig (1), .BR estcmd (1), .BR estcall (1), .BR estwaver (1), .BR estraier (3), .BR estnode (3) .PP Please see .B http://hyperestraier.sourceforge.net/nguide-en.html for detail. hyperestraier-1.4.13/man/estnode.3000066400000000000000000000511711125261632700170000ustar00rootroot00000000000000.TH ESTNODE 3 "2007-03-06" "Man Page" "Hyper Estraier" .SH NAME estnode.h \- the node API of Hyper Estraier .SH SYNOPSIS .PP .B #include .br .B #include .br .B #include .br .B #include .SH API FOR INITIALIZING .PP For preparation to use the node API, initialize the network environment at the beginning of a program. Moreover, the environment should be freed at the end of the program. .PP The function `est_init_net_env' is used in order to initialize the networking environment. .TP .B int est_init_net_env(void); The return value is true if success, else it is false. As it is allowable to call this function multiple times, it is needed to call the function `est_free_net_env' at the same frequency. .PP The function `est_free_net_env' is used in order to free the networking environment. .TP .B void est_free_net_env(void); There is no parameter and no return value. .SH API FOR NODES .PP The type of the structure `ESTNODE' is for abstraction of connection to a node. A node has its own URL. No entity of `ESTNODE' is accessed directly, but it is accessed by the pointer. The term of node connection object means the pointer and its referent. A node connection object is created by the function `est_node_new' and destroyed by `est_node_delete'. Every created node connection object should be destroyed. .PP The function `est_node_new' is used in order to create a node connection object. .TP .B ESTNODE *est_node_new(const char *url); `url' specifies the URL of a node. The return value is a node connection object. .PP The function `est_node_delete' is used in order to destroy a node connection object. .TP .B void est_node_delete(ESTNODE *node); `node' specifies a node connection object. .PP The function `est_node_set_proxy' is used in order to set the proxy information of a node connection object. .TP .B void est_node_set_proxy(ESTNODE *node, const char *host, int port); `node' specifies a node connection object. `host' specifies the host name of a proxy server. `port' specifies the port number of the proxy server. .PP The function `est_node_set_timeout' is used in order to set timeout of a connection. .TP .B void est_node_set_timeout(ESTNODE *node, int sec); `node' specifies a node connection object. `sec' specifies timeout of the connection in seconds. .PP The function `est_node_set_auth' is used in order to set the authentication information of a node connection object. .TP .B void est_node_set_auth(ESTNODE *node, const char *name, const char *passwd); `node' specifies a node connection object. `name' specifies the name of authentication. `passwd' specifies the password of the authentication. .PP The function `est_node_status' is used in order to get the status code of the last request of a node. .TP .B int est_node_status(ESTNODE *node); `node' specifies a node connection object. The return value is the status code of the last request of the node. \-1 means failure of connection. .PP The function `est_node_sync' is used in order to synchronize updating contents of the database of a node. .TP .B int est_node_sync(ESTNODE *node); `node' specifies a node connection object. The return value is true if success, else it is false. .PP The function `est_node_optimize' is used in order to optimize the database of a node. .TP .B int est_node_optimize(ESTNODE *node); `node' specifies a node connection object. The return value is true if success, else it is false. .PP The function `est_node_put_doc' is used in order to add a document to a node. .TP .B int est_node_put_doc(ESTNODE *node, ESTDOC *doc); `node' specifies a node connection object. `doc' specifies a document object. The document object should have the URI attribute. The return value is true if success, else it is false. If the URI attribute is same with an existing document in the node, the existing one is deleted. .PP The function `est_node_out_doc' is used in order to remove a document from a node. .TP .B int est_node_out_doc(ESTNODE *node, int id); `node' specifies a node connection object. `id' specifies the ID number of a registered document. The return value is true if success, else it is false. .PP The function `est_node_out_doc_by_uri' is used in order to remove a document specified by URI from a node. .TP .B int est_node_out_doc_by_uri(ESTNODE *node, const char *uri); `node' specifies a node connection object. `uri' specifies the URI of a registered document. The return value is true if success, else it is false. .PP The function `est_node_edit_doc' is used in order to edit attributes of a document in a node. .TP .B int est_node_edit_doc(ESTNODE *node, ESTDOC *doc); `node' specifies a node connection object. `doc' specifies a document object. The return value is true if success, else it is false. The ID can not be changed. If the URI is changed and it overlaps the URI of another registered document, this function fails. .PP The function `est_node_get_doc' is used in order to retrieve a document in a node. .TP .B ESTDOC *est_node_get_doc(ESTNODE *node, int id); `node' specifies a node connection object. `id' specifies the ID number of a registered document. The return value is a document object. It should be deleted with `est_doc_delete' if it is no longer in use. On error, `NULL' is returned. .PP The function `est_node_get_doc_by_uri' is used in order to retrieve a document specified by URI in a node. .TP .B ESTDOC *est_node_get_doc_by_uri(ESTNODE *node, const char *uri); `node' specifies a node connection object. `uri' specifies the URI of a registered document. The return value is a document object. It should be deleted with `est_doc_delete' if it is no longer in use. On error, `NULL' is returned. .PP The function `est_node_get_doc_attr' is used in order to retrieve the value of an attribute of a document in a node. .TP .B char *est_node_get_doc_attr(ESTNODE *node, int id, const char *name); `node' specifies a node connection object. `id' specifies the ID number of a registered document. `name' specifies the name of an attribute. The return value is the value of the attribute or `NULL' if it does not exist. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. .PP The function `est_node_get_doc_attr_by_uri' is used in order to retrieve the value of an attribute of a document specified by URI in a node. .TP .B char *est_node_get_doc_attr_by_uri(ESTNODE *node, const char *uri, const char *name); `node' specifies a node connection object. `uri' specifies the URI of a registered document. `name' specifies the name of an attribute. The return value is the value of the attribute or `NULL' if it does not exist. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. .PP The function `est_node_etch_doc' is used in order to extract keywords of a document. .TP .B CBMAP *est_node_etch_doc(ESTNODE *node, int id); `node' specifies a node connection object. `id' specifies the ID number of a registered document. The return value is a new map object of keywords and their scores in decimal string or `NULL' on error. Because the object of the return value is opened with the function `cbmapopen', it should be closed with the function `cbmapclose' if it is no longer in use. .PP The function `est_node_etch_doc_by_uri' is used in order to extract keywords of a document specified by URI in a node. .TP .B CBMAP *est_node_etch_doc_by_uri(ESTNODE *node, const char *uri); `node' specifies a node connection object. `uri' specifies the URI of a registered document. The return value is a new map object of keywords and their scores in decimal string or `NULL' on error. Because the object of the return value is opened with the function `cbmapopen', it should be closed with the function `cbmapclose' if it is no longer in use. .PP The function `est_node_uri_to_id' is used in order to get the ID of a document specified by URI. .TP .B int est_node_uri_to_id(ESTNODE *node, const char *uri); `node' specifies a node connection object. `uri' specifies the URI of a registered document. The return value is the ID of the document. On error, \-1 is returned. .PP The function `est_node_name' is used in order to get the name of a node. .TP .B const char *est_node_name(ESTNODE *node); `node' specifies a node connection object. The return value is the name of the node. On error, `NULL' is returned. The life duration of the returned string is synchronous with the one of the node object. .PP The function `est_node_label' is used in order to get the label of a node. .TP .B const char *est_node_label(ESTNODE *node); `node' specifies a node connection object. The return value is the label of the node. On error, `NULL' is returned. The life duration of the returned string is synchronous with the one of the node object. .PP The function `est_node_doc_num' is used in order to get the number of documents in a node. .TP .B int est_node_doc_num(ESTNODE *node); `node' specifies a node connection object. The return value is the number of documents in the node. On error, \-1 is returned. .PP The function `est_node_word_num' is used in order to get the number of unique words in a node. .TP .B int est_node_word_num(ESTNODE *node); `node' specifies a node connection object. The return value is the number of unique words in the node. On error, \-1 is returned. .PP The function `est_node_size' is used in order to get the size of the database of a node. .TP .B double est_node_size(ESTNODE *node); `node' specifies a node connection object. The return value is the size of the database of the node. On error, \-1.0 is returned. .PP The function `est_node_cache_usage' is used in order to get the usage ratio of the cache of a node. .TP .B double est_node_cache_usage(ESTNODE *node); `node' specifies a node connection object. The return value is the usage ratio of the cache of the node. On error, \-1.0 is returned. .PP The function `est_node_admins' is used in order to get a list of names of administrators of a node. .TP .B const CBLIST *est_node_admins(ESTNODE *node); `node' specifies a node connection object. The return value is a list object of names of administrators. On error, `NULL' is returned. The life duration of the returned object is synchronous with the one of the node object. .PP The function `est_node_users' is used in order to get a list of names of users of a node. .TP .B const CBLIST *est_node_users(ESTNODE *node); `node' specifies a node connection object. The return value is a list object of names of users. On error, `NULL' is returned. The life duration of the returned object is synchronous with the one of the node object. .PP The function `est_node_links' is used in order to get a list of expressions of links of a node. .TP .B const CBLIST *est_node_links(ESTNODE *node); `node' specifies a node connection object. The return value is a list object of expressions of links. Each element is a TSV string and has three fields of the URL, the label, and the score. On error, `NULL' is returned. The life duration of the returned object is synchronous with the one of the node object. .PP The function `est_node_search' is used in order to search a node for documents corresponding a condition. .TP .B ESTNODERES *est_node_search(ESTNODE *node, ESTCOND *cond, int depth); `node' specifies a node connection object. `cond' specifies a condition object. `depth' specifies the depth of meta search. The return value is a node result object. It should be deleted with `est_noderes_delete' if it is no longer in use. On error, `NULL' is returned. .PP The function `est_node_set_snippet_width' is used in order to set width of snippet in the result from a node. .TP .B void est_node_set_snippet_width(ESTNODE *node, int wwidth, int hwidth, int awidth); `node' specifies a node connection object. `wwidth' specifies whole width of a snippet. By default, it is 480. If it is 0, no snippet is sent. If it is negative, whole body text is sent instead of snippet. `hwidth' specifies width of strings picked up from the beginning of the text. By default, it is 96. If it is negative 0, the current setting is not changed. `awidth' specifies width of strings picked up around each highlighted word. By default, it is 96. If it is negative, the current setting is not changed. .PP The function `est_node_set_user' is used in order to manage a user account of a node. .TP .B int est_node_set_user(ESTNODE *node, const char *name, int mode); `node' specifies a node connection object. `name' specifies the name of a user. `mode' specifies the operation mode. 0 means to delete the account. 1 means to set the account as an administrator. 2 means to set the account as a guest. The return value is true if success, else it is false. .PP The function `est_node_set_link' is used in order to manage a link of a node. .TP .B int est_node_set_link(ESTNODE *node, const char *url, const char *label, int credit); `node' specifies a node connection object. `url' specifies the URL of the target node of a link. `label' specifies the label of the link. `credit' specifies the credit of the link. If it is negative, the link is removed. The return value is true if success, else it is false. .SH API FOR SEARCH RESULTS OF NODES .PP The type of the structure `ESTNODERES' is for abstraction of search result from a node. A result is composed of a list of corresponding documents and information of hints. No entity of `ESTNODERES' is accessed directly, but it is accessed by the pointer. The term of node result object means the pointer and its referent. A node result object is created by the function `est_node_search' and destroyed by `est_noderes_delete'. Every created node connection object should be destroyed. .PP The type of the structure `ESTRESDOC' is for abstraction of a document in search result. A result document is composed of some attributes and a snippet. No entity of `ESTRESDOC' is accessed directly, but it is accessed by the pointer. The term of result document object means the pointer and its referent. A result document object is gotten by the function `est_noderes_get_doc' but it should not be destroyed because the entity is managed inside the node result object. .PP The function `est_noderes_delete' is used in order to delete a node result object. .TP .B void est_noderes_delete(ESTNODERES *nres); `nres' specifies a node result object. .PP The function `est_noderes_hints' is used in order to get a map object for hints of a node result object. .TP .B CBMAP *est_noderes_hints(ESTNODERES *nres); `nres' specifies a node result object. The return value is a map object for hints. Keys of the map are "VERSION", "NODE", "HIT", "HINT#n", "DOCNUM", "WORDNUM", "TIME", "TIME#n", "LINK#n", and "VIEW". The life duration of the returned object is synchronous with the one of the node result object. .PP The function `est_noderes_eclipse' is used in order to eclipse similar documents of a node result object. .TP .B void est_noderes_eclipse(ESTNODERES *nres, int num, double limit); `nres' specifies a node result object. `num' specifies the number of documents to be shown. If it is not more than 0, eclipse is undone. `limit' specifies the lower limit of similarity for documents to be eclipsed. Similarity is between 0.0 and 1.0. .PP The function `est_noderes_doc_num' is used in order to get the number of documents in a node result object. .TP .B int est_noderes_doc_num(ESTNODERES *nres); `nres' specifies a node result object. The return value is the number of documents in a node result object. .PP The function `est_noderes_get_doc' is used in order to refer a result document object in a node result object. .TP .B ESTRESDOC *est_noderes_get_doc(ESTNODERES *nres, int index); `nres' specifies a node result object. `index' specifies the index of a document. The return value is a result document object or `NULL' if `index' is equal to or more than the number of documents. The life duration of the returned object is synchronous with the one of the node result object. .PP The function `est_resdoc_uri' is used in order to get the URI of a result document object. .TP .B const char *est_resdoc_uri(ESTRESDOC *rdoc); `rdoc' specifies a result document object. The return value is the URI of the result document object. The life duration of the returned string is synchronous with the one of the result document object. .PP The function `est_resdoc_attr_names' is used in order to get a list of attribute names of a result document object. .TP .B CBLIST *est_resdoc_attr_names(ESTRESDOC *rdoc); `rdoc' specifies a result document object. The return value is a new list object of attribute names of the result document object. Because the object of the return value is opened with the function `cblistopen', it should be closed with the function `cblistclose' if it is no longer in use. .PP The function `est_resdoc_attr' is used in order to get the value of an attribute of a result document object. .TP .B const char *est_resdoc_attr(ESTRESDOC *rdoc, const char *name); `rdoc' specifies a result document object. `name' specifies the name of an attribute. The return value is the value of the attribute or `NULL' if it does not exist. The life duration of the returned string is synchronous with the one of the result document object. .PP The function `est_resdoc_snippet' is used in order to get the snippet of a result document object. .TP .B const char *est_resdoc_snippet(ESTRESDOC *rdoc); `rdoc' specifies a result document object. The return value is a string of the snippet of the result document object. There are tab separated values. Each line is a string to be shown. Though most lines have only one field, some lines have two fields. If the second field exists, the first field is to be shown with highlighted, and the second field means its normalized form. The life duration of the returned string is synchronous with the one of the result document object. .PP The function `est_resdoc_keywords' is used in order to get keywords of a result document object. .TP .B const char *est_resdoc_keywords(ESTRESDOC *rdoc); `rdoc' specifies a result document object. The return value is a string of serialized keywords of the result document object. There are tab separated values. Keywords and their scores come alternately. The life duration of the returned string is synchronous with the one of the result document object. .PP The function `est_resdoc_shadows' is used in order to get an array of documents eclipsed by a result document object. .TP .B ESTRESDOC **est_resdoc_shadows(ESTRESDOC *rdoc, int *np); `rdoc' specifies a result document object. `np' specifies the pointer to a variable to which the number of elements of the return value is assigned. The return value is an array of eclipsed result document objects. The life duration of the returned array and its elements is synchronous with the one of the result document object. .PP The function `est_resdoc_similarity' is used in order to get similarity of an eclipsed result document object. .TP .B double est_resdoc_similarity(ESTRESDOC *rdoc); `rdoc' specifies a result document object. The return value is similarity of the result document object to the front document or \-1.0 if it is not eclipsed. .SH PARALLELING .PP Each of node connection objects, node result objects, and result document objects can not be shared by threads. If you use multi threads, make each thread have its own objects. If the precondition is kept, functions of the node API can be treated as thread\-safe functions. .SH AUTHOR .PP Hyper Estraier is written by Mikio Hirabayashi. You can contact the author by e\-mail to . Any suggestion or bug report is welcome to the author. .SH ACKNOWLEDGEMENTS Hyper Estraier was developed under management by Fumitoshi Ukai and supports by Exploratory Software Project of Information\-technology Promotion Agency, Japan (IPA). .SH COPYRIGHT .PP Copyright (C) 2004\-2007 Mikio Hirabayashi .PP Hyper Estraier 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 of the License, or any later version. .PP Hyper Estraier 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. .PP You should have received a copy of the GNU Lesser General Public License along with Hyper Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111\-1307 USA. .SH SEE ALSO .PP .BR estconfig (1), .BR estcmd (1), .BR estmaster (1), .BR estcall (1), .BR estwaver (1), .BR cabin (3), .BR estraier (3) .PP Please see .B http://hyperestraier.sourceforge.net/nguide-en.html for detail. hyperestraier-1.4.13/man/estraier.3000066400000000000000000000651521125261632700171610ustar00rootroot00000000000000.TH ESTRAIER 3 "2007-03-06" "Man Page" "Hyper Estraier" .SH NAME estraier.h \- the core API of Hyper Estraier .SH SYNOPSIS .PP .B #include .br .B #include .br .B #include .SH API FOR DOCUMENT .PP The API for documents aims to handle documents which were registered into the index. .PP The type of the structure `ESTDOC' is for abstraction of a document. A document is composed of some attributes and some text sentences. No entity of `ESTDOC' is accessed directly, but it is accessed by the pointer. The term of document object means the pointer and its referent. A document object is created by the function `est_doc_new' and destroyed by `est_doc_delete'. Every created document object should be destroyed. .PP Target documents of search are to be registered in the database beforehand. The ID is assigned to each registered document. When search, they can be retrieved from the database by their ID. The encoding of attributes and text sentences should be UTF\-8. .PP The function `est_doc_new' is used in order to create a document object. .TP .B ESTDOC *est_doc_new(void); The return value is an object of a document. .PP The function `est_doc_new_from_draft' is used in order to create a document object made from draft data. .TP .B ESTDOC *est_doc_new_from_draft(const char *draft); `draft' specifies a string of draft data. The return value is an object of a document. .PP The function `est_doc_delete' is used in order to destroy a document object. .TP .B void est_doc_delete(ESTDOC *doc); `doc' specifies a document object. .PP The function `est_doc_add_attr' is used in order to add an attribute to a document object. .TP .B void est_doc_add_attr(ESTDOC *doc, const char *name, const char *value); `doc' specifies a document object. `name' specifies the name of an attribute. `value' specifies the value of the attribute. If it is `NULL', the attribute is removed. .PP The function `est_doc_add_text' is used in order to add a sentence of text to a document object. .TP .B void est_doc_add_text(ESTDOC *doc, const char *text); `doc' specifies a document object. `text' specifies a sentence of text. .PP The function `est_doc_add_hidden_text' is used in order to add a hidden sentence to a document object. .TP .B void est_doc_add_hidden_text(ESTDOC *doc, const char *text); `doc' specifies a document object. `text' specifies a hidden sentence. .PP The function `est_doc_set_keywords' is used in order to attach keywords to a document object. .TP .B void est_doc_set_keywords(ESTDOC *doc, CBMAP *kwords); `doc' specifies a document object. `kwords' specifies a map object of keywords. Keys of the map should be keywords of the document and values should be their scores in decimal string. The map object is copied internally. .PP The function `est_doc_set_score' is used in order to set the substitute score of a document object. .TP .B void est_doc_set_score(ESTDOC *doc, int score); `doc' specifies a document object. `score' specifies the substitute score. It it is negative, the substitute score setting is nullified. .PP The function `est_doc_id' is used in order to get the ID number of a document object. .TP .B int est_doc_id(ESTDOC *doc); `doc' specifies a document object. The return value is the ID number of the document object. If the object has not been registered, \-1 is returned. .PP The function `est_doc_attr_names' is used in order to get a list of attribute names of a document object. .TP .B CBLIST *est_doc_attr_names(ESTDOC *doc); `doc' specifies a document object. The return value is a new list object of attribute names of the document object. Because the object of the return value is opened with the function `cblistopen', it should be closed with the function `cblistclose' if it is no longer in use. .PP The function `est_doc_attr' is used in order to get the value of an attribute of a document object. .TP .B const char *est_doc_attr(ESTDOC *doc, const char *name); `doc' specifies a document object. `name' specifies the name of an attribute. The return value is the value of the attribute or `NULL' if it does not exist. The life duration of the returned string is synchronous with the one of the document object. .PP The function `est_doc_texts' is used in order to get a list of sentences of the text of a document object. .TP .B const CBLIST *est_doc_texts(ESTDOC *doc); `doc' specifies a document object. The return value is a list object of sentences of the text of the document object. The life duration of the returned object is synchronous with the one of the document object. .PP The function `est_doc_cat_texts' is used in order to concatenate sentences of the text of a document object. .TP .B char *est_doc_cat_texts(ESTDOC *doc); `doc' specifies a document object. The return value is concatenated sentences of the document object. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. .PP The function `est_doc_keywords' is used in order to get attached keywords of a document object. .TP .B CBMAP *est_doc_keywords(ESTDOC *doc); `doc' specifies a document object. The return value is a map object of keywords and their scores in decimal string. If no keyword is attached, `NULL' is returned. The life duration of the returned object is synchronous with the one of the document object. .PP The function `est_doc_dump_draft' is used in order to dump draft data of a document object. .TP .B char *est_doc_dump_draft(ESTDOC *doc); `doc' specifies a document object. The return value is draft data of the document object. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. .PP The function `est_doc_make_snippet' is used in order to make a snippet of the body text of a document object. .TP .B char *est_doc_make_snippet(ESTDOC *doc, const CBLIST *words, int wwidth, int hwidth, int awidth); `doc' specifies a document object. `word' specifies a list object of words to be highlight. `wwidth' specifies whole width of the result. `hwidth' specifies width of strings picked up from the beginning of the text. `awidth' specifies width of strings picked up around each highlighted word. The return value is a snippet string of the body text of the document object. There are tab separated values. Each line is a string to be shown. Though most lines have only one field, some lines have two fields. If the second field exists, the first field is to be shown with highlighted, and the second field means its normalized form. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. .SH API FOR SEARCH CONDITIONS .PP The API for search conditions aims to specify search conditions given to the index. .PP The type of the structure `ESTCOND' is for abstraction of search conditions. A unit of search conditions is composed of one search phrase, some attribute expressions, and one order expression. No entity of `ESTCOND' is accessed directly, but it is accessed by the pointer. The term of condition object means the pointer and its referent. A condition object is created by the function `est_cond_new' and destroyed by `est_cond_delete'. Every created condition object should be destroyed. .PP Condition objects are used as a parameter to search for documents registered in the database so that a list of IDs of corresponding documents are returned. See the manual for the formats of expressions. The encoding of conditional expressions should be UTF\-8. .PP The function `est_cond_new' is used in order to create a condition object. .TP .B ESTCOND *est_cond_new(void); The return value is an object of search conditions. .PP The function `est_cond_delete' is used in order to destroy a condition object. .TP .B void est_cond_delete(ESTCOND *cond); `cond' specifies a condition object. .PP The function `est_cond_set_phrase' is used in order to set the search phrase to a condition object. .TP .B void est_cond_set_phrase(ESTCOND *cond, const char *phrase); `cond' specifies a condition object. `phrase' specifies a search phrase. .PP The function `est_cond_add_attr' is used in order to add an expression for an attribute to a condition object. .TP .B void est_cond_add_attr(ESTCOND *cond, const char *expr); `cond' specifies a condition object. `expr' specifies an expression for an attribute. .PP The function `est_cond_set_order' is used in order to set the order of a condition object. .TP .B void est_cond_set_order(ESTCOND *cond, const char *expr); `cond' specifies a condition object. `expr' specifies an expression for the order. By default, the order is by score descending. .PP The function `est_cond_set_max' is used in order to set the maximum number of retrieval of a condition object. .TP .B void est_cond_set_max(ESTCOND *cond, int max); `cond' specifies a condition object. `max' specifies the maximum number of retrieval. By default, the number of retrieval is not limited. .PP The function `est_cond_set_skip' is used in order to set the number of skipped documents of a condition object. .TP .B void est_cond_set_skip(ESTCOND *cond, int skip); `cond' specifies a condition object. `skip' specifies the number of documents to be skipped in the search result. .PP The function `est_cond_set_options' is used in order to set options of retrieval of a condition object. .TP .B void est_cond_set_options(ESTCOND *cond, int options); `cond' specifies a condition object. `options' specifies options: `ESTCONDSURE' specifies that it checks every N\-gram key, `ESTCONDUSUAL', which is the default, specifies that it checks N\-gram keys with skipping one key, `ESTCONDFAST' skips two keys, `ESTCONDAGITO' skips three keys, `ESTCONDNOIDF' specifies not to perform TF\-IDF tuning, `ESTCONDSIMPLE' specifies to use simplified phrase, `ESTCONDROUGH' specifies to use rustic phrase, `ESTCONDUNION' specifies to use union phrase, `ESTCONDISECT' specifies to use intersection phrase, `ESTCONDSCFB' specifies to feed back scores (only for debugging). Each option can be specified at the same time by bitwise or. If keys are skipped, though search speed is improved, the relevance ratio grows less. .PP The function `est_cond_set_auxiliary' is used in order to set permission to adopt result of the auxiliary index. .TP .B void est_cond_set_auxiliary(ESTCOND *cond, int min); `cond' specifies a condition object. `min' specifies the minimum hits to adopt result of the auxiliary index. If it is not more than 0, the auxiliary index is not used. By default, it is 32. .PP The function `est_cond_set_eclipse' is used in order to set the lower limit of similarity eclipse. .TP .B void est_cond_set_eclipse(ESTCOND *cond, double limit); `cond' specifies a condition object. `limit' specifies the lower limit of similarity for documents to be eclipsed. Similarity is between 0.0 and 1.0. If the limit is added by `ESTECLSIMURL', similarity is weighted by URL. If the limit is `ESTECLSERV', similarity is ignored and documents in the same server are eclipsed. If the limit is `ESTECLDIR', similarity is ignored and documents in the same directory are eclipsed. If the limit is `ESTECLFILE', similarity is ignored and documents of the same file are eclipsed. .PP The function `est_cond_set_distinct' is used in order to set the attribute distinction filter. .TP .B void est_cond_set_distinct(ESTCOND *cond, const char *name); `cond' specifies a condition object. `name' specifies the name of an attribute to be distinct. If this filter is set, candidates which have same value of the attribute is omitted. .PP The function `est_set_cond_mask' is used in order to set the mask of targets of meta search. .TP .B void est_cond_set_mask(ESTCOND *cond, int mask); `cond' specifies a condition object. `mask' specifies a masking number. 1 means the first target, 2 means the second target, 4 means the third target, and power values of 2 and their summation compose the mask. .SH API FOR DATABASE .PP The API for database aims to handle the database of the index. .PP The type of the structure `ESTDB' is for abstraction of access methods to database. A database has inverted index, document data, and meta data. One of writer or reader is selected when the connection is established. No entity of `ESTDB' is accessed directly, but it is accessed by the pointer. The term of database object means the pointer and its referent. A database object is created by the function `est_db_open' and destroyed by `est_db_close'. Every created database object should be destroyed. .PP Errors with some operations are informed to by the function `est_db_error'. The meaning of each error code can be gotten as a string by the function `est_err_msg'. .PP The following constant are defined for error codes. .PP The function `est_err_msg' is used in order to get the string of an error code. .TP .B const char *est_err_msg(int ecode); `ecode' specifies an error code. The return value is the string of the error code. .PP The function `est_db_open' is used in order to open a database. .TP .B ESTDB *est_db_open(const char *name, int omode, int *ecp); `name' specifies the name of a database directory. `omode' specifies open modes: `ESTDBWRITER' as a writer, `ESTDBREADER' as a reader. If the mode is `ESTDBWRITER', the following may be added by bitwise or: `ESTDBCREAT', which means it creates a new database if not exist, `ESTDBTRUNC', which means it creates a new database regardless if one exists. Both of `ESTDBREADER' and `ESTDBWRITER' can be added to by bitwise or: `ESTDBNOLCK', which means it opens a database file without file locking, or `ESTDBLCKNB', which means locking is performed without blocking. If `ESTDBNOLCK' is used, the application is responsible for exclusion control. `ESTDBCREAT' can be added to by bitwise or: `ESTDBPERFNG', which means N\-gram analysis is performed against European text also, `ESTDBCHRCAT', which means character category analysis is performed instead of N\-gram analysis, `ESTDBSMALL', which means the index is tuned to register less than 50000 documents, `ESTDBLARGE', which means the index is tuned to register more than 300000 documents, `ESTDBHUGE', which means the index is tuned to register more than 1000000 documents, `ESTDBHUGE2', which means the index is tuned to register more than 5000000 documents, `ESTDBHUGE3', which means the index is tuned to register more than 10000000 documents, `ESTDBSCVOID', which means scores are stored as void, `ESTDBSCINT', which means scores are stored as 32-bit integer, `ESTDBSCASIS', which means scores are stored as-is and marked not to be tuned when search. `ecp' specifies the pointer to a variable to which the error code is assigned. The return value is a database object of the database or `NULL' if failure. .PP The function `est_db_close' is used in order to close a database. .TP .B int est_db_close(ESTDB *db, int *ecp); `db' specifies a database object. `ecp' specifies the pointer to a variable to which the error code is assigned. The return value is true if success, else it is false. .PP The function `est_db_error' is used in order to get the last happened error code of a database. .TP .B int est_db_error(ESTDB *db); `db' specifies a database object. The return value is the last happened error code of the database. .PP The function `est_db_fatal' is used in order to check whether a database has a fatal error. .TP .B int est_db_fatal(ESTDB *db); `db' specifies a database object. The return value is true if the database has fatal error, else it is false. .PP The function `est_db_add_attr_index' is used in order to add an index for narrowing or sorting with document attributes. .TP .B int est_db_add_attr_index(ESTDB *db, const char *name, int type); `db' specifies a database object connected as a writer. `name' specifies the name of an attribute. `type' specifies the data type of attribute index; `ESTIDXATTRSEQ' for multipurpose sequencial access method, `ESTIDXATTRSTR' for narrowing with attributes as strings, `ESTIDXATTRNUM' for narrowing with attributes as numbers. The return value is true if success, else it is false. Note that this function should be called before the first document is registered. .PP The function `est_db_flush' is used in order to flush index words in the cache of a database. .TP .B int est_db_flush(ESTDB *db, int max); `db' specifies a database object connected as a writer. `max' specifies the maximum number of words to be flushed. If it not more than zero, all words are flushed. The return value is true if success, else it is false. .PP The function `est_db_sync' is used in order to synchronize updating contents of a database. .TP .B int est_db_sync(ESTDB *db); `db' specifies a database object connected as a writer. The return value is true if success, else it is false. .PP The function `est_db_optimize' is used in order to optimize a database. .TP .B int est_db_optimize(ESTDB *db, int options); `db' specifies a database object connected as a writer. `options' specifies options: `ESTOPTNOPURGE' to omit purging dispensable region of deleted documents, `ESTOPTNODBOPT' to omit optimization of the database files. The three can be specified at the same time by bitwise or. The return value is true if success, else it is false. .PP The function `est_db_merge' is used in order to merge another database. .TP .B int est_db_merge(ESTDB *db, const char *name, int options); `db' specifies a database object connected as a writer. `name' specifies the name of another database directory. `options' specifies options: `ESTMGCLEAN' to clean up dispensable regions of the deleted document. The return value is true if success, else it is false. Creation options of the two databases should be same entirely. ID numbers of imported documents are changed within the sequence of the desitination database. If URIs of imported documents conflict ones of exsisting documents, existing documents are removed. .PP The function `est_db_put_doc' is used in order to add a document to a database. .TP .B int est_db_put_doc(ESTDB *db, ESTDOC *doc, int options); `db' specifies a database object connected as a writer. `doc' specifies a document object. The document object should have the URI attribute. `options' specifies options: `ESTPDCLEAN' to clean up dispensable regions of the overwritten document, `ESTPDWEIGHT' to weight scores statically with score weighting attribute. The return value is true if success, else it is false. If the URI attribute is same with an existing document in the database, the existing one is deleted. .PP The function `est_db_out_doc' is used in order to remove a document from a database. .TP .B int est_db_out_doc(ESTDB *db, int id, int options); `db' specifies a database object connected as a writer. `id' specifies the ID number of a registered document. `options' specifies options: `ESTODCLEAN' to clean up dispensable regions of the deleted document. The return value is true if success, else it is false. .PP The function `est_db_edit_doc' is used in order to edit attributes of a document in a database. .TP .B int est_db_edit_doc(ESTDB *db, ESTDOC *doc); `db' specifies a database object connected as a writer. `doc' specifies a document object. The return value is true if success, else it is false. The ID can not be changed. If the URI is changed and it overlaps the URI of another registered document, this function fails. .PP The function `est_db_get_doc' is used in order to retrieve a document in a database. .TP .B ESTDOC *est_db_get_doc(ESTDB *db, int id, int options); `db' specifies a database object. `id' specifies the ID number of a registered document. `options' specifies options: `ESTGDNOATTR' to ignore attributes, `ESTGDNOTEXT' to ignore the body text, `ESTGDNOKWD' to ignore keywords. The two can be specified at the same time by bitwise or. The return value is a document object. It should be deleted with `est_doc_delete' if it is no longer in use. On error, `NULL' is returned. .PP The function `est_db_get_doc_attr' is used in order to retrieve the value of an attribute of a document in a database. .TP .B char *est_db_get_doc_attr(ESTDB *db, int id, const char *name); `db' specifies a database object. `id' specifies the ID number of a registered document. `name' specifies the name of an attribute. The return value is the value of the attribute or `NULL' if it does not exist. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. .PP The function `est_db_uri_to_id' is used in order to get the ID of a document specified by URI. .TP .B int est_db_uri_to_id(ESTDB *db, const char *uri); `db' specifies a database object. `uri' specifies the URI of a registered document. The return value is the ID of the document. On error, \-1 is returned. .PP The function `est_db_name' is used in order to get the name of a database. .TP .B const char *est_db_name(ESTDB *db); `db' specifies a database object. The return value is the name of the database. The life duration of the returned string is synchronous with the one of the database object. .PP The function `est_db_doc_num' is used in order to get the number of documents in a database. .TP .B int est_db_doc_num(ESTDB *db); `db' specifies a database object. The return value is the number of documents in the database. .PP The function `est_db_word_num' is used in order to get the number of unique words in a database. .TP .B int est_db_word_num(ESTDB *db); `db' specifies a database object. The return value is the number of unique words in the database. .PP The function `est_db_size' is used in order to get the size of a database. .TP .B double est_db_size(ESTDB *db); `db' specifies a database object. The return value is the size of the database. .PP The function `est_db_search' is used in order to search a database for documents corresponding a condition. .TP .B int *est_db_search(ESTDB *db, ESTCOND *cond, int *nump, CBMAP *hints); `db' specifies a database object. `cond' specifies a condition object. `nump' specifies the pointer to a variable to which the number of elements in the result is assigned. `hints' specifies a map object into which the number of documents corresponding to each word is stored. If a word is in a negative condition, the number is negative. The element whose key is an empty string specifies the number of whole result. If it is `NULL', it is not used. The return value is an array whose elements are ID numbers of corresponding documents. This function does never fail. Even if no document corresponds or an error occurs, an empty array is returned. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. .PP Search plural databases for documents corresponding a condition. .TP .B int *est_db_search_meta(ESTDB **dbs, int dbnum, ESTCOND *cond, int *nump, CBMAP *hints); `dbs' specifies an array whose elements are database objects. `dbnum' specifies the number of elements of the array. `cond' specifies a condition object. `nump' specifies the pointer to a variable to which the number of elements in the result is assigned. `hints' specifies a map object into which the number of documents corresponding to each word is stored. If a word is in a negative condition, the number is negative. The element whose key is an empty string specifies the number of whole result. If it is `NULL', it is not used. The return value is an array whose elements are indexes of container databases and ID numbers of in each database alternately. This function does never fail. Even if no document corresponds or an error occurs, an empty array is returned. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. .PP The function `est_db_scan_doc' is used in order to check whether a document object matches the phrase of a search condition object definitely. .TP .B int est_db_scan_doc(ESTDB *db, ESTDOC *doc, ESTCOND *cond); `db' specifies a database object. `doc' specifies a document object. `cond' specifies a search condition object. The return value is true if the document matches the phrase of the condition object definitely, else it is false. .PP The function `est_db_set_cache_size' is used in order to set the maximum size of the cache memory of a database. .TP .B void est_db_set_cache_size(ESTDB *db, size_t size, int anum, int tnum, int rnum); `db' specifies a database object. `size' specifies the maximum size of the index cache. By default, it is 64MB. If it is negative, the current size is not changed. `anum' specifies the maximum number of cached records for document attributes. By default, it is 8192. If it is negative, the current size is not changed. `tnum' specifies the maximum number of cached records for document texts. By default, it is 1024. If it is negative, the current size is not changed. `rnum' specifies the maximum number of cached records for occurrence results. By default, it is 256. If it is negative, the current size is not changed. .SH PARALLELING .PP Databases of Hyper Estraier are protected by file locking. While a writer is connected to a database, neither readers nor writers can be connected. While a reader is connected to a database, other readers can be connect, but writers can not. .PP If you use multi thread, it is suggested to use the MT\-safe API of Hyper Estraier. It is a wrapper to make the core API thread\-safe. As the MT\-safe API provides the same functions as with the core API, the following is different. .SH AUTHOR .PP Hyper Estraier is written by Mikio Hirabayashi. You can contact the author by e\-mail to . Any suggestion or bug report is welcome to the author. .SH ACKNOWLEDGEMENTS Hyper Estraier was developed under management by Fumitoshi Ukai and supports by Exploratory Software Project of Information\-technology Promotion Agency, Japan (IPA). .SH COPYRIGHT .PP Copyright (C) 2004\-2007 Mikio Hirabayashi .PP Hyper Estraier 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 of the License, or any later version. .PP Hyper Estraier 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. .PP You should have received a copy of the GNU Lesser General Public License along with Hyper Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111\-1307 USA. .SH SEE ALSO .PP .BR estconfig (1), .BR estcmd (1), .BR estmaster (1), .BR estcall (1), .BR estwaver (1), .BR cabin (3), .BR estnode (3) .PP Please see .B http://hyperestraier.sourceforge.net/pguide-en.html for detail. hyperestraier-1.4.13/man/estwaver.1000066400000000000000000000051221125261632700171700ustar00rootroot00000000000000.TH ESTWAVER 3 "2007-03-06" "Man Page" "Hyper Estraier" .SH NAME estwaver \- command line interface of web crawler .SH SYNOPSIS .PP .B estwaver init [\-apn|\-acc] [\-xs|\-xl|\-xh] [\-sv|\-si|\-sa] rootdir .PP .B estwaver crawl [\-restart|\-revisit|\-revcont] rootdir .PP .B estwaver unittest rootdir .PP .B estwaver fetch [\-proxy hostr port] [\-tout num] [\-il lang] url .SH DESCRIPTION .PP .B estwaver is an aggregation of sub commands. The name of a sub command is specified by the first argument. Other arguments are parsed according to each sub command. The argument .I rootdir specifies the crawler root directory which contains configuration file and so on. .TP .B estwaver init [\-apn|\-acc] [\-xs|\-xl|\-xh] [\-sv|\-si|\-sa] rootdir Create the crawler root directory. .br If .B \-apn is specified, N\-gram analysis is performed against European text also. .br If .B \-acc is specified, character category analysis is performed instead of N\-gram analysis. .br If .B \-xs is specified, the index is tuned to register less than 50000 documents. .br If .B \-xl is specified, the index is tuned to register more than 300000 documents. .br If .B \-xh is specified, the index is tuned to register more than 1000000 documents. .br If .B \-sv is specified, scores are stored as void. .br If .B \-si is specified, scores are stored as 32\-bit integer. .br If .B \-sa is specified, scores are stored as\-is and marked not to be tuned when search. .TP .B estwaver crawl [\-restart|\-revisit|\-revcont] rootdir Start crawling. .br If .B \-restart is specified, crawling is restarted from the seed documents. .br If .B \-revisit is specified, collected documents are revisited. .br If .B \-revcont is specified, collected documents are revisited and then crawling is continued. .TP .B estwaver unittest rootdir Perform unit tests. .TP .B estwaver fetch [\-proxy hostr port] [\-tout num] [\-il lang] url Fetch a document. .br .I url specifies the URL of a document. .br .B \-proxy specifies the host name and the port number of the proxy server. .br .B \-tout specifies timeout in seconds. .br .B \-il specifies the preferred language. By default, it is English. .PP All sub commands return 0 if the operation is success, else return 1. A running crawler finishes with closing the database when it catches the signal 1 (SIGHUP), 2 (SIGINT), 3 (SIGQUIT), or 15 (SIGTERM). .PP When crawling finishes, there is a directory .B _index in the crawler root directory. It is an index available by .B estcmd and so on. .SH SEE ALSO .PP .BR estconfig (1), .BR estcmd (1), .BR estmaster (1), .BR estcall (1), .BR estraier (3), .BR estnode (3) hyperestraier-1.4.13/man/htmltoman000077500000000000000000000003741125261632700172030ustar00rootroot00000000000000#! /bin/sh # man generator from HTML egrep '^(
    |
    |

    )' | sed -e 's/@/__at__/g' -e 's//.TP@.B /' -e 's/

    /.PP@/' \ -e 's/<[^>]*>//g' -e 's/<//g' -e 's/&/\&/g' -e 's/-/\\-/g' | tr '@' '\n' | sed -e 's/__at__/@/g' hyperestraier-1.4.13/mastermod.c000066400000000000000000001132761125261632700166440ustar00rootroot00000000000000/************************************************************************************************* * Implementation of mastermod * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #include "mastermod.h" /* private function prototypes */ static void log_close(void); static void db_informer(const char *message, void *opaque); static int resdoc_compare_by_score(const void *ap, const void *bp); static int resdoc_compare_by_str_asc(const void *ap, const void *bp); static int resdoc_compare_by_str_desc(const void *ap, const void *bp); static int resdoc_compare_by_num_asc(const void *ap, const void *bp); static int resdoc_compare_by_num_desc(const void *ap, const void *bp); /************************************************************************************************* * pseudo API *************************************************************************************************/ /* The handles of the log file. */ FILE *log_fp = NULL; /* Level of logging. */ int log_level = LL_INFO; /* Open the log file. */ int log_open(const char *rootdir, const char *path, int level, int trunc){ char mypath[URIBUFSIZ]; assert(rootdir && path); log_level = level; if(log_fp) return TRUE; if((ESTPATHCHR == '/' && path[0] == ESTPATHCHR) || (ESTPATHCHR == '\\' && ((path[0] >= 'A' && path[0] <= 'Z') || (path[0] >= 'a' && path[0] <= 'z')) && path[1] == ':' && path[2] == '\\')){ sprintf(mypath, "%s", path); } else { sprintf(mypath, "%s%c%s", rootdir, ESTPATHCHR, path); } if(!(log_fp = fopen(mypath, trunc ? "wb" : "ab"))) return FALSE; if(level == LL_CHECK){ fclose(log_fp); log_fp = NULL; return TRUE; } atexit(log_close); return TRUE; } /* Print formatted string into the log file. */ void log_print(int level, const char *format, ...){ static pthread_mutex_t mymutex = PTHREAD_MUTEX_INITIALIZER; va_list ap, aq; const char *lvstr; char *date; if(level < log_level) return; if(pthread_mutex_lock(&mymutex) != 0) return; va_start(ap, format); est_va_copy(aq, ap); switch(level){ case LL_DEBUG: lvstr = "DEBUG"; break; case LL_INFO: lvstr = "INFO"; break; case LL_WARN: lvstr = "WARN"; break; default: lvstr = "ERROR"; break; } date = cbdatestrwww(time(NULL), 0); printf("%s\t%s\t", date, lvstr); vprintf(format, ap); putchar('\n'); fflush(stdout); if(log_fp){ fprintf(log_fp, "%s\t%s\t", date, lvstr); vfprintf(log_fp, format, aq); fputc('\n', log_fp); fflush(log_fp); } free(date); va_end(aq); va_end(ap); pthread_mutex_unlock(&mymutex); } /* Rotete the log file. */ int log_rotate(const char *rootdir, const char *path){ FILE *ifp, *ofp; char mypath[URIBUFSIZ], *wp, iobuf[IOBUFSIZ]; int err, year, month, day, hour, minute, second, len; assert(rootdir && path); if(!log_fp || fflush(log_fp) == -1) return FALSE; err = FALSE; wp = mypath; if((ESTPATHCHR == '/' && path[0] == ESTPATHCHR) || (ESTPATHCHR == '\\' && ((path[0] >= 'A' && path[0] <= 'Z') || (path[0] >= 'a' && path[0] <= 'z')) && path[1] == ':' && path[2] == '\\')){ wp += sprintf(wp, "%s", path); } else { wp += sprintf(wp, "%s%c%s", rootdir, ESTPATHCHR, path); } if(!(ifp = fopen(mypath, "rb"))) return FALSE; cbcalendar(-1, 0, &year, &month, &day, &hour, &minute, &second); sprintf(wp, "-%04d%02d%02d%02d%02d%02d", year, month, day, hour, minute, second); if(!(ofp = fopen(mypath, "wb"))){ fclose(ifp); return FALSE; } while((len = fread(iobuf, 1, IOBUFSIZ, ifp)) > 0){ fwrite(iobuf, 1, len, ofp); } if(fclose(ofp) == -1) err = TRUE; if(fclose(ifp) == -1) err = TRUE; if(fseek(log_fp, 0, SEEK_SET) == -1 || fflush(log_fp) == -1) err = TRUE; if(ftruncate(fileno(log_fp), 0) == -1) err = TRUE; return err ? FALSE : TRUE; } /* Initialize the root directory. */ int master_init(const char *rootdir){ DEPOT *depot; FILE *ofp; char path[URIBUFSIZ]; int err; assert(rootdir); if(est_mkdir(rootdir) == -1 && errno != EEXIST) return FALSE; err = FALSE; sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, METAFILE); if((depot = dpopen(path, DP_OWRITER | DP_OCREAT | DP_OTRUNC, MINIBNUM))){ if(!dpput(depot, MMKMAGIC, -1, MMKMAGVAL, -1, DP_DKEEP)) err = TRUE; if(!dpclose(depot)) err = TRUE; } else { err = TRUE; } sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, CONFFILE); if((ofp = fopen(path, "wb")) != NULL){ fprintf(ofp, "# binding address of TCP (0.0.0.0 means every address)\n"); fprintf(ofp, "bindaddr: 0.0.0.0\n"); fprintf(ofp, "\n"); fprintf(ofp, "# port number of TCP\n"); fprintf(ofp, "portnum: 1978\n"); fprintf(ofp, "\n"); fprintf(ofp, "# public URL (absolute URL)\n"); fprintf(ofp, "publicurl:\n"); fprintf(ofp, "\n"); fprintf(ofp, "# running mode (1:normal, 2:readonly)\n"); fprintf(ofp, "runmode: 1\n"); fprintf(ofp, "\n"); fprintf(ofp, "# authorization mode (1:none, 2:admin, 3:all)\n"); fprintf(ofp, "authmode: 2\n"); fprintf(ofp, "\n"); fprintf(ofp, "# maximum length of data to receive (in kilobytes)\n"); fprintf(ofp, "recvmax: 1024\n"); fprintf(ofp, "\n"); fprintf(ofp, "# maximum number of connections at the same time\n"); fprintf(ofp, "maxconn: 30\n"); fprintf(ofp, "\n"); fprintf(ofp, "# idle time to start flushing (in seconds)\n"); fprintf(ofp, "idleflush: 20\n"); fprintf(ofp, "\n"); fprintf(ofp, "# idle time to start synchronizing (in seconds)\n"); fprintf(ofp, "idlesync: 300\n"); fprintf(ofp, "\n"); fprintf(ofp, "# timeout of a session (in seconds)\n"); fprintf(ofp, "sessiontimeout: 600\n"); fprintf(ofp, "\n"); fprintf(ofp, "# timeout of search (in seconds)\n"); fprintf(ofp, "searchtimeout: 15\n"); fprintf(ofp, "\n"); fprintf(ofp, "# maximum number of documents to send\n"); fprintf(ofp, "searchmax: 1000\n"); fprintf(ofp, "\n"); fprintf(ofp, "# maximum depth of meta search\n"); fprintf(ofp, "searchdepth: 5\n"); fprintf(ofp, "\n"); fprintf(ofp, "# whether to rate URI for scoring (0:no, 1:yes)\n"); fprintf(ofp, "rateuri: 1\n"); fprintf(ofp, "\n"); fprintf(ofp, "# merge method of meta search (1:score, 2:score and rank, 3:rank)\n"); fprintf(ofp, "mergemethod: 2\n"); fprintf(ofp, "\n"); fprintf(ofp, "# host name of the proxy\n"); fprintf(ofp, "proxyhost:\n"); fprintf(ofp, "\n"); fprintf(ofp, "# port number of the proxy\n"); fprintf(ofp, "proxyport:\n"); fprintf(ofp, "\n"); fprintf(ofp, "# path of the log file (relative path or absolute path)\n"); fprintf(ofp, "logfile: %s\n", LOGFILE); fprintf(ofp, "\n"); fprintf(ofp, "# logging level (1:debug, 2:information, 3:warning, 4:error, 5:none)\n"); fprintf(ofp, "loglevel: 2\n"); fprintf(ofp, "\n"); fprintf(ofp, "# command for backup (absolute path of a command)\n"); fprintf(ofp, "backupcmd:\n"); fprintf(ofp, "\n"); fprintf(ofp, "# scale prediction (1:small, 2:medium, 3:large, 4:huge)\n"); fprintf(ofp, "scalepred: 2\n"); fprintf(ofp, "\n"); fprintf(ofp, "# score expression (1:void, 2:char, 3:int, 4:asis)\n"); fprintf(ofp, "scoreexpr: 2\n"); fprintf(ofp, "\n"); fprintf(ofp, "# attribute indexes (attribute name and data type)\n"); fprintf(ofp, "attrindex: @mdate{{!}}seq\n"); fprintf(ofp, "attrindex: @title{{!}}str\n"); fprintf(ofp, "\n"); fprintf(ofp, "# document root directory (absolute path of a directory to be public)\n"); fprintf(ofp, "docroot:\n"); fprintf(ofp, "\n"); fprintf(ofp, "# index file (name of directory index files)\n"); fprintf(ofp, "indexfile:\n"); fprintf(ofp, "\n"); fprintf(ofp, "# decimal IP addresses of trusted nodes\n"); fprintf(ofp, "trustednode:\n"); fprintf(ofp, "\n"); fprintf(ofp, "# whether to deny all nodes except for trusted nodes (0:no, 1:yes)\n"); fprintf(ofp, "denyuntrusted: 0\n"); fprintf(ofp, "\n"); fprintf(ofp, "# maximum size of the index cache (in megabytes)\n"); fprintf(ofp, "cachesize: 64\n"); fprintf(ofp, "\n"); fprintf(ofp, "# maximum number of cached records for document attributes\n"); fprintf(ofp, "cacheanum: 8192\n"); fprintf(ofp, "\n"); fprintf(ofp, "# maximum number of cached records for document texts\n"); fprintf(ofp, "cachetnum: 1024\n"); fprintf(ofp, "\n"); fprintf(ofp, "# maximum number of cached records for occurrence results\n"); fprintf(ofp, "cachernum: 256\n"); fprintf(ofp, "\n"); fprintf(ofp, "# name of the attribute of the special cache\n"); fprintf(ofp, "specialcache:\n"); fprintf(ofp, "\n"); fprintf(ofp, "# lower limit of cache usage to use the helper\n"); fprintf(ofp, "helpershift: 0.9\n"); fprintf(ofp, "\n"); fprintf(ofp, "# maximum number of expansion of wild cards\n"); fprintf(ofp, "wildmax: 256\n"); fprintf(ofp, "\n"); fprintf(ofp, "# text size limitation of indexing documents (in kilobytes)\n"); fprintf(ofp, "limittextsize: 128\n"); fprintf(ofp, "\n"); fprintf(ofp, "# whole width of the snippet of each shown document\n"); fprintf(ofp, "snipwwidth: 480\n"); fprintf(ofp, "\n"); fprintf(ofp, "# width of strings picked up from the beginning of the text\n"); fprintf(ofp, "sniphwidth: 96\n"); fprintf(ofp, "\n"); fprintf(ofp, "# width of strings picked up around each highlighted word\n"); fprintf(ofp, "snipawidth: 96\n"); fprintf(ofp, "\n"); fprintf(ofp, "# whether to check documents by scanning (0:no, 1:yes)\n"); fprintf(ofp, "scancheck: 1\n"); fprintf(ofp, "\n"); fprintf(ofp, "# number of keywords for similarity search (0 means disabled)\n"); fprintf(ofp, "smlrvnum: 32\n"); fprintf(ofp, "\n"); fprintf(ofp, "# number of documents for delay of keyword extraction\n"); fprintf(ofp, "extdelay: 4096\n"); fprintf(ofp, "\n"); fprintf(ofp, "# e-mail address of the administrator\n"); fprintf(ofp, "adminemail: magnus@hyperestraier.gov\n"); fprintf(ofp, "\n"); fprintf(ofp, "# expressions to replace the URI of each document\n"); fprintf(ofp, "uireplace: ^file:///home/mikio/public_html/{{!}}http://localhost/\n"); fprintf(ofp, "uireplace: /index\\.html?${{!}}/\n"); fprintf(ofp, "\n"); fprintf(ofp, "# extra attributes to be shown\n"); fprintf(ofp, "uiextattr: @author|Author\n"); fprintf(ofp, "uiextattr: @mdate|Modification Date\n"); fprintf(ofp, "\n"); fprintf(ofp, "# mode of phrase form" " (1:usual, 2:simplified, 3:rough, 4:union: 5:intersection)\n"); fprintf(ofp, "uiphraseform: 2\n"); fprintf(ofp, "\n"); fprintf(ofp, "# tuning parameters for similarity search\n"); fprintf(ofp, "uismlrtune: 16 1024 4096\n"); fprintf(ofp, "\n"); if(fclose(ofp) == EOF) err = TRUE; } else { err = TRUE; } sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, PIDFILE); unlink(path); sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, STOPFILE); unlink(path); sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, USERFILE); if((ofp = fopen(path, "wb")) != NULL){ if(fclose(ofp) == EOF) err = TRUE; } else { err = TRUE; } sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, LOGFILE); if((ofp = fopen(path, "wb")) != NULL){ if(fclose(ofp) == EOF) err = TRUE; } else { err = TRUE; } sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, NODEDIR); est_rmdir_rec(path); if(est_mkdir(path) == -1) err = TRUE; sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, SESSDIR); est_rmdir_rec(path); if(est_mkdir(path) == -1) err = TRUE; return err ? FALSE : TRUE; } /* Get the PID of the process locking the root directory. */ int lockerpid(const char *rootdir){ char path[URIBUFSIZ], *vbuf; int pid; pid = -1; sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, PIDFILE); if((vbuf = cbreadfile(path, NULL)) != NULL){ pid = atoi(vbuf); free(vbuf); } return pid; } /* Check whether a name includes alpha numeric characters only. */ int check_alnum_name(const char *name){ while(*name != '\0'){ if(!(*name >= 'a' && *name <= 'z') && !(*name >= '0' && *name <= '9') && *name != '-' && *name != '_' && *name != '.'){ return FALSE; } name++; } return TRUE; } /* Create a user manager object. */ UMGR *umgr_new(const char *rootdir){ UMGR *umgr; assert(rootdir); log_print(LL_INFO, "starting the user manager"); umgr = cbmalloc(sizeof(UMGR)); umgr->rootdir = cbmemdup(rootdir, -1); umgr->users = cbmapopen(); return umgr; } /* Destroy a user manager object. */ int umgr_delete(UMGR *umgr){ USER *user; const char *kbuf, *vbuf; int err; assert(umgr); log_print(LL_INFO, "finishing the user manager"); err = FALSE; if(!umgr_sync(umgr)) err = TRUE; cbmapiterinit(umgr->users); while((kbuf = cbmapiternext(umgr->users, NULL)) != NULL){ vbuf = cbmapiterval(kbuf, NULL); user = (USER *)vbuf; pthread_mutex_destroy(&(user->mutex)); if(user->sess) cbmapclose(user->sess); free(user->misc); free(user->fname); free(user->flags); free(user->passwd); free(user->name); } cbmapclose(umgr->users); free(umgr->rootdir); free(umgr); return err ? FALSE : TRUE; } /* Load all users from the user file. */ int umgr_load(UMGR *umgr){ CBLIST *lines, *elems; const char *line; char path[URIBUFSIZ]; int i, size; assert(umgr); log_print(LL_INFO, "loading the user list"); sprintf(path, "%s%c%s", umgr->rootdir, ESTPATHCHR, USERFILE); if(!(lines = cbreadlines(path))){ log_print(LL_ERROR, "loading the user list failed"); return FALSE; } for(i = 0; i < cblistnum(lines); i++){ line = cblistval(lines, i, &size); if(size < 1) continue; elems = cbsplit(line, size, "\t"); if(cblistnum(elems) >= 5){ umgr_put(umgr, cblistval(elems, 0, NULL), cblistval(elems, 1, NULL), cblistval(elems, 2, NULL), cblistval(elems, 3, NULL), cblistval(elems, 4, NULL)); } else { log_print(LL_WARN, "invalid line: %d", i + 1); } cblistclose(elems); } cblistclose(lines); return TRUE; } /* Synchronize all users into the user file. */ int umgr_sync(UMGR *umgr){ FILE *ofp; USER *user; const char *kbuf, *vbuf; char path[URIBUFSIZ]; int err; assert(umgr); log_print(LL_INFO, "saving the user list"); sprintf(path, "%s%c%s", umgr->rootdir, ESTPATHCHR, USERFILE); if(!(ofp = fopen(path, "wb"))){ log_print(LL_ERROR, "synchronizing the user list failed"); return FALSE; } err = FALSE; cbmapiterinit(umgr->users); while((kbuf = cbmapiternext(umgr->users, NULL)) != NULL){ vbuf = cbmapiterval(kbuf, NULL); user = (USER *)vbuf; fprintf(ofp, "%s\t%s\t%s\t%s\t%s\n", user->name, user->passwd, user->flags, user->fname, user->misc); } if(fclose(ofp) == EOF){ log_print(LL_ERROR, "saving the user list failed"); err = TRUE; } return err ? FALSE : TRUE; } /* Add a user to a user manager object. */ int umgr_put(UMGR *umgr, const char *name, const char *passwd, const char *flags, const char *fname, const char *misc){ USER user; assert(umgr && name && passwd && flags && fname && misc); log_print(LL_DEBUG, "umgr_put: %s:%s:%s:%s:%s", name, passwd, flags, fname, misc); if(name[0] == '\0' || cbmapget(umgr->users, name, -1, NULL)){ log_print(LL_WARN, "duplicated or empty user name: %s", name); return FALSE; } if(!check_alnum_name(name)){ log_print(LL_WARN, "invalid user name: %s", name); return FALSE; } user.name = cbmemdup(name, -1); user.passwd = cbmemdup(passwd, -1); user.flags = cbmemdup(flags, -1); user.fname = cbmemdup(fname, -1); user.misc = cbmemdup(misc, -1); user.atime = 0; user.sess = NULL; pthread_mutex_init(&(user.mutex), NULL); cbmapput(umgr->users, name, -1, (char *)&user, sizeof(USER), FALSE); return TRUE; } /* Remove a user from a user manager object. */ int umgr_out(UMGR *umgr, const char *name){ USER *user; const char *vbuf; assert(umgr && name); log_print(LL_DEBUG, "umgr_out: %s", name); if(!(vbuf = cbmapget(umgr->users, name, -1, NULL))) return FALSE; user = (USER *)vbuf; pthread_mutex_destroy(&(user->mutex)); if(user->sess) cbmapclose(user->sess); free(user->misc); free(user->fname); free(user->flags); free(user->passwd); free(user->name); cbmapout(umgr->users, name, -1); return TRUE; } /* Get a list of names of users in a user manager object. */ CBLIST *umgr_names(UMGR *umgr){ CBLIST *names; assert(umgr); names = cbmapkeys(umgr->users); cblistsort(names); return names; } /* Get a user object in a user manager object. */ USER *umgr_get(UMGR *umgr, const char *name){ const char *vbuf; assert(umgr && name); if(!(vbuf = cbmapget(umgr->users, name, -1, NULL))) return NULL; return (USER *)vbuf; } /* Make the session of a user object. */ void user_make_sess(USER *user){ assert(user); if(pthread_mutex_lock(&(user->mutex)) != 0) return; if(user->sess) cbmapclose(user->sess); user->sess = cbmapopenex(MINIBNUM); pthread_mutex_unlock(&(user->mutex)); } /* Clear the session of a user object. */ void user_clear_sess(USER *user){ assert(user); if(pthread_mutex_lock(&(user->mutex)) != 0) return; if(user->sess) cbmapclose(user->sess); user->sess = NULL; pthread_mutex_unlock(&(user->mutex)); } /* Set a session variable of a user object. */ void user_set_sess_val(USER *user, const char *name, const char *value){ assert(user && name); if(pthread_mutex_lock(&(user->mutex)) != 0) return; if(user->sess){ if(value){ cbmapput(user->sess, name, -1, value, -1, TRUE); } else { cbmapout(user->sess, name, -1); } } pthread_mutex_unlock(&(user->mutex)); } /* Get the value of a session variable of a user object. */ char *user_sess_val(USER *user, const char *name){ const char *value; char *rv; assert(user && name); if(pthread_mutex_lock(&(user->mutex)) != 0) return NULL; value = user->sess ? cbmapget(user->sess, name, -1, NULL) : NULL; rv = value ? cbmemdup(value, -1) : NULL; pthread_mutex_unlock(&(user->mutex)); return rv; } /* Create a node manager object. */ NMGR *nmgr_new(const char *rootdir){ NMGR *nmgr; assert(rootdir); log_print(LL_INFO, "starting the node manager"); nmgr = cbmalloc(sizeof(NMGR)); nmgr->rootdir = cbmemdup(rootdir, -1); nmgr->nodes = cbmapopenex(MINIBNUM); nmgr->aidxs = cbmapopenex(MINIBNUM); return nmgr; } /* Destroy a node manager object. */ int nmgr_delete(NMGR *nmgr){ NODE *node; const char *kbuf, *vbuf; int err, ecode; assert(nmgr); log_print(LL_INFO, "finishing the node manager"); err = FALSE; if(!nmgr_sync(nmgr, FALSE)) err = TRUE; cbmapclose(nmgr->aidxs); cbmapiterinit(nmgr->nodes); while((kbuf = cbmapiternext(nmgr->nodes, NULL)) != NULL){ vbuf = cbmapiterval(kbuf, NULL); node = (NODE *)vbuf; pthread_mutex_destroy(&(node->mutex)); cbmapclose(node->links); cbmapclose(node->users); cbmapclose(node->admins); free(node->label); free(node->name); est_mtdb_close(node->db, &ecode); } cbmapclose(nmgr->nodes); free(nmgr->rootdir); free(nmgr); return err ? FALSE : TRUE; } /* Load all nodes from the node directory. */ int nmgr_load(NMGR *nmgr, int wmode){ CBLIST *list; const char *file; char path[URIBUFSIZ]; int i, err; assert(nmgr); sprintf(path, "%s%c%s", nmgr->rootdir, ESTPATHCHR, NODEDIR); if(!(list = cbdirlist(path))){ log_print(LL_ERROR, "loading the node directory failed"); return FALSE; } err = FALSE; for(i = 0; i < cblistnum(list); i++){ file = cblistval(list, i, NULL); if(!strcmp(file, ESTCDIRSTR) || !strcmp(file, ESTPDIRSTR)) continue; if(!nmgr_put(nmgr, file, wmode, 0)) err = TRUE; } cblistclose(list); return err ? FALSE : TRUE; } /* Synchronize all nodes into the node directory. */ int nmgr_sync(NMGR *nmgr, int phis){ NODE *node; CBDATUM *datum; const char *kbuf, *vbuf; int err, ksiz, vsiz; assert(nmgr); log_print(LL_INFO, "synchronizing the node manager"); err = FALSE; cbmapiterinit(nmgr->nodes); while((kbuf = cbmapiternext(nmgr->nodes, NULL)) != NULL){ vbuf = cbmapiterval(kbuf, NULL); node = (NODE *)vbuf; est_mtdb_add_meta(node->db, NMKNAME, node->name); est_mtdb_add_meta(node->db, NMKLABEL, node->label); datum = cbdatumopen(NULL, -1); cbmapiterinit(node->admins); while((kbuf = cbmapiternext(node->admins, &ksiz)) != NULL){ cbdatumcat(datum, kbuf, ksiz); cbdatumcat(datum, "\n", 1); } est_mtdb_add_meta(node->db, NMKADMINS, cbdatumptr(datum)); cbdatumclose(datum); datum = cbdatumopen(NULL, -1); cbmapiterinit(node->users); while((kbuf = cbmapiternext(node->users, &ksiz)) != NULL){ cbdatumcat(datum, kbuf, ksiz); cbdatumcat(datum, "\n", 1); } est_mtdb_add_meta(node->db, NMKUSERS, cbdatumptr(datum)); cbdatumclose(datum); datum = cbdatumopen(NULL, -1); cbmapiterinit(node->links); while((kbuf = cbmapiternext(node->links, &ksiz)) != NULL){ vbuf = cbmapiterval(kbuf, &vsiz); cbdatumcat(datum, kbuf, ksiz); cbdatumcat(datum, "\t", 1); cbdatumcat(datum, vbuf, vsiz); cbdatumcat(datum, "\n", 1); } est_mtdb_add_meta(node->db, NMKLINKS, cbdatumptr(datum)); cbdatumclose(datum); if(phis && !est_mtdb_sync(node->db)){ log_print(LL_ERROR, "DB-ERROR: %s", est_err_msg(est_mtdb_error(node->db))); err = TRUE; } } return err ? FALSE : TRUE; } /* Add an attribute index to a node manager object. */ void nmgr_add_aidx(NMGR *nmgr, const char *name, const char *type){ int tnum; assert(nmgr && name && type); if(!cbstricmp(type, "str")){ tnum = ESTIDXATTRSTR; } else if(!cbstricmp(type, "num")){ tnum = ESTIDXATTRNUM; } else { tnum = ESTIDXATTRSEQ; } cbmapput(nmgr->aidxs, name, -1, (char *)&tnum, sizeof(int), TRUE); } /* Add a node to a node manager object. */ int nmgr_put(NMGR *nmgr, const char *name, int wmode, int options){ NODE node; ESTMTDB *db; CBLIST *list; const char *cbuf, *pv; char pbuf[URIBUFSIZ], *vbuf; int i, ecode, csiz; assert(nmgr && name); log_print(LL_DEBUG, "nmgr_put: %s", name); if(name[0] == '\0' || cbmapget(nmgr->nodes, name, -1, NULL)){ log_print(LL_WARN, "duplicated or empty node name: %s", name); return FALSE; } if(strlen(name) >= NODENAMEMAX || !check_alnum_name(name)){ log_print(LL_WARN, "invalid node name: %s", name); return FALSE; } log_print(LL_INFO, "opening a node (%s): %s", wmode ? "WRITER" : "READER", name); sprintf(pbuf, "%s%c%s%c%s", nmgr->rootdir, ESTPATHCHR, NODEDIR, ESTPATHCHR, name); if(!(db = est_mtdb_open(pbuf, wmode ? ESTDBWRITER | ESTDBCREAT | options : ESTDBREADER, &ecode))){ log_print(LL_ERROR, "DB-ERROR: %s", est_err_msg(ecode)); return FALSE; } est_mtdb_set_informer(db, db_informer, NULL); cbmapiterinit(nmgr->aidxs); while((cbuf = cbmapiternext(nmgr->aidxs, NULL)) != NULL){ est_mtdb_add_attr_index(db, cbuf, *(int *)cbmapiterval(cbuf, NULL)); } node.db = db; est_mtdb_add_meta(db, NMKNAME, name); node.name = cbmemdup(name, -1); vbuf = est_mtdb_meta(db, NMKLABEL); node.label = vbuf ? vbuf : cbmemdup(name, -1); if((vbuf = est_mtdb_meta(db, NMKADMINS)) != NULL){ list = cbsplit(vbuf, -1, "\n"); node.admins = cbmapopenex(cblistnum(list) + MINIBNUM); for(i = 0; i < cblistnum(list); i++){ cbuf = cblistval(list, i, &csiz); if(csiz < 1) continue; cbmapput(node.admins, cbuf, csiz, "", 0, FALSE); } cblistclose(list); free(vbuf); } else { node.admins = cbmapopenex(MINIBNUM); } if((vbuf = est_mtdb_meta(db, NMKUSERS)) != NULL){ list = cbsplit(vbuf, -1, "\n"); node.users = cbmapopenex(cblistnum(list) + MINIBNUM); for(i = 0; i < cblistnum(list); i++){ cbuf = cblistval(list, i, &csiz); if(csiz < 1) continue; cbmapput(node.users, cbuf, csiz, "", 0, FALSE); } cblistclose(list); free(vbuf); } else { node.users = cbmapopenex(MINIBNUM); } if((vbuf = est_mtdb_meta(db, NMKLINKS)) != NULL){ list = cbsplit(vbuf, -1, "\n"); node.links = cbmapopenex(cblistnum(list) + MINIBNUM); for(i = 0; i < cblistnum(list); i++){ cbuf = cblistval(list, i, NULL); if(!(pv = strchr(cbuf, '\t'))) continue; cbmapput(node.links, cbuf, pv - cbuf, pv + 1, -1, FALSE); } cblistclose(list); free(vbuf); } else { node.links = cbmapopenex(MINIBNUM); } node.mtime = time(NULL); node.dirty = FALSE; pthread_mutex_init(&(node.mutex), NULL); cbmapput(nmgr->nodes, name, -1, (char *)&node, sizeof(NODE), FALSE); return TRUE; } /* Remove a node from a node manager object. */ int nmgr_out(NMGR *nmgr, const char *name){ NODE *node; const char *vbuf; char pbuf[URIBUFSIZ]; int err, ecode; assert(nmgr && name); log_print(LL_DEBUG, "nmgr_out: %s", name); if(!(vbuf = cbmapget(nmgr->nodes, name, -1, NULL))) return FALSE; err = FALSE; node = (NODE *)vbuf; pthread_mutex_destroy(&(node->mutex)); cbmapclose(node->links); cbmapclose(node->users); cbmapclose(node->admins); free(node->label); free(node->name); if(!est_mtdb_close(node->db, &ecode)){ log_print(LL_ERROR, "DB-ERROR: %s", est_err_msg(ecode)); err = TRUE; } sprintf(pbuf, "%s%c%s%c%s", nmgr->rootdir, ESTPATHCHR, NODEDIR, ESTPATHCHR, name); if(!est_rmdir_rec(pbuf)){ log_print(LL_ERROR, "could not remove a directory"); err = TRUE; } cbmapout(nmgr->nodes, name, -1); return TRUE; } /* Clear registered documents in a node in a node manager object. */ int nmgr_clear(NMGR *nmgr, const char *name, int options){ NODE *node; CBMAP *admins, *users, *links; const char *vbuf; char *label; if(!(vbuf = cbmapget(nmgr->nodes, name, -1, NULL))) return FALSE; node = (NODE *)vbuf; label = cbmemdup(node->label, -1); admins = cbmapdup(node->admins); users = cbmapdup(node->users); links = cbmapdup(node->links); if(!nmgr_out(nmgr, name) || !nmgr_put(nmgr, name, TRUE, options)){ cbmapclose(links); cbmapclose(users); cbmapclose(admins); free(label); return FALSE; } if(!(vbuf = cbmapget(nmgr->nodes, name, -1, NULL))) return FALSE; node = (NODE *)vbuf; cbmapclose(node->links); cbmapclose(node->users); cbmapclose(node->admins); free(node->label); node->label = label; node->admins = admins; node->users = users; node->links = links; return TRUE; } /* Get a list of names of nodes in a noder manager object. */ CBLIST *nmgr_names(NMGR *nmgr){ CBLIST *names; assert(nmgr); names = cbmapkeys(nmgr->nodes); cblistsort(names); return names; } /* Get a node object in a node manager object. */ NODE *nmgr_get(NMGR *nmgr, const char *name){ const char *vbuf; assert(nmgr && name); if(!(vbuf = cbmapget(nmgr->nodes, name, -1, NULL))) return NULL; return (NODE *)vbuf; } /* Set a link object of a node. */ void node_set_link(NODE *node, const char *url, const char *label, int credit){ char *vbuf; assert(node && url); if(!label || credit < 0){ cbmapout(node->links, url, -1); return; } vbuf = cbsprintf("%s\t%d", label, credit); cbmapput(node->links, url, -1, vbuf, -1, TRUE); free(vbuf); } /* Create a read-write lock object. */ RWLOCK *rwlock_new(void){ RWLOCK *rwlock; rwlock = cbmalloc(sizeof(RWLOCK)); rwlock->readers = 0; rwlock->writers = 0; pthread_mutex_init(&(rwlock->mutex), NULL); pthread_cond_init(&(rwlock->cond), NULL); return rwlock; } /* Destroy a read-write lock object. */ void rwlock_delete(RWLOCK *rwlock){ assert(rwlock); pthread_cond_destroy(&(rwlock->cond)); pthread_mutex_destroy(&(rwlock->mutex)); free(rwlock); } /* Lock a read-write lock object. */ int rwlock_lock(RWLOCK *rwlock, int wmode){ assert(rwlock); if(pthread_mutex_lock(&(rwlock->mutex)) != 0) return FALSE; if(wmode){ while(rwlock->writers > 0 || rwlock->readers > 0){ pthread_cond_wait(&(rwlock->cond), &(rwlock->mutex)); } rwlock->writers++; } else { while(rwlock->writers > 0){ pthread_cond_wait(&(rwlock->cond), &(rwlock->mutex)); } rwlock->readers++; } pthread_mutex_unlock(&(rwlock->mutex)); return TRUE; } /* Unlock a read-write lock object. */ int rwlock_unlock(RWLOCK *rwlock){ assert(rwlock); if(pthread_mutex_lock(&(rwlock->mutex)) != 0) return FALSE; if(rwlock->writers > 0){ rwlock->writers--; pthread_cond_broadcast(&(rwlock->cond)); pthread_mutex_unlock(&(rwlock->mutex)); } else { rwlock->readers--; if(rwlock->readers < 1) pthread_cond_signal(&(rwlock->cond)); pthread_mutex_unlock(&(rwlock->mutex)); } return TRUE; } /* Get the number of readers locking a read-write lock object. */ int rwlock_rnum(RWLOCK *rwlock){ assert(rwlock); return rwlock->readers; } /* Create a result map object. */ RESMAP *resmap_new(void){ RESMAP *resmap; resmap = cbmalloc(sizeof(RESMAP)); resmap->uris = cbmapopen(); pthread_mutex_init(&(resmap->mutex), NULL); return resmap; } /* Destroy a result map object. */ void resmap_delete(RESMAP *resmap){ RESDOC *resdoc; const char *kbuf, *vbuf; assert(resmap); cbmapiterinit(resmap->uris); while((kbuf = cbmapiternext(resmap->uris, NULL)) != NULL){ vbuf = cbmapiterval(kbuf, NULL); resdoc = (RESDOC *)vbuf; if(resdoc->doc) est_doc_delete(resdoc->doc); if(resdoc->attrs) cbmapclose(resdoc->attrs); if(resdoc->body) free(resdoc->body); } pthread_mutex_destroy(&(resmap->mutex)); cbmapclose(resmap->uris); free(resmap); } /* Add a result document data to a result map object. */ void resmap_put(RESMAP *resmap, int score, ESTDOC *doc, CBMAP *attrs, char *body){ RESDOC resdoc; const char *uri, *vbuf; assert(resmap); uri = NULL; if(doc) uri = est_doc_attr(doc, ESTDATTRURI); if(attrs) uri = cbmapget(attrs, ESTDATTRURI, -1, NULL); if(!uri || pthread_mutex_lock(&(resmap->mutex)) != 0){ if(doc) est_doc_delete(doc); if(attrs) cbmapclose(attrs); if(body) free(body); return; } if((vbuf = cbmapget(resmap->uris, uri, -1, NULL)) != NULL){ if(((RESDOC *)vbuf)->score >= score){ if(doc) est_doc_delete(doc); if(attrs) cbmapclose(attrs); if(body) free(body); } else { if(((RESDOC *)vbuf)->doc) est_doc_delete(((RESDOC *)vbuf)->doc); if(((RESDOC *)vbuf)->attrs) cbmapclose(((RESDOC *)vbuf)->attrs); if(((RESDOC *)vbuf)->body) free(((RESDOC *)vbuf)->body); resdoc.score = score; resdoc.doc = doc; resdoc.attrs = attrs; resdoc.body = body; resdoc.value = NULL; cbmapput(resmap->uris, uri, -1, (char *)&resdoc, sizeof(RESDOC), TRUE); } } else { resdoc.score = score; resdoc.doc = doc; resdoc.attrs = attrs; resdoc.body = body; cbmapput(resmap->uris, uri, -1, (char *)&resdoc, sizeof(RESDOC), FALSE); } pthread_mutex_unlock(&(resmap->mutex)); } /* Get a list object of result objects in a result map objects. */ RESDOC **resmap_list(RESMAP *resmap, int *nump, const char *order, const char *distinct){ RESDOC **resdocs, *resdoc; CBMAP *umap; const char *kbuf, *vbuf, *otype, *rp; char *oname, *wp; int i, onlen, dnlen, nnum; time_t tval; assert(resmap && nump); if(pthread_mutex_lock(&(resmap->mutex)) != 0){ *nump = 0; return cbmalloc(1); } *nump = cbmaprnum(resmap->uris); resdocs = cbmalloc(*nump * sizeof(RESDOC) + 1); cbmapiterinit(resmap->uris); for(i = 0; i < *nump; i++){ kbuf = cbmapiternext(resmap->uris, NULL); vbuf = cbmapiterval(kbuf, NULL); resdocs[i] = (RESDOC *)vbuf; } if(order){ oname = cbmemdup(order, -1); cbstrtrim(oname); otype = ESTORDSTRA; if((wp = strchr(oname, ' ')) != NULL){ *wp = '\0'; rp = wp + 1; while(*rp == ' '){ rp++; } otype = rp; } onlen = strlen(oname); for(i = 0; i < *nump; i++){ if(resdocs[i]->doc){ resdocs[i]->value = est_doc_attr(resdocs[i]->doc, oname); } else { resdocs[i]->value = cbmapget(resdocs[i]->attrs, oname, onlen, NULL); } if(!resdocs[i]->value) resdocs[i]->value = ""; } if(!cbstricmp(otype, ESTORDSTRA)){ qsort(resdocs, *nump, sizeof(RESDOC *), resdoc_compare_by_str_asc); } else if(!cbstricmp(otype, ESTORDSTRD)){ qsort(resdocs, *nump, sizeof(RESDOC *), resdoc_compare_by_str_desc); } else if(!cbstricmp(otype, ESTORDNUMA)){ for(i = 0; i < *nump; i++){ tval = cbstrmktime(resdocs[i]->value); resdocs[i]->value = (void *)tval; } qsort(resdocs, *nump, sizeof(RESDOC *), resdoc_compare_by_num_asc); } else if(!cbstricmp(otype, ESTORDNUMD)){ for(i = 0; i < *nump; i++){ tval = cbstrmktime(resdocs[i]->value); resdocs[i]->value = (void *)tval; } qsort(resdocs, *nump, sizeof(RESDOC *), resdoc_compare_by_num_desc); } free(oname); } else { qsort(resdocs, *nump, sizeof(RESDOC *), resdoc_compare_by_score); } if(distinct){ dnlen = strlen(distinct); umap = cbmapopenex(*nump + 1); nnum = 0; for(i = 0; i < *nump; i++){ resdoc = resdocs[i]; if(resdoc->doc){ vbuf = est_doc_attr(resdoc->doc, distinct); printf("*"); } else { vbuf = cbmapget(resdoc->attrs, distinct, dnlen, NULL); } if(!vbuf) vbuf = ""; if(cbmapput(umap, vbuf, -1, "", 0, FALSE)) resdocs[nnum++] = resdoc; } *nump = nnum; cbmapclose(umap); } pthread_mutex_unlock(&(resmap->mutex)); return resdocs; } /* Be a daemon process. */ int be_daemon(const char *curdir){ #if defined(_SYS_MSVC_) || defined(_SYS_MINGW_) PROCESS_INFORMATION pi; STARTUPINFO si; assert(curdir); FreeConsole(); if(getenv("ESTDAEMON")){ Sleep(1000); if(chdir(curdir) == -1) return FALSE; } else { putenv("ESTDAEMON=1"); memset(&si, 0, sizeof(si)); si.cb = sizeof(si); if(!CreateProcess(NULL, GetCommandLine(), NULL, NULL, FALSE, BELOW_NORMAL_PRIORITY_CLASS | CREATE_NEW_PROCESS_GROUP | CREATE_NO_WINDOW | DETACHED_PROCESS, NULL, NULL, &si, &pi)) return FALSE; CloseHandle(pi.hProcess); exit(0); } return TRUE; #else int fd; assert(curdir); switch(fork()){ case -1: return FALSE; case 0: break; default: exit(0); } if(setsid() == -1) return FALSE; switch(fork()){ case -1: return FALSE; case 0: break; default: exit(0); } umask(0); if(chdir(curdir) == -1) return FALSE; close(0); close(1); close(2); if((fd = open(NULLDEV, O_RDWR, 0)) != -1){ dup2(fd, 0); dup2(fd, 1); dup2(fd, 2); if(fd > 2) close(fd); } nice(5); return TRUE; #endif } /************************************************************************************************* * private objects *************************************************************************************************/ /* Close the log file. */ static void log_close(void){ if(log_fp) fclose(log_fp); } /* Output the log message of a DB event. `msg' specifies the log message of a DB event. `opaque' is simply ignored. */ static void db_informer(const char *message, void *opaque){ assert(message); log_print(LL_INFO, "DB-EVENT: %s", message); } /* Compare two result document objects by score. `ap' specifies the pointer to one object. `ap' specifies the pointer to the other object. The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int resdoc_compare_by_score(const void *ap, const void *bp){ assert(ap && bp); return (*(RESDOC **)bp)->score - (*(RESDOC **)ap)->score; } /* Compare two result document objects by attributes of strings for ascending order. `ap' specifies the pointer to one score. `bp' specifies the pointer to the other score. The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int resdoc_compare_by_str_asc(const void *ap, const void *bp){ assert(ap && bp); return strcmp((*(RESDOC **)ap)->value, (*(RESDOC **)bp)->value); } /* Compare two result document objects by attributes of strings for descending order. `ap' specifies the pointer to one score. `bp' specifies the pointer to the other score. The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int resdoc_compare_by_str_desc(const void *ap, const void *bp){ assert(ap && bp); return strcmp((*(RESDOC **)bp)->value, (*(RESDOC **)ap)->value); } /* Compare two result document objects by attributes of numbers for ascending order. `ap' specifies the pointer to one score. `bp' specifies the pointer to the other score. The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int resdoc_compare_by_num_asc(const void *ap, const void *bp){ assert(ap && bp); return (time_t)(*(RESDOC **)ap)->value - (time_t)(*(RESDOC **)bp)->value; } /* Compare two result document objects by attributes of numbers for descending order. `ap' specifies the pointer to one score. `bp' specifies the pointer to the other score. The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int resdoc_compare_by_num_desc(const void *ap, const void *bp){ assert(ap && bp); return (time_t)(*(RESDOC **)bp)->value - (time_t)(*(RESDOC **)ap)->value; } /* END OF FILE */ hyperestraier-1.4.13/mastermod.h000066400000000000000000000464551125261632700166550ustar00rootroot00000000000000/************************************************************************************************* * Common modules related to estmaster * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #ifndef _MASTERMOD_H /* duplication check */ #define _MASTERMOD_H #include "estraier.h" #include "estmtdb.h" #include "estnode.h" #include "myconf.h" #include "mymorph.h" /************************************************************************************************* * pseudo API *************************************************************************************************/ #define NUMBUFSIZ 32 /* size of a buffer for a number */ #define URIBUFSIZ 8192 /* size of a buffer for an URI */ #define IOBUFSIZ 8192 /* size of a buffer for I/O */ #define HOSTBUFSIZ 256 /* size of a buffer for a host name */ #define ADDRBUFSIZ 48 /* size of a buffer for an address */ #define NODENAMEMAX 128 /* maximum length of node name */ #define MINIBNUM 31 /* bucket number of a small map */ #define KWORDNUM 32 /* number of shown keywords */ #define CONDATTRMAX 9 /* maximum number of attribute conditions */ #define DEFMAXSRCH 10 /* default max number of retrieved documents */ #define SELFCREDIT 10000 /* credit of the node itself */ #define CONFFILE "_conf" /* name of the configuration file */ #define USERFILE "_user" /* name of the user list file */ #define LOGFILE "_log" /* name of the log file */ #define METAFILE "_meta" /* name of the meta database */ #define PIDFILE "_pid" /* name of the process ID file */ #define STOPFILE "_stop" /* name of the process ID file */ #define DFDBFILE "_dfdb" /* name of the document frequency database */ #define NODEDIR "_node" /* name of the node directory */ #define SESSDIR "_sess" /* name of the session directory */ #define NULLDEV "/dev/null" /* path of null device */ #define INFORMHELPER "estbutler inform" /* command name of the inform helper */ #define SEARCHHELPER "estbutler search" /* command name of the search helper */ #define GETDOCHELPER "estbutler getdoc" /* command name of the get_doc helper */ #define GETDOCATTRHELPER "estbutler getdocattr" /* command name of the get_doc helper */ #define ETCHDOCHELPER "estbutler etchdoc" /* command name of the etch_doc helper */ #define URITOIDHELPER "estbutler uritoid" /* command name of the uri_to_id helper */ #define MMKMAGIC "magic" /* meta key of the magic number of meta DB */ #define MMKMAGVAL "[ESTMASTER]" /* value of the magic number of meta DB */ #define NMKNAME "name" /* meta key of the name of node DB */ #define NMKLABEL "label" /* meta key of the label of node DB */ #define NMKADMINS "admins" /* meta key of the administrators of node DB */ #define NMKUSERS "users" /* meta key of the users of node DB */ #define NMKLINKS "links" /* meta key of the links of node DB */ #define DATTRNDURL "#nodeurl" /* name of the pseudo-attribute of the node URL */ #define DATTRNDLABEL "#nodelabel" /* name of the pseudo-attribute of the node label */ #define DATTRNDSCORE "#nodescore" /* name of the pseudo-attribute of the node score */ #define DATTRLFILE "_lfile" /* name of the attribute of the file name */ enum { /* enumeration for running modes */ RM_NORMAL = 1, /* normal */ RM_RDONLY = 2 /* read only */ }; enum { /* enumeration for running modes */ AM_NONE = 1, /* none */ AM_ADMIN = 2, /* admin */ AM_ALL = 3 /* all */ }; enum { /* enumeration for running modes */ LL_DEBUG = 1, /* debug */ LL_INFO = 2, /* information */ LL_WARN = 3, /* warning */ LL_ERROR = 4, /* error */ LL_NONE = 5, /* none */ LL_CHECK = 6 /* check to open */ }; enum { /* enumeration for scale prediction */ SP_SMALL = 1, /* small */ SP_MEDIUM = 2, /* medium */ SP_LARGE = 3, /* large */ SP_HUGE = 4 /* huge */ }; enum { /* enumeration for scoring expression modes */ SE_VOID = 1, /* void */ SE_CHAR = 2, /* char */ SE_INT = 3, /* int */ SE_ASIS = 4 /* asis */ }; enum { /* enumeration for UI operations */ MM_SCORE = 1, /* score */ MM_SCRK = 2, /* score and rank */ MM_RANK = 3 /* rank */ }; enum { /* enumeration for phrase mode */ PM_USUAL = 1, /* usual phrase */ PM_SIMPLE = 2, /* simplified phrase */ PM_ROUGH = 3, /* rough phrase */ PM_UNION = 4, /* union phrase */ PM_ISECT = 5 /* intersection phrase */ }; typedef struct { /* type of structure for a user object */ char *name; /* unique name */ char *passwd; /* encrypted password */ char *flags; /* flags */ char *fname; /* full name */ char *misc; /* miscellaneous */ time_t atime; /* last access time */ CBMAP *sess; /* session variables */ pthread_mutex_t mutex; /* mutex per user */ } USER; typedef struct { /* type of structure for a user manager object */ char *rootdir; /* path of the root directory */ CBMAP *users; /* map of names and entities */ } UMGR; typedef struct { /* type of structure for a node object */ ESTMTDB *db; /* index database */ char *name; /* unique name of the index */ char *label; /* label for display */ CBMAP *admins; /* set of ID numbers of administrators */ CBMAP *users; /* set of ID numbers of users */ CBMAP *links; /* list of expressions of links */ time_t mtime; /* modification date */ int dirty; /* whether to have dirty cache */ pthread_mutex_t mutex; /* mutex per node */ } NODE; typedef struct { /* type of structure for a node manager object */ char *rootdir; /* path of the root directory */ CBMAP *nodes; /* map of names and entities */ CBMAP *aidxs; /* map of attribute indexes */ } NMGR; typedef struct { /* type of structure for a read/write lock object */ int readers; /* number of readers */ int writers; /* number of writers */ pthread_mutex_t mutex; /* mutex per lock */ pthread_cond_t cond; /* conditional variable */ } RWLOCK; typedef struct { /* type of structure for a document in result */ int score; /* score */ ESTDOC *doc; /* document object */ CBMAP *attrs; /* map object for attributes */ char *body; /* body data */ const char *value; /* value of an attribute for sorting */ } RESDOC; typedef struct { /* type of structure for documents in result */ CBMAP *uris; /* map of URIs and entities */ pthread_mutex_t mutex; /* mutex per result */ } RESMAP; /* The handles of the log file. */ extern FILE *log_fp; /* The level of logging. */ extern int log_level; /* Open the log file. `rootdir' specifies the path of the root directory. `path' specifies the path of the log file. `level' specifies the leve of logging. `trunc' specifies whether to truncate the log file. The return value is true if success, else it is false. */ int log_open(const char *rootdir, const char *path, int level, int trunc); /* Print formatted string into the log file. */ void log_print(int level, const char *format, ...); /* Rotete the log file. `rootdir' specifies the path of the root directory. `path' specifies the path of the log file. The return value is true if success, else it is false. */ int log_rotate(const char *rootdir, const char *path); /* Initialize the root directory. `rootdir' specifies the path of the root directory. The return value is true if success, else it is false. */ int master_init(const char *rootdir); /* Get the PID of the process locking the root directory. `rootdir' specifies the path of the root directory. The return value is the PID of the process. */ int lockerpid(const char *rootdir); /* Check whether a name includes alpha numeric characters only. `name' specifies a name. The return value is true if so or false if not. */ int check_alnum_name(const char *name); /* Create a user manager object. `rootdir' specifies the path of the root directory. The return value is a user manager object. */ UMGR *umgr_new(const char *rootdir); /* Destroy a user manager object. `umgr' specifies a user manager object. The return value is true if success, else it is false. */ int umgr_delete(UMGR *umgr); /* Load all users from the user file. `umgr' specifies a user manager object. The return value is true if success, else it is false. */ int umgr_load(UMGR *umgr); /* Synchronize all users into the user file. `umgr' specifies a user manager object. The return value is true if success, else it is false. */ int umgr_sync(UMGR *umgr); /* Add a user to a user manager object. `umgr' specifies a user manager object. `name' specifies the unique name of a user. `passwd' specifies the encrypted password of the user. `flags' specifies the flags of the user. `fname' specifies the full name of the user. `misc' specifies the miscellaneous information of the user. The return value is true if success, else it is false. */ int umgr_put(UMGR *umgr, const char *name, const char *passwd, const char *flags, const char *fname, const char *misc); /* Remove a user from a user manager object. `umgr' specifies a user manager object. `name' specifies the unique name of a user. The return value is true if success, else it is false. */ int umgr_out(UMGR *umgr, const char *name); /* Get a list of names of users in a user manager object. `umgr' specifies a user manager object. The return value is a list object of names of users in a user manager object. The returned object should be destroyed with `cblistclose'. */ CBLIST *umgr_names(UMGR *umgr); /* Get a user object in a user manager object. `umgr' specifies a user manager object. `name' specifies the unique name of a user. The return value is a user object or `NULL' on failure. */ USER *umgr_get(UMGR *umgr, const char *name); /* Make the session of a user object. `user' specifies a user object. */ void user_make_sess(USER *user); /* Clear the session of a user object. `user' specifies a user object. */ void user_clear_sess(USER *user); /* Set a session variable of a user object. `user' specifies a user object. `name' specifies the name of a variable. `value' specifies the value of the variable. If it is `NULL', the variable is deleted. */ void user_set_sess_val(USER *user, const char *name, const char *value); /* Get the value of a session variable of a user object. `user' specifies a user object. `name' specifies the name of a variable. The return value is the value of the session variable or `NULL' if it does not exist. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *user_sess_val(USER *user, const char *name); /* Create a node manager object. `rootdir' specifies the path of the root directory. The return value is a node manager object. */ NMGR *nmgr_new(const char *rootdir); /* Destroy a node manager object. `nmgr' specifies a node manager object. The return value is true if success, else it is false. */ int nmgr_delete(NMGR *nmgr); /* Load all nodes from the node directory. `nmgr' specifies a node manager object. `wmode' specifies whether the node is a writer or a reader. The return value is true if success, else it is false. */ int nmgr_load(NMGR *nmgr, int wmode); /* Synchronize all nodes into the node directory. `nmgr' specifies a node manager object. `phis' specifies whether to synchronize phisically. The return value is true if success, else it is false. */ int nmgr_sync(NMGR *nmgr, int phis); /* Add an attribute index to a node manager object. `nmgr' specifies a node manager object. `name' specifies the name of a target attribute. `type' specifies the expression of a data type. */ void nmgr_add_aidx(NMGR *nmgr, const char *name, const char *type); /* Add a node to a node manager object. `nmgr' specifies a node manager object. `name' specifies the unique name of a node. `wmode' specifies whether the node is a writer or a reader. `options' specifies options for the database of the node. The return value is true if success, else it is false. */ int nmgr_put(NMGR *nmgr, const char *name, int wmode, int options); /* Remove a node from a node manager object. `nmgr' specifies a node manager object. `name' specifies the unique name of a node. The return value is true if success, else it is false. */ int nmgr_out(NMGR *nmgr, const char *name); /* Clear registered documents in a node in a node manager object. `nmgr' specifies a node manager object. `name' specifies the unique name of a node. `options' specifies options for the database of the node. The return value is true if success, else it is false. */ int nmgr_clear(NMGR *nmgr, const char *name, int options); /* Get a list of names of nodes in a noder manager object. `nmgr' specifies a node manager object. The return value is a list object of names of nodes in a node manager object. The returned object should be destroyed with `cblistclose'. */ CBLIST *nmgr_names(NMGR *nmgr); /* Get a node object in a node manager object. `nmgr' specifies a node manager object. `name' specifies the unique name of a node. The return value is a node object or `NULL' on failure. */ NODE *nmgr_get(NMGR *nmgr, const char *name); /* Set a link object of a node. `node' specifies a node object. `url' specifies the URL of a link object. `label' specifies the label of the link object. If it is `NULL', the link is removed. `credit' specifies the credit of the link object. */ void node_set_link(NODE *node, const char *url, const char *label, int credit); /* Get a vector of keywords. `node' specifies a node object. `id' specifies the ID number of a document. The return value is a map object of keywords. The returned object should be destroyed with `cbmapclose'. */ CBMAP *node_etch_doc(NODE *node, int id); /* Create a read-write lock object. The return value is a read-write lock object. */ RWLOCK *rwlock_new(void); /* Destroy a read-write lock object. `rwlock' specifies a read-write lock object. */ void rwlock_delete(RWLOCK *rwlock); /* Lock a read-write lock object. `rwlock' specifies a read-write lock object. `wmode' specifies whether the lock is writer. The return value is true if success, else it is false. */ int rwlock_lock(RWLOCK *rwlock, int wmode); /* Unlock a read-write lock object. `rwlock' specifies a read-write lock object. The return value is true if success, else it is false. */ int rwlock_unlock(RWLOCK *rwlock); /* Get the number of readers locking a read-write lock object. `rwlock' specifies a read-write lock object. The return value is the number of readers locking a read-write lock object. */ int rwlock_rnum(RWLOCK *rwlock); /* Create a result map object. The return value is a result map object. */ RESMAP *resmap_new(void); /* Destroy a result map object. `resmap' specifies a result map object. */ void resmap_delete(RESMAP *resmap); /* Add a result document data to a result map object. `resmap' specifies a result map object. `score' specifies the score of the document. `doc' specifies a document object of the document. It is closed internally. `attrs' specifies the attributes of the document. It can be `NULL'. It is deleted internally. `body' specifies the body data of the document. It can be `NULL'. It is freed internally. */ void resmap_put(RESMAP *resmap, int score, ESTDOC *doc, CBMAP *attrs, char *body); /* Get a list object of result objects in a result map objects. `resmap' specifies a result map object. `nump' specifies the pointer to a variable to which the number of elements in the result is assigned. `order' specifies an expression for the order. If it is `NULL', the order is by score descending. `distinct' specifies the name of the distinct attribute. If it is `NULL', no filter is used. The return value is an array whose elements are result document objects. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ RESDOC **resmap_list(RESMAP *resmap, int *nump, const char *order, const char *distinct); /* Be a daemon process. `curdir' specifies the path of the current directory of the daemon. The return value is true if success, else it is false. */ int be_daemon(const char *curdir); #endif /* duplication check */ /* END OF FILE */ hyperestraier-1.4.13/md5.c000066400000000000000000000312241125261632700153260ustar00rootroot00000000000000/* Copyright (C) 1999, 2000, 2002 Aladdin Enterprises. All rights reserved. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. L. Peter Deutsch ghost@aladdin.com */ /* $Id: md5.c,v 1.6 2002/04/13 19:20:28 lpd Exp $ */ /* Independent implementation of MD5 (RFC 1321). This code implements the MD5 Algorithm defined in RFC 1321, whose text is available at http://www.ietf.org/rfc/rfc1321.txt The code is derived from the text of the RFC, including the test suite (section A.5) but excluding the rest of Appendix A. It does not include any code or documentation that is identified in the RFC as being copyrighted. The original and principal author of md5.c is L. Peter Deutsch . Other authors are noted in the change history that follows (in reverse chronological order): 2002-04-13 lpd Clarified derivation from RFC 1321; now handles byte order either statically or dynamically; added missing #include in library. 2002-03-11 lpd Corrected argument list for main(), and added int return type, in test program and T value program. 2002-02-21 lpd Added missing #include in test program. 2000-07-03 lpd Patched to eliminate warnings about "constant is unsigned in ANSI C, signed in traditional"; made test program self-checking. 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5). 1999-05-03 lpd Original version. */ #include "md5.h" #include #undef BYTE_ORDER /* 1 = big-endian, -1 = little-endian, 0 = unknown */ #ifdef ARCH_IS_BIG_ENDIAN # define BYTE_ORDER (ARCH_IS_BIG_ENDIAN ? 1 : -1) #else # define BYTE_ORDER 0 #endif #define T_MASK ((md5_word_t)~0) #define T1 /* 0xd76aa478 */ (T_MASK ^ 0x28955b87) #define T2 /* 0xe8c7b756 */ (T_MASK ^ 0x173848a9) #define T3 0x242070db #define T4 /* 0xc1bdceee */ (T_MASK ^ 0x3e423111) #define T5 /* 0xf57c0faf */ (T_MASK ^ 0x0a83f050) #define T6 0x4787c62a #define T7 /* 0xa8304613 */ (T_MASK ^ 0x57cfb9ec) #define T8 /* 0xfd469501 */ (T_MASK ^ 0x02b96afe) #define T9 0x698098d8 #define T10 /* 0x8b44f7af */ (T_MASK ^ 0x74bb0850) #define T11 /* 0xffff5bb1 */ (T_MASK ^ 0x0000a44e) #define T12 /* 0x895cd7be */ (T_MASK ^ 0x76a32841) #define T13 0x6b901122 #define T14 /* 0xfd987193 */ (T_MASK ^ 0x02678e6c) #define T15 /* 0xa679438e */ (T_MASK ^ 0x5986bc71) #define T16 0x49b40821 #define T17 /* 0xf61e2562 */ (T_MASK ^ 0x09e1da9d) #define T18 /* 0xc040b340 */ (T_MASK ^ 0x3fbf4cbf) #define T19 0x265e5a51 #define T20 /* 0xe9b6c7aa */ (T_MASK ^ 0x16493855) #define T21 /* 0xd62f105d */ (T_MASK ^ 0x29d0efa2) #define T22 0x02441453 #define T23 /* 0xd8a1e681 */ (T_MASK ^ 0x275e197e) #define T24 /* 0xe7d3fbc8 */ (T_MASK ^ 0x182c0437) #define T25 0x21e1cde6 #define T26 /* 0xc33707d6 */ (T_MASK ^ 0x3cc8f829) #define T27 /* 0xf4d50d87 */ (T_MASK ^ 0x0b2af278) #define T28 0x455a14ed #define T29 /* 0xa9e3e905 */ (T_MASK ^ 0x561c16fa) #define T30 /* 0xfcefa3f8 */ (T_MASK ^ 0x03105c07) #define T31 0x676f02d9 #define T32 /* 0x8d2a4c8a */ (T_MASK ^ 0x72d5b375) #define T33 /* 0xfffa3942 */ (T_MASK ^ 0x0005c6bd) #define T34 /* 0x8771f681 */ (T_MASK ^ 0x788e097e) #define T35 0x6d9d6122 #define T36 /* 0xfde5380c */ (T_MASK ^ 0x021ac7f3) #define T37 /* 0xa4beea44 */ (T_MASK ^ 0x5b4115bb) #define T38 0x4bdecfa9 #define T39 /* 0xf6bb4b60 */ (T_MASK ^ 0x0944b49f) #define T40 /* 0xbebfbc70 */ (T_MASK ^ 0x4140438f) #define T41 0x289b7ec6 #define T42 /* 0xeaa127fa */ (T_MASK ^ 0x155ed805) #define T43 /* 0xd4ef3085 */ (T_MASK ^ 0x2b10cf7a) #define T44 0x04881d05 #define T45 /* 0xd9d4d039 */ (T_MASK ^ 0x262b2fc6) #define T46 /* 0xe6db99e5 */ (T_MASK ^ 0x1924661a) #define T47 0x1fa27cf8 #define T48 /* 0xc4ac5665 */ (T_MASK ^ 0x3b53a99a) #define T49 /* 0xf4292244 */ (T_MASK ^ 0x0bd6ddbb) #define T50 0x432aff97 #define T51 /* 0xab9423a7 */ (T_MASK ^ 0x546bdc58) #define T52 /* 0xfc93a039 */ (T_MASK ^ 0x036c5fc6) #define T53 0x655b59c3 #define T54 /* 0x8f0ccc92 */ (T_MASK ^ 0x70f3336d) #define T55 /* 0xffeff47d */ (T_MASK ^ 0x00100b82) #define T56 /* 0x85845dd1 */ (T_MASK ^ 0x7a7ba22e) #define T57 0x6fa87e4f #define T58 /* 0xfe2ce6e0 */ (T_MASK ^ 0x01d3191f) #define T59 /* 0xa3014314 */ (T_MASK ^ 0x5cfebceb) #define T60 0x4e0811a1 #define T61 /* 0xf7537e82 */ (T_MASK ^ 0x08ac817d) #define T62 /* 0xbd3af235 */ (T_MASK ^ 0x42c50dca) #define T63 0x2ad7d2bb #define T64 /* 0xeb86d391 */ (T_MASK ^ 0x14792c6e) static void md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/) { md5_word_t a = pms->abcd[0], b = pms->abcd[1], c = pms->abcd[2], d = pms->abcd[3]; md5_word_t t; #if BYTE_ORDER > 0 /* Define storage only for big-endian CPUs. */ md5_word_t X[16]; #else /* Define storage for little-endian or both types of CPUs. */ md5_word_t xbuf[16]; const md5_word_t *X; #endif { #if BYTE_ORDER == 0 /* * Determine dynamically whether this is a big-endian or * little-endian machine, since we can use a more efficient * algorithm on the latter. */ static const int w = 1; if (*((const md5_byte_t *)&w)) /* dynamic little-endian */ #endif #if BYTE_ORDER <= 0 /* little-endian */ { /* * On little-endian machines, we can process properly aligned * data without copying it. */ if (!((data - (const md5_byte_t *)0) & 3)) { /* data are properly aligned */ X = (const md5_word_t *)data; } else { /* not aligned */ memcpy(xbuf, data, 64); X = xbuf; } } #endif #if BYTE_ORDER == 0 else /* dynamic big-endian */ #endif #if BYTE_ORDER >= 0 /* big-endian */ { /* * On big-endian machines, we must arrange the bytes in the * right order. */ const md5_byte_t *xp = data; int i; # if BYTE_ORDER == 0 X = xbuf; /* (dynamic only) */ # else # define xbuf X /* (static only) */ # endif for (i = 0; i < 16; ++i, xp += 4) xbuf[i] = xp[0] + (xp[1] << 8) + (xp[2] << 16) + (xp[3] << 24); } #endif } #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) /* Round 1. */ /* Let [abcd k s i] denote the operation a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */ #define F(x, y, z) (((x) & (y)) | (~(x) & (z))) #define SET(a, b, c, d, k, s, Ti)\ t = a + F(b,c,d) + X[k] + Ti;\ a = ROTATE_LEFT(t, s) + b /* Do the following 16 operations. */ SET(a, b, c, d, 0, 7, T1); SET(d, a, b, c, 1, 12, T2); SET(c, d, a, b, 2, 17, T3); SET(b, c, d, a, 3, 22, T4); SET(a, b, c, d, 4, 7, T5); SET(d, a, b, c, 5, 12, T6); SET(c, d, a, b, 6, 17, T7); SET(b, c, d, a, 7, 22, T8); SET(a, b, c, d, 8, 7, T9); SET(d, a, b, c, 9, 12, T10); SET(c, d, a, b, 10, 17, T11); SET(b, c, d, a, 11, 22, T12); SET(a, b, c, d, 12, 7, T13); SET(d, a, b, c, 13, 12, T14); SET(c, d, a, b, 14, 17, T15); SET(b, c, d, a, 15, 22, T16); #undef SET /* Round 2. */ /* Let [abcd k s i] denote the operation a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */ #define G(x, y, z) (((x) & (z)) | ((y) & ~(z))) #define SET(a, b, c, d, k, s, Ti)\ t = a + G(b,c,d) + X[k] + Ti;\ a = ROTATE_LEFT(t, s) + b /* Do the following 16 operations. */ SET(a, b, c, d, 1, 5, T17); SET(d, a, b, c, 6, 9, T18); SET(c, d, a, b, 11, 14, T19); SET(b, c, d, a, 0, 20, T20); SET(a, b, c, d, 5, 5, T21); SET(d, a, b, c, 10, 9, T22); SET(c, d, a, b, 15, 14, T23); SET(b, c, d, a, 4, 20, T24); SET(a, b, c, d, 9, 5, T25); SET(d, a, b, c, 14, 9, T26); SET(c, d, a, b, 3, 14, T27); SET(b, c, d, a, 8, 20, T28); SET(a, b, c, d, 13, 5, T29); SET(d, a, b, c, 2, 9, T30); SET(c, d, a, b, 7, 14, T31); SET(b, c, d, a, 12, 20, T32); #undef SET /* Round 3. */ /* Let [abcd k s t] denote the operation a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */ #define H(x, y, z) ((x) ^ (y) ^ (z)) #define SET(a, b, c, d, k, s, Ti)\ t = a + H(b,c,d) + X[k] + Ti;\ a = ROTATE_LEFT(t, s) + b /* Do the following 16 operations. */ SET(a, b, c, d, 5, 4, T33); SET(d, a, b, c, 8, 11, T34); SET(c, d, a, b, 11, 16, T35); SET(b, c, d, a, 14, 23, T36); SET(a, b, c, d, 1, 4, T37); SET(d, a, b, c, 4, 11, T38); SET(c, d, a, b, 7, 16, T39); SET(b, c, d, a, 10, 23, T40); SET(a, b, c, d, 13, 4, T41); SET(d, a, b, c, 0, 11, T42); SET(c, d, a, b, 3, 16, T43); SET(b, c, d, a, 6, 23, T44); SET(a, b, c, d, 9, 4, T45); SET(d, a, b, c, 12, 11, T46); SET(c, d, a, b, 15, 16, T47); SET(b, c, d, a, 2, 23, T48); #undef SET /* Round 4. */ /* Let [abcd k s t] denote the operation a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */ #define I(x, y, z) ((y) ^ ((x) | ~(z))) #define SET(a, b, c, d, k, s, Ti)\ t = a + I(b,c,d) + X[k] + Ti;\ a = ROTATE_LEFT(t, s) + b /* Do the following 16 operations. */ SET(a, b, c, d, 0, 6, T49); SET(d, a, b, c, 7, 10, T50); SET(c, d, a, b, 14, 15, T51); SET(b, c, d, a, 5, 21, T52); SET(a, b, c, d, 12, 6, T53); SET(d, a, b, c, 3, 10, T54); SET(c, d, a, b, 10, 15, T55); SET(b, c, d, a, 1, 21, T56); SET(a, b, c, d, 8, 6, T57); SET(d, a, b, c, 15, 10, T58); SET(c, d, a, b, 6, 15, T59); SET(b, c, d, a, 13, 21, T60); SET(a, b, c, d, 4, 6, T61); SET(d, a, b, c, 11, 10, T62); SET(c, d, a, b, 2, 15, T63); SET(b, c, d, a, 9, 21, T64); #undef SET /* Then perform the following additions. (That is increment each of the four registers by the value it had before this block was started.) */ pms->abcd[0] += a; pms->abcd[1] += b; pms->abcd[2] += c; pms->abcd[3] += d; } void md5_init(md5_state_t *pms) { pms->count[0] = pms->count[1] = 0; pms->abcd[0] = 0x67452301; pms->abcd[1] = /*0xefcdab89*/ T_MASK ^ 0x10325476; pms->abcd[2] = /*0x98badcfe*/ T_MASK ^ 0x67452301; pms->abcd[3] = 0x10325476; } void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes) { const md5_byte_t *p = data; int left = nbytes; int offset = (pms->count[0] >> 3) & 63; md5_word_t nbits = (md5_word_t)(nbytes << 3); if (nbytes <= 0) return; /* Update the message length. */ pms->count[1] += nbytes >> 29; pms->count[0] += nbits; if (pms->count[0] < nbits) pms->count[1]++; /* Process an initial partial block. */ if (offset) { int copy = (offset + nbytes > 64 ? 64 - offset : nbytes); memcpy(pms->buf + offset, p, copy); if (offset + copy < 64) return; p += copy; left -= copy; md5_process(pms, pms->buf); } /* Process full blocks. */ for (; left >= 64; p += 64, left -= 64) md5_process(pms, p); /* Process a final partial block. */ if (left) memcpy(pms->buf, p, left); } void md5_finish(md5_state_t *pms, md5_byte_t digest[16]) { static const md5_byte_t pad[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; md5_byte_t data[8]; int i; /* Save the length before padding. */ for (i = 0; i < 8; ++i) data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3)); /* Pad to 56 bytes mod 64. */ md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1); /* Append the length. */ md5_append(pms, data, 8); for (i = 0; i < 16; ++i) digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3)); } hyperestraier-1.4.13/md5.h000066400000000000000000000065671125261632700153470ustar00rootroot00000000000000/* Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. L. Peter Deutsch ghost@aladdin.com */ /* $Id: md5.h,v 1.4 2002/04/13 19:20:28 lpd Exp $ */ /* Independent implementation of MD5 (RFC 1321). This code implements the MD5 Algorithm defined in RFC 1321, whose text is available at http://www.ietf.org/rfc/rfc1321.txt The code is derived from the text of the RFC, including the test suite (section A.5) but excluding the rest of Appendix A. It does not include any code or documentation that is identified in the RFC as being copyrighted. The original and principal author of md5.h is L. Peter Deutsch . Other authors are noted in the change history that follows (in reverse chronological order): 2002-04-13 lpd Removed support for non-ANSI compilers; removed references to Ghostscript; clarified derivation from RFC 1321; now handles byte order either statically or dynamically. 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5); added conditionalization for C++ compilation from Martin Purschke . 1999-05-03 lpd Original version. */ #ifndef md5_INCLUDED # define md5_INCLUDED /* * This package supports both compile-time and run-time determination of CPU * byte order. If ARCH_IS_BIG_ENDIAN is defined as 0, the code will be * compiled to run only on little-endian CPUs; if ARCH_IS_BIG_ENDIAN is * defined as non-zero, the code will be compiled to run only on big-endian * CPUs; if ARCH_IS_BIG_ENDIAN is not defined, the code will be compiled to * run on either big- or little-endian CPUs, but will run slightly less * efficiently on either one than if ARCH_IS_BIG_ENDIAN is defined. */ typedef unsigned char md5_byte_t; /* 8-bit byte */ typedef unsigned int md5_word_t; /* 32-bit word */ /* Define the state of the MD5 Algorithm. */ typedef struct md5_state_s { md5_word_t count[2]; /* message length in bits, lsw first */ md5_word_t abcd[4]; /* digest buffer */ md5_byte_t buf[64]; /* accumulate block */ } md5_state_t; #ifdef __cplusplus extern "C" { #endif /* Initialize the algorithm. */ void md5_init(md5_state_t *pms); /* Append a string to the message. */ void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes); /* Finish the message and return the digest. */ void md5_finish(md5_state_t *pms, md5_byte_t digest[16]); #ifdef __cplusplus } /* end extern "C" */ #endif #endif /* md5_INCLUDED */ hyperestraier-1.4.13/misc/000077500000000000000000000000001125261632700154265ustar00rootroot00000000000000hyperestraier-1.4.13/misc/chars.txt000066400000000000000000000053721125261632700172760ustar00rootroot00000000000000 !"#$%&'()*+,-./ 0123456789:;<=>? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~ テテテづεテテテテ暗嘉甘凝古催偲 テ静妥津禿氾陛姪療佚凖堙崚愿敕榲 テテ。テ「テ」テ、テ・テヲテァティテゥテェテォテャテュテョテッ テーテアテイテウテエテオテカテキテクテケテコテサテシテステセテソ トトトてζトトトト案夏監尭呼再柴 ト斉惰墜篤汎米牝瞭估卞堝崙愼敍榮 トト。ト「ト」ト、ト・トヲトァトィトゥトェトォトャトュトョトッ トートアトイトウトエトオトカトキトクトケトコトサトシトストセトソ ナナナでηナナナナ闇嫁看暁固最芝 ナ税打椎毒版頁滅稜佛卩塲崘愬敘槐 ナナ。ナ「ナ」ナ、ナ・ナヲナァナィナゥナェナォナャナュナョナッ ナーナアナイナウナエナオナカナキナクナケナコナサナシナスナセナソ ホ対槻鳶釆偏茂緑佩厥墅嶄慚斟榻 ホホ。ホ」ホ、ホ・ホヲホァホィホゥ ホアホイホウホエホオホカホキホクホケホコホサホシホスホセホソ マママぱρママママ委 ミミミひσミミミミ威禍諌巾糊災社 ミ籍岱漬寅頒片孟厘侑厰墟嶢慴斷榧 ミミ。ミ「ミ」ミ、ミ・ミヲミァミィミゥミェミォミャミュミョミッ ミーミアミイミウミエミオミカミキミクミケミコミサミシミスミセミソ ムムムびτムムムム尉禾貫錦袴采紗 ム績帯柘酉飯篇毛林佯厶墫嶝慯旃樮 スアスイスウスエスオスカスキスクスケスコスサスシスススセスソセセセゑセセ セセセセ茨セ会セ奇セ具セ鯉セ搾セ趣セ擾セ撰セ托セ抵セ会セ費セ包セ セ暦セ假セ呻セ夲セ幢セ懶スヲセ スカセ橸スキセ橸スクセ橸スケセ橸スコセ橸セセ橸セセ橸セゑセ橸セセ橸セセ セ奇セ橸セ具セ橸セ鯉セ橸セ搾セ橸セ趣セ橸セ奇セ滂セ具セ滂セ鯉セ滂セ搾セ滂セ趣セ ス。ス「ス」ス、ス・ ---- 繝帙ャ繝励せ繝繝繝励§繧繝シ繧薙キシ Hyper Estraier 1.1.1繧偵Μ繝ェ繝シ繧ケ縺励∪縺励◆縲 莉雁屓縺ッ縲∵律譛ャ隱槭ョ蠖「諷狗エ隗」譫撰シ亥縺九■譖ク縺搾シ峨r陦後≧MeCab縺ィ縺縺繧ス繝輔ヨ繧ヲ繧ァ繧「繧堤オ縺ソ霎シ繧薙〒縲 繧医j邊セ蠎ヲ縺ョ鬮倥>讀懃エ「縺後〒縺阪k繧医≧縺ォ縺ェ繧翫∪縺励◆縲 荳闊ャ逧縺ォ險縺」縺ヲ縲∝縺九■譖ク縺肴婿蠑上〒繧ュ繝シ繧剃ス懊k讀懃エ「繧キ繧ケ繝繝縺縺ィ縲∫イセ蠎ヲ縺碁ォ倥>蜿埼擇縲√≧縺セ縺 蛻縺九■譖ク縺阪〒縺阪↑縺蝣エ蜷茨シ郁セ樊嶌縺ォ縺ェ縺蜊倩ェ槭↑縺ゥシ峨ッ讀懃エ「縺ァ縺阪↑縺シ域、懃エ「繝「繝ャシ峨→縺縺蝠城。後′ 縺ゅj縺セ縺吶ゆク譁ケ縲¨-gram譁ケ蠑上□縺ィ縲√御コャ驛ス縲阪〒讀懃エ「縺励※縲梧擲莠ャ驛ス縲阪′繝偵ャ繝医@縺ヲ縺励∪縺繧医≧縺ェ縲 讀懃エ「繧エ繝溘ョ蝠城。後′縺ゅj縺セ縺吶 Hyper Estraier縺ォMeCab繧堤オ縺ソ霎シ繧薙□蝣エ蜷医√∪縺壼縺九■譖ク縺阪ョ繧ュ繝シ縺ァ讀懃エ「縺励※繝偵ャ繝医@縺溘i 縺昴ョ邨先棡繧定。ィ遉コ縺励√≧縺セ縺乗、懃エ「縺ァ縺阪↑縺九▲縺溷エ蜷医ッN-gram縺ョ繧ュ繝シ縺ァ讀懃エ「縺励※縺昴ョ邨先棡繧 陦ィ遉コ縺励∪縺吶ょ、壹¥縺ョ蝣エ蜷医ッ鬮倬溘〒鬮倡イセ蠎ヲ縺ェ讀懃エ「繧貞コ縺吶%縺ィ縺後〒縺阪驕九′謔ェ縺蝣エ蜷医〒繧よ、懃エ「繝「繝ャ 縺ォ縺ェ繧九%縺ィ縺ッ縺ゅj縺セ縺帙s縲ゆク。譁ケ縺ョ濶ッ縺縺ィ縺灘叙繧翫→縺縺縺薙→縺ァ縺吶ゅ∪縺溘∝縺九■譖ク縺阪〒謚ス蜃コ縺励◆ 繧ュ繝シ縺ッ縲驥崎ヲ∬ェ橸シ育音蠕エ逧縺ェ隱橸シ峨ョ縺ソ繧偵う繝ウ繝繝繧ッ繧ケ縺ォ蜈・繧後∪縺吶ョ縺ァ縲∵勸騾壹ョ蛻縺九■譖ク縺榊梛縺ョ讀 邏「繧キ繧ケ繝繝シ域立Estraierシ峨↓豈斐∋縺ヲ繧ゅ鬮倡イセ蠎ヲ縺ァ縺励°繧るォ倬溘↑讀懃エ「縺悟庄閭ス縺ォ縺ェ縺」縺ヲ縺縺セ縺吶 MeCab縺ッ http://chasen.org/~taku/software/mecab/ 縺九i蜈・謇九@縺ヲ縲∵焔鬆縺ォ豐ソ縺」縺ヲ繧、繝ウ繧ケ繝医シ 繝ォ縺励※縺翫>縺ヲ縺上□縺輔>縲ゅ◎縺ョ荳翫〒縲?yper Estraier繧偵ン繝ォ繝峨☆繧矩圀縺ョ險ュ螳壹〒縲√./configure縲 縺ョ莉」繧上j縺ォ縲./configure --enable-mecab縲阪r螳溯。後@縺ヲ縺上□縺輔>縲 hyperestraier-1.4.13/misc/data001.est000066400000000000000000000002401125261632700172710ustar00rootroot00000000000000@uri=data001 @title=Material Girl Living in a material world And I am a material girl You know that we are living in a material world And I am a material girl hyperestraier-1.4.13/misc/data002.est000066400000000000000000000001471125261632700173000ustar00rootroot00000000000000@uri=data002 @title=Liberian Girl Liberian girl You came and you changed My world A love so brand new hyperestraier-1.4.13/misc/data003.est000066400000000000000000000005231125261632700172770ustar00rootroot00000000000000@uri=data003 @title=C code which reverses the bits in a word n = ((n >> 1) & 0x55555555) | ((n << 1) & 0xaaaaaaaa); n = ((n >> 2) & 0x33333333) | ((n << 2) & 0xcccccccc); n = ((n >> 4) & 0x0f0f0f0f) | ((n << 4) & 0xf0f0f0f0); n = ((n >> 8) & 0x00ff00ff) | ((n << 8) & 0xff00ff00); n = ((n >> 16) & 0x0000ffff) | ((n << 16) & 0xffff0000); hyperestraier-1.4.13/misc/data004.est000066400000000000000000000041141125261632700173000ustar00rootroot00000000000000@uri=data004 @title=譌・譛ャ蝗ス諞イ豕募燕譁 %VECTOR 譌・譛ャ蝗ス諞イ豕 96 諞イ豕 75 蝗ス豌 66 謌ヲ莠 30 蟷ウ蜥 30 蜴溽炊 30 蝗ス髫帷、セ莨 28 蝗ス螳カ 26 閾ェ逕ア 26 蜑肴枚 15 譌・譛ャ蝗ス豌代ッ縲∵ュ」蠖薙↓驕ク謖吶&繧後◆蝗ス莨壹↓縺翫¢繧倶サ」陦ィ閠繧帝壹§縺ヲ陦悟虚縺励√o繧後i縺ィ繧上l繧峨ョ蟄仙ュォ縺ョ縺溘a縺ォ縲∬ォク蝗ス豌代→縺ョ蜊泌柱縺ォ繧医k謌先棡縺ィ縲√o縺悟嵜蜈ィ蝨溘↓繧上◆縺、縺ヲ閾ェ逕ア縺ョ繧ゅ◆繧峨☆諱オ豐「繧堤「コ菫昴@縲∵帆蠎懊ョ陦檎ぜ縺ォ繧医▽縺ヲ蜀阪ウ謌ヲ莠峨ョ諠ィ遖阪′襍キ繧九%縺ィ縺ョ縺ェ縺繧縺縺ォ縺吶k縺薙→繧呈アコ諢上@縲√%縺薙↓荳サ讓ゥ縺悟嵜豌代↓蟄倥☆繧九%縺ィ繧貞ョ」險縺励√%縺ョ諞イ豕輔r遒コ螳壹☆繧九ゅ◎繧ゅ◎繧ょ嵜謾ソ縺ッ縲∝嵜豌代ョ蜴ウ邊帙↑菫。險励↓繧医k繧ゅョ縺ァ縺ゅ▽縺ヲ縲√◎縺ョ讓ゥ螽√ッ蝗ス豌代↓逕ア譚・縺励√◎縺ョ讓ゥ蜉帙ッ蝗ス豌代ョ莉」陦ィ閠縺後%繧後r陦御スソ縺励√◎縺ョ遖丞茜縺ッ蝗ス豌代′縺薙l繧剃コォ蜿励☆繧九ゅ%繧後ッ莠コ鬘樊勸驕阪ョ蜴溽炊縺ァ縺ゅj縲√%縺ョ諞イ豕輔ッ縲√°縺九k蜴溽炊縺ォ蝓コ縺上b縺ョ縺ァ縺ゅk縲ゅo繧後i縺ッ縲√%繧後↓蜿阪☆繧倶ク蛻縺ョ諞イ豕輔∵ウ穂サ、蜿翫ウ隧泌球繧呈賜髯、縺吶k縲 譌・譛ャ蝗ス豌代ッ縲∵£荵縺ョ蟷ウ蜥後r蠢オ鬘倥@縲∽ココ髢鍋嶌莠偵ョ髢「菫ゅr謾ッ驟阪☆繧句エ鬮倥↑逅諠ウ繧呈キア縺剰ェ隕壹☆繧九ョ縺ァ縺ゅ▽縺ヲ縲∝ケウ蜥後r諢帙☆繧玖ォク蝗ス豌代ョ蜈ャ豁」縺ィ菫。鄒ゥ縺ォ菫。鬆シ縺励※縲√o繧後i縺ョ螳牙ィ縺ィ逕溷ュ倥r菫晄戟縺励h縺縺ィ豎コ諢上@縺溘ゅo繧後i縺ッ縲∝ケウ蜥後r邯ュ謖√@縲∝ーょ宛縺ィ髫キ蠕薙∝悸霑ォ縺ィ蛛冗強繧貞慍荳翫°繧画ーク驕縺ォ髯、蜴サ縺励h縺縺ィ蜉ェ繧√※繧舌k蝗ス髫帷、セ莨壹↓縺翫>縺ヲ縲∝錐隱峨≠繧句慍菴阪r蜊繧√◆縺縺ィ諤昴オ縲ゅo繧後i縺ッ縲∝ィ荳也阜縺ョ蝗ス豌代′縲√イ縺ィ縺励¥諱先悶→谺荵上°繧牙阪°繧後∝ケウ蜥後ョ縺縺。縺ォ逕溷ュ倥☆繧区ィゥ蛻ゥ繧呈怏縺吶k縺薙→繧堤「コ隱阪☆繧九 繧上l繧峨ッ縲√>縺・繧後ョ蝗ス螳カ繧ゅ∬ェ蝗ス縺ョ縺薙→縺ョ縺ソ縺ォ蟆ょソオ縺励※莉門嵜繧堤┌隕悶@縺ヲ縺ッ縺ェ繧峨↑縺縺ョ縺ァ縺ゅ▽縺ヲ縲∵帆豐サ驕灘セウ縺ョ豕募援縺ッ縲∵勸驕咲噪縺ェ繧ゅョ縺ァ縺ゅj縲√%縺ョ豕募援縺ォ蠕薙オ縺薙→縺ッ縲∬ェ蝗ス縺ョ荳サ讓ゥ繧堤カュ謖√@縲∽サ門嵜縺ィ蟇セ遲蛾未菫ゅ↓遶九◆縺縺ィ縺吶k蜷蝗ス縺ョ雋ャ蜍吶〒縺ゅk縺ィ菫。縺壹k縲 譌・譛ャ蝗ス豌代ッ縲∝嵜螳カ縺ョ蜷崎ェ峨↓縺九¢縲∝ィ蜉帙r縺ゅ£縺ヲ縺薙ョ蟠鬮倥↑逅諠ウ縺ィ逶ョ逧繧帝#謌舌☆繧九%縺ィ繧定ェ薙オ縲 譌・譛ャ蝗ス諞イ豕 蜑肴枚 hyperestraier-1.4.13/misc/data005.est000066400000000000000000000044041125261632700173030ustar00rootroot00000000000000@uri=data005 @title=QDBM %SCORE 10000000 QDBM縺ッ繝繝シ繧ソ繝吶シ繧ケ繧呈桶縺繝ォ繝シ繝√Φ鄒、縺ョ繝ゥ繧、繝悶Λ繝ェ縺ァ縺吶ゅョ繝シ繧ソ繝吶シ繧ケ縺ィ縺縺」縺ヲ繧ょ腰邏斐↑繧ゅョ縺ァ縲√く繝シ縺ィ蛟、縺ョ繝壹い縺九i縺ェ繧九Ξ繧ウ繝シ繝臥セ、繧呈シ邏阪@縺溘ョ繝シ繧ソ繝輔ぃ繧、繝ォ縺ァ縺吶ゅく繝シ縺ィ蛟、縺ッ莉サ諢上ョ髟キ縺輔r謖√▽荳騾」縺ョ繝舌う繝亥励〒縺ゅj縲∵枚蟄怜励〒繧ゅヰ繧、繝翫Μ縺ァ繧よ桶縺縺薙→縺後〒縺阪∪縺吶ゅユ繝シ繝悶Ν繧繝繝シ繧ソ蝙九ョ讎ょソオ縺ッ縺ゅj縺セ縺帙s縲ゅΞ繧ウ繝シ繝峨ッ繝上ャ繧キ繝・陦ィ縺セ縺溘ッB+譛ィ縺ァ邱ィ謌舌&繧後∪縺吶 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. 繝上ャ繧キ繝・陦ィ縺ョ繝繝シ繧ソ繝吶シ繧ケ縺ァ縺ッ縲√く繝シ縺ッ繝繝シ繧ソ繝吶シ繧ケ蜀縺ァ荳諢上〒縺ゅj縲√く繝シ縺碁崎、縺吶k隍謨ー縺ョ繝ャ繧ウ繝シ繝峨r譬シ邏阪☆繧九%縺ィ縺ッ縺ァ縺阪∪縺帙s縲ゅ%縺ョ繝繝シ繧ソ繝吶シ繧ケ縺ォ蟇セ縺励※縺ッ縲√く繝シ縺ィ蛟、繧呈欠螳壹@縺ヲ繝ャ繧ウ繝シ繝峨r譬シ邏阪@縺溘j縲√く繝シ繧呈欠螳壹@縺ヲ蟇セ蠢懊☆繧九Ξ繧ウ繝シ繝峨r蜑企勁縺励◆繧翫√く繝シ繧呈欠螳壹@縺ヲ蟇セ蠢懊☆繧九Ξ繧ウ繝シ繝峨r讀懃エ「縺励◆繧翫☆繧九%縺ィ縺後〒縺阪∪縺吶ゅ∪縺溘√ョ繝シ繧ソ繝吶シ繧ケ縺ォ譬シ邏阪@縺ヲ縺ゅk蜈ィ縺ヲ縺ョ繧ュ繝シ繧帝荳榊酔縺ォ荳縺、縺壹▽蜿悶j蜃コ縺吶%縺ィ繧ゅ〒縺阪∪縺吶ゅ%縺ョ繧医≧縺ェ謫堺ス懊ッ縲ゞNIX讓呎コ悶〒螳夂セゥ縺輔l縺ヲ縺繧汽BM繝ゥ繧、繝悶Λ繝ェ縺翫h縺ウ縺昴ョ霑ス蠕薙〒縺ゅkNDBM繧ЖDBM縺ォ鬘槭☆繧九b縺ョ縺ァ縺吶2DBM縺ッDBM縺ョ繧医j濶ッ縺莉」譖ソ縺ィ縺励※蛻ゥ逕ィ縺吶k縺薙→縺後〒縺阪∪縺吶 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. QDBM: 鬮倬溯ウ譁吝渕逶、邂。逅蝎ィ hyperestraier-1.4.13/misc/echigo.est000066400000000000000000000010701125261632700173770ustar00rootroot00000000000000@uri=http://hyperestraier.sourceforge.net/misc/echigo.txt @title=雜雁セ悟ア @author=縺贋サ」螳俶ァ,雜雁セ悟ア @genre=history 縺ョ縺縲∬カ雁セ悟ア九鬲壼ソ縺ゅl縺ー豌エ蠢縲ゅo縺九▲縺ヲ縺翫m縺縺ョ縲 縺昴l縺ッ繧ゅ≧縲√♀莉」螳俶ァ倥ゅ%縺。繧峨r縺顔エ阪a縺上□縺輔>縺セ縺帙 縺サ縺サ縺縲鮟驥題牡縺ョ闖灘ュ舌°縲ゅo縺励ッ縺薙>縺、縺ォ逶ョ縺檎┌縺上※縺ョ縲 縺舌∈縺ク縲ゅ%繧後′雖後>縺ェ閠縺ェ縺ゥ縺斐*縺縺セ縺帙〓縲 縺励°縺苓カ雁セ悟ア九√♀荳サ繧ゅ↑縺九↑縺区が繧医ョ縺縲 縺縺医>縺医√♀莉」螳俶ァ倥↓縺ッ縺九↑縺縺セ縺帙〓縲 繧縺ッ縺ッ縺ッ縺ッ縺ッ縺ッ 縺オ縺ク縺ク縺ク縺ク縺ク縺ク hyperestraier-1.4.13/misc/francais.txt000066400000000000000000000100521125261632700177530ustar00rootroot00000000000000I. Allons enfants de la Patrie Le jour de gloire est arriv! Contre nous de la tyrannie L'テゥtendard sanglant est levテゥ Entendez-vous dans nos campagnes Mugir ces fテゥroces soldats? Ils viennent jusque dans vos bras. テ曳orger vos fils, vos compagnes! Refrain: Aux armes citoyens Formez vos bataillons Marchons, marchons Qu'un sang impur Abreuve nos sillons II. Que veut cette horde d'esclaves De traテョtres, de rois conjurテゥs? Pour qui ces ignobles entraves Ces fers dティs longtemps prテゥparテゥs? Franテァais, pour nous, ah! quel outrage Quels transports il doit exciter? C'est nous qu'on ose mテゥditer De rendre テ l'antique esclavage! III. Quoi ces cohortes テゥtrangティres! Feraient la loi dans nos foyers! Quoi! ces phalanges mercenaires Terrasseraient nos fils guerriers! Grand Dieu! par des mains enchaテョnテゥes Nos fronts sous le joug se ploieraient De vils despotes deviendraient Les maテョtres des destinテゥes. IV. Tremblez, tyrans et vous perfides L'opprobre de tous les partis Tremblez! vos projets parricides Vont enfin recevoir leurs prix! Tout est soldat pour vous combattre S'ils tombent, nos jeunes hテゥros La France en produit de nouveaux, Contre vous tout prテェts テ se battre. V Franテァais, en guerriers magnanimes Portez ou retenez vos coups! テ英argnez ces tristes victimes テ regret s'armant contre nous Mais ces despotes sanguinaires Mais ces complices de Bouillテゥ Tous ces tigres qui, sans pitiテゥ Dテゥchirent le sein de leur mティre! VI. Amour sacrテゥ de la Patrie Conduis, soutiens nos bras vengeurs Libertテゥ, Libertテゥ chテゥrie Combats avec tes dテゥfenseurs! Sous nos drapeaux, que la victoire Accoure テ tes mテ「les accents Que tes ennemis expirants Voient ton triomphe et notre gloire! VII. Couplet des enfants Nous entrerons dans la carriティre Quand nos aテョnテゥs n'y seront plus Nous y trouverons leur poussiティre Et la trace de leurs vertus Bien moins jaloux de leur survivre Que de partager leur cercueil Nous aurons le sublime orgueil De les venger ou de les suivre! VIII. Couplet supprimテゥ par Servan, Ministre de la Guerre en 1792 Dieu de clテゥmence et de justice Vois nos tyrans, juge nos coeurs Que ta bontテゥ nous soit propice Dテゥfends-nous de ces oppresseurs Tu rティgnes au ciel et sur terre Et devant Toi, tout doit flテゥchir De ton bras, viens nous soutenir Toi, grand Dieu, maテョtre du tonnerre. Couplets supplテゥmentaires IX. Peuple franテァais, connais ta gloire; Couronnテゥ par l'テ曳alitテゥ, Quel triomphe, quelle victoire, D'avoir conquis la Libertテゥ! Le Dieu qui lance le tonnerre Et qui commande aux テゥlテゥments, Pour exterminer les tyrans, Se sert de ton bras sur la terre. X. Nous avons de la tyrannie Repoussテゥ les derniers efforts; De nos climats, elle est bannie; Chez les Franテァais les rois sont morts. Vive テ jamais la Rテゥpublique! Anathティme テ la royautテゥ! Que ce refrain, partout portテゥ, Brave des rois la politique. XI. La France que l'Europe admire テ reconquis la Libertテゥ Et chaque citoyen respire Sous les lois de l'テ曳alitテゥ; Un jour son image chテゥrie S'テゥtendra sur tout l'univers. Peuples, vous briserez vos fers Et vous aurez une Patrie! XII. Foulant aux pieds les droits de l'Homme, Les soldatesques lテゥgions Des premiers habitants de Rome Asservirent les nations. Un projet plus grand et plus sage Nous engage dans les combats Et le Franテァais n'arme son bras Que pour dテゥtruire l'esclavage. XIII. Oui! dテゥjテ d'insolents despotes Et la bande des テゥmigrテゥs Faisant la guerre aux Sans-Culottes Par nos armes sont altテゥrテゥs; Vainement leur espoir se fonde Sur le fanatisme irritテゥ, Le signe de la Libertテゥ Fera bientテエt le tour du monde. XIV. O vous! que la gloire environne, Citoyens, illustres guerriers, Craignez, dans les champs de Bellone, Craignez de flテゥtrir vos lauriers! Aux noirs soupテァons inaccessibles Envers vos chefs, vos gテゥnテゥraux, Ne quittez jamais vos drapeaux, Et vous resterez invincibles. XV. Enfants, que l'Honneur, la Patrie Fassent l'objet de tous nos vナ砥x! Ayons toujours l'テ「me nourrie Des feux qu'ils inspirent tous deux. Soyons unis! Tout est possible; Nos vils ennemis tomberont, Alors les Franテァais cesseront De chanter ce refrain terrible: hyperestraier-1.4.13/misc/gwtest.html000066400000000000000000000055401125261632700176350ustar00rootroot00000000000000 繝。繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、縺ョ繝繧ケ繝

    繝。繧ソ讀懃エ「繧イ繝シ繝医え繧ァ繧、縺ョ繝繧ケ繝


    隲也炊遨阪Γ繧ソ讀懃エ「シestscout.cgiシ

    phrase1:
    phrase2:
    phrase3:
    phrase4:
    phrase5:
    attr1:
    attr2:
    attr3:
    attr4:
    attr5:
    max:
    submit:

    隲也炊蜥後Γ繧ソ讀懃エ「シestsupt.cgiシ

    phrase1:
    phrase2:
    phrase3:
    phrase4:
    phrase5:
    attr1:
    attr2:
    attr3:
    attr4:
    attr5:
    max:
    submit:

    hyperestraier-1.4.13/misc/index.est000066400000000000000000000004241125261632700172520ustar00rootroot00000000000000@uri=http://www.mikio.gov/fortune/ @title=Turing's Question @author=Dijkstra Alan Turing thought about criteria to settle the question of whether machines can think, a question of which we now know that it is about as relevant as the question of whether submarines can swim. hyperestraier-1.4.13/misc/lang-de.html000066400000000000000000000431111125261632700176230ustar00rootroot00000000000000 www.bundespraesident.de: Der Bundespräsident / Home

    Navigation mittels Accesskeys:

    Papst Benedikt XVI. breitet die Arme aus.

    "Von ganzem Herzen gratuliere ich Ihnen zur Wahl zum Oberhaupt der Katholischen Kirche. Wie berall in der Welt haben auch hier in Deutschland Millionen Gl舫bige gespannt auf den Ausgang des Konklaves in Rom gewartet."

    Weiter lesen

    Erffnung Produktionsst舩te der Braun Melsungen AG

    Gru゚wort von Bundespr舖ident Horst Khler bei der Erffnung der Produktionsst舩te L.I.F.E. Pfieffewiesen der B. Braun Melsungen AG

    "Die Erffnung der neuen Produktionsst舩te macht deutlich: Es ist mglich, in unserem Land auch unter den neuen Bedingungen des internationalen Wettbewerbs Arbeitspl舩ze zu halten und neue zu schaffen. Das ist ermutigend in einer Zeit, in der die hartn臘kig hohe Arbeitslosigkeit unsere drckendste Sorge ist und in der sich so viele Menschen vergeblich um Arbeit bemhen."

    Weiter lesen

    Schillerjahr 2005

    Gru゚wort von Bundespr舖ident Horst Khler anl舖slich der Schillermatinee im Berliner Ensemble

    "Einige einleitende Gedanken zu dieser Matinee sind mir aufgetragen. Das bedeutet: Sie bekommen heute Morgen keine Schiller-Wrdigung durch das Staatsoberhaupt; ich mchte vielmehr nur Einiges anrei゚en, was mir aus Anlass des Schiller-Jahres zu diesem Klassiker und zur Lage der Kultur in Deutschland wichtig erscheint."

    Weiter lesen

    Deutschland in Japan

    Gru゚wort von Bundespr舖ident Horst Khler bei der Erffnung von "Deutschland in Japan" und der Ausstellung der Berliner Museumsinsel in Tokyo

    "Haben Sie vielen Dank fr die freundliche Begr゚ung. Ich freue mich sehr darber, heute mit Ihnen hier im Heiseikan den Beginn von "Deutschland in Japan 2005/2006" und die Erffnung der Ausstellung der Berliner Museumsinsel feiern zu knnen."

    Weiter lesen

    "Die Ordnung der Freiheit"

    Rede von Bundespr舖ident Horst Khler beim Arbeitgeberforum "Wirtschaft und Gesellschaft" in Berlin

    "In Deutschland sind offiziell 5,216 Millionen Menschen arbeitslos. Sie werden daher von mir keine Festrede erwarten. Zur Sache also:
    Deutschland ist sich selber untreu geworden. Wir vernachl舖sigen schon lange das Erfolgsrezept, das der Bundesrepublik Deutschland nach dem Krieg Zuversicht und Wohlstand, Stabilit舩 und Ansehen gebracht hat."

    Weiter lesen

    Bildergalerie

    Der Bundespräsident umringt von Journalisten. Alle tragen Kittel und Plastikhauben.

    Besuch in Melsungen

    Weiter lesen
    Alle BildergalerienWeiter lesen

    Downloads

    Foto: Schloss Bellevue

    Schloss und Villa als
    Bildschirmhintergrund

    Weiter lesen

    Wissensquiz

    Das Amt des Bundespr舖identen
    Weiter lesen
    Die Bundespr舖identen
    Weiter lesen

     

    hyperestraier-1.4.13/misc/lang-fr.html000066400000000000000000000471621125261632700176540ustar00rootroot00000000000000 Accueil - Prテゥsidence de la Rテゥpublique



    espace un espace
    hyperestraier-1.4.13/misc/lang-ko.html000066400000000000000000001677461125261632700176710ustar00rootroot00000000000000 テサソヘエ ネィニ菎フチソ。 ソタスナ ーヘタサ ネッソオヌユエマエル. ステー「タ蠕ヨタホソ ニ菎フチキホ タフオソヌマステキチク F12ナークヲ エゥク」ステア ケルカエマエル.
    home キホアラタホ ネクソー。タヤ ステー「タ蠕ヨタホネィニ菎フチ セクータフクカエ sitemap テサソヘエ ソオケョ ネィニ菎フチ
    ウケォヌ エナキノ チ、サソワアウ ツソゥチ、コホ テサソヘエシメーウ チ、テ・タレキ眇ヌ テサソヘエ ナスナ テサソヘエ TV ソュクークカエ
     
    ニナ莇コスコ
    チウュ 4ソ 11タマ オカタマ アケコケ貉ョヌム ウケォヌ エナキノタフ トキッ エナキノ チヨテヨヌム アケコククツソ。シュ ツオホクョ シアシソ。ーヤシュ オケネ」 11ケソ。 ソオセキホ ウ エナキノタヌ タフクァタフ タネ テ牾クコケタサ シアケーゲー タヨエル.
    エナキノー ヌヤイイ タミエツ コクーシュ & コホテウコー セケォコクー
    アヌセ郛 ソゥサ タフケフチ
    コ」クヲクー クキスコヌテカナゥソャアクシメ ケ貉ョ
    セニタフオ鯊サ タソーコエソ。シュ アクヌマエツ タマタコ ソクョー。 ヌヤイイ ウェエイセ゚ クカカ・ヌム テ・タモタヤエマエル.
    。コステタ蟆ナキ。ソ。シュタヌ エ。、チ゚シメア篝ー」 コメーチ、ーナキ。 スヌナツソヘ ーウシアケ貔ネ。サコクーシュ
    ウ エナキノ ウサソワ, 4.19ケヲチ ツケ陦、ヌ衒ュ
    'アケケホ スナキレゲエツ ケケォコホ' ーュチカ
    。コオカタマ チ゚シメア篝 タホシーキテ ーヒナ 。サコクーシュ
    。ーー貘ー ソャエ チカネュ タフキ邏ツ サ酳クソゥセ゚。ア
    。ーナクーーウ カァ ソケサソソ ー。タ ネソタイタ。ア
    ナクーーウ カァ ソケサソソ ー。タ ネソタイタ
    ウ エナキノタコ ア篳ケソケサテウ セケォコクーソ。シュ 。ーステケホオ鯀。ーヤ スアーヤ ナクヌマーヤ ーーウヌマエツ ケ貉タフ ー。タ ネソータタフク ネソタイシコタサ ネョコクヌマエツ ケ貔ネ。アタフカー クサヌ゚エル.
    - ア篳ケソケサテウ セケォコクー
    ウ エナキノ, アケケホ スナキレゲエツ ケケォコホ ーュチカ
    ウエナキノタコ ケケォコホ セケォコクーソ。シュ 。ーチ、コホー。 タマヌマエツ オ・ チヲタマ セキチソ ーヘタコ スナキレコホチキタヌ ケョチヲキホ, スナキレタヌ シチリタサ エ ウタマ シ タヨエツ ニッエワタヌ ウキツタフ ヌハソ萇マエル。アー クサヌ゚エル.
    - ケケォコホ セケォコクー
    タッタサ鄒 ーキテ エコッタホ コクョヌホ
    ア雕クシ エコッタホー ケレウイテ タホサ鄰ヲオオコシュータコ 24タマ テカオオテサ タッタサ鄒 アケチ、サネイスヌ ニトセヌー ーキテヌリ コクョヌホ ヌ゚エル
    ー豎箏オシシー襍オタレコソ」ウッキケ ーウクキスト テ猊マグステチ
    チヲ3ネク ー豎箏オ シシー襍オタレコソ」ウッキケ ーウクキタサ チスノタクキホ テ猊マヌユエマエル. タフケ ヌ狃鄲ヌ ナォ シコータサ ア篩ヌマク, クオ コミオ鯊フ オオタレソケシタヌ チ、シクヲ エタウ・ シ タヨア篋ヲ ケルカエマエル.
    ヌムアヌタヌ テ・
    ア篏鄲フケフチ
    [ネ] チチ、ヌム ネタコ アセタヨエツ クカタスソ。
    ニスウエヌムタコ 'チチ、ヌム ネタフカ ケォセタホー。?'カエツ ネュオホクヲ クカタホオ衂ョエマスコカエツ エワセキホ ヌョセ
    エナキノコクーシュ
    。コチヲ4ツ エソワー戝ヲタァソネク。サネクタヌコクータレキ
    シアチアケ チタヤタサ チリコヌマー タヨエツ ヌムアケ ー戝ヲエツ シアチネューチ、タヌ オオター アロキホケネュソ。 オク・ オオタソ。 チク鯢リ タヨエル.
    アケチ、タマア
    ナーコクオ蠧。エツ エナキノ - タアナツソオ チヲ1コホシモスヌタ
    ステー」ー ーー」タヌ チヲセ セタフ, チア゙ソ。 アクセヨゲチ セハー クエマナヘ セユソ。シュ セチヲウェ ククウッ シ タヨエツ ステスコナロ, チ、コクネュ エナキノ
    ヌテキ。ステ
    ア篏鄲フケフチ
    ケフキ。クヲ タァヌム セ狆モ, ナクサ酳クソヘ ヌヤイイ
    チ、コホ, チ、ト。アヌ, ー戝ヲー, ステケホエワテシー。 ヌムタレクョソ。 クソゥ ナクサ酳クヌセ ーオソスヌテオ エルチ
    ア篏鄲フケフチ
    [エナキノコクーシュ]
    オカタマ チ゚シメア篝 タホシーキテ ーヒナ
    ア篏鄲フケフチ
    [ククネュ] タフタホコミタヌ イソクョタ箜
    ヌヤイイ ー。エツ ア
    4.20タコ タ蠕ヨタホタヌウッ
    テサソヘエ TV タフケフチ
    ケケォコホ セケォコクー ウ エナキノ ケ゚セ
    「コ ソタエテタヌ タマチ、タフ セスタエマエル.
    テサソヘエ ーカ タフケフチ ウラニシチ トョキウ タフケフチ
    タホナヘウン スナケョー & アケケホツソゥクカエ
    サーテハキチ エルタフウェケヘ トレクョセニ
    hyperestraier-1.4.13/misc/lang-ru.html000066400000000000000000000563621125261632700176750ustar00rootroot00000000000000 メチラノヤナフリモヤラマ マモモノノ | メチラノヤナフリモヤラナ マモモノハモヒマハ 貲トナメチテノノ
    メチラノヤナフリモヤラマ マモモノハモヒマハ 貲トナメチテノノ
    マメヘチヤノラホルナ トマヒユヘナホヤル
    チヤチフマヌ モナヤナラルネ ノホニマメヘチテノマホホルネ メナモユメモマラ
    鯰ヤナメチヒヤノラホルナ モナメラノモル

    メチラノヤナフリモヤラマ マモモノハモヒマハ 貲トナメチテノノ
    メチラノヤナフリモヤラナ マモモノハモヒマハ 貲トナメチテノノ
    メナトモナトチヤナフリ メチラノヤナフリモヤラチ マモモノハモヒマハ 貲トナメチテノノ
    チヘナモヤノヤナフリ メナトモナトチヤナフム メチラノヤナフリモヤラチ マモモノハモヒマハ 貲トナメチテノノ
    フナホル メチラノヤナフリモヤラチ マモモノハモヒマハ 貲トナメチテノノ
    メチラマラルナ マモホマラル トナムヤナフリホマモヤノ
    瞎ミチメチヤ メチラノヤナフリモヤラチ マモモノハモヒマハ 貲トナメチテノノ
    醯モユトチメモヤラナホホチム モフユヨツチ ラ 瞎ミチメチヤナ メチラノヤナフリモヤラチ マモモノハモヒマハ 貲トナメチテノノ
    フチホル ノ ミメマヌメチヘヘル メチラノヤナフリモヤラチ
    マテノチフリホマ-ワヒマホマヘノ゙ナモヒマナ メチレラノヤノナ ノ ノモミマフホナホノナ ツタトヨナヤチ
    ナヨトユホチメマトホルナ マヤホマロナホノム
    チモナトチホノム メチラノヤナフリモヤラチ
    Government meetings 
    マラナンチホノム ミマ モマテノチフリホルヘ ラマミメマモチヘ
    ナロナホノム メチラノヤナフリモヤラチ
    メチラノヤナフリモヤラマ ノ 貲トナメチフリホマナ Cマツメチホノナ
    ママメトノホチテノマホホルナ ノ モマラナンチヤナフリホルナ マメヌチホル

    貲トナメチフリホルナ マメヌチホル ノモミマフホノヤナフリホマハ ラフチモヤノ
    ヤメユヒヤユメチ ニナトナメチフリホルネ マメヌチホマラ ノモミマフホノヤナフリホマハ ラフチモヤノ
    ノホノモヤナメモヤラチ
    貲トナメチフリホルナ モフユヨツル
    貲トナメチフリホルナ チヌナホヤモヤラチ
    ヘノホノモヤナメモヤラチネ ノ ラナトマヘモヤラチネ

    メヌチホル ミメノ メチラノヤナフリモヤラナ
    メヌチホル ミメノ メチラノヤナフリモヤラナ

    醯モユトチメモヤラナホホルナ ニマホトル
    醯モユトチメモヤラナホホルナ ニマホトル

    メナモモ-テナホヤメ
    メナモモ-モフユヨツチ
    ニノテノチフリホチム ネメマホノヒチ
    ツレマメ
    モチハヤナ メチラノヤナフリモヤラチ マモモノハモヒマハ 貲トナメチテノノ

    ヤトナフ ミマ メチツマヤナ モ マツメチンナホノムヘノ ヌメチヨトチホ
    ツメチンナホノナ ラ メチラノヤナフリモヤラマ マモモノハモヒマハ 貲トナメチテノノ
    鯰ニマメヘチテノマホホルナ ヘチヤナメノチフル
    www.government.ru / メチラノヤナフリモヤラマ マモモノハモヒマハ 貲トナメチテノノ / メチラノヤナフリモヤラマ マモモノハモヒマハ 貲トナメチテノノ / メチラノヤナフリモヤラナ マモモノハモヒマハ 貲トナメチテノノ
    メチラノヤナフリモヤラナ マモモノハモヒマハ 貲トナメチテノノ
    21.04.2005  11:09
    ナヌマトホム ホチ マ゙ナメナトホマヘ レチモナトチホノノ メチラノヤナフリモヤラマ マモモノノ メチモモヘチヤメノラチナヤ マモホマラホルナ ミマヒチレチヤナフノ ミナメモミナヒヤノラホマヌマ ニノホチホモマラマヌマ ミフチホチ ホチ 2006-2008 ヌマトル. メナトモナトチヤナフリ メチラノヤナフリモヤラチ .贅チトヒマラ レチムラノフ, ゙ヤマ モマネメチホナホノナ ミメマニノテノヤチ ニナトナメチフリホマヌマ ツタトヨナヤチ ホチ 2006-ハ ノ ミマモフナトユタンノナ ヌマトル ムラフムナヤモム ホナマツネマトノヘルヘ トフム マツナモミナ゙ナホノム ニノホチホモマラマ-ワヒマホマヘノ゙ナモヒマハ モヤチツノフリホマモヤノ ラ モヤメチホナ.

    チヒ ミマドナメヒホユフ .贅チトヒマラ, ツタトヨナヤ マモモノノ ホチ 2006-ハ ヌマト モヒフチトルラチナヤモム マ゙ナホリ ホチミメムヨナホホマ, ラ モラムレノ モ ゙ナヘ ホナマツネマトノヘマ マヤヒチレチヤリモム マヤ ホナワニニナヒヤノラホルネ ノ ホナマミメチラトチホホルネ メチモネマトマラ. モヒフチトルラチタンノネモム ユモフマラノムネ ホナマツネマトノヘマ ホチハヤノ メナモユメモル トフム ラルミマフホナホノム, ラ ミナメラユタ マ゙ナメナトリ, モマテノチフリホルネ マツムレチヤナフリモヤラ, ミマドナメヒホユフ メナトモナトチヤナフリ メチラノヤナフリモヤラチ. マ ナヌマ モフマラチヘ, ツタトヨナヤ ホチ ツユトユンノハ ヌマト トマフヨナホ ミメナトユモヘチヤメノラチヤリ メチモネマトル ホチ メチレラノヤノナ ノホニメチモヤメユヒヤユメル ノ レチラナメロナホノナ メムトチ ラチヨホルネ メナニマメヘ.

    ... >>>
    ニノテノチフリホチム ネメマホノヒチ
    ナロナホノム メチラノヤナフリモヤラチ
    ヘノホノモヤナメモヤラチネ ノ ラナトマヘモヤラチネ
    hyperestraier-1.4.13/misc/lang-zh.html000066400000000000000000001422521125261632700176620ustar00rootroot00000000000000 ヨミサェネヒテケイコヘケヘ篆サイソ
     ヘ スサ イソ
      ヘ篆サイソウ、
      ヨメェケルヤア
      ラ鰒ッサケケ
      ラ、ヘ篏ケケ
      ラ、クロ。「ートケォハ
      イホケロヘ篆サイソ
      ヘ篆サツモモー
     ヘ篆サカッフャ
      ヘ篆サユイ゚
      ヘ簗ツサカッ
      ヨリメェスイサー
      ヘ簗ツネユウフ
      エハケネホテ
      ノテ。「ケォアィ
     ミツホナキホ
      キ「ムヤネヒフクサー
      タミミシヌユ゚サ睫オツシ
      ヘ篁シヌユ゚ミツホナヨミミト
      シヌユ゚キホ
      ケミツーシヌユ゚ユミエサ
      ケフィーシヌユ゚ユミエサ
     ケシメコヘオリヌ
      ムヌヨ゙オリヌ
      ホムヌアアキヌオリヌ
      キヌヨ゙オリヌ
      ナキムヌオリヌ
      ナキヨ゙オリヌ
      アアテタエムヨ゙オリヌ
      タュカ。テタヨ゙オリヌ
     ケシハホハフ
      ケシハラ鰒ッモサ瞑
      セソリ。「イテセモキタタゥノ「
      フヤシキィツノ
      ケシハネネオ耒ハフ
     チハツキホ
      チハツミツホナ
      ウケフリアフ瞎ム
      チハツヨェハカシス
      サ、ユユツテミミヨ、シ
      ヘ篁ネヒタエサェヌゥヨ、
      チハツネマヨ、。「ケォヨ、
      イホソシラハチマ
     ラハ チマ
      ヘ篁ラ、サェヘ篆サケルテイ
      スィスサケシメメサタタア
      ラィフ
      ヘ篆サタウフ
      ヘ篆サネヒホ
      ヘ篆サホトシ
      タアヨェハカ
      ヨミケヘ篆サハキノマオトスフ
    。、 コスフホウマッシヘトヘツ。サ瞑鰈ルソェ50ヨワトサカッ      。、 ムヌキヌキ蟒盂ユトサ コスフホヌゥハサ瞑鰔ムヤ      。、 コスフホサ眈チェコマケテリハ魑、ーイトマ     
    コスフホウマッシヘトヘツ。サ瞑鰈ルソェ50ヨワトサカッ
       
    。、 ムヌキヌキ蟒盂ユトサ コスフホヌゥハサ瞑鰔ムヤ (2005-04-24)
    。、 コスフホサ眈チェコマケテリハ魑、ーイトマ (2005-04-24)
    。、 コスフホサ眈ネユアセハラマ獎。ネェエソメサタノ (2005-04-24)
    。、 コスフホサ眈ヒシェソヒヒケフケラワヘウタュコユトェナオキ (2005-04-24)
    。、 コスフホサ眈モ。カネラワタミチク (2005-04-24)
    。、 コスフホサ眈シモトノラワヘウソ篋」カ (2005-04-24)
    クカ>>>

        (2005-04-22)
     

    」ィエヒタクトソキ「イシチヒクー140カ犧ケシメコヘウヌハミオトモミケリラ「メ簗ツマ」ゥヌトヤレウケヌーラミマクヤトカチ」ャホメテヌマ」ヘエヒマキホクトオトメモヨョツテエタエニスーイ。「ソタヨ」。
    キ「ムヤネヒフクサー
    ヘ篆サイソキ「ムヤネヒヌリクユセヘテタユクョフ眇サ。ーホイリホハフ筍アラワヘウアィク豢シヌユ゚ホハ
       
    。、 2005ト4ヤツ21ネユヘ篆サイソキ「ムヤネヒヌリクユヤレタミミシヌユ゚サ睨マエシヌユ゚ホハ (2005-04-21)
    。、 ヘ篆サイソキ「ムヤネヒヌリクユセヘヤシノェキ。、タュヌ犧オアム。ミツネホスフサハエシヌユ゚ホハ (2005-04-20)
    。、 2005ト4ヤツ19ネユヘ篆サイソキ「ムヤネヒヌリクユヤレタミミシヌユ゚サ睨マエシヌユ゚ホハ (2005-04-20)
    。、 ヘ篆サイソキ「ムヤネヒヌリクユセヘーヘモ。ケリマオエシヌユ゚ホハ (2005-04-19)
    。、 2005ト4ヤツ14ネユヘ篆サイソキ「ムヤネヒヌリクユヤレタミミシヌユ゚サ睨マエシヌユ゚ホハ (2005-04-14)
    。、 ヘ篆サイソキ「ムヤネヒヌリクユセヘネユテスフ螻ィウニヨミケチムァノ。ーアサコヲ。アハツエシヌユ゚ホハ (2005-04-14)
    クカ>>>
    ラ、ヘ箜ィオタ
    ヒモ鉚エハケマモ。カネテスフ蠖鯔ワホツラワタキテモ。ウノケ
    2.jpg    
    。、 キニツノアヨレメ鰆コウノチ「。ーキニヨミモムコテミ。ラ鬘ア (2005-04-22)
    。、 ヌミ。銷エハケム酩ホー獏タニメオラ鰒ッチェコマサ瞶マッ (2005-04-21)
    。、 ホ篌」チエハケマホャメイトノチェコマケクサケケクコヤネヒオンスサネォネィヨ、ハ (2005-04-21)
    。、 ヒホオツコ獸ワチハツマテマツクス鄂鯔ワホツラワタキテモ。ウノケ (2005-04-21)
    。、 ラ、ツャヘエハケケンセルー。カヨミケモ。マ。キヘシニャユケ (2005-04-21)
    。、 ツャハテエハケセルミミオスネホユミエサ (2005-04-21)
    クカ>>>
    コ」ヘ篦モモー
    ホネユソヒレア鰓ー」ャスウッケヤーチクイヨ
    17.jpg    
    。、 サトトョタオトツフヨ゙ (2005-02-02)
    。、 マラーョミトイサキヨケス ノヤョハヨモョオテヤ゙モ (2005-02-01)
    。、 ヤレメチタュソヒオトネユラモ」コテソフカシハヌユスカキ (2005-01-13)
    。、 サリメ荳オヒミ。ニスオアキュメ (2004-09-09)
    。、 エハケキネヒ」ャヤレー「クサコケーイホ」ボウ」オトネユラモタ (2004-08-27)
    。、 ヨミケラ、ー「クサコケエハケケンエヲタ6.10ソヨイタマョサハツシイ狆ヌ (2004-07-16)
    クカ>>>

     ラィフ
    コスフホヨマッキテホハホトタウ。「モ。ト癸「キニツノアイ「ウマッ2005トムヌキヌキ蟒蘯ヘヘツ。サ瞑鯰衞ョヨワトシヘトサカッ
    。、 コスフホウマッシヘトヘツ。サ瞑鰈ルソェ5...(2005-04-24)
    。、 ムヌキヌキ蟒盂ユトサ コスフホヌゥハサ瞑...(2005-04-24)
    。、 コスフホサ眈チェコマケテリハ魑、ーイトマ(2005-04-24)
    ヘ篆サイソケォヨレソェキナネユ2005ト4ヤツ15ネユ
    。、 ヌラタサヨニサッコオトハラエホケォヨレソェキナ...(2005-04-15)
    。、 サカッシモー」ィメサ」ゥ(2005-04-15)
    。、 サカッシモー」ィカ」ゥ(2005-04-15)
    ホツシメアヲラワタウキテトマムヌヒトケイ「ウマッムヌヨ゙コマラカヤサーオレヒトエホヘ箋、サ瞑鯀ェトサハス
    。、 モムメヨコヘニス コマラエルキ「ユケ:タユリ...(2005-04-13)
    。、 ホツシメアヲサ眈テスフ蠑ヌユ゚ フクキテモ。ネ...(2005-04-12)
    。、 ホツシメアヲヤレモ。カネオツタタケ、エムァキ「...(2005-04-12)
    ケシハノ扈瞶ァウヨホメヘィケ。カキエキヨチムケシメキィ。キ
    。、 ー「カシータムヌヘ篆サイソセヘヨミケ。カキエ...(2005-04-13)
    。、 タアネムヌヨァウヨホメネォケネヒエヘィケ。カ...(2005-04-08)
    。、 ヅツト瞋ヌチオシネヒアハセタス篌ヘヨァ...(2005-04-07)
    ホツシメアヲラワタセルミミヨミヘ箴ヌユ゚ユミエサ
    。、 ホツシメアヲラワタシヌユ゚ユミエサ盒ヨミヘ...(2005-03-14)
    。、 ホツシメアヲラワタエシヌユ゚ホハ」ィヘシニャメサ...(2005-03-14)
    。、 ホツシメアヲラワタエシヌユ゚ホハ」ィヘシニャカ...(2005-03-14)

    クカ獸ィフ>>>
    hyperestraier-1.4.13/misc/mymemo-ja.html000066400000000000000000000034761125261632700202210ustar00rootroot00000000000000 My Private Memo for Hyper Estraier

    Hyper Estraier縺ョ縺溘a縺ョ遘∫噪繝。繝「


    Cygwin+MinGW縺ァ縺ョ繝薙Ν繝臥腸蠅縺ョ險ュ螳壽婿豕

    • Cygwin縺ョ繧サ繝繝医い繝繝玲凾縺ォ縲`inGW縺ョgcc縺ィMinGW縺ョzlib繧る∈謚槭☆繧九
    • MinGW縺ョregex縺ッ http://gnuwin32.sourceforge.net/packages/regex-spencer.htm 縺九i謇九↓蜈・繧後k縲ゅ◎縺励※縲*.h 縺ッ /usr/include/mingw 縺ョ荳九↓縲*.lib 縺ィ *.a 縺ィ *.dll.a 縺ッ /lib/mingw 縺ョ荳九↓縲*.dll 縺ッ /bin縺ョ荳九↓遘サ蜍輔&縺帙k縲
    • MinGW縺ョlibiconv縺ッ http://www.mingw.org/ 縺九i謇九↓蜈・繧後k縲ゅ◎縺励※縲*.h 縺ッ /usr/include/mingw 縺ョ荳九↓縲*.dll.a 縺ッ /lib/mingw 縺ョ荳九↓縲*.dll 縺ッ /bin縺ョ荳九↓遘サ蜍輔&縺帙k縲
    • Pthreads for Win32縺ッ http://sources.redhat.com/pthreads-win32/ 縺九i謇九↓蜈・繧後k縲ゅ◎縺励※縲*.h 縺ッ /usr/include/mingw 縺ョ荳九↓縲*.a 縺ッ /lib/mingw 縺ョ荳九↓縲*.dll 縺ッ /bin縺ョ荳九↓遘サ蜍輔&縺帙k縲
    • xdoc2txt縺ッ http://www31.ocn.ne.jp/~h_ishida/xdoc2txt.html 縺九i謇九↓蜈・繧後k縲/usr/local/xdoc2txt 繧剃ス懈舌@縺ヲ繧「繝シ繧ォ繧、繝悶ョ荳蠑上r縺昴ョ荳ュ縺ォ遘サ蜍輔&縺帙k縲
    • QDBM縺ョ繧、繝ウ繧ケ繝医シ繝ォ縺ッ ./configure --enable-zlib --enable-iconv ; make mingw ; make install-win 縺ァ陦後≧縲
    • Hyper Estraier縺ョ繧、繝ウ繧ケ繝医シ繝ォ縺ッ ./configure ; make win ; make install-win 縺ァ陦後≧縲ゅヱ繝繧ア繝シ繧ク菴懈舌ッ make winpkg 縺ァ陦後≧縲

    hyperestraier-1.4.13/misc/rights.txt000066400000000000000000000126411125261632700174730ustar00rootroot00000000000000荳也阜莠コ讓ゥ螳」險 蜑肴枚 莠コ鬘樒、セ莨壹ョ縺吶∋縺ヲ縺ョ讒区仙藤縺ョ蝗コ譛峨ョ蟆雁宍縺ィ蟷ウ遲峨〒隴イ繧九%縺ィ縺ョ縺ァ縺阪↑縺讓ゥ蛻ゥ縺ィ繧呈価隱阪☆繧九%縺ィ縺ッ縲∽ク也阜縺ォ縺翫¢繧玖ェ逕ア縲∵ュ」鄒ゥ蜿翫ウ蟷ウ蜥後ョ蝓コ遉弱〒縺ゅk縺ョ縺ァ縲∽ココ讓ゥ縺ョ辟。隕門所縺ウ霆ス萓ョ縺後∽ココ鬘槭ョ濶ッ蠢繧定ク上∩縺ォ縺倥▲縺滄手岼陦檎ぜ繧偵b縺溘i縺励∬ィ隲門所縺ウ菫。莉ー縺ョ閾ェ逕ア縺悟女縺代i繧後∵$諤門所縺ウ谺荵上ョ縺ェ縺荳也阜縺ョ蛻ー譚・縺後∽ク闊ャ縺ョ莠コ縲縺ョ譛鬮倥ョ鬘俶悍縺ィ縺励※螳」險縺輔l縺溘ョ縺ァ縲∽ココ髢薙′蟆ょ宛縺ィ蝨ァ霑ォ縺ィ縺ォ蟇セ縺吶k譛蠕後ョ謇区ョオ縺ィ縺励※蜿埼縺ォ險エ縺医k縺薙→縺後↑縺繧医≧縺ォ縺吶k縺溘a縺ォ縺ッ縲∵ウ輔ョ謾ッ驟阪↓繧医▲縺ヲ莠コ讓ゥ菫晁ュキ縺吶k縺薙→縺瑚晁ヲ√〒縺ゅk縺ョ縺ァ縲∬ォク蝗ス髢薙ョ蜿句・ス髢「菫ゅョ逋コ螻輔r菫騾イ縺吶k縺薙→縺後∬晁ヲ√〒縺ゅk縺ョ縺ァ縲∝嵜髫幃」蜷医ョ隲ク蝗ス豌代ッ縲∝嵜髫幃」蜷域イ遶縺ォ縺翫>縺ヲ縲∝渕譛ャ逧莠コ讓ゥ縲∽ココ髢薙ョ蟆雁宍蜿翫ウ萓。蛟、荳ヲ縺ウ縺ォ逕キ螂ウ縺ョ蜷梧ィゥ縺ォ縺、縺縺ヲ縺ョ菫。蠢オ繧貞咲「コ隱阪@縲√°縺、縲∽ク螻、螟ァ縺阪↑閾ェ逕ア縺ョ縺縺。縺ァ遉セ莨夂噪騾イ豁ゥ縺ィ逕滓エサ豌エ貅悶ョ蜷台ク翫→繧剃ソ騾イ縺吶k縺薙→繧呈アコ諢上@縺溘ョ縺ァ縲∝刈逶溷嵜縺ッ縲∝嵜髫幃」蜷医→蜊泌鴨縺励※縲∽ココ讓ゥ蜿翫ウ蝓コ譛ャ逧閾ェ逕ア縺ョ譎ョ驕咲噪縺ェ蟆企榊所縺ウ蟆雁ョ医ョ菫騾イ繧帝#謌舌☆繧九%縺ィ繧定ェ鍋エ縺励◆縺ョ縺ァ縲√%繧後i縺ョ讓ゥ蛻ゥ蜿翫ウ閾ェ逕ア縺ォ蟇セ縺吶k蜈ア騾壹ョ逅隗」縺ッ縲√%縺ョ隱鍋エ繧貞ョ悟ィ縺ォ縺吶k縺溘a縺ォ繧ゅ▲縺ィ繧る崎ヲ√〒縺ゅk縺ョ縺ァ縲√h縺」縺ヲ縲√%縺薙↓縲∝嵜髫幃」蜷育キ丈シ壹ッ縲∫、セ莨壹ョ蜷蛟倶ココ蜿翫ウ蜷讖滄未縺後√%縺ョ荳也阜莠コ讓ゥ螳」險繧貞クク縺ォ蠢オ鬆ュ縺ォ鄂ョ縺阪↑縺後i縲∝刈逶溷嵜閾ェ霄ォ縺ョ莠コ豌代ョ髢薙↓繧ゅ√∪縺溘∝刈逶溷嵜縺ョ邂。霓荳九↓縺ゅk蝨ー蝓溘ョ莠コ豌代ョ髢薙↓繧ゅ√%繧後i縺ョ讓ゥ蛻ゥ縺ィ閾ェ逕ア縺ィ縺ョ蟆企阪r謖蟆主所縺ウ謨呵ご縺ォ繧医▲縺ヲ菫騾イ縺吶k縺薙→荳ヲ縺ウ縺ォ縺昴l繧峨ョ譎ョ驕咲噪縺九▽蜉ケ譫懃噪縺ェ謇ソ隱阪→蟆雁ョ医→繧貞嵜蜀逧蜿翫ウ蝗ス髫帷噪縺ェ貍ク騾イ逧謗ェ鄂ョ縺ォ繧医▲縺ヲ遒コ菫昴☆繧九%縺ィ縺ォ蜉ェ蜉帙☆繧九h縺縺ォ縲√☆縺ケ縺ヲ縺ョ莠コ豌代→縺吶∋縺ヲ縺ョ蝗ス縺ィ縺碁#謌舌☆縺ケ縺榊ア騾壹ョ蝓コ貅悶→縺励※縲√%縺ョ荳也阜莠コ讓ゥ螳」險繧貞ャ蟶縺吶k縲 隨ャ荳譚。 縺吶∋縺ヲ縺ョ莠コ髢薙ッ縲∫函繧後↑縺後i縺ォ縺励※閾ェ逕ア縺ァ縺ゅj縲√°縺、縲∝ー雁宍縺ィ讓ゥ蛻ゥ縺ィ縺ォ縺、縺縺ヲ蟷ウ遲峨〒縺ゅk縲ゆココ髢薙ッ縲∫炊諤ァ縺ィ濶ッ蠢縺ィ繧呈肢縺代i繧後※縺翫j縲∽コ偵>縺ォ蜷瑚槭ョ邊セ逾槭r繧ゅ▲縺ヲ陦悟虚縺励↑縺代l縺ー縺ェ繧峨↑縺縲 隨ャ莠梧擅 縺吶∋縺ヲ莠コ縺ッ縲∽ココ遞ョ縲∫坩閹壹ョ濶イ縲∵ァ縲∬ィ隱槭∝ョ玲蕗縲∵帆豐サ荳翫◎縺ョ莉悶ョ諢剰ヲ九∝嵜豌醍噪闍・縺励¥縺ッ遉セ莨夂噪蜃コ霄ォ縲∬イ。逕」縲髢蝨ー縺昴ョ莉悶ョ蝨ー菴榊処縺ッ縺薙l縺ォ鬘槭☆繧九>縺九↑繧倶コ狗罰縺ォ繧医k蟾ョ蛻・繧偵b蜿励¢繧九%縺ィ縺ェ縺上√%縺ョ螳」險縺ォ謗イ縺偵k縺吶∋縺ヲ縺ョ讓ゥ蛻ゥ縺ィ閾ェ逕ア縺ィ繧剃コォ譛峨☆繧九%縺ィ縺後〒縺阪k縲 縺輔i縺ォ縲∝倶ココ縺ョ螻槭☆繧句嵜蜿医ッ蝨ー蝓溘′迢ャ遶句嵜縺ァ縺ゅk縺ィ縲∽ソ。險礼オア豐サ蝨ー蝓溘〒縺ゅk縺ィ縲髱櫁ェ豐サ蝨ー蝓溘〒縺ゅk縺ィ縲∝処縺ッ莉悶ョ縺ェ繧薙i縺九ョ荳サ讓ゥ蛻カ髯舌ョ荳九↓縺ゅk縺ィ繧貞撫繧上★縲√◎縺ョ蝗ス蜿医ッ蝨ー蝓溘ョ謾ソ豐サ荳翫∫ョ。霓荳雁処縺ッ蝗ス髫帑ク翫ョ蝨ー菴阪↓蝓コ縺・縺上>縺九↑繧句キョ蛻・繧ゅ@縺ヲ縺ッ縺ェ繧峨↑縺縲 隨ャ荳画擅 縺吶∋縺ヲ莠コ縺ッ縲∫函蜻ス縲∬ェ逕ア蜿翫ウ霄ォ菴薙ョ螳牙ィ縺ォ蟇セ縺吶k讓ゥ蛻ゥ繧呈怏縺吶k縲 隨ャ蝗帶擅 菴穂ココ繧ゅ∝・エ髫キ縺ォ縺輔l縲∝処縺ッ闍ヲ蠖ケ縺ォ譛阪☆繧九%縺ィ縺ッ縺ェ縺縲ょ・エ髫キ蛻カ蠎ヲ蜿翫ウ螂エ髫キ螢イ雋キ縺ッ縲√>縺九↑繧句ス「縺ォ縺翫>縺ヲ繧らヲ∵ュ「縺吶k縲 隨ャ莠疲擅 菴穂ココ繧ゅ∵狭蝠丞処縺ッ谿玖剞縺ェ縲髱樔ココ驕鍋噪縺ェ闍・縺励¥縺ッ螻郁セア逧縺ェ蜿匁桶闍・縺励¥縺ッ蛻醍スー繧貞女縺代k縺薙→縺ッ縺ェ縺縲 隨ャ蜈ュ譚。 縺吶∋縺ヲ莠コ縺ッ縲√>縺九↑繧句エ謇縺ォ縺翫>縺ヲ繧ゅ∵ウ輔ョ荳九↓縺翫>縺ヲ縲∽ココ縺ィ縺励※隱阪a繧峨l繧区ィゥ蛻ゥ繧呈怏縺吶k縲 隨ャ荳譚。 縺吶∋縺ヲ縺ョ莠コ縺ッ縲∵ウ輔ョ荳九↓縺翫>縺ヲ蟷ウ遲峨〒縺ゅj縲√∪縺溘√>縺九↑繧句キョ蛻・繧ゅ↑縺励↓豕輔ョ蟷ウ遲峨↑菫晁ュキ繧貞女縺代k讓ゥ蛻ゥ繧呈怏縺吶k縲ゅ☆縺ケ縺ヲ縺ョ莠コ縺ッ縲√%縺ョ螳」險縺ォ驕募渚縺吶k縺縺九↑繧句キョ蛻・縺ォ蟇セ縺励※繧ゅ√∪縺溘√◎縺ョ繧医≧縺ェ蟾ョ蛻・繧偵◎縺昴ョ縺九☆縺縺九↑繧玖。檎ぜ縺ォ蟇セ縺励※繧ゅ∝ケウ遲峨↑菫晁ュキ繧貞女縺代k讓ゥ蛻ゥ繧呈怏縺吶k縲 隨ャ蜈ォ譚。 縺吶∋縺ヲ莠コ縺ッ縲∵イ豕募処縺ッ豕募セ九↓繧医▲縺ヲ荳弱∴繧峨l縺溷渕譛ャ逧讓ゥ蛻ゥ繧剃セオ螳ウ縺吶k陦檎ぜ縺ォ蟇セ縺励∵ィゥ髯舌r譛峨☆繧句嵜蜀陬∝愛謇縺ォ繧医k蜉ケ譫懃噪縺ェ謨第ク医r蜿励¢繧区ィゥ蛻ゥ繧呈怏縺吶k縲 隨ャ荵晄擅 菴穂ココ繧ゅ√⊇縺励>縺セ縺セ縺ォ騾ョ謐輔∵鋸遖√∝処縺ッ霑ス謾セ縺輔l繧九%縺ィ縺ッ縺ェ縺縲 隨ャ蜊∵擅 縺吶∋縺ヲ莠コ縺ッ縲∬ェ蟾ア縺ョ讓ゥ蛻ゥ蜿翫ウ鄒ゥ蜍吩クヲ縺ウ縺ォ閾ェ蟾ア縺ォ蟇セ縺吶k蛻台コ玖イャ莉サ縺梧アコ螳壹&繧後k縺ォ蠖薙▲縺ヲ縺ッ縲∫峡遶九ョ蜈ャ蟷ウ縺ェ陬∝愛謇縺ォ繧医k蜈ャ豁」縺ェ蜈ャ髢九ョ蟇ゥ逅繧貞女縺代k縺薙→縺ォ縺、縺縺ヲ螳悟ィ縺ォ蟷ウ遲峨ョ讓ゥ蛻ゥ繧呈怏縺吶k縲 隨ャ蜊∽ク譚。 迥ッ鄂ェ縺ョ險エ霑ス繧貞女縺代◆閠縺ッ縲√☆縺ケ縺ヲ縲∬ェ蟾ア縺ョ蠑∬ュキ縺ォ蠢隕√↑縺吶∋縺ヲ縺ョ菫晞囿繧剃ク弱∴繧峨l縺溷ャ髢九ョ陬∝愛縺ォ縺翫>縺ヲ豕募セ九↓蠕薙▲縺ヲ譛臥スェ縺ョ遶玖ィシ縺後≠繧九∪縺ァ縺ッ縲∫┌鄂ェ縺ィ謗ィ螳壹&繧後k讓ゥ蛻ゥ繧呈怏縺吶k縲 菴穂ココ繧ゅ∝ョ溯。後ョ譎ゅ↓蝗ス蜀豕募処縺ッ蝗ス髫帶ウ輔↓繧医j迥ッ鄂ェ繧呈ァ区舌@縺ェ縺九▲縺滉ス懃ぜ蜿医ッ荳堺ス懃ぜ縺ョ縺溘a縺ォ譛臥スェ縺ィ縺輔l繧九%縺ィ縺ッ縺ェ縺縲ゅ∪縺溘∫官鄂ェ縺瑚。後o繧後◆譎ゅ↓驕ゥ逕ィ縺輔l繧句醍スー繧医j驥阪>蛻醍スー繧定ェイ縺帙i繧後↑縺縲 隨ャ蜊∽コ梧擅 菴穂ココ繧ゅ∬ェ蟾ア縺ョ遘∽コ九∝ョカ譌上∝ョカ蠎ュ闍・縺励¥縺ッ騾壻ソ。縺ォ蟇セ縺励※縲√⊇縺励>縺セ縺セ縺ォ蟷イ貂峨&繧後∝処縺ッ蜷崎ェ牙所縺ウ菫。逕ィ縺ォ蟇セ縺励※謾サ謦繧貞女縺代k縺薙→縺ッ縺ェ縺縲ゆココ縺ッ縺吶∋縺ヲ縲√%縺ョ繧医≧縺ェ蟷イ貂牙処縺ッ謾サ謦縺ォ蟇セ縺励※豕輔ョ菫晁ュキ繧貞女縺代k讓ゥ蛻ゥ繧呈怏縺吶k縲 隨ャ蜊∽ク画擅 縺吶∋縺ヲ莠コ縺ッ縲∝推蝗ス縺ョ蠅逡悟縺ォ縺翫>縺ヲ閾ェ逕ア縺ォ遘サ霆「蜿翫ウ螻菴上☆繧区ィゥ蛻ゥ繧呈怏縺吶k縲 縺吶∋縺ヲ莠コ縺ッ縲∬ェ蝗ス縺昴ョ莉悶>縺壹l縺ョ蝗ス繧偵b遶九■蜴サ繧翫∝所縺ウ閾ェ蝗ス縺ォ蟶ー繧区ィゥ蛻ゥ繧呈怏縺吶k縲 hyperestraier-1.4.13/misc/spiteurl.txt000066400000000000000000000274571125261632700200550ustar00rootroot00000000000000http://mikio:oikim@localhost:1978/node/sample0/put_doc?draft=%40uri%3Dmikio1%0A%0AMikio%20Hirabayashi%20no1 http://mikio:oikim@localhost:1978/node/sample0/put_doc?draft=%40uri%3Dmikio2%0A%0AMikio%20Hirabayashi%20no2 http://mikio:oikim@localhost:1978/node/sample0/put_doc?draft=%40uri%3Dmikio3%0A%0AMikio%20Hirabayashi%20no3 http://mikio:oikim@localhost:1978/node/sample0/put_doc?draft=%40uri%3Dmikio4%0A%0AMikio%20Hirabayashi%20no4 http://mikio:oikim@localhost:1978/node/sample0/put_doc?draft=%40uri%3Dmikio5%0A%0AMikio%20Hirabayashi%20no5 http://mikio:oikim@localhost:1978/node/sample0/put_doc?draft=%40uri%3Dmikio6%0A%0AMikio%20Hirabayashi%20no6 http://mikio:oikim@localhost:1978/node/sample0/put_doc?draft=%40uri%3Dmikio7%0A%0AMikio%20Hirabayashi%20no7 http://localhost:1978/node/sample0/put_doc?draft=%40uri%3Dmikio7%0A%0AMikio%20Hirabayashi%20no0 http://localhost:1978/node/sample0/inform http://localhost:1978/node/sample0/search http://localhost:1978/node/sample0/search?phrase=mikio http://localhost:1978/node/sample0/search?phrase=mikio&depth=0 http://localhost:1978/node/sample0/search?phrase=mikio&depth=1 http://localhost:1978/node/sample0/search?phrase=mikio&depth=2 http://localhost:1978/node/sample0/search?phrase=mikio&depth=3 http://localhost:1978/node/sample0/search?phrase=0&depth=3 http://localhost:1978/node/sample0/search?phrase=1&depth=3 http://localhost:1978/node/sample0/search?phrase=2&depth=3 http://localhost:1978/node/sample0/search?phrase=3&depth=3 http://localhost:1978/node/sample0/search?phrase=4&depth=3 http://localhost:1978/node/sample0/search?phrase=5&depth=3 http://localhost:1978/node/sample0/search?phrase=6&depth=3 http://localhost:1978/node/sample0/search?phrase=7&depth=3 http://localhost:1978/node/sample0/search?phrase=8&depth=3 http://localhost:1978/node/sample0/search?phrase=9&depth=3 http://localhost:1978/node/sample0/search?phrase=a&depth=3 http://localhost:1978/node/sample0/search?phrase=b&depth=3 http://localhost:1978/node/sample0/search?phrase=c&depth=3 http://localhost:1978/node/sample0/search?phrase=d&depth=3 http://localhost:1978/node/sample0/search?phrase=e&depth=3 http://localhost:1978/node/sample0/search?phrase=f&depth=3 http://localhost:1978/node/sample0/search?phrase=mikio+AND+hirabayashi&depth=3 http://localhost:1978/node/sample0/search?phrase=estraier+AND+i&depth=2&order=%40title+STRA http://localhost:1978/node/sample0/search?phrase=a+OR+b&depth=2 http://localhost:1978/node/sample0/search?phrase=unix+OR+java&depth=2 http://localhost:1978/node/sample0/search?phrase=ruby+OR+python&depth=2 http://localhost:1978/node/sample0/search?phrase=this+OR+.&depth=2 http://localhost:1978/node/sample0/search?phrase=estraier&attr=%40uri+STREW+.txt&order=%40size+NUMD&depth=3 http://localhost:1978/node/sample0/search?phrase=mikio&attr=%40uri+STREW+.txt&order=%40size+NUMA&depth=3 http://localhost:1978/node/sample0/search?phrase=unix&attr=%40uri+STREW+.txt&order=%40title+STRA&depth=3 http://localhost:1978/node/sample0/search?phrase=%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB&depth=3 http://localhost:1978/node/sample0/search?phrase=%E5%B9%B3%E6%9E%97%E5%B9%B9%E9%9B%84&depth=3 http://localhost:1978/node/sample0/search?phrase=%E3%80%82%20OR%20.&attr=%40uri&depth=3 http://localhost:1978/node/sample0/search?phrase=%E3%81%99%E3%82%8B%20OR%20%E3%81%BE%E3%81%99&depth=3 http://localhost:1978/node/sample0/inform http://localhost:1978/node/sample0/get_doc?id=1 http://localhost:1978/node/sample0/get_doc?id=3 http://localhost:1978/node/sample0/get_doc?id=5 http://localhost:1978/node/sample0/get_doc?id=9 http://localhost:1978/node/sample0/get_doc?id=0 http://localhost:1978/node/sample0/get_doc?uri=http%3A%2F%2Fhyperestraier.sourceforge.net%2Fsample.txt http://localhost:1978/node/sample0/get_doc_attr?id=1&attr=%40uri http://localhost:1978/node/sample0/get_doc_attr?uri=http://localhost:1978/node/sample0/get_doc?uri=http%3A%2F%2Fhyperestraier.sourceforge.net%2Fsample.txt&attr=%40title http://localhost:1978/node/sample0/inform http://localhost:1978/node/sample0/uri_to_id?uri=mikio1 http://localhost:1978/node/sample0/uri_to_id?uri=mikio3 http://localhost:1978/node/sample0/uri_to_id?uri=mikio5 http://localhost:1978/node/sample0/uri_to_id?uri=mikio0 http://localhost:1978/node/sample0/inform http://mikio:oikim@localhost:1978/node/sample0/out_doc?id=1 http://mikio:oikim@localhost:1978/node/sample0/out_doc?id=3 http://mikio:oikim@localhost:1978/node/sample0/out_doc?id=5 http://mikio:oikim@localhost:1978/node/sample0/out_doc?id=9 http://mikio:oikim@localhost:1978/node/sample0/out_doc?id=0 http://localhost:1978/node/sample0/inform http://mikio:oikim@localhost:1978/node/sample0/_set_link?url=http%3A%2F%2Flocalhost.localdomain%3A1978%2Fnode%2Fsample0&label=loop1&credit=20000 http://admin:admin@localhost:1978/node/sample0/_set_link?url=http%3A%2F%2F127.0.0.1%3A1978%2Fnode%2Fsample0&label=loop2&credit=30000 http://mikio:oikim@localhost:1978/node/sample0/_set_link?url=http%3A%2F%2Flocalhost%3A1978%3A1978%2Fnode%2Funix&label=UNIX&credit=10000 http://mikio:oikim@localhost:1978/node/sample0/_set_link?url=http%3A%2F%2Flocalhost%3A1978%3A1978%2Fnode%2Fminix&label=MINIX&credit=10000 http://admin:admin@localhost:1978/node/sample0/_set_user?name=user1&mode=1 http://admin:admin@localhost:1978/node/sample0/_set_user?name=user2&mode=2 http://localhost:1978/node/sample0/searchui http://localhost:1978/node/sample0/searchui?phrase=unix&depth=2 http://localhost:1978/node/sample0/searchui?phrase=mikio&attr1=%40uri%20STREW%20.html&attr2=%40title&order=%40size%20STRD http://localhost:1978/node/sample0/inform http://mikio:oikim@localhost:1978/node/sample1/put_doc?draft=%40uri%3Dmikio1%0A%0AMikio%20Hirabayashi%20no1 http://mikio:oikim@localhost:1978/node/sample1/put_doc?draft=%40uri%3Dmikio2%0A%0AMikio%20Hirabayashi%20no2 http://mikio:oikim@localhost:1978/node/sample1/put_doc?draft=%40uri%3Dmikio3%0A%0AMikio%20Hirabayashi%20no3 http://mikio:oikim@localhost:1978/node/sample1/put_doc?draft=%40uri%3Dmikio4%0A%0AMikio%20Hirabayashi%20no4 http://mikio:oikim@localhost:1978/node/sample1/put_doc?draft=%40uri%3Dmikio5%0A%0AMikio%20Hirabayashi%20no5 http://mikio:oikim@localhost:1978/node/sample1/put_doc?draft=%40uri%3Dmikio6%0A%0AMikio%20Hirabayashi%20no6 http://mikio:oikim@localhost:1978/node/sample1/put_doc?draft=%40uri%3Dmikio7%0A%0AMikio%20Hirabayashi%20no7 http://localhost:1978/node/sample1/put_doc?draft=%40uri%3Dmikio7%0A%0AMikio%20Hirabayashi%20no0 http://localhost:1978/node/sample1/inform http://localhost:1978/node/sample1/search http://localhost:1978/node/sample1/search?phrase=mikio http://localhost:1978/node/sample1/search?phrase=mikio&depth=0 http://localhost:1978/node/sample1/search?phrase=mikio&depth=1 http://localhost:1978/node/sample1/search?phrase=mikio&depth=2 http://localhost:1978/node/sample1/search?phrase=mikio&depth=3 http://localhost:1978/node/sample1/search?phrase=0&depth=3 http://localhost:1978/node/sample1/search?phrase=1&depth=3 http://localhost:1978/node/sample1/search?phrase=2&depth=3 http://localhost:1978/node/sample1/search?phrase=3&depth=3 http://localhost:1978/node/sample1/search?phrase=4&depth=3 http://localhost:1978/node/sample1/search?phrase=5&depth=3 http://localhost:1978/node/sample1/search?phrase=6&depth=3 http://localhost:1978/node/sample1/search?phrase=7&depth=3 http://localhost:1978/node/sample1/search?phrase=8&depth=3 http://localhost:1978/node/sample1/search?phrase=9&depth=3 http://localhost:1978/node/sample1/search?phrase=a&depth=3 http://localhost:1978/node/sample1/search?phrase=b&depth=3 http://localhost:1978/node/sample1/search?phrase=c&depth=3 http://localhost:1978/node/sample1/search?phrase=d&depth=3 http://localhost:1978/node/sample1/search?phrase=e&depth=3 http://localhost:1978/node/sample1/search?phrase=f&depth=3 http://localhost:1978/node/sample1/search?phrase=mikio+AND+hirabayashi&depth=3 http://localhost:1978/node/sample1/search?phrase=estraier+AND+i&depth=2&order=%40title+STRA http://localhost:1978/node/sample1/search?phrase=a+OR+b&depth=2 http://localhost:1978/node/sample1/search?phrase=unix+OR+java&depth=2 http://localhost:1978/node/sample1/search?phrase=ruby+OR+python&depth=2 http://localhost:1978/node/sample1/search?phrase=this+OR+.&depth=2 http://localhost:1978/node/sample1/search?phrase=estraier&attr=%40uri+STREW+.txt&order=%40size+NUMD&depth=3 http://localhost:1978/node/sample1/search?phrase=mikio&attr=%40uri+STREW+.txt&order=%40size+NUMA&depth=3 http://localhost:1978/node/sample1/search?phrase=unix&attr=%40uri+STREW+.txt&order=%40title+STRA&depth=3 http://localhost:1978/node/sample1/search?phrase=%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB&depth=3 http://localhost:1978/node/sample1/search?phrase=%E5%B9%B3%E6%9E%97%E5%B9%B9%E9%9B%84&depth=3 http://localhost:1978/node/sample1/search?phrase=%E3%80%82%20OR%20.&attr=%40uri&depth=3 http://localhost:1978/node/sample1/search?phrase=%E3%81%99%E3%82%8B%20OR%20%E3%81%BE%E3%81%99&depth=3 http://localhost:1978/node/sample1/inform http://localhost:1978/node/sample1/get_doc?id=1 http://localhost:1978/node/sample1/get_doc?id=3 http://localhost:1978/node/sample1/get_doc?id=5 http://localhost:1978/node/sample1/get_doc?id=9 http://localhost:1978/node/sample1/get_doc?id=0 http://localhost:1978/node/sample1/get_doc?uri=http%3A%2F%2Fhyperestraier.sourceforge.net%2Fsample.txt http://localhost:1978/node/sample1/get_doc_attr?id=1&attr=%40uri http://localhost:1978/node/sample1/get_doc_attr?id=1&attr=%40title http://localhost:1978/node/sample1/get_doc_attr?uri=http://localhost:1978/node/sample0/get_doc?uri=http%3A%2F%2Fhyperestraier.sourceforge.net%2Fsample.txt&attr=%40title http://localhost:1978/node/sample1/inform http://localhost:1978/node/sample1/uri_to_id?uri=mikio1 http://localhost:1978/node/sample1/uri_to_id?uri=mikio3 http://localhost:1978/node/sample1/uri_to_id?uri=mikio5 http://localhost:1978/node/sample1/uri_to_id?uri=mikio0 http://localhost:1978/node/sample1/inform http://mikio:oikim@localhost:1978/node/sample1/out_doc?id=1 http://mikio:oikim@localhost:1978/node/sample1/out_doc?id=3 http://mikio:oikim@localhost:1978/node/sample1/out_doc?id=5 http://mikio:oikim@localhost:1978/node/sample1/out_doc?id=9 http://mikio:oikim@localhost:1978/node/sample1/out_doc?id=0 http://localhost:1978/node/sample1/inform http://mikio:oikim@localhost:1978/node/sample1/_set_link?url=http%3A%2F%2Flocalhost.localdomain%3A1978%2Fnode%2Fsample0&label=loop1&credit=20000 http://admin:admin@localhost:1978/node/sample1/_set_link?url=http%3A%2F%2F127.0.0.1%3A1978%2Fnode%2Fsample0&label=loop2&credit=30000 http://mikio:oikim@localhost:1978/node/sample1/_set_link?url=http%3A%2F%2Flocalhost%3A1978%3A1978%2Fnode%2Funix&label=UNIX&credit=10000 http://mikio:oikim@localhost:1978/node/sample1/_set_link?url=http%3A%2F%2Flocalhost%3A1978%3A1978%2Fnode%2Fminix&label=MINIX&credit=10000 http://admin:admin@localhost:1978/node/sample1/_set_user?name=user1&mode=1 http://admin:admin@localhost:1978/node/sample1/_set_user?name=user2&mode=2 http://localhost:1978/node/sample1/searchui http://localhost:1978/node/sample1/searchui?phrase=unix&depth=2 http://localhost:1978/node/sample1/searchui?phrase=mikio&attr1=%40uri%20STREW%20.html&attr2=%40title&order=%40size%20STRD http://localhost:1978/node/sample1/inform http://localhost:1978/ http://localhost:1978/hoge http://localhost:1978/node/ http://admin:admin@localhost:1978/master?action=userlist http://admin:admin@localhost:1978/master?action=useradd&name=yama&passwd=kawa http://admin:admin@localhost:1978/master?action=useradd&name=tako&passwd=ika http://admin:admin@localhost:1978/master?action=userdel&name=yama http://admin:admin@localhost:1978/master?action=userdel&name=tako http://admin:admin@localhost:1978/master?action=nodelist http://admin:admin@localhost:1978/master?action=nodeadd&name=unix&label=UNIX http://admin:admin@localhost:1978/master?action=nodeadd&name=minix&label=MINIX http://admin:admin@localhost:1978/master?action=nodedel&name=unix http://admin:admin@localhost:1978/master?action=nodedel&name=minix http://admin:admin@localhost:1978/masterui?action=2 http://admin:admin@localhost:1978/masterui?action=5 hyperestraier-1.4.13/misc/test001.est000066400000000000000000000022021125261632700173370ustar00rootroot00000000000000@uri=http://hyperestraier.sourceforge.net/sample.txt @cdate=Sat, 11 Feb 1978 01:05:30 -0800 @mdate=Sat, 11 Feb 1978 01:05:30 -0800 @title=Mikio Hirabayashi @genre=private @weight=10.0 %VECTOR one 1 two 2 three 3 estraier 100 hyper 10 mikio 10 My name is Mikio Hirabayashi. I'm the author of Hyper Estraier. Hyper Estraier is a full-text search system. It works as with Google, but based on peer-to-peer architecture. Using Hyper Estraier, we can construct a large-scaled search engine with inexpensive computers. Hyper Estraier provides not only user interface but also application programming interface. The UI is web interface and users can enjoy full-text search with a web browser. The API is available in such languages as C and some scripting languages. Hyper Estraier is the successor of Estraier (see http://estraier.sourceforge.net). While Estraier uses morphological analysis to extract search words, Hyper Estraier uses N-gram analysis. That is, most natural languages are supported and recall rate of search is improved. Mikio Hirabayashi Hyper Estraier hyperestraier full-text search GNU Library or Lesser Public License (LGPL) hyperestraier-1.4.13/misc/test002.est000066400000000000000000000002241125261632700173420ustar00rootroot00000000000000@uri=http://hyperestraier.sourceforge.net/hoge.txt This is the simplest sample document draft. 縺薙l縺ッ譛繧ょ腰邏斐↑譁譖ク繝峨Λ繝輔ヨ縺ァ縺吶 hyperestraier-1.4.13/misc/test003.est000066400000000000000000000023161125261632700173470ustar00rootroot00000000000000@uri=file:///home/mikio/Mail/inbox/12345 @title=鬯シ騾豐サ縺ォ陦後″縺セ縺励g縺シシ @cdate=Thu, 03 Feb 2005 16:14:32 +0900 @mdate=Thu, 03 Feb 2005 16:14:32 +0900 @author=Mikio Hirabayashi @type=message/rfc822 @lang=ja @genre=private @weight=0.5 date=Thu, 03 Feb 2005 16:14:32 +0900 from=Mikio Hirabayashi to=Momoyama Taro , Inuyama Jiro cc=Saruyama Saburo , Kijiyama Shiro subject=鬯シ騾豐サ縺ォ陦後″縺セ縺励g縺シシ content-type=text/plain; charset=ISO-2022-JP 譯螟ェ驛弱〒縺吶 譏斐縺九@縲√≠繧九→縺薙m縺ォ縺顔絢縺輔s縺ィ縺雁ゥ縺輔s縺後>縺セ縺励◆縲 莠御ココ縺ォ縺ッ蟄蝉セ帙′縺翫j縺セ縺帙s縺ァ縺励◆縺後∝、ォ蟀ヲ莉イ逹ヲ縺セ縺倥¥證ョ繧峨@縺ヲ縺翫j縺セ縺励◆縲 縺ゅk譌・縲√♀辷コ縺輔s縺ッ螻ア縺ク譟エ蛻医j縺ォ縲√♀蟀縺輔s縺ッ蟾昴∈豢玲ソッ縺ォ陦後″縺セ縺励◆縲 縺昴s縺ェ縺薙s縺ェ縺ァ縲鬯シ騾豐サ縺ォ陦後″縺セ縺励g縺縲 譌「縺ォ迪ソ荳蛾ヮ縺輔s縲髮牙屁譛励&繧薙°繧峨ッ蠢ォ隲セ繧偵>縺溘□縺縺ヲ縺縺セ縺吶 迥ャ谺。驛弱&繧薙↓蜿ら判縺縺溘□縺代l縺ー鬯シ縺ォ驥第」偵〒縺吶 Let's enjoy ogre hunt!! ---- Momoyama Taro hyperestraier-1.4.13/misc/test004.est000066400000000000000000000120621125261632700173470ustar00rootroot00000000000000@uri=http://estraier.sourceforge.net/spex-ja.html @title=Specifications of Estraier Version 1 (Japanese) @author=Mikio Hirabayashi @cdate=Wed, 23 Dec 2004 10:18:23 +0900 @mdate=Wed, 18 Aug 2004 23:09:03 +0900 @type=text/html; charset=UTF-8 @lang=ja @genre=web @weight=2.0 蜈ィ譁讀懃エ「 Estraier 蝓コ譛ャ莉墓ァ俶嶌 Estraier繝舌シ繧ク繝ァ繝ウシ大渕譛ャ莉墓ァ俶嶌 Copyright (C) 2003-2004 Mikio Hirabayashi Last Update: Wed, 18 Aug 2004 23:09:03 +0900 Estraier縺ッ蛟倶ココ逕ィ騾泌髄縺代ョ蜈ィ譁讀懃エ「繧キ繧ケ繝繝縺ァ縺ゅk縲ゅ>繧上f繧句ィ譁讀懃エ「縺ィ縺ッ縲∵焚螟壹¥縺ョ譁譖ク縺ョ荳ュ縺九i縲∫音螳壹ョ隱槫唱繧貞性繧縺縺上▽縺九ョ譁譖ク繧定ヲ九▽縺大コ縺吶%縺ィ縺ァ縺ゅk縲Estraier縺ッWeb繧オ繧、繝井ク翫ョ譁譖ク繧貞ッセ雎。縺ィ縺励◆蜈ィ譁讀懃エ「繧キ繧ケ繝繝繧貞ョ溽樟縺吶k縺薙→繧剃クサ縺ェ逶ョ逧縺ィ縺吶k縲Google縺ョ繧医≧縺ェ讀懃エ「繧キ繧ケ繝繝繧貞倶ココ縺ョ繧オ繧、繝医d繧、繝ウ繝医Λ繝阪ャ繝医〒蛻ゥ逕ィ縺ァ縺阪k繧医≧縺ォ縺励◆繧ゅョ縺ァ縺ゅk縲Estraier縺ッ莉・荳九ョ迚ケ髟キ繧呈戟縺、縲 1. 讀懃エ「縺碁ォ倬溘〒縺ゅk縲 2. 讀懃エ「邨先棡縺瑚ヲ九d縺吶>縲 3. 髢「騾」譁譖ク讀懃エ「縺後〒縺阪k縲 4. 讒倥縺ェ險隱槭′謇ア縺医k縲 5. 讒倥縺ェ繝輔ぃ繧、繝ォ蠖「蠑上′謇ア縺医k縲 6. 螟ァ驥上ョ譁譖ク繧呈桶縺医k縲 7. 蟆主・縺檎ー。蜊倥〒縺ゅk縲 Estraier縺ッ霆「鄂ョ繧、繝ウ繝繝繧ッ繧ケ縺ィ蜻シ縺ー繧後k繝繝シ繧ソ繝吶シ繧ケ繧堤畑縺縺ヲ鬮倬溘↑蜈ィ譁讀懃エ「繧貞ョ溽樟縺吶k縲りサ「鄂ョ繧、繝ウ繝繝繧ッ繧ケ縺ッ繧オ繧、繝医ョ邂。逅閠縺係eb繧オ繝シ繝舌ョ蜍穂ス懊☆繧九さ繝ウ繝斐Η繝シ繧ソ縺ョ荳翫〒菴懈・ュ縺吶k縺薙→縺ォ繧医▲縺ヲ菴懈舌&繧後k縲ゅΘ繝シ繧カ縺ッ縺昴ョ髫帙↓險ュ鄂ョ縺輔l縺櫃GI繧ケ繧ッ繝ェ繝励ヨ縺ォWeb繝悶Λ繧ヲ繧カ繧堤畑縺縺ヲ繧「繧ッ繧サ繧ケ縺励※讀懃エ「繧定。後≧縲ゅΘ繝シ繧カ繧、繝ウ繧ソ繝輔ぉ繝シ繧ケ縺ッ邁。蜊倥↑繝繝ウ繝励Ξ繝シ繝医r邱ィ髮縺吶k縺薙→縺ォ繧医▲縺ヲ繧ォ繧ケ繧ソ繝槭う繧コ縺吶k縺薙→縺後〒縺阪k縲ょィ譁讀懃エ「讖溯ス繧貞y縺医k邁。譏展eb繧オ繝シ繝舌b謠蝉セ帙&繧後k縲 繝ヲ繝シ繧カ縺係eb繝壹シ繧ク荳翫ョ蜈・蜉帙ヵ繧ゥ繝シ繝縺ォ讀懃エ「繝輔Ξ繝シ繧コ繧貞・蜉帙☆繧九→縲√◎縺ョ譚。莉カ縺ォ隧イ蠖薙☆繧区枚譖ク縺ョ繧ソ繧、繝医Ν繧ФRL縺ョ繝ェ繧ケ繝医′陦ィ遉コ縺輔l繧九ょ推譁譖ク縺ォ蜷ォ縺セ繧後k繝繧ュ繧ケ繝医ョ隕∫エ繧ょ酔譎ゅ↓陦ィ遉コ縺輔l繧九りヲ∫エ縺ッ縲∵、懃エ「隱槭ョ蜻ィ霎コ縺ョ譁繧呈歓蜃コ縺励※逕滓舌&繧後k縲りヲ∫エ縺ォ蜷ォ縺セ繧後k讀懃エ「隱槭ッ繝上う繝ゥ繧、繝医&繧後※陦ィ遉コ縺輔l繧九よ、懃エ「邨先棡縺ョ蜷譁譖ク縺ッ縲∵、懃エ「隱槭↓蟇セ縺吶k繧ケ繧ウ繧「縺ョ髯埼縺ァ荳ヲ縺ケ繧峨l繧九ゅせ繧ウ繧「縺ッ譁譖ク荳ュ縺ォ蜊繧√k讀懃エ「隱槭ョ謨ー繧蜑イ蜷医↓蝓コ縺・縺縺ヲ豎ゅa繧峨l繧九 Estraier縺ッ髢「騾」譁譖ク讀懃エ「繧ょョ溯」縺吶k縲よ、懃エ「邨先棡縺ィ縺励※蠕励i繧後◆縺ゅk譁譖ク縺ィ髢「騾」縺吶k蜀螳ケ縺ョ譁譖ク縺ョ繝ェ繧ケ繝医r謠千、コ縺吶k讖溯ス縺ァ縺ゅk縲よ、懃エ「邨先棡縺ッ髢「騾」蠎ヲ縺ョ髯埼縺ァ荳ヲ縺ケ繧峨l繧九る未騾」蠎ヲ縺ッ繝吶け繝医Ν遨コ髢薙Δ繝繝ォ縺ォ蝓コ縺・縺縺ヲ邂怜コ縺輔l繧九らー。蜊倥↓險縺医ー縲∬ェ槭ョ蜃コ迴セ蛯セ蜷代′莨シ縺滓枚譖ク繧呈、懃エ「縺ァ縺阪k縺ィ縺縺縺薙→縺ァ縺ゅk縲ゅ&繧峨↓縲∵枚譖ク繧ッ繝ゥ繧ケ繧ソ繝ェ繝ウ繧ー繧ゅし繝昴シ繝医&繧後k縲ゅ%繧後ッ縲髢「騾」蠎ヲ繧堤畑縺縺ヲ讀懃エ「邨先棡縺ョ譁譖ク繧定ェ蜍慕噪縺ォ蛻鬘槭☆繧区ゥ溯ス縺ァ縺ゅk縲 Estraier縺ッUnicodeシUCS-2シ峨〒譁蟄励r陦ィ迴セ縺吶k縺ョ縺ァ縲∬恭隱槭↑縺ゥ縺ョ繝ィ繝シ繝ュ繝繝代ョ險隱槭□縺代〒縺ェ縺上∵律譛ャ隱槭↑縺ゥ縺ョ繧「繧ク繧「縺ョ險隱槭b謇ア縺縺薙→縺後〒縺阪k縲ら樟蝨ィ縺ョ繝舌シ繧ク繝ァ繝ウ縺ァ縺ッ縲√Κ繝シ繝ュ繝繝代ョ險隱槭→譌・譛ャ隱槭ョ繝繧ュ繧ケ繝医r螳溽畑逧縺ェ邊セ蠎ヲ縺ァ隗」譫舌☆繧九%縺ィ縺後〒縺阪k縲 繝ュ繝シ繧ォ繝ォ繝輔ぃ繧、繝ォ繧キ繧ケ繝繝縺ォ縺ゅk繝輔ぃ繧、繝ォ縺九i繝繧ュ繧ケ繝医r謚ス蜃コ縺吶k讖溯ス縺窪straier縺ォ縺ッ邨縺ソ霎シ縺セ繧後※縺繧九ゅし繝昴シ繝医☆繧九ヵ繧ゥ繝シ繝槭ャ繝医ッ繝励Ξ繝シ繝ウ繝繧ュ繧ケ繝医→HTML縺ィMIMEシ磯崕蟄舌Γ繝シ繝ォ縺ィMHTMLシ峨〒縺ゅk縲ゅ◎繧後□縺代〒縺ェ縺上∽ササ諢上ョ螟夜Κ繧ウ繝槭Φ繝峨r蜻シ縺ウ蜃コ縺吶%縺ィ縺ォ繧医▲縺ヲ讒倥縺ェ繝輔か繝シ繝槭ャ繝医ョ繝輔ぃ繧、繝ォ繧貞ヲ逅縺吶k縺薙→縺後〒縺阪k縲ゆセ九∴縺ー縲〜wvWare' 繧堤畑縺縺ヲMS-Word縺ョ繝輔ぃ繧、繝ォ繧貞ヲ逅縺励◆繧翫〜pdftotext' 繧堤畑縺縺ヲPDF縺ョ繝輔ぃ繧、繝ォ繧貞ヲ逅縺吶k縺薙→縺後〒縺阪k縲 Estraier縺ッ10荳繧定カ翫∴繧区枚譖ク繧貞ッセ雎。縺ィ縺励◆霆「鄂ョ繧、繝ウ繝繝繧ッ繧ケ繧呈ァ狗ッ峨☆繧九%縺ィ縺後〒縺阪k縲よ桶縺医k譁譖ク謨ー縺ョ荳企剞縺ッ繧ス繝輔ヨ繧ヲ繧ァ繧「縺ィ縺励※縺ッ謖√◆縺ェ縺縺後√ワ繝シ繝峨え繧ァ繧「縺ョ閭ス蜉帙↓萓晏ュ倥@縺ヲ霆「鄂ョ繧、繝ウ繝繝繧ッ繧ケ縺ョ讒狗ッ峨d譖エ譁ー縺ォ縺九°繧区凾髢薙′豎コ縺セ繧九ョ縺ァ縲√◎繧後↓蠢懊§縺ヲ螳滄°逕ィ荳翫ョ蛻カ髯舌′縺九°繧九%縺ィ縺ォ縺ェ繧九ゆク譁ケ縲∵、懃エ「縺ォ隕√☆繧区凾髢薙ッ縲∬サ「鄂ョ繧、繝ウ繝繝繧ッ繧ケ縺ョ隕乗ィ。縺ォ髢「繧上i縺壹√⊇縺シ荳螳壹〒縺ゅk縲ら匳骭イ譁譖ク謨ー縺10荳莉カ遞句コヲ縺ェ繧峨ー1遘剃サ・荳九〒讀懃エ「邨先棡縺梧署遉コ縺ァ縺阪k縺繧阪≧縲 Estraier縺ョ蟆主・縺ッ縺ィ縺ヲ繧らー。蜊倥〒縺ゅk縲ゅ⊇縺ィ繧薙←縺ョ蝣エ蜷医√う繝ウ繧ケ繝医シ繝ォ菴懈・ュ縺ッ20蛻莉・蜀縺ォ縺ァ縺阪k縺繧阪≧縲りサ「鄂ョ繧、繝ウ繝繝繧ッ繧ケ繧剃ス懈舌☆繧九↓縺ッ縲√さ繝槭Φ繝峨r1蝗槭°2蝗槫ョ溯。後☆繧九□縺代〒繧医>縲よ焚蛻縺九i謨ー譎る俣遞句コヲ蠕縺、縺ィ霆「鄂ョ繧、繝ウ繝繝繧ッ繧ケ縺後〒縺阪≠縺後k縲ゅ≠縺ィ縺ッ縲∬ィュ鄂ョ縺輔l縺櫃GI繧ケ繧ッ繝ェ繝励ヨ縺ォ繧「繧ッ繧サ繧ケ縺吶k縺縺代〒縲∝ィ譁讀懃エ「繧呈・ス縺励縺薙→縺後〒縺阪k縲 Estraier縺ッLinux縲ヾolaris縲?P-UX縲:reeBSD縲¨etBSD縲^penBSD縲`ac OS X縺翫h縺ウWindowsシCygwinシ峨〒蛻ゥ逕ィ縺ァ縺阪k縲ゅ◎縺ョ莉悶ョUNIX邉サ縺ョOS縺ァ繧ょ茜逕ィ縺ァ縺阪k縲Estraier縺ッGNU General Public License縺ォ蝓コ縺・縺上ヵ繝ェ繝シ繧ス繝輔ヨ繧ヲ繧ァ繧「縺ァ縺ゅk縲 hyperestraier-1.4.13/misc/test005.est000066400000000000000000000211241125261632700173470ustar00rootroot00000000000000@uri=file:///home/mikio/public_html/data/ihaveadream.xml @title=I Have a Dream @author=Martin Luther King, Jr. @genre=history @lang=en Five score years ago, a great American, in whose symbolic shadow we stand signed the Emancipation Proclamation. This momentous decree came as a great beacon light of hope to millions of Negro slaves who had been seared in the flames of withering injustice. It came as a joyous daybreak to end the long night of captivity. But one hundred years later, we must face the tragic fact that the Negro is still not free. One hundred years later, the life of the Negro is still sadly crippled by the manacles of segregation and the chains of discrimination. One hundred years later, the Negro lives on a lonely island of poverty in the midst of a vast ocean of material prosperity. One hundred years later, the Negro is still languishing in the corners of American society and finds himself an exile in his own land. So we have come here today to dramatize an appalling condition. In a sense we have come to our nation's capital to cash a check. When the architects of our republic wrote the magnificent words of the Constitution and the declaration of Independence, they were signing a promissory note to which every American was to fall heir. This note was a promise that all men would be guaranteed the inalienable rights of life, liberty, and the pursuit of happiness. It is obvious today that America has defaulted on this promissory note insofar as her citizens of color are concerned. Instead of honoring this sacred obligation, America has given the Negro people a bad check which has come back marked "insufficient funds. " But we refuse to believe that the bank of justice is bankrupt. We refuse to believe that there are insufficient funds in the great vaults of opportunity of this nation. So we have come to cash this check -- a check that will give us upon demand the riches of freedom and the security of justice. We have also come to this hallowed spot to remind America of the fierce urgency of now. This is no time to engage in the luxury of cooling off or to take the tranquilizing drug of gradualism. Now is the time to rise from the dark and desolate valley of segregation to the sunlit path of racial justice. Now is the time to open the doors of opportunity to all of God's children. Now is the time to lift our nation from the quicksands of racial injustice to the solid rock of brotherhood. It would be fatal for the nation to overlook the urgency of the moment and to underestimate the determination of the Negro. This sweltering summer of the Negro's legitimate discontent will not pass until there is an invigorating autumn of freedom and equality. Nineteen sixty-three is not an end, but a beginning. Those who hope that the Negro needed to blow off steam and will now be content will have a rude awakening if the nation returns to business as usual. There will be neither rest nor tranquility in America until the Negro is granted his citizenship rights. The whirlwinds of revolt will continue to shake the foundations of our nation until the bright day of justice emerges. But there is something that I must say to my people who stand on the warm threshold which leads into the palace of justice. In the process of gaining our rightful place we must not be guilty of wrongful deeds. Let us not seek to satisfy our thirst for freedom by drinking from the cup of bitterness and hatred. We must forever conduct our struggle on the high plane of dignity and discipline. We must not allow our creative protest to degenerate into physical violence. Again and again we must rise to the majestic heights of meeting physical force with soul force. The marvelous new militancy which has engulfed the Negro community must not lead us to distrust of all white people, for many of our white brothers, as evidenced by their presence here today, have come to realize that their destiny is tied up with our destiny and their freedom is inextricably bound to our freedom. We cannot walk alone. And as we walk, we must make the pledge that we shall march ahead. We cannot turn back. There are those who are asking the devotees of civil rights, "When will you be satisfied?" We can never be satisfied as long as our bodies, heavy with the fatigue of travel, cannot gain lodging in the motels of the highways and the hotels of the cities. We cannot be satisfied as long as the Negro's basic mobility is from a smaller ghetto to a larger one. We can never be satisfied as long as a Negro in Mississippi cannot vote and a Negro in New York believes he has nothing for which to vote. No, no, we are not satisfied, and we will not be satisfied until justice rolls down like waters and righteousness like a mighty stream. I am not unmindful that some of you have come here out of great trials and tribulations. Some of you have come fresh from narrow cells. Some of you have come from areas where your quest for freedom left you battered by the storms of persecution and staggered by the winds of police brutality. You have been the veterans of creative suffering. Continue to work with the faith that unearned suffering is redemptive. Go back to Mississippi, go back to Alabama, go back to Georgia, go back to Louisiana, go back to the slums and ghettos of our northern cities, knowing that somehow this situation can and will be changed. Let us not wallow in the valley of despair. I say to you today, my friends, that in spite of the difficulties and frustrations of the moment, I still have a dream. It is a dream deeply rooted in the American dream. I have a dream that one day this nation will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident: that all men are created equal." I have a dream that one day on the red hills of Georgia the sons of former slaves and the sons of former slaveowners will be able to sit down together at a table of brotherhood. I have a dream that one day even the state of Mississippi, a desert state, sweltering with the heat of injustice and oppression, will be transformed into an oasis of freedom and justice. I have a dream that my four children will one day live in a nation where they will not be judged by the color of their skin but by the content of their character. I have a dream today. I have a dream that one day the state of Alabama, whose governor's lips are presently dripping with the words of interposition and nullification, will be transformed into a situation where little black boys and black girls will be able to join hands with little white boys and white girls and walk together as sisters and brothers. I have a dream today. I have a dream that one day every valley shall be exalted, every hill and mountain shall be made low, the rough places will be made plain, and the crooked places will be made straight, and the glory of the Lord shall be revealed, and all flesh shall see it together. This is our hope. This is the faith with which I return to the South. With this faith we will be able to hew out of the mountain of despair a stone of hope. With this faith we will be able to transform the jangling discords of our nation into a beautiful symphony of brotherhood. With this faith we will be able to work together, to pray together, to struggle together, to go to jail together, to stand up for freedom together, knowing that we will be free one day. This will be the day when all of God's children will be able to sing with a new meaning, "My country, 'tis of thee, sweet land of liberty, of thee I sing. Land where my fathers died, land of the pilgrim's pride, from every mountainside, let freedom ring." And if America is to be a great nation this must become true. So let freedom ring from the prodigious hilltops of New Hampshire. Let freedom ring from the mighty mountains of New York. Let freedom ring from the heightening Alleghenies of Pennsylvania! Let freedom ring from the snowcapped Rockies of Colorado! Let freedom ring from the curvaceous peaks of California! But not only that; let freedom ring from Stone Mountain of Georgia! Let freedom ring from Lookout Mountain of Tennessee! Let freedom ring from every hill and every molehill of Mississippi. From every mountainside, let freedom ring. When we let freedom ring, when we let it ring from every village and every hamlet, from every state and every city, we will be able to speed up that day when all of God's children, black men and white men, Jews and Gentiles, Protestants and Catholics, will be able to join hands and sing in the words of the old Negro spiritual, "Free at last! free at last! thank God Almighty, we are free at last!" hyperestraier-1.4.13/misc/test006.est000066400000000000000000000003141125261632700173460ustar00rootroot00000000000000@uri=mailto:mikio@users.sourceforge.net @title=蟷ウ譫怜ケケ髮 description=譛ャ譁繧螳滉ス薙′縺ェ縺上※繧よ枚譖ク縺ィ縺縺讎ょソオ縺ッ謌千ォ九☆繧九 蟷ウ譫怜ケケ髮 Mikio Hirabayashi Male Japanese Programmer hyperestraier-1.4.13/misc/test007.txt000066400000000000000000000143221125261632700173770ustar00rootroot00000000000000蜜柑 芥川龍之介 或曇った冬の日暮である。私は横須賀発上り二等客車の隅に腰を下して、ぼんやり発車の笛を待っていた。とうに電燈のついた客車の中には、珍らしく私の外に一人も乗客はいなかった。外を覗くと、うす暗いプラットフォオムにも、今日は珍しく見送りの人影さえ跡を絶って、唯、檻に入れられた小犬が一匹、時々悲しそうに、吠え立てていた。これらはその時の私の心もちと、不思議な位似つかわしい景色だった。私の頭の中には云いようのない疲労と倦怠とが、まるで雪曇りの空のようなどんよりした影を落していた。私は外套のポッケットへじっと両手をつっこんだまま、そこにはいっている夕刊を出して見ようと云う元気さえ起らなかった。 が、やがて発車の笛が鳴った。私はかすかな心の寛ぎを感じながら、後の窓枠へ頭をもたせて、眼の前の停車場がずるずると後ずさりを始めるのを待つともなく待ちかまえていた。ところがそれよりも先にけたたましい日和下駄の音が、改札口の方から聞え出したと思うと、間もなく車掌の何か云い罵る声と共に、私の乗っている二等室の戸ががらりと開いて、十三四の小娘が一人、慌しく中へはいって来た、と同時に一つずしりと揺れて、徐に汽車は動き出した。一本ずつ眼をくぎって行くプラットフォオムの柱、置き忘れたような運水車、それから車内の誰かに祝儀の礼を云っている赤帽――そう云うすべては、窓へ吹きつける煤煙の中に、未練がましく後へ倒れて行った。私は漸くほっとした心もちになって、巻煙草に火をつけながら、始めて懶い睚をあげて、前の席に腰を下していた小娘の顔を一瞥した。 それは油気のない髪をひっつめの銀杏返しに結って、横なでの痕のある皸だらけの両頬を気持の悪い程赤く火照らせた、如何にも田舎者らしい娘だった。しかも垢じみた萌黄色の毛糸の襟巻がだらりと垂れ下った膝の上には、大きな風呂敷包みがあった。その又包みを抱いた霜焼けの手の中には、三等の赤切符が大事そうにしっかり握られていた。私はこの小娘の下品な顔だちを好まなかった。それから彼女の服装が不潔なのもやはり不快だった。最後にその二等と三等との区別さえも弁えない愚鈍な心が腹立たしかった。だから巻煙草に火をつけた私は、一つにはこの小娘の存在を忘れたいと云う心もちもあって、今度はポッケットの夕刊を漫然と膝の上へひろげて見た。するとその時夕刊の紙面に落ちていた外光が、突然電燈の光に変って、刷の悪い何欄かの活字が意外な位鮮に私の眼の前へ浮んで来た。云うまでもなく汽車は今、横須賀線に多い隧道の最初のそれへはいったのである。 しかしその電燈の光に照らされた夕刊の紙面を見渡しても、やはり私の憂鬱を慰むべく、世間は余りに平凡な出来事ばかりで持ち切っていた。講和問題、新婦新郎、涜職事件、死亡広告――私は隧道へはいった一瞬間、汽車の走っている方向が逆になったような錯覚を感じながら、それらの索漠とした記事から記事へ殆機械的に眼を通した。が、その間も勿論あの小娘が、あたかも卑俗な現実を人間にしたような面持ちで、私の前に坐っている事を絶えず意識せずにはいられなかった。この隧道の中の汽車と、この田舎者の小娘と、そうして又この平凡な記事に埋っている夕刊と、――これが象徴でなくて何であろう。不可解な、下等な、退屈な人生の象徴でなくて何であろう。私は一切がくだらなくなって、読みかけた夕刊を抛り出すと、又窓枠に頭を靠せながら、死んだように眼をつぶって、うつらうつらし始めた。 それから幾分か過ぎた後であった。ふと何かに脅されたような心もちがして、思わずあたりを見まわすと、何時の間にか例の小娘が、向う側から席を私の隣へ移して、頻に窓を開けようとしている。が、重い硝子戸は中々思うようにあがらないらしい。あの皸だらけの頬は愈赤くなって、時々鼻洟をすすりこむ音が、小さな息の切れる声と一しょに、せわしなく耳へはいって来る。これは勿論私にも、幾分ながら同情を惹くに足るものには相違なかった。しかし汽車が今将に隧道の口へさしかかろうとしている事は、暮色の中に枯草ばかり明い両側の山腹が、間近く窓側に迫って来たのでも、すぐに合点の行く事であった。にも関らずこの小娘は、わざわざしめてある窓の戸を下そうとする、――その理由が私には呑みこめなかった。いや、それが私には、単にこの小娘の気まぐれだとしか考えられなかった。だから私は腹の底に依然として険しい感情を蓄えながら、あの霜焼けの手が硝子戸を擡げようとして悪戦苦闘する容子を、まるでそれが永久に成功しない事でも祈るような冷酷な眼で眺めていた。すると間もなく凄じい音をはためかせて、汽車が隧道へなだれこむと同時に、小娘の開けようとした硝子戸は、とうとうばたりと下へ落ちた。そうしてその四角な穴の中から、煤を溶したようなどす黒い空気が、俄に息苦しい煙になって、濛々と車内へ漲り出した。元来咽喉を害していた私は、手巾を顔に当てる暇さえなく、この煙を満面に浴びせられたおかげで、殆息もつけない程咳きこまなければならなかった。が、小娘は私に頓着する気色も見えず、窓から外へ首をのばして、闇を吹く風に銀杏返しの鬢の毛を戦がせながら、じっと汽車の進む方向を見やっている。その姿を煤煙と電燈の光との中に眺めた時、もう窓の外が見る見る明くなって、そこから土の匂や枯草の匂や水の匂が冷かに流れこんで来なかったなら、漸咳きやんだ私は、この見知らない小娘を頭ごなしに叱りつけてでも、又元の通り窓の戸をしめさせたのに相違なかったのである。 しかし汽車はその時分には、もう安々と隧道を辷りぬけて、枯草の山と山との間に挟まれた、或貧しい町はずれの踏切りに通りかかっていた。踏切りの近くには、いずれも見すぼらしい藁屋根や瓦屋根がごみごみと狭苦しく建てこんで、踏切り番が振るのであろう、唯一旒のうす白い旗が懶げに暮色を揺っていた。やっと隧道を出たと思う――その時その蕭索とした踏切りの柵の向うに、私は頬の赤い三人の男の子が、目白押しに並んで立っているのを見た。彼等は皆、この曇天に押しすくめられたかと思う程、揃って背が低かった。そうして又この町はずれの陰惨たる風物と同じような色の着物を着ていた。それが汽車の通るのを仰ぎ見ながら、一斉に手を挙げるが早いか、いたいけな喉を高く反らせて、何とも意味の分らない喊声を一生懸命に迸らせた。するとその瞬間である。窓から半身を乗り出していた例の娘が、あの霜焼けの手をつとのばして、勢よく左右に振ったと思うと、忽ち心を躍らすばかり暖な日の色に染まっている蜜柑が凡そ五つ六つ、汽車を見送った子供たちの上へばらばらと空から降って来た。私は思わず息を呑んだ。そうして刹那に一切を了解した。小娘は、恐らくはこれから奉公先へ赴こうとしている小娘は、その懐に蔵していた幾顆の蜜柑を窓から投げて、わざわざ踏切りまで見送りに来た弟たちの労に報いたのである。 暮色を帯びた町はずれの踏切りと、小鳥のように声を挙げた三人の子供たちと、そうしてその上に乱落する鮮な蜜柑の色と――すべては汽車の窓の外に、瞬く暇もなく通り過ぎた。が、私の心の上には、切ない程はっきりと、この光景が焼きつけられた。そうしてそこから、或得体の知れない朗な心もちが湧き上って来るのを意識した。私は昂然と頭を挙げて、まるで別人を見るようにあの小娘を注視した。小娘は何時かもう私の前の席に返って、相不変皸だらけの頬を萌黄色の毛糸の襟巻に埋めながら、大きな風呂敷包みを抱えた手に、しっかりと三等切符を握っている。………… 私はこの時始めて、云いようのない疲労と倦怠とを、そうして又不可解な、下等な、退屈な人生を僅に忘れる事が出来たのである。 hyperestraier-1.4.13/misc/test008.html000066400000000000000000000242101125261632700175220ustar00rootroot00000000000000

    ンヲンィ

    ウ皺豢シ。マコ

    、ィ、ソ、、、ホテホ、、ハ、、ノヤオネ、ハイ、ャサ荀ホソエ、サマスェーオ、ィ、ト、ア、ニ、、、ソ。」セヌッ、ネクタ、ェ、ヲ、ォ。「キーュ、ネクタ、ェ、ヲ、ォ。ス。スシ、ー、、タ、「、ネ、ヒスノソ、ャ、「、、隍ヲ、ヒ。「シ、ヒ霹ー、、ヌ、、、、ネスノソ、ヒチナ、キ、ソサエ、ャ、荀テ、ニヘ隍。」、ス、、ャヘ隍ソ、ホ、タ。」、ウ、、マ、チ、遉テ、ネ、、、ア、ハ、ォ、テ、ソ。」キイフ、キ、ソヌルタ・ォ・ソ・、菫タキミソシ螟ャ、、、ア、ハ、、、ホ、ヌ、マ、ハ、、。」、゙、ソヌリ、セニ、ッ、隍ヲ、ハシレカ筅ハ、ノ、ャ、、、ア、ハ、、、ホ、ヌ、マ、ハ、、。」、、、ア、ハ、、、ホ、マ、ス、ホノヤオネ、ハイ、タ。」ーハチーサ荀エ、ミ、サ、ソ、ノ、、ハネ、キ、、イサウレ、筍「、ノ、、ハネ、キ、、サ、ホータ皃篩ノハ、ャ、ハ、鬢ハ、ッ、ハ、テ、ソ。」テ゚イサエ、トー、ォ、サ、ニ、筅鬢、、ヒ、、カ、、カスミ、ォ、ア、ニケヤ、テ、ニ、筍「コヌス鬢ホニサーセョタ皃ヌノヤーユ、ヒホゥ、チセ螟ャ、テ、ニ、キ、゙、、、ソ、ッ、ハ、。」イソ、ォ、ャサ荀オエョ、鬢コ、オ、サ、、ホ、タ。」、ス、、ヌサマスェサ荀マウケ、ォ、魑ケ、ノ簪イ、キツウ、ア、ニ、、、ソ。」

    イソクホ、タ、ォ、ス、ホコ「サ荀マクォ、ケ、ワ、鬢キ、ッ、ニネ、キ、、、筅ホ、ヒカッ、ッ、メ、ュ、ト、ア、鬢、ソ、ホ、ウミ、ィ、ニ、、、。」ノキハ、ヒ、キ、ニ、箚、、ォ、ォ、テ、ソウケ、タ、ネ、ォ。「、ス、ホウケ、ヒ、キ、ニ、筅隍ス、隍ス、キ、、ノストフ、熙隍熙筅ノ、ウ、ォソニ、キ、゚、ホ、「、。「ア、、タツハェ、ャエウ、キ、ニ、「、テ、ソ、熙ャ、鬢ッ、ソ、ャナセ、ャ、キ、ニ、「、テ、ソ、熙爨オ、ッ、、キ、、ノイー、ャヌチ、、、ニ、、、ソ、熙ケ、ホ「トフ、熙ャケ・、ュ、ヌ、「、テ、ソ。」アォ、菲、ャソェ、、ヌ、荀ャ、ニナレ、ヒオ「、テ、ニ、キ、゙、ヲ。「、ネクタ、テ、ソ、隍ヲ、ハシ、ュ、ホ、「、ウケ、ヌ。「ナレハス、ャハ、、ニ、、、ソ、イネハツ、ャキケ、ュ、ォ、ォ、テ、ニ、、、ソ、遙ス。スタェ、、、ホ、、、、、ホ、マソ「ハェ、タ、ア、ヌ。「サ、ネ、ケ、、ネ、モ、テ、ッ、熙オ、サ、、隍ヲ、ハクニーェ、ャ、「、テ、ソ、・ォ・・ハ、ャコ鬢、、ニ、、、ソ、熙ケ、。」

    サ、ノ、ュサ荀マ、ス、、ハマゥ、ハ筅ュ、ハ、ャ、鬘「、ユ、ネ。「、ス、ウ、ャオナヤ、ヌ、マ、ハ、ッ、ニオナヤ、ォ、魎ソノエホ、、簧・、、ソタ酊讀ネ、ォトケコ熙ネ、ォ。ス。ス、ス、ホ、隍ヲ、ハサヤ、リコ」シォハャ、ャヘ隍ニ、、、、ホ、タ。ス。ス、ネ、、、ヲコウミ、オッ、ウ、ス、ヲ、ネナリ、皃。」サ荀マ。「、ヌ、ュ、、ウ、ネ、ハ、魴ナヤ、ォ、鯣ィ、イスミ、キ、ニテッーソヘテホ、鬢ハ、、、隍ヲ、ハサヤ、リケヤ、テ、ニ、キ、゙、、、ソ、ォ、テ、ソ。」ツ隹、ヒーツタナ。」、ャ、鬢、ネ、キ、ソホケエロ、ホーシシ。」タカセ、ハウテト。」ニ、、、ホ、、、、イ翔「、ネクメ、ホ、隍ッ、ュ、、、ソヘ皺癸」、ス、ウ、ヌーキ、ロ、ノイソ、篏ラ、、コイ」、ヒ、ハ、熙ソ、、。」エ、、ッ、マ、ウ、ウ、ャ、、、ト、ホエヨ、ヒ、ォ、ス、ホサヤ、ヒ、ハ、テ、ニ、、、、ホ、タ、テ、ソ、鬘」。ス。スコウミ、ャ、隍ヲ、荀ッタョク、キ、マ、ク、皃、ネサ荀マ、ス、、ォ、鬢ス、、リチロチ、ホウィカ、ナノ、熙ト、ア、ニ、讀ッ。」、ハ、、ホ、ウ、ネ、マ、ハ、、。「サ荀ホコウミ、ネイ、、ォ、ォ、テ、ソウケ、ネ、ホニスナシフ、キ、ヌ、「、。」、ス、キ、ニサ荀マ、ス、ホテ讀ヒクスシツ、ホサ莨ォソネ、クォシコ、ヲ、ホ、ウレ、キ、、タ。」

    サ荀マ、゙、ソ、「、ホイヨイミ、ネ、、、ヲ、荀ト、ャケ・、ュ、ヒ、ハ、テ、ソ。」イヨイミ、ス、ホ、筅ホ、マツ霹テハ、ネ、キ、ニ。「、「、ホーツ、テ、ン、、ウィカ、ヌタヨ、莉遉茣ォ、菎ト、茖「、オ、゙、カ、゙、ホシハフマヘヘ、サ、テ、ソイヨイミ、ホツォ。「テ貊ウサ、ホタアイシ、遙「イヨケ鄲。「クマ、、ケ、ケ、ュ。」、ス、、ォ、鮹ヘイヨイミ、ネ、、、ヲ、ホ、マー、ト、コ、トホリ、ヒ、ハ、テ、ニ、、、ニネ「、ヒオヘ、皃ニ、「、。」、ス、、ハ、筅ホ、ャハム、ヒサ荀ホソエ、コカ、テ、ソ。」

    、ス、、ォ、鬢゙、ソ。「、モ、、、ノ、、ネ、、、ヲソァセヒサメ、ヌツ荀茣ヨ、ツヌ、チスミ、キ、ニ、「、、ェ、マ、ク、ュ、ャケ・、ュ、ヒ、ハ、テ、ソ、キ。「ニオカフ、ャケ・、ュ、ヒ、ハ、テ、ソ。」、゙、ソ、ス、、セィ、皃ニ、゚、、ホ、ャサ荀ヒ、ネ、テ、ニ、ハ、、ネ、筅、、ィ、ハ、、オウレ、タ、テ、ソ、ホ、タ。」、「、ホ、モ、、、ノ、、ホフ」、ロ、ノヘゥ、ォ、ハホテ、キ、、フ」、ャ、「、、筅ホ、ォ。」サ荀マヘト、、サ、隍ッ、ス、、ク、ヒニ、、ニ、マノ飜、ヒシク、鬢、ソ、筅ホ、タ、ャ。「、ス、ホヘトサ、ホ、「、゙、、オュイア、ャツ遉ュ、ッ、ハ、テ、ニヘ、チー、、ソサ荀ヒチノ、ィ、テ、ニ、ッ、クホ、タ、、ヲ、ォ。「、゙、テ、ソ、ッ、「、ホフ」、ヒ、マヘゥ、ォ、ハチヨ、荀ォ、ハ、ハ、、ネ、ハ、ッサネ、ネクタ、テ、ソ、隍ヲ、ハフ」ウミ、ャノコ、テ、ニヘ隍。」

    サ。、キ、マ、ト、ッ、タ、、ヲ、ャサ荀ヒ、マ、゙、、ヌカ筅ャ、ハ、ォ、テ、ソ。」、ネ、マクタ、ィ、ス、、ハ、筅ホ、クォ、ニセッ、キ、ヌ、篩エ、ホニー、ュ、ォ、ア、ソサ、ホサ莨ォソネ、ーヨ、皃、ソ、皃ヒ、マヤツ、ネ、、、ヲ、ウ、ネ、ャノャヘラ、ヌ、「、テ、ソ。」ニチャ、莉ーチャ、ホ、筅ホ。ス。ス、ネクタ、テ、ニヤツ、ハ、筅ホ。」ネ、キ、、、筅ホ。ス。ス、ネクタ、テ、ニフオオ、ホマ、ハサ荀ホソィウム、ヒ、爨キ、ユサ、モ、ニヘ隍、筅ホ。」。ス。ス、ス、ヲクタ、テ、ソ、筅ホ、ャシォチウサ荀ーヨ、皃、ホ、タ。」

    タクウ隍ャ、゙、タソェ、゙、、ニ、、、ハ、ォ、テ、ソーハチーサ荀ホケ・、ュ、ヌ、「、テ、ソス熙マ。「、ソ、ネ、ィ、ミエンチア、ヌ、「、テ、ソ。」タヨ、茣ォ、ホ・ェ。シ・ノ・ウ・・、茹ェ。シ・ノ・ュ・ヒ・。」゙ッヘ、ソタレサメコルケゥ、菁オイ、ハ・・ウ・ウシフ」、ホノ篶マヘヘ、サ、テ、ソ琲珮ソァ、蓙ヌソ鯀ァ、ホケ眩袂爍」アエノ。「セョナ癸「タミクエ。「アチ。」サ荀マ、ス、、ハ、筅ホ、クォ、、ホ、ヒセョーサエヨ、篳、ケ、ウ、ネ、ャ、「、テ、ソ。」、ス、キ、ニキカノーナ、、、、アノョ、ーヒワヌ网ヲ、ッ、鬢、、ホヤツ、、ケ、、ホ、タ、テ、ソ。」、キ、ォ、キ、ウ、ウ、筅筅ヲ、ス、ホコ「、ホサ荀ヒ、ネ、テ、ニ、マスナ、ッ、、キ、、セス熙ヒイ皃ョ、ハ、ォ、テ、ソ。」スタメ。「ウリタク。「エェトツ譯「、ウ、、鬢マ、゚、ハシレカ箴隍熙ホヒエホ、ホ、隍ヲ、ヒサ荀ヒ、マクォ、ィ、、ホ、タ、テ、ソ。」

    、「、トォ。ス。ス、ス、ホコ「サ荀マケテ、ホヘァテ」、ォ、魎オ、ホヘァテ」、リ、ネ、、、ヲ、ユ、ヲ、ヒヘァテ」、ホイシスノ、ナセ。ケ、ネ、キ、ニハ、鬢キ、ニ、、、ソ、ホ、タ、ャ。ス。スヘァテ」、ャウリケサ、リスミ、ニ、キ、゙、テ、ソ、「、ネ、ホカオ、ハカオ、、ホ、ハ、ォ、ヒ、ン、ト、ヘ、、ネーソヘシ隍サト、オ、、ソ。」サ荀マ、゙、ソ、ス、ウ、ォ、鰊ヌラモ、、スミ、ハ、ア、、ミ、ハ、鬢ハ、ォ、テ、ソ。」イソ、ォ、ャサ荀トノ、、、ソ、ニ、。」、ス、キ、ニウケ、ォ、魑ケ、リ。「タ隍ヒクタ、テ、ソ、隍ヲ、ハホ「トフ、熙ハ筅、、ソ、遙「ツフイロサメイー、ホチー、ヌホゥ、チホア、゙、テ、ソ、遙「エ・ハェイー、ホエ・イワ、萢タテュ、菁ヘユ、トッ、皃ソ、遙「、ネ、ヲ、ネ、ヲサ荀マニセ、ホハ、リサトョ、イシ、遙「、ス、ウ、ホイフハェイー、ヌツュ、ホア、皃ソ。」、ウ、ウ、ヌ、チ、遉テ、ネ、ス、ホイフハェイー、セメイ、キ、ソ、、、ホ、タ、ャ。「、ス、ホイフハェイー、マサ荀ホテホ、テ、ニ、、、ソネマーマ、ヌコヌ、篁・、ュ、ハナケ、ヌ、「、テ、ソ。」、ス、ウ、マキ隍キ、ニホゥヌノ、ハナケ、ヌ、マ、ハ、ォ、テ、ソ、ホ、タ、ャ。「イフハェイークヌヘュ、ホネ、キ、オ、ャコヌ、簪ェケ、ヒエカ、シ、鬢、ソ。」イフハェ、マ、ォ、ハ、クヌロ、ホオ゙、ハツ讀ホセ螟ヒハツ、ル、ニ、「、テ、ニ。「、ス、ホツ讀ネ、、、ヲ、ホ、篋ナ、モ、ソケ、、シソナノ、熙ホネト、タ、テ、ソ、隍ヲ、ヒサラ、ィ、。」イソ、ォイレ、荀ォ、ハネ、キ、、イサウレ、ホイツョトエ、ホホョ、、ャ。「クォ、ソヘ、タミ、ヒイス、キ、ソ、ネ、、、ヲ・エ・・エ・、ホオエフフ。ス。スナェ、ハ、筅ホ、コケ、キ、ト、ア、鬢、ニ。「、「、、ハソァコフ、荀「、、ハ・・ゥ・・ヲ・爨ヒカナ、クヌ、゙、テ、ソ、ネ、、、ヲ、ユ、ヲ、ヒイフハェ、マハツ、、ヌ、、、。」タトハェ、筅荀マ、ア、リ、讀ア、ミ、讀ッ、ロ、ノツマケ筅ッタム、゙、、ニ、、、。」。ス。スシツコン、「、ス、ウ、ホソヘサイヘユ、ホネ、キ、オ、ハ、ノ、マチヌタイ、キ、ォ、テ、ソ。」、ス、、ォ、鯀螟ヒトメ、ア、ニ、「、ニヲ、タ、ネ、ォサクネ、タ、ネ、ォ。」

    、゙、ソ、ス、ウ、ホイネ、ホネ、キ、、、ホ、マフ、タ、テ、ソ。」サトョトフ、マ、、、テ、ソ、、、ヒニ、ォ、ハトフ、熙ヌ。ス。ス、ネクタ、テ、ニエカ、ク、マナオ、萃郤螟隍熙マ、コ、テ、ネタ。、、ヌ、、、、ャ。ス。スセチ、ホク、ャ、ェ、モ、ソ、タ、キ、ッウケマゥ、リホョ、スミ、ニ、、、。」、ス、、ャ、ノ、ヲ、キ、ソ、、ア、ォ、ス、ホナケニャ、ホシーマ、タ、ア、ャフッ、ヒーナ、、、ホ、タ。」、筅ネ、筅ネハメハ、マーナ、、ニセトフ、ヒタワ、キ、ニ、、、ウケウム、ヒ、ハ、テ、ニ、、、、ホ、ヌ。「ーナ、、、ホ、マナチウ、ヌ、「、テ、ソ、ャ。「、ス、ホホルイネ、ャサトョトフ、ヒ、「、イネ、ヒ、筅ォ、ォ、、鬢コーナ、ォ、テ、ソ、ホ、ャホニチウ、キ、ハ、、。」、キ、ォ、キ、ス、ホイネ、ャーナ、ッ、ハ、ォ、テ、ソ、鬘「、「、、ハ、ヒ、篏荀ヘカマヌ、ケ、、ヒ、マサ熙鬢ハ、ォ、テ、ソ、ネサラ、ヲ。」、筅ヲー、ト、マ、ス、ホイネ、ホツヌ、チスミ、キ、ソヨ、ハ、ホ、タ、ャ。「、ス、ホヨ、ャエ譱シ、ヒエァ、テ、ソヒケサメ、ホヨ、ホ、隍ヲ、ヒ。ス。ス、ウ、、マキチヘニ、ネ、、、ヲ、隍熙筍「。ヨ、ェ、茖「、「、ス、ウ、ホナケ、マヒケサメ、ホヨ、、荀ア、ヒイシ、イ、ニ、、、、セ。ラ、ネサラ、、サ、、ロ、ノ、ハ、ホ、ヌ。「ヨ、ホセ螟マ、ウ、、篩ソーナ、ハ、ホ、タ。」、ス、ヲシーマ、ャソソーナ、ハ、ソ、癸「ナケニャ、ヒナタ、ア、鬢、ソエ、ト、筅ホナナナ、ャ螻ォ、ホ、隍ヲ、ヒヘ皃モ、サ、ォ、ア、ーシ爭、マ。「シーマ、ホイソシヤ、ヒ、篥・、、、、ウ、ネ、ハ、ッ。「、ロ、キ、、、゙、゙、ヒ、篳、キ、、トッ、皃ャセネ、鬢キスミ、オ、、ニ、、、、ホ、タ。」ヘ遉ホナナナ、ャコルトケ、、ヘ貘ヒタ、、ュ、熙ュ、エ网ホテ讀リサノ、キケ、、ヌ、ッ、アヘ隍ヒホゥ、テ、ニ。「、゙、ソカ眇熙ヒ、「、ュイー、ホニウャ、ホセヒサメチ、、ケ、ォ、キ、ニトッ、皃ソ、ウ、ホイフハェナケ、ホトッ、皃ロ、ノ。「、ス、ホサ、ノ、ュ、ホサ荀カス、ャ、鬢サ、ソ、筅ホ、マサトョ、ホテ讀ヌ、箏ゥ、タ、テ、ソ。」

    、ス、ホニサ荀マ、、、ト、ヒ、ハ、ッ、ス、ホナケ、ヌヌ飜ェ、、キ、ソ。」、ネ、、、ヲ、ホ、マ、ス、ホナケ、ヒ、マトチ、キ、、ンヲンィ、ャスミ、ニ、、、ソ、ホ、タ。」ンヲンィ、ハ、ノ、エ、ッ、「、熙ユ、、ニ、、、。」、ャ、ス、ホナケ、ネ、、、ヲ、ホ、篋ォ、ケ、ワ、鬢キ、ッ、マ、ハ、、、゙、ヌ、筅ソ、タ、「、ソ、熙゙、ィ、ホネャノエイー、ヒイ皃ョ、ハ、ォ、テ、ソ、ホ、ヌ。「、ス、、゙、ヌ、「、゙、クォ、ォ、ア、ソ、ウ、ネ、マ、ハ、ォ、テ、ソ。」、、、テ、ソ、、サ荀マ、「、ホンヲンィ、ャケ・、ュ、タ。」・・筵・ィ・・ヲ、ホウィカ、・チ・蝪シ・ヨ、ォ、鮗、スミ、キ、ニクヌ、皃ソ、隍ヲ、ハ、「、ホテアス网ハソァ、筍「、ス、、ォ、鬢「、ホセ讀ホオヘ、゙、テ、ソヒツソキチ、ホウ貉・、筍」。ス。スキカノサ荀マ、ス、、ー、ト、タ、アヌ网ヲ、ウ、ネ、ヒ、キ、ソ。」、ス、、ォ、鬢ホサ荀マ、ノ、ウ、リ、ノ、ヲハ筅、、ソ、ホ、タ、、ヲ。」サ荀マトケ、、エヨウケ、ハ筅、、ニ、、、ソ。」サマスェサ荀ホソエ、ーオ、ィ、ト、ア、ニ、、、ソノヤオネ、ハイ、ャ、ス、、ーョ、テ、ソスヨエヨ、ォ、鬢、、ッ、鬢ォテミ、、ヌヘ隍ソ、ネ、゚、ィ、ニ。「サ荀マウケ、ホセ螟ヌネセ、ヒケャハ。、ヌ、「、テ、ソ。」、「、、ハ、ヒシケルケ、ォ、テ、ソヘォンオ、ャ。「、ス、、ハ、筅ホ、ホー、ヌハカ、鬢オ、、。ス。ス、「、、、、マノヤソウ、ハ、ウ、ネ、ャ。「オユタ簀ェ、ハ、ロ、、ネ、ヲ、ヌ、「、テ、ソ。」、ス、、ヒ、キ、ニ、篩エ、ネ、、、ヲ、荀ト、マ、ハ、、ネ、、、ヲノヤイトサラオト、ハ、荀ト、タ、、ヲ。」

    、ス、ホンヲンィ、ホホ荀ソ、オ、マ、ソ、ネ、ィ、隍ヲ、筅ハ、ッ、隍ォ、テ、ソ。」、ス、ホコ「サ荀マヌルタ、ーュ、ッ、キ、ニ、、、ニ、、、ト、篩ネツホ、ヒヌョ、ャスミ、ソ。」サシツヘァテ」、ホテッネ爨ヒサ荀ホヌョ、クォ、サ、モ、鬢ォ、ケ、ソ、皃ヒシ熙ホーョ、ケ遉、、ハ、ノ、、キ、ニ、゚、、ホ、タ、ャ。「サ荀ホセク、ャテッ、ホ、隍熙簓ョ、ォ、テ、ソ。」、ス、ホヌョ、、クホ、タ、テ、ソ、ホ、タ、、ヲ。「ーョ、テ、ニ、、、セク、ォ、鯀ネニ筅ヒソサ、゚ニゥ、テ、ニ、讀ッ、隍ヲ、ハ、ス、ホホ荀ソ、オ、マイ、、、筅ホ、タ、テ、ソ。」

    サ荀マイソナル、箚ソナル、筅ス、ホイフシツ、ノ。、ヒサ、テ、ニ、、、テ、ニ、マモフ、、、ヌ、゚、ソ。」、ス、、ホサコテマ、タ、ネ、、、ヲ・ォ・・ユ・ゥ・・ヒ・荀ャチロチ、ヒセ螟テ、ニヘ隍。」エチハク、ヌスャ、テ、ソ。ヨヌ莇サシヤヌキクタ。ラ、ホテ讀ヒス、、、ニ、「、テ、ソ。ヨノ。、ヒミ、ト。ラ、ネ、、、ヲクタヘユ、ャテヌ、、ョ、、ヒノ筅ォ、、ヌヘ隍。」、ス、キ、ニ、ユ、ォ、ヨ、ォ、ネカサーヌユ、ヒニ、荀ォ、ハカオ、、オロ、、ケ、皃ミ。「、ト、、、セカサーヌユ、ヒクニオロ、キ、ソ、ウ、ネ、ホ、ハ、ォ、テ、ソサ荀ホソネツホ、莇鬢ヒ、マイケ、、キ、ホ、ロ、ネ、ワ、熙ャセコ、テ、ニヘ隍ニ、ハ、、タ、ォソネニ筅ヒクオオ、、ャフワウミ、皃ニヘ隍ソ、ホ、タ、テ、ソ。」。ト。ト

    シツコン、「、、ハテアス网ハホ莎ミ、菫ィウミ、萼フウミ、莉ウミ、ャ。「、コ、テ、ネタホ、ォ、鬢ウ、、ミ、ォ、テオ、キ、ニ、、、ソ、ホ、タ、ネクタ、、、ソ、ッ、ハ、テ、ソ、ロ、ノサ荀ヒ、キ、テ、ッ、熙キ、ソ、ハ、、ニサ荀マノヤサラオト、ヒサラ、ィ、。ス。ス、ス、、ャ、「、ホコ「、ホ、ウ、ネ、ハ、、タ、ォ、鬘」

    サ荀マ、筅ヲアヘ隍キレ、荀ォ、ハケキハウ、ヒテニ、、ヌ。「ーシクリ、熙ォ、ハオ、サ、オ、ィエカ、ク、ハ、ャ、鬘「ネナェチツォ、、キ、ニウケ、鯡筅キ、ソサソヘ、ホ、ウ、ネ、ハ、ノサラ、、ノ筅ォ、ル、ニ、マハ筅、、ニ、、、ソ。」ア、、ソシソ。、ホセ螟リコワ、サ、ニ、゚、ソ、・゙・・ネ、ホセ螟リ、「、ニ、ャ、テ、ニ、゚、ソ、熙キ、ニソァ、ホネソアヌ、ホフ、テ、ソ、遙「、゙、ソ、ウ、、ハ、ウ、ネ、サラ、テ、ソ、遙「

    。ス。ス、ト、゙、熙マ、ウ、ホスナ、オ、ハ、、タ、ハ。」。ス。ス

    、ス、ホスナ、オ、ウ、スセ、ナ、ヘソメ、ヘ、「、ー、、ヌ、、、ソ、筅ホ、ヌ。「オソ、、、筅ハ、ッ、ウ、ホスナ、オ、マ、ケ、ル、ニ、ホチア、、、筅ホ、ケ、ル、ニ、ホネ、キ、、、筅ホ、スナホフ、ヒエケササ、キ、ニヘ隍ソスナ、オ、ヌ、「、、ネ、ォ。「サラ、、、「、ャ、テ、ソ゚篩エ、ォ、鬢ス、、ハヌマシッ、イ、ソ、ウ、ネ、ケヘ、ィ、ニ、゚、ソ、遙ス。ス、ハ、ヒ、ャ、オ、ニサ荀マケャハ。、タ、テ、ソ、ホ、タ。」

    、ノ、ウ、、ノ、ヲハ筅、、ソ、ホ、タ、、ヲ。「サ荀ャコヌク螟ヒホゥ、テ、ソ、ホ、マエンチア、ホチー、タ、テ、ソ。」ハソセ、「、、ハ、ヒネ、ア、ニ、、、ソエンチア、ャ、ス、ホサ、ホサ荀ヒ、マ、荀ケ、荀ケ、ネニ、、、隍ヲ、ヒサラ、ィ、ソ。」

    。ヨコ」ニ、マー、トニ、テ、ニ、゚、ニ、荀、ヲ。ラ、ス、キ、ニサ荀マ、コ、ォ、コ、ォニ、テ、ニケヤ、テ、ソ。」

    、キ、ォ、キ、ノ、ヲ、キ、ソ、ウ、ネ、タ、、ヲ。「サ荀ホソエ、スシ、ソ、キ、ニ、、、ソケャハ。、ハエカセ、マ、タ、、タ、ニィ、イ、ニ、、、テ、ソ。」ケ眩螟ホヤ爨ヒ、箜エノ、ヒ、篏荀ホソエ、マ、ホ、キ、ォ、ォ、テ、ニ、マ、讀ォ、ハ、ォ、テ、ソ。」ヘォンオ、ャホゥ、ニ豁、皃ニヘ隍。「サ荀マハ筅ュイ、テ、ソネ靠ォ、ャスミ、ニヘ隍ソ、ホ、タ、ネサラ、テ、ソ。」サ荀マイ靈ワ、ホテェ、ホチー、リケヤ、テ、ニ、゚、ソ。」イ霓ク、ホスナ、ソ、、、ホ、シ隍スミ、ケ、ホ、オ、ィセ、ヒチ、キ、ニホマ、ャヘラ、、ハ。ェ。。、ネサラ、テ、ソ。」、キ、ォ、キサ荀マーコ、コ、トネエ、ュスミ、キ、ニ、マ、゚、。「、ス、キ、ニウォ、ア、ニ、マ、゚、、ホ、タ、ャ。「ケフタ、ヒ、マ、ー、テ、ニ、讀ッオ、サ、マ、オ、鬢ヒヘッ、、、ニヘ隍ハ、、。」、キ、ォ、箴、、、ソ、ウ、ネ、ヒ、マ、゙、ソシ。、ホーコ、ー、ュスミ、キ、ニヘ隍。」、ス、、簇ア、ク、ウ、ネ、タ。」、ス、、ヌ、、、ニーナル・ミ・鬣ミ・鬢ネ、荀テ、ニ、゚、ハ、ッ、ニ、マオ、、ャコム、゙、ハ、、、ホ、タ。」、ス、ーハセ螟マエョ、鬢ハ、ッ、ハ、テ、ニ、ス、ウ、リテヨ、、、ニ、キ、゙、ヲ。」ーハチー、ホーフテヨ、リフ皃ケ、ウ、ネ、オ、ィ、ヌ、ュ、ハ、、。」サ荀マエナル、筅ス、、キォ、ハヨ、キ、ソ。」、ネ、ヲ、ネ、ヲ、ェ、キ、゙、、、ヒ、マニコ「、ォ、鯆郢・、ュ、タ、テ、ソ・「・・ー・、ホワソァ、ホスナ、、ヒワ、゙、ヌ、ハ、ェ、、、テ、ス、ヲ、ホエョ、ィ、ャ、ソ、オ、ホ、ソ、皃ヒテヨ、、、ニ、キ、゙、テ、ソ。」。ス。ス、ハ、、ネ、、、ヲシ、、、ソ、ウ、ネ、タ。」シ熙ホカレニ、ヒネ靠ォ、ャサト、テ、ニ、、、。」サ荀マヘォンオ、ヒ、ハ、テ、ニ、キ、゙、テ、ニ。「シォハャ、ャネエ、、、ソ、゙、゙タム、゚スナ、ヘ、ソヒワ、ホキイ、トッ、皃ニ、、、ソ。」

    ーハチー、ヒ、マ、「、、ハ、ヒサ荀、メ、ュ、ト、ア、ソイ靈ワ、ャ、ノ、ヲ、キ、ソ、ウ、ネ、タ、、ヲ。」ーヒ邁ヒ遉ヒエ网サッ、キスェ、、テ、ニク蝪「、オ、ニ、「、゙、熙ヒソメセ、ハシーマ、クォイ、ケ、ネ、ュ、ホ、「、ホハム、ヒ、ス、ー、、ハ、、オ、サ、。「サ荀マーハチー、ヒ、マケ・、、ヌフ」、、テ、ニ、、、ソ、筅ホ、ヌ、「、テ、ソ。」。ト。ト

    。ヨ、「。「、ス、ヲ、タ、ス、ヲ、タ。ラ、ス、ホササ荀マヨ、ホテ讀ホンヲンィ、イア、、スミ、キ、ソ。」ヒワ、ホソァコフ、・エ・チ・罕エ・チ・网ヒタム、゚、「、イ、ニ。「ーナル、ウ、ホンヲンィ、ヌサ、キ、ニ、゚、ソ、鬘」。ヨ、ス、ヲ、タ。ラ

    サ荀ヒ、゙、ソタ隍ロ、ノ、ホキレ、荀ォ、ハケキハウ、ャオ「、テ、ニヘ隍ソ。」サ荀マシナ、ソ、シ。ツ隍ヒタム、゚、「、イ。「、゙、ソケイ、キ、ットル、キ。「、゙、ソケイ、キ、ッテロ、ュ、「、イ、ソ。」ソキ、キ、ッー、ュネエ、、、ニ、ト、アイテ、ィ、ソ、遙「シ隍オ、テ、ソ、熙キ、ソ。」エイ、ハククチロナェ、ハセ、ャ。「、ス、ホ、ソ、モ、ヒタヨ、ッ、ハ、テ、ソ、タト、ッ、ハ、テ、ソ、熙キ、ソ。」

    、荀テ、ネ、ス、、マ、ヌ、ュセ螟ャ、テ、ソ。」、ス、キ、ニキレ、ットキ、熙「、ャ、ソエ、タゥ、キ、ハ、ャ、鬘「、ス、ホセハノ、ホトコ、ュ、ヒカイ、カイ、ンヲンィ、ソ、ィ、ト、ア、ソ。」、ス、キ、ニ、ス、、マセ蠖ミヘ隍タ、テ、ソ。」

    クォ、、ソ、ケ、ネ。「、ス、ホンヲンィ、ホソァコフ、マ・ャ・チ・罕ャ・チ・网キ、ソソァ、ホウャトエ、、メ、テ、ス、熙ネヒツソキチ、ホソネツホ、ホテ讀リオロシ、キ、ニ、キ、゙、テ、ニ。「・ォ。シ・、ネコ网ィ、ォ、ィ、テ、ニ、、、ソ。」サ荀マヤシ、テ、ン、、エンチア、ホテ讀ホカオ、、ャ。「、ス、ホンヲンィ、ホシーマ、タ、アハム、ヒカロト・、キ、ニ、、、、隍ヲ、ハオ、、ャ、キ、ソ。」サ荀マ、キ、ミ、鬢ッ、ス、、トッ、皃ニ、、、ソ。」

    ノヤーユ、ヒツ霹、ホ・「・、・ヌ・」・「、ャオッ、ウ、テ、ソ。」、ス、ホエフッ、ハ、ソ、ッ、鬢゚、マ、爨キ、サ荀、ョ、遉テ、ネ、オ、サ、ソ。」

    。ス。ス、ス、、、ス、ホ、゙、゙、ヒ、キ、ニ、ェ、、、ニサ荀マ。「、ハ、ヒカ、、フエ鬢、キ、ニウー、リスミ、。」。ス。ス

    サ荀マハム、ヒ、ッ、ケ、ー、テ、ソ、、オ、サ、ャ、キ、ソ。」。ヨスミ、ニケヤ、ウ、ヲ、ォ、ハ、「。」、ス、ヲ、タスミ、ニケヤ、ウ、ヲ。ラ、ス、キ、ニサ荀マ、ケ、ソ、ケ、ソスミ、ニケヤ、テ、ソ。」

    ハム、ヒ、ッ、ケ、ー、テ、ソ、、オ、サ、ャウケ、ホセ螟ホサ荀ネセミ、゙、サ、ソ。」エンチア、ホテェ、リイォカ篩ァ、ヒオア、ッカイ、、キ、、ヌテニ、サナウン、ア、ニヘ隍ソエイ、ハーュエチ、ャサ荀ヌ。「、筅ヲススハャク螟ヒ、マ、「、ホエンチア、ャネスム、ホテェ、テ豼エ、ネ、キ、ニツ酩ネッ、、ケ、、ホ、タ、テ、ソ、鬢ノ、、ハ、ヒ、ェ、筅キ、、、、タ、、ヲ。」

    サ荀マ、ウ、ホチロチ、ヌョソエ、ヒトノオ皃キ、ソ。」。ヨ、ス、ヲ、キ、ソ、鬢「、ホオ、オヘ、゙、熙ハエンチア、簗エヘユ、゚、ク、、タ、、ヲ。ラ

    、ス、キ、ニサ荀マウ霹ーシフソソ、ホエヌネトイ隍ャエツホ、ハシ、ュ、ヌウケ、コフ、テ、ニ、、、オカヒ、イシ、テ、ニケヤ、テ、ソ。」

    hyperestraier-1.4.13/misc/test009.html000066400000000000000000000044101125261632700175230ustar00rootroot00000000000000 < 文字 & 正規化 >

    文字の正規化

    1234567890

    ABCDEFGHIJKLMNOPQRSTUVWXYZ

    abcdefghijklmnopqrstuvwxyz

    My name is ″Mikio hirabayashi″. I’ll take it.

    ワタシノナマエハ平林幹雄デス。

    Copyright © 1978-2005 Mikio Hirabayashi

    2次元の 2 次元の2次元の 2 次元の二次元。

    &<>"'ÄÅÝùΣ†&hoge;AA

    今日は☀だった。でも明日は☁か☂になりそうだ。

    ,.:;?!´`¨^ ̄_―‐/\〜|
    ‘’“”()〔〕[]{}〈〉+−=<>′″
    ¥$#&*@♯
    

    2輪

    2輪車と2輪車が衝突した。


    ジュゲム

    寿限無寿限無
    五劫ノ擦リ切レ
    海砂利水魚ノ 水行末 雲来末 風来末
    食ウ寝ル処ニ住ム処
    ヤブラ小路ノ ブラ小路
    パイポパイポ パイポノシューリンガン
    シューリンガンノグーリンダイ
    グーリンダイノポンポコピーノポンポコナーノ
    長久命ノ長助
    

    ∞∴♂♀°℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓

    ニジヲムスンデソラノリボン。キミノエガヲヘオクリモノヨ。ネガイヲカケマショ、ユメビヨリ。アシタマタシアワセデアルヨウニ。

    キミガヨハ チヨニヤチヨニ サザレイシノ イワオトナリテ コケノムスマデ

    イッシュンノ センタクデ スベテヲ ナクシテモ コウカイハ ミセナイデ アカルク マケテ ナキマショー


    motsu

    Let’s gamble hey jumbo now shake your bum and do the rumble
    鋭くラインを三本 テンションあがりっぱでバンボー
    登場move三人衆 皆様の安眠中
    爆音で 「お前らウザーい!」 とか言われたって延々と
    I like to move it move it I’ll make you move into it
    国産のエグいノイズかます ギンギラギン欲望さらす
    スタートからゴールまでまとめてワープして
    マッハ55で抜き去っていこう
    to your next stage
    

    hyperestraier-1.4.13/misc/test010.html000066400000000000000000000022411125261632700175130ustar00rootroot00000000000000

    Telephone

    Les Blue Belles
    Yes I now you're never free on Saturday
    And I know I couldn't see you anyway
    Oh oh oh you told me we could have been lovers
    Lovers lovers lovers
    For you-I can run away and sail the seven seas
    For you-I can give all up and get down on my knees
    For you-oh oh oh I told to other boys I'm free never
    Ever never ever
    
    Come on your silly life is over
    Now it's time to give me affection
    I say come on so pick up your receiver
    There's my number at your home dialing it on the phone
    
    It's just a matter of
    Telephone call me tonight call me today
    Telephone without your voice no I can't stay
    Telephone I've gotta a message for my love
    Bad operator no communication
    Telephone call me today call me tonight
    Telephone without your love I can't survive
    Telephone jealousy wonders where you are
    Bad operator no communication
    
    Got to know the way you pass your Saturdays
    Got to know what crosses your mind anyway
    Oh oh oh can't keep me hanging baby forever
    Ever ever never
    For you-I don't sleep don't eat don't talk to anyone
    For you-with my friend a don't go to the cinema
    For you-oh oh oh all my emotions run into fever
    Fever fever fever
    
    hyperestraier-1.4.13/misc/test011.html000066400000000000000000000016401125261632700175160ustar00rootroot00000000000000 タ・クヘ、ホイヨイヌ
    タ・クヘ、マニハ、、ニ。。ヘシヌネセョヌネ
    、「、ハ、ソ、ホナ遉リ。。、ェイヌ、ヒケヤ、ッ、ホ
    シ网、、ネテッ、筅ャ。。ソエヌロ、ケ、、ア、、ノ
    ーヲ、ャ、「、、ォ、鬘。、タ、、、ク、遉ヲ、ヨ、ハ、ホ
    、タ、、タ、ネェ、ネ。。、オ、隍ハ、鬢ケ、、ホ、
    ヘト、、ト。。ケヤ、ッ、ハ、ネオ网、、ソ
    テヒ、タ、テ、ソ、鬘。オ网、、ソ、熙サ、コ、ヒ
    ノ网オ、ハ、オ、。。、タ、、、ク、ヒ、キ、ニ、ヘ

    フィ、゙、、、ホ。。セョ、オ、ハチ・、ャ
    タク、゙、、ソナ遉ャ。。ア、ッ、ヒ、ハ、、
    ニケセ、ホク、ヲ、ヌ。。クォチ、ソヘ、ソ、チ、ヒ
    ハフ、ケ、イ、ソ、鬘。ボ、ャスミ、ソ、
    ナ遉ォ、鯒遉リ、ネ。。ナマ、テ、ニ、讀ッ、ホ、
    、「、ハ、ソ、ネ、ウ、、ォ、鬘。タク、ュ、ニ、ッサ
    タ・クヘ、マヘシセニ、ア。。フタニ、簑イ、、
    ニソヘ、ホフ鄂ミ。。スヒ、テ、ニ、、、、
    hyperestraier-1.4.13/misc/test012.eml000066400000000000000000000043031125261632700173270ustar00rootroot00000000000000Date: Wed, 6 Apr 2005 17:02:56 +0900 From: Wikipedia To: Mikio Hirabayashi Subject: Deutschland Content-Type: text/plain; charset=ISO-8859-15 Deutschland (amtliche Staatsbezeichnung Bundesrepublik Deutschland) ist ein Staat in Mitteleuropa und hat gemeinsame Grenzen mit D舅emark, Polen, Tschechien, ヨsterreich, der Schweiz, Frankreich, Luxemburg, Belgien und den Niederlanden. Im Norden bilden die Nordsee und die Ostsee die natrlichen Landesgrenzen. Hauptstadt und Regierungssitz ist Berlin; einige Bundesministerien sind in Bonn angesiedelt. Das Politische System Deutschlands ist fderal und berwiegend als parlamentarische Demokratie organisiert. Der Staat ist in 16 teilsouver舅e Bundesl舅der gegliedert. Deutschland ist Mitglied der Europ臺schen Union, der NATO und der G8. Der nrdliche Teil Deutschlands, die Norddeutsche Tiefebene, ist ein von den Eiszeiten geformtes Tiefland. An die Tiefebenen schlie゚en sich nach Sden die bewaldeten Mittelgebirge im Zentrum des Landes und schlie゚lich die Alpen als Hochgebirge an. Der niedrigste Punkt liegt bei Neuendorf-Sachsenbande in der Wilstermarsch mit 3,54 Metern unter NN. Der hchste Berg ist die Zugspitze mit 2.962 m. Flsse in Deutschland sind Rhein, Donau, Elbe, Weser, Oder und viele weitere gr゚ere Zuflsse. Extreme Wetterbedingungen wie strenge Drren, Tornados, Strme, strenger Frost oder Hitze usw. sind relativ selten, da Deutschland zur gem葹igten Zone gehrt. Erdbeben mit schweren Folgen gab es in Deutschland bisher nicht. Dies ist damit zu erkl舐en, dass Deutschland auf der Eurasischen Platte liegt. Da sich keine Grenzen zweier gro゚er Platten innerhalb Deutschlands befinden, gibt es relativ wenige und wenn, dann auch nur relativ schwache Erdbeben. Die Bundesrepublik Deutschland ist fl臘henm葹ig etwas gr゚er als das Nachbarland Polen, hat aber mit rund 82,5 Mio. Menschen mehr als doppelt so viele Bewohner. Davon sind ethnisch gesehen rund 68 Mio. Deutsche und rund 15 Mio. ausl舅discher Abstammung. Etwa 75 Millionen Menschen besitzen die bundesdeutsche Staatsangehrigkeit, einige zus舩zlich die Staatsangehrigkeit ihres Herkunftslandes. Rund 7,5 Millionen Menschen sind (allein) ausl舅dische Staatsbrger. hyperestraier-1.4.13/misc/test013.eml000066400000000000000000000012551125261632700173330ustar00rootroot00000000000000Date: Wed, 9 Jun 2004 20:00:47 +0900 From: Mikio Hirabayashi To: Foo Bar Baz Subject: Sample Message-Id: <20040609200045.5eae8fb4.mikio@users.sourceforge.net> X-Mailer: Sylpheed version 0.8.5 (GTK+ 1.2.10; i386-vine-linux) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Estraier is the most useful search engine. She sang: > Somewhere over the rainbow > Way up high > There's a land that I heard of > Once in a lullaby > Somewhere over the rainbow > Skies are blue > And the dreams that you dare to dream > Really do come true Have a nice day. // Mikio Hirabayashi hyperestraier-1.4.13/misc/test014.eml000066400000000000000000000044541125261632700173400ustar00rootroot00000000000000Date: Thu, 10 Jun 2004 15:08:06 +0900 From: Mikio Hirabayashi To: Peter Cc: Flopsy , Mopsy , Cotton-tail Subject: =?ISO-2022-JP?B?GyRCSH4kNyQkRnxLXDhsJHJPQyQ9JCYbKEI=?= Message-Id: <20040610150806.36dc6a91.mikio@users.sourceforge.net> X-Mailer: Sylpheed version 0.8.5 (GTK+ 1.2.10; i386-vine-linux) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Thu__10_Jun_2004_15:08:06_+0900_082236a0" This is a multi-part message in MIME format. --Multipart_Thu__10_Jun_2004_15:08:06_+0900_082236a0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit This is testing for Estraier. $B$3$l$O(BEstraier$B$N%F%9%H$G$9!#(B Estraier is a full-text search system for personal use. Estraier$B$O8D?MMQES8~$1$NA4J88!:w%7%9%F%`$G$9!#(B $B$4$-$2$s$h$&!#(B Good-bye. // Mikio Hirabayashi --Multipart_Thu__10_Jun_2004_15:08:06_+0900_082236a0 Content-Type: text/html; name="peter-ja.html" Content-Disposition: attachment; filename="peter-ja.html" Content-Transfer-Encoding: base64 PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPGh0bWw+CjxoZWFkPgo8bWV0 YSBodHRwLWVxdWl2PSJDb250ZW50LVR5cGUiIGNvbnRlbnQ9InRleHQvaHRtbDsgY2hhcnNldD1V VEYtOCIgLz4KPHRpdGxlPkVzdHJhaWVy44Gu44K144Oz44OX44Or5paH5pu4PC90aXRsZT4KPC9o ZWFkPgo8Ym9keT4KPGgxPkVzdHJhaWVy44Gu44K144Oz44OX44Or5paH5pu4PC9oMT4KPGRpdj5I VE1M57eoPC9kaXY+CjxociAvPgo8cD5PTkNFIHVwb24gYSB0aW1lIHRoZXJlIHdlcmUgZm91ciBs aXR0bGUgUmFiYml0cywgYW5kIHRoZWlyIG5hbWVzIHdlcmUgRmxvcHN5LCBNb3BzeSwgQ290dG9u LXRhaWwsIGFuZCBQZXRlci5UaGV5IGxpdmVkIHdpdGggdGhlaXIgTW90aGVyIGluIGEgc2FuZC1i YW5rLCB1bmRlcm5lYXRoIHRoZSByb290IG9mIGEgdmVyeSBiaWcgZmlyLXRyZWUuPC9wPgo8aHIg Lz4KPHA+44KA44GL44GX5piU44CB77yU5Yy544Gu5a2Q44Km44K144Ku44GM44GE44G+44GX44Gf 44CC5b2844KJ44Gu5ZCN5YmN44Gv44CB44OV44Ot44OX44K344O844CB44Oi44OX44K344O844CB 44Kz44OD44OI44Oz44OG44Kk44Or44CB44Gd44GX44Gm44CB44OU44O844K/44O844Go44GE44GE 44G+44GX44Gf44CC5b2844KJ44Gv44GK5q+N44GV44KT44Go5LiA57eS44Gr44CB44Go44Gm44KC 5aSn44GN44Gq44Oi44Of44Gu5pyo44Gu55yf5LiL44Gr44GC44KL56CC5bee44Gu5Lit44Gr5L2P 44KT44Gn44GE44G+44GX44Gf44CCPC9wPgo8aHIgLz4KPC9ib2R5Pgo8L2h0bWw+Cg== --Multipart_Thu__10_Jun_2004_15:08:06_+0900_082236a0-- hyperestraier-1.4.13/misc/test015.mht000066400000000000000000000433771125261632700173630ustar00rootroot00000000000000From: Subject: Google Date: Tue, 26 Apr 2005 17:54:58 +0900 MIME-Version: 1.0 Content-Type: multipart/related; type="text/html"; boundary="----=_NextPart_000_0000_01C54A89.0FC57160" X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 This is a multi-part message in MIME format. ------=_NextPart_000_0000_01C54A89.0FC57160 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Location: http://www.google.co.jp/ =EF=BB=BF Google
    3DGoogle=20

    =E3=82=A6=E3=82=A7=E3=83=96    =E3=82=A4=E3=83= =A1=E3=83=BC=E3=82=B8    =E3=83=8B=E3=83= =A5=E3=83=BC=E3=82=B9    =E3=82=B0=E3=83= =AB=E3=83=BC=E3=83=97New!    =E3=83=87=E3=82= =A3=E3=83=AC=E3=82=AF=E3=83=88=E3=83=AA    =E3=83= =87=E3=82=B9=E3=82=AF=E3=83=88=E3=83=83=E3=83=97  &n= bsp; 
     
      =E6=A4=9C=E7=B4=A2= =E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3
      =E8=A1=A8=E7=A4=BA=E8= =A8=AD=E5=AE=9A
      =E8=A8=80=E8=AA=9E= =E3=83=84=E3=83=BC=E3=83=AB
    =E6=97=A5=E6=9C=AC=E8=AA=9E=E3=81=AE=E3=83=9A=E3=83=BC=E3=82=B8=E3= =82=92=E6=A4=9C=E7=B4=A2
    <= BR>
    =E5=BA=83=E5=91=8A=E6=8E=B2=E8=BC=89= - =E3=83=93=E3=82=B8=E3=83=8D=E3= =82=B9 = =E3=82=BD=E3=83=AA=E3=83=A5=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3 - Google = =E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6 - =E6=8E=A1=E7=94=A8=E3=83=BB= =E3=82=A4=E3=83=B3=E3=82=BF=E3=83=BC=E3=83=B3 - Google.com in English

    =C2=A92005 Google -=20 8,058,044,651=E3=82=A6=E3=82=A7=E3=83=96=E3=83=9A=E3=83=BC=E3=82=B8=E3=81= =8B=E3=82=89=E6=A4=9C=E7=B4=A2

    ------=_NextPart_000_0000_01C54A89.0FC57160 Content-Type: image/gif Content-Transfer-Encoding: base64 Content-Location: http://www.google.co.jp/intl/ja_jp/images/logo.gif R0lGODlhFAFuAOcAAP////f7/+fr/8bX/73P763H96W+7/f3/4Sq91mB1jFl1iFZ1hhNxhhJtRBF tUp952OW787T5+/v7xhRzgg8paW21tbb5/f39//7/3Oi7xhFrRA8lClJlDtZk0phlFJtrTlx3pSu 3ufn7ylRtWN5pJSetcbHztbT1t7b1tbX1tnXy87PzsbHxrW2vXOOztrl/7W6xt7b3t7f3sbDxsa+ vb2+vaWmrVqK7xA0hL26vbWytbW2tYSStb22vZyanDlhtQgkY3N5jM7Lzq2qpefj54SGlK2ure/r 7/fz7+fn54ySlElVc97f562mrffz97WyraWmpZyenKWipa2qrVppfClBa7XD3nuGrefk3pSSjIR9 c4Sa1u/n58vO1s7V1v/z79bb3ffXzve6rfeWhPeGc/emnP/Lxv/r5/dpUudJMd4wGNYkCOc8Ie9Z QtZlWufb3vfn1sYYAK0UALUkEL0sGMZ1a86upc7Hxt7Lxta2tf//7848KYwgEMaSjO/y9+fr797j 55xlWt7X1v/ztf/vMZRBMa2WjP/3hP/vCP/PANauAGssIaWCAP91Y4wQAO+6AK2GAIRpAHtNQrVF Mb2WAIR1Of/3/2sMAKWGe7WqpWNRALVZSntlUu/jlMaeAJR5AKWqrbWOAK2ytfffWvfXKff37+/H Kd66Qt7LjM7Dpc6uKf/392tpa72eEP/73u/r562OELWiY7WmjKqSMaWuvZyGQv//99bX3r3jvXvb hGvTc1rLWlqqY2PTY0LDSiGqKRCWGAB9CABlAEKOQu/375zTpTm6QjG2OYzLjAhRCPfr9xiiISld MVp1Wt7v3s7rzvn5+fHx8cnJycXEwcLCwxdAmv39/ainpxk5fxguYfT09OHh4bi1sAotdyo+bdfU 0ZKUmqKgoLKxsrm4uZqbn9LS0sC/v7SzspSTlZuZl9nZ2erq6nuWexh5IYyujHR0dKKiotHR0V1d Xbm5uS8vL+jo6IuLi0ZGRv///////////////////////////////ywAAAAAFAFuAAAI/gABCBxI sKDBgwgTKlzIsKHDhxAjSpxIsaLFixgzatzIsaPHjyBDihxJsqTJkyhTqlzJsqXLlzBjypxJs6bN mzhz6tzJs6fPn0CDCh1KtKjRo0iD4srFNJcuXbt28ZrK609ShgEEDCBQwIBXAwUIDBBw4KpZhrh0 9Xqq1tcvYMGCCRsG5qzBAwQQJFCwgEGDvw4C/2WwQMEDCAYiSLB7llgxY8d89Wqqyy3cuZYyX8Bw VkABCAomCKZAunTpwRNSTyicoIKFzYyN4kKGrJhtZE53HbucbMYRIkeQwEY6IMODBX01UNiwgUMH Dx8+eOjAQTkFBwwII0e+GkQIEbGR/lpSViyqsWVykzETImRFjCROOBsdAAEE3xHMO5AoYeIEiv8p qLACCy2UQEIHyg22nWoLuBBBeENdgEQSbyBjjDFvCSOMejv0wEIK8Mk31AvG2YffBiTAEIMMKAw4 Aw0w1iAjjC/aQEJ1qHE3QXYJWAAhUBccwUQMukCG3obqGaHDDDEER9QBBtzwAAj44UCCCTKcwEKM OXTp5Zc6hLmDjQlmp5pfFGjAw3A/6hQkE29Udl56yTTTxJIySCAiUCRKqYAGOHTQQosydtiDly+y oOiiMO4Qpg4+dJDmYH4phwMOHMTQ5k4XOCHBEbns4haddu5wAnxDEQCBlD9sAEQQ/gP2IGaHNLR3 QoAryiBDDDGc4GINYQ5BQpkNaLABDkAA4QERbG5q02ZO5NLLqEiWCuKePn1W3wjIFrFCDkoqWQML 7uka3KfCIYFuEkT0ugINjioxQmDGIgvEEicw4aSzOVkiLbXJJKMFnnoGZQAE2yKrBAs63KlDDjP4 l0RwFwzH2cWcefpbCkLA68MIy9m7xBPjNokEvzj5O+0vdA5MQwzCAaXtA9y+WkMTUAyhQ63vFYzx Qp0KyfHNHIgchRRT1HAqbBhgi7JLF/zLMpIu5/nzTjPXTEUOUCC98wnANftQ0FnmUPS9PqSd9KlO PG2TygAnU4QOLDARn08vIHyD/gKuVmGEFEfvIESTd1sUNAnIUhFF2lLQbbLbNUW7Mp1KOF74Tgdk sOqfySrRNRSC9+w0RVaM0MEVTwDeOJOoQk4TEm0dGXDlQjDrEwII04zsEk0EXve+GllgARYn5DCF zqxf7npMsE8rezJZhC72TXlnsLerQGRxtBHJX53RESfACzHhoy/f0gWx0xl97dPbhIDmVO7e+xBK t95RkCcIQS755tNETPpI8oHgbLeT4liPb8kqgu/sVr6LXEAC7VoR8Ponk/85j04CZF8DYxIABOAu fkCowuK4x7+PBOkIE6RgBdUypwD2YAX2wwmJEHC9xB1NBzBs30YqtsGIfCEM/mIYAxmGSIYxlMEM ZyCJHlwxiEOM4olPPMQgXPETC7YwYBmMoUPgIIYyCLGIZRADHLxXEFaYMQVMYMVmZKBGhBjgfTTD nhaQxiSf8eQMZUBDGtSghjWsQQ1sCGQa0tAGN4zhDR7RgxNN8YhGOvIRiYhkIkyBild8xA8vGEAB NsnJrnzFgx7cgihd4IIKFMQZULliMrKoQ4OEYQxtCCQg2TDIWhqSCwhRFyt6gIQYsIIGAGABK4hw EAF4sD6ACqEPGrcCAu4EDmTY4xriIIc50OGac/gjLdPABj66AZEZccUoEvEIRXiCEpRohTo9oQhF NDKSjTwFFjJygAHQ8AH4/nzADRDGTynZpy9oogAONlACOwIAlbtQJSsbEoZGsMGPcZiDRLVZy4eq oQ/tY0UNAEAEKGgBAzQY5kHyQsM/IUuETaifxW5yhjFIs5p1sMMd8LCCPNihDnTQpizjsIY6GDQi ehjnIzwRCljEIhUqENAdUhGLVrTzkeVEhfIgYszjZEc7htknBDTnp+SEbANXIOZKEarKKLxQiwY5 QzTVINFJ9MEONu3DJnI6yz7GYRLgLCMw28UKHRyBFSs4yButt4Bj3StndezhS8yABjbsYQ586EMM /PAHQPDKC5itQSCy+Ue7xmEPgqDIIAiRCEVQAhayyJMIhnSCW3mBBrFg/ucj26mKeUYkAAawqgY+ UIIKVGALHygMCPJpHwb84AokSO6VJkQE+AyHrLxZZQ6WphDGOnYOhbDDHyg7JDB4IROT4GkfpxkH OuDBIKyAQjCPADgADMwgTvCgcaoEBCrciX06KUMb0rAHORTiDn7olf629KIZGWIOPIVoHCKaB4kc AhGlhcQsVHAEAbOnwDOShVPdWU5ztkIFECGRfXbbBXUdgQvEo8UPCKMAvlSqBC1qbf5WADb7PSOV 0TUrdREihv32NxCA+APHLkwjGAQiweSVAx3yOpCVAuAARzDIDOvTgEu9am1HcPJM8tiG/hZiRQOm EYExfOAFK1gOcmgw/hkP8uAI14JXYU4Uo7oEhQ2305znBHFD6POAP11hQu4asBBq8AHsXLVeVwDW ocYlBDT67MYJzfF00SoQMaChy3IAcgzijGFZbQLJ1JTDJGImEQJk4ICAQlYQSLgYnHB5D3xYRKO5 FDEaB8hXHaOBIRbM61DL4Q4OabMiGFEJGtPaVrf+lSzYeWdPnBMWelYIfW4Agt2+wsIzmPMOCg2Y euFgbrRqT54KB2ljSHrHBWGsHrEboGPTeAX6A9Ye/DhNOTjCERjV8kIKcOq9pRoIc0vsTcTQiHU7 QgpdMFStaswuFB4hS+ypQ68XjOYlNw0AFzfIgxHxCEhEIhMJDzfD/h1OhCF1LBZ3buc5QzELZ0pZ c3F8WYHJ9e54G2EEVy3WsTZgAxbYKmwiKve50XqGgreBDgf/lsjNxS4B94GP9b43H2IwVYYY4NTH +XfAGWiThjbi6I6QBMN0sAOeOVc+QduYCcLbazQ7IhA8RMggEAFhSkSiEiYQEw3cM7HhVAwJQqOB KlK+ckbEouoA6ODmNuABpTN6Rc01uRBKcNVKHavxMQD6np7Ri0hjcNJOHkPB9xD2vD8sYvoSTsU0 FoMZvNQRl4g9JvyA+IRcHQLHOVa3lsR1mliCDKPnwyUw0YMpPGxp7esUEcCQiYm73RF2qBhCCAHh YWsiesanAfJH/qf8FNgh5eYMBSQYkYqqZ+3b4kM9xZygMY6R4Ew6xwEtuCCB6XFeN0NfqRka0Yg0 0OESWgAD2XcqqlcQb5IGazAH9xZ7l7AIJdQQuENthWVlRXBWrcQSBPd1SLcIObM2vZcQTpAEYPBp Z2ZvhQAIpEYQG/cIdqcJHThpKZhLIngKjaRylDB+Lac8fnBqoOEqlcM920cQQYIFMLAAqhF/y1J/ B3F/u/F56CYQwIcGsHYJWSAuT2gQgqAG1AR7DMgJtRODC2EcfcYA9WIz+EUTagV8aTAHlyAJXWM5 igUAnmIH9FZv9uYImZBle6IH1BdhkcAJNgA6XxiHE5IKjmRO/jfICJ+QA3qIcRjAb9ZTM8sEhwfx JglwhPVSBWdYEEyYfwSxfxroCIsQBchjNQjxBWWQBlsYe4vACVWoUg9RH8VVhluziTJBcGTQZcLn hikFNhdIEL00bxD1fEDWiBjXCXSXCJ7wCZoAiPRzAln2EBCkCjVoWuP3CW8WjQBwAfKlO9mDZToU JCGwGjvibaCQJxdgEJ2IQT3whGXAf2soioEIegfRUggYB7C3CJKgBWkziTn0EAlQGMlhWB4AgzUx RKF4Cc74O3EoEBLydOO1hY7AB75xMgNBfRxHCcw4RwTTkNt4BKhwiESliJHAAgTEBBnwQclEOzDT QBXjBXwx/pAKky9igwud14RIEgX0KBBfwH9SyIYcyGrYYgZk8FBrYIKYECb96AO9SGkIEZDc4W1V MEC1txJv0AhqqIAKCQqm4pQJcQF4IEtRB3uGoC/pCABwkIyKEAqRoAkc+Y8QEQAqIJLi9wmRkFrR GAH9ZlIARzcuV4lHsBd8UYaw0pIFYZP454TaCABhgAZf11/y6Jd+Z2l2JQd8UAd5MCTFdzQ54yEP uBAusBpG2ADMgQN+M4gzgYs/CXucYASwGJdJEEvdJJGXEAheQEDIWH0e55bgGBEXIAKmQE7ldIN2 iQm3mY6Q6G+qZoEMsQpbAAIgsABVpmrat5gCgZg4iUU7/gkAeeCYR2dvHHhWAmGPduhWTcIEHdMw xuchfFeVBrEFoika3rYwpigToveY9qaQovAyP8UQFxAAdTBIfXSHbTg4SjgKEOaHvMmfHtlkqCCc 1miXeNcktnAwuLcAyVSLXkkQFYBPfGmGWoSdnigQ76iB4GkDNcAEfqACRVlvc4CZfyBk8YYo4tZc 7mkQ48gd8YcDQWCga6YSSAB8Jsqa+zlZDToQdjBID0Wgi0CPpJCgnrCbVWOREvGgNUicd6dSFhqd qTYytpgQXeAnydSXqDkQIqqYw3Gf/mdvfMCVcsVroiZZlOUrMEIDNQAxjSYDfXekAEAAC0KGpdkB 1cmn/iBxAfw3pG1YpFQaEXjQBvvFVgu4CDqAX09KTlEqoYpKESoATxEaCZEwqcxiBfjEpboHCl+K EBFwA8rZOU9Qptd5k9HlA9O1mKKnR3TAppxQCHMwCZtQBzDqB0yQP0LwIrXSaD1TgBMhAqFhhJZ3 KTYAjb9oEkhwqGsKe5KQqROBBZe2RwqYj03AApNVCqQAT5d6d9gqEa8QnI1Uri4IrqtAANAZGqR5 Kd5SnwphAWKaLCLUkQRxpi4ErQMxBmhgq3c4MNR1ATJKZLVCYzYarQxxicyqc8dSmDcaEZm0FQOQ sRqrsVyxSa4hEEfgmATrreBasQchAUbHBt3agFDA/p9IMK6WCgmYWjcmC1/BGbNt2a5UlwQxKZ/H 0gE+yhCpGkfJYl/c85f+qp3oJrAj+3bqt3z5oyg0MAPtkXkUQ6gHkaM7AqjHwgEClxEkMiXQqU9b xYMSSIaBAgggK7IIeIccSLM/qhBBemkqG6m9KAEvS66hYJeR0LL2ChEXALNDxQg5e7ercImpwbU4 AApNolhWQG01kz3MxCx7krSr1I7GyLRte2+SAAODoyubpii2kno1+xARAH8SiwM80LgYIWIthhwK MFwQAErGoQBo6wFRBi0pe5QLmAVwSxFkMLB1y4pQAIM3O5wk6QO/KxEHME4424zgaAWVh4QU9osh /hCd2KM4UtCVZ2mmsOqESdC9+rVfvDuR3+ofvXIrKSADmmdCIIC69QK0G8oQApABRrgAI5C/I/AD H+ACp/Y+EggomTIhemKojrqkCxgIWKKEE8G0w5uoFngKnIqlmPC1vum8LGiX0AuDSMBt3cYcPEB/ G+QEe1MzS6A2DHqY3/uvi5kHB3yUd1jBEsMue6pvGzGOiWt5xxLC/ekQB2AFFWAFXYBZXgBvthIC +yQl0ukqVNAiEhQALsVNMHxvhTCoFOHAWqmQRiCeVoq8EmrFE4HBGqkJCwqtFyC9gmEdFOC1YFgQ BgBCS7A4ZuWqr5qYATSr3RsGSjqWVQw2eBsf/g6LETHArDlnLM0hBNZZEV8ggjNKA885JbZrWFtj dgGQB2IpkXwAqoFcEALbZVnsMtfSCXRJkjrANhMRAM67ljn7iilQf0FSAmqsxiPQBbaQEAOQe/fS O8sExv26wkq7mEcgm3Z4b2U5vya0BdNbLPVCAiJsEZ7SLh2jaDXwnP/0b1Rweu9xAW/QTZUZw8dJ qMGLaaxIiimqJ1gwynZpCMc5EReQyoRLxuRMdZwhJFdgGsyxARQwAqYEX7llUkHQA6pDld5jubIK rfKBAXUAdRRngt+cEhdwAgBVyIZcUJtsgCEIcYwiBCHgoRhqZVRgfPgVAG5Ab6FGxV1gpMxb/nD+ x4ULaaQHQIMdRgl1WQsnjQR8GriWyoyakF5TIHAhqAI8sHP3jM8O0BoWIAIi8AKf0WeAUgJC8DeC aJgGQdB4fNB58EdJdoeGIAKLahISsgWG5hcfzAElhrVyCEGg2ysrUgGrwqUe3QQ7SYcleG+ZkM0S cQQqncXao8mcYYgddk4y+wlPQKESIa7kxJZkvNeo+ZsxcAc24AGXcinM0QATAAI3cGowpwDcAgqC MCbIkwKJ7L12HDA6Zp1JIIxwytAMjBIXEAM/ENbdphw/IAM27J8ag0ISkNtIMDMdnTgPw7oA8Ad7 0HZ3aJvG7EqXNoVtGDimDAAiMHg2WJex/nALx10QcxdhZMwJzB2+aAc+NPAESuABVRDZFMAAIDC7 AKzZOHAFKAAuSgKuXknVANtkfcBTqW1vgbBdZk0RQQIDlBLbyvEBoe0QsDFVpnah1syviWcHzsem OfCXDaFfKx172mO4DpkKzVZ4iwjhDIGMLLjK8bzacpgEKgAvQxAFShAEKn4FJbAFKbktG1AFhYLN Ay7a2ZkMpb1SKEBe9y0H+aYSEMQDggEY3UYBzOwRB551Hr0kMVAwH/lp9+0Im6AvDYqyuhh7rLA9 ZRokp4BnhWd4R92gF0Ba1ueWk0jHGDAh4fMEUN2ZOqBVSs4BjnJ8dq0QlquTT+gEF1Df/g2OZj/O 2uBDAkNO5H9BAQLeEUne2/XVqvXZKXeAYAvtdoZAe3FbED0Wj8u9y+jm6K3gbM4m0+OnXaXr4Yit 3ZqOVmnOyCaOMzrAA8PVZ1VSBZ0ZtAtx59spEE7ABGzX5xilEsQACELwAZNC6IDxA7fAEYlOi4y+ qBMiC2j27M8+B3cgfQ0BB7YqfKN45vaa6naATt4O6rCwAjXrCqQ1xpLAOAoOXxAUuuLDA7HLF/P6 bSRzLQ3hr8LADDlugEeQB5A+cbzmBrg0NmbwBRYBDdFABNLwA8NO7NgRArWcEcm+5DOw7b+BCdAO 7XiVcQqxCg5FB9jej03ZvQ55BBYg/gvf/u2zEAMBUOkCQVrLqAnnPkKvmRDqQgS7cgIxcL3/xLUc YKofaOei8hZyoSH5XhAQ1AcX7+900OtAIwZuoGYFLwEoMA3CniYacPX/XdTHjhGqsjcMYFiLbsEY 8NMWf/FoNgnntRBFxwYe34Zdo+1dLRAQ5AWyEAp2f/d2n/IMEVSDqwmVoMuTG/cI4Sm67QX+lBxX n88tIBxxiAtGMvQawg7w7TRBAgZlD+3+vgd9gAdT9QVmMAaPBfUXYfAxQA0kcM/VgPX/zQBboLYW QQBTMgJjGvbb3imbhgl84AhmPwdMfxA9pgZIV5ubuTqEre6bJguwMH6QcPfpJFUJ/jEIpDBUdhmA vUP8NY4Q/9kpWzAlANVtDeDwDqELywAXkC8M7eAOL2MJJzskl5/0vbYGbOAGdYCQbaCF1XReFVPR B2ENEhAD01AEAMEBx4YN1TQcbJCQgYMFLiJcABBR4kSKEy8gUDBCAw4gHYFQeTJDBhIMFC8kSWEC SiFHLeW8fDmpTxgJFzCcCVOmjZo1cxwVgtLFiBQoOmikSGKzYsQLR1IOqcVIKiRIoSh5UoUKDkkA elwdIvVIUahPlTKZGCrFKFKIS91SjABCwYKFCe06cNH2LQBcy4AFEyYs2eDAwoK1GzaMVwqLR2J0 McSnpSOYMONcXnNZ88ufggAg/gGtdO9oANasRYtx55qHDQMJHtRgl8GECSC2EDhScnSAFwZuZNSA DUg24h9DjtQ90UmSEzNaYGI52XKcPXvSsFFz+WUhQym66GjSZG0SJ8mXLm/eIkutT+2lWvWE9ZQp U2I9UWI0S9YJIeDFzziBPPNIqyiECeq6KyEKSDhiL2eWCQawwSYkrLB2itELAAxOeioQySZzqbLK WuIDk6SIICKJI7gicC/TtNlGGm6U6AAHG11DSDbaFnjAhRAMIGAAIQcgoAAEIHhgLgY2AqIbILxZ gooiophCJBZNIiI9UDCR5MMQRZSjkEDsIIIJFnYwwogdABRQogElQiJL50BZ/q+S9j55jxI9Q+Fz llhSKfPMNNdk603S/HiBACtC2EIj2GKzqwEKfrDgrWeQcccddrRoplNPm2GHHXeSsKQ889Bzzocu HbkERFdbWgSTFUSI4YQTUpAhqQxbdMsabYj4JocmiqjxRhxzVIiB2WhjllllJd2Agw6oUAKccK69 1ggWmLiyMTnRBCUKTAKRpBBzzd2kjj7yYOKPLGnQId4cWECqPAIviDMlcH3IApNa/q1lFj9jseOO FJlYwbl4axCiXgwMreiAAQzI4Aa56HKAAoI2RtYBSUe4Za+mVuihiShOPtkIhmNgWUXRIsp3zii0 kGQRm2+2WZJADAFQiBl+/hbihFxf5vUta6CRIAZpxLkmiyCWqMJYGzem4FHYKMBaY2k/4AGGFRIe Z4pryQmniR6EIMLepS5wwikhanhiivBAEaUFGhoGAxC9+WOBhhz+BjCGFSFe6oC2Y3g7bihsoHsH hr24hYm9E/Yb8BUEJ9qtCwZAIMkDFayaA9FFPzZBCkZgQnPHWACPKNeHMAroGNqUiG3mZih58ZOz 4D2LKJpQM155H59d7aJJ85WIcsw555qmg6AC6qilxqaaaKX1gAQeSvBaBiywSEEIc8ZpYgrzp9hB h4YHF/mILN8GV24dcqgB6L5/9puFy9PetUU/3OcPvHQgv/nVjwUHZAH+/u62v5qQ5gIFgMDFJKWB DmiPFibwwgnOBIUicOA1kEqIBiaVm4o0BXFwE97CLHeC2XUrIm0jQsJyZwMpoMyGi5NX4Gh3PAJZ 4wISSIIgxBe2a0jBB/xCRzrAUa0oMG4c5piBNFbwjRVIwwRRnME0zGGOHIzDi+aQhhDUAYYd7gUJ 7vMODSqngx4AToFCCBoKUpS54y2HCWmsXBvdiD84Co1/hJPIACqWpBFE6womwMIruAC+NObOB6yp mulwcIVS7Mp2tRLC1zS5yRQIriaGagoRHqMw8EBBbqeUFwsahjlA8rAipoGGNtynjnLMoIviwKU4 5HaNIUxBHOfQwTnS/iSOJzxBHNzYQQ5oQI07rKAcLNwGEdaxjmjQ8S34ihMRvANHbvaRhbNz2cNc aZIjuE8G2+xmJr/WyXZ90oEGgMANHvADglwBKShI2AFncMAa9KCUUyDBBiJpFw0QpAuZw2aKjqCi JDC0oQt1p+aWkwRMJnAGasxfH2Mwx/6Ns4dH04YE1rGNGKRgBT6bwRZ/Ng1qYPEO1BDCM2OwjW0k YZpHkEA1nXABa4hzIq0EQAAu0BRzlkkGR2WCQpFgKo9eEzQpMmpSpbqinbZIAkdC0ghwwIEayOBt laNB/WYgBATWoJ9P6OBAD9IaBjHVTUPdEBLwNVS5DpVXCU1CVFkW/gOkUtWaTUWeaWB5AVmuIwnb kEEMwMCEbagjqQ1V0Yq0AQ3KUlawsLRGRICquQ3hywkSCI1nNwvYuQ71s3Jd6miDmgEIZBUHVRir Hs1KA/2tc6+1kmEUNELQ1nBgVn8F7ESEWloJFDe0HQ1ucpW7XOY2l4dYvQE9gWADeE1BXnjrK06L C8C32WAEDlhIQW1EC26p1rnnRW961bvepg4AAqwFAQc+IizxzMuPR2Ab0YZ6BK/SoATPEi8QlFCo pr7jHexFcIIVvODjISADGXiAVgVsMpUJwZPABcAPmXOHK3yuNUAogoXdCQ8Dl7jE8diLgRm8Yha3 mL0RyMCRQLCR/ioc0Qg5uFxEd3OSGNRAAQf6cBDY1JZ3yGMeR0YyPeYxkXgg+cjyMLKT6+FiKlfZ yi2iWMUUsAEg1FgtIjbvZ46AggTQ5cNFYBipIqJiiih5IiQuMT3kTA8To/jKd8bzlUPw4AhzucZV qhcPhXqELZiZI0rYAdqUwuaJuHkp8aDzOxydZ0pXesUXgW8hXxsF9aXNp5q91ypCoAAG+JnTii4J oyUyaYrIwx4Gtoc8LD1rWrN3C/EkdWtw4AMc68qjo5bwEsSj6DXfw8QGZrVE5kGPehi4HvSwc62l Pe3gbuEBcllSa4QcIOS2aAsKYFIRikJsABTZyUdONgDqcY8l/qsYHveYMrXlPW8ClWTUShIvVwns Sj88YAFcXsLJzqbmch+4zUueyLoNzuZ3wJveD4f4TwFAgAXQJrwEIQEKkuLRCmSEIz4gSg0IrOqI sFrhJb6Hsd9BYodH3OX0LkUCnhVCEfKAhK58AQgKCeJTbotFJAfApJd9YCRD+cgolnS8X750aVsh QY9ywc2L9oIHlBoIQaBvDwKktoYfW9IIVzc8KEJypTPd7JV2AhJ4ULVH2eUHVrBF0QoAglJPUghD UV8MImruc6d7IkA/e+ArLQEZkCBrbQcvCEIAiFLsxQkFuIGZOQAKFfhTZVtPDtD9LhHAC97zV0bP FTb2QYVM/mABIPBRBYJEJAMgwGIH0hgJWChAHJc3uPAQ++d1j2cT3iEKxSrdsprVrGdpzAMweEUK wArm3Tff8ydpjg6KwJrgK8v6BNXaIfP61R6MVe9hdn74aR2zHgxBCUHwgOiQNUENjGAEXIPBPSln uaGBX/z3pzT5h7A4fimhCFcAQB7YHlqAAf1JAf4QArCqH6TQMfxzQIhDj8SZAiiQgtcJHtnqp78x q+4LmtmxqwcEwYg7iffxG/A4pbkRD3lJphwAmhOQowYMwRiUN6Iqk/BJwLPagRyUrbGylZbBL/uT wSCssv1yH206QFtBQlvpJL5ymW4TwieUNnwpru0ignKKNiycOi43gcItfDibGCon5MIwFMMxJMPz KgndOMMyVMMyTMM1dMM3hMM41EI01BA5tMM7DK6AAAA7 ------=_NextPart_000_0000_01C54A89.0FC57160-- hyperestraier-1.4.13/misc/test016.mime000066400000000000000000000055731125261632700175170ustar00rootroot00000000000000HTTP/1.0 200 OK Date: Tue, 06 Sep 2005 19:15:33 GMT Server: Apache/1.3.33 (Unix) PHP/4.3.10 Content-Location: index.ja.html Vary: negotiate,accept-language TCN: choice Last-Modified: Thu, 01 Sep 2005 09:47:31 GMT ETag: "6f9138-19da-4316ce33;431a16a3" Accept-Ranges: bytes Content-Type: text/html Content-Language: ja Connection: close Proxy-Connection: close Content-Encoding: x-gzip Pragma: wwwoffle-compressed スY[WY~躙惓璃YcRオラネt#カホBeZ\:3kヨ"9$・IUコェツナァTUP"(エ6xE!Diエ萇ェ<_}NU\^N*gロ竜マ゙Eォ。D `Eeゥヌ8├ー・hwケ鯉/ワW。末N_gO格 ミs幟s揶輔<コ4コzカ|7tISトーニ]8トナ4-ルホャチ縷Y塊ス゚C・賦ケK淕d-ツQuL P屯ュァN搜9コゥ=.Pカラ標  善K05Q>%tp擺、aIuテ謾ナ ;O 0呀疆蛬 i<%W 滑オヌi」\メ羣!VXU+d%!;8!・ナd・b轌コ(」ウ「" テDョ聶AY鴎BgA宸コタムh苗ォT<」レ相%;セ9WチjX$JjLN$ノィZ・HチホJ1wp~セvラー" カR8モ'Nt1鞅D-惷F]R4.ェ1/洩AU麕5ア譯薀B癒eOテT゙ユ ヨ/I)Zオ x"e A渓r{與)(U9・б?)KT+蒜|CユjGB晤:ャj8 Q)IヤDャy%ネ;Iン#テ,ノ[`ュ kr|~痃ニノルモキナルツbB稽b゙$3j・q繧 蹲鎮。N99ャ尉リ'ヤ懺チヌIT耀AdC コUC欄d;鼾・治タ u*Nノタm靠ヾ #a@脾 Kp /$b@。向]GXナA将ォJY\写\((&「HUツホw'謳厳gCッD丘pヌP&cz jfkニクShト痂[ネ^2階:クコ>Hヨ願ヘ「Ce「?"i鑚D 1}肱樂でヨ*ムヌ%iス設カヨテテbゥ5ャノ瞭Hトラ爿}w∬粟寞+?Yサ)ク1誅h鰾メ2,ホ 具ワ_uリ#8#sJWp1゙c遭」 Rメヌャ髻]|=6ムキ箝シ5z酉pEャラF睇オナオ:GフMblムOェ寂X」+lマa49Oフbセ$,1MbャSbけ譎ョ裕)ン3I}イ。ク1ゥsオユヤKUェポイq<f幻_ヘ3季ヲ輅|>シaトク] 投ウb7謁ォツ嘴サ{D|K/猛 y踊?<`0 kqケtk「2[B觀GFil\゙゚攘G'"^E!qオv&ィ描ヨニ8K<羮hdフWヤ゚ニ;/k罠擔.-ヘ?ン゚ルゼc|ツB4ハ禊コソ5]キ&3ヨフ.=ケ4`ag7>レネ;,ハョアウik6G餓.8ヨxbュ>エヘミジmナ s4]傚ζ厠rkナ扈ヨ}P o3D゚+~c,zレzJ鱸;{eョh~ワT棣IテヒィォpoアレウT_\ 」n1%k z<・メネkヒd%e&9巷昿e溜!カKトjーPョBン「てセオXTau^」距ミU「゚fyg -$ァ碯sW 幢/^b・~ル宸ォ6+Y[,YH雁[ci .メoPXI|FM侠P;ャxタ2|マンbゥjタUH^ュァオHミフeェノiャク~4E]ィ|JG音Jフ4;Mソsメ{ ツeT4%FpせトL係 -ロD0Y'*5^ウフ嫩eヌ@、HシF"nzUсキトl]eY冦啝C語トシォ。*dヘシ1壻リヘレ蒔W_タメ・_イgモkV'ナッ;」Bpイク1_wク胚%。盪PIソkン}マ弋・ョI=(JテBvヤEァムシヘNq鮒ニラュ醗4サ檎NNコg& :搾R}テァ+q イ)聳k( エミ樺=(テ座咥鉦5%E8Vpマaハ戳o,mアJキ郢゙YI &イホェvm7h+cg&コァ墟Bウ .)+ヨレァ嘴 エツ$`!)愿「5^ムl漏(儚\X!{|N1,R*|疆タロ hュc9セ@5セ`XGEテ ユリfWふン費 Tエマナ%マc{歃&弊セ點ZGEJ'靉E*ニラ涛Mm箆a ナム~ツ栲ィコ"~ヲv,}奚籀F晝zソ率{*サア゙ムu攣+簧=ス#~>メ葎+8\ァソ9Oy「vTォoヘコ9R2sャオv:xw8bーテ層?U、ヲ/タ「R歓S蛬mPP0l」o*NキサTJk16暾レZフレ3淅黽賄エn`/ル竺f [kGヨ゚B滷榴ヲTイw奇^6?ン-ュm珊マ6吩諸25ウカ7ァャメL茶カヤ崑儂ィ趨ーRキv枉96仄捺yイヨfh賺シキV'ニeル馥シセレー マィvワ7ヨヤ岌'Yヒェb:←g8ョ9鑒5イaマfン ミ+ョl疲ヌ)UW{゙-ヨセ`5#モTdヘ0ャロマ`オ7ァ+數ニIm("TコXーァS琵蝴梺9ヤG_#v /* nィo,サ1ヘ4=晒uタマ大テdモuニモナツ゚DラXト|Mfヨラム掛 【aセl3ロ#V l%ーPナル框繝sレ廷、札Hサ=u樒F崗メト{ッ~ル?リ?g|>ヤu4コx9ラン|セPヒ^、krレhyperestraier-1.4.13/misc/validurl.txt000066400000000000000000000006631125261632700200160ustar00rootroot00000000000000http://hyperestraier.sourceforge.net/ http://hyperestraier.sourceforge.net/index.ja.html http://hyperestraier.sourceforge.net/uguide-ja.html http://hyperestraier.sourceforge.net/pguide-ja.html http://hyperestraier.sourceforge.net/nguide-ja.html http://qdbm.sourceforge.net/ http://qdbm.sourceforge.net/index.ja.html http://qdbm.sourceforge.net/spex-ja.html http://estraier.sourceforge.net/ http://estraier.sourceforge.net/spex-ja.html hyperestraier-1.4.13/misc/zen.txt000066400000000000000000000015151125261632700167650ustar00rootroot00000000000000菴幄ェェ鞫ゥ險カ闊ャ闍・豕「鄒陷懷、壼ソ邯 隗閾ェ蝨ィ闖ゥ阮ゥ陦梧キア闊ャ闍・豕「鄒陷懷、壽凾辣ァ隕倶コ碑顔嚀遨コ蠎ヲ荳蛻闍ヲ蜴闊榊茜蟄占牡荳咲焚遨コ遨コ 荳咲焚濶イ濶イ蜊ス譏ッ遨コ遨コ蜊ス譏ッ濶イ蜿玲Φ陦瑚ュ倅コヲ蠕ゥ螯よ弍闊榊茜蟄先弍隲ク豕慕ゥコ逶ク荳咲函荳肴サ荳榊椶 荳肴キィ荳榊「樔ク肴ク帶弍謨遨コ荳ュ辟。濶イ辟。蜿玲Φ陦瑚ュ倡┌逵シ閠ウ鮠サ闊瑚コォ諢冗┌濶イ閨イ鬥吝袖隗ク豕慕┌逵シ 逡御ケ閾ウ辟。諢剰ュ倡阜辟。辟。譏惹コヲ辟。辟。譏守孱荵閾ウ辟。閠∵ュサ莠ヲ辟。閠∵ュサ逶。辟。闍ヲ髮貊驕鍋┌譎コ莠ヲ 辟。蠕嶺サ・辟。謇蠕玲腐闖ゥ謠占湊蝓オ萓晁握闍・豕「鄒陷懷、壽腐蠢辟。鄂」遉咏┌鄂」遉呎腐辟。譛画$諤夜□髮「 荳蛻鬘壼貞、「諠ウ遨カ遶滓カ讒荳我ク冶ォク菴帑セ晁握闍・豕「鄒陷懷、壽腐蠕鈴仭閠ィ螟夂セ荳芽乱荳芽娼謠先腐 遏・闊ャ闍・豕「鄒陷懷、壽弍螟ァ逾槫鋳譏ッ螟ァ譏主鋳譏ッ辟。荳雁鋳譏ッ辟。遲臥ュ牙鋳閭ス髯、荳蛻闍ヲ逵槫ッヲ荳崎劒 謨隱ェ闊ャ闍・豕「鄒陷懷、壼鋳 蜊ス隱ェ蜥呈峅鄒ッ隲ヲ鄒ッ隲ヲ豕「鄒鄒ッ隲ヲ豕「鄒蜒ァ鄒ッ隲ヲ闖ゥ謠仙ィ大ゥ險カ 闊ャ闍・蠢邯 hyperestraier-1.4.13/myconf.h000066400000000000000000000137701125261632700161470ustar00rootroot00000000000000/************************************************************************************************* * System-dependent configurations of Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #ifndef _MYCONF_H /* duplication check */ #define _MYCONF_H /************************************************************************************************* * common settings *************************************************************************************************/ #undef TRUE #define TRUE 1 #undef FALSE #define FALSE 0 #if defined(_MYNOZLIB) #define ESTUSEZLIB FALSE #else #define ESTUSEZLIB TRUE #endif #if defined(_MYLZO) #define ESTUSELZO TRUE #else #define ESTUSELZO FALSE #endif #if defined(_MYBZIP) #define ESTUSEBZIP TRUE #else #define ESTUSEBZIP FALSE #endif #if defined(_MYMECAB) #define ESTUSEMECAB TRUE #else #define ESTUSEMECAB FALSE #endif /************************************************************************************************* * system discrimination *************************************************************************************************/ #if defined(__linux__) #define _SYS_LINUX_ #define ESTSYSNAME "Linux" #elif defined(__FreeBSD__) #define _SYS_FREEBSD_ #define ESTSYSNAME "FreeBSD" #elif defined(__NetBSD__) #define _SYS_NETBSD_ #define ESTSYSNAME "NetBSD" #elif defined(__OpenBSD__) #define _SYS_OPENBSD_ #define ESTSYSNAME "OpenBSD" #elif defined(__sun__) #define _SYS_SUNOS_ #define ESTSYSNAME "SunOS" #elif defined(__hpux) #define _SYS_HPUX_ #define ESTSYSNAME "HP-UX" #elif defined(__osf) #define _SYS_TRU64_ #define ESTSYSNAME "Tru64" #elif defined(_AIX) #define _SYS_AIX_ #define ESTSYSNAME "AIX" #elif defined(__APPLE__) && defined(__MACH__) #define _SYS_MACOSX_ #define ESTSYSNAME "Mac OS X" #elif defined(_MSC_VER) #define _SYS_MSVC_ #define ESTSYSNAME "Windows (VC++)" #elif defined(_WIN32) #define _SYS_MINGW_ #define ESTSYSNAME "Windows (MinGW)" #elif defined(__CYGWIN__) #define _SYS_CYGWIN_ #define ESTSYSNAME "Windows (Cygwin)" #else #define _SYS_GENERIC_ #define ESTSYSNAME "Generic" #endif /************************************************************************************************* * general headers *************************************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if ESTUSEZLIB #include #endif #if ESTUSELZO #include #endif #if ESTUSEBZIP #include #endif #include "md5.h" #if defined(_SYS_MSVC_) #include #include #include #include #include #include #include #include #elif defined(_SYS_MINGW_) #include #include #include #include #include #include #include #include #include #elif defined(_SYS_CYGWIN_) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #else #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif #if ! defined(_QDBM_LIBVER) #error QDBM is required but not found. #elif _QDBM_LIBVER < 1411 #error This version of QDBM is too old. Use 1.8.75 or later. #endif #if defined(__va_copy) #define est_va_copy(a, b) \ __va_copy(a, b) #elif defined(va_copy) #define est_va_copy(a, b) \ va_copy(a, b) #else #define est_va_copy(a, b) \ (a = b) #endif /************************************************************************************************* * notation of paths in the file system *************************************************************************************************/ #if defined(_SYS_MSVC_) || defined(_SYS_MINGW_) #define ESTPATHCHR '\\' #define ESTPATHSTR "\\" #define ESTEXTCHR '.' #define ESTEXTSTR "." #define ESTCDIRSTR "." #define ESTPDIRSTR ".." #define \ open(pathname, flags, mode) \ open(pathname, flags | O_BINARY, mode) #else #define ESTPATHCHR '/' #define ESTPATHSTR "/" #define ESTEXTCHR '.' #define ESTEXTSTR "." #define ESTCDIRSTR "." #define ESTPDIRSTR ".." #endif #endif /* duplication check */ /* END OF FILE */ hyperestraier-1.4.13/myimage.dat000066400000000000000000000256451125261632700166310ustar00rootroot00000000000000/************************************************************************************************* * Raw data of the icons * Copyright (C) 2004-2005 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ /************************************************************************************************* * icon data *************************************************************************************************/ /* favorite icon (PNG: 16x16) */ const unsigned char g_favicon[] = { 0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52, 0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x08,0x03,0x00,0x00,0x00,0x28,0x2d,0x0f, 0x53,0x00,0x00,0x00,0x33,0x50,0x4c,0x54,0x45,0x01,0x00,0x00,0x37,0x38,0x36,0x06, 0x60,0x48,0x2c,0x5c,0x77,0x51,0x53,0x50,0x2f,0x79,0x64,0x48,0x71,0x89,0x6a,0x6c, 0x69,0x56,0x8f,0x82,0x86,0x88,0x86,0x80,0xac,0xa0,0x97,0xa2,0xa4,0xb6,0xba,0xba, 0xce,0xd4,0xd2,0xe3,0xe5,0xe6,0xf4,0xf6,0xf3,0x08,0x45,0x62,0x5c,0xbf,0x84,0xa8, 0x00,0x00,0x00,0x01,0x74,0x52,0x4e,0x53,0x00,0x40,0xe6,0xd8,0x66,0x00,0x00,0x00, 0x01,0x62,0x4b,0x47,0x44,0x00,0x88,0x05,0x1d,0x48,0x00,0x00,0x00,0x09,0x70,0x48, 0x59,0x73,0x00,0x00,0x0b,0x0f,0x00,0x00,0x0b,0x0f,0x01,0x92,0xf9,0x03,0xa5,0x00, 0x00,0x00,0x07,0x74,0x49,0x4d,0x45,0x07,0xd5,0x04,0x07,0x0c,0x16,0x21,0xbf,0x9b, 0xe5,0xa8,0x00,0x00,0x00,0x77,0x49,0x44,0x41,0x54,0x18,0xd3,0x4d,0xce,0x5b,0x12, 0xc3,0x20,0x08,0x40,0x51,0x8b,0x35,0x80,0xf2,0xda,0xff,0x6a,0x2b,0xc1,0x66,0x72, 0x3f,0xcf,0x20,0xd8,0x1a,0x72,0x85,0xac,0xed,0x8e,0xbd,0x62,0x5b,0x7a,0x60,0xc2, 0x4c,0x70,0x5b,0x56,0xa0,0xa0,0x1b,0x50,0x44,0x50,0xcf,0x44,0x3e,0xc1,0xcf,0x8e, 0x0f,0x10,0x0c,0x77,0x5d,0x8b,0x0b,0x68,0xe8,0x3d,0x64,0x7a,0x60,0xcc,0x6d,0x75, 0xa9,0x60,0x1f,0x19,0x24,0x3d,0x2e,0x2b,0xc8,0x23,0x40,0x61,0x16,0x67,0xc7,0x00, 0x22,0x88,0xec,0xbf,0x34,0x8b,0xf5,0xda,0x91,0xf5,0x6e,0xae,0xf6,0x02,0xed,0xd1, 0xaf,0x9a,0x40,0xd1,0x27,0x4c,0x10,0xfe,0x3e,0xed,0xaf,0xff,0x00,0xc6,0x41,0x09, 0x07,0x6c,0xd3,0x95,0xf1,0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60, 0x82 }; /* big icon (PNG: 64x64) */ const unsigned char g_bigicon[] = { 0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52, 0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x40,0x08,0x03,0x00,0x00,0x00,0x9d,0xb7,0x81, 0xec,0x00,0x00,0x00,0x93,0x50,0x4c,0x54,0x45,0x00,0x00,0x00,0x4c,0x5f,0x42,0x41, 0x5f,0x61,0x40,0x62,0x5e,0x52,0x5e,0x4b,0x4c,0x5f,0x68,0x59,0x5f,0x56,0x58,0x64, 0x73,0x65,0x65,0x61,0x5f,0x6c,0x7e,0x72,0x6d,0x6c,0x6a,0x72,0x85,0x7c,0x76,0x7b, 0x72,0x79,0x8d,0x7c,0x81,0x91,0x88,0x7e,0x84,0x88,0x8c,0x9b,0x94,0x8b,0x91,0x92, 0x94,0xa0,0x9d,0x93,0x99,0x9c,0x9d,0xa6,0xa5,0x9a,0xa0,0x9f,0x9f,0xa3,0xa8,0x9b, 0xa8,0xac,0xa3,0xab,0xa7,0xa8,0xaf,0xa8,0xaa,0xa7,0xb7,0xa9,0xb7,0xaf,0xb1,0xae, 0xb5,0xad,0xb5,0xb0,0xb1,0xb6,0xb8,0xba,0xb7,0xbb,0xbb,0xc0,0xc4,0xb6,0xc4,0xc2, 0xba,0xc3,0xbd,0xbf,0xbc,0xc5,0xc4,0xc8,0xc4,0xc6,0xc3,0xcb,0xc2,0xc8,0xcb,0xce, 0xca,0xce,0xcd,0xd1,0xd5,0xcb,0xd1,0xd0,0xd2,0xcf,0xd7,0xd9,0xd6,0xd9,0xd8,0xdc, 0xe0,0xd6,0xdd,0xdf,0xe0,0xde,0xe8,0xdd,0xe4,0x45,0x62,0x3e,0x94,0x37,0x14,0xf8, 0x00,0x00,0x00,0x01,0x74,0x52,0x4e,0x53,0x00,0x40,0xe6,0xd8,0x66,0x00,0x00,0x00, 0x01,0x62,0x4b,0x47,0x44,0x00,0x88,0x05,0x1d,0x48,0x00,0x00,0x00,0x09,0x70,0x48, 0x59,0x73,0x00,0x00,0x0a,0x9c,0x00,0x00,0x0a,0x9c,0x01,0xf4,0xd2,0xdf,0x12,0x00, 0x00,0x04,0x98,0x49,0x44,0x41,0x54,0x58,0xc3,0xed,0x56,0x6b,0x93,0xa2,0x3a,0x10, 0x85,0x84,0xf0,0x08,0x20,0x22,0x66,0x54,0x0c,0x04,0x0c,0x21,0xbc,0x64,0xf2,0xff, 0x7f,0xdd,0x6d,0xdc,0x75,0xc7,0x79,0xdc,0x1d,0x75,0xab,0x6e,0xd5,0xad,0xda,0x7c, 0xd0,0x2a,0xa0,0x3b,0xa7,0xcf,0x39,0xdd,0x89,0x65,0xfd,0x5d,0x7f,0xd7,0x7f,0xbd, 0x9a,0xe9,0x8f,0xc2,0xbb,0x90,0xac,0xff,0x24,0x3c,0xd8,0x90,0xa0,0xb4,0xe6,0xa7, 0xd1,0xc7,0x84,0x1c,0xa6,0xa1,0xd3,0xe3,0x93,0x09,0xd6,0x08,0xa3,0x4e,0x09,0xa9, 0x9e,0x49,0xb0,0x09,0xd7,0x56,0xb7,0x25,0x5e,0xc9,0xb9,0xd4,0x8f,0x87,0x9f,0x48, 0xec,0x91,0x62,0x9e,0x3c,0x7c,0xc8,0xf9,0x33,0x00,0x56,0xab,0x53,0x1c,0xe8,0x4e, 0xaf,0xf1,0x8a,0x73,0xf5,0x38,0x89,0x5b,0x74,0x38,0x05,0x5b,0x29,0x64,0x83,0x91, 0x10,0x8f,0x25,0xe8,0xd6,0xdb,0xce,0x5a,0x61,0xcf,0x2b,0xaa,0x52,0x48,0x1d,0x93, 0x4a,0xc8,0x47,0x4a,0x38,0x10,0x82,0xc3,0x75,0x8c,0x89,0x12,0x7c,0xbd,0x51,0x53, 0x35,0x6a,0xa9,0x86,0xfb,0xa1,0xc7,0xe1,0x6a,0x83,0x51,0xe0,0x21,0xb2,0xcd,0xb7, 0xa1,0xd2,0xd3,0x3c,0x0e,0x5a,0xbf,0x2b,0xa1,0x3d,0xff,0x26,0xde,0xc3,0xc1,0x3c, 0xc6,0xd8,0x5b,0x11,0xc8,0x12,0x6c,0x95,0x1e,0xa6,0xf9,0xbd,0x0f,0xcf,0x89,0x9b, 0xfe,0x9b,0x72,0xe5,0xe4,0x11,0x1c,0x6b,0x59,0x62,0x9c,0xbf,0xc4,0x61,0x90,0x73, 0x09,0x10,0xde,0x7d,0x73,0x8e,0x32,0xdf,0x3f,0x7e,0xdd,0x6d,0x2b,0xb4,0xe9,0xba, 0x0d,0xf6,0x04,0x2f,0x3d,0x8f,0xe7,0xcb,0xe2,0xe2,0x43,0xf5,0x7d,0xe2,0x3a,0xbb, 0xbe,0xd3,0xb7,0xc6,0x2a,0xbd,0x18,0x12,0x74,0x93,0x75,0x40,0xc1,0x34,0x9e,0x3c, 0xaf,0xcc,0x4b,0xbc,0x12,0x1c,0xa2,0xc5,0x27,0xf6,0x98,0x6d,0xec,0x56,0x49,0xa9, 0x6e,0x9a,0x15,0x63,0xe8,0xd6,0x43,0xb0,0xb5,0x2c,0x0f,0x57,0x4a,0x85,0x24,0x2e, 0x63,0xaf,0x92,0x20,0xfe,0x30,0x2e,0xea,0xbd,0x5e,0x29,0xdb,0x45,0xa9,0xd5,0xee, 0x7c,0x7f,0x7f,0x63,0xed,0x6e,0xda,0x7a,0x04,0x6d,0xf4,0x21,0xc0,0xeb,0x09,0x3a, 0x27,0x96,0x72,0x85,0xbc,0x70,0x25,0x64,0x75,0xed,0x9f,0xda,0x4d,0x2f,0x19,0x5a, 0x1a,0x51,0x77,0x3f,0x4f,0xbe,0x61,0xbf,0xac,0x3d,0xad,0x48,0x31,0x35,0x31,0x0e, 0xf9,0x26,0x44,0x41,0xd7,0x1d,0x48,0x20,0x44,0x85,0x90,0xe0,0xfc,0x0d,0xfc,0xd1, 0xa6,0x17,0x8a,0xd2,0xa4,0x4e,0xfc,0x56,0xeb,0xcc,0x24,0x57,0x6b,0x6f,0x30,0x26, 0xdd,0x3c,0x43,0xbf,0x01,0x5b,0x04,0x97,0xa2,0xf2,0x08,0xfc,0x84,0x78,0x03,0x09, 0xd4,0x95,0xfc,0x33,0xcd,0xe6,0x61,0x80,0x3c,0xbb,0x36,0x4a,0x17,0x6b,0x3b,0x36, 0x54,0xb7,0x20,0x98,0x3c,0x84,0xc3,0x4e,0xa9,0x06,0xe1,0x6d,0xce,0x37,0x80,0xa3, 0x24,0x78,0x23,0xc4,0x1a,0x23,0xc2,0xc5,0x0d,0xcd,0x13,0x03,0x23,0xa5,0x86,0x3a, 0x7b,0x51,0x96,0xb2,0x49,0x9c,0xe2,0xa7,0xb5,0xbb,0x2d,0x86,0x5e,0x17,0x31,0x48, 0xcf,0x79,0x45,0x50,0x18,0x06,0xd8,0xe3,0x7c,0x85,0xc2,0xf2,0x36,0x41,0x1b,0xf9, 0x27,0x3d,0xa6,0xc6,0x39,0x09,0xce,0x52,0x35,0xd5,0xfd,0x9b,0xb5,0x3d,0x1c,0xc7, 0xe4,0x50,0x22,0x0c,0x98,0x63,0x84,0x62,0x50,0x34,0xe7,0x61,0x01,0x4d,0xf0,0xd6, 0x7f,0xaf,0x99,0xed,0xa4,0x7a,0x48,0x6d,0x27,0xe3,0x2f,0xb4,0x00,0x6b,0xcf,0x60, 0xed,0x9f,0xcd,0xb5,0xc6,0x80,0x5e,0x34,0x21,0x8a,0x73,0xa1,0xd6,0x05,0x18,0xe8, 0x05,0xd4,0x6f,0xb4,0xba,0x6e,0x51,0x80,0x69,0xeb,0xc4,0x4d,0x1a,0xd5,0xba,0xc6, 0xa1,0x34,0x05,0x6b,0x8f,0x37,0xd6,0x3e,0x00,0x6b,0x10,0x11,0x22,0x14,0x70,0x59, 0x15,0x72,0x15,0xf2,0x45,0xe3,0x61,0x18,0x2e,0x3b,0xb4,0xcc,0x76,0x40,0xc2,0xd6, 0xf7,0x4b,0xa1,0x8e,0x11,0xf5,0x19,0x20,0x7b,0x37,0x5e,0xbb,0x00,0xc1,0xb8,0x11, 0x21,0x70,0x91,0x0b,0xe2,0x21,0xa0,0xb0,0x92,0xd7,0x2f,0xce,0x09,0x4d,0x7c,0x97, 0x8d,0xe3,0x48,0x0d,0xdb,0x33,0xa5,0xab,0x45,0xde,0x0f,0xd6,0x8c,0x17,0xc2,0x24, 0x39,0x68,0x78,0x77,0xd8,0xea,0xc5,0xa3,0xbf,0x76,0x48,0x29,0xeb,0x33,0x27,0x81, 0x27,0x05,0xa0,0x4f,0xa5,0xbe,0xbc,0x1e,0xde,0xcf,0xa6,0x13,0x46,0xde,0x46,0x74, 0x83,0x06,0x81,0x01,0xb9,0x56,0x6f,0x1f,0xd4,0xc6,0x9f,0xc6,0xa3,0x4b,0x61,0xd3, 0x36,0x72,0xa2,0x05,0x3c,0x58,0xfb,0xe3,0x68,0xdb,0x12,0xbc,0x06,0x09,0xb5,0xfe, 0xc1,0xeb,0x38,0xfe,0xd8,0xfe,0xe8,0x32,0x68,0x1b,0xda,0x2b,0x69,0x1b,0x96,0x95, 0x43,0x7f,0x02,0x61,0xa4,0xfe,0x3c,0x18,0xa7,0x38,0xee,0x14,0x14,0xa6,0xdf,0x65, 0x2e,0x6a,0x6a,0xa7,0x67,0x66,0x4c,0x23,0x2b,0x6a,0xdc,0xa8,0x54,0xc3,0xb4,0x08, 0xf3,0xd5,0x5c,0x9c,0xac,0x59,0xff,0x34,0xe6,0x42,0x5b,0xbf,0xe8,0xce,0x7c,0x37, 0x2a,0xea,0x61,0xe7,0x9b,0x94,0xef,0xdd,0x08,0x9a,0x0f,0x7c,0x3d,0x7d,0x46,0x7f, 0x5d,0xe3,0xf0,0xab,0xec,0x28,0xb3,0xce,0xe7,0xda,0x37,0xa6,0x1e,0x80,0x2f,0x6a, 0x0c,0x8d,0xf6,0x4a,0x82,0xb2,0xf7,0x9e,0x2b,0x09,0x8d,0xfc,0xa9,0x48,0x7d,0x77, 0xb7,0x58,0x11,0x84,0x77,0x53,0x18,0x2a,0x42,0xdc,0x3b,0x93,0x5f,0xa9,0x89,0x6a, 0x18,0xa2,0xd4,0x66,0x60,0xa7,0x61,0x9e,0xdb,0x65,0x77,0x50,0xee,0xde,0x43,0x21, 0xf3,0x6d,0x0a,0x07,0x71,0xc3,0xec,0x08,0xe2,0x96,0xa8,0xa5,0x92,0x7b,0x0f,0xf6, 0xfe,0xd5,0x3a,0x67,0x2e,0xad,0x00,0x7b,0xe7,0x98,0xf2,0x47,0x02,0x6b,0x1e,0xbf, 0x0d,0x3f,0x5e,0xe6,0x55,0x4d,0x29,0x3d,0xcf,0x3d,0x5d,0x28,0xd7,0x53,0xe2,0xa4, 0x42,0xde,0x57,0xf7,0xd1,0xb7,0x13,0xc8,0x90,0xd1,0x8c,0x1d,0xfb,0x79,0x4e,0xec, 0x8c,0xef,0xd9,0xcc,0x98,0x96,0x77,0x25,0x68,0x29,0x4d,0xa8,0xcb,0x7a,0xf8,0xaf, 0xe7,0x63,0xa3,0x87,0xda,0xb8,0x49,0x54,0x00,0x7d,0x83,0xba,0x83,0xf9,0x3e,0xb1, 0xd3,0x7e,0xea,0x8f,0x69,0x75,0x74,0x4c,0xe4,0xfb,0x7e,0xd4,0x0c,0xd4,0x01,0xf4, 0x60,0xbc,0xf1,0xfb,0xda,0xad,0xcc,0x36,0x0e,0x1b,0x5b,0x70,0x8a,0x2c,0xc0,0xb0, 0xc6,0x31,0xb4,0x52,0xa7,0xa4,0x10,0x37,0x03,0xf5,0xf7,0xf8,0x53,0x63,0x67,0x8a, 0x65,0x4a,0x29,0x7d,0xdc,0xb1,0x32,0x33,0x4b,0xe3,0x81,0xe7,0xc5,0x57,0x5d,0xf3, 0xb5,0xf1,0x4c,0x54,0x66,0xae,0xd2,0xdd,0xa9,0x3b,0x35,0x22,0xa3,0x2f,0x79,0x2e, 0x96,0x9e,0x1e,0xee,0xbd,0x8e,0xd4,0x60,0x76,0x9f,0xee,0xd4,0x89,0xd6,0x11,0x4d, 0x5c,0xb6,0xd8,0x6e,0x78,0xe4,0x2a,0xd3,0x47,0x26,0xca,0x5f,0x52,0x91,0xd0,0x34, 0x4d,0x32,0x55,0xc1,0x59,0xfa,0xe0,0x6d,0x2e,0x81,0xb2,0xf3,0xbc,0xf4,0xfd,0xcb, 0xb4,0xaa,0x3e,0xcd,0xab,0x6f,0xd7,0xde,0xf5,0xf7,0x79,0x9e,0xd8,0xd1,0x12,0xae, 0xd4,0xe3,0xd7,0xd9,0x57,0xd0,0x9f,0x45,0x7e,0xd1,0x5c,0x26,0xe2,0x33,0xf7,0xe9, 0xc4,0x38,0x0e,0x83,0x83,0xf8,0xfe,0x9e,0xfb,0xc0,0x22,0x35,0x99,0xc8,0x2f,0x47, 0xf9,0x73,0xd7,0xf9,0x63,0x36,0x0d,0x62,0x39,0x8a,0x9e,0xbd,0xcb,0x2f,0x13,0x51, 0x3d,0x72,0x89,0xfc,0x32,0xc3,0x68,0xfd,0x4f,0xd7,0x3f,0x59,0x62,0x93,0xb2,0x0d, 0xd8,0xee,0x13,0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82 }; /* canvas pattern (PNG: 20x20) */ const unsigned char g_canvas[] = { 0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52, 0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x14,0x01,0x03,0x00,0x00,0x00,0xb7,0x47,0x8f, 0x4e,0x00,0x00,0x00,0x06,0x50,0x4c,0x54,0x45,0xec,0xeb,0xd8,0xf6,0xf6,0xf0,0x36, 0x17,0xbe,0xcb,0x00,0x00,0x00,0x09,0x70,0x48,0x59,0x73,0x00,0x00,0x0b,0x13,0x00, 0x00,0x0b,0x13,0x01,0x00,0x9a,0x9c,0x18,0x00,0x00,0x00,0x13,0x49,0x44,0x41,0x54, 0x08,0xd7,0x63,0xf8,0xff,0xff,0x03,0x03,0xb1,0x18,0x04,0x08,0xa8,0x01,0x00,0xc6, 0x09,0x37,0xab,0x77,0x8c,0x91,0xda,0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae, 0x42,0x60,0x82 }; /* END OF FILE */ hyperestraier-1.4.13/mymorph.c000066400000000000000000000332361125261632700163410ustar00rootroot00000000000000/************************************************************************************************* * Morphological analyzers for Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #include "mymorph.h" #include "estraier.h" #include "myconf.h" #if defined(_MYMECAB) #include #endif #define ESTNUMBUFSIZ 32 /* size of a buffer for a number */ #define ESTSCOREUNIT 100 /* unit of score of each word */ #define ESTWORDMAXLEN 48 /* maximum length of a word */ typedef struct { /* type of structure for a hitting object */ const char *word; /* face of keyword */ int pt; /* score tuned by TF-IDF */ } ESTKEYSC; /* private function prototypes */ static void est_uwords_add(CBMAP *uwords, const char *word, int wsiz, int pt); static int est_keysc_compare(const void *ap, const void *bp); static int est_mecab_analyze(const char *text, CBMAP *uwords); /************************************************************************************************* * pseudo API *************************************************************************************************/ /* Extract keywords of a document object using morphological analyzers. */ CBMAP *est_morph_etch_doc(ESTDOC *doc, int max){ ESTKEYSC *scores; CBMAP *kwords, *uwords; const CBLIST *texts; CBLIST *words; const char *text, *word; const unsigned char *uword; char numbuf[ESTNUMBUFSIZ]; char *enc; int i, j, all, miss, wsiz, pt, snum; double dval; assert(doc && max >= 0); kwords = cbmapopenex(max * 2 + 1); uwords = cbmapopen(); all = 0; texts = est_doc_texts(doc); for(i = -1; i < cblistnum(texts); i++){ text = i < 0 ? est_doc_hidden_texts(doc) : cblistval(texts, i, NULL); if(text[0] == '\0') continue; if(ESTUSEMECAB && (enc = est_iconv(text, -1, "UTF-8", "EUC-JP", NULL, &miss)) != NULL){ if(miss > 0){ free(enc); } else { all += est_mecab_analyze(enc, uwords); free(enc); continue; } } words = cblistopen(); est_break_text_chrcat(text, words, FALSE); for(j = 0; j < cblistnum(words); j++){ uword = (unsigned char *)cblistval(words, j, &wsiz); if(uword[0] >= 0xe3){ if(wsiz <= 3){ pt = ESTSCOREUNIT / 4; if((uword[0] == 0xe3 && (uword[1] == 0x80 || uword[1] == 0x81 || (uword[1] == 0x82 && uword[2] <= 0x9f))) || (uword[0] == 0xef && uword[1] >= 0xbc)) pt /= 10; } else { pt = ESTSCOREUNIT; if((uword[0] == 0xe3 && (uword[1] == 0x80 || uword[1] == 0x81 || (uword[1] == 0x82 && uword[2] <= 0x9f))) || (uword[0] == 0xef && uword[1] >= 0xbc)) pt /= 2; if((uword[3] == 0xe3 && (uword[4] == 0x80 || uword[4] == 0x81 || (uword[4] == 0x82 && uword[5] <= 0x9f))) || (uword[3] == 0xef && uword[4] >= 0xbc)) pt /= 2; } } else if((uword[0] > '\0' && uword[0] <= '/') || (uword[0] >= '[' && uword[0] <= '`') || (uword[0] >= '{' && uword[0] <= '~')){ pt = ESTSCOREUNIT / 50; } else { switch(wsiz){ case 1: pt = ESTSCOREUNIT / 9; break; case 2: pt = ESTSCOREUNIT / 5; break; case 3: pt = ESTSCOREUNIT / 3; break; case 4: pt = ESTSCOREUNIT / 2; break; case 5: pt = ESTSCOREUNIT / 1.5; break; case 6: pt = ESTSCOREUNIT / 1.25; break; default: pt = ESTSCOREUNIT; break; } } est_uwords_add(uwords, (char *)uword, wsiz, pt); all += pt; } cblistclose(words); } scores = cbmalloc(cbmaprnum(uwords) * sizeof(ESTKEYSC) + 1); snum = 0; cbmapiterinit(uwords); while((word = cbmapiternext(uwords, &wsiz)) != NULL){ scores[snum].word = word; scores[snum].pt = *(int *)cbmapget(uwords, word, wsiz, NULL); snum++; } qsort(scores, snum, sizeof(ESTKEYSC), est_keysc_compare); dval = log(all + ESTSCOREUNIT * 64); dval *= dval; dval /= 10; for(i = 0; i < snum && i < max; i++){ pt = (int)(scores[i].pt / dval); wsiz = sprintf(numbuf, "%d", pt > 1 ? pt : 1); cbmapput(kwords, scores[i].word, -1, numbuf, wsiz, FALSE); } free(scores); cbmapclose(uwords); return kwords; } /************************************************************************************************* * private objects *************************************************************************************************/ /* Add a record to a unique word map. `uwords' specifies a unique word map. `word' specifies a word. `wsiz' specifies size of the word. `pt' specifies point of the word. */ static void est_uwords_add(CBMAP *uwords, const char *word, int wsiz, int pt){ const char *vbuf; int num; assert(uwords && word && wsiz >= 0); if(wsiz > ESTWORDMAXLEN) return; num = (vbuf = cbmapget(uwords, word, wsiz, NULL)) ? *(int *)vbuf + pt : pt; if(num < 0) num = 0; cbmapput(uwords, word, wsiz, (char *)&num, sizeof(int), TRUE); } /* Compare two keywords by scores in descending order. `ap' specifies the pointer to one keyword. `bp' specifies the pointer to the other keyword. The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int est_keysc_compare(const void *ap, const void *bp){ assert(ap && bp); return ((ESTKEYSC *)bp)->pt - ((ESTKEYSC *)ap)->pt; } /* Analyze text with using mecab. `text' specifies a sentence whose encoding is EUC-JP. `uwords' specifies a unique word map. The return value is the total points of extracted words. */ static int est_mecab_analyze(const char *text, CBMAP *uwords){ #if defined(_MYMECAB) static mecab_t *mecab = NULL; static CBMAP *swmap = NULL; static char *args[] = { "mecab", "--node-format=%m\\t%f[0]\\t%f[1]\\n", "--unk-format=%m\\t\\t\\n", "--eos-format=", NULL }; static char *stops[] = { "a", "an", "the", "there", "any", "no", "each", "all", "most", "more", "i", "my", "me", "mine", "you", "your", "yours", "we", "our", "us", "ours", "he", "his", "him", "she", "her", "hers", "it", "its", "they", "their", "them", "theirs", "this", "these", "that", "those", "what", "who", "which", "where", "when", "why", "whose", "how", "or", "and", "but", "not", "as", "if", "so", "because", "as", "unless", "until", "while", "to", "on", "of", "in", "for", "from", "by", "with", "at", "against", "via", "under", "over", "be", "am", "are", "is", "was", "were", "being", "wanna", "gonna", "gotta", "going", "do", "does", "did", "have", "has", "had", "get", "got", "go", "went", "come", "came", "will", "would", "ll", "ve", "can", "could", "may", "might", "shall", "should", "must", NULL }; CBDATUM *prefix; const char *cres; unsigned char *uword; char *res, *pv, *ep, *word, *sign, *info; int i, all, ppt, pnum, wsiz, pt; assert(text && uwords); if(!mecab){ if(!(mecab = mecab_new(sizeof(args) / sizeof(char *) - 1, args))) return 0; /* for (maybe) mecab's bug cbglobalgc(mecab, (void (*)(void *))mecab_destroy); */ swmap = cbmapopenex(sizeof(stops) / sizeof(char *) * 2 + 1); cbglobalgc(swmap, (void (*)(void *))cbmapclose); for(i = 0; stops[i]; i++){ cbmapput(swmap, stops[i], -1, "", 0, FALSE); } } if(!(cres = mecab_sparse_tostr(mecab, (char *)text))) return 0; if(!(res = est_iconv(cres, -1, "EUC-JP", "UTF-8", NULL, NULL))) return 0; all = 0; pv = res; ep = pv; prefix = cbdatumopen(NULL, -1); pnum = 0; ppt = 0; while(ep){ if((ep = strchr(pv, '\n')) != NULL) *ep = '\0'; word = pv; if((sign = strchr(pv, '\t')) != NULL){ *(sign++) = '\0'; pv = sign; } else { sign = ""; } if((info = strchr(pv, '\t')) != NULL){ *(info++) = '\0'; pv = info; } else { info = ""; } for(pv = word; *pv != '\0'; pv++){ if(*pv >= 'A' && *pv <= 'Z') *pv += 'a' - 'A'; } wsiz = pv - word; if(wsiz > 0){ uword = (unsigned char *)word; if(!strcmp(sign, "險伜捷")){ pt = ESTSCOREUNIT / 100; } else if(!strcmp(sign, "蜉ゥ隧") || !strcmp(sign, "蜉ゥ蜍戊ゥ") || !strcmp(sign, "謗・鬆ュ隧") || !strcmp(sign, "謗・邯夊ゥ") || !strcmp(sign, "繝輔ぅ繝ゥ繝シ") || !strcmp(sign, "縺昴ョ莉")){ pt = ESTSCOREUNIT / 50; } else if(!strcmp(sign, "蜷崎ゥ") || !strcmp(sign, "蜍戊ゥ")){ pt = ESTSCOREUNIT; if(!strcmp(info, "髱櫁ェ遶") || !strcmp(info, "迚ケ谿") || !strcmp(info, "蠑慕畑譁蟄怜") || !strcmp(info, "謨ー") || !strcmp(info, "謗・邯夊ゥ樒噪") || !strcmp(info, "謗・蟆セ") || !strcmp(info, "莉」蜷崎ゥ") || !strcmp(info, "蜍戊ゥ樣撼閾ェ遶狗噪")){ pt /= 2; } if(wsiz <= 3){ pt /= 5; if(uword[0] == 0xe3 && (uword[1] == 0x80 || uword[1] == 0x81 || (uword[1] == 0x82 && uword[2] <= 0x9f))) pt /= 5; } else { if(uword[0] == 0xe3 && (uword[1] == 0x80 || uword[1] == 0x81 || (uword[1] == 0x82 && uword[2] <= 0x9f))) pt /= 5; if(uword[3] == 0xe3 && (uword[4] == 0x80 || uword[4] == 0x81 || (uword[4] == 0x82 && uword[5] <= 0x9f))) pt /= 2.5; if(wsiz <= 6) pt /= 1.5; } } else if(!strcmp(sign, "蠖「螳ケ隧") || !strcmp(sign, "蜑ッ隧") || !strcmp(sign, "騾」菴楢ゥ") || !strcmp(sign, "諢溷虚隧")){ pt = ESTSCOREUNIT / 2; if(wsiz <= 3){ pt /= 5; if(uword[0] == 0xe3 && (uword[1] == 0x80 || uword[1] == 0x81 || (uword[1] == 0x82 && uword[2] <= 0x9f))) pt /= 5; } else { if(uword[0] == 0xe3 && (uword[1] == 0x80 || uword[1] == 0x81 || (uword[1] == 0x82 && uword[2] <= 0x9f))) pt /= 5; if(uword[3] == 0xe3 && (uword[4] == 0x80 || uword[4] == 0x81 || (uword[4] == 0x82 && uword[5] <= 0x9f))) pt /= 2.5; if(wsiz <= 6) pt /= 1.5; } } else if((word[0] > '\0' && word[0] <= '/') || (word[0] >= ':' && word[0] <= '@') || (word[0] >= '[' && word[0] <= '`') || (word[0] >= '{' && word[0] <= '~')){ pt = ESTSCOREUNIT / 50; if(wsiz <= 1) pt /= 2; } else if(cbmapget(swmap, word, wsiz, NULL)){ pt = ESTSCOREUNIT / 25; if(wsiz <= 1) pt /= 2; } else { switch(wsiz){ case 1: pt = ESTSCOREUNIT / 9; break; case 2: pt = ESTSCOREUNIT / 5; break; case 3: pt = ESTSCOREUNIT / 3; break; case 4: pt = ESTSCOREUNIT / 2; break; case 5: pt = ESTSCOREUNIT / 1.5; break; case 6: pt = ESTSCOREUNIT / 1.25; break; default: pt = ESTSCOREUNIT; break; } } est_uwords_add(uwords, (char *)uword, wsiz, pt); all += pt; if(!strcmp(sign, "蜷崎ゥ")){ ppt += pt; pnum++; if(cbdatumsize(prefix) > 0){ est_uwords_add(uwords, cbdatumptr(prefix), cbdatumsize(prefix), (double)ppt / pnum * -0.15 - 1); est_uwords_add(uwords, (char *)uword, wsiz, pt * -0.15 - 1); cbdatumcat(prefix, word, wsiz); est_uwords_add(uwords, cbdatumptr(prefix), cbdatumsize(prefix), ((double)ppt / pnum) * 0.9); all += (ppt / pnum) * 0.8; } else { cbdatumcat(prefix, word, wsiz); } } else if(!strcmp(sign, "") && (cbdatumsize(prefix) < 1 || uword[0] >= 0xc0)){ ppt += pt * 0.8; pnum++; if(cbdatumsize(prefix) > 0){ est_uwords_add(uwords, cbdatumptr(prefix), cbdatumsize(prefix), (double)ppt / pnum * -0.15 - 1); est_uwords_add(uwords, (char *)uword, wsiz, pt * -0.15 - 1); cbdatumcat(prefix, word, wsiz); est_uwords_add(uwords, cbdatumptr(prefix), cbdatumsize(prefix), ((double)ppt / pnum) * 0.9); all += (ppt / pnum) * 0.8; } else if(wsiz > 1 || uword[0] >= 0x80 || (word[0] >= '0' && word[0] <= '9') || (word[0] >= 'A' && word[0] <= 'Z') || (word[0] >= 'a' && word[0] <= 'z')){ cbdatumcat(prefix, word, wsiz); } else { ppt = 0; pnum = 0; } } else { cbdatumsetsize(prefix, 0); pnum = 0; ppt = 0; } } else { cbdatumsetsize(prefix, 0); pnum = 0; ppt = 0; } pv = ep + 1; } cbdatumclose(prefix); free(res); return all; #else return 0; #endif } /* END OF FILE */ hyperestraier-1.4.13/mymorph.h000066400000000000000000000037101125261632700163400ustar00rootroot00000000000000/************************************************************************************************* * Morphological analyzers for Hyper Estraier * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #ifndef _MYMORPH_H /* duplication check */ #define _MYMORPH_H #include #include /************************************************************************************************* * pseudo API *************************************************************************************************/ /* Extract keywords of a document object using morphological analyzers. `doc' specifies a document object. `max' specifies the maximum number of keywords to be extracted. The return value is a new map object of keywords and their scores in decimal string. Because the object of the return value is opened with the function `cbmapopen', it should be closed with the function `cbmapclose' if it is no longer in use. */ CBMAP *est_morph_etch_doc(ESTDOC *doc, int max); #endif /* duplication check */ hyperestraier-1.4.13/perlnative/000077500000000000000000000000001125261632700166445ustar00rootroot00000000000000hyperestraier-1.4.13/perlnative/Makefile.in000066400000000000000000000073521125261632700207200ustar00rootroot00000000000000# Makefile for the Perl binding of Hyper Estraier #================================================================ # Setting Variables #================================================================ # Generic settings SHELL = @SHELL@ # Packaging PACKAGE = @PACKAGE_NAME@ VERSION = @PACKAGE_VERSION@ # Targets MYPLBINS = estcmd.pl # Install destinations prefix = @prefix@ exec_prefix = @exec_prefix@ MYHEADDIR = @includedir@ MYLIBDIR = @libdir@ MYPLLIBDIR = @MYPLLIBDIR@ MYPLBINDIR = @bindir@ DESTDIR = # Building binaries PERL = @PERL@ POD2HTML = @POD2HTML@ CC = gcc INC = -I. -I../.. -I$(MYHEADDIR) -I$(HOME)/include -I/usr/local/include OPTIMIZE = @MYOPTIMIZE@ LD = gcc LIBS = -L../.. -L$(MYLIBDIR) -L$(HOME)/lib -L/usr/local/lib @LIBS@ RUNENV = LD_LIBRARY_PATH=.:..:/lib:/usr/lib:$(MYLIBDIR):$(HOME)/lib:/usr/local/lib:@MYRUNPATH@ #================================================================ # Actions #================================================================ all : ( cd src && if ! [ -f Makefile ] ; \ then $(RUNENV) $(PERL) Makefile.PL CC="$(CC)" INC="$(INC)" OPTIMIZE="$(OPTIMIZE)" \ LD="$(LD)" LIBS="$(LIBS)" PREFIX="$(prefix)" ; fi ) ( cd src && make ) @printf '\n' @printf '#================================================================\n' @printf '# Ready to install.\n' @printf '#================================================================\n' clean : ( cd src && if [ -f Makefile ] ; then make -i clean ; fi ) cd src && rm -rf Makefile blib pm_to_blib *.c *.o *.bs *.old casket *~ rm -rf check.out casket *~ install : cd src && $(RUNENV) make install mkdir -p $(DESTDIR)$(MYPLBINDIR) cp -Rf $(MYPLBINS) $(DESTDIR)$(MYPLBINDIR) @printf '\n' @printf '#================================================================\n' @printf '# Thanks for using Hyper Estraier for Perl.\n' @printf '#================================================================\n' uninstall : find $(DESTDIR)$(MYPLLIBDIR) -print | egrep 'Estraier(\.pm|\.so|\.bs|\.pod)?$$' | \ egrep -v '/Search/Estraier' | xargs rm -rf rm -f /usr/share/man/man3/Estraier.3pm /usr/local/share/man/man3/Estraier.3pm cd $(DESTDIR)$(MYPLBINDIR) && rm -f $(MYPLBINS) dist : autoconf make doc make distclean distclean : clean ( cd src && if [ -f Makefile ] ; then make distclean ; fi ) ( cd src && rm -rf Makefile blib pm_to_blib *.c *.o *.bs *.old casket *~ ) cd example && make clean rm -rf Makefile config.cache config.log config.status autom4te.cache check : rm -rf casket $(RUNENV) $(PERL) -I./src -w estcmd.pl put casket ../misc/test001.est $(RUNENV) $(PERL) -I./src -w estcmd.pl put casket ../misc/test002.est $(RUNENV) $(PERL) -I./src -w estcmd.pl put casket ../misc/test003.est $(RUNENV) $(PERL) -I./src -w estcmd.pl put casket ../misc/test004.est $(RUNENV) $(PERL) -I./src -w estcmd.pl put casket ../misc/test005.est $(RUNENV) $(PERL) -I./src -w estcmd.pl put casket ../misc/test006.est $(RUNENV) $(PERL) -I./src -w estcmd.pl edit casket 1 "@title" "java" $(RUNENV) $(PERL) -I./src -w estcmd.pl get casket 1 $(RUNENV) $(PERL) -I./src -w estcmd.pl get casket 1 "@title" $(RUNENV) $(PERL) -I./src -w estcmd.pl out casket 1 $(RUNENV) $(PERL) -I./src -w estcmd.pl inform casket $(RUNENV) $(PERL) -I./src -w estcmd.pl optimize casket $(RUNENV) $(PERL) -I./src -w estcmd.pl search \ -vf -cd casket "estraier" > check.out $(RUNENV) $(PERL) -I./src -w estcmd.pl search \ -vs -gs -attr "@uri" -ord "@mdate NUMD" -max 1 casket "estraier OR mikio" > check.out rm -rf casket doc : make docclean mkdir -p ../doc/perlnativeapi $(POD2HTML) --infile=src/Estraier.pod --outfile=../doc/perlnativeapi/index.html \ --title="estraier" ; rm -f pod2*.tmp docclean : rm -rf ../doc/perlnativeapi .PHONY : all clean install casket check # END OF FILE hyperestraier-1.4.13/perlnative/configure000077500000000000000000003252421125261632700205630ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for hyperestraier-perlnative 1.0.0. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='hyperestraier-perlnative' PACKAGE_TARNAME='hyperestraier-perlnative' PACKAGE_VERSION='1.0.0' PACKAGE_STRING='hyperestraier-perlnative 1.0.0' PACKAGE_BUGREPORT='' ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT PERL POD2HTML MYOPTIMIZE MYPLLIBDIR MYRUNPATH LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures hyperestraier-perlnative 1.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of hyperestraier-perlnative 1.0.0:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-stable build for stable release Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF hyperestraier-perlnative configure 1.0.0 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by hyperestraier-perlnative $as_me 1.0.0, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Export variables PERL="perl" POD2HTML="pod2html" MYOPTIMIZE="-O3 -fomit-frame-pointer -fforce-addr" MYPLLIBDIR=/usr/lib/perl5/site_perl MYRUNPATH="" # Building paths pathtmp="$PATH" PATH="..:$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin" PATH="$PATH:/usr/ccs/bin:/usr/ucb:/usr/xpg4/bin:/usr/xpg6/bin:$pathtmp" LIBRARY_PATH="..:$HOME/lib:/usr/local/lib:$LIBRARY_PATH" LD_LIBRARY_PATH="..:$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH" CPATH="..:$HOME/include:/usr/local/include:$CPATH" PKG_CONFIG_PATH="..:$HOME/lib/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH if type pkg-config > /dev/null 2>&1 then PATH="$PATH:`pkg-config --variable=bindir qdbm`" PATH="$PATH:`pkg-config --variable=bindir hyperestraier`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir hyperestraier`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir hyperestraier`" CPATH="$CPATH:`pkg-config --variable=includedir qdbm`" CPATH="$CPATH:`pkg-config --variable=includedir hyperestraier`" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH fi # Setting the default prefix if test "$prefix" = NONE then prefix=`perl -mConfig -e 'print $Config::Config{prefix}'` fi #================================================================ # Options #================================================================ # Stable mode # Check whether --enable-stable or --disable-stable was given. if test "${enable_stable+set}" = set; then enableval="$enable_stable" fi; if test "$enable_stable" = "yes" then MYOPTIMIZE="-O2" stable="yes" fi #================================================================ # Checking Commands and Libraries #================================================================ # Perl interpreter printf 'checking PERL... ' if which perl > /dev/null then PERL=`which perl` fi printf '%s\n' "$PERL" # Other building tools printf 'checking POD2HTML... ' if which pod2html > /dev/null then POD2HTML=`which pod2html` fi printf '%s\n' "$POD2HTML" # Librarh path mypllibdir=`perl -mConfig -e 'print $Config::Config{sitelib}'` if test -n "$mypllibdir" then MYPLLIBDIR="$mypllibdir" fi # Underlying libraries ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for main in -lc" >&5 echo $ECHO_N "checking for main in -lc... $ECHO_C" >&6 if test "${ac_cv_lib_c_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_c_main" >&5 echo "${ECHO_T}$ac_cv_lib_c_main" >&6 if test $ac_cv_lib_c_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBC 1 _ACEOF LIBS="-lc $LIBS" fi echo "$as_me:$LINENO: checking for main in -lm" >&5 echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6 if test "${ac_cv_lib_m_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_m_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5 echo "${ECHO_T}$ac_cv_lib_m_main" >&6 if test $ac_cv_lib_m_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi echo "$as_me:$LINENO: checking for main in -liconv" >&5 echo $ECHO_N "checking for main in -liconv... $ECHO_C" >&6 if test "${ac_cv_lib_iconv_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liconv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_iconv_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_iconv_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_main" >&5 echo "${ECHO_T}$ac_cv_lib_iconv_main" >&6 if test $ac_cv_lib_iconv_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBICONV 1 _ACEOF LIBS="-liconv $LIBS" fi echo "$as_me:$LINENO: checking for main in -lz" >&5 echo $ECHO_N "checking for main in -lz... $ECHO_C" >&6 if test "${ac_cv_lib_z_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_z_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_z_main" >&5 echo "${ECHO_T}$ac_cv_lib_z_main" >&6 if test $ac_cv_lib_z_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF LIBS="-lz $LIBS" fi echo "$as_me:$LINENO: checking for main in -llzo2" >&5 echo $ECHO_N "checking for main in -llzo2... $ECHO_C" >&6 if test "${ac_cv_lib_lzo2_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llzo2 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_lzo2_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_lzo2_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2_main" >&5 echo "${ECHO_T}$ac_cv_lib_lzo2_main" >&6 if test $ac_cv_lib_lzo2_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBLZO2 1 _ACEOF LIBS="-llzo2 $LIBS" fi echo "$as_me:$LINENO: checking for main in -lbz2" >&5 echo $ECHO_N "checking for main in -lbz2... $ECHO_C" >&6 if test "${ac_cv_lib_bz2_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbz2 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bz2_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bz2_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_bz2_main" >&5 echo "${ECHO_T}$ac_cv_lib_bz2_main" >&6 if test $ac_cv_lib_bz2_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBBZ2 1 _ACEOF LIBS="-lbz2 $LIBS" fi echo "$as_me:$LINENO: checking for main in -lqdbm" >&5 echo $ECHO_N "checking for main in -lqdbm... $ECHO_C" >&6 if test "${ac_cv_lib_qdbm_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lqdbm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_qdbm_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_qdbm_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_qdbm_main" >&5 echo "${ECHO_T}$ac_cv_lib_qdbm_main" >&6 if test $ac_cv_lib_qdbm_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBQDBM 1 _ACEOF LIBS="-lqdbm $LIBS" fi echo "$as_me:$LINENO: checking for main in -lestraier" >&5 echo $ECHO_N "checking for main in -lestraier... $ECHO_C" >&6 if test "${ac_cv_lib_estraier_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lestraier $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_estraier_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_estraier_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_estraier_main" >&5 echo "${ECHO_T}$ac_cv_lib_estraier_main" >&6 if test $ac_cv_lib_estraier_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBESTRAIER 1 _ACEOF LIBS="-lestraier $LIBS" fi # Checking the version of QDBM with pkg-config if type pkg-config > /dev/null 2>&1 && pkg-config --atleast-version=1.0.0 qdbm then MYRUNPATH="$MYRUNPATH:`pkg-config --variable=libdir qdbm`" fi #================================================================ # Generic Settings #================================================================ # Export variables # Targets ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by hyperestraier-perlnative $as_me 1.0.0, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ hyperestraier-perlnative config.status 1.0.0 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@PERL@,$PERL,;t t s,@POD2HTML@,$POD2HTML,;t t s,@MYOPTIMIZE@,$MYOPTIMIZE,;t t s,@MYPLLIBDIR@,$MYPLLIBDIR,;t t s,@MYRUNPATH@,$MYRUNPATH,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi # END OF FILE hyperestraier-1.4.13/perlnative/configure.in000066400000000000000000000064011125261632700211560ustar00rootroot00000000000000# Source of configuration for the Perl binding of Hyper Estraier #================================================================ # Generic Settings #================================================================ # Targets AC_INIT(hyperestraier-perlnative, 1.0.0) # Export variables PERL="perl" POD2HTML="pod2html" MYOPTIMIZE="-O3 -fomit-frame-pointer -fforce-addr" MYPLLIBDIR=/usr/lib/perl5/site_perl MYRUNPATH="" # Building paths pathtmp="$PATH" PATH="..:$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin" PATH="$PATH:/usr/ccs/bin:/usr/ucb:/usr/xpg4/bin:/usr/xpg6/bin:$pathtmp" LIBRARY_PATH="..:$HOME/lib:/usr/local/lib:$LIBRARY_PATH" LD_LIBRARY_PATH="..:$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH" CPATH="..:$HOME/include:/usr/local/include:$CPATH" PKG_CONFIG_PATH="..:$HOME/lib/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH if type pkg-config > /dev/null 2>&1 then PATH="$PATH:`pkg-config --variable=bindir qdbm`" PATH="$PATH:`pkg-config --variable=bindir hyperestraier`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir hyperestraier`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir hyperestraier`" CPATH="$CPATH:`pkg-config --variable=includedir qdbm`" CPATH="$CPATH:`pkg-config --variable=includedir hyperestraier`" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH fi # Setting the default prefix if test "$prefix" = NONE then prefix=`perl -mConfig -e 'print $Config::Config{prefix}'` fi #================================================================ # Options #================================================================ # Stable mode AC_ARG_ENABLE(stable, AC_HELP_STRING([--enable-stable], [build for stable release])) if test "$enable_stable" = "yes" then MYOPTIMIZE="-O2" stable="yes" fi #================================================================ # Checking Commands and Libraries #================================================================ # Perl interpreter printf 'checking PERL... ' if which perl > /dev/null then PERL=`which perl` fi printf '%s\n' "$PERL" # Other building tools printf 'checking POD2HTML... ' if which pod2html > /dev/null then POD2HTML=`which pod2html` fi printf '%s\n' "$POD2HTML" # Librarh path mypllibdir=`perl -mConfig -e 'print $Config::Config{sitelib}'` if test -n "$mypllibdir" then MYPLLIBDIR="$mypllibdir" fi # Underlying libraries AC_CHECK_LIB(c, main) AC_CHECK_LIB(m, main) AC_CHECK_LIB(iconv, main) AC_CHECK_LIB(z, main) AC_CHECK_LIB(lzo2, main) AC_CHECK_LIB(bz2, main) AC_CHECK_LIB(qdbm, main) AC_CHECK_LIB(estraier, main) # Checking the version of QDBM with pkg-config if type pkg-config > /dev/null 2>&1 && pkg-config --atleast-version=1.0.0 qdbm then MYRUNPATH="$MYRUNPATH:`pkg-config --variable=libdir qdbm`" fi #================================================================ # Generic Settings #================================================================ # Export variables AC_SUBST(PERL) AC_SUBST(POD2HTML) AC_SUBST(MYOPTIMIZE) AC_SUBST(MYPLLIBDIR) AC_SUBST(MYRUNPATH) # Targets AC_OUTPUT(Makefile) # END OF FILE hyperestraier-1.4.13/perlnative/estcmd.pl000077500000000000000000000502701125261632700204670ustar00rootroot00000000000000#! /usr/bin/perl -w #-- # Perl binding of Hyper Estraier # Copyright (C) 2004-2007 Mikio Hirabayashi # This file is part of Hyper Estraier. # Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper # Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, # Boston, MA 02111-1307 USA. use lib qw(./src/blib/lib ./src/blib/arch); use strict; use warnings; use ExtUtils::testlib; use Time::HiRes qw(gettimeofday); use Estraier; $Estraier::DEBUG = 1; # global constants use constant { TRUE => 1, FALSE => 0, PROTVER => "1.0", SEARCHMAX => 10, SEARCHAUX => 32, SNIPWWIDTH => 480, SNIPHWIDTH => 96, SNIPAWIDTH => 96, VM_ID => 0, VM_URI => 1, VM_ATTR => 2, VM_FULL => 3, VM_SNIP => 4, READMAX => 1024 * 1024 * 256, }; # main routine sub main { (scalar(@ARGV) >= 1) || usage(); my $rv; if($ARGV[0] eq "put"){ $rv = runput(); } elsif($ARGV[0] eq "out"){ $rv = runout(); } elsif($ARGV[0] eq "edit"){ $rv = runedit(); } elsif($ARGV[0] eq "get"){ $rv = runget(); } elsif($ARGV[0] eq "uriid"){ $rv = runuriid(); } elsif($ARGV[0] eq "inform"){ $rv = runinform(); } elsif($ARGV[0] eq "optimize"){ $rv = runoptimize(); } elsif($ARGV[0] eq "merge"){ $rv = runmerge(); } elsif($ARGV[0] eq "search"){ $rv = runsearch(); } else { usage(); } return $rv; } # print the usage and exit sub usage { printf(STDERR "%s: command line utility for the core API of Hyper Estraier\n", $0); printf(STDERR "\n"); printf(STDERR "usage:\n"); printf(STDERR " %s put [-cl] [-ws] db [file]\n", $0); printf(STDERR " %s out [-cl] db expr\n", $0); printf(STDERR " %s edit db expr name [value]\n", $0); printf(STDERR " %s get db expr [attr]\n", $0); printf(STDERR " %s uriid db uri\n", $0); printf(STDERR " %s inform db\n", $0); printf(STDERR " %s optimize [-onp] [-ond] db\n", $0); printf(STDERR " %s merge [-cl] db target\n", $0); printf(STDERR " %s search [-vu|-va|-vf|-vs] [-gs|-gf|-ga] [-cd] [-ni] [-sf|-sfr|-sfu|-sfi]" . " [-attr expr] [-ord expr] [-max num] [-sk num] [-aux num] [-dis name]" . " db [phrase]\n", $0); printf(STDERR "\n"); exit(1); } # print error string and flush the buffer */ sub printerror { my $msg = shift; printf(STDERR "%s: ERROR: %s\n", $0, $msg); } # parse arguments of the put command sub runput { my $dbname = undef; my $file = undef; my $opts = 0; my $i; for($i = 1; $i < scalar(@ARGV); $i++){ if(!defined($dbname) && $ARGV[$i] =~ /^-/){ if($ARGV[$i] eq "-cl"){ $opts |= Database::PDCLEAN; } elsif($ARGV[$i] eq "-ws"){ $opts |= Database::PDWEIGHT; } else { usage(); } } elsif(!defined($dbname)){ $dbname = $ARGV[$i]; } elsif(!defined($file)){ $file = $ARGV[$i]; } else { usage(); } } usage() if(!defined($dbname)); procput($dbname, $file, $opts); } # parse arguments of the out command sub runout { my $dbname = undef; my $expr = undef; my $opts = 0; my $i; for($i = 1; $i < scalar(@ARGV); $i++){ if(!defined($dbname) && $ARGV[$i] =~ /^-/){ if($ARGV[$i] eq "-cl"){ $opts |= Database::ODCLEAN; } else { usage(); } } elsif(!defined($dbname)){ $dbname = $ARGV[$i]; } elsif(!defined($expr)){ $expr = $ARGV[$i]; } else { usage(); } } usage() if(!defined($dbname) || !defined($expr)); procout($dbname, $expr, $opts); } # parse arguments of the edit command sub runedit { my $dbname = undef; my $expr = undef; my $name = undef; my $value = undef; my $i; for($i = 1; $i < scalar(@ARGV); $i++){ if(!defined($dbname) && $ARGV[$i] =~ /^-/){ usage(); } elsif(!defined($dbname)){ $dbname = $ARGV[$i]; } elsif(!defined($expr)){ $expr = $ARGV[$i]; } elsif(!defined($name)){ $name = $ARGV[$i]; } elsif(!defined($value)){ $value = $ARGV[$i]; } else { usage(); } } usage() if(!defined($dbname) || !defined($expr) || !defined($name)); procedit($dbname, $expr, $name, $value); } # parse arguments of the get command sub runget { my $dbname = undef; my $expr = undef; my $attr = undef; my $i; for($i = 1; $i < scalar(@ARGV); $i++){ if(!defined($dbname) && $ARGV[$i] =~ /^-/){ usage(); } elsif(!defined($dbname)){ $dbname = $ARGV[$i]; } elsif(!defined($expr)){ $expr = $ARGV[$i]; } elsif(!defined($attr)){ $attr = $ARGV[$i]; } else { usage(); } } usage() if(!defined($dbname) || !defined($expr)); procget($dbname, $expr, $attr); } # parse arguments of the uriid command sub runuriid { my $dbname = undef; my $uri = undef; my $i; for($i = 1; $i < scalar(@ARGV); $i++){ if(!defined($dbname) && $ARGV[$i] =~ /^-/){ usage(); } elsif(!defined($dbname)){ $dbname = $ARGV[$i]; } elsif(!defined($uri)){ $uri = $ARGV[$i]; } else { usage(); } } usage() if(!defined($dbname) || !defined($uri)); procuriid($dbname, $uri); } # parse arguments of the inform command sub runinform { my $dbname = undef; my $i; for($i = 1; $i < scalar(@ARGV); $i++){ if(!defined($dbname) && $ARGV[$i] =~ /^-/){ usage(); } elsif(!defined($dbname)){ $dbname = $ARGV[$i]; } else { usage(); } } usage() if(!defined($dbname)); procinform($dbname); } # parse arguments of the optimize command sub runoptimize { my $dbname = undef; my $opts = 0; my $i; for($i = 1; $i < scalar(@ARGV); $i++){ if(!defined($dbname) && $ARGV[$i] =~ /^-/){ if($ARGV[$i] eq "-onp"){ $opts |= Database::OPTNOPURGE; } elsif($ARGV[$i] eq "-ond"){ $opts |= Database::OPTNODBOPT; } else { usage(); } } elsif(!defined($dbname)){ $dbname = $ARGV[$i]; } else { usage(); } } usage() if(!defined($dbname)); procoptimize($dbname, $opts); } # parse arguments of the merge command sub runmerge { my $dbname = undef; my $tgname = undef; my $opts = 0; my $i; for($i = 1; $i < scalar(@ARGV); $i++){ if(!defined($dbname) && $ARGV[$i] =~ /^-/){ if($ARGV[$i] eq "-cl"){ $opts |= Database::MGCLEAN; } else { usage(); } } elsif(!defined($dbname)){ $dbname = $ARGV[$i]; } elsif(!defined($tgname)){ $tgname = $ARGV[$i]; } else { usage(); } } usage() if(!defined($dbname) || !defined($tgname)); procmerge($dbname, $tgname, $opts); } # parse arguments of the search command sub runsearch { my $dbname = undef; my $phrase = undef; my @attrs = (); my $ord = undef; my $max = SEARCHMAX; my $skip = 0; my $opts = 0; my $aux = SEARCHAUX; my $dis = undef; my $cd = FALSE; my $view = VM_ID; my $i; for($i = 1; $i < scalar(@ARGV); $i++){ if(!defined($dbname) && $ARGV[$i] =~ /^-/){ if($ARGV[$i] eq "-vu"){ $view = VM_URI; } elsif($ARGV[$i] eq "-va"){ $view = VM_ATTR; } elsif($ARGV[$i] eq "-vf"){ $view = VM_FULL; } elsif($ARGV[$i] eq "-vs"){ $view = VM_SNIP; } elsif($ARGV[$i] eq "-gs"){ $opts |= Condition::SURE; } elsif($ARGV[$i] eq "-gf"){ $opts |= Condition::FAST; } elsif($ARGV[$i] eq "-ga"){ $opts |= Condition::AGITO; } elsif($ARGV[$i] eq "-cd"){ $cd = TRUE; } elsif($ARGV[$i] eq "-ni"){ $opts |= Condition::NOIDF; } elsif($ARGV[$i] eq "-sf"){ $opts |= Condition::SIMPLE; } elsif($ARGV[$i] eq "-sfr"){ $opts |= Condition::ROUGH; } elsif($ARGV[$i] eq "-sfu"){ $opts |= Condition::UNION; } elsif($ARGV[$i] eq "-sfi"){ $opts |= Condition::ISECT; } elsif($ARGV[$i] eq "-attr"){ usage() if(++$i >= scalar(@ARGV)); push(@attrs, $ARGV[$i]); } elsif($ARGV[$i] eq "-ord"){ usage() if(++$i >= scalar(@ARGV)); $ord = $ARGV[$i]; } elsif($ARGV[$i] eq "-max"){ usage() if(++$i >= scalar(@ARGV)); $max = Estraier::atoi($ARGV[$i]); } elsif($ARGV[$i] eq "-sk"){ usage() if(++$i >= scalar(@ARGV)); $skip = Estraier::atoi($ARGV[$i]); } elsif($ARGV[$i] eq "-aux"){ usage() if(++$i >= scalar(@ARGV)); $aux = Estraier::atoi($ARGV[$i]); } elsif($ARGV[$i] eq "-dis"){ usage() if(++$i >= scalar(@ARGV)); $dis = $ARGV[$i]; } else { usage(); } } elsif(!defined($dbname)){ $dbname = $ARGV[$i]; } elsif(!defined($phrase)){ $phrase = $ARGV[$i]; } else { $phrase = $phrase . " " . $ARGV[$i]; } } usage() if(!defined($dbname)); procsearch($dbname, $phrase, \@attrs, $ord, $max, $skip, $opts, $aux, $dis, $cd, $view); } # perform the put command sub procput { my $dbname = shift; my $file = shift; my $opts = shift; my $draft = ""; if(defined($file)){ unless(open(IN, "<$file")){ printerror($dbname . ": could not open"); return 1; } binmode(IN); sysread(IN, $draft, READMAX); close(IN); } else { binmode(STDIN); sysread(STDIN, $draft, READMAX); } my $doc = new Document($draft); my $db = new Database(); unless($db->open($dbname, Database::DBWRITER | Database::DBCREAT)){ printerror($dbname . ": " . $db->err_msg($db->error())); return 1; } $db->set_informer("main::informer"); unless($db->put_doc($doc, $opts)){ printerror($dbname . ": " . $db->err_msg($db->error())); $db->close(); return 1; } unless($db->close()){ printerror($dbname . ": " . $db->err_msg($db->error())); return 1; } return 0; } # perform the out command sub procout { my $dbname = shift; my $expr = shift; my $opts = shift; my $db = new Database(); unless($db->open($dbname, Database::DBWRITER)){ printerror($dbname . ": " . $db->err_msg($db->error())); return 1; } $db->set_informer("main::informer"); my $id = Estraier::atoi($expr); if($id < 1 && ($id = $db->uri_to_id($expr)) < 1){ printerror($dbname . ": " . $db->err_msg($db->error())); $db->close(); return 1; } unless($db->out_doc($id, $opts)){ printerror($dbname . ": " . $db->err_msg($db->error())); $db->close(); return 1; } unless($db->close()){ printerror($dbname . ": " . $db->err_msg($db->error())); return 1; } return 0; } # perform the edit command sub procedit { my $dbname = shift; my $expr = shift; my $name = shift; my $value = shift; my $db = new Database(); unless($db->open($dbname, Database::DBWRITER)){ printerror($dbname . ": " . $db->err_msg($db->error())); return 1; } $db->set_informer("main::informer"); my $id = Estraier::atoi($expr); if($id < 1 && ($id = $db->uri_to_id($expr)) < 1){ printerror($dbname . ": " . $db->err_msg($db->error())); $db->close(); return 1; } my $doc = $db->get_doc($id, Database::GDNOTEXT); unless(defined($doc)){ printerror($dbname . ": " . $db->err_msg($db->error())); $db->close(); return 1; } $doc->add_attr($name, $value); unless($db->edit_doc($doc)){ printerror($dbname . ": " . $db->err_msg($db->error())); $db->close(); return 1; } unless($db->close()){ printerror($dbname . ": " . $db->err_msg($db->error())); return 1; } return 0; } # perform the get command sub procget { my $dbname = shift; my $expr = shift; my $attr = shift; my $db = new Database(); unless($db->open($dbname, Database::DBREADER)){ printerror($dbname . ": " . $db->err_msg($db->error())); return 1; } my $id = Estraier::atoi($expr); if($id < 1 && ($id = $db->uri_to_id($expr)) < 1){ printerror($dbname . ": " . $db->err_msg($db->error())); $db->close(); return 1; } if(defined($attr)){ my $value = $db->get_doc_attr($id, $attr); unless(defined($value)){ printerror($dbname . ": " . $db->err_msg($db->error())); $db->close(); return 1; } printf("%s\n", $value); } else { my $doc = $db->get_doc($id, 0); unless(defined($doc)){ printerror($dbname . ": " . $db->err_msg($db->error())); $db->close(); return 1; } printf("%s", $doc->dump_draft()); } unless($db->close()){ printerror($dbname . ": " . $db->err_msg($db->error())); return 1; } return 0; } # perform the uriid command sub procuriid { my $dbname = shift; my $uri = shift; my $db = new Database(); unless($db->open($dbname, Database::DBREADER)){ printerror($dbname . ": " . $db->err_msg($db->error())); return 1; } my $id = $db->uri_to_id($uri); unless($id > 0){ printerror($dbname . ": " . $db->err_msg($db->error())); $db->close(); return 1; } printf("%d\n", $id); unless($db->close()){ printerror($dbname . ": " . $db->err_msg($db->error())); return 1; } return 0; } # perform the inform command sub procinform { my $dbname = shift; my $db = new Database(); unless($db->open($dbname, Database::DBREADER)){ printerror($dbname . ": " . $db->err_msg($db->error())); return 1; } printf("number of documents: %d\n", $db->doc_num()); printf("number of words: %d\n", $db->word_num()); printf("file size: %d\n", $db->size()); unless($db->close()){ printerror($dbname . ": " . $db->err_msg($db->error())); return 1; } return 0; } # perform the optimize command sub procoptimize { my $dbname = shift; my $opts = shift; my $db = new Database(); unless($db->open($dbname, Database::DBWRITER)){ printerror($dbname . ": " . $db->err_msg($db->error())); return 1; } $db->set_informer("main::informer"); unless($db->optimize($opts)){ printerror($dbname . ": " . $db->err_msg($db->error())); $db->close(); return 1; } unless($db->close()){ printerror($dbname . ": " . $db->err_msg($db->error())); return 1; } return 0; } # perform the merge command sub procmerge { my $dbname = shift; my $tgname = shift; my $opts = shift; my $db = new Database(); unless($db->open($dbname, Database::DBWRITER)){ printerror($dbname . ": " . $db->err_msg($db->error())); return 1; } $db->set_informer("main::informer"); unless($db->merge($tgname, $opts)){ printerror($dbname . ": " . $db->err_msg($db->error())); $db->close(); return 1; } unless($db->close()){ printerror($dbname . ": " . $db->err_msg($db->error())); return 1; } return 0; } # perform the search command sub procsearch { my $dbname = shift; my $phrase = shift; my $attrs = shift; my $ord = shift; my $max = shift; my $skip = shift; my $opts = shift; my $aux = shift; my $dis = shift; my $cd = shift; my $view = shift; my $db = new Database(); unless($db->open($dbname, Database::DBREADER)){ printerror($dbname . ": " . $db->err_msg($db->error())); return 1; } my $cond = new Condition(); $cond->set_phrase($phrase) if(defined($phrase)); foreach my $expr (@$attrs) { $cond->add_attr($expr); } $cond->set_order($ord) if(defined($ord)); $cond->set_max($max) if($max >= 0); $cond->set_skip($skip) if($skip >= 0); $cond->set_options($opts); $cond->set_auxiliary($aux); $cond->set_distinct($dis) if(defined($dis)); my ($sec, $usec) = gettimeofday(); my $stime = $sec + $usec / 1000000.0; my $res = $db->search($cond); ($sec, $usec) = gettimeofday(); my $etime = $sec + $usec / 1000000.0; my $border = sprintf("--------[%.0f]--------", $stime * 100); printf("%s\n", $border); printf("VERSION\t%s\n", PROTVER); printf("NODE\tlocal\n"); printf("HIT\t%d\n", $res->hint("")); my @snwords = (); my $words = $res->hint_words(); my $i; foreach my $word (@$words){ $i++; my $hits = $res->hint($word); push(@snwords, $word) if $hits > 0; printf("HINT#%d\t%s\t%d\n", $i, $word, $hits) } printf("TIME\t%0.3f\n", $etime - $stime); printf("DOCNUM\t%d\n", $db->doc_num()); printf("WORDNUM\t%d\n", $db->word_num()); if($view == VM_URI){ printf("VIEW\tURI\n"); } elsif($view == VM_ATTR){ printf("VIEW\tATTRIBUTE\n"); } elsif($view == VM_FULL){ printf("VIEW\tFULL\n"); } elsif($view == VM_SNIP){ printf("VIEW\tSNIPPET\n"); } else { printf("VIEW\tID\n"); } printf("\n"); printf("%s\n", $border) if($view != VM_ATTR && $view != VM_FULL && $view != VM_SNIP); my $dnum = $res->doc_num(); foreach my $i (0..$dnum-1){ my $id = $res->get_doc_id($i); if($view == VM_URI){ my $doc = $db->get_doc($id, $cd ? 0 : Database::GDNOTEXT); next unless defined($doc); next if $cd && !$db->scan_doc($doc, $cond); printf("%d\t%s\n", $id, $doc->attr('@uri')); } elsif($view == VM_ATTR){ my $doc = $db->get_doc($id, $cd ? 0 : Database::GDNOTEXT); next unless defined($doc); printf("%s\n", $border); my $names = $doc->attr_names(); foreach my $name (@$names){ printf("%s=%s\n", $name, $doc->attr($name)); } printf("\n"); } elsif($view == VM_FULL){ my $doc = $db->get_doc($id, 0); next unless defined($doc); printf("%s\n", $border); printf("%s", $doc->dump_draft()); } elsif($view == VM_SNIP){ my $doc = $db->get_doc($id, 0); next unless defined($doc); printf("%s\n", $border); my $names = $doc->attr_names(); foreach my $name (@$names){ printf("%s=%s\n", $name, $doc->attr($name)); } printf("\n"); printf("%s", $doc->make_snippet(\@snwords, SNIPWWIDTH, SNIPHWIDTH, SNIPAWIDTH)); } else { printf("%d\n", $id); } } printf("%s:END\n", $border); unless($db->close()){ printerror($dbname . ": " . $db->err_msg($db->error())); return 1; } return 0; } # callback function for database events sub informer { printf("%s: INFO: %s\n", $0, shift); } # perform the main routine $0 =~ s/.*\///; exit(main()); # END OF FILE hyperestraier-1.4.13/perlnative/example/000077500000000000000000000000001125261632700202775ustar00rootroot00000000000000hyperestraier-1.4.13/perlnative/example/Makefile000066400000000000000000000007721125261632700217450ustar00rootroot00000000000000# Makefile for sample programs of the Perl binding #================================================================ # Setting Variables #================================================================ # Generic settings SHELL = /bin/sh #================================================================ # Actions #================================================================ all : clean : rm -rf *.exe *.o a.out check.out gmon.out leak.log casket *~ .PHONY : all clean # END OF FILE hyperestraier-1.4.13/perlnative/example/example001.pl000066400000000000000000000016051125261632700225120ustar00rootroot00000000000000use strict; use warnings; use Estraier; $Estraier::DEBUG = 1; # create the database object my $db = new Database(); # open the database unless($db->open("casket", Database::DBWRITER | Database::DBCREAT)){ printf("error: %s\n", $db->err_msg($db->error())); exit; } # create a document object my $doc = new Document(); # add attributes to the document object $doc->add_attr('@uri', "http://estraier.gov/example.txt"); $doc->add_attr('@title', "Over the Rainbow"); # add the body text to the document object $doc->add_text("Somewhere over the rainbow. Way up high."); $doc->add_text("There's a land that I heard of once in a lullaby."); # register the document object to the database unless($db->put_doc($doc, Database::PDCLEAN)){ printf("error: %s\n", $db->err_msg($db->error())); } # close the database unless($db->close()){ printf("error: %s\n", $db->err_msg($db->error())); } hyperestraier-1.4.13/perlnative/example/example002.pl000066400000000000000000000021431125261632700225110ustar00rootroot00000000000000use strict; use warnings; use Estraier; $Estraier::DEBUG = 1; # create the database object my $db = new Database(); # open the database unless($db->open("casket", Database::DBREADER)){ printf("error: %s\n", $db->err_msg($db->error())); exit; } # create a search condition object my $cond = new Condition(); # set the search phrase to the search condition object $cond->set_phrase("rainbow AND lullaby"); # get the result of search my $result = $db->search($cond); # for each document in the result my $dnum = $result->doc_num(); foreach my $i (0..$dnum-1){ # retrieve the document object my $doc = $db->get_doc($result->get_doc_id($i), 0); next unless(defined($doc)); # display attributes my $uri = $doc->attr('@uri'); printf("URI: %s\n", $uri) if defined($uri); my $title = $doc->attr('@title'); printf("Title: %s\n", $title) if defined($title); # display the body text my $texts = $doc->texts(); foreach my $text (@$texts){ printf("%s\n", $text); } } # close the database unless($db.close()){ printf("error: %s\n", $db->err_msg($db->error())); } hyperestraier-1.4.13/perlnative/src/000077500000000000000000000000001125261632700174335ustar00rootroot00000000000000hyperestraier-1.4.13/perlnative/src/Estraier.pm000066400000000000000000000576361125261632700215700ustar00rootroot00000000000000#------------------------------------------------------------------------------------------------- # Perl binding of Hyper Estraier # Copyright (C) 2004-2007 Mikio Hirabayashi # This file is part of Hyper Estraier. # Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper # Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, # Boston, MA 02111-1307 USA. #------------------------------------------------------------------------------------------------- package Estraier; use strict; use warnings; use Carp; require Exporter; require XSLoader; our @ISA = qw(Exporter); our $VERSION = '1.0'; our $DEBUG = 0; XSLoader::load('Estraier', $VERSION); use constant { TRUE => 1, FALSE => 0, }; sub atoi { my $str = shift; $str =~ s/^ *//; my $sign = 1; if($str =~ /^-/){ $sign = -1; $str =~ s/^-*// } return 0 unless $str =~ /^[0-9]+/; my $t = 0; foreach my $d (split(//, $str)){ last unless($d =~ /^[0-9]$/); $t = $t * 10 + $d; } return $t * $sign; } package Document; use Carp; sub new { my $class = shift; my $draft = shift; if(scalar(@_) != 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } my $self = [0]; $$self[0] = defined($draft) ? Estraier::doc_new_from_draft($draft) : Estraier::doc_new(); bless($self, $class); return $self; } sub new_with_ptr { my $class = shift; my $ptr = shift; if(scalar(@_) != 0 || !defined($ptr)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } my $self = [0]; $$self[0] = $ptr; bless($self, $class); return $self; } sub DESTROY { my $self = shift; return undef unless($$self[0]); Estraier::doc_delete($$self[0]); return undef; } sub add_attr { my $self = shift; my $name = shift; my $value = shift; if(scalar(@_) != 0 || !defined($name)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } $value = "\t(NULL)\t" if(!defined($value)); Estraier::doc_add_attr($$self[0], $name, $value); return undef; } sub add_text { my $self = shift; my $text = shift; if(scalar(@_) != 0 || !defined($text)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } Estraier::doc_add_text($$self[0], $text); return undef; } sub add_hidden_text { my $self = shift; my $text = shift; if(scalar(@_) != 0 || !defined($text)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } Estraier::doc_add_hidden_text($$self[0], $text); return undef; } sub set_keywords { my $self = shift; my $kwords = shift; if(scalar(@_) != 0 || !defined($kwords) || ref($kwords) ne "HASH"){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } Estraier::doc_set_keywords($$self[0], $kwords); return undef; } sub set_score { my $self = shift; my $score = shift; if(scalar(@_) != 0 || !defined($score) || $score < 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } Estraier::doc_set_score($$self[0], $score); return undef; } sub id { my $self = shift; if(scalar(@_) != 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } return Estraier::doc_id($$self[0]); } sub attr_names { my $self = shift; if(scalar(@_) != 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } return Estraier::doc_attr_names($$self[0]); } sub attr { my $self = shift; my $name = shift; if(scalar(@_) != 0 || !defined($name)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } return Estraier::doc_attr($$self[0], $name); } sub texts { my $self = shift; if(scalar(@_) != 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } return Estraier::doc_texts($$self[0]); } sub cat_texts { my $self = shift; if(scalar(@_) != 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } return Estraier::doc_cat_texts($$self[0]); } sub keywords { my $self = shift; if(scalar(@_) != 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } return Estraier::doc_keywords($$self[0]); } sub score { my $self = shift; if(scalar(@_) != 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } return Estraier::doc_score($$self[0]); } sub dump_draft { my $self = shift; if(scalar(@_) != 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } return Estraier::doc_dump_draft($$self[0]); } sub make_snippet { my $self = shift; my $words = shift; my $wwidth = shift; my $hwidth = shift; my $awidth = shift; if(scalar(@_) != 0 || !defined($words) || ref($words) ne "ARRAY" || !defined($wwidth) || $wwidth < 0 || !defined($hwidth) || $hwidth < 0 || !defined($awidth) || $awidth < 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } return Estraier::doc_make_snippet($$self[0], $words, $wwidth, $hwidth, $awidth); } package Condition; use Carp; use constant { SURE => 1 << 0, USUAL => 1 << 1, FAST => 1 << 2, AGITO => 1 << 3, NOIDF => 1 << 4, SIMPLE => 1 << 10, ROUGH => 1 << 11, UNION => 1 << 15, ISECT => 1 << 16, ECLSIMURL => 10.0, ECLSERV => 100.0, ECLDIR => 101.0, ECLFILE => 102.0, }; sub new { my $class = shift; if(scalar(@_) != 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } my $self = [0]; $$self[0] = Estraier::cond_new(); bless($self, $class); return $self; } sub DESTROY { my $self = shift; return undef unless($$self[0]); Estraier::cond_delete($$self[0]); return undef; } sub set_phrase { my $self = shift; my $phrase = shift; if(scalar(@_) != 0 || !defined($phrase)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } Estraier::cond_set_phrase($$self[0], $phrase); return undef; } sub add_attr { my $self = shift; my $expr = shift; if(scalar(@_) != 0 || !defined($expr)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } Estraier::cond_add_attr($$self[0], $expr); return undef; } sub set_order { my $self = shift; my $expr = shift; if(scalar(@_) != 0 || !defined($expr)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } Estraier::cond_set_order($$self[0], $expr); return undef; } sub set_max { my $self = shift; my $max = shift; if(scalar(@_) != 0 || !defined($max) || $max < 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } Estraier::cond_set_max($$self[0], $max); return undef; } sub set_skip { my $self = shift; my $skip = shift; if(scalar(@_) != 0 || !defined($skip) || $skip < 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } Estraier::cond_set_skip($$self[0], $skip); return undef; } sub set_options { my $self = shift; my $options = shift; if(scalar(@_) != 0 || !defined($options)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } Estraier::cond_set_options($$self[0], $options); return undef; } sub set_auxiliary { my $self = shift; my $min = shift; if(scalar(@_) != 0 || !defined($min)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } Estraier::cond_set_auxiliary($$self[0], $min); return undef; } sub set_eclipse { my $self = shift; my $limit = shift; if(scalar(@_) != 0 || !defined($limit)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } Estraier::cond_set_eclipse($$self[0], $limit); return undef; } sub set_distinct { my $self = shift; my $name = shift; if(scalar(@_) != 0 || !defined($name)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } Estraier::cond_set_distinct($$self[0], $name); return undef; } package Result; use Carp; sub new { my $class = shift; my $resptr = shift; my $idxsptr = shift; my $resnum = shift; my $hints = shift; my $cond = shift; if(scalar(@_) != 0 || !defined($resptr) || !defined($resnum) || !defined($hints) || !defined($cond)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } my $self = [$resptr, $idxsptr, $resnum, $hints, $cond]; bless($self, $class); return $self; } sub DESTROY { my $self = shift; return undef unless($$self[0]); Estraier::res_delete($$self[0], defined($$self[1]) ? $$self[1] : 0, $$self[3], $$self[4]); return undef; } sub doc_num { my $self = shift; if(scalar(@_) != 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return -1; } return $$self[2]; } sub get_doc_id { my $self = shift; my $index = shift; if(scalar(@_) != 0 || !defined($index)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return -1; } return -1 if($index < 0 || $index >= $$self[2]); return Estraier::res_get_doc_id($$self[0], $index); } sub get_dbidx { my $self = shift; my $index = shift; if(scalar(@_) != 0 || !defined($index)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return -1; } return -1 if(!defined($$self[1]) || $index < 0 || $index >= $$self[2]); return Estraier::res_get_dbidx($$self[1], $index); } sub hint_words { my $self = shift; if(scalar(@_) != 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } return Estraier::res_hint_words($$self[3]); } sub hint { my $self = shift; my $word = shift; if(scalar(@_) != 0 || !defined($word)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return 0; } return Estraier::res_hint($$self[3], $word); } sub get_score { my $self = shift; my $index = shift; if(scalar(@_) != 0 || !defined($index)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return -1; } return -1 if($index < 0 || $index >= $$self[2]); return Estraier::res_get_score($$self[4], $index); } sub get_shadows { my $self = shift; my $id = shift; if(scalar(@_) != 0 || !defined($id) || $id < 1){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } return Estraier::res_get_shadows($$self[4], $id); } package Database; use Carp; sub VERSION { return Estraier::db_version(); } use constant { ERRNOERR => 0, ERRINVAL => 1, ERRACCES => 2, ERRLOCK => 3, ERRDB => 4, ERRIO => 5, ERRNOITEM => 6, ERRMISC => 9999, DBREADER => 1 << 0, DBWRITER => 1 << 1, DBCREAT => 1 << 2, DBTRUNC => 1 << 3, DBNOLCK => 1 << 4, DBLCKNB => 1 << 5, DBPERFNG => 1 << 10, DBCHRCAT => 1 << 11, DBSMALL => 1 << 20, DBLARGE => 1 << 21, DBHUGE => 1 << 22, DBHUGE2 => 1 << 23, DBHUGE3 => 1 << 24, DBSCVOID => 1 << 25, DBSCINT => 1 << 26, DBSCASIS => 1 << 27, IDXATTRSEQ => 0, IDXATTRSTR => 1, IDXATTRNUM => 2, OPTNOPURGE => 1 << 0, OPTNODBOPT => 1 << 1, MGCLEAN => 1 << 0, PDCLEAN => 1 << 0, PDWEIGHT => 1 << 1, ODCLEAN => 1 << 0, GDNOATTR => 1 << 0, GDNOTEXT => 1 << 1, GDNOKWD => 1 << 2, }; sub new { my $class = shift; if(scalar(@_) != 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } my $self = [0, ERRNOERR, undef]; bless($self, $class); return $self; } sub DESTROY { my $self = shift; $self->close(); } sub search_meta { my $dbs = shift; my $cond = shift; if(scalar(@_) != 0 || !defined($dbs) || ref($dbs) ne "ARRAY" || !defined($cond) || ref($cond) ne "Condition"){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } my @dbptrs; foreach my $elem (@$dbs){ return undef if(ref($elem) ne "Database" || !$$elem[0]); push(@dbptrs, $$elem[0]); } my ($resptr, $idxsptr, $resnum, $hints, $tcond) = Estraier::db_search_meta(\@dbptrs, $$cond[0]); return new Result($resptr, $idxsptr, $resnum, $hints, $tcond); } sub err_msg { my $self = shift; my $ecode = shift; if(scalar(@_) != 0 || !defined($ecode)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } return Estraier::db_err_msg($ecode); } sub open { my $self = shift; my $name = shift; my $omode = shift; if(scalar(@_) != 0 || !defined($name) || !defined($omode)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return Estraier::FALSE; } if($$self[0]){ $$self[1] = ERRMISC; return Estraier::FALSE; } ($$self[0], $$self[1]) = Estraier::db_open($name, $omode); return $$self[0] ? Estraier::TRUE : Estraier::FALSE; } sub close { my $self = shift; if(scalar(@_) != 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return Estraier::FALSE; } unless($$self[0]){ $$self[1] = ERRMISC; return Estraier::FALSE; } my $ok; ($ok, $$self[1]) = Estraier::db_close($$self[0]); $$self[0] = 0; return $ok ? Estraier::TRUE : Estraier::FALSE; } sub error { my $self = shift; return $$self[1]; } sub fatal { my $self = shift; if(scalar(@_) != 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return Estraier::FALSE; } unless($$self[0]){ $$self[1] = ERRMISC; return Estraier::FALSE; } return Estraier::db_fatal($$self[0]); } sub add_attr_index { my $self = shift; my $name = shift; my $type = shift; if(scalar(@_) != 0 || !defined($name) || !defined($type)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return Estraier::FALSE; } unless($$self[0]){ $$self[1] = ERRMISC; return Estraier::FALSE; } if(!Estraier::db_add_attr_index($$self[0], $name, $type)){ $$self[1] = Estraier::db_error($$self[0]); return Estraier::FALSE; } return Estraier::TRUE; } sub flush { my $self = shift; my $max = shift; if(scalar(@_) != 0 || !defined($max)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return Estraier::FALSE; } unless($$self[0]){ $$self[1] = ERRMISC; return Estraier::FALSE; } if(!Estraier::db_flush($$self[0], $max)){ $$self[1] = Estraier::db_error($$self[0]); return Estraier::FALSE; } return Estraier::TRUE; } sub sync { my $self = shift; if(scalar(@_) != 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return Estraier::FALSE; } unless($$self[0]){ $$self[1] = ERRMISC; return Estraier::FALSE; } if(!Estraier::db_sync($$self[0])){ $$self[1] = Estraier::db_error($$self[0]); return Estraier::FALSE; } return Estraier::TRUE; } sub optimize { my $self = shift; my $options = shift; if(scalar(@_) != 0 || !defined($options)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return Estraier::FALSE; } unless($$self[0]){ $$self[1] = ERRMISC; return Estraier::FALSE; } if(!Estraier::db_optimize($$self[0], $options)){ $$self[1] = Estraier::db_error($$self[0]); return Estraier::FALSE; } return Estraier::TRUE; } sub merge { my $self = shift; my $name = shift; my $options = shift; if(scalar(@_) != 0 || !defined($name) || !defined($options)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return Estraier::FALSE; } unless($$self[0]){ $$self[1] = ERRMISC; return Estraier::FALSE; } if(!Estraier::db_merge($$self[0], $name, $options)){ $$self[1] = Estraier::db_error($$self[0]); return Estraier::FALSE; } return Estraier::TRUE; } sub put_doc { my $self = shift; my $doc = shift; my $options = shift; if(scalar(@_) != 0 || !defined($doc) || ref($doc) ne "Document" || !defined($options)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return Estraier::FALSE; } unless($$self[0]){ $$self[1] = ERRMISC; return Estraier::FALSE; } if(!Estraier::db_put_doc($$self[0], $$doc[0], $options)){ $$self[1] = Estraier::db_error($$self[0]); return Estraier::FALSE; } return Estraier::TRUE; } sub out_doc { my $self = shift; my $id = shift; my $options = shift; if(scalar(@_) != 0 || !defined($id) || $id < 1 || !defined($options)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return Estraier::FALSE; } unless($$self[0]){ $$self[1] = ERRMISC; return Estraier::FALSE; } if(!Estraier::db_out_doc($$self[0], $id, $options)){ $$self[1] = Estraier::db_error($$self[0]); return Estraier::FALSE; } return Estraier::TRUE; } sub edit_doc { my $self = shift; my $doc = shift; if(scalar(@_) != 0 || !defined($doc) || ref($doc) ne "Document"){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return Estraier::FALSE; } unless($$self[0]){ $$self[1] = ERRMISC; return Estraier::FALSE; } if(!Estraier::db_edit_doc($$self[0], $$doc[0])){ $$self[1] = Estraier::db_error($$self[0]); return Estraier::FALSE; } return Estraier::TRUE; } sub get_doc { my $self = shift; my $id = shift; my $options = shift; if(scalar(@_) != 0 || !defined($id) || $id < 1 || !defined($options)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } unless($$self[0]){ $$self[1] = ERRMISC; return undef; } my $docptr = Estraier::db_get_doc($$self[0], $id, $options); if(!$docptr){ $$self[1] = Estraier::db_error($$self[0]); return undef; } return new_with_ptr Document($docptr); } sub get_doc_attr { my $self = shift; my $id = shift; my $name = shift; if(scalar(@_) != 0 || !defined($id) || $id < 1 || !defined($name)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } unless($$self[0]){ $$self[1] = ERRMISC; return undef; } my $value = Estraier::db_get_doc_attr($$self[0], $id, $name); if(!$value){ $$self[1] = Estraier::db_error($$self[0]); return undef; } return $value; } sub uri_to_id { my $self = shift; my $uri = shift; if(scalar(@_) != 0 || !defined($uri)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return -1; } unless($$self[0]){ $$self[1] = ERRMISC; return -1; } my $id = Estraier::db_uri_to_id($$self[0], $uri); if($id < 1){ $$self[1] = Estraier::db_error($$self[0]); return -1; } return $id; } sub name { my $self = shift; if(scalar(@_) != 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } unless($$self[0]){ $$self[1] = ERRMISC; return undef; } return Estraier::db_name($$self[0]); } sub doc_num { my $self = shift; if(scalar(@_) != 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return -1; } unless($$self[0]){ $$self[1] = ERRMISC; return -1; } return Estraier::db_doc_num($$self[0]); } sub word_num { my $self = shift; if(scalar(@_) != 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return -1; } unless($$self[0]){ $$self[1] = ERRMISC; return -1; } return Estraier::db_word_num($$self[0]); } sub size { my $self = shift; if(scalar(@_) != 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return -1; } unless($$self[0]){ $$self[1] = ERRMISC; return -1; } return Estraier::db_size($$self[0]); } sub search { my $self = shift; my $cond = shift; if(scalar(@_) != 0 || !defined($cond) || ref($cond) ne "Condition"){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } unless($$self[0]){ $$self[1] = ERRMISC; return undef; } my ($resptr, $resnum, $hints, $tcond) = Estraier::db_search($$self[0], $$cond[0]); return new Result($resptr, undef, $resnum, $hints, $tcond); } sub scan_doc { my $self = shift; my $doc = shift; my $cond = shift; if(scalar(@_) != 0 || !defined($doc) || ref($doc) ne "Document" || !defined($cond) || ref($cond) ne "Condition"){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } unless($$self[0]){ $$self[1] = ERRMISC; return undef; } return Estraier::db_scan_doc($$self[0], $$doc[0], $$cond[0]); } sub set_cache_size { my $self = shift; my $size = shift; my $anum = shift; my $tnum = shift; my $rnum = shift; if(scalar(@_) != 0 || !defined($size) || !defined($anum) || !defined($tnum) || !defined($rnum)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } unless($$self[0]){ $$self[1] = ERRMISC; return undef; } Estraier::db_set_cache_size($$self[0], $size, $anum, $tnum, $rnum); return undef; } sub add_pseudo_index { my $self = shift; my $path = shift; if(scalar(@_) != 0 || !defined($path)){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } unless($$self[0]){ $$self[1] = ERRMISC; return undef; } return Estraier::db_add_pseudo_index($$self[0], $path); } sub set_wildmax { my $self = shift; my $num = shift; if(scalar(@_) != 0 || !defined($num) || $num < 0){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } unless($$self[0]){ $$self[1] = ERRMISC; return undef; } Estraier::db_set_wildmax($$self[0], $num); return undef; } sub set_informer { my $self = shift; my $informer = shift; if(scalar(@_) != 0 || !defined($informer) || ref(\$informer) ne "SCALAR"){ croak(__FILE__ . ": invalid parameter") if($Estraier::DEBUG); return undef; } unless($$self[0]){ $$self[1] = ERRMISC; return undef; } $$self[2] = $informer; Estraier::db_set_informer($$self[0], $informer); return undef; } Estraier::TRUE; # END OF FILE hyperestraier-1.4.13/perlnative/src/Estraier.pod000066400000000000000000000574151125261632700217310ustar00rootroot00000000000000#------------------------------------------------------------------------------------------------- # Perl binding of Hyper Estraier # Copyright (C) 2004-2007 Mikio Hirabayashi # This file is part of Hyper Estraier. # Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper # Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, # Boston, MA 02111-1307 USA. #------------------------------------------------------------------------------------------------- =head1 NAME Perl Binding of Hyper Estraier =head1 SYNOPSYS use Estraier; =head1 INTRODUCTION Hyper Estraier is a full-text search system for communities. This is a package implementing the core API of Hyper Estraier ( http://hyperestraier.sourceforge.net/ ), including native codes written in C with XS macros. As it works on Linux, Mac OS X, Windows, and so on, native libraries for each environment are required to run programs. This package requires Perl 5.8.8 or later versions. =head2 Setting Install the latest version of Hyper Estraier. Enter the sub directory `perlnative' in the extracted package then perform installation. cd perlnative ./configure make su make install On Linux and other UNIX systems: set the environment variable LD_LIBRARY_PATH to find libraries; "libestraier.so". On Mac OS X: set the environment variable DYLD_LIBRARY_PATH to find libraries; "libestraier.dylib". On Windows: set the environment variable PATH to find libraries; "estraier.dll". The package `Estraier' should be loaded in each source file of application programs. use Estraier; If you want to enable runtime assertion, set the variable `$Estraier::DEBUG' to be true. $Estraier::DEBUG = 1; =head1 DESCRIPTION =head2 Class Document =over =item $doc = new Document(I) Create a document object. `draft' specifies a string of draft data. If it is omitted, an empty document object is created. =item $doc-Eadd_attr(I, I) Add an attribute. `name' specifies the name of an attribute. `value' specifies the value of the attribute. If it is `undef', the attribute is removed. The return value is always `undef'. =item $doc-Eadd_text(I) Add a sentence of text. `text' specifies a sentence of text. The return value is always `undef'. =item $doc-Eadd_hidden_text(I) Add a hidden sentence. `text' specifies a hidden sentence. The return value is always `undef'. =item $doc-Eset_keywords(I) Attach keywords. `kwords' specifies the reference of a hash object of keywords. Keys of the hash should be keywords of the document and values should be their scores in decimal string. The return value is always `undef'. =item $doc-Eset_score(I) Set the substitute score. `score' specifies the substitute score. It should be zero or positive. The return value is always `undef'. =item $doc-Eid() Get the ID number. The return value is the ID number of the document object. If the object has never been registered, -1 is returned. =item $doc-Eattr_names() Get an array of attribute names of a document object. The return value is a reference of an array object of attribute names. =item $doc-Eattr() Get the value of an attribute. `name' specifies the name of an attribute. The return value is the value of the attribute or `undef' if it does not exist. =item $doc-Etexts() Get an array of sentences of the text. The return value is a reference of an array object of sentences of the text. =item $doc-Ecat_texts() Concatenate sentences of the text of a document object. The return value is concatenated sentences. =item $doc-Ekeywords() Get attached keywords. The return value is a reference of a hash object of keywords and their scores in decimal string. If no keyword is attached, `undef' is returned. =item $doc-Escore() Get the substitute score. The return value is the substitute score or -1 if it is not set. =item $doc-Edump_draft() Dump draft data of a document object. The return value is draft data. =item $doc-Emake_snippet(I, I, I, I) Make a snippet of the body text. `words' specifies a reference of an array object of words to be highlight. `wwidth' specifies whole width of the result. `hwidth' specifies width of strings picked up from the beginning of the text. `awidth' width of strings picked up around each highlighted word. The return value is a snippet string of the body text. There are tab separated values. Each line is a string to be shown. Though most lines have only one field, some lines have two fields. If the second field exists, the first field is to be shown with highlighted, and the second field means its normalized form. =back =head2 Class Condition =over =item Condition::SURE = 1 << 0 option: check every N-gram key =item Condition::USUAL = 1 << 1 option: check N-gram keys skipping by one =item Condition::FAST = 1 << 2 option: check N-gram keys skipping by two =item Condition::AGITO = 1 << 3 option: check N-gram keys skipping by three =item Condition::NOIDF = 1 << 4 option: without TF-IDF tuning =item Condition::SIMPLE = 1 << 10 option: with the simplified phrase =item Condition::ROUGH = 1 << 11 option: with the rough phrase =item Condition::UNION = 1 << 15 option: with the union phrase =item Condition::ISECT = 1 << 16 option: with the intersection phrase =item Condition::ECLSIMURL = 10.0 eclipse tuning: consider URL =item Condition::ECLSERV = 100.0 eclipse tuning: on server basis =item Condition::ECLDIR = 101.0 eclipse tuning: on directory basis =item Condition::ECLFILE = 102.0 eclipse tuning: on file basis =item $cond = new Condition() Create a search condition object. =item $cond-Eset_phrase(I) Set the search phrase. `phrase' specifies a search phrase. The return value is always `undef'. =item $cond-Eadd_attr(I) Add an expression for an attribute. `expr' specifies an expression for an attribute. The return value is always `undef'. =item $cond-Eset_order(I) Set the order of a condition object. `expr' specifies an expression for the order. By default, the order is by score descending. The return value is always `undef'. =item $cond-Eset_max(I) Set the maximum number of retrieval. `max' specifies the maximum number of retrieval. By default, the number of retrieval is not limited. =item $cond-Eset_skip(I) Set the number of skipped documents. `skip' specifies the number of documents to be skipped in the search result. The return value is always `undef'. =item $cond-Eset_options(I) Set options of retrieval. `options' specifies options: `Condition::SURE' specifies that it checks every N-gram key, `Condition::USU', which is the default, specifies that it checks N-gram keys with skipping one key, `Condition::FAST' skips two keys, `Condition::AGITO' skips three keys, `Condition::NOIDF' specifies not to perform TF-IDF tuning, `Condition::SIMPLE' specifies to use simplified phrase, `Condition::ROUGH' specifies to use rough phrase, `Condition::UNION' specifies to use union phrase, `Condition::ISECT' specifies to use intersection phrase. Each option can be specified at the same time by bitwise or. If keys are skipped, though search speed is improved, the relevance ratio grows less. The return value is always `undef'. =item $cond-Eset_auxiliary(I) Set permission to adopt result of the auxiliary index. `min' specifies the minimum hits to adopt result of the auxiliary index. If it is not more than 0, the auxiliary index is not used. By default, it is 32. =item $cond-Eset_eclipse(I) Set the lower limit of similarity eclipse. `limit' specifies the lower limit of similarity for documents to be eclipsed. Similarity is between 0.0 and 1.0. If the limit is added by `Condition::ECLSIMURL', similarity is weighted by URL. If the limit is `Condition::ECLSERV', similarity is ignored and documents in the same server are eclipsed. If the limit is `Condition::ECLDIR', similarity is ignored and documents in the same directory are eclipsed. If the limit is `Condition::ECLFILE', similarity is ignored and documents of the same file are eclipsed. =item $cond-Eset_distinct(I) Set the attribute distinction filter. `name' specifies the name of an attribute to be distinct. The return value is always `undef'. =back =head2 Class Result =over =item $result-Edoc_num() Get the number of documents. The return value is the number of documents in the result. =item $result-Eget_doc_id(I) Get the ID number of a document. `index' specifies the index of a document. The return value is the ID number of the document or -1 if the index is out of bounds. =item $result-Eget_dbidx(I) Get the index of the container database of a document. `index' specifies the index of a document. The return value is the index of the container database of the document or -1 if the index is out of bounds. =item $result-Ehint_words() Get an array of hint words. The return value is a reference of an array of hint words. =item $result-Ehint(I) Get the value of a hint word. `word' specifies a hint word. An empty string means the number of whole result. The return value is the number of documents corresponding the hint word. If the word is in a negative condition, the value is negative. =item $result-Eget_score(I) Get the score of a document. `index' specifies the index of a document. The return value is the score of the document or -1 if the index is out of bounds. =item $result-Eget_shadows(I) Get an array of ID numbers of eclipsed docuemnts of a document. `id' specifies the ID number of a parent document. The return value is a reference of an array whose elements expresse the ID numbers and their scores alternately. =back =head2 Class Database =over =item Database::VERSION = "0.0.0" version of Hyper Estraier =item Database::ERRNOERR = 0 error code: no error =item Database::ERRINVAL = 1 error code: invalid argument =item Database::ERRACCES = 2 error code: access forbidden =item Database::ERRLOCK = 3 error code: lock failure =item Database::ERRDB = 4 error code: database problem =item Database::ERRIO = 5 error code: I/O problem =item Database::ERRNOITEM = 6 error code: no item =item Database::ERRMISC = 9999 error code: miscellaneous =item Database::DBREADER = 1 << 0 open mode: open as a reader =item Database::DBWRITER = 1 << 1 open mode: open as a writer =item Database::DBCREAT = 1 << 2 open mode: a writer creating =item Database::DBTRUNC = 1 << 3 open mode: a writer truncating =item Database::DBNOLCK = 1 << 4 open mode: open without locking =item Database::DBLCKNB = 1 << 5 open mode: lock without blocking =item Database::DBPERFNG = 1 << 10 open mode: use perfect N-gram analyzer =item Database::DBCHRCAT = 1 << 11 open mode: use character category analyzer =item Database::DBSMALL= 1 << 20 open mode: small tuning =item Database::DBLARGE = 1 << 21 open mode: large tuning =item Database::DBHUGE = 1 << 22 open mode: huge tuning =item Database::DBHUGE2 = 1 << 23 open mode: huge tuning second =item Database::DBHUGE3 = 1 << 24 open mode: huge tuning third =item Database::DBSCVOID = 1 << 25 open mode: store scores as void =item Database::DBSCINT = 1 << 26 open mode: store scores as integer =item Database::DBSCASIS = 1 << 27 open mode: refrain from adjustment of scores =item Database::IDXATTRSEQ = 0 attribute index type: for multipurpose sequencial access method =item Database::IDXATTRSTR = 1 attribute index type: for narrowing with attributes as strings =item Database::IDXATTRNUM = 2 attribute index type: for narrowing with attributes as numbers =item Database::OPTNOPURGE = 1 << 0 optimize option: omit purging dispensable region of deleted =item Database::OPTNODBOPT = 1 << 1 optimize option: omit optimization of the database files =item Database::MGCLEAN = 1 << 0 merge option: clean up dispensable regions =item Database::PDCLEAN = 1 << 0 put_doc option: clean up dispensable regions =item Database::PDWEIGHT = 1 << 1 put_doc option: weight scores statically when indexing =item Database::ODCLEAN = 1 << 0 out_doc option: clean up dispensable regions =item Database::GDNOATTR = 1 << 0 get_doc option: no attributes =item Database::GDNOTEXT = 1 << 1 get_doc option: no text =item Database::GDNOKWD = 1 << 2 get_doc option: no keywords =item $db = new Database() Create a database object. =item Database::search_meta(dbs, cond) Search plural databases for documents corresponding a condition. `dbs' specifies a reference of an array whose elements are database objects. `cond' specifies a condition object. The return value is a result object. On error, `undef' is returned. =item $db-Eerr_msg(I) Get the string of an error code. `ecode' specifies an error code. The return value is the string of the error code. =item $db-Eopen(I, I) Open a database. `name' specifies the name of a database directory. `omode' specifies open modes: `Database::DBWRITER' as a writer, `Database::DBREADER' as a reader. If the mode is `Database::DBWRITER', the following may be added by bitwise or: `Database::DBCREAT', which means it creates a new database if not exist, `Database::DBTRUNC', which means it creates a new database regardless if one exists. Both of `Database::DBREADER' and `Database::DBWRITER' can be added to by bitwise or: `Database::DBNOLCK', which means it opens a database file without file locking, or `Database::DBLCKNB', which means locking is performed without blocking. If `Database::DBNOLCK' is used, the application is responsible for exclusion control. `Database::DBCREAT' can be added to by bitwise or: `Database::DBPERFNG', which means N-gram analysis is performed against European text also, `Database::DBCHACAT', which means character category analysis is performed instead of N-gram analysis, `Database::DBSMALL', which means the index is tuned to register less than 50000 documents, `Database::DBLARGE', which means the index is tuned to register more than 300000 documents, `Database::DBHUGE', which means the index is tuned to register more than 1000000 documents, `Database::DBHUGE2', which means the index is tuned to register more than 5000000 documents, `Database::DBHUGE3', which means the index is tuned to register more than 10000000 documents, `Database::DBSCVOID', which means scores are stored as void, `Database::DBSCINT', which means scores are stored as 32-bit integer, `Database::DBSCASIS', which means scores are stored as-is and marked not to be tuned when search. The return value is true if success, else it is false. =item $db-Eclose() Close the database. The return value is true if success, else it is false. =item $db-Eerror() Get the last happened error code. The return value is the last happened error code. =item $db-Efatal() Check whether the database has a fatal error. The return value is true if the database has fatal erroor, else it is false. =item $db-Eadd_attr_index(I, I) Add an index for narrowing or sorting with document attributes. `name' specifies the name of an attribute. `type' specifies the data type of attribute index; `Database::IDXATTRSEQ' for multipurpose sequencial access method, `Database::IDXATTRSTR' for narrowing with attributes as strings, `Database::IDXATTRNUM' for narrowing with attributes as numbers. The return value is true if success, else it is false. =item $db-Eflush(I) Flush index words in the cache. `max' specifies the maximum number of words to be flushed. If it not more than zero, all words are flushed. The return value is true if success, else it is false. =item $db-Esync() Synchronize updating contents. The return value is true if success, else it is false. =item $db-Eoptimize(I) Optimize the database. `options' specifies options: `Database::OPTNOPURGE' to omit purging dispensable region of deleted documents, `Database::OPTNODBOPT' to omit optimization of the database files. The two can be specified at the same time by bitwise or. The return value is true if success, else it is false. =item $db-Emerge(I, I) Merge another database. `name' specifies the name of another database directory. `options' specifies options: `Database::MGCLEAN' to clean up dispensable regions of the deleted document. The return value is true if success, else it is false. =item $db-Eput_doc(I, I) Add a document. `doc' specifies a document object. The document object should have the URI attribute. `options' specifies options: `Database::PDCLEAN' to clean up dispensable regions of the overwritten document. The return value is true if success, else it is false. =item $db-Eout_doc(I, I) Remove a document. `id' specifies the ID number of a registered document. `options' specifies options: `Database::ODCLEAN' to clean up dispensable regions of the deleted document. The return value is true if success, else it is false. =item $db-Eedit_doc(I) Edit attributes of a document. `doc' specifies a document object. The return value is true if success, else it is false. =item $db-Eget_doc(I, I) Retrieve a document. `id' specifies the ID number of a registered document. `options' specifies options: `Database::GDNOATTR' to ignore attributes, `Database::GDNOTEXT' to ignore the body text, `Database::GDNOKWD' to ignore keywords. The three can be specified at the same time by bitwise or. The return value is a document object. On error, `undef' is returned. =item $db-Eget_doc_attr(I, I) Retrieve the value of an attribute of a document. `id' specifies the ID number of a registered document. `name' specifies the name of an attribute. The return value is the value of the attribute or `undef' if it does not exist. =item $db-Euri_to_id(I) Get the ID of a document specified by URI. `uri' specifies the URI of a registered document. The return value is the ID of the document. On error, -1 is returned. =item $db-Ename() Get the name. The return value is the name of the database. =item $db-Edoc_num() Get the number of documents. The return value is the number of documents in the database. =item $db-Eword_num() Get the number of unique words. The return value is the number of unique words in the database. =item $db-Esize() Get the size. The return value is the size of the database. =item $db-Esearch(I) Search for documents corresponding a condition. `cond' specifies a condition object. The return value is a result object. On error, `undef' is returned. =item $db-Escan_doc(I, I) Check whether a document object matches the phrase of a search condition object definitely. `doc' specifies a document object. `cond' specifies a search condition object. The return value is true if the document matches the phrase of the condition object definitely, else it is false. =item $db-Eset_cache_size(I, I, I, I) Set the maximum size of the cache memory. `size' specifies the maximum size of the index cache. By default, it is 64MB. If it is not more than 0, the current size is not changed. `anum' specifies the maximum number of cached records for document attributes. By default, it is 8192. If it is not more than 0, the current size is not changed. `tnum' specifies the maximum number of cached records for document texts. By default, it is 1024. If it is not more than 0, the current size is not changed. `rnum' specifies the maximum number of cached records for occurrence results. By default, it is 256. If it is not more than 0, the current size is not changed. The return value is always `undef'. =item $db-Eadd_pseudo_index(I) Add a pseudo index directory. `path' specifies the path of a pseudo index directory. The return value is true if success, else it is false. =item $db-Eset_wildmax(I) Set the maximum number of expansion of wild cards. `num' specifies the maximum number of expansion of wild cards. The return value is always `undef'. =item $db-Eset_informer(I) Set the callback function to inform of database events. `informer' specifies the name of an arbitrary function. The function should have one parameter for a string of a message of each event. The return value is always `undef'. =back =head1 EXAMPLE =head2 Gatherer The following is the simplest implementation of a gatherer. use strict; use warnings; use Estraier; $Estraier::DEBUG = 1; # create the database object my $db = new Database(); # open the database unless($db->open("casket", Database::DBWRITER | Database::DBCREAT)){ printf("error: %s\n", $db->err_msg($db->error())); exit; } # create a document object my $doc = new Document(); # add attributes to the document object $doc->add_attr('@uri', "https://estraier.gov/example.txt"); $doc->add_attr('@title', "Over the Rainbow"); # add the body text to the document object $doc->add_text("Somewhere over the rainbow. Way up high."); $doc->add_text("There's a land that I heard of once in a lullaby."); # register the document object to the database unless($db->put_doc($doc, Database::PDCLEAN)){ printf("error: %s\n", $db->err_msg($db->error())); } # close the database unless($db->close()){ printf("error: %s\n", $db->err_msg($db->error())); } =head2 Searcher The following is the simplest implementation of a searcher. use strict; use warnings; use Estraier; $Estraier::DEBUG = 1; # create the database object my $db = new Database(); # open the database unless($db->open("casket", Database::DBREADER)){ printf("error: %s\n", $db->err_msg($db->error())); exit; } # create a search condition object my $cond = new Condition(); # set the search phrase to the search condition object $cond->set_phrase("rainbow AND lullaby"); # get the result of search my $result = $db->search($cond); # for each document in the result my $dnum = $result->doc_num(); foreach my $i (0..$dnum-1){ # retrieve the document object my $doc = $db->get_doc($result->get_doc_id($i), 0); next unless(defined($doc)); # display attributes my $uri = $doc->attr('@uri'); printf("URI: %s\n", $uri) if defined($uri); my $title = $doc->attr('@title'); printf("Title: %s\n", $title) if defined($title); # display the body text my $texts = $doc->texts(); foreach my $text (@$texts){ printf("%s\n", $text); } } # close the database unless($db.close()){ printf("error: %s\n", $db->err_msg($db->error())); } =head1 LICENSE Copyright (C) 2004-2007 Mikio Hirabayashi All rights reserved. Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. hyperestraier-1.4.13/perlnative/src/Estraier.xs000066400000000000000000000307261125261632700215750ustar00rootroot00000000000000/************************************************************************************************* * Perl binding of Hyper Estraier * Copyright (C) 2004-2005 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include #include #include #include /************************************************************************************************* * private objects *************************************************************************************************/ static AV *cblisttoav(const CBLIST *values); static CBLIST *avtocblist(AV *av); static HV *cbmaptohv(CBMAP *kwords); static CBMAP *hvtocbmap(HV *hv); static void dbinform(const char *message, void *opaque); static AV *cblisttoav(const CBLIST *values){ AV *av; const char *buf; int i, size; av = newAV(); for(i = 0; i < cblistnum(values); i++){ buf = cblistval(values, i, &size); av_push(av, newSVpvn(buf, size)); } return av; } static CBLIST *avtocblist(AV *av){ CBLIST *list; SV *val; STRLEN size; char *buf; int i, num; list = cblistopen(); if((num = av_len(av)) < 0) return list; for(i = 0; i <= num; i++){ val = *av_fetch(av, i, 0); buf = SvPV(val, size); cblistpush(list, buf, (int)size); } return list; } static HV *cbmaptohv(CBMAP *map){ HV *hv; const char *kbuf, *vbuf; int ksiz, vsiz; hv = newHV(); cbmapiterinit(map); while((kbuf = cbmapiternext(map, &ksiz)) != NULL){ vbuf = cbmapiterval(kbuf, &vsiz); hv_store(hv, kbuf, ksiz, newSVpvn(vbuf, vsiz), 0); } return hv; } static CBMAP *hvtocbmap(HV *hv){ HE *entry; STRLEN vsiz; CBMAP *map; char *kbuf, *vbuf; SV *val; I32 ksiz; map = cbmapopenex(31); hv_iterinit(hv); while((entry = hv_iternext(hv)) != NULL){ kbuf = hv_iterkey(entry, &ksiz); val = hv_iterval(hv, entry); vbuf = SvPV(val, vsiz); cbmapput(map, kbuf, (int)ksiz, vbuf, (int)vsiz, FALSE); } return map; } static void dbinform(const char *message, void *opaque){ dSP; ENTER; SAVETMPS; PUSHMARK(SP); XPUSHs(sv_2mortal(newSVpv(message, 0))); PUTBACK; perl_call_pv(opaque, G_DISCARD | G_EVAL); FREETMPS; LEAVE; } /************************************************************************************************* * public objects *************************************************************************************************/ MODULE = Estraier PACKAGE = Estraier PROTOTYPES: DISABLE void * doc_new() CODE: RETVAL = est_doc_new(); OUTPUT: RETVAL void * doc_new_from_draft(draft) char * draft CODE: RETVAL = est_doc_new_from_draft(draft); OUTPUT: RETVAL void doc_delete(doc) void * doc CODE: est_doc_delete(doc); void doc_add_attr(doc, name, value) void * doc char * name char * value CODE: if(!strcmp(value, "\t(NULL)\t")) value = NULL; est_doc_add_attr(doc, name, value); void doc_add_text(doc, text) void * doc char * text CODE: est_doc_add_text(doc, text); void doc_add_hidden_text(doc, text) void * doc char * text CODE: est_doc_add_hidden_text(doc, text); void doc_set_keywords(doc, kwords) void * doc HV * kwords PREINIT: CBMAP *tkwords; CODE: tkwords = hvtocbmap(kwords); est_doc_set_keywords(doc, tkwords); cbmapclose(tkwords); void doc_set_score(doc, score) void * doc int score CODE: est_doc_set_score(doc, score); int doc_id(doc) void * doc CODE: RETVAL = est_doc_id(doc); OUTPUT: RETVAL void doc_attr_names(doc) void * doc PREINIT: CBLIST *names; PPCODE: names = est_doc_attr_names(doc); XPUSHs(sv_2mortal(newRV_noinc((SV *)cblisttoav(names)))); cblistclose(names); XSRETURN(1); const char * doc_attr(doc, name) void * doc char * name CODE: RETVAL = est_doc_attr(doc, name); OUTPUT: RETVAL void doc_texts(doc) void * doc PREINIT: const CBLIST *texts; PPCODE: texts = est_doc_texts(doc); XPUSHs(sv_2mortal(newRV_noinc((SV *)cblisttoav(texts)))); XSRETURN(1); void doc_cat_texts(doc) void * doc PREINIT: char *texts; PPCODE: texts = est_doc_cat_texts(doc); XPUSHs(sv_2mortal(newSVpv(texts, 0))); free(texts); XSRETURN(1); void doc_keywords(doc) void * doc PREINIT: CBMAP *kwords; PPCODE: if((kwords = est_doc_keywords(doc)) != NULL){ XPUSHs(sv_2mortal(newRV_noinc((SV *)cbmaptohv(kwords)))); } else { XPUSHs((SV *)&PL_sv_undef); } XSRETURN(1); int doc_score(doc) void * doc CODE: RETVAL = est_doc_score(doc); OUTPUT: RETVAL void doc_make_snippet(doc, words, wwidth, hwidth, awidth) void * doc AV * words int wwidth int hwidth int awidth PREINIT: CBLIST *twords; char *snippet; PPCODE: twords = avtocblist(words); snippet = est_doc_make_snippet(doc, twords, wwidth, hwidth, awidth); XPUSHs(sv_2mortal(newSVpv(snippet, 0))); free(snippet); cblistclose(twords); XSRETURN(1); void doc_dump_draft(doc) void * doc PREINIT: char *draft; PPCODE: draft = est_doc_dump_draft(doc); XPUSHs(sv_2mortal(newSVpv(draft, 0))); free(draft); XSRETURN(1); void * cond_new() PREINIT: void *cond; CODE: cond = est_cond_new(); est_cond_set_options(cond, ESTCONDSCFB); RETVAL = cond; OUTPUT: RETVAL void cond_delete(cond) void * cond CODE: est_cond_delete(cond); void cond_set_phrase(cond, phrase) void * cond char * phrase CODE: est_cond_set_phrase(cond, phrase); void cond_add_attr(cond, expr) void * cond char * expr CODE: est_cond_add_attr(cond, expr); void cond_set_order(cond, expr) void * cond char * expr CODE: est_cond_set_order(cond, expr); void cond_set_max(cond, max) void * cond int max CODE: est_cond_set_max(cond, max); void cond_set_skip(cond, skip) void * cond int skip CODE: est_cond_set_skip(cond, skip); void cond_set_options(cond, options) void * cond int options CODE: est_cond_set_options(cond, options); void cond_set_auxiliary(cond, min) void * cond int min CODE: est_cond_set_auxiliary(cond, min); void cond_set_eclipse(cond, limit) void * cond double limit CODE: est_cond_set_eclipse(cond, limit); void cond_set_distinct(cond, name) void * cond char * name CODE: est_cond_set_distinct(cond, name); void res_delete(resptr, idxsptr, hints, cond) void * resptr void * idxsptr void * hints void * cond CODE: est_cond_delete(cond); cbmapclose(hints); free(idxsptr); free(resptr); int res_get_doc_id(resptr, index) void * resptr int index CODE: RETVAL = ((int *)resptr)[index]; OUTPUT: RETVAL int res_get_dbidx(idxsptr, index) void * idxsptr int index CODE: RETVAL = ((int *)idxsptr)[index]; OUTPUT: RETVAL void res_hint_words(hints) void * hints PREINIT: CBLIST *words; const char *vbuf; int i; PPCODE: words = cbmapkeys(hints); for(i = 0; i < cblistnum(words); i++){ vbuf = cblistval(words, i, NULL); if(vbuf[0] == '\0'){ free(cblistremove(words, i, NULL)); break; } } XPUSHs(sv_2mortal(newRV_noinc((SV *)cblisttoav(words)))); cblistclose(words); XSRETURN(1); int res_hint(hints, word) void * hints char * word PREINIT: const char *value; CODE: value = cbmapget(hints, word, -1, NULL); RETVAL = value ? atoi(value) : 0; OUTPUT: RETVAL int res_get_score(cond, index) void * cond int index CODE: RETVAL = est_cond_score(cond, index); OUTPUT: RETVAL void res_get_shadows(cond, id) void * cond int id PREINIT: const int *ary; int i, anum; AV *av; PPCODE: ary = est_cond_shadows(cond, id, &anum); av = newAV(); for(i = 0; i < anum; i++){ av_push(av, newSViv(ary[i])); } XPUSHs(sv_2mortal(newRV_noinc((SV *)av))); XSRETURN(1); const char * db_version() CODE: RETVAL = est_version; OUTPUT: RETVAL void db_search_meta(dbav, cond) AV * dbav void * cond PREINIT: ESTMTDB **dbs; CBMAP *hints; int i, dbnum, *res, rnum, *idxs; PPCODE: dbnum = av_len(dbav) + 1; dbs = cbmalloc(dbnum * sizeof(ESTMTDB *) + 1); for(i = 0; i < dbnum; i++){ dbs[i] = (ESTMTDB *)SvIV(*av_fetch(dbav, i, 0)); } hints = cbmapopenex(31); res = est_mtdb_search_meta(dbs, dbnum, cond, &rnum, hints); idxs = cbmalloc(rnum / 2 * sizeof(int) + 1); for(i = 0; i < rnum; i += 2){ idxs[i/2] = res[i]; res[i/2] = res[i+1]; } free(dbs); XPUSHs(sv_2mortal(newSViv((IV)res))); XPUSHs(sv_2mortal(newSViv((IV)idxs))); XPUSHs(sv_2mortal(newSViv((IV)(rnum / 2)))); XPUSHs(sv_2mortal(newSViv((IV)hints))); XPUSHs(sv_2mortal(newSViv((IV)est_cond_dup(cond)))); XSRETURN(5); const char * db_err_msg(ecode) int ecode CODE: RETVAL = est_err_msg(ecode); OUTPUT: RETVAL void db_open(name, omode) char * name int omode PREINIT: void * db; int ecode; PPCODE: db = est_mtdb_open(name, omode, &ecode); XPUSHs(sv_2mortal(newSViv((IV)db))); XPUSHs(sv_2mortal(newSViv((IV)ecode))); XSRETURN(2); void db_close(db) void * db PREINIT: int ecode, rv; PPCODE: rv = est_mtdb_close(db, &ecode); XPUSHs(sv_2mortal(newSViv((IV)rv))); XPUSHs(sv_2mortal(newSViv((IV)ecode))); XSRETURN(2); int db_error(db) void * db CODE: RETVAL = est_mtdb_error(db); OUTPUT: RETVAL int db_fatal(db) void * db CODE: RETVAL = est_mtdb_fatal(db); OUTPUT: RETVAL int db_add_attr_index(db, name, type) void * db char * name int type CODE: RETVAL = est_mtdb_add_attr_index(db, name, type); OUTPUT: RETVAL int db_flush(db, max) void * db int max CODE: RETVAL = est_mtdb_flush(db, max); OUTPUT: RETVAL int db_sync(db) void * db CODE: RETVAL = est_mtdb_sync(db); OUTPUT: RETVAL int db_optimize(db, options) void * db int options CODE: RETVAL = est_mtdb_optimize(db, options); OUTPUT: RETVAL int db_merge(db, name, options) void * db char * name int options CODE: RETVAL = est_mtdb_merge(db, name, options); OUTPUT: RETVAL int db_put_doc(db, doc, options) void * db void * doc int options CODE: RETVAL = est_mtdb_put_doc(db, doc, options); OUTPUT: RETVAL int db_out_doc(db, id, options) void * db int id int options CODE: RETVAL = est_mtdb_out_doc(db, id, options); OUTPUT: RETVAL int db_edit_doc(db, doc) void * db void * doc CODE: RETVAL = est_mtdb_edit_doc(db, doc); OUTPUT: RETVAL void * db_get_doc(db, id, options) void * db int id int options CODE: RETVAL = est_mtdb_get_doc(db, id, options); OUTPUT: RETVAL void db_get_doc_attr(db, id, name) void * db int id char * name PREINIT: char *value; PPCODE: value = est_mtdb_get_doc_attr(db, id, name); if(!value) XSRETURN_UNDEF; XPUSHs(sv_2mortal(newSVpv(value, 0))); free(value); XSRETURN(1); int db_uri_to_id(db, uri) void * db char * uri CODE: RETVAL = est_mtdb_uri_to_id(db, uri); OUTPUT: RETVAL const char * db_name(db) void * db CODE: RETVAL = est_mtdb_name(db); OUTPUT: RETVAL int db_doc_num(db) void * db CODE: RETVAL = est_mtdb_doc_num(db); OUTPUT: RETVAL int db_word_num(db) void * db CODE: RETVAL = est_mtdb_word_num(db); OUTPUT: RETVAL double db_size(db) void * db CODE: RETVAL = est_mtdb_size(db); OUTPUT: RETVAL void db_search(db, cond) void * db void * cond PREINIT: CBMAP *hints; int *res; int rnum; PPCODE: hints = cbmapopenex(31); res = est_mtdb_search(db, cond, &rnum, hints); XPUSHs(sv_2mortal(newSViv((IV)res))); XPUSHs(sv_2mortal(newSViv((IV)rnum))); XPUSHs(sv_2mortal(newSViv((IV)hints))); XPUSHs(sv_2mortal(newSViv((IV)est_cond_dup(cond)))); XSRETURN(4); int db_scan_doc(db, doc, cond) void * db void * doc void * cond CODE: RETVAL = est_mtdb_scan_doc(db, doc, cond); OUTPUT: RETVAL void db_set_cache_size(db, size, anum, tnum, rnum) void * db double size int anum int tnum int rnum CODE: est_mtdb_set_cache_size(db, (size_t)size, anum, tnum, rnum); int db_add_pseudo_index(db, path) void * db char * path CODE: RETVAL = est_mtdb_add_pseudo_index(db, path); OUTPUT: RETVAL void db_set_wildmax(db, num) void * db int num CODE: est_mtdb_set_wildmax(db, num); void db_set_informer(db, informer) void * db char * informer CODE: est_mtdb_set_informer(db, dbinform, informer); ## END OF FILE hyperestraier-1.4.13/perlnative/src/MANIFEST000066400000000000000000000000721125261632700205630ustar00rootroot00000000000000MANIFEST Makefile.PL Estraier.pm Estraier.xs Estraier.pod hyperestraier-1.4.13/perlnative/src/Makefile.PL000066400000000000000000000005571125261632700214140ustar00rootroot00000000000000#================================================================================================= # Script for MakeMaker #================================================================================================= use ExtUtils::MakeMaker; # Create Makefile WriteMakefile( 'NAME' => 'Estraier', 'VERSION_FROM' => 'Estraier.pm', ); # END OF FILE hyperestraier-1.4.13/rubynative/000077500000000000000000000000001125261632700166635ustar00rootroot00000000000000hyperestraier-1.4.13/rubynative/Makefile.in000066400000000000000000000062261125261632700207360ustar00rootroot00000000000000# Makefile for the Ruby binding of Hyper Estraier #================================================================ # Setting Variables #================================================================ # Generic settings SHELL = @SHELL@ # Packaging PACKAGE = @PACKAGE_NAME@ VERSION = @PACKAGE_VERSION@ # Targets MYRBLIBS = estraier.so MYRBBINS = estcmd.rb # Install destinations prefix = @prefix@ exec_prefix = @exec_prefix@ MYLIBDIR = @libdir@ MYRBLIBDIR = @MYRBLIBDIR@ MYRBBINDIR = @bindir@ DESTDIR = # Building binaries RUBY = @RUBY@ RDOC = @RDOC@ RUNENV = LD_LIBRARY_PATH=.:..:/lib:/usr/lib:$(MYLIBDIR):$(HOME)/lib:/usr/local/lib:@MYRUNPATH@ #================================================================ # Actions #================================================================ all : ( cd src && if ! [ -f Makefile ] ; then $(RUBY) extconf.rb ; fi ) ( cd src && make ) @printf '\n' @printf '#================================================================\n' @printf '# Ready to install.\n' @printf '#================================================================\n' clean : ( cd src && if [ -f Makefile ] ; then make clean ; fi ) rm -rf check.out casket *~ install : mkdir -p $(DESTDIR)$(MYRBLIBDIR) ( cd src && cp -Rf $(MYRBLIBS) $(DESTDIR)$(MYRBLIBDIR) ) mkdir -p $(DESTDIR)$(MYRBBINDIR) cp -Rf $(MYRBBINS) $(DESTDIR)$(MYRBBINDIR) @printf '\n' @printf '#================================================================\n' @printf '# Thanks for using Hyper Estraier for Ruby.\n' @printf '#================================================================\n' uninstall : cd $(DESTDIR)$(MYRBLIBDIR) && rm -f $(MYRBLIBS) cd $(DESTDIR)$(MYRBBINDIR) && rm -f $(MYRBBINS) dist : autoconf make doc make distclean distclean : clean ( cd src && if [ -f Makefile ] ; then make distclean ; fi ) cd example && make clean rm -rf Makefile config.cache config.log config.status autom4te.cache src/mkmf.log check : rm -rf casket $(RUNENV) $(RUBY) -I./src -w -d estcmd.rb put casket ../misc/test001.est $(RUNENV) $(RUBY) -I./src -w -d estcmd.rb put casket ../misc/test002.est $(RUNENV) $(RUBY) -I./src -w -d estcmd.rb put casket ../misc/test003.est $(RUNENV) $(RUBY) -I./src -w -d estcmd.rb put casket ../misc/test004.est $(RUNENV) $(RUBY) -I./src -w -d estcmd.rb put casket ../misc/test005.est $(RUNENV) $(RUBY) -I./src -w -d estcmd.rb put casket ../misc/test006.est $(RUNENV) $(RUBY) -I./src -w -d estcmd.rb edit casket 1 "@title" "java" $(RUNENV) $(RUBY) -I./src -w -d estcmd.rb get casket 1 $(RUNENV) $(RUBY) -I./src -w -d estcmd.rb get casket 1 "@title" $(RUNENV) $(RUBY) -I./src -w -d estcmd.rb out casket 1 $(RUNENV) $(RUBY) -I./src -w -d estcmd.rb inform casket $(RUNENV) $(RUBY) -I./src -w -d estcmd.rb optimize casket $(RUNENV) $(RUBY) -I./src -w -d estcmd.rb search \ -vf -cd casket "estraier" > check.out $(RUNENV) $(RUBY) -I./src -w -d estcmd.rb search \ -vs -gs -attr "@uri" -ord "@mdate NUMD" -max 1 casket "estraier OR mikio" > check.out rm -rf casket doc : make docclean $(RDOC) -t estraier -o ../doc/rubynativeapi estraier-doc.rb docclean : rm -rf ../doc/rubynativeapi .PHONY : all clean install casket check # END OF FILE hyperestraier-1.4.13/rubynative/configure000077500000000000000000002042271125261632700206010ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for hyperestraier-rubynative 1.0.0. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='hyperestraier-rubynative' PACKAGE_TARNAME='hyperestraier-rubynative' PACKAGE_VERSION='1.0.0' PACKAGE_STRING='hyperestraier-rubynative 1.0.0' PACKAGE_BUGREPORT='' ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS RUBY RDOC MYRBLIBDIR MYRUNPATH LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures hyperestraier-rubynative 1.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of hyperestraier-rubynative 1.0.0:";; esac cat <<\_ACEOF _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF hyperestraier-rubynative configure 1.0.0 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by hyperestraier-rubynative $as_me 1.0.0, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Export variables RUBY="ruby" RDOC="rdoc" MYRBLIBDIR=/usr/local/lib/ruby/site_ruby MYRUNPATH="" # Building paths pathtmp="$PATH" PATH="..:$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin" PATH="$PATH:/usr/ccs/bin:/usr/ucb:/usr/xpg4/bin:/usr/xpg6/bin:$pathtmp" LIBRARY_PATH="..:$HOME/lib:/usr/local/lib:$LIBRARY_PATH" LD_LIBRARY_PATH="..:$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH" CPATH="..:$HOME/include:/usr/local/include:$CPATH" PKG_CONFIG_PATH="..:$HOME/lib/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH if type pkg-config > /dev/null 2>&1 then PATH="$PATH:`pkg-config --variable=bindir qdbm`" PATH="$PATH:`pkg-config --variable=bindir hyperestraier`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir hyperestraier`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir hyperestraier`" CPATH="$CPATH:`pkg-config --variable=includedir qdbm`" CPATH="$CPATH:`pkg-config --variable=includedir hyperestraier`" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH fi # Setting the default prefix if test "$prefix" = NONE then prefix=`ruby -rrbconfig -e 'puts(Config::CONFIG.fetch("prefix"))'` fi #================================================================ # Checking Commands and Libraries #================================================================ # Ruby interpreter printf 'checking RUBY... ' if which ruby > /dev/null then RUBY=`which ruby` fi printf '%s\n' "$RUBY" # Other building tools printf 'checking RDOC... ' if which rdoc > /dev/null then RDOC=`which rdoc` fi printf '%s\n' "$RDOC" # Librarh path myrblibdir=`ruby -rrbconfig -e 'puts(Config::CONFIG.fetch("sitelibdir"))'` if test -n "$myrblibdir" then MYRBLIBDIR="$myrblibdir" fi # Checking the version of QDBM with pkg-config if type pkg-config > /dev/null 2>&1 && pkg-config --atleast-version=1.0.0 qdbm then MYRUNPATH="$MYRUNPATH:`pkg-config --variable=libdir qdbm`" fi #================================================================ # Generic Settings #================================================================ # Export variables # Targets ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by hyperestraier-rubynative $as_me 1.0.0, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ hyperestraier-rubynative config.status 1.0.0 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@RUBY@,$RUBY,;t t s,@RDOC@,$RDOC,;t t s,@MYRBLIBDIR@,$MYRBLIBDIR,;t t s,@MYRUNPATH@,$MYRUNPATH,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi # END OF FILE hyperestraier-1.4.13/rubynative/configure.in000066400000000000000000000052241125261632700211770ustar00rootroot00000000000000# Source of configuration for the Ruby binding of Hyper Estraier #================================================================ # Generic Settings #================================================================ # Targets AC_INIT(hyperestraier-rubynative, 1.0.0) # Export variables RUBY="ruby" RDOC="rdoc" MYRBLIBDIR=/usr/local/lib/ruby/site_ruby MYRUNPATH="" # Building paths pathtmp="$PATH" PATH="..:$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin" PATH="$PATH:/usr/ccs/bin:/usr/ucb:/usr/xpg4/bin:/usr/xpg6/bin:$pathtmp" LIBRARY_PATH="..:$HOME/lib:/usr/local/lib:$LIBRARY_PATH" LD_LIBRARY_PATH="..:$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH" CPATH="..:$HOME/include:/usr/local/include:$CPATH" PKG_CONFIG_PATH="..:$HOME/lib/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH if type pkg-config > /dev/null 2>&1 then PATH="$PATH:`pkg-config --variable=bindir qdbm`" PATH="$PATH:`pkg-config --variable=bindir hyperestraier`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir hyperestraier`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir hyperestraier`" CPATH="$CPATH:`pkg-config --variable=includedir qdbm`" CPATH="$CPATH:`pkg-config --variable=includedir hyperestraier`" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH fi # Setting the default prefix if test "$prefix" = NONE then prefix=`ruby -rrbconfig -e 'puts(Config::CONFIG.fetch("prefix"))'` fi #================================================================ # Checking Commands and Libraries #================================================================ # Ruby interpreter printf 'checking RUBY... ' if which ruby > /dev/null then RUBY=`which ruby` fi printf '%s\n' "$RUBY" # Other building tools printf 'checking RDOC... ' if which rdoc > /dev/null then RDOC=`which rdoc` fi printf '%s\n' "$RDOC" # Librarh path myrblibdir=`ruby -rrbconfig -e 'puts(Config::CONFIG.fetch("sitelibdir"))'` if test -n "$myrblibdir" then MYRBLIBDIR="$myrblibdir" fi # Checking the version of QDBM with pkg-config if type pkg-config > /dev/null 2>&1 && pkg-config --atleast-version=1.0.0 qdbm then MYRUNPATH="$MYRUNPATH:`pkg-config --variable=libdir qdbm`" fi #================================================================ # Generic Settings #================================================================ # Export variables AC_SUBST(RUBY) AC_SUBST(RDOC) AC_SUBST(MYRBLIBDIR) AC_SUBST(MYRUNPATH) # Targets AC_OUTPUT(Makefile) # END OF FILE hyperestraier-1.4.13/rubynative/estcmd.rb000077500000000000000000000362451125261632700205040ustar00rootroot00000000000000#! /usr/bin/ruby -w #-- # Ruby binding of Hyper Estraier # Copyright (C) 2004-2007 Mikio Hirabayashi # This file is part of Hyper Estraier. # Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper # Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, # Boston, MA 02111-1307 USA. $:.unshift("./src") require "estraier" include Estraier # global constants PROTVER = "1.0" SEARCHMAX = 10 SEARCHAUX = 32 SNIPWWIDTH = 480 SNIPHWIDTH = 96 SNIPAWIDTH = 96 VM_ID = 0 VM_URI = 1 VM_ATTR = 2 VM_FULL = 3 VM_SNIP = 4 # main routine def main(args) usage if args.length < 1 rv = 0 case args[0] when "put" rv = runput(args) when "out" rv = runout(args) when "edit" rv = runedit(args) when "get" rv = runget(args) when "uriid" rv = runuriid(args) when "inform" rv = runinform(args) when "optimize" rv = runoptimize(args) when "merge" rv = runmerge(args) when "search" rv = runsearch(args) else usage end return rv end # print usage and exit def usage() STDERR.printf("%s: command line utility for the core API of Hyper Estraier\n", $0) STDERR.printf("\n") STDERR.printf("usage:\n") STDERR.printf(" %s put [-cl] [-ws] db [file]\n", $0) STDERR.printf(" %s out [-cl] db expr\n", $0) STDERR.printf(" %s edit db expr name [value]\n", $0) STDERR.printf(" %s get db expr [attr]\n", $0) STDERR.printf(" %s uriid db uri\n", $0) STDERR.printf(" %s inform db\n", $0) STDERR.printf(" %s optimize [-onp] [-ond] db\n", $0) STDERR.printf(" %s merge [-cl] db target\n", $0) STDERR.printf(" %s search [-vu|-va|-vf|-vs] [-gs|-gf|-ga] [-cd] [-ni] [-sf|-sfr|-sfu|-sfi]" \ " [-attr expr] [-ord expr] [-max num] [-sk num] [-aux num] [-dis name]" \ " db [phrase]\n", $0) STDERR.printf("\n") exit(1) end # print error string and flush the buffer */ def printerror(msg) STDERR.printf("%s: ERROR: %s\n", $0, msg) STDERR.flush end # parse arguments of the put command def runput(args) dbname = nil file = nil opts = 0 i = 1 while i < args.length if !dbname && args[i] =~ /^-/ if args[i] == "-cl" opts |= Database::PDCLEAN elsif args[i] == "-ws" opts |= Database::PDWEIGHT else usage end elsif !dbname dbname = args[i] elsif !file file = args[i] else usage end i += 1 end usage if !dbname procput(dbname, file, opts) end # parse arguments of the out command def runout(args) dbname = nil expr = nil opts = 0 i = 1 while i < args.length if !dbname && args[i] =~ /^-/ if args[i] == "-cl" opts |= Database::ODCLEAN else usage end elsif !dbname dbname = args[i] elsif !expr expr = args[i] else usage end i += 1 end usage if !dbname || !expr procout(dbname, expr, opts) end # parse arguments of the edit command def runedit(args) dbname = nil expr = nil name = nil value = nil i = 1 while i < args.length if !dbname && args[i] =~ /^-/ usage elsif !dbname dbname = args[i] elsif !expr expr = args[i] elsif !name name = args[i] elsif !value value = args[i] else usage end i += 1 end usage if !dbname || !expr || !name procedit(dbname, expr, name, value) end # parse arguments of the get command def runget(args) dbname = nil expr = nil attr = nil i = 1 while i < args.length if !dbname && args[i] =~ /^-/ usage elsif !dbname dbname = args[i] elsif !expr expr = args[i] elsif !attr attr = args[i] else usage end i += 1 end usage if !dbname || !expr procget(dbname, expr, attr) end # parse arguments of the uriid command def runuriid(args) dbname = nil uri = nil i = 1 while i < args.length if !dbname && args[i] =~ /^-/ usage elsif !dbname dbname = args[i] elsif !uri uri = args[i] else usage end i += 1 end usage if !dbname || !uri procuriid(dbname, uri) end # parse arguments of the inform command def runinform(args) dbname = nil i = 1 while i < args.length if !dbname && args[i] =~ /^-/ usage elsif !dbname dbname = args[i] else usage end i += 1 end usage if !dbname procinform(dbname) end # parse arguments of the optimize command def runoptimize(args) dbname = nil opts = 0 i = 1 while i < args.length if !dbname && args[i] =~ /^-/ if args[i] == "-onp" opts |= Database::OPTNOPURGE elsif args[i] == "-ond" opts |= Database::OPTNODBOPT else usage end elsif !dbname dbname = args[i] else usage end i += 1 end usage if !dbname procoptimize(dbname, opts) end # parse arguments of the merge command def runmerge(args) dbname = nil tgname = nil opts = 0 i = 1 while i < args.length if !dbname && args[i] =~ /^-/ if args[i] == "-cl" opts |= Database::MGCLEAN else usage end elsif !dbname dbname = args[i] elsif !tgname tgname = args[i] else usage end i += 1 end usage if !dbname || !tgname procmerge(dbname, tgname, opts) end # parse arguments of the search command def runsearch(args) dbname = nil phrase = nil attrs = [] ord = nil max = SEARCHMAX skip = 0 opts = 0 aux = SEARCHAUX dis = nil cd = false view = VM_ID i = 1 while i < args.length if !dbname && args[i] =~ /^-/ if args[i] == "-vu" view = VM_URI elsif args[i] == "-va" view = VM_ATTR elsif args[i] == "-vf" view = VM_FULL elsif args[i] == "-vs" view = VM_SNIP elsif args[i] == "-gs" opts |= Condition::SURE elsif args[i] == "-gf" opts |= Condition::FAST elsif args[i] == "-ga" opts |= Condition::AGITO elsif args[i] == "-cd" cd = true elsif args[i] == "-ni" opts |= Condition::NOIDF elsif args[i] == "-sf" opts |= Condition::SIMPLE elsif args[i] == "-sfr" opts |= Condition::ROUGH elsif args[i] == "-sfu" opts |= Condition::UNION elsif args[i] == "-sfi" opts |= Condition::ISECT elsif args[i] == "-attr" usage if (i += 1) >= args.length attrs.push(args[i]) elsif args[i] == "-ord" usage if (i += 1) >= args.length ord = args[i] elsif args[i] == "-max" usage if (i += 1) >= args.length max = args[i].to_i elsif args[i] == "-sk" usage if (i += 1) >= args.length skip = args[i].to_i elsif args[i] == "-aux" usage if (i += 1) >= args.length aux = args[i].to_i elsif args[i] == "-dis" usage if (i += 1) >= args.length dis = args[i] else usage end elsif !dbname dbname = args[i] elsif !phrase phrase = args[i] else phrase += " " + args[i] end i += 1 end usage if !dbname procsearch(dbname, phrase, attrs, ord, max, skip, opts, aux, dis, cd, view) end # perform the put command def procput(dbname, file, opts) if file begin ifp = open(file, "rb") draft = ifp.read rescue printerror(file + ": could not open") return 1 ensure ifp.close if ifp end else STDIN.binmode draft = STDIN.read end doc = Document::new(draft) db = Database::new unless db.open(dbname, Database::DBWRITER | Database::DBCREAT) printerror(dbname + ": " + db.err_msg(db.error)) return 1 end db.set_informer(Informer::new) unless db.put_doc(doc, opts) printerror(dbname + ": " + db.err_msg(db.error)) db.close return 1 end unless db.close printerror(dbname + ": " + db.err_msg(db.error)) return 1 end return 0 end # perform the out command def procout(dbname, expr, opts) db = Database::new unless db.open(dbname, Database::DBWRITER) printerror(dbname + ": " + db.err_msg(db.error)) return 1 end db.set_informer(Informer::new) id = expr.to_i if id < 1 && (id = db.uri_to_id(expr)) < 1 printerror(dbname + ": " + db.err_msg(db.error)) db.close return 1 end unless db.out_doc(id, opts) printerror(dbname + ": " + db.err_msg(db.error)) db.close return 1 end unless db.close printerror(dbname + ": " + db.err_msg(db.error)) return 1 end return 0 end # perform the edit command def procedit(dbname, expr, name, value) db = Database::new unless db.open(dbname, Database::DBWRITER) printerror(dbname + ": " + db.err_msg(db.error)) return 1 end db.set_informer(Informer::new) id = expr.to_i if id < 1 && (id = db.uri_to_id(expr)) < 1 printerror(dbname + ": " + db.err_msg(db.error)) db.close return 1 end unless doc = db.get_doc(id, Database::GDNOTEXT) printerror(dbname + ": " + db.err_msg(db.error)) db.close return 1 end doc.add_attr(name, value) unless db.edit_doc(doc) printerror(dbname + ": " + db.err_msg(db.error)) db.close return 1 end unless db.close printerror(dbname + ": " + db.err_msg(db.error)) return 1 end return 0 end # perform the get command def procget(dbname, expr, attr) db = Database::new unless db.open(dbname, Database::DBREADER) printerror(dbname + ": " + db.err_msg(db.error)) return 1 end id = expr.to_i if id < 1 && (id = db.uri_to_id(expr)) < 1 printerror(dbname + ": " + db.err_msg(db.error)) db.close return 1 end if attr unless value = db.get_doc_attr(id, attr) printerror(dbname + ": " + db.err_msg(db.error)) db.close return 1 end printf("%s\n", value) else unless doc = db.get_doc(id, 0) printerror(dbname + ": " + db.err_msg(db.error)) db.close return 1 end printf("%s", doc.dump_draft) end unless db.close printerror(dbname + ": " + db.err_msg(db.error)) return 1 end return 0 end # perform the uriid command def procuriid(dbname, uri) db = Database::new unless db.open(dbname, Database::DBREADER) printerror(dbname + ": " + db.err_msg(db.error)) return 1 end unless (id = db.uri_to_id(uri)) > 0 printerror(dbname + ": " + db.err_msg(db.error)) db.close return 1 end printf("%d\n", id) unless db.close printerror(dbname + ": " + db.err_msg(db.error)) return 1 end return 0 end # perform the inform command def procinform(dbname) db = Database::new unless db.open(dbname, Database::DBREADER) printerror(dbname + ": " + db.err_msg(db.error)) return 1 end printf("number of documents: %d\n", db.doc_num) printf("number of words: %d\n", db.word_num) printf("file size: %d\n", db.size.to_i) unless db.close printerror(dbname + ": " + db.err_msg(db.error)) return 1 end return 0 end # perform the optimize command def procoptimize(dbname, opts) db = Database::new unless db.open(dbname, Database::DBWRITER) printerror(dbname + ": " + db.err_msg(db.error)) return 1 end db.set_informer(Informer::new) unless db.optimize(opts) printerror(dbname + ": " + db.err_msg(db.error)) db.close return 1 end unless db.close printerror(dbname + ": " + db.err_msg(db.error)) return 1 end return 0 end # perform the merge command def procmerge(dbname, tgname, opts) db = Database::new unless db.open(dbname, Database::DBWRITER) printerror(dbname + ": " + db.err_msg(db.error)) return 1 end db.set_informer(Informer::new) unless db.merge(tgname, opts) printerror(dbname + ": " + db.err_msg(db.error)) db.close return 1 end unless db.close printerror(dbname + ": " + db.err_msg(db.error)) return 1 end return 0 end # perform the search command def procsearch(dbname, phrase, attrs, ord, max, skip, opts, aux, dis, cd, view) db = Database::new unless db.open(dbname, Database::DBREADER) printerror(dbname + ": " + db.err_msg(db.error)) return 1 end cond = Condition::new() cond.set_phrase(phrase) if phrase for i in 0...attrs.length cond.add_attr(attrs[i]) end cond.set_order(ord) if ord cond.set_max(max) if max >= 0 cond.set_skip(skip) if skip >= 0 cond.set_options(opts) cond.set_auxiliary(aux) cond.set_distinct(dis) if dis stime = Time::now.to_f res = db.search(cond) etime = Time::now.to_f border = "--------[" + Time::now.to_f.to_s.gsub(/\./, "") + "]--------" printf("%s\n", border) printf("VERSION\t%s\n", PROTVER) printf("NODE\tlocal\n") printf("HIT\t%d\n", res.hint("")) snwords = [] words = res.hint_words for i in 0...words.length word = words[i] hits = res.hint(word) snwords.push(word) if hits > 0 printf("HINT#%d\t%s\t%d\n", i + 1, word, hits) end printf("TIME\t%0.3f\n", etime - stime) printf("DOCNUM\t%d\n", db.doc_num()) printf("WORDNUM\t%d\n", db.word_num()) if view == VM_URI printf("VIEW\tURI\n") elsif view == VM_ATTR printf("VIEW\tATTRIBUTE\n") elsif view == VM_FULL printf("VIEW\tFULL\n") elsif view == VM_SNIP printf("VIEW\tSNIPPET\n") else printf("VIEW\tID\n") end printf("\n") printf("%s\n", border) if view != VM_ATTR && view != VM_FULL && view != VM_SNIP dnum = res.doc_num() for i in 0...dnum id = res.get_doc_id(i) if view == VM_URI next unless doc = db.get_doc(id, cd ? 0 : Database::GDNOTEXT) next if cd && !db.scan_doc(doc, cond) printf("%d\t%s\n", id, doc.attr("@uri")) elsif view == VM_ATTR next unless doc = db.get_doc(id, cd ? 0 : Database::GDNOTEXT) next if cd && !db.scan_doc(doc, cond) printf("%s\n", border) names = doc.attr_names() for j in 0...names.length printf("%s=%s\n", names[j], doc.attr(names[j])) end printf("\n") elsif view == VM_FULL next unless doc = db.get_doc(id, 0) next if cd && !db.scan_doc(doc, cond) printf("%s\n", border) printf("%s", doc.dump_draft()) elsif view == VM_SNIP next unless doc = db.get_doc(id, 0) next if cd && !db.scan_doc(doc, cond) printf("%s\n", border) names = doc.attr_names() for j in 0...names.length printf("%s=%s\n", names[j], doc.attr(names[j])) end printf("\n") printf("%s", doc.make_snippet(snwords, SNIPWWIDTH, SNIPHWIDTH, SNIPAWIDTH)) else printf("%d\n", id) end end printf("%s:END\n", border) unless db.close printerror(dbname + ": " + db.err_msg(db.error)) return 1 end return 0 end # class for callback function for database events class Informer def inform(message) printf("%s: INFO: %s\n", $0, message) end end # perform the main routine $0.gsub!(/.*\//, "") exit(main(ARGV)) # END OF FILE hyperestraier-1.4.13/rubynative/estraier-doc.rb000066400000000000000000000570541125261632700216040ustar00rootroot00000000000000#-- # Ruby binding of Hyper Estraier # Copyright (C) 2004-2007 Mikio Hirabayashi # This file is part of Hyper Estraier. # Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper # Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, # Boston, MA 02111-1307 USA. #++ #:include:overview # # Module for the namespace of Hyper Estraier # module Estraier #---------------------------------------------------------------- #++ Abstraction of document. #---------------------------------------------------------------- class Document #-------------------------------- # public methods #-------------------------------- public # Add an attribute. # `name' specifies the name of an attribute. # `value' specifies the value of the attribute. If it is `nil', the attribute is removed. # The return value is always `nil'. def add_attr(name, value) # native code ... end # Add a sentence of text. # `text' specifies a sentence of text. # The return value is always `nil'. def add_text(text) # native code ... end # Add a hidden sentence. # `text' specifies a hidden sentence. # The return value is always `nil'. def add_hidden_text(text) # native code ... end # Attach keywords. # `kwords' specifies a hash object of keywords. Keys of the hash should be keywords of the # document and values should be their scores in decimal string. # The return value is always `nil'. def set_keywords(kwords) # native code ... end # Set the substitute score. # `score' specifies the substitute score. It it is negative, the substitute score setting is # nullified. # The return value is always `nil'. def set_score(score) # native code ... end # Get the ID number. # The return value is the ID number of the document object. If the object has never been # registered, -1 is returned. def id() # native code ... end # Get an array of attribute names of a document object. # The return value is an array object of attribute names. def attr_names() # native code ... end # Get the value of an attribute. # `name' specifies the name of an attribute. # The return value is the value of the attribute or `nil' if it does not exist. def attr(name) # native code ... end # Get an array of sentences of the text. # The return value is an array object of sentences of the text. def texts() # native code ... end # Concatenate sentences of the text of a document object. # The return value is concatenated sentences. def cat_texts() # native code ... end # Get attached keywords. # The return value is a hash object of keywords and their scores in decimal string. If no # keyword is attached, `nil' is returned. def keywords() # native code ... end # Get the substitute score. # The return value is the substitute score or -1 if it is not set. def score() # native code ... end # Dump draft data of a document object. # The return value is draft data. def dump_draft() # native code ... end # Make a snippet of the body text. # `words' specifies an array object of words to be highlight. # `wwidth' specifies whole width of the result. # `hwidth' specifies width of strings picked up from the beginning of the text. # `awidth' width of strings picked up around each highlighted word. # The return value is a snippet string of the body text. There are tab separated values. # Each line is a string to be shown. Though most lines have only one field, some lines have # two fields. If the second field exists, the first field is to be shown with highlighted, # and the second field means its normalized form. def make_snippet(words, wwidth, hwidth, awidth) # native code ... end #-------------------------------- # private methods #-------------------------------- private # Create a document object. # `draft' specifies a string of draft data. def initialize(draft = "") # native code ... end end #---------------------------------------------------------------- #++ Abstraction of search condition. #---------------------------------------------------------------- class Condition #-------------------------------- # public constants #-------------------------------- public # option: check every N-gram key SURE = 1 << 0 # option: check N-gram keys skipping by one USUAL = 1 << 1 # option: check N-gram keys skipping by two FAST = 1 << 2 # option: check N-gram keys skipping by three AGITO = 1 << 3 # option: without TF-IDF tuning NOIDF = 1 << 4 # option: with the simplified phrase SIMPLE = 1 << 10 # option: with the rough phrase ROUGH = 1 << 11 # option: with the union phrase UNION = 1 << 15 # option: with the intersection phrase ISECT = 1 << 16 # eclipse tuning: consider URL ECLSIMURL = 10.0 # eclipse tuning: on server basis ECLSERV = 100.0 # eclipse tuning: on directory basis ECLDIR = 101.0 # eclipse tuning: on file basis ECLFILE = 102.0 #-------------------------------- # public methods #-------------------------------- public # Set the search phrase. # `phrase' specifies a search phrase. # The return value is always `nil'. def set_phrase(phrase) # native code ... end # Add an expression for an attribute. # `expr' specifies an expression for an attribute. # The return value is always `nil'. def add_attr(expr) # native code ... end # Set the order of a condition object. # `expr' specifies an expression for the order. By default, the order is by score descending. # The return value is always `nil'. def set_order(expr) # native code ... end # Set the maximum number of retrieval. # `max' specifies the maximum number of retrieval. By default, the number of retrieval is # not limited. # The return value is always `nil'. def set_max(max) # native code ... end # Set the number of skipped documents. # `skip' specifies the number of documents to be skipped in the search result. # The return value is always `nil'. def set_skip(skip) # native code ... end # Set options of retrieval. # `options' specifies options: `Condition::SURE' specifies that it checks every N-gram # key, `Condition::USU', which is the default, specifies that it checks N-gram keys # with skipping one key, `Condition::FAST' skips two keys, `Condition::AGITO' # skips three keys, `Condition::NOIDF' specifies not to perform TF-IDF tuning, # `Condition::SIMPLE' specifies to use simplified phrase, `Condition::ROUGH' specifies to use # rough phrase, `Condition::UNION' specifies to use union phrase, `Condition::ISECT' specifies # to use intersection phrase. Each option can be specified at the same time by bitwise or. # If keys are skipped, though search speed is improved, the relevance ratio grows less. # The return value is always `nil'. def set_options(options) # native code ... end # Set permission to adopt result of the auxiliary index. # `min' specifies the minimum hits to adopt result of the auxiliary index. If it is not more # than 0, the auxiliary index is not used. By default, it is 32. # The return value is always `nil'. def set_auxiliary(min) # native code ... end # Set the lower limit of similarity eclipse. # `limit' specifies the lower limit of similarity for documents to be eclipsed. Similarity is # between 0.0 and 1.0. If the limit is added by `Condition::ECLSIMURL', similarity is # weighted by URL. If the limit is `Condition::ECLSERV', similarity is ignored and documents # in the same server are eclipsed. If the limit is `Condition::ECLDIR', similarity is ignored # and documents in the same directory are eclipsed. If the limit is `Condition::ECLFILE', # similarity is ignored and documents of the same file are eclipsed. # The return value is always `nil'. def set_eclipse(limit) # native code ... end # Set the attribute distinction filter. # `name' specifies the name of an attribute to be distinct. # The return value is always `nil'. def set_distinct(name) end # Set the mask of targets of meta search. # `mask' specifies a masking number. 1 means the first target, 2 means the second target, 4 # means the third target, and power values of 2 and their summation compose the mask. # The return value is always `nil'. def set_mask(mask) # native code ... end #-------------------------------- # private methods #-------------------------------- private # Create a search condition object. def initialize() # native code ... end end #---------------------------------------------------------------- #++ Abstraction of result set from database. #---------------------------------------------------------------- class Result #-------------------------------- # public methods #-------------------------------- public # Get the number of documents. # The return value is the number of documents in the result. def doc_num() # native code ... end # Get the ID number of a document. # `index' specifies the index of a document. # The return value is the ID number of the document or -1 if the index is out of bounds. def get_doc_id(index) # native code ... end # Get the index of the container database of a document. # `index' specifies the index of a document. # The return value is the index of the container database of the document or -1 if the index # is out of bounds. def get_dbidx(index) # native code ... end # Get an array of hint words. # The return value is an array of hint words. def hint_words() # native code ... end # Get the value of a hint word. # `word' specifies a hint word. An empty string means the number of whole result. # The return value is the number of documents corresponding the hint word. If the word is # in a negative condition, the value is negative. def hint(word) # native code ... end # Get the score of a document. # `index' specifies the index of a document. # The return value is the score of the document or -1 if the index is out of bounds. def get_score(index) # native code ... end # Get an array of ID numbers of eclipsed docuemnts of a document. # `id' specifies the ID number of a parent document. # The return value is an array whose elements expresse the ID numbers and their scores # alternately. def get_shadows(id) # native code ... end #-------------------------------- # private methods #-------------------------------- private # Create a result set object. def initialize() # native code ... end end #---------------------------------------------------------------- #++ Abstraction of database. #---------------------------------------------------------------- class Database #-------------------------------- # public constants #-------------------------------- public # version of Hyper Estraier VERSION = "0.0.0" # error code: no error ERRNOERR = 0 # error code: invalid argument ERRINVAL = 1 # error code: access forbidden ERRACCES = 2 # error code: lock failure ERRLOCK = 3 # error code: database problem ERRDB = 4 # error code: I/O problem ERRIO = 5 # error code: no item ERRNOITEM = 6 # error code: miscellaneous ERRMISC = 9999 # open mode: open as a reader DBREADER = 1 << 0 # open mode: open as a writer DBWRITER = 1 << 1 # open mode: a writer creating DBCREAT = 1 << 2 # open mode: a writer truncating DBTRUNC = 1 << 3 # open mode: open without locking DBNOLCK = 1 << 4 # open mode: lock without blocking DBLCKNB = 1 << 5 # open mode: use perfect N-gram analyzer DBPERFNG = 1 << 10 # open mode: use character category analyzer DBCHRCAT = 1 << 11 # open mode: small tuning DBSMALL = 1 << 20 # open mode: large tuning DBLARGE = 1 << 21 # open mode: huge tuning DBHUGE = 1 << 22 # open mode: huge tuning second DBHUGE2 = 1 << 23 # open mode: huge tuning third DBHUGE3 = 1 << 24 # open mode: store scores as void DBSCVOID = 1 << 25 # open mode: store scores as integer DBSCINT = 1 << 26 # open mode: refrain from adjustment of scores DBSCASIS = 1 << 27 # attribute index type: for multipurpose sequencial access method IDXATTRSEQ = 0 # attribute index type: for narrowing with attributes as strings IDXATTRSTR = 1 # attribute index type: for narrowing with attributes as numbers IDXATTRNUM = 2 # optimize option: omit purging dispensable region of deleted OPTNOPURGE = 1 << 0 # optimize option: omit optimization of the database files OPTNODBOPT = 1 << 1 # merge option: clean up dispensable regions MGCLEAN = 1 << 0 # put_doc option: clean up dispensable regions PDCLEAN = 1 << 0 # put_doc option: weight scores statically when indexing PDWEIGHT = 1 << 1 # out_doc option: clean up dispensable regions ODCLEAN = 1 << 0 # get_doc option: no attributes GDNOATTR = 1 << 0 # get_doc option: no text GDNOTEXT = 1 << 1 # get_doc option: no keywords GDNOKWD = 1 << 2 #-------------------------------- # public class methods #-------------------------------- public # Search plural databases for documents corresponding a condition. # `dbs' specifies an array whose elements are database objects. # `cond' specifies a condition object. # The return value is a result object. On error, `nil' is returned. def self.search_meta(dbs, cond) # native code ... end #-------------------------------- # public methods #-------------------------------- public # Get the string of an error code. # `ecode' specifies an error code. # The return value is the string of the error code. def err_msg(ecode) # native code ... end # Open a database. # `name' specifies the name of a database directory. # `omode' specifies open modes: `Database::DBWRITER' as a writer, `Database::DBREADER' as a # reader. If the mode is `Database::DBWRITER', the following may be added by bitwise or: # `Database::DBCREAT', which means it creates a new database if not exist, # `Database::DBTRUNC', which means it creates a new database regardless if one exists. Both # of `Database::DBREADER' and `Database::DBWRITER' can be added to by bitwise or: # `Database::DBNOLCK', which means it opens a database file without file locking, or # `Database::DBLCKNB', which means locking is performed without blocking. If # `Database::DBNOLCK' is used, the application is responsible for exclusion control. # `Database::DBCREAT' can be added to by bitwise or: `Database::DBPERFNG', which means N-gram # analysis is performed against European text also, `Database::DBCHACAT', which means # character category analysis is performed instead of N-gram analysis, `Database::DBSMALL', # which means the index is tuned to register less than 50000 documents, `Database::DBLARGE', # which means the index is tuned to register more than 300000 documents, `Database::DBHUGE', # which means the index is tuned to register more than 1000000 documents, `Database::DBHUGE2', # which means the index is tuned to register more than 5000000 documents, `Database::DBHUGE3', # which means the index is tuned to register more than 10000000 documents, # `Database::DBSCVOID', which means scores are stored as void, `Database::DBSCINT', which # means scores are stored as 32-bit integer, `Database::DBSCASIS', which means scores are # stored as-is and marked not to be tuned when search. # The return value is true if success, else it is false. def open(name, omode) # native code ... end # Close the database. # The return value is true if success, else it is false. def close() # native code ... end # Get the last happened error code. # The return value is the last happened error code. def error() # native code ... end # Check whether the database has a fatal error. # The return value is true if the database has fatal erroor, else it is false. def fatal() # native code ... end # Add an index for narrowing or sorting with document attributes. # `name' specifies the name of an attribute. # `type' specifies the data type of attribute index; `Database::IDXATTRSEQ' for multipurpose # sequencial access method, `Database::IDXATTRSTR' for narrowing with attributes as strings, # `Database::IDXATTRNUM' for narrowing with attributes as numbers. # The return value is true if success, else it is false. def add_attr_index(name, type) # native code ... end # Flush index words in the cache. # `max' specifies the maximum number of words to be flushed. If it not more than zero, all # words are flushed. # The return value is true if success, else it is false. def flush(max) # native code ... end # Synchronize updating contents. # The return value is true if success, else it is false. def sync() # native code ... end # Optimize the database. # `options' specifies options: `Database::OPTNOPURGE' to omit purging dispensable region of # deleted documents, `Database::OPTNODBOPT' to omit optimization of the database files. The # two can be specified at the same time by bitwise or. # The return value is true if success, else it is false. def optimize(options) # native code ... end # Merge another database. # `name' specifies the name of another database directory. # `options' specifies options: `Database::MGCLEAN' to clean up dispensable regions of the # deleted document. # The return value is true if success, else it is false. def merge(name, options) # native code ... end # Add a document. # `doc' specifies a document object. The document object should have the URI attribute. # `options' specifies options: `Database::PDCLEAN' to clean up dispensable regions of the # overwritten document. # The return value is true if success, else it is false. def put_doc(doc, options) # native code ... end # Remove a document. # `id' specifies the ID number of a registered document. # `options' specifies options: `Database::ODCLEAN' to clean up dispensable regions of the # deleted document. # The return value is true if success, else it is false. def out_doc(id, options) # native code ... end # Edit attributes of a document. # `doc' specifies a document object. # The return value is true if success, else it is false. def edit_doc(doc) # native code ... end # Retrieve a document. # `id' specifies the ID number of a registered document. # `options' specifies options: `Database::GDNOATTR' to ignore attributes, `Database::GDNOTEXT' # to ignore the body text, `Database::GDNOKWD' to ignore keywords. The three can be # specified at the same time by bitwise or. # The return value is a document object. On error, `nil' is returned. def get_doc(id, options) # native code ... end # Retrieve the value of an attribute of a document. # `id' specifies the ID number of a registered document. # `name' specifies the name of an attribute. # The return value is the value of the attribute or `nil' if it does not exist. def get_doc_attr(id, name) # native code ... end # Get the ID of a document specified by URI. # `uri' specifies the URI of a registered document. # The return value is the ID of the document. On error, -1 is returned. def uri_to_id(uri) # native code ... end # Get the name. # The return value is the name of the database. def name() # native code ... end # Get the number of documents. # The return value is the number of documents in the database. def doc_num() # native code ... end # Get the number of unique words. # The return value is the number of unique words in the database. def word_num() # native code ... end # Get the size. # The return value is the size of the database. def size() # native code ... end # Search for documents corresponding a condition. # `cond' specifies a condition object. # The return value is a result object. On error, `nil' is returned. def search(cond) # native code ... end # Check whether a document object matches the phrase of a search condition object definitely. # `doc' specifies a document object. # `cond' specifies a search condition object. # The return value is true if the document matches the phrase of the condition object # definitely, else it is false. def scan_doc(doc, cond) # native code ... end # Set the maximum size of the cache memory. # `size' specifies the maximum size of the index cache. By default, it is 64MB. If it is # not more than 0, the current size is not changed. # `anum' specifies the maximum number of cached records for document attributes. By default, # it is 8192. If it is not more than 0, the current size is not changed. # `tnum' specifies the maximum number of cached records for document texts. By default, it # is 1024. If it is not more than 0, the current size is not changed. # `rnum' specifies the maximum number of cached records for occurrence results. By default, # it is 256. If it is not more than 0, the current size is not changed. # The return value is always `nil'. def set_cache_size(size, anum, tnum, rnum) # native code ... end # Add a pseudo index directory. # `path' specifies the path of a pseudo index directory. # The return value is true if success, else it is false. def add_pseudo_index(path) # native code ... end # Set the maximum number of expansion of wild cards. # `num' specifies the maximum number of expansion of wild cards. # The return value is always `nil'. def set_wildmax(num) # native code ... end # Set the callback function to inform of database events. # `informer' specifies an arbitrary object with a method named as `inform'. The method # should have one parameter for a string of a message of each event. # The return value is always `nil'. def set_informer(informer) # native code ... end #-------------------------------- # private methods #-------------------------------- private # Create a database object. def initialize() # native code ... end end end # END OF FILE hyperestraier-1.4.13/rubynative/example/000077500000000000000000000000001125261632700203165ustar00rootroot00000000000000hyperestraier-1.4.13/rubynative/example/Makefile000066400000000000000000000007721125261632700217640ustar00rootroot00000000000000# Makefile for sample programs of the Ruby binding #================================================================ # Setting Variables #================================================================ # Generic settings SHELL = /bin/sh #================================================================ # Actions #================================================================ all : clean : rm -rf *.exe *.o a.out check.out gmon.out leak.log casket *~ .PHONY : all clean # END OF FILE hyperestraier-1.4.13/rubynative/example/example001.rb000066400000000000000000000014541125261632700225230ustar00rootroot00000000000000require "estraier" include Estraier # create the database object db = Database::new # open the database unless db.open("casket", Database::DBWRITER | Database::DBCREAT) printf("error: %s\n", db.err_msg(db.error)) exit end # create a document object doc = Document::new # add attributes to the document object doc.add_attr("@uri", "http://estraier.gov/example.txt") doc.add_attr("@title", "Over the Rainbow") # add the body text to the document object doc.add_text("Somewhere over the rainbow. Way up high.") doc.add_text("There's a land that I heard of once in a lullaby.") # register the document object to the database unless db.put_doc(doc, Database::PDCLEAN) printf("error: %s\n", db.err_msg(db.error)) end # close the database unless db.close printf("error: %s\n", db.err_msg(db.error)) end hyperestraier-1.4.13/rubynative/example/example002.rb000066400000000000000000000016171125261632700225250ustar00rootroot00000000000000require "estraier" include Estraier # create the database object db = Database::new # open the database unless db.open("casket", Database::DBREADER) printf("error: %s\n", db.err_msg(db.error)) exit end # create a search condition object cond = Condition::new # set the search phrase to the search condition object cond.set_phrase("rainbow AND lullaby") # get the result of search result = db.search(cond) # for each document in the result dnum = result.doc_num for i in 0...dnum # retrieve the document object doc = db.get_doc(result.get_doc_id(i), 0) next unless doc # display attributes uri = doc.attr("@uri") printf("URI: %s\n", uri) if uri title = doc.attr("@title") printf("Title: %s\n", title) if title # display the body text doc.texts.each do |text| printf("%s\n", text) end end # close the database unless db.close printf("error: %s\n", db.err_msg(db.error)) end hyperestraier-1.4.13/rubynative/overview000066400000000000000000000066341125261632700204650ustar00rootroot00000000000000= Ruby Binding of Hyper Estraier Hyper Estraier is a full-text search system for communities. == Introduction This is a package implementing the core API of {Hyper Estraier}[http://hyperestraier.sourceforge.net/], including native codes written in C. As it works on Linux, Mac OS X, Windows, and so on, native libraries for each environment are required to run programs. This package requires Ruby 1.8.4 or later versions. == Setting Install the latest version of Hyper Estraier. Enter the sub directory `rubynative' in the extracted package then perform installation. cd rubynative ./configure make su make install The package `estraier' should be required in each source file of application programs and include the module `Estraier' at pleasure. == Example of Gatherer The following is the simplest implementation of a gatherer. require "estraier" include Estraier # create the database object db = Database::new # open the database unless db.open("casket", Database::DBWRITER | Database::DBCREAT) printf("error: %s\n", db.err_msg(db.error)) exit end # create a document object doc = Document::new # add attributes to the document object doc.add_attr("@uri", "http://estraier.gov/example.txt") doc.add_attr("@title", "Over the Rainbow") # add the body text to the document object doc.add_text("Somewhere over the rainbow. Way up high.") doc.add_text("There's a land that I heard of once in a lullaby.") # register the document object to the database unless db.put_doc(doc, Database::PDCLEAN) printf("error: %s\n", db.err_msg(db.error)) end # close the database unless db.close printf("error: %s\n", db.err_msg(db.error)) end ==Example of Searcher The following is the simplest implementation of a searcher. require "estraier" include Estraier # create the database object db = Database::new # open the database unless db.open("casket", Database::DBREADER) printf("error: %s\n", db.err_msg(db.error)) exit end # create a search condition object cond = Condition::new # set the search phrase to the search condition object cond.set_phrase("rainbow AND lullaby") # get the result of search result = db.search(cond) # for each document in the result dnum = result.doc_num for i in 0...dnum # retrieve the document object doc = db.get_doc(result.get_doc_id(i), 0) next unless doc # display attributes uri = doc.attr("@uri") printf("URI: %s\n", uri) if uri title = doc.attr("@title") printf("Title: %s\n", title) if title # display the body text doc.texts.each do |text| printf("%s\n", text) end end # close the database unless db.close printf("error: %s\n", db.err_msg(db.error)) end == License Copyright (C) 2004-2006 Mikio Hirabayashi All rights reserved. Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. hyperestraier-1.4.13/rubynative/src/000077500000000000000000000000001125261632700174525ustar00rootroot00000000000000hyperestraier-1.4.13/rubynative/src/estraier.c000066400000000000000000001116131125261632700214370ustar00rootroot00000000000000/************************************************************************************************* * Ruby binding of Hyper Estraier * Copyright (C) 2004-2005 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #include "ruby.h" #include #include #include #include #define VNDATA "@ptr" #define VNINFO "@informer" #define VNCOND "@cond" typedef struct { int *ids; int *dbidxs; int num; CBMAP *hints; } ESTRES; typedef struct { ESTMTDB *db; int ecode; } ESTDBMGR; /* private function prototypes */ static void doc_init(void); static VALUE doc_initialize(int argc, VALUE *argv, VALUE vself); static VALUE doc_add_attr(VALUE vself, VALUE vname, VALUE vvalue); static VALUE doc_add_text(VALUE vself, VALUE vtext); static VALUE doc_add_hidden_text(VALUE vself, VALUE vtext); static VALUE doc_set_keywords(VALUE vself, VALUE vkwords); static VALUE doc_set_score(VALUE vself, VALUE vscore); static VALUE doc_id(VALUE vself); static VALUE doc_attr_names(VALUE vself); static VALUE doc_attr(VALUE vself, VALUE vname); static VALUE doc_texts(VALUE vself); static VALUE doc_cat_texts(VALUE vself); static VALUE doc_keywords(VALUE vself); static VALUE doc_score(VALUE vself); static VALUE doc_dump_draft(VALUE vself); static VALUE doc_make_snippet(VALUE vself, VALUE vwords, VALUE vwwidth, VALUE vhwidth, VALUE vawidth); static void cond_init(void); static VALUE cond_initialize(VALUE vself); static VALUE cond_set_phrase(VALUE vself, VALUE vphrase); static VALUE cond_add_attr(VALUE vself, VALUE vexpr); static VALUE cond_set_order(VALUE vself, VALUE vexpr); static VALUE cond_set_max(VALUE vself, VALUE vmax); static VALUE cond_set_skip(VALUE vself, VALUE vskip); static VALUE cond_set_options(VALUE vself, VALUE voptions); static VALUE cond_set_auxiliary(VALUE vself, VALUE vmin); static VALUE cond_set_eclipse(VALUE vself, VALUE vlimit); static VALUE cond_set_distinct(VALUE vself, VALUE vname); static VALUE cond_set_mask(VALUE vself, VALUE vmask); static void res_init(void); static VALUE res_initialize(VALUE vself); static ESTRES *est_res_new(void); static void est_res_delete(ESTRES *res); static VALUE res_doc_num(VALUE vself); static VALUE res_get_doc_id(VALUE vself, VALUE vindex); static VALUE res_get_dbidx(VALUE vself, VALUE vindex); static VALUE res_hint_words(VALUE vself); static VALUE res_hint(VALUE vself, VALUE vword); static VALUE res_get_score(VALUE vself, VALUE vindex); static VALUE res_get_shadows(VALUE vself, VALUE vid); static void db_init(void); static VALUE db_initialize(VALUE vself); static ESTDBMGR *est_dbmgr_new(void); static void est_dbmgr_delete(ESTDBMGR *db); static VALUE db_search_meta(VALUE vself, VALUE vdbs, VALUE vcond); static VALUE db_err_msg(VALUE vself, VALUE vecode); static VALUE db_open(VALUE vself, VALUE vname, VALUE vomode); static VALUE db_close(VALUE vself); static VALUE db_error(VALUE vself); static VALUE db_fatal(VALUE vself); static VALUE db_add_attr_index(VALUE vself, VALUE vname, VALUE vtype); static VALUE db_flush(VALUE vself, VALUE vmax); static VALUE db_sync(VALUE vself); static VALUE db_optimize(VALUE vself, VALUE voptions); static VALUE db_merge(VALUE vself, VALUE vname, VALUE voptions); static VALUE db_put_doc(VALUE vself, VALUE vdoc, VALUE voptions); static VALUE db_out_doc(VALUE vself, VALUE vid, VALUE voptions); static VALUE db_edit_doc(VALUE vself, VALUE vdoc); static VALUE db_get_doc(VALUE vself, VALUE vid, VALUE voptions); static VALUE db_get_doc_attr(VALUE vself, VALUE vid, VALUE vname); static VALUE db_uri_to_id(VALUE vself, VALUE vuri); static VALUE db_name(VALUE vself); static VALUE db_doc_num(VALUE vself); static VALUE db_word_num(VALUE vself); static VALUE db_size(VALUE vself); static VALUE db_search(VALUE vself, VALUE vcond); static VALUE db_scan_doc(VALUE vself, VALUE vdoc, VALUE vcond); static VALUE db_set_cache_size(VALUE vself, VALUE vsize, VALUE vanum, VALUE vtnum, VALUE vrnum); static VALUE db_add_pseudo_index(VALUE vself, VALUE vpath); static VALUE db_set_wildmax(VALUE vself, VALUE vnum); static VALUE db_set_informer(VALUE vself, VALUE vinformer); static VALUE cblisttoobj(const CBLIST *list); static CBLIST *objtocblist(VALUE obj); static VALUE cbmaptoobj(CBMAP *map); static CBMAP *objtocbmap(VALUE obj); static void db_informer(const char *message, void *opaque); static VALUE db_informer_process(VALUE arg); static VALUE db_informer_resque(VALUE arg); /************************************************************************************************* * public objects *************************************************************************************************/ VALUE mod_estraier; VALUE cls_doc; VALUE cls_doc_data; VALUE cls_cond; VALUE cls_cond_data; VALUE cls_res; VALUE cls_res_data; VALUE cls_db; VALUE cls_db_data; int Init_estraier(void){ mod_estraier = rb_define_module("Estraier"); doc_init(); cond_init(); res_init(); db_init(); return 0; } /************************************************************************************************* * private objects *************************************************************************************************/ static void doc_init(void){ cls_doc = rb_define_class_under(mod_estraier, "Document", rb_cObject); cls_doc_data = rb_define_class_under(mod_estraier, "Document_data", rb_cObject); rb_define_private_method(cls_doc, "initialize", doc_initialize, -1); rb_define_method(cls_doc, "add_attr", doc_add_attr, 2); rb_define_method(cls_doc, "add_text", doc_add_text, 1); rb_define_method(cls_doc, "add_hidden_text", doc_add_hidden_text, 1); rb_define_method(cls_doc, "set_keywords", doc_set_keywords, 1); rb_define_method(cls_doc, "set_score", doc_set_score, 1); rb_define_method(cls_doc, "id", doc_id, 0); rb_define_method(cls_doc, "attr_names", doc_attr_names, 0); rb_define_method(cls_doc, "attr", doc_attr, 1); rb_define_method(cls_doc, "texts", doc_texts, 0); rb_define_method(cls_doc, "cat_texts", doc_cat_texts, 0); rb_define_method(cls_doc, "keywords", doc_keywords, 0); rb_define_method(cls_doc, "score", doc_score, 0); rb_define_method(cls_doc, "dump_draft", doc_dump_draft, 0); rb_define_method(cls_doc, "make_snippet", doc_make_snippet, 4); } static VALUE doc_initialize(int argc, VALUE *argv, VALUE vself){ VALUE vdraft, vdoc; ESTDOC *doc; rb_scan_args(argc, argv, "01", &vdraft); if(vdraft != Qnil){ Check_Type(vdraft, T_STRING); doc = est_doc_new_from_draft(StringValuePtr(vdraft)); } else { doc = est_doc_new(); } vdoc = Data_Wrap_Struct(cls_doc_data, 0, est_doc_delete, doc); rb_iv_set(vself, VNDATA, vdoc); return Qnil; } static VALUE doc_add_attr(VALUE vself, VALUE vname, VALUE vvalue){ VALUE vdoc; ESTDOC *doc; const char *value; vdoc = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdoc, ESTDOC, doc); Check_Type(vname, T_STRING); if(vvalue != Qnil){ Check_Type(vvalue, T_STRING); value = StringValuePtr(vvalue); } else { value = NULL; } est_doc_add_attr(doc, StringValuePtr(vname), value); return Qnil; } static VALUE doc_add_text(VALUE vself, VALUE vtext){ VALUE vdoc; ESTDOC *doc; vdoc = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdoc, ESTDOC, doc); Check_Type(vtext, T_STRING); est_doc_add_text(doc, StringValuePtr(vtext)); return Qnil; } static VALUE doc_add_hidden_text(VALUE vself, VALUE vtext){ VALUE vdoc; ESTDOC *doc; vdoc = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdoc, ESTDOC, doc); Check_Type(vtext, T_STRING); est_doc_add_hidden_text(doc, StringValuePtr(vtext)); return Qnil; } static VALUE doc_set_keywords(VALUE vself, VALUE vkwords){ VALUE vdoc; ESTDOC *doc; CBMAP *kwords; vdoc = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdoc, ESTDOC, doc); Check_Type(vkwords, T_HASH); kwords = objtocbmap(vkwords); est_doc_set_keywords(doc, kwords); cbmapclose(kwords); return Qnil; } static VALUE doc_set_score(VALUE vself, VALUE vscore){ VALUE vdoc; ESTDOC *doc; vdoc = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdoc, ESTDOC, doc); est_doc_set_score(doc, NUM2INT(vscore)); return Qnil; } static VALUE doc_id(VALUE vself){ VALUE vdoc; ESTDOC *doc; vdoc = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdoc, ESTDOC, doc); return INT2NUM(est_doc_id(doc)); } static VALUE doc_attr_names(VALUE vself){ VALUE vdoc, vnames; ESTDOC *doc; CBLIST *names; vdoc = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdoc, ESTDOC, doc); names = est_doc_attr_names(doc); vnames = cblisttoobj(names); cblistclose(names); return vnames; } static VALUE doc_attr(VALUE vself, VALUE vname){ VALUE vdoc; ESTDOC *doc; const char *value; vdoc = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdoc, ESTDOC, doc); Check_Type(vname, T_STRING); value = est_doc_attr(doc, StringValuePtr(vname)); return value ? rb_str_new2(value) : Qnil; } static VALUE doc_texts(VALUE vself){ VALUE vdoc; ESTDOC *doc; vdoc = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdoc, ESTDOC, doc); return cblisttoobj(est_doc_texts(doc)); } static VALUE doc_cat_texts(VALUE vself){ VALUE vdoc, vtexts; ESTDOC *doc; char *texts; vdoc = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdoc, ESTDOC, doc); texts = est_doc_cat_texts(doc); vtexts = rb_str_new2(texts); free(texts); return vtexts; } static VALUE doc_keywords(VALUE vself){ VALUE vdoc; ESTDOC *doc; CBMAP *kwords; vdoc = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdoc, ESTDOC, doc); if(!(kwords = est_doc_keywords(doc))) return Qnil; return cbmaptoobj(kwords); } static VALUE doc_score(VALUE vself){ VALUE vdoc; ESTDOC *doc; vdoc = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdoc, ESTDOC, doc); return INT2NUM(est_doc_score(doc)); } static VALUE doc_dump_draft(VALUE vself){ VALUE vdoc, vdraft; ESTDOC *doc; char *draft; vdoc = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdoc, ESTDOC, doc); draft = est_doc_dump_draft(doc); vdraft = rb_str_new2(draft); free(draft); return vdraft; } static VALUE doc_make_snippet(VALUE vself, VALUE vwords, VALUE vwwidth, VALUE vhwidth, VALUE vawidth){ VALUE vdoc, vsnippet; ESTDOC *doc; CBLIST *words; int i, len; char *snippet; vdoc = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdoc, ESTDOC, doc); Check_Type(vwords, T_ARRAY); len = RARRAY(vwords)->len; for(i = 0; i < len; i++){ Check_Type(rb_ary_entry(vwords, i), T_STRING); } words = objtocblist(vwords); snippet = est_doc_make_snippet(doc, words, NUM2INT(vwwidth), NUM2INT(vhwidth), NUM2INT(vawidth)); vsnippet = rb_str_new2(snippet); free(snippet); cblistclose(words); return vsnippet; } static void cond_init(void){ cls_cond = rb_define_class_under(mod_estraier, "Condition", rb_cObject); cls_cond_data = rb_define_class_under(mod_estraier, "Condition_data", rb_cObject); rb_define_const(cls_cond, "SURE", INT2NUM(ESTCONDSURE)); rb_define_const(cls_cond, "USUAL", INT2NUM(ESTCONDUSUAL)); rb_define_const(cls_cond, "FAST", INT2NUM(ESTCONDFAST)); rb_define_const(cls_cond, "AGITO", INT2NUM(ESTCONDAGITO)); rb_define_const(cls_cond, "NOIDF", INT2NUM(ESTCONDNOIDF)); rb_define_const(cls_cond, "SIMPLE", INT2NUM(ESTCONDSIMPLE)); rb_define_const(cls_cond, "ROUGH", INT2NUM(ESTCONDROUGH)); rb_define_const(cls_cond, "UNION", INT2NUM(ESTCONDUNION)); rb_define_const(cls_cond, "ISECT", INT2NUM(ESTCONDISECT)); rb_define_const(cls_cond, "ECLSIMURL", rb_float_new(ESTECLSIMURL)); rb_define_const(cls_cond, "ECLSERV", rb_float_new(ESTECLSERV)); rb_define_const(cls_cond, "ECLDIR", rb_float_new(ESTECLDIR)); rb_define_const(cls_cond, "ECLFILE", rb_float_new(ESTECLFILE)); rb_define_private_method(cls_cond, "initialize", cond_initialize, 0); rb_define_method(cls_cond, "set_phrase", cond_set_phrase, 1); rb_define_method(cls_cond, "add_attr", cond_add_attr, 1); rb_define_method(cls_cond, "set_order", cond_set_order, 1); rb_define_method(cls_cond, "set_max", cond_set_max, 1); rb_define_method(cls_cond, "set_skip", cond_set_skip, 1); rb_define_method(cls_cond, "set_options", cond_set_options, 1); rb_define_method(cls_cond, "set_auxiliary", cond_set_auxiliary, 1); rb_define_method(cls_cond, "set_eclipse", cond_set_eclipse, 1); rb_define_method(cls_cond, "set_distinct", cond_set_distinct, 1); rb_define_method(cls_cond, "set_mask", cond_set_mask, 1); } static VALUE cond_initialize(VALUE vself){ VALUE vcond; ESTCOND *cond; cond = est_cond_new(); est_cond_set_options(cond, ESTCONDSCFB); vcond = Data_Wrap_Struct(cls_cond_data, 0, est_cond_delete, cond); rb_iv_set(vself, VNDATA, vcond); return Qnil; } static VALUE cond_set_phrase(VALUE vself, VALUE vphrase){ VALUE vcond; ESTCOND *cond; vcond = rb_iv_get(vself, VNDATA); Data_Get_Struct(vcond, ESTCOND, cond); Check_Type(vphrase, T_STRING); est_cond_set_phrase(cond, StringValuePtr(vphrase)); return Qnil; } static VALUE cond_add_attr(VALUE vself, VALUE vexpr){ VALUE vcond; ESTCOND *cond; vcond = rb_iv_get(vself, VNDATA); Data_Get_Struct(vcond, ESTCOND, cond); Check_Type(vexpr, T_STRING); est_cond_add_attr(cond, StringValuePtr(vexpr)); return Qnil; } static VALUE cond_set_order(VALUE vself, VALUE vexpr){ VALUE vcond; ESTCOND *cond; vcond = rb_iv_get(vself, VNDATA); Data_Get_Struct(vcond, ESTCOND, cond); Check_Type(vexpr, T_STRING); est_cond_set_order(cond, StringValuePtr(vexpr)); return Qnil; } static VALUE cond_set_max(VALUE vself, VALUE vmax){ VALUE vcond; ESTCOND *cond; int max; vcond = rb_iv_get(vself, VNDATA); Data_Get_Struct(vcond, ESTCOND, cond); max = NUM2INT(vmax); if(max < 0) rb_raise(rb_eArgError, "invalid argument"); est_cond_set_max(cond, max); return Qnil; } static VALUE cond_set_skip(VALUE vself, VALUE vskip){ VALUE vcond; ESTCOND *cond; int skip; vcond = rb_iv_get(vself, VNDATA); Data_Get_Struct(vcond, ESTCOND, cond); skip = NUM2INT(vskip); if(skip < 0) rb_raise(rb_eArgError, "invalid argument"); est_cond_set_skip(cond, skip); return Qnil; } static VALUE cond_set_options(VALUE vself, VALUE voptions){ VALUE vcond; ESTCOND *cond; vcond = rb_iv_get(vself, VNDATA); Data_Get_Struct(vcond, ESTCOND, cond); est_cond_set_options(cond, NUM2INT(voptions)); return Qnil; } static VALUE cond_set_auxiliary(VALUE vself, VALUE vmin){ VALUE vcond; ESTCOND *cond; vcond = rb_iv_get(vself, VNDATA); Data_Get_Struct(vcond, ESTCOND, cond); est_cond_set_auxiliary(cond, NUM2INT(vmin)); return Qnil; } static VALUE cond_set_eclipse(VALUE vself, VALUE vlimit){ VALUE vcond; ESTCOND *cond; vcond = rb_iv_get(vself, VNDATA); Data_Get_Struct(vcond, ESTCOND, cond); est_cond_set_eclipse(cond, NUM2DBL(vlimit)); return Qnil; } static VALUE cond_set_distinct(VALUE vself, VALUE vname){ VALUE vcond; ESTCOND *cond; vcond = rb_iv_get(vself, VNDATA); Data_Get_Struct(vcond, ESTCOND, cond); Check_Type(vname, T_STRING); est_cond_set_distinct(cond, StringValuePtr(vname)); return Qnil; } static VALUE cond_set_mask(VALUE vself, VALUE vmask){ VALUE vcond; ESTCOND *cond; vcond = rb_iv_get(vself, VNDATA); Data_Get_Struct(vcond, ESTCOND, cond); est_cond_set_mask(cond, NUM2INT(vmask)); return Qnil; } static void res_init(void){ cls_res = rb_define_class_under(mod_estraier, "Result", rb_cObject); cls_res_data = rb_define_class_under(mod_estraier, "Result_data", rb_cObject); rb_define_private_method(cls_res, "initialize", res_initialize, 0); rb_define_method(cls_res, "doc_num", res_doc_num, 0); rb_define_method(cls_res, "get_doc_id", res_get_doc_id, 1); rb_define_method(cls_res, "get_dbidx", res_get_dbidx, 1); rb_define_method(cls_res, "hint_words", res_hint_words, 0); rb_define_method(cls_res, "hint", res_hint, 1); rb_define_method(cls_res, "get_score", res_get_score, 1); rb_define_method(cls_res, "get_shadows", res_get_shadows, 1); } static VALUE res_initialize(VALUE vself){ VALUE vres; ESTRES *res; res = est_res_new(); vres = Data_Wrap_Struct(cls_res_data, 0, est_res_delete, res); rb_iv_set(vself, VNDATA, vres); return Qnil; } static ESTRES *est_res_new(void){ ESTRES *res; res = cbmalloc(sizeof(ESTRES)); res->ids = NULL; res->dbidxs = NULL; res->num = 0; res->hints = NULL; return res; } static void est_res_delete(ESTRES *res){ if(res->hints) cbmapclose(res->hints); if(res->dbidxs) free(res->dbidxs); if(res->ids) free(res->ids); free(res); } static VALUE res_doc_num(VALUE vself){ VALUE vres; ESTRES *res; vres = rb_iv_get(vself, VNDATA); Data_Get_Struct(vres, ESTRES, res); return INT2NUM(res->num); } static VALUE res_get_doc_id(VALUE vself, VALUE vindex){ VALUE vres; ESTRES *res; int index; vres = rb_iv_get(vself, VNDATA); Data_Get_Struct(vres, ESTRES, res); index = NUM2INT(vindex); if(!res->ids || index < 0 || index >= res->num) return -1; return INT2NUM(res->ids[index]); } static VALUE res_get_dbidx(VALUE vself, VALUE vindex){ VALUE vres; ESTRES *res; int index; vres = rb_iv_get(vself, VNDATA); Data_Get_Struct(vres, ESTRES, res); index = NUM2INT(vindex); if(!res->dbidxs || index < 0 || index >= res->num) return -1; return INT2NUM(res->dbidxs[index]); } static VALUE res_hint_words(VALUE vself){ VALUE vres, vwords; ESTRES *res; CBLIST *words; const char *vbuf; int i; vres = rb_iv_get(vself, VNDATA); Data_Get_Struct(vres, ESTRES, res); if(!res->hints) return rb_ary_new(); words = cbmapkeys(res->hints); for(i = 0; i < cblistnum(words); i++){ vbuf = cblistval(words, i, NULL); if(vbuf[0] == '\0'){ free(cblistremove(words, i, NULL)); break; } } vwords = cblisttoobj(words); cblistclose(words); return vwords; } static VALUE res_hint(VALUE vself, VALUE vword){ VALUE vres; ESTRES *res; const char *value; vres = rb_iv_get(vself, VNDATA); Data_Get_Struct(vres, ESTRES, res); Check_Type(vword, T_STRING); if(!res->hints) return INT2NUM(0); if(!(value = cbmapget(res->hints, StringValuePtr(vword), -1, NULL))) return INT2NUM(0); return INT2NUM(atoi(value)); } static VALUE res_get_score(VALUE vself, VALUE vindex){ VALUE vres, vcond; ESTRES *res; ESTCOND *cond; vres = rb_iv_get(vself, VNDATA); Data_Get_Struct(vres, ESTRES, res); vcond = rb_iv_get(vself, VNCOND); Data_Get_Struct(vcond, ESTCOND, cond); return INT2NUM(est_cond_score(cond, NUM2INT(vindex))); } static VALUE res_get_shadows(VALUE vself, VALUE vid){ VALUE vres, vcond, vary; ESTRES *res; ESTCOND *cond; const int *ary; int i, anum; vres = rb_iv_get(vself, VNDATA); Data_Get_Struct(vres, ESTRES, res); vcond = rb_iv_get(vself, VNCOND); Data_Get_Struct(vcond, ESTCOND, cond); ary = est_cond_shadows(cond, NUM2INT(vid), &anum); vary = rb_ary_new2(anum); for(i = 0; i < anum; i++){ rb_ary_push(vary, INT2NUM(ary[i])); } return vary; } static void db_init(void){ cls_db = rb_define_class_under(mod_estraier, "Database", rb_cObject); cls_db_data = rb_define_class_under(mod_estraier, "Database_data", rb_cObject); rb_define_const(cls_db, "VERSION", rb_str_new2(est_version)); rb_define_const(cls_db, "ERRNOERR", INT2NUM(ESTENOERR)); rb_define_const(cls_db, "ERRINVAL", INT2NUM(ESTEINVAL)); rb_define_const(cls_db, "ERRACCES", INT2NUM(ESTEACCES)); rb_define_const(cls_db, "ERRLOCK", INT2NUM(ESTELOCK)); rb_define_const(cls_db, "ERRDB", INT2NUM(ESTEDB)); rb_define_const(cls_db, "ERRIO", INT2NUM(ESTEIO)); rb_define_const(cls_db, "ERRNOITEM", INT2NUM(ESTENOITEM)); rb_define_const(cls_db, "ERRMISC", INT2NUM(ESTEMISC)); rb_define_const(cls_db, "DBREADER", INT2NUM(ESTDBREADER)); rb_define_const(cls_db, "DBWRITER", INT2NUM(ESTDBWRITER)); rb_define_const(cls_db, "DBCREAT", INT2NUM(ESTDBCREAT)); rb_define_const(cls_db, "DBTRUNC", INT2NUM(ESTDBTRUNC)); rb_define_const(cls_db, "DBNOLCK", INT2NUM(ESTDBNOLCK)); rb_define_const(cls_db, "DBLCKNB", INT2NUM(ESTDBLCKNB)); rb_define_const(cls_db, "DBPERFNG", INT2NUM(ESTDBPERFNG)); rb_define_const(cls_db, "DBCHRCAT", INT2NUM(ESTDBCHRCAT)); rb_define_const(cls_db, "DBSMALL", INT2NUM(ESTDBSMALL)); rb_define_const(cls_db, "DBLARGE", INT2NUM(ESTDBLARGE)); rb_define_const(cls_db, "DBHUGE", INT2NUM(ESTDBHUGE)); rb_define_const(cls_db, "DBHUGE2", INT2NUM(ESTDBHUGE2)); rb_define_const(cls_db, "DBHUGE3", INT2NUM(ESTDBHUGE3)); rb_define_const(cls_db, "DBSCVOID", INT2NUM(ESTDBSCVOID)); rb_define_const(cls_db, "DBSCINT", INT2NUM(ESTDBSCINT)); rb_define_const(cls_db, "DBSCASIS", INT2NUM(ESTDBSCASIS)); rb_define_const(cls_db, "IDXATTRSEQ", INT2NUM(ESTIDXATTRSEQ)); rb_define_const(cls_db, "IDXATTRSTR", INT2NUM(ESTIDXATTRSTR)); rb_define_const(cls_db, "IDXATTRNUM", INT2NUM(ESTIDXATTRNUM)); rb_define_const(cls_db, "OPTNOPURGE", INT2NUM(ESTOPTNOPURGE)); rb_define_const(cls_db, "OPTNODBOPT", INT2NUM(ESTOPTNODBOPT)); rb_define_const(cls_db, "MGCLEAN", INT2NUM(ESTMGCLEAN)); rb_define_const(cls_db, "PDCLEAN", INT2NUM(ESTPDCLEAN)); rb_define_const(cls_db, "PDWEIGHT", INT2NUM(ESTPDWEIGHT)); rb_define_const(cls_db, "ODCLEAN", INT2NUM(ESTODCLEAN)); rb_define_const(cls_db, "GDNOATTR", INT2NUM(ESTGDNOATTR)); rb_define_const(cls_db, "GDNOTEXT", INT2NUM(ESTGDNOTEXT)); rb_define_const(cls_db, "GDNOKWD", INT2NUM(ESTGDNOKWD)); rb_define_private_method(cls_db, "initialize", db_initialize, 0); rb_define_singleton_method(cls_db, "search_meta", db_search_meta, 2); rb_define_method(cls_db, "err_msg", db_err_msg, 1); rb_define_method(cls_db, "open", db_open, 2); rb_define_method(cls_db, "close", db_close, 0); rb_define_method(cls_db, "error", db_error, 0); rb_define_method(cls_db, "fatal", db_fatal, 0); rb_define_method(cls_db, "add_attr_index", db_add_attr_index, 2); rb_define_method(cls_db, "flush", db_flush, 1); rb_define_method(cls_db, "sync", db_sync, 0); rb_define_method(cls_db, "optimize", db_optimize, 1); rb_define_method(cls_db, "merge", db_merge, 2); rb_define_method(cls_db, "put_doc", db_put_doc, 2); rb_define_method(cls_db, "out_doc", db_out_doc, 2); rb_define_method(cls_db, "edit_doc", db_edit_doc, 1); rb_define_method(cls_db, "get_doc", db_get_doc, 2); rb_define_method(cls_db, "get_doc_attr", db_get_doc_attr, 2); rb_define_method(cls_db, "uri_to_id", db_uri_to_id, 1); rb_define_method(cls_db, "name", db_name, 0); rb_define_method(cls_db, "doc_num", db_doc_num, 0); rb_define_method(cls_db, "word_num", db_word_num, 0); rb_define_method(cls_db, "size", db_size, 0); rb_define_method(cls_db, "search", db_search, 1); rb_define_method(cls_db, "scan_doc", db_scan_doc, 2); rb_define_method(cls_db, "set_cache_size", db_set_cache_size, 4); rb_define_method(cls_db, "add_pseudo_index", db_add_pseudo_index, 1); rb_define_method(cls_db, "set_wildmax", db_set_wildmax, 1); rb_define_method(cls_db, "set_informer", db_set_informer, 1); } static VALUE db_initialize(VALUE vself){ VALUE vdb; ESTDBMGR *db; db = est_dbmgr_new(); vdb = Data_Wrap_Struct(cls_db_data, 0, est_dbmgr_delete, db); rb_iv_set(vself, VNDATA, vdb); return Qnil; } static ESTDBMGR *est_dbmgr_new(void){ ESTDBMGR *db; db = cbmalloc(sizeof(ESTDBMGR)); db->db = NULL; db->ecode = ESTENOERR; return db; } static void est_dbmgr_delete(ESTDBMGR *db){ if(db->db) est_mtdb_close(db->db, &(db->ecode)); free(db); } static VALUE db_search_meta(VALUE vself, VALUE vdbs, VALUE vcond){ VALUE vdb, vres, tres, tcond; ESTDBMGR *db; ESTRES *ores; ESTCOND *cond; ESTMTDB **dbs; CBMAP *hints; int i, dnum, *res, rnum; Check_Type(vdbs, T_ARRAY); dnum = RARRAY(vdbs)->len; dbs = cbmalloc(dnum * sizeof(ESTMTDB *) + 1); for(i = 0; i < dnum; i++){ vdb = rb_ary_entry(vdbs, i); if(rb_obj_is_instance_of(vdb, cls_db) != Qtrue){ free(dbs); rb_raise(rb_eArgError, "invalid argument"); } Data_Get_Struct(rb_iv_get(vdb, VNDATA), ESTDBMGR, db); if(!db->db){ free(dbs); rb_raise(rb_eArgError, "invalid argument"); } dbs[i] = db->db; } if(rb_obj_is_instance_of(vcond, cls_cond) != Qtrue){ free(dbs); rb_raise(rb_eArgError, "invalid argument"); } Data_Get_Struct(rb_iv_get(vcond, VNDATA), ESTCOND, cond); hints = cbmapopenex(31); res = est_mtdb_search_meta(dbs, dnum, cond, &rnum, hints); ores = est_res_new(); ores->ids = res; ores->dbidxs = cbmalloc(rnum / 2 * sizeof(int) + 1); for(i = 0; i < rnum; i += 2){ ores->dbidxs[i/2] = res[i]; ores->ids[i/2] = res[i+1]; } ores->num = rnum / 2; ores->hints = hints; vres = rb_funcall(cls_res, rb_intern("new"), 0); tres = Data_Wrap_Struct(cls_res_data, 0, est_res_delete, ores); rb_iv_set(vres, VNDATA, tres); tcond = Data_Wrap_Struct(cls_cond_data, 0, est_cond_delete, est_cond_dup(cond)); rb_iv_set(vres, VNCOND, tcond); free(dbs); return vres; } static VALUE db_err_msg(VALUE vself, VALUE vecode){ return rb_str_new2(est_err_msg(NUM2INT(vecode))); } static VALUE db_open(VALUE vself, VALUE vname, VALUE vomode){ VALUE vdb; ESTDBMGR *db; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(db->db && !est_mtdb_close(db->db, &(db->ecode))){ db->db = NULL; return Qfalse; } Check_Type(vname, T_STRING); if(!(db->db = est_mtdb_open(StringValuePtr(vname), NUM2INT(vomode), &(db->ecode)))) return Qfalse; return Qtrue; } static VALUE db_close(VALUE vself){ VALUE vdb; ESTDBMGR *db; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) rb_raise(rb_eArgError, "invalid argument"); if(!est_mtdb_close(db->db, &(db->ecode))){ db->db = NULL; return Qfalse; } db->db = NULL; return Qtrue; } static VALUE db_error(VALUE vself){ VALUE vdb; ESTDBMGR *db; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); return INT2NUM(db->ecode); } static VALUE db_fatal(VALUE vself){ VALUE vdb; ESTDBMGR *db; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) return Qfalse; return est_mtdb_fatal(db->db) ? Qtrue : Qfalse; } static VALUE db_add_attr_index(VALUE vself, VALUE vname, VALUE vtype){ VALUE vdb; ESTDBMGR *db; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) return Qfalse; Check_Type(vname, T_STRING); if(!est_mtdb_add_attr_index(db->db, StringValuePtr(vname), NUM2INT(vtype))){ db->ecode = est_mtdb_error(db->db); return Qfalse; } return Qtrue; } static VALUE db_flush(VALUE vself, VALUE vmax){ VALUE vdb; ESTDBMGR *db; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) rb_raise(rb_eArgError, "invalid argument"); if(!est_mtdb_flush(db->db, NUM2INT(vmax))){ db->ecode = est_mtdb_error(db->db); return Qfalse; } return Qtrue; } static VALUE db_sync(VALUE vself){ VALUE vdb; ESTDBMGR *db; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) rb_raise(rb_eArgError, "invalid argument"); if(!est_mtdb_sync(db->db)){ db->ecode = est_mtdb_error(db->db); return Qfalse; } return Qtrue; } static VALUE db_optimize(VALUE vself, VALUE voptions){ VALUE vdb; ESTDBMGR *db; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) rb_raise(rb_eArgError, "invalid argument"); if(!est_mtdb_optimize(db->db, NUM2INT(voptions))){ db->ecode = est_mtdb_error(db->db); return Qfalse; } return Qtrue; } static VALUE db_merge(VALUE vself, VALUE vname, VALUE voptions){ VALUE vdb; ESTDBMGR *db; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) rb_raise(rb_eArgError, "invalid argument"); Check_Type(vname, T_STRING); if(!est_mtdb_merge(db->db, StringValuePtr(vname), NUM2INT(voptions))){ db->ecode = est_mtdb_error(db->db); return Qfalse; } return Qtrue; } static VALUE db_put_doc(VALUE vself, VALUE vdoc, VALUE voptions){ VALUE vdb; ESTDBMGR *db; ESTDOC *doc; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) rb_raise(rb_eArgError, "invalid argument"); if(rb_obj_is_instance_of(vdoc, cls_doc) != Qtrue) rb_raise(rb_eArgError, "invalid argument"); Data_Get_Struct(rb_iv_get(vdoc, VNDATA), ESTDOC, doc); if(!est_mtdb_put_doc(db->db, doc, NUM2INT(voptions))){ db->ecode = est_mtdb_error(db->db); return Qfalse; } return Qtrue; } static VALUE db_out_doc(VALUE vself, VALUE vid, VALUE voptions){ VALUE vdb; ESTDBMGR *db; int id; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) rb_raise(rb_eArgError, "invalid argument"); id = NUM2INT(vid); if(id < 1) rb_raise(rb_eArgError, "invalid argument"); if(!est_mtdb_out_doc(db->db, id, NUM2INT(voptions))){ db->ecode = est_mtdb_error(db->db); return Qfalse; } return Qtrue; } static VALUE db_edit_doc(VALUE vself, VALUE vdoc){ VALUE vdb; ESTDBMGR *db; ESTDOC *doc; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) rb_raise(rb_eArgError, "invalid argument"); if(rb_obj_is_instance_of(vdoc, cls_doc) != Qtrue) rb_raise(rb_eArgError, "invalid argument"); Data_Get_Struct(rb_iv_get(vdoc, VNDATA), ESTDOC, doc); if(!est_mtdb_edit_doc(db->db, doc)){ db->ecode = est_mtdb_error(db->db); return Qfalse; } return Qtrue; } static VALUE db_get_doc(VALUE vself, VALUE vid, VALUE voptions){ VALUE vdb, vdoc, tdoc; ESTDBMGR *db; ESTDOC *doc; int id; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) rb_raise(rb_eArgError, "invalid argument"); id = NUM2INT(vid); if(id < 1) rb_raise(rb_eArgError, "invalid argument"); if(!(doc = est_mtdb_get_doc(db->db, id, NUM2INT(voptions)))){ db->ecode = est_mtdb_error(db->db); return Qnil; } vdoc = rb_funcall(cls_doc, rb_intern("new"), 0); tdoc = Data_Wrap_Struct(cls_doc_data, 0, est_doc_delete, doc); rb_iv_set(vdoc, VNDATA, tdoc); return vdoc; } static VALUE db_get_doc_attr(VALUE vself, VALUE vid, VALUE vname){ VALUE vdb, vvalue; ESTDBMGR *db; char *value; int id; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) rb_raise(rb_eArgError, "invalid argument"); Check_Type(vname, T_STRING); id = NUM2INT(vid); if(id < 1) rb_raise(rb_eArgError, "invalid argument"); if(!(value = est_mtdb_get_doc_attr(db->db, id, StringValuePtr(vname)))){ db->ecode = est_mtdb_error(db->db); return Qnil; } vvalue = rb_str_new2(value); free(value); return vvalue; } static VALUE db_uri_to_id(VALUE vself, VALUE vuri){ VALUE vdb; ESTDBMGR *db; int id; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) rb_raise(rb_eArgError, "invalid argument"); Check_Type(vuri, T_STRING); if((id = est_mtdb_uri_to_id(db->db, StringValuePtr(vuri))) == -1){ db->ecode = est_mtdb_error(db->db); return INT2NUM(-1); } return INT2NUM(id); } static VALUE db_name(VALUE vself){ VALUE vdb; ESTDBMGR *db; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) rb_raise(rb_eArgError, "invalid argument"); return rb_str_new2(est_mtdb_name(db->db)); } static VALUE db_doc_num(VALUE vself){ VALUE vdb; ESTDBMGR *db; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) rb_raise(rb_eArgError, "invalid argument"); return INT2NUM(est_mtdb_doc_num(db->db)); } static VALUE db_word_num(VALUE vself){ VALUE vdb; ESTDBMGR *db; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) rb_raise(rb_eArgError, "invalid argument"); return INT2NUM(est_mtdb_word_num(db->db)); } static VALUE db_size(VALUE vself){ VALUE vdb; ESTDBMGR *db; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) rb_raise(rb_eArgError, "invalid argument"); return rb_float_new(est_mtdb_size(db->db)); } static VALUE db_search(VALUE vself, VALUE vcond){ VALUE vdb, vres, tres, tcond; ESTDBMGR *db; ESTRES *ores; ESTCOND *cond; CBMAP *hints; int *res, rnum; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) rb_raise(rb_eArgError, "invalid argument"); if(rb_obj_is_instance_of(vcond, cls_cond) != Qtrue) rb_raise(rb_eArgError, "invalid argument"); Data_Get_Struct(rb_iv_get(vcond, VNDATA), ESTCOND, cond); hints = cbmapopenex(31); res = est_mtdb_search(db->db, cond, &rnum, hints); ores = est_res_new(); ores->ids = res; ores->num = rnum; ores->hints = hints; vres = rb_funcall(cls_res, rb_intern("new"), 0); tres = Data_Wrap_Struct(cls_res_data, 0, est_res_delete, ores); rb_iv_set(vres, VNDATA, tres); tcond = Data_Wrap_Struct(cls_cond_data, 0, est_cond_delete, est_cond_dup(cond)); rb_iv_set(vres, VNCOND, tcond); return vres; } static VALUE db_scan_doc(VALUE vself, VALUE vdoc, VALUE vcond){ VALUE vdb; ESTDBMGR *db; ESTDOC *doc; ESTCOND *cond; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) rb_raise(rb_eArgError, "invalid argument"); if(rb_obj_is_instance_of(vdoc, cls_doc) != Qtrue) rb_raise(rb_eArgError, "invalid argument"); if(rb_obj_is_instance_of(vcond, cls_cond) != Qtrue) rb_raise(rb_eArgError, "invalid argument"); Data_Get_Struct(rb_iv_get(vdoc, VNDATA), ESTDOC, doc); Data_Get_Struct(rb_iv_get(vcond, VNDATA), ESTCOND, cond); return est_mtdb_scan_doc(db->db, doc, cond) ? Qtrue : Qfalse; } static VALUE db_set_cache_size(VALUE vself, VALUE vsize, VALUE vanum, VALUE vtnum, VALUE vrnum){ VALUE vdb; ESTDBMGR *db; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) rb_raise(rb_eArgError, "invalid argument"); est_mtdb_set_cache_size(db->db, NUM2INT(vsize), NUM2INT(vanum), NUM2INT(vtnum), NUM2INT(vrnum)); return Qnil; } static VALUE db_add_pseudo_index(VALUE vself, VALUE vpath){ VALUE vdb; ESTDBMGR *db; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) rb_raise(rb_eArgError, "invalid argument"); Check_Type(vpath, T_STRING); return est_mtdb_add_pseudo_index(db->db, StringValuePtr(vpath)) ? Qtrue : Qfalse; } static VALUE db_set_wildmax(VALUE vself, VALUE vnum){ VALUE vdb; ESTDBMGR *db; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) rb_raise(rb_eArgError, "invalid argument"); est_mtdb_set_wildmax(db->db, NUM2INT(vnum)); return Qnil; } static VALUE db_set_informer(VALUE vself, VALUE vinformer){ VALUE vdb; ESTDBMGR *db; vdb = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdb, ESTDBMGR, db); if(!db->db) rb_raise(rb_eArgError, "invalid argument"); rb_iv_set(vself, VNINFO, vinformer); est_mtdb_set_informer(db->db, db_informer, (void *)vinformer); return Qnil; } static VALUE cblisttoobj(const CBLIST *list){ const char *vbuf; int i, vsiz; VALUE obj; obj = rb_ary_new2(cblistnum(list)); for(i = 0; i < cblistnum(list); i++){ vbuf = cblistval(list, i, &vsiz); rb_ary_store(obj, i, rb_str_new(vbuf, vsiz)); } return obj; } static CBLIST *objtocblist(VALUE obj){ CBLIST *list; VALUE str; int i, len; list = cblistopen(); len = RARRAY(obj)->len; for(i = 0; i < len; i++){ str = rb_ary_entry(obj, i); cblistpush(list, RSTRING(str)->ptr, RSTRING(str)->len); } return list; } static VALUE cbmaptoobj(CBMAP *map){ const char *kbuf, *vbuf; int ksiz, vsiz; VALUE obj; obj = rb_hash_new(); cbmapiterinit(map); while((kbuf = cbmapiternext(map, &ksiz)) != NULL){ vbuf = cbmapiterval(kbuf, &vsiz); rb_hash_aset(obj, rb_str_new(kbuf, ksiz), rb_str_new(vbuf, vsiz)); } return obj; } static CBMAP *objtocbmap(VALUE obj){ CBMAP *map; VALUE keys, key, val; int i, len; map = cbmapopenex(31); keys = rb_funcall(obj, rb_intern("keys"), 0); len = RARRAY(keys)->len; for(i = 0; i < len; i++){ key = rb_ary_entry(keys, i); val = rb_hash_aref(obj, key); key = rb_String(key); val = rb_String(val); cbmapput(map, RSTRING(key)->ptr, RSTRING(key)->len, RSTRING(val)->ptr, RSTRING(val)->len, 0); } return map; } static void db_informer(const char *message, void *opaque){ VALUE ary; ary = rb_ary_new2(2); rb_ary_push(ary, (VALUE)opaque); rb_ary_push(ary, rb_str_new2(message)); rb_rescue(db_informer_process, ary, db_informer_resque, Qnil); } static VALUE db_informer_process(VALUE arg){ VALUE informer, message; informer = rb_ary_shift(arg); message = rb_ary_shift(arg); rb_funcall(informer, rb_intern("inform"), 1, message); return Qnil; } static VALUE db_informer_resque(VALUE arg){ return Qnil; } /* END OF FILE */ hyperestraier-1.4.13/rubynative/src/extconf.rb000066400000000000000000000007501125261632700214470ustar00rootroot00000000000000require "mkmf" dir_config('estraier') ENV["PATH"] = ENV["PATH"] + ":/usr/local/bin:.:..:../.." estcflags = `estconfig --cflags`.chomp estldflags = `estconfig --ldflags`.chomp estlibs = `estconfig --libs`.chomp $CFLAGS = "-I. -I.. -I../.. #{estcflags} -Wall #{$CFLAGS} -O3 -fomit-frame-pointer -fforce-addr" $LDFLAGS = "#{$LDFLAGS} -L. -L.. -L../.. #{estldflags}" $libs = "#{$libs} #{estlibs}" if have_header('estraier.h') and have_library('estraier') create_makefile('estraier') end hyperestraier-1.4.13/rubypure/000077500000000000000000000000001125261632700163505ustar00rootroot00000000000000hyperestraier-1.4.13/rubypure/Makefile.in000066400000000000000000000056161125261632700204250ustar00rootroot00000000000000# Makefile for the pure Ruby interface of Hyper Estraier #================================================================ # Setting Variables #================================================================ # Generic settings SHELL = @SHELL@ # Packaging PACKAGE = @PACKAGE_NAME@ VERSION = @PACKAGE_VERSION@ # Targets MYRBLIBS = estraierpure.rb MYRBBINS = estcall.rb # Install destinations prefix = @prefix@ exec_prefix = @exec_prefix@ MYRBLIBDIR = @MYRBLIBDIR@ MYRBBINDIR = @bindir@ DESTDIR = # Building binaries RUBY = @RUBY@ RDOC = @RDOC@ #================================================================ # Actions #================================================================ all : @printf '\n' @printf '#================================================================\n' @printf '# Ready to install.\n' @printf '#================================================================\n' clean : rm -rf check.out casket *~ install : mkdir -p $(DESTDIR)$(MYRBLIBDIR) cp -Rf $(MYRBLIBS) $(DESTDIR)$(MYRBLIBDIR) mkdir -p $(DESTDIR)$(MYRBBINDIR) cp -Rf $(MYRBBINS) $(DESTDIR)$(MYRBBINDIR) @printf '\n' @printf '#================================================================\n' @printf '# Thanks for using Hyper Estraier for Ruby.\n' @printf '#================================================================\n' uninstall : cd $(DESTDIR)$(MYRBLIBDIR) && rm -f $(MYRBLIBS) cd $(DESTDIR)$(MYRBBINDIR) && rm -f $(MYRBBINS) dist : autoconf make doc make distclean distclean : clean cd example && make clean rm -rf Makefile config.cache config.log config.status autom4te.cache check : $(RUBY) -I. -w -d estcall.rb put -auth admin admin \ "http://localhost:1978/node/sample1" ../misc/test001.est $(RUBY) -I. -w -d estcall.rb put -auth admin admin \ "http://localhost:1978/node/sample1" ../misc/test002.est $(RUBY) -I. -w -d estcall.rb out -auth admin admin \ "http://localhost:1978/node/sample1" 1 $(RUBY) -I. -w -d estcall.rb edit -auth admin admin \ "http://localhost:1978/node/sample1" 2 "@title" "Super Nova" $(RUBY) -I. -w -d estcall.rb get \ "http://localhost:1978/node/sample1" 2 $(RUBY) -I. -w -d estcall.rb etch \ "http://localhost:1978/node/sample1" 2 $(RUBY) -I. -w -d estcall.rb inform \ "http://localhost:1978/node/sample1" $(RUBY) -I. -w -d estcall.rb search \ "http://localhost:1978/node/sample1" "mikio" $(RUBY) -I. -w -d estcall.rb search -attr "@uri" -ord "@title" \ "http://localhost:1978/node/sample1" "i" $(RUBY) -I. -w -d estcall.rb setuser -auth admin admin \ "http://localhost:1978/node/sample1" mikio 1 $(RUBY) -I. -w -d estcall.rb setlink -auth admin admin \ "http://localhost:1978/node/sample1" "http://localhost:1978/node/sample2" \ "Sample2" 10 doc : make docclean $(RDOC) -t estraierpure -o ../doc/rubypureapi estraierpure.rb docclean : rm -rf ../doc/rubypureapi .PHONY : all clean install casket check # END OF FILE hyperestraier-1.4.13/rubypure/configure000077500000000000000000002036111125261632700202620ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for hyperestraier-rubypure 1.0.0. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='hyperestraier-rubypure' PACKAGE_TARNAME='hyperestraier-rubypure' PACKAGE_VERSION='1.0.0' PACKAGE_STRING='hyperestraier-rubypure 1.0.0' PACKAGE_BUGREPORT='' ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS RUBY RDOC MYRBLIBDIR LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures hyperestraier-rubypure 1.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of hyperestraier-rubypure 1.0.0:";; esac cat <<\_ACEOF _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF hyperestraier-rubypure configure 1.0.0 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by hyperestraier-rubypure $as_me 1.0.0, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Export variables RUBY="ruby" RDOC="rdoc" MYRBLIBDIR=/usr/local/lib/ruby/site_ruby # Building paths pathtmp="$PATH" PATH="..:$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin" PATH="$PATH:/usr/ccs/bin:/usr/ucb:/usr/xpg4/bin:/usr/xpg6/bin:$pathtmp" LIBRARY_PATH="..:$HOME/lib:/usr/local/lib:$LIBRARY_PATH" LD_LIBRARY_PATH="..:$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH" CPATH="..:$HOME/include:/usr/local/include:$CPATH" PKG_CONFIG_PATH="..:$HOME/lib/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH if type pkg-config > /dev/null 2>&1 then PATH="$PATH:`pkg-config --variable=bindir qdbm`" PATH="$PATH:`pkg-config --variable=bindir hyperestraier`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir hyperestraier`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir hyperestraier`" CPATH="$CPATH:`pkg-config --variable=includedir qdbm`" CPATH="$CPATH:`pkg-config --variable=includedir hyperestraier`" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH fi # Setting the default prefix if test "$prefix" = NONE then prefix=`ruby -rrbconfig -e 'puts(Config::CONFIG.fetch("prefix"))'` fi #================================================================ # Checking Commands and Libraries #================================================================ # Ruby interpreter printf 'checking RUBY... ' if which ruby > /dev/null then RUBY=`which ruby` fi printf '%s\n' "$RUBY" # Other building tools printf 'checking RDOC... ' if which rdoc > /dev/null then RDOC=`which rdoc` fi printf '%s\n' "$RDOC" # Librarh path myrblibdir=`ruby -rrbconfig -e 'puts(Config::CONFIG.fetch("sitelibdir"))'` if test -n "$myrblibdir" then MYRBLIBDIR="$myrblibdir" fi #================================================================ # Generic Settings #================================================================ # Export variables # Targets ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by hyperestraier-rubypure $as_me 1.0.0, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ hyperestraier-rubypure config.status 1.0.0 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@RUBY@,$RUBY,;t t s,@RDOC@,$RDOC,;t t s,@MYRBLIBDIR@,$MYRBLIBDIR,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi # END OF FILE hyperestraier-1.4.13/rubypure/configure.in000066400000000000000000000046641125261632700206730ustar00rootroot00000000000000# Source of configuration for the pure Ruby interface of Hyper Estraier #================================================================ # Generic Settings #================================================================ # Targets AC_INIT(hyperestraier-rubypure, 1.0.0) # Export variables RUBY="ruby" RDOC="rdoc" MYRBLIBDIR=/usr/local/lib/ruby/site_ruby # Building paths pathtmp="$PATH" PATH="..:$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin" PATH="$PATH:/usr/ccs/bin:/usr/ucb:/usr/xpg4/bin:/usr/xpg6/bin:$pathtmp" LIBRARY_PATH="..:$HOME/lib:/usr/local/lib:$LIBRARY_PATH" LD_LIBRARY_PATH="..:$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH" CPATH="..:$HOME/include:/usr/local/include:$CPATH" PKG_CONFIG_PATH="..:$HOME/lib/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH if type pkg-config > /dev/null 2>&1 then PATH="$PATH:`pkg-config --variable=bindir qdbm`" PATH="$PATH:`pkg-config --variable=bindir hyperestraier`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LIBRARY_PATH="$LIBRARY_PATH:`pkg-config --variable=libdir hyperestraier`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir qdbm`" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pkg-config --variable=libdir hyperestraier`" CPATH="$CPATH:`pkg-config --variable=includedir qdbm`" CPATH="$CPATH:`pkg-config --variable=includedir hyperestraier`" export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH fi # Setting the default prefix if test "$prefix" = NONE then prefix=`ruby -rrbconfig -e 'puts(Config::CONFIG.fetch("prefix"))'` fi #================================================================ # Checking Commands and Libraries #================================================================ # Ruby interpreter printf 'checking RUBY... ' if which ruby > /dev/null then RUBY=`which ruby` fi printf '%s\n' "$RUBY" # Other building tools printf 'checking RDOC... ' if which rdoc > /dev/null then RDOC=`which rdoc` fi printf '%s\n' "$RDOC" # Librarh path myrblibdir=`ruby -rrbconfig -e 'puts(Config::CONFIG.fetch("sitelibdir"))'` if test -n "$myrblibdir" then MYRBLIBDIR="$myrblibdir" fi #================================================================ # Generic Settings #================================================================ # Export variables AC_SUBST(RUBY) AC_SUBST(RDOC) AC_SUBST(MYRBLIBDIR) # Targets AC_OUTPUT(Makefile) # END OF FILE hyperestraier-1.4.13/rubypure/estcall.rb000077500000000000000000000544151125261632700203400ustar00rootroot00000000000000#! /usr/bin/ruby -w #-- # Ruby interface of Hyper Estraier # Copyright (C) 2004-2007 Mikio Hirabayashi # All rights reserved. # This file is part of Hyper Estraier. # Redistribution and use in source and binary forms, with or without modification, are # permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this list of # conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright notice, this list of # conditions and the following disclaimer in the documentation and/or other materials # provided with the distribution. # * Neither the name of Mikio Hirabayashi nor the names of its contributors may be used to # endorse or promote products derived from this software without specific prior written # permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED # OF THE POSSIBILITY OF SUCH DAMAGE. require "estraierpure" include EstraierPure # global constants SEARCHMAX = 10 SEARCHAUX = 10 # global variables $pxhost = nil $pxport = 0 $timeout = -1 $authname = nil $authpass = nil $condopts = 0 # main routine def main(args) usage if args.length < 1 rv = 0 case args[0] when "put" rv = runput(args) when "out" rv = runout(args) when "edit" rv = runedit(args) when "get" rv = runget(args) when "etch" rv = runetch(args) when "uriid" rv = runuriid(args) when "inform" rv = runinform(args) when "sync" rv = runsync(args) when "optimize" rv = runoptimize(args) when "search" rv = runsearch(args) when "setuser" rv = runsetuser(args) when "setlink" rv = runsetlink(args) else usage end return rv end # print usage and exit def usage() STDERR.printf("%s: command line utility for the node API of Hyper Estraier\n", $0) STDERR.printf("\n") STDERR.printf("usage:\n") STDERR.printf(" %s put [-proxy host port] [-tout num] [-auth user pass] nurl [file]\n", $0) STDERR.printf(" %s out [-proxy host port] [-tout num] [-auth user pass] nurl expr\n", $0) STDERR.printf(" %s edit [-proxy host port] [-tout num] [-auth user pass]" \ " nurl expr name [value]\n", $0) STDERR.printf(" %s get [-proxy host port] [-tout num] [-auth user pass]" \ " nurl expr [attr]\n", $0) STDERR.printf(" %s etch [-proxy host port] [-tout num] [-auth user pass] nurl expr\n", $0) STDERR.printf(" %s uriid [-proxy host port] [-tout num] [-auth user pass] nurl uri\n", $0) STDERR.printf(" %s inform [-proxy host port] [-tout num] [-auth user pass] nurl\n", $0) STDERR.printf(" %s sync [-proxy host port] [-tout num] [-auth user pass] nurl\n", $0) STDERR.printf(" %s optimize [-proxy host port] [-tout num] [-auth user pass] nurl\n", $0) STDERR.printf(" %s search [-proxy host port] [-tout num] [-auth user pass]" \ " [-sf|-sfr|-sfu|-sfi] [-attr expr] [-ord expr] [-max num] [-sk num]" \ " [-aux num] [-dis name] [-dpt num] [-mask num] nurl [phrase]\n", $0) STDERR.printf(" %s setuser [-proxy host port] [-tout num] [-auth user pass]" \ " nurl name mode\n", $0) STDERR.printf(" %s setlink [-proxy host port] [-tout num] [-auth user pass]" \ " nurl url label credit\n", $0) STDERR.printf("\n") exit(1) end # print error string and flush the buffer */ def printerror(msg) STDERR.printf("%s: ERROR: %s\n", $0, msg) STDERR.flush end # parse arguments of the put command def runput(args) nurl = nil file = nil i = 1 while i < args.length if !nurl && args[i] =~ /^-/ if args[i] == "-proxy" usage if (i += 1) >= args.length $pxhost = args[i] usage if (i += 1) >= args.length $pxport = args[i].to_i elsif args[i] == "-tout" usage if (i += 1) >= args.length $timeout = args[i].to_i elsif args[i] == "-auth" usage if (i += 1) >= args.length $authname = args[i] usage if (i += 1) >= args.length $authpass = args[i] else usage end elsif !nurl nurl = args[i] elsif !file file = args[i] else usage end i += 1 end usage if !nurl procput(nurl, file) end # parse arguments of the out command def runout(args) nurl = nil expr = nil i = 1 while i < args.length if !nurl && args[i] =~ /^-/ if args[i] == "-proxy" usage if (i += 1) >= args.length $pxhost = args[i] usage if (i += 1) >= args.length $pxport = args[i].to_i elsif args[i] == "-tout" usage if (i += 1) >= args.length $timeout = args[i].to_i elsif args[i] == "-auth" usage if (i += 1) >= args.length $authname = args[i] usage if (i += 1) >= args.length $authpass = args[i] else usage end elsif !nurl nurl = args[i] elsif !expr expr = args[i] else usage end i += 1 end usage if !nurl || !expr procout(nurl, expr) end # parse arguments of the edit command def runedit(args) nurl = nil expr = nil name = nil value = nil i = 1 while i < args.length if !nurl && args[i] =~ /^-/ if args[i] == "-proxy" usage if (i += 1) >= args.length $pxhost = args[i] usage if (i += 1) >= args.length $pxport = args[i].to_i elsif args[i] == "-tout" usage if (i += 1) >= args.length $timeout = args[i].to_i elsif args[i] == "-auth" usage if (i += 1) >= args.length $authname = args[i] usage if (i += 1) >= args.length $authpass = args[i] else usage end elsif !nurl nurl = args[i] elsif !expr expr = args[i] elsif !name name = args[i] elsif !value value = args[i] else usage end i += 1 end usage if !nurl || !expr || !name procedit(nurl, expr, name, value) end # parse arguments of the get command def runget(args) nurl = nil expr = nil attr = nil i = 1 while i < args.length if !nurl && args[i] =~ /^-/ if args[i] == "-proxy" usage if (i += 1) >= args.length $pxhost = args[i] usage if (i += 1) >= args.length $pxport = args[i].to_i elsif args[i] == "-tout" usage if (i += 1) >= args.length $timeout = args[i].to_i elsif args[i] == "-auth" usage if (i += 1) >= args.length $authname = args[i] usage if (i += 1) >= args.length $authpass = args[i] else usage end elsif !nurl nurl = args[i] elsif !expr expr = args[i] elsif !attr attr = args[i] else usage end i += 1 end usage if !nurl || !expr procget(nurl, expr, attr) end # parse arguments of the etch command def runetch(args) nurl = nil expr = nil i = 1 while i < args.length if !nurl && args[i] =~ /^-/ if args[i] == "-proxy" usage if (i += 1) >= args.length $pxhost = args[i] usage if (i += 1) >= args.length $pxport = args[i].to_i elsif args[i] == "-tout" usage if (i += 1) >= args.length $timeout = args[i].to_i elsif args[i] == "-auth" usage if (i += 1) >= args.length $authname = args[i] usage if (i += 1) >= args.length $authpass = args[i] else usage end elsif !nurl nurl = args[i] elsif !expr expr = args[i] else usage end i += 1 end usage if !nurl || !expr procetch(nurl, expr) end # parse arguments of the uriid command def runuriid(args) nurl = nil uri = nil i = 1 while i < args.length if !nurl && args[i] =~ /^-/ if args[i] == "-proxy" usage if (i += 1) >= args.length $pxhost = args[i] usage if (i += 1) >= args.length $pxport = args[i].to_i elsif args[i] == "-tout" usage if (i += 1) >= args.length $timeout = args[i].to_i elsif args[i] == "-auth" usage if (i += 1) >= args.length $authname = args[i] usage if (i += 1) >= args.length $authpass = args[i] else usage end elsif !nurl nurl = args[i] elsif !uri uri = args[i] else usage end i += 1 end usage if !nurl || !uri procuriid(nurl, uri) end # parse arguments of the inform command def runinform(args) nurl = nil i = 1 while i < args.length if !nurl && args[i] =~ /^-/ if args[i] == "-proxy" usage if (i += 1) >= args.length $pxhost = args[i] usage if (i += 1) >= args.length $pxport = args[i].to_i elsif args[i] == "-tout" usage if (i += 1) >= args.length $timeout = args[i].to_i elsif args[i] == "-auth" usage if (i += 1) >= args.length $authname = args[i] usage if (i += 1) >= args.length $authpass = args[i] else usage end elsif !nurl nurl = args[i] else usage end i += 1 end usage if !nurl procinform(nurl) end # parse arguments of the sync command def runsync(args) nurl = nil i = 1 while i < args.length if !nurl && args[i] =~ /^-/ if args[i] == "-proxy" usage if (i += 1) >= args.length $pxhost = args[i] usage if (i += 1) >= args.length $pxport = args[i].to_i elsif args[i] == "-tout" usage if (i += 1) >= args.length $timeout = args[i].to_i elsif args[i] == "-auth" usage if (i += 1) >= args.length $authname = args[i] usage if (i += 1) >= args.length $authpass = args[i] else usage end elsif !nurl nurl = args[i] else usage end i += 1 end usage if !nurl procsync(nurl) end # parse arguments of the optimize command def runoptimize(args) nurl = nil i = 1 while i < args.length if !nurl && args[i] =~ /^-/ if args[i] == "-proxy" usage if (i += 1) >= args.length $pxhost = args[i] usage if (i += 1) >= args.length $pxport = args[i].to_i elsif args[i] == "-tout" usage if (i += 1) >= args.length $timeout = args[i].to_i elsif args[i] == "-auth" usage if (i += 1) >= args.length $authname = args[i] usage if (i += 1) >= args.length $authpass = args[i] else usage end elsif !nurl nurl = args[i] else usage end i += 1 end usage if !nurl procoptimize(nurl) end # parse arguments of the search command def runsearch(args) nurl = nil phrase = nil attrs = [] ord = nil max = SEARCHMAX skip = 0 opts = 0 aux = SEARCHAUX dis = nil depth = 0 mask = 0 i = 1 while i < args.length if !nurl && args[i] =~ /^-/ if args[i] == "-proxy" usage if (i += 1) >= args.length $pxhost = args[i] usage if (i += 1) >= args.length $pxport = args[i].to_i elsif args[i] == "-tout" usage if (i += 1) >= args.length $timeout = args[i].to_i elsif args[i] == "-auth" usage if (i += 1) >= args.length $authname = args[i] usage if (i += 1) >= args.length $authpass = args[i] elsif args[i] == "-sf" opts |= Condition::SIMPLE elsif args[i] == "-sfr" opts |= Condition::ROUGH elsif args[i] == "-sfu" opts |= Condition::UNION elsif args[i] == "-sfi" opts |= Condition::ISECT elsif args[i] == "-attr" usage if (i += 1) >= args.length attrs.push(args[i]) elsif args[i] == "-ord" usage if (i += 1) >= args.length ord = args[i] elsif args[i] == "-max" usage if (i += 1) >= args.length max = args[i].to_i elsif args[i] == "-sk" usage if (i += 1) >= args.length skip = args[i].to_i elsif args[i] == "-aux" usage if (i += 1) >= args.length aux = args[i].to_i elsif args[i] == "-dis" usage if (i += 1) >= args.length dis = args[i] elsif args[i] == "-dpt" usage if (i += 1) >= args.length depth = args[i].to_i elsif args[i] == "-mask" usage if (i += 1) >= args.length mask = args[i].to_i else usage end elsif !nurl nurl = args[i] elsif !phrase phrase = args[i] else phrase += " " + args[i] end i += 1 end usage if !nurl || depth < 0 procsearch(nurl, phrase, attrs, ord, max, skip, opts, aux, dis, depth, mask) end # parse arguments of the setuser command def runsetuser(args) nurl = nil name = nil mode = nil i = 1 while i < args.length if !nurl && args[i] =~ /^-/ if args[i] == "-proxy" usage if (i += 1) >= args.length $pxhost = args[i] usage if (i += 1) >= args.length $pxport = args[i].to_i elsif args[i] == "-tout" usage if (i += 1) >= args.length $timeout = args[i].to_i elsif args[i] == "-auth" usage if (i += 1) >= args.length $authname = args[i] usage if (i += 1) >= args.length $authpass = args[i] else usage end elsif !nurl nurl = args[i] elsif !name name = args[i] elsif !mode mode = args[i].to_i else usage end i += 1 end usage if !nurl || !name || !mode || mode < 0 procsetuser(nurl, name, mode) end # parse arguments of the setlink command def runsetlink(args) nurl = nil url = nil label = nil credit = nil i = 1 while i < args.length if !nurl && args[i] =~ /^-/ if args[i] == "-proxy" usage if (i += 1) >= args.length $pxhost = args[i] usage if (i += 1) >= args.length $pxport = args[i].to_i elsif args[i] == "-tout" usage if (i += 1) >= args.length $timeout = args[i].to_i elsif args[i] == "-auth" usage if (i += 1) >= args.length $authname = args[i] usage if (i += 1) >= args.length $authpass = args[i] else usage end elsif !nurl nurl = args[i] elsif !url url = args[i] elsif !label label = args[i] elsif !credit credit = args[i].to_i else usage end i += 1 end usage if !nurl || !url || !label || !credit procsetlink(nurl, url, label, credit) end # perform the put command def procput(nurl, file) if file begin ifp = open(file, "rb") draft = ifp.read ensure ifp.close if ifp end else STDIN.binmode draft = STDIN.read end doc = Document::new(draft) node = Node::new node.set_url(nurl) node.set_proxy($pxhost, $pxport) if $pxhost node.set_timeout($timeout) if $timeout > 0 node.set_auth($authname, $authpass) if $authname if !node.put_doc(doc) printerror("failed: " + node.status.to_s) return 1 end return 0 end # perform the out command def procout(nurl, expr) node = Node::new node.set_url(nurl) node.set_proxy($pxhost, $pxport) if $pxhost node.set_timeout($timeout) if $timeout > 0 node.set_auth($authname, $authpass) if $authname id = expr.to_i if id > 0 if !node.out_doc(id) printerror("failed: " + node.status.to_s) return 1 end else if !node.out_doc_by_uri(expr) printerror("failed: " + node.status.to_s) return 1 end end return 0 end # perform the edit command def procedit(nurl, expr, name, value) node = Node::new node.set_url(nurl) node.set_proxy($pxhost, $pxport) if $pxhost node.set_timeout($timeout) if $timeout > 0 node.set_auth($authname, $authpass) if $authname id = expr.to_i doc = id > 0 ? node.get_doc(id) : node.get_doc_by_uri(expr) if !doc printerror("failed: " + node.status.to_s) return 1 end doc.add_attr(name, value) if !node.edit_doc(doc) printerror("failed: " + node.status.to_s) return 1 end return 0 end # perform the get command def procget(nurl, expr, attr) node = Node::new node.set_url(nurl) node.set_proxy($pxhost, $pxport) if $pxhost node.set_timeout($timeout) if $timeout > 0 node.set_auth($authname, $authpass) if $authname id = expr.to_i if attr value = id > 0 ? node.get_doc_attr(id, attr) : node.get_doc_attr_by_uri(expr, attr) if !value printerror("failed: " + node.status.to_s) return 1 end printf("%s\n", value) else doc = id > 0 ? node.get_doc(id) : node.get_doc_by_uri(expr) if !doc printerror("failed: " + node.status.to_s) return 1 end printf("%s", doc.dump_draft) end return 0 end # perform the etch command def procetch(nurl, expr) node = Node::new node.set_url(nurl) node.set_proxy($pxhost, $pxport) if $pxhost node.set_timeout($timeout) if $timeout > 0 node.set_auth($authname, $authpass) if $authname id = expr.to_i kwords = id > 0 ? node.etch_doc(id) : node.etch_doc_by_uri(expr) if !kwords printerror("failed: " + node.status.to_s) return 1 end kwords.each do |key, value| printf("%s\t%s\n", key, value) end return 0 end # perform the uriid command def procuriid(nurl, uri) node = Node::new node.set_url(nurl) node.set_proxy($pxhost, $pxport) if $pxhost node.set_timeout($timeout) if $timeout > 0 node.set_auth($authname, $authpass) if $authname value = node.uri_to_id(uri) if !value printerror("failed: " + node.status.to_s) return 1 end printf("%s\n", value) return 0 end # perform the inform command def procinform(nurl) node = Node::new node.set_url(nurl) node.set_proxy($pxhost, $pxport) if $pxhost node.set_timeout($timeout) if $timeout > 0 node.set_auth($authname, $authpass) if $authname name = node.name label = node.label dnum = node.doc_num wnum = node.word_num size = node.size ratio = node.cache_usage if !name || !label || dnum < 0 || wnum < 0 || size < 0.0 || ratio < 0.0 printerror("failed: " + node.status.to_s) return 1 end printf("%s\t%s\t%d\t%d\t%.0f\t%.6f\n", name, label, dnum, wnum, size, ratio) return 0 end # perform the sync command def procsync(nurl) node = Node::new node.set_url(nurl) node.set_proxy($pxhost, $pxport) if $pxhost node.set_timeout($timeout) if $timeout > 0 node.set_auth($authname, $authpass) if $authname if !node.sync printerror("failed: " + node.status.to_s) return 1 end return 0 end # perform the optimize command def procoptimize(nurl) node = Node::new node.set_url(nurl) node.set_proxy($pxhost, $pxport) if $pxhost node.set_timeout($timeout) if $timeout > 0 node.set_auth($authname, $authpass) if $authname if !node.optimize printerror("failed: " + node.status.to_s) return 1 end return 0 end # perform the search command def procsearch(nurl, phrase, attrs, ord, max, skip, opts, aux, dis, depth, mask) node = Node::new node.set_url(nurl) node.set_proxy($pxhost, $pxport) if $pxhost node.set_timeout($timeout) if $timeout > 0 node.set_auth($authname, $authpass) if $authname cond = Condition::new cond.set_phrase(phrase) if phrase for i in 0...attrs.length cond.add_attr(attrs[i]) end cond.set_order(ord) if ord cond.set_max(max) if max >= 0 cond.set_skip(skip) if skip >= 0 cond.set_options(opts) cond.set_auxiliary(aux) cond.set_distinct(dis) if dis cond.set_mask(mask) nres = node.search(cond, depth) if !nres printerror("failed: " + node.status.to_s) return 1 end border = "--------[" + Time::now.to_f.to_s.gsub(/\./, "") + "]--------" printf("%s\n", border) value = nres.hint("VERSION") printf("VERSION\t%s\n", value) if value value = nres.hint("NODE") printf("NODE\t%s\n", value) if value value = nres.hint("HIT") printf("HIT\t%s\n", value) if value for i in 1...1024 key = "HINT#" + i.to_s value = nres.hint(key) if value printf("%s\t%s\n", key, value) else break end end value = nres.hint("DOCNUM") printf("DOCNUM\t%s\n", value) if value value = nres.hint("WORDNUM") printf("WORDNUM\t%s\n", value) if value value = nres.hint("TIME") printf("TIME\t%s\n", value) if value value = nres.hint("TIME#i") printf("TIME#i\t%s\n", value) if value for i in 0...1024 key = "TIME#" + i.to_s value = nres.hint(key) if value printf("%s\t%s\n", key, value) else break end end for i in 0...1024 key = "LINK#" + i.to_s value = nres.hint(key) if value printf("%s\t%s\n", key, value) else break end end value = nres.hint("VIEW") printf("VIEW\t%s\n", value) if value printf("\n") for i in 0...nres.doc_num printf("%s\n", border) rdoc = nres.get_doc(i) names = rdoc.attr_names for j in 0...names.length printf("%s=%s\n", names[j], rdoc.attr(names[j])) end keywords = rdoc.keywords printf("%%VECTOR\t%s\n", keywords) if keywords.length > 0 printf("\n") printf("%s", rdoc.snippet) end printf("%s:END\n", border) return 0 end # perform the setuser command def procsetuser(nurl, name, mode) node = Node::new node.set_url(nurl) node.set_proxy($pxhost, $pxport) if $pxhost node.set_timeout($timeout) if $timeout > 0 node.set_auth($authname, $authpass) if $authname if !node.set_user(name, mode) printerror("failed: " + node.status.to_s) return 1 end return 0 end # perform the setlink command def procsetlink(nurl, url, label, credit) node = Node::new node.set_url(nurl) node.set_proxy($pxhost, $pxport) if $pxhost node.set_timeout($timeout) if $timeout > 0 node.set_auth($authname, $authpass) if $authname if !node.set_link(url, label, credit) printerror("failed: " + node.status.to_s) return 1 end return 0 end # perform the main routine exit(main(ARGV)) # END OF FILE hyperestraier-1.4.13/rubypure/estraierpure.rb000066400000000000000000001251001125261632700214060ustar00rootroot00000000000000#-- # Ruby interface of Hyper Estraier # Copyright (C) 2004-2007 Mikio Hirabayashi # All rights reserved. # This file is part of Hyper Estraier. # Redistribution and use in source and binary forms, with or without modification, are # permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this list of # conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright notice, this list of # conditions and the following disclaimer in the documentation and/or other materials # provided with the distribution. # * Neither the name of Mikio Hirabayashi nor the names of its contributors may be used to # endorse or promote products derived from this software without specific prior written # permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED # OF THE POSSIBILITY OF SUCH DAMAGE. #++ #:include:overview require "uri" require "cgi" require "socket" require "stringio" # # Module for the namespace of Hyper Estraier # module EstraierPure #---------------------------------------------------------------- #++ Abstraction of document. #---------------------------------------------------------------- class Document #-------------------------------- # public methods #-------------------------------- public # Add an attribute. # `name' specifies the name of an attribute. # `value' specifies the value of the attribute. If it is `nil', the attribute is removed. # The return value is always `nil'. def add_attr(name, value) Utility::check_types({ name=>String, value=>String }) if $DEBUG name = name.gsub(/[ \t\r\n\v\f]+/, " ") name = name.strip.squeeze(" ") value = value.gsub(/[ \t\r\n\v\f]+/, " ") value = value.strip.squeeze(" ") @attrs[name] = value nil end # Add a sentence of text. # `text' specifies a sentence of text. # The return value is always `nil'. def add_text(text) Utility::check_types({ text=>String }) if $DEBUG text = text.gsub(/[ \t\r\n\v\f]+/, " ") text = text.strip.squeeze(" ") @dtexts.push(text) if text.length nil end # Add a hidden sentence. # `text' specifies a hidden sentence. # The return value is always `nil'. def add_hidden_text(text) Utility::check_types({ text=>String }) if $DEBUG text = text.gsub(/[ \t\r\n\v\f]+/, " ") text = text.strip.squeeze(" ") @htexts.push(text) if text.length nil end # Attach keywords. # `kwords' specifies a map object of keywords. Keys of the map should be keywords of the # document and values should be their scores in decimal string. # The return value is always `nil'. def set_keywords(kwords) Utility::check_types({ kwords=>Hash }) if $DEBUG @kwords = kwords nil end # Set the substitute score. # `score' specifies the substitute score. It it is negative, the substitute score setting is # nullified. # The return value is always `nil'. def set_score(score) Utility::check_types({ score=>Integer }) if $DEBUG @score = score nil end # Get the ID number. # The return value is the ID number of the document object. If the object has never been # registered, -1 is returned. def id() @id end # Get an array of attribute names of a document object. # The return value is an array object of attribute names. def attr_names() @attrs.keys.sort end # Get the value of an attribute. # `name' specifies the name of an attribute. # The return value is the value of the attribute or `nil' if it does not exist. def attr(name) Utility::check_types({ name=>String }) if $DEBUG @attrs[name] end # Get an array of sentences of the text. # The return value is an array object of sentences of the text. def texts() @dtexts end # Concatenate sentences of the text of a document object. # The return value is concatenated sentences. def cat_texts() buf = StringIO::new for i in 0...@dtexts.length buf.write(" ") if i > 0 buf.write(@dtexts[i]) end buf.string end # Dump draft data of a document object. # The return value is draft data. def dump_draft() buf = StringIO::new keys = @attrs.keys.sort for i in 0...keys.length buf.printf("%s=%s\n", keys[i], @attrs[keys[i]]) end if @kwords buf.printf("%%VECTOR") @kwords.each() do |key, value| buf.printf("\t%s\t%s", key, value) end buf.printf("\n") end buf.printf("%%SCORE\t%d\n", @score) if @score >= 0 buf.printf("\n") for i in 0...@dtexts.length buf.printf("%s\n", @dtexts[i]) end for i in 0...@htexts.length buf.printf("\t%s\n", @htexts[i]) end buf.string end # Get attached keywords. # The return value is a map object of keywords and their scores in decimal string. If no # keyword is attached, `nil' is returned. def keywords() @kwords end # Get the substitute score. # The return value is the substitute score or -1 if it is not set. def score() return -1 if(@score < 0) @score end #-------------------------------- # private methods #-------------------------------- private # Create a document object. # `draft' specifies a string of draft data. def initialize(draft = "") Utility::check_types({ draft=>String }) if $DEBUG @id = -1 @attrs = {} @dtexts = [] @htexts = [] @kwords = nil @score = -1 if draft.length lines = draft.split(/\n/, -1) num = 0 while num < lines.length line = lines[num] num += 1 break if line.length < 1 if line =~ /^%/ if line =~ /^%VECTOR\t/ @kwords = {} unless @kwords fields = line.split(/\t/) i = 1 while i < fields.length - 1 @kwords[fields[i]] = fields[i+1] i += 2 end elsif line =~ /^%SCORE\t/ fields = line.split(/\t/) @score = fields[1].to_i; end next end line = line.gsub(/[ \t\r\n\v\f]+/, " ") line = line.strip.squeeze(" ") if idx = line.index("=") key = line[0...idx] value = line[idx+1...line.length] @attrs[key] = value end end while num < lines.length line = lines[num] num += 1 next unless line.length > 0 if line[0] == 0x9 @htexts.push(line[1...line.length]) if line.length > 1 else @dtexts.push(line) end end end end end #---------------------------------------------------------------- #++ Abstraction of search condition. #---------------------------------------------------------------- class Condition #-------------------------------- # public constants #-------------------------------- public # option: check every N-gram key SURE = 1 << 0 # option: check N-gram keys skipping by one USUAL = 1 << 1 # option: check N-gram keys skipping by two FAST = 1 << 2 # option: check N-gram keys skipping by three AGITO = 1 << 3 # option: without TF-IDF tuning NOIDF = 1 << 4 # option: with the simplified phrase SIMPLE = 1 << 10 # option: with the rough phrase ROUGH = 1 << 11 # option: with the union phrase UNION = 1 << 15 # option: with the intersection phrase ISECT = 1 << 16 #-------------------------------- # public methods #-------------------------------- public # Set the search phrase. # `phrase' specifies a search phrase. # The return value is always `nil'. def set_phrase(phrase) Utility::check_types({ phrase=>String }) if $DEBUG phrase = phrase.gsub(/[ \t\r\n\v\f]+/, " ") phrase = phrase.strip.squeeze(" ") @phrase = phrase nil end # Add an expression for an attribute. # `expr' specifies an expression for an attribute. # The return value is always `nil'. def add_attr(expr) Utility::check_types({ expr=>String }) if $DEBUG expr = expr.gsub(/[ \t\r\n\v\f]+/, " ") expr = expr.strip.squeeze(" ") @attrs.push(expr) nil end # Set the order of a condition object. # `expr' specifies an expression for the order. By default, the order is by score descending. # The return value is always `nil'. def set_order(expr) Utility::check_types({ expr=>String }) if $DEBUG expr = expr.gsub(/[ \t\r\n\v\f]+/, " ") expr = expr.strip.squeeze(" ") @order = expr nil end # Set the maximum number of retrieval. # `max' specifies the maximum number of retrieval. By default, the number of retrieval is # not limited. # The return value is always `nil'. def set_max(max) Utility::check_types({ max=>Integer }) if $DEBUG @max = max if max >= 0 nil end # Set the number of skipped documents. # `skip' specifies the number of documents to be skipped in the search result. # The return value is always `nil'. def set_skip(skip) Utility::check_types({ skip=>Integer }) if $DEBUG @skip = skip if skip >= 0 nil end # Set options of retrieval. # `options' specifies options: `Condition::SURE' specifies that it checks every N-gram # key, `Condition::USU', which is the default, specifies that it checks N-gram keys # with skipping one key, `Condition::FAST' skips two keys, `Condition::AGITO' # skips three keys, `Condition::NOIDF' specifies not to perform TF-IDF tuning, # `Condition::SIMPLE' specifies to use simplified phrase, `Condition::ROUGH' specifies to use # rough phrase, `Condition.UNION' specifies to use union phrase, `Condition.ISECT' specifies # to use intersection phrase. Each option can be specified at the same time by bitwise or. # If keys are skipped, though search speed is improved, the relevance ratio grows less. # The return value is always `nil'. def set_options(options) Utility::check_types({ options=>Integer }) if $DEBUG @options |= options nil end # Set permission to adopt result of the auxiliary index. # `min' specifies the minimum hits to adopt result of the auxiliary index. If it is not more # than 0, the auxiliary index is not used. By default, it is 32. # The return value is always `nil'. def set_auxiliary(min) Utility::check_types({ min=>Integer }) if $DEBUG @auxiliary = min nil end # Set the attribute distinction filter. # `name' specifies the name of an attribute to be distinct. # The return value is always `nil'. def set_distinct(name) Utility::check_types({ name=>String }) if $DEBUG name = name.gsub(/[ \t\r\n\v\f]+/, " ") name = name.strip.squeeze(" ") @distinct = name nil end # Set the mask of targets of meta search. # `mask' specifies a masking number. 1 means the first target, 2 means the second target, 4 # means the third target, and power values of 2 and their summation compose the mask. # The return value is always `nil'. def set_mask(mask) Utility::check_types({ mask=>Integer }) if $DEBUG @mask = mask nil end # Get the search phrase. # The return value is the search phrase. def phrase() @phrase end # Get expressions for attributes. # The return value is expressions for attributes. def attrs() @attrs end # Get the order expression. # The return value is the order expression. def order() @order end # Get the maximum number of retrieval. # The return value is the maximum number of retrieval. def max() @max end # Get the number of skipped documents. # The return value is the number of documents to be skipped in the search result. def skip() @skip end # Get options of retrieval. # The return value is options by bitwise or. def options() @options end # Get permission to adopt result of the auxiliary index. # The return value is permission to adopt result of the auxiliary index. def auxiliary() @auxiliary end # Get the attribute distinction filter. # The return value is the name of the distinct attribute. def distinct() @distinct end # Get the mask of targets of meta search. # The return value is the mask of targets of meta search. def mask() @mask end #-------------------------------- # private methods #-------------------------------- private # Create a search condition object. def initialize() @phrase = nil @attrs = [] @order = nil @max = -1 @skip = 0 @options = 0 @auxiliary = 32 @distinct = nil @mask = 0 end end #---------------------------------------------------------------- #++ Abstraction of document in result set. #---------------------------------------------------------------- class ResultDocument #-------------------------------- # public methods #-------------------------------- public # Get the URI. # The return value is the URI of the result document object. def uri() @uri end # Get an array of attribute names. # The return value is an array object of attribute names. def attr_names() @attrs.keys.sort end # Get the value of an attribute. # The return value is the value of the attribute or `nil' if it does not exist. def attr(name) Utility::check_types({ name=>String }) if $DEBUG @attrs[name] end # Get the snippet of a result document object. # The return value is a string of the snippet of the result document object. There are tab # separated values. Each line is a string to be shown. Though most lines have only one # field, some lines have two fields. If the second field exists, the first field is to be # shown with highlighted, and the second field means its normalized form. def snippet() @snippet end # Get keywords. # The return value is a string of serialized keywords of the result document object. There # are tab separated values. Keywords and their scores come alternately. def keywords() @keywords end #-------------------------------- # private methods #-------------------------------- private # Create a result document object. def initialize(uri, attrs, snippet, keywords) Utility::check_types({ uri=>String, attrs=>Hash, snippet=>String, keywords=>String }) if $DEBUG @uri = uri @attrs = attrs @snippet = snippet @keywords = keywords end end #---------------------------------------------------------------- #++ Abstraction of result set from node. #---------------------------------------------------------------- class NodeResult #-------------------------------- # public methods #-------------------------------- public # Get the number of documents. # The return value is the number of documents. def doc_num() @docs.length end # Get the value of hint information. # The return value is a result document object or `nil' if the index is out of bounds. def get_doc(index) Utility::check_types({ index=>Integer }) if $DEBUG return nil if index < 0 || index >= @docs.length @docs[index] end # Get the value of hint information. # `key' specifies the key of a hint. "VERSION", "NODE", "HIT", "HINT#n", "DOCNUM", "WORDNUM", # "TIME", "TIME#n", "LINK#n", and "VIEW" are provided for keys. # The return value is the hint or `nil' if the key does not exist. def hint(key) Utility::check_types({ key=>String }) if $DEBUG @hints[key] end #-------------------------------- # private methods #-------------------------------- private # Create a node result object. def initialize(docs, hints) Utility::check_types({ docs=>Array, hints=>Hash }) if $DEBUG @docs = docs @hints = hints end end #---------------------------------------------------------------- #++ Abstraction of connection to P2P node. #---------------------------------------------------------------- class Node #-------------------------------- # public methods #-------------------------------- public # Set the URL of a node server. # `url' specifies the URL of a node. # The return value is always `nil'. def set_url(url) Utility::check_types({ url=>String }) if $DEBUG @url = url nil end # Set the proxy information. # `host' specifies the host name of a proxy server. # `port' specifies the port number of the proxy server. # The return value is always `nil'. def set_proxy(host, port) Utility::check_types({ host=>String, port=>Integer }) if $DEBUG @pxhost = host @pxport = port nil end # Set timeout of a connection. # `sec' specifies timeout of the connection in seconds. # The return value is always `nil'. def set_timeout(sec) Utility::check_types({ sec=>Integer }) if $DEBUG @timeout = sec nil end # Set the authentication information. # `name' specifies the name of authentication. # `passwd' specifies the password of the authentication. # The return value is always `nil'. def set_auth(name, password) Utility::check_types({ name=>String, password=>String }) if $DEBUG @auth = name + ":" + password nil end # Get the status code of the last request. # The return value is the status code of the last request. -1 means failure of connection. def status() @status end # Synchronize updating contents of the database. # The return value is true if success, else it is false. def sync() @status = -1 return false unless @url turl = @url + "/sync" reqheads = [ "Content-Type: application/x-www-form-urlencoded" ] reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, "", nil, nil) @status = rv rv == 200 end # Optimize the database. # The return value is true if success, else it is false. def optimize() @status = -1 return false unless @url turl = @url + "/optimize" reqheads = [ "Content-Type: application/x-www-form-urlencoded" ] reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, "", nil, nil) @status = rv rv == 200 end # Add a document. # `doc' specifies a document object. The document object should have the URI attribute. # The return value is true if success, else it is false. def put_doc(doc) Utility::check_types({ doc=>Document }) if $DEBUG @status = -1 return false unless @url turl = @url + "/put_doc" reqheads = [ "Content-Type: text/x-estraier-draft" ] reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth reqbody = doc.dump_draft rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, nil) @status = rv rv == 200 end # Remove a document. # `id' specifies the ID number of a registered document. # The return value is true if success, else it is false. def out_doc(id) Utility::check_types({ id=>Integer }) if $DEBUG @status = -1 return false unless @url turl = @url + "/out_doc" reqheads = [ "Content-Type: application/x-www-form-urlencoded" ] reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth reqbody = "id=" + id.to_s rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, nil) @status = rv rv == 200 end # Remove a document specified by URI. # `uri' specifies the URI of a registered document. # The return value is true if success, else it is false. def out_doc_by_uri(uri) Utility::check_types({ uri=>String }) if $DEBUG @status = -1 return false unless @url turl = @url + "/out_doc" reqheads = [ "Content-Type: application/x-www-form-urlencoded" ] reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth reqbody = "uri=" + CGI::escape(uri) rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, nil) @status = rv rv == 200 end # Edit attributes of a document. # `doc' specifies a document object. # The return value is true if success, else it is false. def edit_doc(doc) Utility::check_types({ doc=>Document }) if $DEBUG @status = -1 return false unless @url turl = @url + "/edit_doc" reqheads = [ "Content-Type: text/x-estraier-draft" ] reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth reqbody = doc.dump_draft rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, nil) @status = rv rv == 200 end # Retrieve a document. # `id' specifies the ID number of a registered document. # The return value is a document object. On error, `nil' is returned. def get_doc(id) Utility::check_types({ id=>Integer }) if $DEBUG @status = -1 return nil unless @url turl = @url + "/get_doc" reqheads = [ "Content-Type: application/x-www-form-urlencoded" ] reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth reqbody = "id=" + id.to_s resbody = StringIO::new rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, resbody) @status = rv return nil if rv != 200 Document::new(resbody.string) end # Retrieve a document. # `uri' specifies the URI of a registered document. # The return value is a document object. On error, `nil' is returned. def get_doc_by_uri(uri) Utility::check_types({ uri=>String }) if $DEBUG @status = -1 return nil unless @url turl = @url + "/get_doc" reqheads = [ "Content-Type: application/x-www-form-urlencoded" ] reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth reqbody = "uri=" + CGI::escape(uri) resbody = StringIO::new rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, resbody) @status = rv return nil if rv != 200 Document::new(resbody.string) end # Retrieve the value of an attribute of a document. # `id' specifies the ID number of a registered document. # `name' specifies the name of an attribute. # The return value is the value of the attribute or `nil' if it does not exist. def get_doc_attr(id, name) Utility::check_types({ id=>Integer, name=>String }) if $DEBUG @status = -1 return nil unless @url turl = @url + "/get_doc_attr" reqheads = [ "Content-Type: application/x-www-form-urlencoded" ] reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth reqbody = "id=" + id.to_s + "&attr=" + CGI::escape(name) resbody = StringIO::new rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, resbody) @status = rv return nil if rv != 200 resbody.string.chomp end # Retrieve the value of an attribute of a document specified by URI. # `uri' specifies the URI of a registered document. # `name' specifies the name of an attribute. # The return value is the value of the attribute or `nil' if it does not exist. def get_doc_attr_by_uri(uri, name) Utility::check_types({ uri=>String, name=>String }) if $DEBUG @status = -1 return nil unless @url turl = @url + "/get_doc_attr" reqheads = [ "Content-Type: application/x-www-form-urlencoded" ] reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth reqbody = "uri=" + CGI::escape(uri) + "&attr=" + CGI::escape(name) resbody = StringIO::new rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, resbody) @status = rv return nil if rv != 200 resbody.string.chomp end # Extract keywords of a document. # `id' specifies the ID number of a registered document. # The return value is a hash object of keywords and their scores in decimal string or `nil' # on error. def etch_doc(id) Utility::check_types({ id=>Integer }) if $DEBUG @status = -1 return nil unless @url turl = @url + "/etch_doc" reqheads = [ "Content-Type: application/x-www-form-urlencoded" ] reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth reqbody = "id=" + id.to_s resbody = StringIO::new rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, resbody) @status = rv return nil if rv != 200 kwords = {} lines = resbody.string.split(/\n/, -1) for i in 0...lines.length pair = lines[i].split(/\t/) next if pair.length < 2 kwords[pair[0]] = pair[1] end kwords end # Extract keywords of a document specified by URI. # `uri' specifies the URI of a registered document. # The return value is a hash object of keywords and their scores in decimal string or `nil' # on error. def etch_doc_by_uri(uri) Utility::check_types({ uri=>String }) if $DEBUG @status = -1 return nil unless @url turl = @url + "/etch_doc" reqheads = [ "Content-Type: application/x-www-form-urlencoded" ] reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth reqbody = "uri=" + CGI::escape(uri) resbody = StringIO::new rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, resbody) @status = rv return nil if rv != 200 kwords = {} lines = resbody.string.split(/\n/, -1) for i in 0...lines.length pair = lines[i].split(/\t/) next if pair.length < 2 kwords[pair[0]] = pair[1] end kwords end # Get the ID of a document specified by URI. # `uri' specifies the URI of a registered document. # The return value is the ID of the document. On error, -1 is returned. def uri_to_id(uri) Utility::check_types({ uri=>String }) if $DEBUG @status = -1 return -1 unless @url turl = @url + "/uri_to_id" reqheads = [ "Content-Type: application/x-www-form-urlencoded" ] reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth reqbody = "uri=" + CGI::escape(uri) resbody = StringIO::new rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, resbody) @status = rv return nil if rv != 200 resbody.string.chomp end # Get the name. # The return value is the name. On error, `nil' is returned. def name() set_info if !@name @name end # Get the label. # The return value is the label. On error, `nil' is returned. def label() set_info if !@label @label end # Get the number of documents. # The return value is the number of documents. On error, -1 is returned. def doc_num() set_info if @dnum < 0 @dnum end # Get the number of unique words. # The return value is the number of unique words. On error, -1 is returned. def word_num() set_info if @wnum < 0 @wnum end # Get the size of the datbase. # The return value is the size of the datbase. On error, -1.0 is returned. def size() set_info if @size < 0.0 @size end # Get the usage ratio of the cache. # The return value is the usage ratio of the cache. On error, -1.0 is returned. def cache_usage() @status = -1 return -1.0 unless @url turl = @url + "/cacheusage" reqheads = [] reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth resbody = StringIO::new rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, nil, nil, resbody) @status = rv return -1.0 if rv != 200 return resbody.string.strip.to_f end # Get an array of names of administrators. # The return value is an array object of names of administrators. On error, `nil' is # returned. def admins() set_info unless @admins @admins end # Get an array of names of users. # The return value is an array object of names of users. On error, `nil' is returned. def users() set_info unless @users @users end # Get an array of expressions of links. # The return value is an array object of expressions of links. Each element is a TSV string # and has three fields of the URL, the label, and the score. On error, `nil' is returned. def links() set_info unless @links @links end # Search for documents corresponding a condition. # `cond' specifies a condition object. # `depth' specifies the depth of meta search. # The return value is a node result object. On error, `nil' is returned. def search(cond, depth) Utility::check_types({ cond=>Condition, depth=>Integer }) if $DEBUG @status = -1 return nil unless @url turl = @url + "/search" reqheads = [ "Content-Type: application/x-www-form-urlencoded" ] reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth reqbody = Utility::cond_to_query(cond, depth, @wwidth, @hwidth, @awidth) resbody = StringIO::new rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, resbody) @status = rv return nil if rv != 200 lines = resbody.string.split(/\n/, -1) return nil if lines.length < 1 docs = [] hints = {} nres = NodeResult::new(docs, hints) border = lines[0] isend = false lnum = 1 while lnum < lines.length line = lines[lnum] lnum += 1 if line.length >= border.length && line.index(border) == 0 isend = true if line[border.length...line.length] == ":END" break end lidx = line.index("\t") if lidx key = line[0...lidx] value = line[(lidx+1)...line.length] hints[key] = value end end snum = lnum while !isend && lnum < lines.length line = lines[lnum] lnum += 1 if line.length >= border.length && line.index(border) == 0 if lnum > snum rdattrs = {} sb = StringIO::new rdvector = "" rlnum = snum while rlnum < lnum - 1 rdline = lines[rlnum].strip rlnum += 1 break if rdline.length < 1 if rdline =~ /^%/ lidx = rdline.index("\t") rdvector = rdline[(lidx+1)...rdline.length] if rdline =~ /%VECTOR/ && lidx else lidx = rdline.index("=") if lidx key = rdline[0...lidx] value = rdline[(lidx+1)...rdline.length] rdattrs[key] = value end end end while rlnum < lnum - 1 rdline = lines[rlnum] rlnum += 1 sb.printf("%s\n", rdline) end rduri = rdattrs["@uri"] rdsnippet = sb.string if rduri rdoc = ResultDocument::new(rduri, rdattrs, rdsnippet, rdvector) docs.push(rdoc) end end snum = lnum isend = true if line[border.length...line.length] == ":END" end end return nil if !isend return nres end # Set width of snippet in the result. # `wwidth' specifies whole width of a snippet. By default, it is 480. If it is 0, no # snippet is sent. If it is negative, whole body text is sent instead of snippet. # `hwidth' specifies width of strings picked up from the beginning of the text. By default, # it is 96. If it is negative 0, the current setting is not changed. # `awidth' specifies width of strings picked up around each highlighted word. By default, # it is 96. If it is negative, the current setting is not changed. def set_snippet_width(wwidth, hwidth, awidth) @wwidth = wwidth @hwidth = hwidth if hwidth >= 0 @awidth = awidth if awidth >= 0 end # Manage a user account of a node. # `name' specifies the name of a user. # `mode' specifies the operation mode. 0 means to delete the account. 1 means to set the # account as an administrator. 2 means to set the account as a guest. # The return value is true if success, else it is false. def set_user(name, mode) Utility::check_types({ name=>String, mode=>Integer }) if $DEBUG @status = -1 return false unless @url turl = @url + "/_set_user" reqheads = [ "Content-Type: application/x-www-form-urlencoded" ] reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth reqbody = "name=" + CGI::escape(name) + "&mode=" + mode.to_s rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, nil) @status = rv rv == 200 end # Manage a link of a node. # `url' specifies the URL of the target node of a link. # `label' specifies the label of the link. # `credit' specifies the credit of the link. If it is negative, the link is removed. # The return value is true if success, else it is false. def set_link(url, label, credit) Utility::check_types({ url=>String, label=>String, credit=>Integer }) if $DEBUG @status = -1 return false unless @url turl = @url + "/_set_link" reqheads = [ "Content-Type: application/x-www-form-urlencoded" ] reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth reqbody = "url=" + CGI::escape(url) + "&label=" + label reqbody += "&credit=" + credit.to_s if credit >= 0 rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, reqbody, nil, nil) @status = rv rv == 200 end #-------------------------------- # private methods #-------------------------------- private # Create a node connection object. def initialize() @url = nil @pxhost = nil @pxport = -1 @timeout = -1 @auth = nil @name = nil @label = nil @dnum = -1 @wnum = -1 @size = -1.0 @admins = nil @users = nil @links = nil @wwidth = 480 @hwidth = 96 @awidth = 96 @status = -1 end # Set information of the node. def set_info() @status = -1 return unless @url turl = @url + "/inform" reqheads = [] reqheads.push("Authorization: Basic " + Utility::base_encode(@auth)) if @auth resbody = StringIO::new rv = Utility::shuttle_url(turl, @pxhost, @pxport, @timeout, reqheads, nil, nil, resbody) @status = rv return if rv != 200 lines = resbody.string.split(/\n/, -1) return if lines.length < 1 elems = lines[0].chomp.split(/\t/) return if elems.length != 5 @name = elems[0] @label = elems[1] @dnum = elems[2].to_i @wnum = elems[3].to_i @size = elems[4].to_f return if lines.length < 2 lnum = 1 lnum += 1 if(lnum < lines.length && lines[lnum].length < 1) @admins = [] while(lnum < lines.length) line = lines[lnum] break if line.length < 1 @admins.push(line) lnum += 1 end lnum += 1 if(lnum < lines.length && lines[lnum].length < 1) @users = [] while(lnum < lines.length) line = lines[lnum] break if line.length < 1 @users.push(line) lnum += 1 end lnum += 1 if(lines[lnum].length < 1) @links = [] while(lnum < lines.length) line = lines[lnum] break if line.length < 1 @links.push(line) if line.split(/\t/).length == 3 lnum += 1 end end end #:stopdoc: # # Module for utility # module Utility public # Check types of arguments # `types' specifies a hash object whose keys are arguments and values are class objects. # If there is a invalid object, an exception is thrown. def check_types(types) i = 0 types.each_key do |key| i += 1 unless key.kind_of?(types[key]) || key == nil raise ArgumentError::new("Argument#" + i.to_s + " should be a kind of " + types[key].to_s) end end end module_function :check_types # Perform an interaction of a URL. # `url' specifies a URL. # `pxhost' specifies the host name of a proxy. If it is `nil', it is not used. # `pxport' specifies the port number of the proxy. # `outsec' specifies timeout in seconds. If it is negative, it is not used. # `reqheads' specifies an array object of extension headers. If it is `nil', it is not used. # `reqbody' specifies the pointer of the entitiy body of request. If it is `nil', "GET" # method is used. # `resheads' specifies an array object into which headers of response is stored. If it is # `nil' it is not used. # `resbody' specifies stream object into which the entity body of response is stored. If it # is `nil', it is not used. # The return value is the status code of the response or -1 on error. def shuttle_url(url, pxhost, pxport, outsec, reqheads, reqbody, resheads, resbody) begin status = -1 th = Thread::start do url = URI::parse(url) url.normalize Thread::current.exit if url.scheme != "http" || !url.host || url.port < 1 if pxhost host = pxhost port = pxport query = "http://" + url.host + ":" + url.port.to_s + url.path else host = url.host port = url.port query = url.path end query += "?" + url.query if url.query && !reqbody begin sock = TCPSocket.open(host, port) if reqbody sock.printf("POST " + query + " HTTP/1.0\r\n") else sock.printf("GET " + query + " HTTP/1.0\r\n") end sock.printf("Host: %s:%d\r\n", url.host, url.port) sock.printf("Connection: close\r\n") sock.printf("User-Agent: HyperEstraierForRuby/1.0.0\r\n") if reqheads reqheads.each do |line| sock.printf("%s\r\n", line) end end sock.printf("Content-Length: %d\r\n", reqbody.length) if reqbody sock.printf("\r\n") sock.write(reqbody) if reqbody line = sock.gets.chomp elems = line.split(/ */) Thread::current.exit if elems.length < 3 || !(elems[0] =~ /^HTTP/) status = elems[1].to_i resheads.push(line) if resheads begin line = sock.gets.chomp resheads.push(line) if resheads end while line.length > 0 while buf = sock.read(8192) resbody.write(buf) if resbody end ensure sock.close if sock end end if outsec >= 0 unless th.join(outsec) th.exit th.join return -1 end else th.join end return status rescue return -1 end end module_function :shuttle_url # Serialize a condition object into a query string. # `cond' specifies a condition object. # `depth' specifies depth of meta search. # `wwidth' specifies whole width of a snippet. # `hwidth' specifies width of strings picked up from the beginning of the text. # `awidth' specifies width of strings picked up around each highlighted word. # The return value is the serialized string. def cond_to_query(cond, depth, wwidth, hwidth, awidth) buf = StringIO::new if cond.phrase buf.write("&") if buf.length > 0 buf.write("phrase=") buf.write(CGI::escape(cond.phrase)) end for i in 0...cond.attrs.length buf.write("&") if buf.length > 0 buf.write("attr" + (i + 1).to_s + "=") buf.write(CGI::escape(cond.attrs[i])) end if cond.order buf.write("&") if buf.length > 0 buf.write("order=") buf.write(CGI::escape(cond.order)) end if cond.max >= 0 buf.write("&") if buf.length > 0 buf.write("max=" + cond.max.to_s) else buf.write("&") if buf.length > 0 buf.write("max=" + (1 << 30).to_s) end buf.write("&options=" + cond.options.to_s) if cond.options > 0 buf.write("&auxiliary=" + cond.auxiliary.to_s) if cond.distinct buf.write("&distinct=") buf.write(CGI::escape(cond.distinct)) end buf.write("&depth=" + depth.to_s) if depth > 0 buf.write("&wwidth=" + wwidth.to_s) buf.write("&hwidth=" + hwidth.to_s) buf.write("&awidth=" + awidth.to_s) buf.write("&skip=" + cond.skip.to_s) buf.write("&mask=" + cond.mask.to_s) buf.string end module_function :cond_to_query # Encode a byte sequence with Base64 encoding. # `data' specifyes a string object. # The return value is the encoded string. def base_encode(data) [data].pack("m").gsub(/[ \n]/, "") end module_function :base_encode end end # END OF FILE hyperestraier-1.4.13/rubypure/example/000077500000000000000000000000001125261632700200035ustar00rootroot00000000000000hyperestraier-1.4.13/rubypure/example/Makefile000066400000000000000000000007741125261632700214530ustar00rootroot00000000000000# Makefile for sample programs of the Ruby interface #================================================================ # Setting Variables #================================================================ # Generic settings SHELL = /bin/sh #================================================================ # Actions #================================================================ all : clean : rm -rf *.exe *.o a.out check.out gmon.out leak.log casket *~ .PHONY : all clean # END OF FILE hyperestraier-1.4.13/rubypure/example/example001.rb000066400000000000000000000012311125261632700222010ustar00rootroot00000000000000require "estraierpure" include EstraierPure # create and configure the node connecton object node = Node::new node.set_url("http://localhost:1978/node/test1") node.set_auth("admin", "admin") # create a document object doc = Document::new # add attributes to the document object doc.add_attr("@uri", "http://estraier.gov/example.txt") doc.add_attr("@title", "Over the Rainbow") # add the body text to the document object doc.add_text("Somewhere over the rainbow. Way up high.") doc.add_text("There's a land that I heard of once in a lullaby.") # register the document object to the node unless node.put_doc(doc) STDERR.printf("error: %d\n", node.status) end hyperestraier-1.4.13/rubypure/example/example002.rb000066400000000000000000000014351125261632700222100ustar00rootroot00000000000000require "estraierpure" include EstraierPure # create and configure the node connecton object node = Node::new node.set_url("http://localhost:1978/node/test1") # create a search condition object cond = Condition::new # set the search phrase to the search condition object cond.set_phrase("rainbow AND lullaby") # get the result of search nres = node.search(cond, 0); if nres # for each document in the result for i in 0...nres.doc_num # get a result document object rdoc = nres.get_doc(i) # display attributes value = rdoc.attr("@uri") printf("URI: %s\n", value) if value value = rdoc.attr("@title") printf("Title: %s\n", value) if value # display the snippet text */ printf("%s", rdoc.snippet) end else STDERR.printf("error: %d\n", node.status) end hyperestraier-1.4.13/rubypure/overview000066400000000000000000000101241125261632700201370ustar00rootroot00000000000000= Pure Ruby Interface of Hyper Estraier Hyper Estraier is a full-text search system for communities. == Introduction This is a package implementing the node API of {Hyper Estraier}[http://hyperestraier.sourceforge.net/]. This is a pure ruby package. So, it works on Linux, Mac OS X, Windows, and so on. It does not depend on the core library of Hyper Estraier. Applications are implemented as clients of node servers running on local or remote machines. This package requires Ruby 1.8.4 or later versions. Though Hyper Estraier itself is released under the terms of the GNU LGPL, this package is released under the terms of a BSD-style license. == Setting Get the package of the latest version of Hyper Estraier. Extract the package and enter the sub directory `rubypure' and perform installation. cd rubypure ./configure make su make install The package `estraierpure' should be required in each source file of application programs and include the module `EstraierPure' at pleasure. == Example of Gatherer The following is the simplest implementation of a gatherer. require "estraierpure" include EstraierPure # create and configure the node connecton object node = Node::new node.set_url("http://localhost:1978/node/test1") node.set_auth("admin", "admin") # create a document object doc = Document::new # add attributes to the document object doc.add_attr("@uri", "http://estraier.gov/example.txt") doc.add_attr("@title", "Over the Rainbow") # add the body text to the document object doc.add_text("Somewhere over the rainbow. Way up high.") doc.add_text("There's a land that I heard of once in a lullaby.") # register the document object to the node unless node.put_doc(doc) STDERR.printf("error: %d\n", node.status) end ==Example of Searcher The following is the simplest implementation of a searcher. require "estraierpure" include EstraierPure # create and configure the node connecton object node = Node::new node.set_url("http://localhost:1978/node/test1") # create a search condition object cond = Condition::new # set the search phrase to the search condition object cond.set_phrase("rainbow AND lullaby") # get the result of search nres = node.search(cond, 0); if nres # for each document in the result for i in 0...nres.doc_num # get a result document object rdoc = nres.get_doc(i) # display attributes value = rdoc.attr("@uri") printf("URI: %s\n", value) if value value = rdoc.attr("@title") printf("Title: %s\n", value) if value # display the snippet text */ printf("%s", rdoc.snippet) end else STDERR.printf("error: %d\n", node.status) end == License Copyright (C) 2004-2006 Mikio Hirabayashi All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of Mikio Hirabayashi nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. hyperestraier-1.4.13/wavermod.c000066400000000000000000002131461125261632700164720ustar00rootroot00000000000000/************************************************************************************************* * Implementation of wavermod * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #include "wavermod.h" /* private function prototypes */ static void log_close(void); static void db_informer(const char *message, void *opaque); static const char *skiplabel(const char *str); static char *makeabspath(const char *rootdir, const char *path); static int queue_compare(const char *aptr, int asiz, const char *bptr, int bsiz); static int keysc_compare(const void *ap, const void *bp); static void make_doc_from_draft(const char *buf, int size, ESTDOC *doc, CBLIST *links); static void make_doc_from_text(const char *buf, int size, const char *penc, int plang, ESTDOC *doc, CBLIST *links); static int check_binary(const char *buf, int size); static void make_doc_from_html(const char *buf, int size, const char *penc, int plang, ESTDOC *doc, CBLIST *links); static char *html_enc(const char *str); static char *html_raw_text(const char *html); static void make_doc_from_mime(const char *buf, int size, const char *penc, int plang, ESTDOC *doc, CBLIST *links); static void doc_add_attr_mime(ESTDOC *doc, const char *name, const char *value); static void make_doc_with_xcmd(const char *xcmd, const char *url, const char *buf, int size, const char *penc, int plang, ESTDOC *doc, CBLIST *links); /************************************************************************************************* * pseudo API *************************************************************************************************/ /* The handles of the log file. */ FILE *log_fp = NULL; /* Level of logging. */ int log_level = LL_INFO; /* Open the log file. */ int log_open(const char *rootdir, const char *path, int level, int trunc){ char mypath[URIBUFSIZ]; assert(rootdir && path); log_level = level; if(log_fp) return TRUE; if((ESTPATHCHR == '/' && path[0] == ESTPATHCHR) || (ESTPATHCHR == '\\' && ((path[0] >= 'A' && path[0] <= 'Z') || (path[0] >= 'a' && path[0] <= 'z')) && path[1] == ':' && path[2] == '\\')){ sprintf(mypath, "%s", path); } else { sprintf(mypath, "%s%c%s", rootdir, ESTPATHCHR, path); } if(!(log_fp = fopen(mypath, trunc ? "wb" : "ab"))) return FALSE; if(level == LL_CHECK){ fclose(log_fp); log_fp = NULL; return TRUE; } atexit(log_close); return TRUE; } /* Print formatted string into the log file. */ void log_print(int level, const char *format, ...){ static pthread_mutex_t mymutex = PTHREAD_MUTEX_INITIALIZER; va_list ap, aq; const char *lvstr; char *date; if(level < log_level) return; if(pthread_mutex_lock(&mymutex) != 0) return; va_start(ap, format); est_va_copy(aq, ap); switch(level){ case LL_DEBUG: lvstr = "DEBUG"; break; case LL_INFO: lvstr = "INFO"; break; case LL_WARN: lvstr = "WARN"; break; default: lvstr = "ERROR"; break; } date = cbdatestrwww(time(NULL), 0); printf("%s\t%s\t", date, lvstr); vprintf(format, ap); putchar('\n'); fflush(stdout); if(log_fp){ fprintf(log_fp, "%s\t%s\t", date, lvstr); vfprintf(log_fp, format, aq); fputc('\n', log_fp); fflush(log_fp); } free(date); va_end(aq); va_end(ap); pthread_mutex_unlock(&mymutex); } /* Rotete the log file. */ int log_rotate(const char *rootdir, const char *path){ FILE *ifp, *ofp; char mypath[URIBUFSIZ], *wp, iobuf[IOBUFSIZ]; int err, year, month, day, hour, minute, second, len; assert(rootdir && path); if(!log_fp || fflush(log_fp) == -1) return FALSE; err = FALSE; wp = mypath; if((ESTPATHCHR == '/' && path[0] == ESTPATHCHR) || (ESTPATHCHR == '\\' && ((path[0] >= 'A' && path[0] <= 'Z') || (path[0] >= 'a' && path[0] <= 'z')) && path[1] == ':' && path[2] == '\\')){ wp += sprintf(wp, "%s", path); } else { wp += sprintf(wp, "%s%c%s", rootdir, ESTPATHCHR, path); } if(!(ifp = fopen(mypath, "rb"))) return FALSE; cbcalendar(-1, 0, &year, &month, &day, &hour, &minute, &second); sprintf(wp, "-%04d%02d%02d%02d%02d%02d", year, month, day, hour, minute, second); if(!(ofp = fopen(mypath, "wb"))){ fclose(ifp); return FALSE; } while((len = fread(iobuf, 1, IOBUFSIZ, ifp)) > 0){ fwrite(iobuf, 1, len, ofp); } if(fclose(ofp) == -1) err = TRUE; if(fclose(ifp) == -1) err = TRUE; if(fseek(log_fp, 0, SEEK_SET) == -1 || fflush(log_fp) == -1) err = TRUE; if(ftruncate(fileno(log_fp), 0) == -1) err = TRUE; return err ? FALSE : TRUE; } /* Initialize the root directory. */ int waver_init(const char *rootdir, int options){ DEPOT *metadb; CURIA *trace; QUEUE *queue; ESTMTDB *index; FILE *ofp; char path[URIBUFSIZ]; int err, tracebnum, estopts, ecode; assert(rootdir); if(est_mkdir(rootdir) == -1 && errno != EEXIST) return FALSE; err = FALSE; sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, METAFILE); if((metadb = dpopen(path, DP_OWRITER | DP_OCREAT | DP_OTRUNC, MINIBNUM))){ if(!dpput(metadb, MMKMAGIC, -1, MMKMAGVAL, -1, DP_DKEEP)) err = TRUE; if(!dpclose(metadb)) err = TRUE; } else { err = TRUE; } sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, CONFFILE); if((ofp = fopen(path, "wb")) != NULL){ fprintf(ofp, "# seed documents (weight and URL)\n"); fprintf(ofp, "seed: 1.5|http://hyperestraier.sourceforge.net/uguide-en.html\n"); fprintf(ofp, "seed: 1.0|http://hyperestraier.sourceforge.net/pguide-en.html\n"); fprintf(ofp, "seed: 1.0|http://hyperestraier.sourceforge.net/nguide-en.html\n"); fprintf(ofp, "seed: 0.0|http://qdbm.sourceforge.net/\n"); fprintf(ofp, "\n"); fprintf(ofp, "# host name of the proxy\n"); fprintf(ofp, "proxyhost:\n"); fprintf(ofp, "\n"); fprintf(ofp, "# port number of the proxy\n"); fprintf(ofp, "proxyport:\n"); fprintf(ofp, "\n"); fprintf(ofp, "# waiting interval of each request (in milliseconds)\n"); fprintf(ofp, "interval: 500\n"); fprintf(ofp, "\n"); fprintf(ofp, "# timeout of each request (in seconds)\n"); fprintf(ofp, "timeout: 30\n"); fprintf(ofp, "\n"); fprintf(ofp, "# strategy of crawling path" " (0:balanced, 1:similarity, 2:depth, 3:width, 4:random)\n"); fprintf(ofp, "strategy: %d\n", CS_BALANCED); fprintf(ofp, "\n"); fprintf(ofp, "# inheritance ratio of similarity from the parent\n"); fprintf(ofp, "inherit: 0.4\n"); fprintf(ofp, "\n"); fprintf(ofp, "# maximum depth of seed documents\n"); fprintf(ofp, "seeddepth: 0\n"); fprintf(ofp, "\n"); fprintf(ofp, "# maximum depth of recursion\n"); fprintf(ofp, "maxdepth: 20\n"); fprintf(ofp, "\n"); fprintf(ofp, "# standard value for checking mass sites\n"); fprintf(ofp, "masscheck: 500\n"); fprintf(ofp, "\n"); fprintf(ofp, "# maximum number of records of the priority queue\n"); fprintf(ofp, "queuesize: 50000\n"); fprintf(ofp, "\n"); fprintf(ofp, "# regular expressions and replacement strings to normalize URLs\n"); fprintf(ofp, "replace: ^http://127.0.0.1/{{!}}http://localhost/\n"); fprintf(ofp, "\n"); fprintf(ofp, "# allowing regular expressions of URLs to be visited\n"); fprintf(ofp, "allowrx: ^http://\n"); fprintf(ofp, "\n"); fprintf(ofp, "# denying regular expressions of URLs to be visited\n"); fprintf(ofp, "denyrx: \\.(css|js|csv|tsv|log|md5|crc|conf|ini|inf|lnk|sys|tmp|bak)$\n"); fprintf(ofp, "denyrx: \\.(xml|xsl|xslt|rdf|rss|dtd|sgml|sgm)$\n"); fprintf(ofp, "denyrx: \\.(pgp|sig|cer|csr|pem|key|b64|uu|uue|[0-9])$\n"); fprintf(ofp, "denyrx: \\.(rtf|pdf|ps|eps|ai|doc|xls|ppt|sxw|sxc|sxi|xdw|jtd|oas|swf)$\n"); fprintf(ofp, "denyrx: \\.(zip|tar|tgz|gz|bz2|tbz2|z|lha|lzh)(\\?.*)?$\n"); fprintf(ofp, "denyrx: \\.(7z|lzo|lzma|cpio|shar|cab|rar|sit|ace|hqx)(\\?.*)?$\n"); fprintf(ofp, "denyrx: \\.(bin|o|a|so|exe|dll|lib|obj|ocx|class|jar|war)(\\?.*)?$\n"); fprintf(ofp, "denyrx: \\.(rpm|deb|qdb|qdb|dbx|dbf|dat|msi|bat|com|iso)(\\?.*)?$\n"); fprintf(ofp, "denyrx: \\.(png|gif|jpg|jpeg|tif|tiff|bmp|ico|pbm|pgm|ppm|xbm|xpm|dvi)$\n"); fprintf(ofp, "denyrx: \\.(au|snd|mid|midi|kar|smf|mp2|mp3|m3u|wav|wma|wmp|asx|at3|aif)$\n"); fprintf(ofp, "denyrx: \\.(mpg|mpeg|qt|mov|avi|wmv|wvx|asf|ram|rm)$\n"); fprintf(ofp, "denyrx: (/core$|/core\\.[0-9]*$|/casket/)\n"); fprintf(ofp, "denyrx: ://(localhost|[a-z]*\\.localdomain|127\\.0\\.0\\.1)/\n"); fprintf(ofp, "\n"); fprintf(ofp, "# denying regular expressions of URLs to be indexed\n"); fprintf(ofp, "noidxrx: /\\?[a-z]=[a-z](;|$)\n"); fprintf(ofp, "\n"); fprintf(ofp, "# URL rules (regular expressions and media types)\n"); fprintf(ofp, "urlrule: \\.est${{!}}text/x-estraier-draft\n"); fprintf(ofp, "urlrule: \\.(eml|mime|mht|mhtml)${{!}}message/rfc822\n"); fprintf(ofp, "\n"); fprintf(ofp, "# media type rules (regular expressions and filter commands)\n"); fprintf(ofp, "typerule: ^text/x-estraier-draft${{!}}%s\n", DRAFTCMD); fprintf(ofp, "typerule: ^text/plain${{!}}%s\n", TEXTCMD); fprintf(ofp, "typerule: ^(text/html|application/xhtml+xml)${{!}}%s\n", HTMLCMD); fprintf(ofp, "typerule: ^message/rfc822${{!}}%s\n", MIMECMD); fprintf(ofp, "\n"); fprintf(ofp, "# preferred language (0:English, 1:Japanese, 2:Chinese, 3:Korean, 4:misc)\n"); fprintf(ofp, "language: 0\n"); fprintf(ofp, "\n"); fprintf(ofp, "# text size limitation (in kilobytes)\n"); fprintf(ofp, "textlimit: 128\n"); fprintf(ofp, "\n"); fprintf(ofp, "# total number of keywords for seed documents\n"); fprintf(ofp, "seedkeynum: 256\n"); fprintf(ofp, "\n"); fprintf(ofp, "# number of keywords saved for each document\n"); fprintf(ofp, "savekeynum: 32\n"); fprintf(ofp, "\n"); fprintf(ofp, "# number of threads running in parallel\n"); fprintf(ofp, "threadnum: 10\n"); fprintf(ofp, "\n"); fprintf(ofp, "# number of documents to collect\n"); fprintf(ofp, "docnum: 10000\n"); fprintf(ofp, "\n"); fprintf(ofp, "# running time period (in s:seconds, m:minutes, h:hours, d:days)\n"); fprintf(ofp, "period: 10000s\n"); fprintf(ofp, "\n"); fprintf(ofp, "# revisit span (in s:seconds, m:minutes, h:hours, d:days)\n"); fprintf(ofp, "revisit: 7d\n"); fprintf(ofp, "\n"); fprintf(ofp, "# maximum size of the index cache (in megabytes)\n"); fprintf(ofp, "cachesize: 256\n"); fprintf(ofp, "\n"); fprintf(ofp, "# remote nodes for alternative indexes (ID number and URL)\n"); fprintf(ofp, "#nodeserv: 1|http://admin:admin@localhost:1978/node/node1\n"); fprintf(ofp, "#nodeserv: 2|http://admin:admin@localhost:1978/node/node2\n"); fprintf(ofp, "#nodeserv: 3|http://admin:admin@localhost:1978/node/node3\n"); fprintf(ofp, "\n"); fprintf(ofp, "# path of the log file (relative path or absolute path)\n"); fprintf(ofp, "logfile: %s\n", LOGFILE); fprintf(ofp, "\n"); fprintf(ofp, "# logging level (1:debug, 2:information, 3:warning, 4:error, 5:none)\n"); fprintf(ofp, "loglevel: 2\n"); fprintf(ofp, "\n"); fprintf(ofp, "# path of the draft directory (relative path or absolute path)\n"); fprintf(ofp, "draftdir:\n"); fprintf(ofp, "\n"); fprintf(ofp, "# path of the entity directory (relative path or absolute path)\n"); fprintf(ofp, "entitydir:\n"); fprintf(ofp, "\n"); fprintf(ofp, "# postprocessor for retrieved files\n"); fprintf(ofp, "postproc:\n"); fprintf(ofp, "\n"); if(fclose(ofp) == EOF) err = TRUE; } else { err = TRUE; } tracebnum = TRACEBNUM; estopts = 0; if(options & WI_PERFNG){ estopts |= ESTDBPERFNG; } else if(options & WI_CHRCAT){ estopts |= ESTDBCHRCAT; } if(options & WI_SMALL){ tracebnum = TRACEBNUM / 2; estopts |= ESTDBSMALL; } else if(options & WI_LARGE){ tracebnum = TRACEBNUM * 2; estopts |= ESTDBLARGE; } else if(options & WI_HUGE){ tracebnum = TRACEBNUM * 4; estopts |= ESTDBHUGE; } if(options & WI_SCVOID){ estopts |= ESTDBSCVOID; } else if(options & WI_SCINT){ estopts |= ESTDBSCINT; } else if(options & WI_SCASIS){ estopts |= ESTDBSCASIS; } sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, QUEUEFILE); unlink(path); if((queue = queue_open(path)) != NULL){ if(!queue_close(queue)) err = TRUE; } else { err = TRUE; } sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, TRACEFILE); if((trace = cropen(path, CR_OWRITER | CR_OCREAT | CR_OTRUNC, tracebnum, TRACEDNUM)) != NULL){ if(!crclose(trace)) err = TRUE; } else { err = TRUE; } sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, INDEXDIR); if((index = est_mtdb_open(path, ESTDBWRITER | ESTDBCREAT | ESTDBTRUNC | estopts, &ecode)) != NULL){ if(!est_mtdb_add_attr_index(index, ESTDATTRURI, ESTIDXATTRSTR)) err = TRUE; if(!est_mtdb_add_attr_index(index, ESTDATTRTITLE, ESTIDXATTRSTR)) err = TRUE; if(!est_mtdb_add_attr_index(index, ESTDATTRMDATE, ESTIDXATTRSEQ)) err = TRUE; if(!est_mtdb_close(index, &ecode)) err = TRUE; } else { err = TRUE; } sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, MYTMPDIR); est_mkdir(path); sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, LOGFILE); if((ofp = fopen(path, "wb")) != NULL){ if(fclose(ofp) == EOF) err = TRUE; } else { err = TRUE; } return err ? FALSE : TRUE; } /* Open a waver handle. */ WAVER *waver_open(const char *rootdir){ WAVER *waver; UNRULE unrule; PMRULE pmrule; URLRULE urlrule; MTRULE mtrule; DEPOT *metadb; CURIA *trace; QUEUE *queue; ESTMTDB *index; ESTNODE *node; CBLIST *lines; const char *rp, *pv, *logfile; char path[URIBUFSIZ], *tmp; int i, ecode, loglevel, num; struct stat sbuf; assert(rootdir); if(stat(rootdir, &sbuf) == -1) return NULL; sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, CONFFILE); lines = cbreadlines(path); sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, METAFILE); metadb = dpopen(path, DP_OWRITER, -1); sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, QUEUEFILE); queue = queue_open(path); sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, TRACEFILE); trace = cropen(path, CR_OWRITER, -1, -1); sprintf(path, "%s%c%s", rootdir, ESTPATHCHR, INDEXDIR); index = est_mtdb_open(path, ESTDBWRITER, &ecode); if(!lines || !metadb || !queue || !trace || !index){ if(index) est_mtdb_close(index, &ecode); if(trace) crclose(trace); if(queue) queue_close(queue); if(metadb) dpclose(metadb); if(lines) cblistclose(lines); return NULL; } waver = cbmalloc(sizeof(WAVER)); waver->rootdir = cbmemdup(rootdir, -1); waver->metadb = metadb; waver->queue = queue; waver->trace = trace; waver->index = index; waver->seeds = cbmapopen(); waver->kwords = cbmapopen(); waver->sites = cbmapopen(); waver->pxhost = NULL; waver->pxport = 80; waver->timeout = -1; waver->interval = 0; waver->strategy = CS_BALANCED; waver->inherit = 0.0; waver->seeddepth = 0; waver->maxdepth = INT_MAX; waver->masscheck = INT_MAX; waver->queuesize = INT_MAX; waver->unrules = cblistopen(); waver->pmrules = cblistopen(); waver->urlrules = cblistopen(); waver->mtrules = cblistopen(); waver->language = ESTLANGEN; waver->textlimit = 0; waver->seedkeynum = 0; waver->savekeynum = 0; waver->thnum = 1; waver->docnum = 0; waver->period = 0; waver->revisit = 0; waver->cachesize = 0; waver->nodes = cbmapopenex(MINIBNUM); waver->draftdir = NULL; waver->entitydir = NULL; waver->postproc = NULL; waver->stime = time(NULL); waver->curnum = 0; waver->curnode = 0; waver->minload = 1.0; logfile = LOGFILE; loglevel = LL_INFO; for(i = 0; i < cblistnum(lines); i++){ rp = cblistval(lines, i, NULL); if(cbstrfwimatch(rp, "seed:")){ rp = skiplabel(rp); if((pv = strchr(rp, '|')) != NULL){ tmp = cburlresolve(pv + 1, ""); cbmapput(waver->seeds, tmp, -1, rp, pv - rp, FALSE); free(tmp); } } else if(cbstrfwimatch(rp, "proxyhost:")){ rp = skiplabel(rp); if(rp[0] != '\0') waver->pxhost = cbmemdup(rp, -1); } else if(cbstrfwimatch(rp, "proxyport:")){ rp = skiplabel(rp); if(rp[0] != '\0') waver->pxport = atoi(rp); } else if(cbstrfwimatch(rp, "interval:")){ waver->interval = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "timeout:")){ waver->timeout = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "strategy:")){ waver->strategy = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "inherit:")){ waver->inherit = strtod(skiplabel(rp), NULL); } else if(cbstrfwimatch(rp, "seeddepth:")){ waver->seeddepth = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "maxdepth:")){ waver->maxdepth = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "masscheck:")){ waver->masscheck = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "queuesize:")){ waver->queuesize = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "replace:")){ rp = skiplabel(rp); if((pv = strstr(rp, "{{!}}")) != NULL){ tmp = cbmemdup(rp, pv - rp); if((unrule.regex = est_regex_new(tmp)) != NULL){ unrule.before = tmp; unrule.after = cbmemdup(pv + 5, -1); cblistpush(waver->unrules, (char *)&unrule, sizeof(UNRULE)); } else { free(tmp); } } } else if(cbstrfwimatch(rp, "allowrx:")){ tmp = cbsprintf("*I:%s", skiplabel(rp)); if((pmrule.regex = est_regex_new(tmp)) != NULL){ pmrule.visit = 1; pmrule.index = 1; cblistpush(waver->pmrules, (char *)&pmrule, sizeof(PMRULE)); } free(tmp); } else if(cbstrfwimatch(rp, "denyrx:")){ tmp = cbsprintf("*I:%s", skiplabel(rp)); if((pmrule.regex = est_regex_new(tmp)) != NULL){ pmrule.visit = -1; pmrule.index = 0; cblistpush(waver->pmrules, (char *)&pmrule, sizeof(PMRULE)); } free(tmp); } else if(cbstrfwimatch(rp, "noidxrx:")){ tmp = cbsprintf("*I:%s", skiplabel(rp)); if((pmrule.regex = est_regex_new(tmp)) != NULL){ pmrule.visit = 0; pmrule.index = -1; cblistpush(waver->pmrules, (char *)&pmrule, sizeof(PMRULE)); } free(tmp); } else if(cbstrfwimatch(rp, "urlrule:")){ rp = skiplabel(rp); if((pv = strstr(rp, "{{!}}")) != NULL){ tmp = cbmemdup(rp, pv - rp); if((urlrule.regex = est_regex_new(tmp)) != NULL){ urlrule.type = cbmemdup(pv + 5, -1); cblistpush(waver->urlrules, (char *)&urlrule, sizeof(URLRULE)); } free(tmp); } } else if(cbstrfwimatch(rp, "typerule:")){ rp = skiplabel(rp); if((pv = strstr(rp, "{{!}}")) != NULL){ tmp = cbmemdup(rp, pv - rp); if((mtrule.regex = est_regex_new(tmp)) != NULL){ mtrule.filter = cbmemdup(pv + 5, -1); cblistpush(waver->mtrules, (char *)&mtrule, sizeof(MTRULE)); } free(tmp); } } else if(cbstrfwimatch(rp, "language:")){ waver->language = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "textlimit:")){ waver->textlimit = atoi(skiplabel(rp)) * 1024; } else if(cbstrfwimatch(rp, "seedkeynum:")){ waver->seedkeynum = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "savekeynum:")){ waver->savekeynum = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "threadnum:")){ waver->thnum = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "docnum:")){ waver->docnum = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "period:")){ rp = skiplabel(rp); waver->period = atoi(rp); if(cbstrbwimatch(rp, "m")){ waver->period *= 60; } else if(cbstrbwimatch(rp, "h")){ waver->period *= 3600; } else if(cbstrbwimatch(rp, "d")){ waver->period *= 86400; } } else if(cbstrfwimatch(rp, "revisit:")){ rp = skiplabel(rp); waver->revisit = atoi(rp); if(cbstrbwimatch(rp, "m")){ waver->revisit *= 60; } else if(cbstrbwimatch(rp, "h")){ waver->revisit *= 3600; } else if(cbstrbwimatch(rp, "d")){ waver->revisit *= 86400; } } else if(cbstrfwimatch(rp, "cachesize:")){ waver->cachesize = atoi(skiplabel(rp)) * 1024 * 1024; } else if(cbstrfwimatch(rp, "nodeserv:")){ rp = skiplabel(rp); if((pv = strchr(rp, '|')) != NULL){ pv++; num = atoi(rp); if(num > 0 && !cbmapget(waver->nodes, (char *)&num, sizeof(int), NULL)){ node = est_node_new(pv); cbmapput(waver->nodes, (char *)&num, sizeof(int), (char *)&node, sizeof(ESTNODE *), FALSE); } } } else if(cbstrfwimatch(rp, "logfile:")){ logfile = skiplabel(rp); } else if(cbstrfwimatch(rp, "loglevel:")){ loglevel = atoi(skiplabel(rp)); } else if(cbstrfwimatch(rp, "draftdir:")){ rp = skiplabel(rp); if(rp[0] != '\0' && !waver->draftdir) waver->draftdir = makeabspath(rootdir, rp); } else if(cbstrfwimatch(rp, "entitydir:")){ rp = skiplabel(rp); if(rp[0] != '\0' && !waver->entitydir) waver->entitydir = makeabspath(rootdir, rp); } else if(cbstrfwimatch(rp, "postproc:")){ rp = skiplabel(rp); if(rp[0] != '\0' && !waver->postproc) waver->postproc = cbmemdup(rp, -1); } } if(!log_open(rootdir, logfile, loglevel, FALSE)){ cblistclose(lines); waver_close(waver); return NULL; } if(waver->pxport < 1) waver->pxport = 80; if(waver->seeddepth < 0) waver->seeddepth = 0; if(waver->maxdepth < 0) waver->maxdepth = 0; if(waver->masscheck < 1) waver->masscheck = 1; if(waver->queuesize < 1) waver->queuesize = 1; if(waver->textlimit < 0) waver->textlimit = 0; if(waver->seedkeynum < 0) waver->seedkeynum = 0; if(waver->savekeynum < 0) waver->savekeynum = 0; if(waver->thnum < 1) waver->thnum = 1; if(waver->period < 1) waver->period = 1; if(waver->revisit < 1) waver->revisit = 1; if(waver->cachesize < 1) waver->cachesize = 1; cblistclose(lines); est_mtdb_set_informer(index, db_informer, NULL); est_mtdb_set_cache_size(index, waver->cachesize, -1, -1, -1); return waver; } /* Close a waver handle. */ int waver_close(WAVER *waver){ UNRULE *unrule; PMRULE *pmrule; URLRULE *urlrule; MTRULE *mtrule; ESTNODE *node; const char *kbuf; int i, err, ecode; assert(waver); err = FALSE; free(waver->postproc); free(waver->entitydir); free(waver->draftdir); cbmapiterinit(waver->nodes); while((kbuf = cbmapiternext(waver->nodes, NULL)) != NULL){ node = *(ESTNODE **)cbmapget(waver->nodes, kbuf, sizeof(int), NULL); est_node_delete(node); } cbmapclose(waver->nodes); for(i = 0; i < cblistnum(waver->mtrules); i++){ mtrule = (MTRULE *)cblistval(waver->mtrules, i, NULL); est_regex_delete(mtrule->regex); free(mtrule->filter); } cblistclose(waver->mtrules); for(i = 0; i < cblistnum(waver->urlrules); i++){ urlrule = (URLRULE *)cblistval(waver->urlrules, i, NULL); est_regex_delete(urlrule->regex); free(urlrule->type); } cblistclose(waver->urlrules); for(i = 0; i < cblistnum(waver->pmrules); i++){ pmrule = (PMRULE *)cblistval(waver->pmrules, i, NULL); est_regex_delete(pmrule->regex); } cblistclose(waver->pmrules); for(i = 0; i < cblistnum(waver->unrules); i++){ unrule = (UNRULE *)cblistval(waver->unrules, i, NULL); est_regex_delete(unrule->regex); free(unrule->before); free(unrule->after); } cblistclose(waver->unrules); free(waver->pxhost); cbmapclose(waver->sites); cbmapclose(waver->kwords); cbmapclose(waver->seeds); if(!est_mtdb_close(waver->index, &ecode)) err = TRUE; if(!crclose(waver->trace)) err = TRUE; if(!queue_close(waver->queue)) err = TRUE; if(!dpclose(waver->metadb)) err = TRUE; free(waver->rootdir); free(waver); return err ? FALSE : TRUE; } /* Set the current node. */ void waver_set_current_node(WAVER *waver){ ESTNODE *node; const char *kbuf; int i; double ratio; assert(waver); waver->curnode = 0; cbmapiterinit(waver->nodes); waver->minload = 1.0; for(i = 0; i < 600; i++){ while((kbuf = cbmapiternext(waver->nodes, NULL)) != NULL){ node = *(ESTNODE **)cbmapget(waver->nodes, kbuf, sizeof(int), NULL); if((ratio = est_node_cache_usage(node)) >= 0.0 && ratio <= waver->minload){ waver->curnode = *(int *)kbuf; waver->minload = ratio; } } if(waver->minload < 1.0){ cbmapmove(waver->nodes, (char *)&(waver->curnode), sizeof(int), TRUE); break; } est_usleep(1000 * 1000); } } /* Get the load of the current node. */ double waver_current_node_load(WAVER *waver){ ESTNODE *node; double ratio; if(!(node = *(ESTNODE **)cbmapget(waver->nodes, (char *)&(waver->curnode), sizeof(int), NULL))) return 1.0; ratio = est_node_cache_usage(node); return ratio > 0.0 ? ratio : 1.0; } /* Add a document to a node. */ int waver_node_put_doc(WAVER *waver, ESTDOC *doc, int *codep){ ESTNODE *node; int rv; assert(waver && doc); if(!(node = *(ESTNODE **)cbmapget(waver->nodes, (char *)&(waver->curnode), sizeof(int), NULL))){ if(codep) *codep = -1; return FALSE; } rv = est_node_put_doc(node, doc); if(codep) *codep = est_node_status(node); return rv; } /* Remove a document from a node. */ int waver_node_out_doc(WAVER *waver, const char *url, int *codep){ ESTNODE *node; const char *rp; char *vbuf; int nid, rv; assert(waver && url); nid = 0; if((vbuf = crget(waver->trace, url, -1, 0, -1, NULL)) != NULL){ if((rp = strchr(vbuf, '#')) != NULL) nid = atoi(rp + 1); free(vbuf); } if(nid < 1 || !(node = *(ESTNODE **)cbmapget(waver->nodes, (char *)&nid, sizeof(int), NULL))){ if(codep) *codep = -1; return FALSE; } rv = est_node_out_doc_by_uri(node, url); if(codep) *codep = est_node_status(node); return rv; } /* Open a priority queue. */ QUEUE *queue_open(const char *name){ QUEUE *queue; VILLA *db; const char *vbuf; int vomode, vsiz; double max; assert(name); vomode = VL_OWRITER | VL_OCREAT; if(ESTUSEBZIP){ vomode |= VL_OXCOMP; } else if(ESTUSELZO){ vomode |= VL_OYCOMP; } else if(ESTUSEZLIB){ vomode |= VL_OZCOMP; } if(!(db = vlopen(name, vomode, queue_compare))) return NULL; vlsettuning(db, QUEUELRM, QUEUENIM, QUEUELCN, QUEUENCN); max = 1.0; vlcurlast(db); if((vbuf = vlcurkeycache(db, &vsiz)) != NULL && vsiz == sizeof(double)) max = *(double *)vbuf; if(max < 1.0) max = 1.0; queue = cbmalloc(sizeof(QUEUE)); queue->db = db; queue->max = max; return queue; } /* Close a priority queue. */ int queue_close(QUEUE *queue){ int err; assert(queue); err = FALSE; if(!vlclose(queue->db)) err = TRUE; free(queue); return err ? FALSE : TRUE; } /* Set the range of the priority space of a priority queue. */ void queue_set_range(QUEUE *queue, double range){ assert(queue); queue->max = range; if(queue->max < 1.0) queue->max = 1.0; } /* Enqueue a record into a priority queue. */ int queue_enqueue(QUEUE *queue, const char *str, double priority){ int err; assert(queue && str); if(priority < 0.0) priority = 0.0; if(priority > 1.0) priority = 1.0; priority *= queue->max; err = FALSE; if(!vlput(queue->db, (char *)&priority, sizeof(double), str, -1, VL_DDUP)) err = TRUE; return err ? FALSE : TRUE; } /* Dequeue a record from a priority queue. */ char *queue_dequeue(QUEUE *queue){ char *vbuf; assert(queue); vlcurfirst(queue->db); if(!(vbuf = vlcurval(queue->db, NULL))) return NULL; vlcurout(queue->db); return vbuf; } /* Get the number of records in a priority queue. */ int queue_rnum(QUEUE *queue){ assert(queue); return vlrnum(queue->db); } /* Discard inferior records in a priority queue. */ int queue_slim(QUEUE *queue, int num){ int i, diff; assert(queue && num >= 0); if((diff = vlrnum(queue->db) - num) < 1) return TRUE; vlcurlast(queue->db); for(i = 1; i < diff; i++){ vlcurprev(queue->db); } while(TRUE){ if(!vlcurout(queue->db)) break; } return vlrnum(queue->db) == num && !vlfatalerror(queue->db); } /* Add a word to a keyword map. */ void kwords_add(CBMAP *kwords, const char *word, int frequency){ const char *vbuf; char numbuf[NUMBUFSIZ]; int wlen, nlen; assert(kwords && word && frequency >= 0); wlen = strlen(word); if((vbuf = cbmapget(kwords, word, wlen, NULL)) != NULL) frequency += atoi(vbuf); nlen = sprintf(numbuf, "%d", frequency); cbmapput(kwords, word, wlen, numbuf, nlen, TRUE); } /* Reduce elements of a keyword map. */ void kwords_reduce(CBMAP *kwords, int num, int fadeout){ KEYSC *scores; const char *vbuf; char numbuf[NUMBUFSIZ]; int i, snum, vsiz; double basis; assert(kwords && num >= 0); if(num < 1) num = 1; snum = cbmaprnum(kwords); scores = cbmalloc(snum * sizeof(KEYSC) + 1); cbmapiterinit(kwords); for(i = 0; i < snum; i++){ vbuf = cbmapiternext(kwords, &vsiz); scores[i].word = vbuf; scores[i].wsiz = vsiz; scores[i].pt = atoi(cbmapget(kwords, vbuf, vsiz, NULL)); } qsort(scores, snum, sizeof(KEYSC), keysc_compare); basis = num * 1.1 + 1.0; for(i = 0; i < snum; i++){ if(i < num){ vsiz = sprintf(numbuf, "%d", fadeout ? (int)(scores[i].pt * (basis - i) / basis) : scores[i].pt); cbmapput(kwords, scores[i].word, scores[i].wsiz, numbuf, vsiz, TRUE); cbmapmove(kwords, scores[i].word, scores[i].wsiz, FALSE); } else { cbmapout(kwords, scores[i].word, scores[i].wsiz); } } free(scores); } /* Fetch a document of a URL. */ int fetch_document(const char *url, const char *pxhost, int pxport, int outsec, time_t mdate, const CBLIST *urlrules, const CBLIST *mtrules, int *codep, CBDATUM *raw, CBMAP *heads, CBLIST *links, const CBLIST *unrules, ESTDOC *doc, int lang){ URLRULE *urlrule; MTRULE *mtrule; UNRULE *unrule; ESTDOC *rdoc; CBMAP *rheads; CBLIST *reqheads; CBDATUM *rbuf; const char *vbuf, *cmd; char *dstr, *tbuf, *type, *enc, *pv; int i, j, rescode; assert(url); rescode = -1; if(raw){ rbuf = NULL; } else { rbuf = cbdatumopen(NULL, -1); raw = rbuf; } if(heads){ rheads = NULL; } else { rheads = cbmapopenex(MINIBNUM); heads = rheads; } if(doc){ rdoc = NULL; } else { rdoc = est_doc_new(); doc = rdoc; } reqheads = cblistopen(); if(mdate > 0){ dstr = cbdatestrhttp(mdate, 0); tbuf = cbsprintf("If-Modified-Since: %s", dstr); cblistpush(reqheads, tbuf, -1); free(tbuf); free(dstr); } switch(lang){ case ESTLANGEN: cblistpush(reqheads, "Accept-Language: en,ja", -1); break; case ESTLANGJA: cblistpush(reqheads, "Accept-Language: ja,en", -1); break; case ESTLANGZH: cblistpush(reqheads, "Accept-Language: zh,en", -1); break; case ESTLANGKO: cblistpush(reqheads, "Accept-Language: ko,en", -1); break; } if(!est_url_shuttle(url, pxhost, pxport, outsec, RESLIMSIZE, NULL, reqheads, NULL, 0, &rescode, heads, raw) || rescode != 200){ if(links && (rescode == 301 || rescode == 302) && (vbuf = cbmapget(heads, "location", -1, NULL)) != NULL){ tbuf = cburlresolve(url, vbuf); cblistpush(links, tbuf, -1); free(tbuf); } cblistclose(reqheads); if(rdoc) est_doc_delete(rdoc); if(rheads) cbmapclose(rheads); if(rbuf) cbdatumclose(rbuf); if(codep) *codep = rescode; return FALSE; } if(urlrules){ for(i = 0; i < cblistnum(urlrules); i++){ urlrule = (URLRULE *)cblistval(urlrules, i, NULL); if(est_regex_match(urlrule->regex, url)){ cbmapput(heads, "content-type", -1, urlrule->type, -1, TRUE); break; } } } if(!(vbuf = cbmapget(heads, "content-type", -1, NULL))) vbuf = "text/plain"; type = cbmemdup(vbuf, -1); if((pv = strchr(type, ';')) != NULL) *pv = '\0'; cbstrtolower(type); enc = NULL; if((pv = strstr(vbuf, "charset=")) != NULL || (pv = strstr(vbuf, "CHARSET=")) != NULL){ pv = strchr(pv, '=') + 1; if(*pv == '"') pv++; enc = cbmemdup(pv, -1); if((pv = strchr(enc, '"')) != NULL) *pv = '\0'; } cmd = ""; if(mtrules){ for(i = 0; i < cblistnum(mtrules); i++){ mtrule = (MTRULE *)cblistval(mtrules, i, NULL); if(est_regex_match(mtrule->regex, type)){ cmd = mtrule->filter; break; } } } else if(!strcmp(type, "text/plain")){ cmd = TEXTCMD; } else if(!strcmp(type, "text/html") || !strcmp(vbuf, "application/xhtml+xml")){ cmd = HTMLCMD; } else if(!strcmp(type, "message/rfc822")){ cmd = MIMECMD; } if(!strcmp(cmd, DRAFTCMD)){ make_doc_from_draft(cbdatumptr(raw), cbdatumsize(raw), doc, links); if(!est_doc_attr(doc, ESTDATTRURI)) est_doc_add_attr(doc, ESTDATTRURI, url); } else if(!strcmp(cmd, TEXTCMD)){ make_doc_from_text(cbdatumptr(raw), cbdatumsize(raw), enc, lang, doc, links); est_doc_add_attr(doc, ESTDATTRURI, url); } else if(!strcmp(cmd, HTMLCMD)){ make_doc_from_html(cbdatumptr(raw), cbdatumsize(raw), enc, lang, doc, links); est_doc_add_attr(doc, ESTDATTRURI, url); } else if(!strcmp(cmd, MIMECMD)){ make_doc_from_mime(cbdatumptr(raw), cbdatumsize(raw), enc, lang, doc, links); est_doc_add_attr(doc, ESTDATTRURI, url); } else if(cmd[0] != '\0'){ make_doc_with_xcmd(cmd, url, cbdatumptr(raw), cbdatumsize(raw), enc, lang, doc, links); if(!est_doc_attr(doc, ESTDATTRURI)) est_doc_add_attr(doc, ESTDATTRURI, url); } free(enc); free(type); if((vbuf = cbmapget(heads, "last-modified", -1, NULL)) != NULL) est_doc_add_attr(doc, ESTDATTRMDATE, vbuf); if(links){ for(i = 0; i < cblistnum(links); i++){ tbuf = cburlresolve(url, cblistval(links, i, NULL)); if(unrules){ for(j = 0; j < cblistnum(unrules); j++){ unrule = (UNRULE *)cblistval(unrules, j, NULL); if(!est_regex_match(unrule->regex, tbuf)) continue; dstr = est_regex_replace(tbuf, unrule->before, unrule->after); free(tbuf); tbuf = dstr; } } if(cbstrfwmatch(tbuf, "http://")){ pv = tbuf + 7; if((pv = strchr(pv, '/')) != NULL && cbstrfwmatch(pv, "/%E2%80%BE")){ pv[1] = '~'; memmove(pv + 2, pv + 10, strlen(pv + 10) + 1); } cblistover(links, i, tbuf, -1); } free(tbuf); } } cblistclose(reqheads); if(rdoc) est_doc_delete(rdoc); if(rheads) cbmapclose(rheads); if(rbuf) cbdatumclose(rbuf); if(codep) *codep = rescode; return TRUE; } /************************************************************************************************* * private objects *************************************************************************************************/ /* Close the log file. */ static void log_close(void){ if(log_fp) fclose(log_fp); } /* Output the log message of a DB event. `message' specifies the log message of a DB event. `opaque' is simply ignored. */ static void db_informer(const char *message, void *opaque){ assert(message); log_print(LL_INFO, "DB-EVENT: %s", message); } /* Skip the label of a line. `str' specifies a string of a line. The return value is the pointer to the first character of the line. */ static const char *skiplabel(const char *str){ assert(str); if(!(str = strchr(str, ':'))) return ""; str++; while(*str != '\0' && (*str == ' ' || *str == '\t')){ str++; } return str; } /* Make the absolute path of a relative path. `rootdir' specifies the path of the root directory. `path' specifies a ralative path of the a file. */ static char *makeabspath(const char *rootdir, const char *path){ char mypath[URIBUFSIZ]; assert(rootdir && path); if((ESTPATHCHR == '/' && path[0] == ESTPATHCHR) || (ESTPATHCHR == '\\' && ((path[0] >= 'A' && path[0] <= 'Z') || (path[0] >= 'a' && path[0] <= 'z')) && path[1] == ':' && path[2] == '\\')){ sprintf(mypath, "%s", path); } else { sprintf(mypath, "%s%c%s", rootdir, ESTPATHCHR, path); } return est_realpath(mypath); } /* Compare keys of two records as double type objects. `aptr' specifies the pointer to the region of one key. `asiz' specifies the size of the region of one key. `bptr' specifies the pointer to the region of the other key. `bsiz' specifies the size of the region of the other key. The return value is positive if the former is big, negative if the latter is big, 0 if both are equivalent. */ static int queue_compare(const char *aptr, int asiz, const char *bptr, int bsiz){ double anum, bnum; assert(aptr && asiz >= 0 && bptr && bsiz >= 0); if(asiz != bsiz) return asiz - bsiz; anum = (asiz == sizeof(double) ? *(double *)aptr : INT_MIN); bnum = (bsiz == sizeof(double) ? *(double *)bptr : INT_MIN); if(anum > bnum) return 1; if(anum < bnum) return -1; return 0; } /* Compare two keywords by scores in descending order. `ap' specifies the pointer to one keyword. `bp' specifies the pointer to the other keyword. The return value is negative if one is small, positive if one is big, 0 if both are equal. */ static int keysc_compare(const void *ap, const void *bp){ assert(ap && bp); return ((KEYSC *)bp)->pt - ((KEYSC *)ap)->pt; } /* Create a document object from docuemnt draft. `buf' specifies the pointer to a data buffer. It should be trailed by zero code. `size' specifies the size of the buffer. `doc' specifies a document handle to store attributes and texts. `link' specifies a list handle to store links. If it is `NULL', it is not used. */ static void make_doc_from_draft(const char *buf, int size, ESTDOC *doc, CBLIST *links){ CBLIST *lines; const char *line; char *pv; int i; assert(buf && size >= 0 && doc); lines = cbsplit(buf, -1, "\n"); for(i = 0; i < CB_LISTNUM(lines); i++){ line = CB_LISTVAL(lines, i); while(*line > '\0' && *line <= ' '){ line++; } if(*line == '\0'){ i++; break; } if(*line != '%' && (pv = strchr(line, '=')) != NULL){ *(pv++) = '\0'; est_doc_add_attr(doc, line, pv); } } for(; i < CB_LISTNUM(lines); i++){ line = CB_LISTVAL(lines, i); if(*line == '\t'){ est_doc_add_hidden_text(doc, line + 1); } else { est_doc_add_text(doc, line); } } cblistclose(lines); } /* Create a document object from plain text. `buf' specifies the pointer to a data buffer. It should be trailed by zero code. `size' specifies the size of the buffer. `penc' specifies the name of preferred encoding. If it is `NULL', it is not used. `plang' specifies the code of preferred language. `doc' specifies a document handle to store attributes and texts. `link' specifies a list handle to store links. If it is `NULL', it is not used. */ static void make_doc_from_text(const char *buf, int size, const char *penc, int plang, ESTDOC *doc, CBLIST *links){ CBLIST *lines; CBDATUM *datum; const char *enc, *text, *line; char *nbuf, numbuf[NUMBUFSIZ]; int i; assert(buf && size >= 0 && doc); if(check_binary(buf, size)) return; enc = penc ? penc : est_enc_name(buf, size, plang); if(!strcmp(enc, "UTF-8")){ nbuf = NULL; text = buf; } else { text = buf; nbuf = est_iconv(buf, size, enc, "UTF-8", NULL, NULL); if(nbuf) text = nbuf; } lines = cbsplit(text, -1, "\n"); CB_DATUMOPEN(datum); for(i = 0; i < CB_LISTNUM(lines); i++){ line = CB_LISTVAL(lines, i); while(*line == ' ' || *line == '\t' || *line == '\r'){ line++; } if(line[0] == '\0'){ est_doc_add_text(doc, CB_DATUMPTR(datum)); CB_DATUMSETSIZE(datum, 0); } else { CB_DATUMCAT(datum, " ", 1); CB_DATUMCAT(datum, line, strlen(line)); } } est_doc_add_text(doc, CB_DATUMPTR(datum)); CB_DATUMCLOSE(datum); CB_LISTCLOSE(lines); est_doc_add_attr(doc, ESTDATTRTYPE, "text/plain"); sprintf(numbuf, "%d", size); est_doc_add_attr(doc, ESTDATTRSIZE, numbuf); if(nbuf) free(nbuf); } /* Check whether a buffer is binary. `buf' specifies the pointer to a data buffer. It should be trailed by zero code. `size' specifies the size of the buffer. */ static int check_binary(const char *buf, int size){ int i, bin; assert(buf && size >= 0); if(size < 32) return FALSE; /* PDF */ if(!memcmp(buf, "%PDF-", 5)) return TRUE; /* PostScript */ if(!memcmp(buf, "%!PS-Adobe", 10)) return TRUE; /* generic binary */ size -= 5; if(size >= 256) size = 256; bin = FALSE; for(i = 0; i < size; i++){ if(buf[i] == 0x0){ if(buf[i+1] == 0x0 && buf[i+2] == 0x0 && buf[i+3] == 0x0 && buf[i+4] == 0x0) return TRUE; bin = TRUE; } } if(!bin) return FALSE; /* PNG */ if(!memcmp(buf, "\x89PNG", 4)) return TRUE; /* GIF(87a) */ if(!memcmp(buf, "GIF87a", 6)) return TRUE; /* GIF(89a) */ if(!memcmp(buf, "GIF89a", 6)) return TRUE; /* JFIF */ if(!memcmp(buf, "\xff\xd8JFIF", 6)) return TRUE; /* TIFF(Intel) */ if(!memcmp(buf, "MM\x00\x2a", 4)) return TRUE; /* TIFF(Motorola) */ if(!memcmp(buf, "II\x2a\x00", 4)) return TRUE; /* BMP */ if(!memcmp(buf, "BM", 2)) return TRUE; /* GZIP */ if(!memcmp(buf, "\x1f\x8b\x08", 3)) return TRUE; /* BZIP2 */ if(!memcmp(buf, "BZh", 3)) return TRUE; /* ZIP */ if(!memcmp(buf, "PK\x03\x04", 4)) return TRUE; /* MP3(with ID3) */ if(!memcmp(buf, "ID3", 3)) return TRUE; /* MP3 */ if(((buf[0] * 0x100 + buf[1]) & 0xfffe) == 0xfffa) return TRUE; /* MIDI */ if(!memcmp(buf, "MThd", 4)) return TRUE; /* RPM package*/ if(!memcmp(buf, "0xed0xab", 2)) return TRUE; /* Debian package */ if(!memcmp(buf, "!\ndebian", 14)) return TRUE; /* ELF */ if(!memcmp(buf, "\x7f\x45\x4c\x46", 4)) return TRUE; /* MS-DOS executable */ if(!memcmp(buf, "MZ", 2)) return TRUE; /* MS-Office */ if(!memcmp(buf, "\xd0\xcf\x11\xe0\xa1\xb1\x1a\xe1", 8)) return TRUE; if(!memcmp(buf, "\xfe\x37\x00\x23", 4)) return TRUE; if(!memcmp(buf, "\xdb\xa5-\x00\x00\x00", 6)) return TRUE; return FALSE; } /* Create a document object from HTML. `buf' specifies the pointer to a data buffer. It should be trailed by zero code. `size' specifies the size of the buffer. `penc' specifies the name of preferred encoding. If it is `NULL', it is not used. `plang' specifies the code of preferred language. `doc' specifies a document handle to store attributes and texts. `link' specifies a list handle to store links. If it is `NULL', it is not used. */ static void make_doc_from_html(const char *buf, int size, const char *penc, int plang, ESTDOC *doc, CBLIST *links){ CBLIST *elems; CBMAP *attrs; CBDATUM *datum; const char *enc, *html, *elem, *next, *value, *name, *content, *rp; char *nbuf, *nenc, *rbuf, *lbuf, numbuf[NUMBUFSIZ]; int i, esiz; assert(buf && size >= 0 && doc); enc = est_enc_name(buf, size, plang); html = NULL; nbuf = NULL; if(!strcmp(enc, "UTF-16") || !strcmp(enc, "UTF-16BE") || !strcmp(enc, "UTF-16LE")){ nbuf = est_iconv(buf, size, enc, "UTF-8", NULL, NULL); } else if(!strcmp(enc, "US-ASCII")){ nbuf = NULL; } else { if((nenc = penc ? cbmemdup(penc, -1) : html_enc(buf)) != NULL){ if(cbstricmp(nenc, "UTF-8")){ nbuf = est_iconv(buf, size, nenc, "UTF-8", NULL, NULL); if(!nbuf) nbuf = est_iconv(buf, size, enc, "UTF-8", NULL, NULL); } free(nenc); } else { nbuf = est_iconv(buf, size, enc, "UTF-8", NULL, NULL); } } if(nbuf) html = nbuf; if(!html) html = buf; CB_DATUMOPEN(datum); elems = cbxmlbreak(html, TRUE); for(i = 0; i < CB_LISTNUM(elems); i++){ elem = CB_LISTVAL2(elems, i, esiz); if(!(next = cblistval(elems, i + 1, NULL))) next = ""; if(elem[0] == '<'){ if(cbstrfwimatch(elem, "= '0' && *rp <= '9') || *rp == ' ' || *rp == '\t' || *rp == ';'){ rp++; } if(cbstrfwmatch(rp, "url=")) rp += 4; if(*rp != '\0') cblistpush(links, rp, -1); free(rbuf); } else { rp = content; while((*rp >= '0' && *rp <= '9') || *rp == ' ' || *rp == '\t' || *rp == ';'){ rp++; } if(cbstrfwmatch(rp, "url=")) rp += 4; if(*rp != '\0') cblistpush(links, rp, -1); } } if(name[0] != '@' && name[0] != '_'){ if(strchr(content, '&')){ rbuf = html_raw_text(content); est_doc_add_attr(doc, lbuf, rbuf); free(rbuf); } else { est_doc_add_attr(doc, lbuf, content); } } free(lbuf); } cbmapclose(attrs); } else if(cbstrfwimatch(elem, "") || cbstrfwimatch(elem, "

    ", """, "\"", "'", "'", /* ISO-8859-1 */ " ", "\xc2\xa0", "¡", "\xc2\xa1", "¢", "\xc2\xa2", "£", "\xc2\xa3", "¤", "\xc2\xa4", "¥", "\xc2\xa5", "¦", "\xc2\xa6", "§", "\xc2\xa7", "¨", "\xc2\xa8", "©", "\xc2\xa9", "ª", "\xc2\xaa", "«", "\xc2\xab", "¬", "\xc2\xac", "­", "\xc2\xad", "®", "\xc2\xae", "¯", "\xc2\xaf", "°", "\xc2\xb0", "±", "\xc2\xb1", "²", "\xc2\xb2", "³", "\xc2\xb3", "´", "\xc2\xb4", "µ", "\xc2\xb5", "¶", "\xc2\xb6", "·", "\xc2\xb7", "¸", "\xc2\xb8", "¹", "\xc2\xb9", "º", "\xc2\xba", "»", "\xc2\xbb", "¼", "\xc2\xbc", "½", "\xc2\xbd", "¾", "\xc2\xbe", "¿", "\xc2\xbf", "À", "\xc3\x80", "Á", "\xc3\x81", "Â", "\xc3\x82", "Ã", "\xc3\x83", "Ä", "\xc3\x84", "Å", "\xc3\x85", "Æ", "\xc3\x86", "Ç", "\xc3\x87", "È", "\xc3\x88", "É", "\xc3\x89", "Ê", "\xc3\x8a", "Ë", "\xc3\x8b", "Ì", "\xc3\x8c", "Í", "\xc3\x8d", "Î", "\xc3\x8e", "Ï", "\xc3\x8f", "Ð", "\xc3\x90", "Ñ", "\xc3\x91", "Ò", "\xc3\x92", "Ó", "\xc3\x93", "Ô", "\xc3\x94", "Õ", "\xc3\x95", "Ö", "\xc3\x96", "×", "\xc3\x97", "Ø", "\xc3\x98", "Ù", "\xc3\x99", "Ú", "\xc3\x9a", "Û", "\xc3\x9b", "Ü", "\xc3\x9c", "Ý", "\xc3\x9d", "Þ", "\xc3\x9e", "ß", "\xc3\x9f", "à", "\xc3\xa0", "á", "\xc3\xa1", "â", "\xc3\xa2", "ã", "\xc3\xa3", "ä", "\xc3\xa4", "å", "\xc3\xa5", "æ", "\xc3\xa6", "ç", "\xc3\xa7", "è", "\xc3\xa8", "é", "\xc3\xa9", "ê", "\xc3\xaa", "ë", "\xc3\xab", "ì", "\xc3\xac", "í", "\xc3\xad", "î", "\xc3\xae", "ï", "\xc3\xaf", "ð", "\xc3\xb0", "ñ", "\xc3\xb1", "ò", "\xc3\xb2", "ó", "\xc3\xb3", "ô", "\xc3\xb4", "õ", "\xc3\xb5", "ö", "\xc3\xb6", "÷", "\xc3\xb7", "ø", "\xc3\xb8", "ù", "\xc3\xb9", "ú", "\xc3\xba", "û", "\xc3\xbb", "ü", "\xc3\xbc", "ý", "\xc3\xbd", "þ", "\xc3\xbe", "ÿ", "\xc3\xbf", /* ISO-10646 */ "ƒ", "\xc6\x92", "Α", "\xce\x91", "Β", "\xce\x92", "Γ", "\xce\x93", "Δ", "\xce\x94", "Ε", "\xce\x95", "Ζ", "\xce\x96", "Η", "\xce\x97", "Θ", "\xce\x98", "Ι", "\xce\x99", "Κ", "\xce\x9a", "Λ", "\xce\x9b", "Μ", "\xce\x9c", "Ν", "\xce\x9d", "Ξ", "\xce\x9e", "Ο", "\xce\x9f", "Π", "\xce\xa0", "Ρ", "\xce\xa1", "Σ", "\xce\xa3", "Τ", "\xce\xa4", "Υ", "\xce\xa5", "Φ", "\xce\xa6", "Χ", "\xce\xa7", "Ψ", "\xce\xa8", "Ω", "\xce\xa9", "α", "\xce\xb1", "β", "\xce\xb2", "γ", "\xce\xb3", "δ", "\xce\xb4", "ε", "\xce\xb5", "ζ", "\xce\xb6", "η", "\xce\xb7", "θ", "\xce\xb8", "ι", "\xce\xb9", "κ", "\xce\xba", "λ", "\xce\xbb", "μ", "\xce\xbc", "ν", "\xce\xbd", "ξ", "\xce\xbe", "ο", "\xce\xbf", "π", "\xcf\x80", "ρ", "\xcf\x81", "ς", "\xcf\x82", "σ", "\xcf\x83", "τ", "\xcf\x84", "υ", "\xcf\x85", "φ", "\xcf\x86", "χ", "\xcf\x87", "ψ", "\xcf\x88", "ω", "\xcf\x89", "ϑ", "\xcf\x91", "ϒ", "\xcf\x92", "ϖ", "\xcf\x96", "•", "\xe2\x80\xa2", "…", "\xe2\x80\xa6", "′", "\xe2\x80\xb2", "″", "\xe2\x80\xb3", "‾", "\xe2\x80\xbe", "⁄", "\xe2\x81\x84", "℘", "\xe2\x84\x98", "ℑ", "\xe2\x84\x91", "ℜ", "\xe2\x84\x9c", "™", "\xe2\x84\xa2", "ℵ", "\xe2\x84\xb5", "←", "\xe2\x86\x90", "↑", "\xe2\x86\x91", "→", "\xe2\x86\x92", "↓", "\xe2\x86\x93", "↔", "\xe2\x86\x94", "↵", "\xe2\x86\xb5", "⇐", "\xe2\x87\x90", "⇑", "\xe2\x87\x91", "⇒", "\xe2\x87\x92", "⇓", "\xe2\x87\x93", "⇔", "\xe2\x87\x94", "∀", "\xe2\x88\x80", "∂", "\xe2\x88\x82", "∃", "\xe2\x88\x83", "∅", "\xe2\x88\x85", "∇", "\xe2\x88\x87", "∈", "\xe2\x88\x88", "∉", "\xe2\x88\x89", "∋", "\xe2\x88\x8b", "∏", "\xe2\x88\x8f", "∑", "\xe2\x88\x91", "−", "\xe2\x88\x92", "∗", "\xe2\x88\x97", "√", "\xe2\x88\x9a", "∝", "\xe2\x88\x9d", "∞", "\xe2\x88\x9e", "∠", "\xe2\x88\xa0", "∧", "\xe2\x88\xa7", "∨", "\xe2\x88\xa8", "∩", "\xe2\x88\xa9", "∪", "\xe2\x88\xaa", "∫", "\xe2\x88\xab", "∴", "\xe2\x88\xb4", "∼", "\xe2\x88\xbc", "≅", "\xe2\x89\x85", "≈", "\xe2\x89\x88", "≠", "\xe2\x89\xa0", "≡", "\xe2\x89\xa1", "≤", "\xe2\x89\xa4", "≥", "\xe2\x89\xa5", "⊂", "\xe2\x8a\x82", "⊃", "\xe2\x8a\x83", "⊄", "\xe2\x8a\x84", "⊆", "\xe2\x8a\x86", "⊇", "\xe2\x8a\x87", "⊕", "\xe2\x8a\x95", "⊗", "\xe2\x8a\x97", "⊥", "\xe2\x8a\xa5", "⋅", "\xe2\x8b\x85", "⌈", "\xe2\x8c\x88", "⌉", "\xe2\x8c\x89", "⌊", "\xe2\x8c\x8a", "⌋", "\xe2\x8c\x8b", "⟨", "\xe2\x8c\xa9", "⟩", "\xe2\x8c\xaa", "◊", "\xe2\x97\x8a", "♠", "\xe2\x99\xa0", "♣", "\xe2\x99\xa3", "♥", "\xe2\x99\xa5", "♦", "\xe2\x99\xa6", "Œ", "\xc5\x92", "œ", "\xc5\x93", "Š", "\xc5\xa0", "š", "\xc5\xa1", "Ÿ", "\xc5\xb8", "ˆ", "\xcb\x86", "˜", "\xcb\x9c", " ", "\xe2\x80\x82", " ", "\xe2\x80\x83", " ", "\xe2\x80\x89", "‌", "\xe2\x80\x8c", "‍", "\xe2\x80\x8d", "‎", "\xe2\x80\x8e", "‏", "\xe2\x80\x8f", "–", "\xe2\x80\x93", "—", "\xe2\x80\x94", "‘", "\xe2\x80\x98", "’", "\xe2\x80\x99", "‚", "\xe2\x80\x9a", "“", "\xe2\x80\x9c", "”", "\xe2\x80\x9d", "„", "\xe2\x80\x9e", "†", "\xe2\x80\xa0", "‡", "\xe2\x80\xa1", "‰", "\xe2\x80\xb0", "‹", "\xe2\x80\xb9", "›", "\xe2\x80\xba", "€", "\xe2\x82\xac", NULL }; char *raw, *wp, buf[2], *tmp; int i, j, hit, num, tsiz; assert(html); CB_MALLOC(raw, strlen(html) * 3 + 1); wp = raw; while(*html != '\0'){ if(*html == '&'){ if(*(html + 1) == '#'){ if(*(html + 2) == 'x' || *(html + 2) == 'X'){ num = strtol(html + 3, NULL, 16); } else { num = atoi(html + 2); } buf[0] = num / 256; buf[1] = num % 256; if((tmp = est_uconv_out(buf, 2, &tsiz)) != NULL){ for(j = 0; j < tsiz; j++){ *wp = ((unsigned char *)tmp)[j]; wp++; } free(tmp); } while(*html != ';' && *html != ' ' && *html != '\n' && *html != '\0'){ html++; } if(*html == ';') html++; } else { hit = FALSE; for(i = 0; pairs[i] != NULL; i += 2){ if(cbstrfwmatch(html, pairs[i])){ wp += sprintf(wp, "%s", pairs[i+1]); html += strlen(pairs[i]); hit = TRUE; break; } } if(!hit){ *wp = *html; wp++; html++; } } } else { *wp = *html; wp++; html++; } } *wp = '\0'; return raw; } /* Create a document object from MIME. `buf' specifies the pointer to a data buffer. It should be trailed by zero code. `size' specifies the size of the buffer. `penc' specifies the name of preferred encoding. If it is `NULL', it is not used. `plang' specifies the code of preferred language. `doc' specifies a document handle to store attributes and texts. `link' specifies a list handle to store links. If it is `NULL', it is not used. */ static void make_doc_from_mime(const char *buf, int size, const char *penc, int plang, ESTDOC *doc, CBLIST *links){ ESTDOC *tdoc; CBMAP *attrs; const CBLIST *texts; CBLIST *parts, *lines; CBDATUM *datum; const char *key, *val, *bound, *part, *text, *line; char *body, *swap, numbuf[NUMBUFSIZ]; int i, j, bsiz, psiz, ssiz, mht; assert(buf && size >= 0 && doc); attrs = cbmapopenex(MINIBNUM); body = cbmimebreak(buf, size, attrs, &bsiz); if((val = cbmapget(attrs, "subject", -1, NULL)) != NULL){ doc_add_attr_mime(doc, ESTDATTRTITLE, val); if((val = est_doc_attr(doc, ESTDATTRTITLE)) != NULL) est_doc_add_hidden_text(doc, val); } if((val = cbmapget(attrs, "from", -1, NULL)) != NULL) doc_add_attr_mime(doc, ESTDATTRAUTHOR, val); if((val = cbmapget(attrs, "date", -1, NULL)) != NULL){ doc_add_attr_mime(doc, ESTDATTRCDATE, val); doc_add_attr_mime(doc, ESTDATTRMDATE, val); } est_doc_add_attr(doc, ESTDATTRTYPE, "message/rfc822"); sprintf(numbuf, "%d", size); est_doc_add_attr(doc, ESTDATTRSIZE, numbuf); cbmapiterinit(attrs); while((key = cbmapiternext(attrs, NULL)) != NULL){ if((key[0] >= 'A' && key[0] <= 'Z') || key[0] == '@' || key[0] == '_') continue; val = cbmapget(attrs, key, -1, NULL); doc_add_attr_mime(doc, key, val); } if((key = cbmapget(attrs, "TYPE", -1, NULL)) != NULL && cbstrfwimatch(key, "multipart/")){ mht = cbstrfwimatch(key, "multipart/related"); if((bound = cbmapget(attrs, "BOUNDARY", -1, NULL)) != NULL){ parts = cbmimeparts(body, bsiz, bound); for(i = 0; i < CB_LISTNUM(parts) && i < 8; i++){ part = CB_LISTVAL2(parts, i, psiz); tdoc = est_doc_new(); make_doc_from_mime(part, psiz, penc, plang, tdoc, links); if(mht){ if((text = est_doc_attr(tdoc, ESTDATTRTITLE)) != NULL) est_doc_add_attr(doc, ESTDATTRTITLE, text); if((text = est_doc_attr(tdoc, ESTDATTRAUTHOR)) != NULL) est_doc_add_attr(doc, ESTDATTRAUTHOR, text); } texts = est_doc_texts(tdoc); for(j = 0; j < CB_LISTNUM(texts); j++){ text = CB_LISTVAL(texts, j); est_doc_add_text(doc, text); } est_doc_delete(tdoc); } CB_LISTCLOSE(parts); } } else { key = cbmapget(attrs, "content-transfer-encoding", -1, NULL); if(key && cbstrfwimatch(key, "base64")){ swap = cbbasedecode(body, &ssiz); free(body); body = swap; bsiz = ssiz; } else if(key && cbstrfwimatch(key, "quoted-printable")){ swap = cbquotedecode(body, &ssiz); free(body); body = swap; bsiz = ssiz; } key = cbmapget(attrs, "content-encoding", -1, NULL); if(key && (cbstrfwimatch(key, "x-gzip") || cbstrfwimatch(key, "gzip")) && (swap = cbgzdecode(body, bsiz, &ssiz)) != NULL){ free(body); body = swap; bsiz = ssiz; } else if(key && (cbstrfwimatch(key, "x-deflate") || cbstrfwimatch(key, "deflate")) && (swap = cbinflate(body, bsiz, &ssiz)) != NULL){ free(body); body = swap; bsiz = ssiz; } if(!(key = cbmapget(attrs, "TYPE", -1, NULL)) || cbstrfwimatch(key, "text/plain")){ if(!check_binary(body, bsiz)){ if(penc && (swap = est_iconv(body, bsiz, penc, "UTF-8", &ssiz, NULL)) != NULL){ free(body); body = swap; bsiz = ssiz; } else if((key = cbmapget(attrs, "CHARSET", -1, NULL)) != NULL && (swap = est_iconv(body, bsiz, key, "UTF-8", &ssiz, NULL)) != NULL){ free(body); body = swap; bsiz = ssiz; } lines = cbsplit(body, bsiz, "\n"); CB_DATUMOPEN(datum); for(i = 0; i < CB_LISTNUM(lines); i++){ line = CB_LISTVAL(lines, i); while(*line == ' ' || *line == '>' || *line == '|' || *line == '\t' || *line == '\r'){ line++; } if(line[0] == '\0'){ est_doc_add_text(doc, CB_DATUMPTR(datum)); CB_DATUMSETSIZE(datum, 0); } else { CB_DATUMCAT(datum, " ", 1); CB_DATUMCAT(datum, line, strlen(line)); } } est_doc_add_text(doc, CB_DATUMPTR(datum)); CB_DATUMCLOSE(datum); CB_LISTCLOSE(lines); } } else if(cbstrfwimatch(key, "text/html") || cbstrfwimatch(key, "application/xhtml+xml")){ tdoc = est_doc_new(); make_doc_from_html(body, bsiz, penc, plang, tdoc, links); if((text = est_doc_attr(tdoc, ESTDATTRTITLE)) != NULL){ if(!est_doc_attr(doc, ESTDATTRTITLE)) est_doc_add_attr(doc, ESTDATTRTITLE, text); est_doc_add_text(doc, text); } if((text = est_doc_attr(tdoc, ESTDATTRAUTHOR)) != NULL){ if(!est_doc_attr(doc, ESTDATTRAUTHOR)) est_doc_add_attr(doc, ESTDATTRAUTHOR, text); est_doc_add_text(doc, text); } texts = est_doc_texts(tdoc); for(i = 0; i < CB_LISTNUM(texts); i++){ text = CB_LISTVAL(texts, i); est_doc_add_text(doc, text); } est_doc_delete(tdoc); } else if(cbstrfwimatch(key, "message/rfc822")){ tdoc = est_doc_new(); make_doc_from_mime(body, bsiz, penc, plang, tdoc, links); if((text = est_doc_attr(tdoc, ESTDATTRTITLE)) != NULL){ if(!est_doc_attr(doc, ESTDATTRTITLE)) est_doc_add_attr(doc, ESTDATTRTITLE, text); est_doc_add_text(doc, text); } if((text = est_doc_attr(tdoc, ESTDATTRAUTHOR)) != NULL){ if(!est_doc_attr(doc, ESTDATTRAUTHOR)) est_doc_add_attr(doc, ESTDATTRAUTHOR, text); est_doc_add_text(doc, text); } texts = est_doc_texts(tdoc); for(i = 0; i < CB_LISTNUM(texts); i++){ text = CB_LISTVAL(texts, i); est_doc_add_text(doc, text); } est_doc_delete(tdoc); } else if(cbstrfwimatch(key, "text/")){ tdoc = est_doc_new(); make_doc_from_text(body, bsiz, penc, plang, tdoc, links); texts = est_doc_texts(tdoc); for(i = 0; i < CB_LISTNUM(texts); i++){ text = CB_LISTVAL(texts, i); est_doc_add_text(doc, text); } est_doc_delete(tdoc); } } free(body); cbmapclose(attrs); } /* set mime value as an attribute of a document */ static void doc_add_attr_mime(ESTDOC *doc, const char *name, const char *value){ char enc[64], *ebuf, *rbuf; assert(doc && name && value); ebuf = cbmimedecode(value, enc); if((rbuf = est_iconv(ebuf, -1, enc, "UTF-8", NULL, NULL)) != NULL){ est_doc_add_attr(doc, name, rbuf); free(rbuf); } free(ebuf); } /* Create a document object with an outer command. `xcmd' specifies an outer command line. `buf' specifies the pointer to a data buffer. It should be trailed by zero code. `size' specifies the size of the buffer. `url' specifies the URL of the target document. `penc' specifies the name of preferred encoding. If it is `NULL', it is not used. `plang' specifies the code of preferred language. `doc' specifies a document handle to store attributes and texts. `link' specifies a list handle to store links. If it is `NULL', it is not used. */ static void make_doc_with_xcmd(const char *xcmd, const char *url, const char *buf, int size, const char *penc, int plang, ESTDOC *doc, CBLIST *links){ const char *tmpdir, *pv, *ext, *fmt; char iname[URIBUFSIZ], oname[URIBUFSIZ], cmd[URIBUFSIZ]; char *rbuf, numbuf[NUMBUFSIZ]; int rnd, pid, rsiz; struct stat sbuf; assert(buf && size >= 0 && url && xcmd); if(ESTPATHCHR == '/' && stat("/tmp", &sbuf) == 0){ tmpdir = "/tmp"; } else if(ESTPATHCHR == '\\' && ((pv = getenv("TMP")) != NULL || (pv = getenv("TEMP")) != NULL) && stat(pv, &sbuf) == 0){ tmpdir = pv; } else { tmpdir = ESTCDIRSTR; } ext = NULL; if((pv = strrchr(url, ESTPATHCHR)) != NULL) url = pv; if((pv = strrchr(url, ESTEXTCHR)) != NULL) ext = pv; if(!ext || strlen(ext) >= 32 || strchr(ext, '"') || strchr(ext, '\\')) ext = ""; rnd = dpouterhash(url, -1) & 0xffff; pid = (int)getpid() & 0xffff; sprintf(iname, "%s%cxcmd-in-%04X%04X%s", tmpdir, ESTPATHCHR, pid, rnd, ext); sprintf(oname, "%s%cxcmd-out-%04X%04X%cest", tmpdir, ESTPATHCHR, pid, rnd, ESTEXTCHR); fmt = DRAFTCMD; if(cbstrfwmatch(xcmd, "T@")){ fmt = TEXTCMD; xcmd += 2; } else if(cbstrfwmatch(xcmd, "H@")){ fmt = HTMLCMD; xcmd += 2; } else if(cbstrfwmatch(xcmd, "M@")){ fmt = MIMECMD; xcmd += 2; } cbwritefile(iname, buf, size); sprintf(cmd, "%s \"%s\" \"%s\"", xcmd, iname, oname); system(cmd); if((rbuf = cbreadfile(oname, &rsiz)) != NULL){ if(fmt == DRAFTCMD){ make_doc_from_draft(rbuf, rsiz, doc, links); } else if(fmt == TEXTCMD){ make_doc_from_text(rbuf, rsiz, penc, plang, doc, links); } else if(fmt == HTMLCMD){ make_doc_from_html(rbuf, rsiz, penc, plang, doc, links); } else if(fmt == MIMECMD){ make_doc_from_mime(rbuf, rsiz, penc, plang, doc, links); } free(rbuf); } if(doc && fmt != NULL){ sprintf(numbuf, "%d", size); est_doc_add_attr(doc, ESTDATTRSIZE, numbuf); est_doc_add_attr(doc, ESTDATTRTYPE, est_ext_type(ext)); } unlink(oname); unlink(iname); } /* END OF FILE */ hyperestraier-1.4.13/wavermod.h000066400000000000000000000360751125261632700165030ustar00rootroot00000000000000/************************************************************************************************* * Common modules related to estwaver * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #ifndef _WAVERMOD_H /* duplication check */ #define _WAVERMOD_H #include "estraier.h" #include "estmtdb.h" #include "estnode.h" #include "myconf.h" #include "mymorph.h" /************************************************************************************************* * pseudo API *************************************************************************************************/ #define NUMBUFSIZ 32 /* size of a buffer for a number */ #define URIBUFSIZ 8192 /* size of a buffer for an URI */ #define IOBUFSIZ 8192 /* size of a buffer for I/O */ #define MINIBNUM 31 /* bucket number of a small map */ #define RESLIMSIZE (1048576*32) /* limitation of the entity body of response */ #define CONFFILE "_conf" /* name of the configuration file */ #define METAFILE "_meta" /* name of the meta database */ #define LOGFILE "_log" /* name of the log file */ #define INDEXDIR "_index" /* name of the index directory */ #define MYTMPDIR "_tmp" /* name of the temporary directory */ #define MMKMAGIC "magic" /* meta key of the magic number of meta DB */ #define MMKMAGVAL "[ESTWAVER]" /* value of the magic number of meta DB */ #define QUEUEFILE "_queue" /* name of the queue file */ #define QUEUELRM 77 /* records in a leaf node of the queue */ #define QUEUENIM 192 /* records in a non-leaf node of the queue */ #define QUEUELCN 2048 /* number of leaf cache of the queue */ #define QUEUENCN 512 /* number of non-leaf cache of the queue */ #define TRACEFILE "_trace" /* name of the trace file */ #define TRACEBNUM 425977 /* bucket number of the trace database */ #define TRACEDNUM 3 /* division number of the trace database */ #define DATTRDEPTH "_depth" /* name of the attribute of the depth */ #define DRAFTCMD "[DRAFT]" /* built-in command for document draft */ #define TEXTCMD "[TEXT]" /* built-in command for plain text */ #define HTMLCMD "[HTML]" /* built-in command for HTML */ #define MIMECMD "[MIME]" /* built-in command for MIME */ enum { /* enumeration for initializing options */ WI_PERFNG = 1 << 10, /* use perfect N-gram analyzer */ WI_CHRCAT = 1 << 11, /* use character category analyzer */ WI_SMALL = 1 << 20, /* small tuning */ WI_LARGE = 1 << 21, /* large tuning */ WI_HUGE = 1 << 22, /* huge tuning */ WI_SCVOID = 1 << 25, /* store scores as void */ WI_SCINT = 1 << 26, /* store scores as integer */ WI_SCASIS = 1 << 27 /* refrain from adjustment of scores */ }; enum { /* enumeration for running modes */ LL_DEBUG = 1, /* debug */ LL_INFO = 2, /* information */ LL_WARN = 3, /* warning */ LL_ERROR = 4, /* error */ LL_NONE = 5, /* none */ LL_CHECK = 6 /* check to open */ }; enum { /* enumeration for crawling strategy */ CS_BALANCED, /* balanced of depth, width, and similarity */ CS_SIMILARITY, /* similarity first */ CS_DEPTH, /* depth first */ CS_WIDTH, /* width first */ CS_RANDOM /* at random */ }; typedef struct { /* type of structure for priority queue */ VILLA *db; /* internal database */ double max; /* maximum point */ } QUEUE; typedef struct { /* type of structure for a keyword */ const char *word; /* face of keyword */ int wsiz; /* size of the keyword */ int pt; /* score tuned by TF-IDF */ } KEYSC; typedef struct { /* type of structure for a URL normalization */ void *regex; /* regular expressions */ char *before; /* before substring */ char *after; /* after substring */ } UNRULE; typedef struct { /* type of structure for a permission */ void *regex; /* regular expressions */ int visit; /* to be visited */ int index; /* to be indexed */ } PMRULE; typedef struct { /* type of structure for a URL rule */ void *regex; /* regular expressions */ char *type; /* media type */ } URLRULE; typedef struct { /* type of structure for a media type rule */ void *regex; /* regular expressions */ char *filter; /* filter command */ } MTRULE; typedef struct { /* type of structure for waver */ char *rootdir; /* root directory */ DEPOT *metadb; /* meta database */ QUEUE *queue; /* priority queue */ CURIA *trace; /* tracking records */ ESTMTDB *index; /* document index */ CBMAP *seeds; /* seed map */ CBMAP *kwords; /* keyword map */ CBMAP *sites; /* site map */ char *pxhost; /* host name of the proxy */ int pxport; /* port number of the proxy */ int interval; /* interval time */ int timeout; /* timeout of each request */ int strategy; /* crawling strategy */ double inherit; /* inheritance ratio of similarity */ int seeddepth; /* maximum depth of seed documents */ int maxdepth; /* maximum depth of recursion */ int masscheck; /* standard value for checking mass sites */ int queuesize; /* size of the priority queue */ CBLIST *unrules; /* rules of URL normalization */ CBLIST *pmrules; /* rules of permission */ CBLIST *urlrules; /* rules of URL */ CBLIST *mtrules; /* rules of media types */ int language; /* preferred language */ int textlimit; /* text size limitation */ int seedkeynum; /* total number of keywords for seed documents */ int savekeynum; /* number of keywords saved for each document */ int thnum; /* number of threads */ int docnum; /* total number of documents */ int period; /* running time period */ int revisit; /* revisit span */ size_t cachesize; /* maximum size of the index cache */ CBMAP *nodes; /* remote nodes for alternative indexes */ char *draftdir; /* path of the draft directory */ char *entitydir; /* path of the entity directory */ char *postproc; /* postprocessor for retrieved files */ time_t stime; /* start time */ int curnum; /* current number of documents */ int curnode; /* current using node */ double minload; /* minimum load of nodes */ } WAVER; /* The handles of the log file. */ extern FILE *log_fp; /* The level of logging. */ extern int log_level; /* Open the log file. `rootdir' specifies the path of the root directory. `path' specifies the path of the log file. `level' specifies the leve of logging. `trunc' specifies whether to truncate the log file. The return value is true if success, else it is false. */ int log_open(const char *rootdir, const char *path, int level, int trunc); /* Print formatted string into the log file. */ void log_print(int level, const char *format, ...); /* Initialize the root directory. `rootdir' specifies the path of the root directory. `options' specifies the options: `WI_PERFNG', `WI_CHRCAT', `WI_SMALL', `WI_LARGE', `WI_HUGE', `WI_SCVOID', `WI_SCINT', and `WI_ACASIS'. The return value is true if success, else it is false. */ int waver_init(const char *rootdir, int options); /* Open a waver handle. `rootdir' specifies the path of the root directory. The return value is the waver handle or `NULL' on failure. */ WAVER *waver_open(const char *rootdir); /* Close a waver handle. `waver' specifies a waver handle. The return value is true if success, else it is false. */ int waver_close(WAVER *waver); /* Set the current node. `waver' specifies a waver handle. */ void waver_set_current_node(WAVER *waver); /* Get the load of the current node. `waver' specifies a waver handle. the return value is the load of the current node. */ double waver_current_node_load(WAVER *waver); /* Add a document to a node. `waver' specifies a waver handle. `doc' specifies a document object. `codep' specifies the pointer to a variable to which the status code of respnese is assigned. If it is `NULL', it is not used. The return value is true if success, else it is false. */ int waver_node_put_doc(WAVER *waver, ESTDOC *doc, int *codep); /* Remove a document from a node. `waver' specifies a waver handle. `url' specifies the URL of a document. `codep' specifies the pointer to a variable to which the status code of respnese is assigned. If it is `NULL', it is not used. The return value is true if success, else it is false. */ int waver_node_out_doc(WAVER *waver, const char *url, int *codep); /* Open a priority queue. `name' specifies the name of a database file. The return value is the queue handle or `NULL' on failure. */ QUEUE *queue_open(const char *name); /* Close a priority queue. `queue' specifies a queue handle. The return value is true if successful, or false on failure. */ int queue_close(QUEUE *queue); /* Set the range of the priority space of a priority queue. `queue' specifies a queue handle. `range' specifies the range of the priority space. */ void queue_set_range(QUEUE *queue, double range); /* Enqueue a record into a priority queue. `queue' specifies a queue handle. `str' specifies a string. `priority' specifies the priority between 0.0 and 1.0. The return value is true if successful, or false on failure. */ int queue_enqueue(QUEUE *queue, const char *str, double priority); /* Dequeue a record from a priority queue. `queue' specifies a queue handle. The return value is the pointer to a record or `NULL' if no record exists. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use. */ char *queue_dequeue(QUEUE *queue); /* Get the number of records in a priority queue. `queue' specifies a queue handle. The return value is the number of records. */ int queue_rnum(QUEUE *queue); /* Discard inferior records in a priority queue. `queue' specifies a queue handle. `num' specifies the number of records to be kept. The return value is true if successful, or false on failure. */ int queue_slim(QUEUE *queue, int num); /* Add a word to a keyword map. `kwords' specifies a keyword map handle. `word' specifies the string of a word. `frequency' specifies the frequency of the word. */ void kwords_add(CBMAP *kwords, const char *word, int frequency); /* Reduce elements of a keyword map. `kwords' specifies a keyword map handle. `num' specifies the number of elements after reduction of the keyword map. `fadeout' specifies whether scores do fade-out. */ void kwords_reduce(CBMAP *kwords, int num, int fadeout); /* Fetch a document of a URL. `url' specifies the URL of a document. `pxhost' specifies the host name of a proxy. If it is `NULL', it is not used. `pxport' specifies the port number of the proxy. `outsec' specifies timeout in seconds. If it is negative, it is not used. `mdate' specifies the last-modified date. If it is not more than 0, it is not used. `urlrules' specifies a list object conteining type rules of URLs. If it is `NULL', the default rule is applied. `mtrules' specifies a list object conteining filter rules of media types. If it is `NULL', the default rule is applied. `codep' specifies the pointer to a variable to which the status code of respnese is assigned. If it is `NULL', it is not used. `raw' specifies a datum handle to store raw data. If it is `NULL', it is not used. `heads' specifies a map handle to store HTTP headers. If it is `NULL', it is not used. `links' specifies a list handle to store links. If it is `NULL', it is not used. `unrules' specifies a list object conteining URL normalization rules. If it is `NULL', it is not used. `doc' specifies a document handle to store attributes and texts. If it is `NULL', it is not used. `lang' specifies the code of preferred language. The return value is true if success, else it is false. */ int fetch_document(const char *url, const char *pxhost, int pxport, int outsec, time_t mdate, const CBLIST *urlrules, const CBLIST *mtrules, int *codep, CBDATUM *raw, CBMAP *heads, CBLIST *links, const CBLIST *unrules, ESTDOC *doc, int lang); #endif /* duplication check */ /* END OF FILE */ hyperestraier-1.4.13/windows/000077500000000000000000000000001125261632700161655ustar00rootroot00000000000000hyperestraier-1.4.13/windows/COPYING.txt000066400000000000000000000644661125261632700200560ustar00rootroot00000000000000 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. Copyright (C) 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. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! hyperestraier-1.4.13/windows/Makefile000066400000000000000000000021061125261632700176240ustar00rootroot00000000000000# Makefile for Hyper Estraier Win32 Tools #================================================================ # Setting Variables #================================================================ MYBINS = scmutil.exe CC = gcc -mno-cygwin CFLAGS = -I. -I$(HOME)/include -I/usr/local/include -Wall LDFLAGS = -L. -L$(HOME)/lib -L/usr/local/lib LIBS = LDENV = LD_RUN_PATH=/lib:/usr/lib:$(HOME)/lib:/usr/local/lib:. #================================================================ # Suffix rules #================================================================ .SUFFIXES : .SUFFIXES : .c .o .c.o : $(CC) -c $(CPPFLAGS) $(CFLAGS) $< #================================================================ # Actions #================================================================ all : $(MYBINS) clean : rm -rf $(MYBINS) *.o a.out *~ #================================================================ # Building binaries #================================================================ scmutil.exe : scmutil.o $(CC) $(CFLAGS) -o $@ scmutil.o $(LDFLAGS) $(LIBS) # END OF FILE hyperestraier-1.4.13/windows/README-en.txt000066400000000000000000000107251125261632700202700ustar00rootroot00000000000000================================================================ Hyper Estraier: a full-text search system for communities Copyright (C) 2004-2006 Mikio Hirabayashi ================================================================ This is a package of Win32 binaries of Hyper Estraier. This package contains the core API of Hyper Estraier and its utility commands. Also, DLLs of zlib, iconv, and QDBM are included. estraier.dll : DLL of Hyper Estraier libestraier.dll.a : import library of Hyper Estraier qdbm.dll : DLL of QDBM mgwz.dll : DLL of zlib libiconv-2.dll : DLL of iconv regex.dll : DLL of regex pthreadGC2.dll : DLL of Pthreads pthreadGC2.a : import library of Pthreads estraier.h : header file of Hyper Estraier depot.h : header file of QDBM curia.h : header file of QDBM cabin.h : header file of QDBM villa.h : header file of QDBM pthread.h : header file of Pthreads sched.h : header file of Pthreads semaphore.h : header file of Pthreads estcmd.exe : utility command estmttest.exe : command for operation check estmaster.exe : command of the node master estmaster-sv.exe : service version of the node master estbutler.exe : helper command for estmaster estcall.exe : command of the node client estwaver.exe : command for web crawling estload.exe : command for load test scmutil.exe : command for service control manager estcheck.bat : command for operation check estxfilt.bat : wrapper of the text extraction filter estresult.dtd : DTD of XML generated by estcmd estseek.cgi : CGI script for search estseek.conf : configuration of the CGI script estseek.tmpl : configuration of the CGI script estseek.top : configuration of the CGI script estseek.help : configuration of the CGI script estfraud.cgi : CGI script of pseudo node server estfraud.conf : configuration of the CGI script estproxy.cgi : CGI script of highlighting display estproxy.conf : configuration of the CGI script estscout.cgi : CGI script for local meta search estscout.conf : configuration of the CGI script estsupt.cgi : CGI script for remote meta search estsupt.conf : configuration of the CGI script locale/ : configuration for localization increm/ : files for incremental search doc/ : manuals xdoc2txt.exe : main unit of the text extraction filter xdoc2txt.txt : manual of xdoc2txt zlib.dll : zlib for xdoc2txt estraiernative.jar : JAR of the Java binding jestraier.dll : DLL of the Java binding estraierpure.jar : JAR of the pure Java Interface estraierpure.rb : module of the pure Ruby Interface estcall.rb : command of the pure Ruby Interface Install all commands (*.exe, *.bat) and DLLs (*.dll) into a directory included in the command search path. Install the CGI script and its configuration files into a directory according to the web server. Hyper Estraier is released under the terms of the GNU Lesser General Public License. See the file `COPYING.txt' for details. Hyper Estraier 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/hyperestraier-users See http://hyperestraier.sourceforge.net/ for more information. Copyrights of programs in this package except for Hyper Estraier inhere to each product. See documentation of each product andlicense information for detail. QDBM was written by Mikio Hirabayashi See http://qdbm.sourceforge.net/ for more information. zlib was written by Jean-loup Gailly et al. See http://www.gzip.org/zlib/ for more information. iconv was written by Ulrich Drepper. See http://www.gnu.org/software/libiconv/ for more information. regex was written by Henry Spencer See ftp://ftp.zoo.toronto.edu/pub/ for more information. Pthreads for Win32 was written by Ben Elliston et al. See http://sources.redhat.com/pthreads-win32/ for more information. xdoc2txt was written by hishida. See the file xdoc2txt.txt for more information. MD5 implementation was written by L. Peter Deutsch. Thank you for using Hyper Estraier. == END OF FILE == hyperestraier-1.4.13/windows/README-ja.txt000066400000000000000000000114101125261632700202500ustar00rootroot00000000000000================================================================ Hyper Estraier: a full-text search system for communities Copyright (C) 2004-2006 Mikio Hirabayashi ================================================================ これはHyper EstraierのWin32版バイナリパッケージです。 このパッケージには、Hyper EstraierのコアAPIとユーティリティコマンドが 含まれています。また、幾つかの他の製品のライブラリやコマンドも同梱さ れています。 estraier.dll : Hyper EstraierのDLL libestraier.dll.a : Hyper Estraierのインポートライブラリ qdbm.dll : QDBM(データベースライブラリ)のDLL mgwz.dll : zlib(データ圧縮ライブラリ)のDLL libiconv-2.dll : iconv(文字コード変換ライブラリ)のDLL regex.dll : regex(正規表現ライブラリ)のDLL pthreadGC2.dll : Pthreads(POSIXスレッドライブラリ)のDLL libpthreadGC2.a : Pthreadsのインポートライブラリ estraier.h : Hyper Estraierのヘッダファイル depot.h : QDBMのヘッダファイル curia.h : QDBMのヘッダファイル cabin.h : QDBMのヘッダファイル villa.h : QDBMのヘッダファイル pthread.h : Pthreadsのヘッダファイル sched.h : Pthreadsのヘッダファイル semaphore.h : Pthreadsのヘッダファイル estcmd.exe : ユーティリティコマンド estmtcmd.exe : 動作確認用コマンド estmaster.exe : ノードマスタコマンド estmaster-sv.exe : ノードマスタのサービス版 estbutler.exe : ノードマスタのヘルパコマンド estcall.exe : ノードクライアントコマンド estwaver.exe : Webクローラのコマンド estload.exe : 負荷テスト用コマンド scmutil.exe : サービス設定用コマンド estcheck.bat : 動作確認用コマンド estxfilt.bat : テキスト抽出フィルタのラッパー estresult.dtd : estcmdのXML出力のDTD estseek.cgi : 検索用CGIスクリプト estseek.conf : 検索用CGIスクリプトの設定ファイル estseek.tmpl : 検索用CGIスクリプトの設定ファイル estseek.top : 検索用CGIスクリプトの設定ファイル estseek.help : 検索用CGIスクリプトの設定ファイル estfraud.cgi : 疑似ノードサーバ用CGIスクリプト estfraud.conf : 疑似ノードサーバ用CGIスクリプトの設定ファイル estproxy.cgi : ハイライト表示用CGIスクリプト estproxy.conf : ハイライト表示用CGIスクリプトの設定ファイル estscout.cgi : ローカルメタ検索用CGIスクリプト estscout.conf : ローカルメタ検索用CGIスクリプトの設定ファイル estsupt.cgi : リモートメタ検索用CGIスクリプト estsupt.conf : リモートメタ検索用CGIスクリプトの設定ファイル locale/ : 地域化用設定ファイル increm/ : インクリメンタル検索用のファイル doc/ : 説明書などの文書 xdoc2txt.exe : テキスト抽出フィルタの本体 xdoc2txt.txt : xdoc2txtの説明書 zlib.dll : xdoc2txtが利用するzlib estraiernative.jar : JavaバインディングのJAR jestraier.dll : JavaバインディングのDLL estraierpure.jar : ピュアJavaインターフェイスのJAR estraierpure.rb : ピュアRubyインターフェイスのモジュール estcall.rb : ピュアRubyインターフェイスのコマンド コマンド(*.exe、*.bat)とDLL(*.dll)はコマンド検索パスの通った場所に 置いてください。CGIスクリプトと各種設定ファイルは、Webサーバに依存した 適当な位置に置いてください。 CGIスクリプトのコマンド検索パスはWebサーバの実行ユーザによって異なるこ とに注意してください。CGIスクリプトと同じ場所にDLLも置いておけば確実に パスを通すことができます。 Hyper EstraierはGNU Lesser General Public Licenseのもとにリリースされ ています。詳しくは「COPYING.txt」をご覧ください。 Hyper Estraierは平林幹雄が作成しました。作者に連絡を取るには、 「mikio@users.sourceforge.net」まで電子メールを送ってください。ただし、 他のユーザと共有できそうな話題に関しては、メーリングリストに送ってくだ さい。メーリングリストに参加するには、以下のURLを参照してください。 http://lists.sourceforge.net/lists/listinfo/hyperestraier-users-ja 詳しくは、「http://hyperestraier.sourceforge.net/」をご覧ください。 このパッケージに同梱されているHyper Estraier本体以外のプログラム群の 権利は、各製品の著作者に帰属します。詳細な使用法やライセンスについて は各製品の資料をご覧ください。 QDBMは平林幹雄が開発しました。 詳しくは http://qdbm.sourceforge.net/ をご覧ください。 zlibはJean-loup Gailly氏らが開発しました。 詳しくは http://www.gzip.org/zlib/ をご覧ください。 iconvはUlrich Drepper氏が開発しました。 詳しくは http://www.gnu.org/software/libiconv/ をご覧ください。 regexはHenry Spencer氏が開発しました。 詳しくは ftp://ftp.zoo.toronto.edu/pub/ をご覧ください。 Pthreads for Win32はBen Elliston氏らが開発しました。 詳しくは http://sources.redhat.com/pthreads-win32/ をご覧ください。 xdoc2txtはhishida氏が開発しました。 詳しくは xdoc2txt.txt ファイルをご覧ください。 MD5の実装はL. Peter Deutsch氏が開発しました。 Hyper Estraierをお選びいただきありがとうございます。 == END OF FILE == hyperestraier-1.4.13/windows/estcheck.bat000066400000000000000000000011441125261632700204460ustar00rootroot00000000000000estcmd wicked casket 1000 if errorlevel 1 goto error estcmd wicked casket 1000 if errorlevel 1 goto error estcmd regression casket if errorlevel 1 goto error rd /S /Q casket estcmd gather casket . if errorlevel 1 goto error estcmd extkeys casket if errorlevel 1 goto error set QUERY_STRING=gnu estseek.cgi 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 hyperestraier-1.4.13/windows/estxfilt.bat000066400000000000000000000000521125261632700205140ustar00rootroot00000000000000@echo off xdoc2txt -s -r=0 -o=0 %1 > %2 hyperestraier-1.4.13/windows/scmutil.c000066400000000000000000000135241125261632700200160ustar00rootroot00000000000000/************************************************************************************************* * Utility for the Win32 service control manager * Copyright (C) 2004-2007 Mikio Hirabayashi * This file is part of Hyper Estraier. * Hyper Estraier 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 any later version. Hyper Estraier 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 Hyper * Estraier; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA. *************************************************************************************************/ #include #include #include /* global variables */ const char *g_progname = NULL; /* function prototypes */ int main(int argc, char **argv); static void printferror(const char *format, ...); static void printfinfo(const char *format, ...); static void usage(void); static int runinstall(int argc, char **argv); static int rununinstall(int argc, char **argv); static int procinstall(const char *name, const char *label, const char *path); static int procuninstall(const char *name); /* main routine */ int main(int argc, char **argv){ int rv; g_progname = argv[0]; if(argc < 2) usage(); rv = 0; if(!strcmp(argv[1], "install")){ rv = runinstall(argc, argv); } else if(!strcmp(argv[1], "uninstall")){ rv = rununinstall(argc, argv); } else { usage(); } return rv; } /* print formatted error string and flush the buffer */ static void printferror(const char *format, ...){ va_list ap; va_start(ap, format); fprintf(stderr, "%s: ERROR: ", g_progname); vfprintf(stderr, format, ap); fputc('\n', stderr); fflush(stderr); va_end(ap); } /* print formatted information string and flush the buffer */ static void printfinfo(const char *format, ...){ va_list ap; va_start(ap, format); printf("%s: INFO: ", g_progname); vprintf(format, ap); putchar('\n'); fflush(stdout); va_end(ap); } /* print the usage and exit */ static void usage(void){ fprintf(stderr, "%s: utility for the Win32 service control manager\n", g_progname); fprintf(stderr, "\n"); fprintf(stderr, "usage:\n"); fprintf(stderr, " %s install name label command ...\n", g_progname); fprintf(stderr, " %s uninstall name\n", g_progname); fprintf(stderr, "\n"); exit(1); } /* parse arguments of the install command */ static int runinstall(int argc, char **argv){ char *name, *label, path[8192], *wp; int i, rv; name = NULL; label = NULL; wp = path; for(i = 2; i < argc; i++){ if(!name && argv[i][0] == '-'){ usage(); } else if(!name){ name = argv[i]; } else if(!label){ label = argv[i]; } else { if(wp > path) wp += sprintf(wp, " "); wp += sprintf(wp, "%s", argv[i]); } } *wp = '\0'; if(!name || !label) usage(); rv = procinstall(name, label, path); return rv; } /* parse arguments of the uninstall command */ static int rununinstall(int argc, char **argv){ char *name; int i, rv; name = NULL; for(i = 2; i < argc; i++){ if(!name && argv[i][0] == '-'){ usage(); } else if(!name){ name = argv[i]; } else { usage(); } } if(!name); rv = procuninstall(name); return rv; } /* perform the install command */ static int procinstall(const char *name, const char *label, const char *path){ SC_HANDLE scm, svc; printfinfo("installing %s ...", name); if(!(scm = OpenSCManager(0, 0, SC_MANAGER_CREATE_SERVICE))){ printferror("the SCM could not open: %d", GetLastError()); return 1; } if(!(svc = CreateService(scm, name, label, SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL, path, 0, 0, 0, 0, 0))){ printferror("the new service could not be created: %d", GetLastError()); CloseServiceHandle(scm); return 1; } CloseServiceHandle(svc); CloseServiceHandle(scm); printfinfo("done"); return 0; } /* perform the uninstall command */ static int procuninstall(const char *name){ SC_HANDLE scm, svc; SERVICE_STATUS st; printfinfo("uninstalling %s ...", name); if(!(scm = OpenSCManager(0, 0, SC_MANAGER_CREATE_SERVICE))){ printferror("the SCM could not open: %d", GetLastError()); return 1; } if(!(svc = OpenService(scm, name, SERVICE_ALL_ACCESS | DELETE))){ printferror("the service could not open: %d", GetLastError()); CloseServiceHandle(scm); return 1; } if(!QueryServiceStatus(svc, &st)){ printferror("the service did not finish successfully: %d", GetLastError()); CloseServiceHandle(svc); CloseServiceHandle(scm); return 1; } if(st.dwCurrentState != SERVICE_STOPPED){ if(!ControlService(svc, SERVICE_CONTROL_STOP, &st)){ printferror("the service did not finish successfully: %d", GetLastError()); CloseServiceHandle(svc); CloseServiceHandle(scm); return 1; } Sleep(500); } if(!DeleteService(svc)){ printferror("the service could not be deleted: %d", GetLastError()); CloseServiceHandle(svc); CloseServiceHandle(scm); return 1; } CloseServiceHandle(svc); CloseServiceHandle(scm); printfinfo("done"); return 0; } /* END OF FILE */