diff --git a/doc/gperf.html b/doc/gperf.html index 9781687..015c6d2 100644 --- a/doc/gperf.html +++ b/doc/gperf.html @@ -1,36 +1,39 @@
+ from gperf.texi on 20 August 2000 --> -gperfgperf 2.7.2
gperf Utility
-gperf
-gperf
+gperf Utility
+gperf
+gperf
-gperf Utility
+gperf
gperf
-
-This manual documents the GNU gperf perfect hash function generator
-utility, focusing on its features and how to use them, and how to report
-bugs.
-
-
-Version 1, February 1989 +Version 2, June 1991
-Copyright (C) 1989 Free Software Foundation, Inc. -675 Mass Ave, Cambridge, MA 02139, USA +Copyright (C) 1989, 1991 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. @@ -73,25 +67,27 @@ of this license document, but changing it is not allowed. -Preamble
+Preamble
- The license agreements of most software companies try to keep users -at the mercy of those companies. By contrast, our General Public + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. The -General Public License applies to the Free Software Foundation's -software and to any other program whose authors commit to using it. -You can use it for your programs, too. +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too.
When we speak of free software, we are referring to freedom, not -price. Specifically, the General Public License is designed to make -sure that you have the freedom to give away or sell copies of free -software, that you receive source code or can get it if you want it, -that you can change the software or use pieces of it in new free -programs; and that you know you can do these things. +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 or use pieces of it +in new free programs; and that you know you can do these things.
@@ -102,10 +98,11 @@ distribute copies of the software, or if you modify it.
- For example, if you distribute copies of a such a program, whether + For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the -source code. And you must tell them their rights. +source code. And you must show them these terms so they know their +rights.
@@ -122,6 +119,14 @@ want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. +
++ Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. +
The precise terms and conditions for copying, distribution and @@ -129,138 +134,221 @@ modification follow.
-TERMS AND CONDITIONS +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- -This License Agreement applies to any program or other work which -contains a notice placed by the copyright holder saying it may be -distributed under the terms of this General Public License. The -"Program", below, refers to any such program or work, and a "work based -on the Program" means either the Program or any work containing the -Program or a portion of it, either verbatim or with modifications. Each -licensee is addressed as "you". +This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does.
- -You may copy and distribute verbatim copies of the Program's 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 -General Public License and to the absence of any warranty; and give any -other recipients of the Program a copy of this General Public License -along with the Program. You may charge a fee for the physical act of -transferring a copy. +You may copy and distribute verbatim copies of the Program's +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 give any other recipients of the Program a copy of this License +along with the Program. + +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.
- -You may modify your copy or copies of the Program or any portion of -it, and copy and distribute such modifications under the terms of Paragraph -1 above, provided that you also do the following: +You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: -
+
+You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: -Mere aggregation of another independent work with the Program (or its -derivative) on a volume of a storage or distribution medium does not bring -the other work under the scope of these terms. + ++ +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +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 Program, 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 Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License.
- -cause the modified files to carry prominent notices stating that -you changed the files and the date of any change; and +You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change.
- -cause the whole of any work that you distribute or publish, that -in whole or in part contains the Program or any part thereof, either -with or without modifications, to be licensed at no charge to all -third parties under the terms of this General Public License (except -that you may choose to grant warranty protection to some or all -third parties, at your option). +You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License.
- -If the modified program normally reads commands interactively when -run, you must cause it, when started running for such interactive use -in the simplest and most usual way, to print or display an -announcement including an appropriate copyright notice and a notice -that there is no warranty (or else, saying that you provide a -warranty) and that users may redistribute the program under these -conditions, and telling the user how to view a copy of this General -Public License. +If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) +
- -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. -
+
-Source code for a work means the preferred form of the work for making -modifications to it. For an executable file, complete source code means -all the source code for all modules it contains; but, as a special -exception, it need not include source code for modules which are standard -libraries that accompany the operating system on which the executable -file runs, or for standard header files or definitions files that -accompany that operating system. +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, 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 executable. However, as a +special exception, the source code 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. + +If distribution of executable or 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 counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code.- + +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; or,
- -You may copy and distribute the Program (or a portion or derivative of -it, under Paragraph 2) in object code or executable form under the terms of -Paragraphs 1 and 2 above provided that you also do one of the following: - - -
-
+received the program in object code or executable form with such +an offer, in accord with Subsection b above.) +- - -accompany it with the complete corresponding machine-readable -source code, which must be distributed under the terms of -Paragraphs 1 and 2 above; or, +Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or,
- -accompany it with a written offer, valid for at least three -years, to give any third party free (except for a nominal charge -for the cost of distribution) a complete machine-readable copy of the -corresponding source code, to be distributed under the terms of -Paragraphs 1 and 2 above; or, - -
- - -accompany it with the information you received as to where the -corresponding source code may be obtained. (This alternative is +Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you -received the program in object code or executable form alone.) -
- -You may not copy, modify, sublicense, distribute or transfer the -Program except as expressly provided under this General Public License. -Any attempt otherwise to copy, modify, sublicense, distribute or transfer -the Program is void, and will automatically terminate your rights to use -the Program under this License. However, parties who have received -copies, or rights to use copies, from you under this General Public -License will not have their licenses terminated so long as such parties -remain in full compliance. +You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program 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.
- -By copying, distributing or modifying the Program (or any work based -on the Program) you indicate your acceptance of this license to do so, -and all its terms and conditions. +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 Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it.
- Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the original -licensor to copy, distribute or modify the Program subject to these -terms and conditions. You may not impose any further restrictions on the -recipients' exercise of the rights granted herein. +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program 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 to +this License. + +
- + +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 Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program 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 Program. + +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. + +
- + +If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program 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.
- @@ -270,11 +358,11 @@ 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 Program -specifies a version number of the license which applies to it and "any +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 Program does not specify a version number of -the license, you may choose any version ever published by the Free Software +this License, you may choose any version ever published by the Free Software Foundation.
- @@ -303,15 +391,15 @@ REPAIR OR CORRECTION.
- -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 +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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE -WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN -ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES.
@@ -320,31 +408,30 @@ END OF TERMS AND CONDITIONS
-Appendix: How to Apply These Terms to Your New Programs
+How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest -possible use to humanity, the best way to achieve this is to make it -free software which everyone can redistribute and change under these -terms. +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms.
- To do so, attach the following notices to the program. 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. + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found.
-one line to give the program's name and a brief idea of what it does. -Copyright (C) 19yy name of author +one line to give the program's name and an idea of what it does. +Copyright (C) year name of author -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 1, or (at your option) -any later version. +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -353,7 +440,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.@@ -367,48 +454,55 @@ when it starts in an interactive mode:
-Gnomovision version 69, Copyright (C) 19yy name of author -Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. -This is free software, and you are welcome to redistribute it -under certain conditions; type `show c' for details. +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details +type `show w'. This is free software, and you are welcome +to redistribute it under certain conditions; type `show c' +for details.-The hypothetical commands `show w' and `show c' should show the -appropriate parts of the General Public License. Of course, the -commands you use may be called something other than `show w' and `show -c'; they could even be mouse-clicks or menu items--whatever suits your -program. +The hypothetical commands `show w' and `show c' should show +the appropriate parts of the General Public License. Of course, the +commands you use may be called something other than `show w' and +`show c'; they could even be mouse-clicks or menu items--whatever +suits your program.
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here a sample; alter the names: +necessary. Here is a sample; alter the names:
-Yoyodyne, Inc., hereby disclaims all copyright interest in the -program `Gnomovision' (a program to direct compilers to make passes -at assemblers) written by James Hacker. +Yoyodyne, Inc., hereby disclaims all copyright +interest in the program `Gnomovision' +(which makes passes at compilers) written +by James Hacker. signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice-That's all there is to it! +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License.
-Contributors to GNU
+gperfUtilityContributors to GNU
gperfUtility
gperf perfect hash function generator utility was
originally written in GNU C++ by Douglas C. Schmidt. It is now also
available in a highly-portable "old-style" C version. The general
@@ -417,7 +511,7 @@ Bostic's algorithm written in C, and distributed to net.sources around
1984. The current program is a heavily modified, enhanced, and extended
implementation of Keith's basic idea, created at the University of
California, Irvine. Bugs, patches, and suggestions should be reported
-to <bug-gnu-utils@gnu.org> and <schmidt@ics.uci.edu>.
+to <bug-gnu-utils@gnu.org>.
gperf.
+
+
gperf is a perfect hash function generator written in C++. It
-transforms an n element user-specified keyword set W into
-a perfect hash function F. F uniquely maps keywords in
-W onto the range 0..k, where k >= n. If
-k = n then F is a minimal perfect hash function.
+transforms an n element user-specified keyword set W into a
+perfect hash function F. F uniquely maps keywords in
+W onto the range 0..k, where k >= n. If k
+= n then F is a minimal perfect hash function.
gperf generates a 0..k element static lookup table and a
pair of C functions. These functions determine whether a given
-character string s occurs in W, using at most one probe
-into the lookup table.
+character string s occurs in W, using at most one probe into
+the lookup table.
@@ -450,19 +549,18 @@ into the lookup table.
lexical analyzers in several production and research compilers and
language processing tools, including GNU C, GNU C++, GNU Pascal, GNU
Modula 3, and GNU indent. Complete C++ source code for gperf is
-available via anonymous ftp from ics.uci.edu and
-ftp.santafe.edu. gperf was also distributed along with
-the GNU libg++ library for several years. A highly portable,
-functionally equivalent K&R C version of gperf is archived in
-comp.sources.unix, volume 20. Finally, a paper describing
-gperf's design and implementation in greater detail is available
-in the Second USENIX C++ Conference proceedings.
+available via anonymous ftp from ftp://ftp.gnu.org/pub/gnu/gperf/.
+A paper describing gperf's design and implementation in greater
+detail is available in the Second USENIX C++ Conference proceedings.
gperfgperfA static search structure is an Abstract Data Type with certain fundamental operations, e.g., initialize, insert, @@ -491,8 +589,8 @@ often locate a table entry in constant time, but typically impose additional memory overhead and exhibit poor worst case performance.
-+ Minimal perfect hash functions provide an optimal solution for a particular class of static search sets. A minimal perfect hash function is defined by two properties: @@ -542,7 +640,7 @@ efficiently identify their respective reserved keywords.
-gperfgperf
The perfect hash function generator gperf reads a set of
@@ -578,9 +676,12 @@ Experimentation is the key to getting the most from gperf.
gperfgperf
+
+
+
+
You can control the input keyfile format by varying certain command-line
arguments, in particular the `-t' option. The input's appearance
is similar to GNU utilities flex and bison (or UNIX
@@ -598,15 +699,15 @@ functions
-Unlike flex or bison, all sections of gperf's input
-are optional. The following sections describe the input format for each
-section.
+Unlike flex or bison, all sections of
+gperf's input are optional. The following sections describe the
+input format for each section.
struct Declarations and C Code Inclusionstruct Declarations and C Code Inclusion
The keyword input file optionally contains a section for including
@@ -614,13 +715,13 @@ arbitrary C declarations and definitions, as well as provisions for
providing a user-supplied struct. If the `-t' option
is enabled, you must provide a C struct as the last
component in the declaration section from the keyfile file. The first
-field in this struct must be a char * identifier called `name',
-although it is possible to modify this field's name with the `-K'
-option described below.
+field in this struct must be a char * or const char *
+identifier called `name', although it is possible to modify this
+field's name with the `-K' option described below.
-Here is simple example, using months of the year and their attributes as +Here is a simple example, using months of the year and their attributes as input:
@@ -643,17 +744,20 @@ december, 12, 31, 31
-Separating the struct declaration from the list of key words and
-other fields are a pair of consecutive percent signs, %%,
+
+Separating the struct declaration from the list of keywords and
+other fields are a pair of consecutive percent signs, `%%',
appearing left justified in the first column, as in the UNIX utility
lex.
+
+
Using a syntax similar to GNU utilities flex and bison, it
is possible to directly include C source text and comments verbatim into
the generated output file. This is accomplished by enclosing the region
-inside left-justified surrounding %{, %} pairs. Here is
+inside left-justified surrounding `%{', `%}' pairs. Here is
an input fragment based on the previous example that illustrates this
feature:
@@ -689,7 +793,7 @@ april, 4, 30, 30
-
The second keyfile format section contains lines of keywords and any @@ -700,16 +804,19 @@ in the first column is considered a comment. Everything following the
The first field of each non-comment line is always the key itself. It
-should be given as a simple name, i.e., without surrounding
-string quotation marks, and be left-justified flush against the first
-column. In this context, a "field" is considered to extend up to, but
+can be given in two ways: as a simple name, i.e., without surrounding
+string quotation marks, or as a string enclosed in double-quotes, in
+C syntax, possibly with backslash escapes like \" or \234
+or \xa8. In either case, it must start right at the beginning
+of the line, without leading whitespace.
+In this context, a "field" is considered to extend up to, but
not include, the first blank, comma, or newline. Here is a simple
example taken from a partial list of C reserved words:
-# These are a few C reserved words, see the c.gperf file
+# These are a few C reserved words, see the c.gperf file
# for a complete list of ANSI C reserved words.
unsigned
sizeof
@@ -723,7 +830,7 @@ return
-Note that unlike flex or bison the first %% marker
+Note that unlike flex or bison the first `%%' marker
may be elided if the declaration section is empty.
The optional third section also corresponds closely with conventions
found in flex and bison. All text in this section,
-starting at the final %% and extending to the end of the input
+starting at the final `%%' and extending to the end of the input
file, is included verbatim into the generated output file. Naturally,
it is your responsibility to ensure that the code contained in this
section is valid C.
@@ -752,81 +859,128 @@ section is valid C.
gperfgperf
-Several options control how the generated C code appears on the standard
-output. Two C function are generated. They are called hash and
-in_word_set, although you may modify the name for
-in_word_set with a command-line option. Both functions require
-two arguments, a string, char * str, and a length
-parameter, int len. Their default function prototypes are
-as follows:
+
-static int hash (char *str, int len); -int in_word_set (char *str, int len); --
+Several options control how the generated C code appears on the standard
+output. Two C function are generated. They are called hash and
+in_word_set, although you may modify their names with a command-line
+option. Both functions require two arguments, a string, char *
+str, and a length parameter, int len. Their default
+function prototypes are as follows:
+
+
+
hash function returns an integer value
created by adding len to several user-specified str key
positions indexed into an associated values table stored in a
local static array. The associated values table is constructed
-internally by gperf and later output as a static local C array called
-hash_table; its meaning and properties are described below.
-See section 7 Implementation Details of GNU gperf. The relevant key positions are specified via the
-`-k' option when running gperf, as detailed in the Options
-section below. See section 4 Options to the gperf Utility.
+internally by gperf and later output as a static local C array
+called `hash_table'; its meaning and properties are described below
+(see section 7 Implementation Details of GNU gperf). The relevant key positions are specified via
+the `-k' option when running gperf, as detailed in the
+Options section below(see section 4 Invoking gperf).
+
-Two options, `-g' (assume you are compiling with GNU C and its
-inline feature) and `-a' (assume ANSI C-style function
-prototypes), alter the content of both the generated hash and
-in_word_set routines. However, function in_word_set may
-be modified more extensively, in response to your option settings. The
-options that affect the in_word_set structure are:
+
NULL.
++If the option `-c' is not used, str must be a NUL terminated +string of exactly length len. If `-c' is used, str must +simply be an array of len characters and does not need to be NUL +terminated. -
+The code generated for these two functions is affected by the following +options: + +
struct.
-switch statement rather than use a large,
(and potentially sparse) static array. Although the exact time and
space savings of this approach vary according to your C compiler's
degree of optimization, this method often results in smaller and faster
code.
-If the `-t' and `-S' options are omitted, the
-default action is to generate a char * array containing the keys,
-together with additional null strings used for padding the array. By
-experimenting with the various input and output options, and timing the
-resulting C code, you can determine the best option choices for
-different keyword set characteristics.
+If the `-t' and `-S' options are omitted, the default action
+is to generate a char * array containing the keys, together with
+additional null strings used for padding the array. By experimenting
+with the various input and output options, and timing the resulting C
+code, you can determine the best option choices for different keyword
+set characteristics.
gperf Utility
+By default, the code generated by gperf operates on zero
+terminated strings, the usual representation of strings in C. This means
+that the keywords in the input file must not contain NUL characters,
+and the str argument passed to hash or in_word_set
+must be NUL terminated and have exactly length len.
+
+
+If option `-c' is used, then the str argument does not need
+to be NUL terminated. The code generated by gperf will only
+access the first len, not len+1, bytes starting at str.
+However, the keywords in the input file still must not contain NUL
+characters.
+
+
+If option `-l' is used, then the hash table performs binary
+comparison. The keywords in the input file may contain NUL characters,
+written in string syntax as \000 or \x00, and the code
+generated by gperf will treat NUL like any other character.
+Also, in this case the `-c' option is ignored.
+
+
gperf
There are many options to gperf. They were added to make
the program more convenient for use with real applications. "On-line"
-help is readily available via the `-h' option. Here is the complete
-list of options.
+help is readily available via the `-h' option. Here is the
+complete list of options.
struct type declaration for generated
-code. Any text before a pair of consecutive %% is consider part of the
-type declaration. Key words and additional fields may follow this, one
-group of fields per line. A set of examples for generating perfect hash
-tables and functions for Ada, C, and G++, Pascal, and Modula 2 and 3
-reserved words are distributed with this release.
+code. Any text before a pair of consecutive `%%' is considered
+part of the type declaration. Keywords and additional fields may follow
+this, one group of fields per line. A set of examples for generating
+perfect hash tables and functions for Ada, C, C++, Pascal, Modula 2,
+Modula 3 and JavaScript reserved words are distributed with this release.
gperf to generate code in the language specified by the
option's argument. Languages handled are currently:
-
-gperf. It does not do anything.
struct.
-Perfect_Hash.
isalnum and isgraph do
not guarantee that a character is in this range. Only an explicit
test like `c >= 'A' && c <= 'Z'' guarantees this.) This was the
-default in earlier versions of gperf; now the default is to assume
-8-bit characters.
+default in versions of gperf earlier than 2.7; now the default is
+to assume 8-bit characters.
strncmp function to perform
string comparisons. The default action is to use strcmp.
<jjc@ai.mit.edu>.
<string.h>, at the
beginning of the code. By default, this is not done; the user must
include this header file himself to allow compilation of the code.
switch statement scheme,
rather than an array lookup table. This can lead to a reduction in both
time and space requirements for some keyfiles. The argument to this
@@ -1006,6 +1195,8 @@ was inspired in part by Keith Bostic's original C program.
gperf. It does not do anything.
gperfstrcmp.
@@ -1052,9 +1244,13 @@ However, using `-l' might greatly increase the size of the
generated C code if the lookup table range is large (which implies that
the switch option `-S' is not enabled), since the length table
contains as many elements as there are entries in the lookup table.
+This option is mandatory for binary comparisons (see section 3.3 Use of NUL characters).
gperf does not backtrack it is possible for it to process
all your input keywords without finding a unique mapping for each word.
However, frequently only a very small number of duplicates occur, and
the majority of keys still require one probe into the table.
+
gperf treats all these keys as part of
-an equivalence class and generates a perfect hash function with multiple
-comparisons for duplicate keys. It is up to you to completely
+attributes. With the -D option gperf treats all these keys as
+part of an equivalence class and generates a perfect hash function with
+multiple comparisons for duplicate keys. It is up to you to completely
disambiguate the keywords by modifying the generated C code. However,
gperf helps you out by organizing the output.
gperf to work on
keyword sets that it otherwise could not handle.
-gperf's
-running time at the cost of minimizing generated table-size. The
-iteration amount represents the number of times to iterate when
-resolving a collision. `0' means iterate by the number of keywords.
-This option is probably most useful when used in conjunction with options
-`-D' and/or `-S' for large keyword sets.
+gperf's running time at the cost of minimizing generated
+table-size. The iteration amount represents the number of times to
+iterate when resolving a collision. `0' means iterate by the number of
+keywords. This option is probably most useful when used in conjunction
+with options `-D' and/or `-S' for large keyword sets.
-gperf jumps by random amounts.
+gperf
+jumps by random amounts.
gperf's execution time, since collisions will begin
-earlier and continue throughout the remainder of keyword processing.
-See Cichelli's paper from the January 1980 Communications of the ACM for
-details.
+increase gperf's execution time, since collisions will
+begin earlier and continue throughout the remainder of keyword
+processing. See Cichelli's paper from the January 1980 Communications
+of the ACM for details.
gperf has difficultly with a certain keyword set try usi
gperf is executing. It is useful both for
maintaining the program and for determining whether a given set of
@@ -1195,7 +1410,6 @@ options is actually speeding up the search for a solution. Some useful
information is dumped at the end of the program when the `-d'
option is enabled.
+
switch, switch
+-This document was generated on 15 April 1998 using the +This document was generated on 20 August 2000 using the texi2html translator version 1.51.
diff --git a/doc/gperf.info b/doc/gperf.info index 4f9946f..31bb1c6 100644 --- a/doc/gperf.info +++ b/doc/gperf.info @@ -1,14 +1,14 @@ -This is Info file gperf.info, produced by Makeinfo version 1.68 from -the input file gperf.texi. +This is gperf.info, produced by makeinfo version 4.0 from gperf.texi. +INFO-DIR-SECTION Programming Tools START-INFO-DIR-ENTRY * Gperf: (gperf). Perfect Hash Function Generator. END-INFO-DIR-ENTRY This file documents the features of the GNU Perfect Hash Function -Generator +Generator 2.7.2. - Copyright (C) 1989-1998 Free Software Foundation, Inc. + Copyright (C) 1989-2000 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are @@ -23,10 +23,9 @@ identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified -versions, except that the section entitled "GNU `gperf' General Public -License" and this permission notice may be included in translations -approved by the Free Software Foundation instead of in the original -English. +versions, except that the section entitled "GNU General Public License" +and this permission notice may be included in translations approved by +the Free Software Foundation instead of in the original English. File: gperf.info, Node: Top, Next: Copying, Prev: (dir), Up: (dir) @@ -40,38 +39,40 @@ bugs. * Menu: -* Copying:: GNU `gperf' General Public License says +* Copying:: GNU `gperf' General Public License says how you can copy and share `gperf'. -* Contributors:: People who have contributed to `gperf'. -* Motivation:: Static search structures and GNU GPERF. -* Search Structures:: Static search structures and GNU `gperf' -* Description:: High-level discussion of how GPERF functions. -* Options:: A description of options to the program. -* Bugs:: Known bugs and limitations with GPERF. -* Projects:: Things still left to do. -* Implementation:: Implementation Details for GNU GPERF. -* Bibliography:: Material Referenced in this Report. +* Contributors:: People who have contributed to `gperf'. +* Motivation:: Static search structures and GNU GPERF. +* Search Structures:: Static search structures and GNU `gperf' +* Description:: High-level discussion of how GPERF functions. +* Options:: A description of options to the program. +* Bugs:: Known bugs and limitations with GPERF. +* Projects:: Things still left to do. +* Implementation:: Implementation Details for GNU GPERF. +* Bibliography:: Material Referenced in this Report. + +* Concept Index:: - -- The Detailed Node Listing -- High-Level Description of GNU `gperf' -* Input Format:: Input Format to `gperf' -* Output Format:: Output Format for Generated C Code with `gperf' +* Input Format:: Input Format to `gperf' +* Output Format:: Output Format for Generated C Code with `gperf' +* Binary Strings:: Use of NUL characters Input Format to `gperf' -* Declarations:: `struct' Declarations and C Code Inclusion. -* Keywords:: Format for Keyword Entries. -* Functions:: Including Additional C Functions. +* Declarations:: `struct' Declarations and C Code Inclusion. +* Keywords:: Format for Keyword Entries. +* Functions:: Including Additional C Functions. -Options to the `gperf' Utility +Invoking `gperf' -* Input Details:: Options that affect Interpretation of the Input File -* Output Language:: Specifying the Language for the Output Code -* Output Details:: Fine tuning Details in the Output Code -* Algorithmic Details:: Changing the Algorithms employed by `gperf' -* Verbosity:: Informative Output +* Input Details:: Options that affect Interpretation of the Input File +* Output Language:: Specifying the Language for the Output Code +* Output Details:: Fine tuning Details in the Output Code +* Algorithmic Details:: Changing the Algorithms employed by `gperf' +* Verbosity:: Informative Output File: gperf.info, Node: Copying, Next: Contributors, Prev: Top, Up: Top @@ -79,10 +80,10 @@ File: gperf.info, Node: Copying, Next: Contributors, Prev: Top, Up: Top GNU GENERAL PUBLIC LICENSE ************************** - Version 1, February 1989 + Version 2, June 1991 - Copyright (C) 1989 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA + Copyright (C) 1989, 1991 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. @@ -90,30 +91,33 @@ GNU GENERAL PUBLIC LICENSE Preamble ======== - The license agreements of most software companies try to keep users -at the mercy of those companies. By contrast, our General Public + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. The -General Public License applies to the Free Software Foundation's -software and to any other program whose authors commit to using it. -You can use it for your programs, too. +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. When we speak of free software, we are referring to freedom, not -price. Specifically, the General Public License is designed to make -sure that you have the freedom to give away or sell copies of free -software, that you receive source code or can get it if you want it, -that you can change the software or use pieces of it in new free -programs; and that you know you can do these things. +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 or use pieces of it in +new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. - For example, if you distribute copies of a such a program, whether + For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the -source code. And you must tell them their rights. +source code. And you must show them these terms so they know their +rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, @@ -126,124 +130,214 @@ want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + The precise terms and conditions for copying, distribution and modification follow. - TERMS AND CONDITIONS + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - 1. This License Agreement applies to any program or other work which - contains a notice placed by the copyright holder saying it may be - distributed under the terms of this General Public License. The - "Program", below, refers to any such program or work, and a "work - based on the Program" means either the Program or any work - containing the Program or a portion of it, either verbatim or with - modifications. Each licensee is addressed as "you". + 0. This License applies to any program or other work which contains a + notice placed by the copyright holder saying it may be distributed + under the terms of this General Public License. The "Program", + below, refers to any such program or work, and a "work based on + the Program" means either the Program or any derivative work under + copyright law: that is to say, a work containing the Program or a + portion of it, either verbatim or with modifications and/or + translated into another language. (Hereinafter, translation is + included without limitation in the term "modification".) Each + licensee is addressed as "you". - 2. You may copy and distribute verbatim copies of the Program's 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 General Public License - and to the absence of any warranty; and give any other recipients - of the Program a copy of this General Public License along with - the Program. You may charge a fee for the physical act of - transferring a copy. + Activities other than copying, distribution and modification are + not covered by this License; they are outside its scope. The act + of running the Program is not restricted, and the output from the + Program is covered only if its contents constitute a work based on + the Program (independent of having been made by running the + Program). Whether that is true depends on what the Program does. - 3. You may modify your copy or copies of the Program or any portion of - it, and copy and distribute such modifications under the terms of - Paragraph 1 above, provided that you also do the following: + 1. You may copy and distribute verbatim copies of the Program's + 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 give any other recipients of the Program a copy of + this License along with the Program. - * cause the modified files to carry prominent notices stating - that you changed the files and the date of any change; and + 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. - * cause the whole of any work that you distribute or publish, - that in whole or in part contains the Program or any part - thereof, either with or without modifications, to be licensed - at no charge to all third parties under the terms of this - General Public License (except that you may choose to grant - warranty protection to some or all third parties, at your - option). + 2. You may modify your copy or copies of the Program or any portion + of it, thus forming a work based on the Program, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: - * If the modified program normally reads commands interactively + a. You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b. You must cause any work that you distribute or publish, that + in whole or in part contains or is derived from the Program + or any part thereof, to be licensed as a whole at no charge + to all third parties under the terms of this License. + + c. If the modified program normally reads commands interactively when run, you must cause it, when started running for such - interactive use in the simplest and most usual way, to print - or display an announcement including an appropriate copyright - notice and a notice that there is no warranty (or else, - saying that you provide a warranty) and that users may - redistribute the program under these conditions, and telling - the user how to view a copy of this General Public License. + interactive use in the most ordinary way, to print or display + an announcement including an appropriate copyright notice and + a notice that there is no warranty (or else, saying that you + provide a warranty) and that users may redistribute the + program under these conditions, and telling the user how to + view a copy of this License. (Exception: if the Program + itself is interactive but does not normally print such an + announcement, your work based on the Program is not required + to print an announcement.) - * 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. + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the + Program, 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 Program, 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. - Mere aggregation of another independent work with the Program (or - its derivative) on a volume of a storage or distribution medium - does not bring the other work under the scope of these terms. + 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 Program. - 4. You may copy and distribute the Program (or a portion or - derivative of it, under Paragraph 2) in object code or executable - form under the terms of Paragraphs 1 and 2 above provided that you - also do one of the following: + In addition, mere aggregation of another work not based on the + Program with the Program (or with a work based on the Program) on + a volume of a storage or distribution medium does not bring the + other work under the scope of this License. - * accompany it with the complete corresponding machine-readable + 3. You may copy and distribute the Program (or a work based on it, + under Section 2) in object code or executable form under the terms + of Sections 1 and 2 above provided that you also do one of the + following: + + a. Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of - Paragraphs 1 and 2 above; or, + Sections 1 and 2 above on a medium customarily used for + software interchange; or, - * accompany it with a written offer, valid for at least three - years, to give any third party free (except for a nominal - charge for the cost of distribution) a complete + b. Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be - distributed under the terms of Paragraphs 1 and 2 above; or, + distributed under the terms of Sections 1 and 2 above on a + medium customarily used for software interchange; or, - * accompany it with the information you received as to where the - corresponding source code may be obtained. (This alternative - is allowed only for noncommercial distribution and only if you - received the program in object code or executable form alone.) + c. Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with + such an offer, in accord with Subsection b above.) - Source code for a work means the preferred form of the work for - making modifications to it. For an executable file, complete - source code means all the source code for all modules it contains; - but, as a special exception, it need not include source code for - modules which are standard libraries that accompany the operating - system on which the executable file runs, or for standard header - files or definitions files that accompany that operating system. + The source code for a work means the preferred form of the work for + making modifications to it. For an executable work, 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 executable. + However, as a special exception, the source code 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. - 5. You may not copy, modify, sublicense, distribute or transfer the - Program except as expressly provided under this General Public - License. Any attempt otherwise to copy, modify, sublicense, - distribute or transfer the Program is void, and will automatically - terminate your rights to use the Program under this License. - However, parties who have received copies, or rights to use - copies, from you under this General Public License will not have - their licenses terminated so long as such parties remain in full - compliance. + If distribution of executable or 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 counts as + distribution of the source code, even though third parties are not + compelled to copy the source along with the object code. - 6. By copying, distributing or modifying the Program (or any work - based on the Program) you indicate your acceptance of this license - to do so, and all its terms and conditions. + 4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense or distribute the Program 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. - 7. Each time you redistribute the Program (or any work based on the + 5. 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 Program or its derivative works. These actions + are prohibited by law if you do not accept this License. + Therefore, by modifying or distributing the Program (or any work + based on the Program), you indicate your acceptance of this + License to do so, and all its terms and conditions for copying, + distributing or modifying the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights - granted herein. + granted herein. You are not responsible for enforcing compliance + by third parties to this License. - 8. The Free Software Foundation may publish revised and/or new + 7. 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 + Program at all. For example, if a patent license would not permit + royalty-free redistribution of the Program 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 Program. + + 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. + + 8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, + the original copyright holder who places the Program 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. + + 9. The Free Software Foundation may publish revised and/or new versions of the 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 - Program specifies a version number of the 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 + Program 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 Program - does not specify a version number of the license, you may choose + does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. - 9. If you wish to incorporate parts of the Program into other free + 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software @@ -254,7 +348,7 @@ modification follow. NO WARRANTY - 10. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT @@ -265,7 +359,7 @@ modification follow. PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - 11. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN + 12. 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 PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, @@ -278,26 +372,26 @@ modification follow. END OF TERMS AND CONDITIONS -Appendix: How to Apply These Terms to Your New Programs -======================================================= +How to Apply These Terms to Your New Programs +============================================= If you develop a new program, and you want it to be of the greatest -possible use to humanity, the best way to achieve this is to make it +possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. 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. +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. - ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. - Copyright (C) 19YY NAME OF AUTHOR + ONE LINE TO GIVE THE PROGRAM'S NAME AND AN IDEA OF WHAT IT DOES. + Copyright (C) YEAR NAME OF AUTHOR - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 1, or (at your option) - any later version. + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -306,7 +400,7 @@ convey the exclusion of warranty; and each file should have at least the You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + 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. @@ -314,10 +408,11 @@ mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) 19YY NAME OF AUTHOR - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. + Gnomovision version 69, Copyright (C) YEAR NAME OF AUTHOR + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details + type `show w'. This is free software, and you are welcome + to redistribute it under certain conditions; type `show c' + for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the @@ -327,16 +422,21 @@ program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, -if necessary. Here a sample; alter the names: +if necessary. Here is a sample; alter the names: - Yoyodyne, Inc., hereby disclaims all copyright interest in the - program `Gnomovision' (a program to direct compilers to make passes - at assemblers) written by James Hacker. + Yoyodyne, Inc., hereby disclaims all copyright + interest in the program `Gnomovision' + (which makes passes at compilers) written + by James Hacker. SIGNATURE OF TY COON, 1 April 1989 Ty Coon, President of Vice - That's all there is to it! + This General Public License does not permit incorporating your +program into proprietary programs. If your program is a subroutine +library, you may consider it more useful to permit linking proprietary +applications with the library. If this is what you want to do, use the +GNU Library General Public License instead of this License. File: gperf.info, Node: Contributors, Next: Motivation, Prev: Copying, Up: Top @@ -353,7 +453,7 @@ Contributors to GNU `gperf' Utility modified, enhanced, and extended implementation of Keith's basic idea, created at the University of California, Irvine. Bugs, patches, and suggestions should be reported to - `