Penguin

GLIB-MKENUMS

GLIB-MKENUMS

NAME SYNOPSIS DESCRIPTION INVOCATION SEE ALSO BUGS AUTHOR


NAME

glib-mkenums - C language enum description generation utility

SYNOPSIS

glib-mkenums [''options''? [''files...''?

DESCRIPTION

glib-mkenums is a small perl-script utility that parses C code to extract enum definitions and produces enum descriptions based on text templates specified by the user. Most frequently this script is used to produce C code that contains enum values as strings so programs can provide value name strings for introspection.

INVOCATION

glib-mkenums takes a list of valid C code files as input. The options specified control the text that is output, certain substitutions are performed on the text templates for keywords enclosed in @ characters.

Options

--fhead

Put out

--fprod

Put out

--ftail

Put out

--eprod

Put out

--vhead

Put out

--vprod

Put out

--vtail

Put out

--comments

Template for auto-generated comments, the default (for C code generations) is

-h, --help

Print brief help and exit.

-v, --version

Print version and exit.

Production text substitutions

Certain keywords enclosed in @ characters will be substituted in the outputted text. For the substitution examples of the keywords below, the following example enum definition is assumed:

typedef enum { PREFIX_THE_XVALUE = 1

@!EnumName?@

The name of the enum currently being processed, enum names are assumed to be properly namespaced and to use mixed capitalization to separate words (e.g. PrefixTheXEnum).

@enum_name@

The enum name with words lowercase and word-separated by underscores (e.g. prefix_the_xenum).

@ENUMNAME@

The enum name with words uppercase and word-separated by underscores (e.g. PREFIX_THE_XENUM).

@ENUMSHORT@

The enum name with words uppercase and word-separated by underscores, prefix stripped (e.g. THE_XENUM).

@VALUENAME@

The enum value name currently being processed with words uppercase and word-separated by underscores, this is the assumed literal notation of enum values in the C sources (e.g. PREFIX_THE_XVALUE).

@valuenick@

A nick name for the enum value currently being processed, this is usually generated by stripping common prefix words of all the enum values of the current enum, the words are lowercase and underscores are substituted by a minus (e.g. the-xvalue).

@type@

This is substituted either by

@Type@

The same as @type@ with the first letter capitalized (e.g. Flags).

@TYPE@

The same as @type@ with all letters uppercased (e.g. FLAGS).

@filename@

The name of the input file currently being processed (e.g. foo.h).

Trigraph extensions

Some C comments are treated specially in the parsed enum definitions, such comments start out with the trigraph sequence

typedef enum /*

SEE ALSO

__glib-genmarshal(1)?__

BUGS

None known yet.

AUTHOR

glib-mkenums was written by Tim Janik __

This manual page was provided by Tim Janik


This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.