### Example keyword entries for C reserved words Source: https://www.gnu.org/software/gperf/manual/html_node/Keywords.html A simple example from a partial list of C reserved words. Lines starting with '#' are comments. Each non-comment line contains a keyword as the first field, with no leading whitespace. ```plaintext # These are a few C reserved words, see the c.gperf file # for a complete list of ANSI C reserved words. unsigned sizeof switch signed if default for while return ``` -------------------------------- ### Minimal Keyword-Only Input Format Source: https://www.gnu.org/software/gperf/manual/html_node/Input-Format.html An example of an input file starting directly with keywords, which is possible when the '-t' option is omitted. ```text january february march april ... ``` -------------------------------- ### Inserting GNU indent directives Source: https://www.gnu.org/software/gperf/manual/html_node/Controls-for-GNU-indent.html Example showing where to place '/* *INDENT-OFF* */' and '/* *INDENT-ON* */' comments to allow GNU indent to process a gperf input file correctly. ```c /* *INDENT-OFF* */ declarations part 1 %{ /* *INDENT-ON* */ verbatim code /* *INDENT-OFF* */ %} declarations part 2 %% keywords %% /* *INDENT-ON* */ functions ``` -------------------------------- ### Include C code with %{ %} in gperf input Source: https://www.gnu.org/software/gperf/manual/html_node/C-Code-Inclusion.html Use left-justified %{ and %} to insert C source text verbatim into the generated output. The example includes an assert.h header, a comment, and a function declaration, followed by the gperf input structure and keyword list. ```gperf %{ #include /* This section of code is inserted directly into the output. */ int return_month_days (struct month *months, int is_leap_year); %} struct month { char *name; int number; int days; int leap_days; }; %% january, 1, 31, 31 february, 2, 28, 29 march, 3, 31, 31 ... ``` -------------------------------- ### Abbreviated struct declaration with month data Source: https://www.gnu.org/software/gperf/manual/html_node/User_002dsupplied-Struct.html Example input file when the struct has already been declared in an include file. Uses an abbreviated form 'struct month;' followed by %% and the month list. The ellipsis (...) indicates omitted data in the source. ```gperf struct month; %% january, 1, 31, 31 ... ``` -------------------------------- ### Full struct declaration with month data Source: https://www.gnu.org/software/gperf/manual/html_node/User_002dsupplied-Struct.html Example input file for gperf with -t option. Defines a struct month with fields name, number, days, leap_days, followed by a %% separator and a list of month entries. The first field must be named 'name' and be of type char * (or const char *) unless -P is used. ```gperf struct month { char *name; int number; int days; int leap_days; }; %% january, 1, 31, 31 february, 2, 28, 29 march, 3, 31, 31 april, 4, 30, 30 may, 5, 31, 31 june, 6, 30, 30 july, 7, 31, 31 august, 8, 31, 31 september, 9, 30, 30 october, 10, 31, 31 november, 11, 30, 30 december, 12, 31, 31 ``` -------------------------------- ### General gperf input file structure Source: https://www.gnu.org/software/gperf/manual/html_node/Controls-for-GNU-indent.html The standard structure of a gperf input file containing declarations, verbatim code, keywords, and functions. ```text declarations part 1 %{ verbatim code %} declarations part 2 %% keywords %% functions ``` -------------------------------- ### General Input Format Outline Source: https://www.gnu.org/software/gperf/manual/html_node/Input-Format.html The general structure of a gperf input file, consisting of three sections separated by double percent signs. ```text declarations %% keywords %% functions ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.