MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


User Commands                                     glib-mkenums(1)



NAME
     glib-mkenums - generate C language enum description

SYNOPSIS
     glib-mkenums [--comments text] [--eprod text] [--fhead text]
     [--fprod  text] [--ftail text] [--help] [--template file] [-
     -version]  [--vhead  text]  [--vprod  text]  [--vtail  text]
     [file...]

DESCRIPTION
     glib-mkenums parses C code to extract enum definitions,  and
     produces enum descriptions based on text templates specified
     by the user. glib-mkenums produces C code that contains enum
     values  as  strings,  which allows programs to provide value
     name strings for introspection.

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

EXTENDED DESCRIPTION
     This section provides more information about text  substitu-
     tion and trigraph extensions.

  Text Substitution
     glib-mkenums  substitutes  certain   keywords,   which   are
     enclosed in @ characters, when creating the output text. For
     the substitution examples of the keywords in  this  section,
     the following example enum definition is assumed:

     typedef enum
     {
       PREFIXTHEXVALUE    = 1 << 3,
       PREFIXANOTHERVALUE = 1 << 4
     } PrefixTheXEnum;

     glib-mkenums substitutes the following keywords:

     @EnumName@      The name of the enum  currently  being  pro-
                     cessed.  enum  names are assumed to be prop-
                     erly namespaced and to use mixed capitaliza-
                     tion to separate                  words (for
                     example, PrefixTheXEnum).



     @enumname@     The enum name with words  in  lowercase  and
                     each  word  separated  by  underscores  (for
                     example, prefixthexenum).





SunOS 5.11           Last change: 7 Apr 2003                    1






User Commands                                     glib-mkenums(1)



     @ENUMNAME@      The enum name with words  in  uppercase  and
                     each  word  separated  by  underscores  (for
                     example, PREFIXTHEXENUM).



     @ENUMSHORT@     The enum name with words  in  uppercase  and
                     each word separated by underscores, and with
                     the   prefix    stripped    (for    example,
                     THEXENUM).



     @VALUENAME@     The enum value  name  currently  being  pro-
                     cessed,  with  words  in  uppercase and each
                     word separated by underscores. This  is  the
                     assumed  literal  notation of enum values in
                     the     C     sources     (for      example,
                     PREFIXTHEXVALUE).



     @valuenick@     A nickname  for  the  enum  value  currently
                     being  processed.  This is usually generated
                     by stripping the common prefix words of  all
                     of the enum values of the current enum, with
                     words in lowercase and  underscores  substi-
                     tuted by hyphens (for example, the-xvalue).



     @type@          This is  substituted  either  by  "enum"  or
                     "flags", depending on whether the enum value
                     definitions contain bit-shift  operators  or
                     not (for example, flags).



     @Type@          Same as @type@, but with  the  first  letter
                     capitalized (for example, Flags).



     @TYPE@          Same as @type@,  but  with  all  letters  in
                     uppercase (for example, FLAGS).



     @filename@      The name of the input file  currently  being
                     processed (for example, foo.h).





SunOS 5.11           Last change: 7 Apr 2003                    2






User Commands                                     glib-mkenums(1)



  Trigraph Extensions
     Some C comments in the parsed enum definitions  are  treated
     as  special.  Such comments start with the trigraph sequence
     /*< and end with the trigraph sequence  >*/.

     Per enum definition, the "skip" and "flags" options are sup-
     ported.  The skip option indicates that this enum definition
     should be skipped.  The flags  option  specifies  that  this
     enum  definition should be treated as a flags definition, or
     specifies the common prefix to be stripped from  all  values
     to  generate  value nicknames.  The "underscorename" option
     can be used to specify the underscorized name  variant  used
     in  the  *gettype()  function  and  *TYPE*  macro.   For
     instance:

     /*< underscorename=gnomevfsurihideoptions >*/

     Per value definition, the "skip" and "nick" options are sup-
     ported.  The skip option causes the value to be skipped. The
     nick option specifies the otherwise autogenerated nickname.

OPTIONS
     The following options are supported:

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

                             "/* @comment@ */"




     --eprod text            Output  text  every  time  an   enum
                             occurs in the input files.



     --fhead text            Output  text  prior  to   processing
                             input files.



     --fprod text            Output text every time a  new  input
                             file is processed.



     --ftail text            Output text after  all  input  files
                             have been processed.





SunOS 5.11           Last change: 7 Apr 2003                    3






User Commands                                     glib-mkenums(1)



     -h, --help              Show usage and basic  help  informa-
                             tion.



     --template file         Read template from the  given  file.
                             The   templates   are   enclosed  in
                             specially-formatted C comments


                             /*** BEGIN section ***/
                             /*** END section ***/


                             where section  may  be  file-header,
                             file-production,          file-tail,
                             enumeration-production,       value-
                             header,   value-production,   value-
                             tail, or comment.



     -v, --version           Show version information.



     --vhead text            Output text before iterating the set
                             of values of an enum.



     --vprod text            Output text for every  value  of  an
                             enum.



     --vtail text            Output  text  after  iterating   all
                             values of an enum.



OPERANDS
     The following operands are supported:

     file                    Specifies a valid C code file.



EXAMPLES
     Example 1: Examples of Trigraph Extensions





SunOS 5.11           Last change: 7 Apr 2003                    4






User Commands                                     glib-mkenums(1)



     typedef enum /*< skip >*/
     {
       PREFIXFO
     } PrefixThisEnumWillBeSkipped;
     typedef enum /*< flags,prefix=PREFIX >*/
     {
       PREFIXTHEZEROTHVALUE,    /*< skip >*/
       PREFIXTHEFIRSTVALUE,
       PREFIXTHESECONDVALUE,
       PREFIXTHETHIRDVALUE,     /*< nick=the-last-value >*/
     } PrefixTheFlagsEnum;

EXIT STATUS
     The following exit values are returned:

     0        Application exited successfully



     >0       Application exited with failure



FILES
     The following files are used by this application:

     /usr/bin/glib-mkenums           The command-line  executable
                                     for the application.



     /usr/share/gtk-doc/html/glib    Location of developer  docu-
                                     mentation



ATRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:

     
           ATRIBUTE TYPE               ATRIBUTE VALUE       
    
     Availability                 SUNWgnome-base-libs-devel   
    
     Interface stability          Committed                   
    


SEE ALSO
     gdk-pixbuf-source(1),   gdk-pixbuf-query-loaders(1),   glib-
     genmarshal(1),  glib-gettextize(1),  gobject-query(1),  gtk-



SunOS 5.11           Last change: 7 Apr 2003                    5






User Commands                                     glib-mkenums(1)



     query-immodules-2.0(1),  gtk-update-icon-cache(1),  libglib-
     2.0(3), attributes(5), gnome-interfaces(5)

NOTES
     Updated by Brian Cameron, Sun Microsystems Inc., 2003, 2006.
     Written by Tim Janik.

















































SunOS 5.11           Last change: 7 Apr 2003                    6



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™