Menu

Tree [7aa14d] default tip /
 History

Read Only access


File Date Author Commit
 src 2025-11-12 Goetz Pfeiffer Goetz Pfeiffer [ecb416] The version number was set to 1.8.1.
 .hgtags 2025-11-12 Goetz Pfeiffer Goetz Pfeiffer [7aa14d] Added tag 1.8.1 for changeset 743c977f2700
 LICENSE 2022-02-18 Goetz Pfeiffer Goetz Pfeiffer [5add4d] hgen is now published under license GPL v.3.
 Makefile 2025-11-12 Goetz Pfeiffer Goetz Pfeiffer [6b3236] README.rst replaces README and contains the ful...
 README.rst 2025-11-12 Goetz Pfeiffer Goetz Pfeiffer [743c97] A legacy warning was added to README.rst.

Read Me

hgen.pl

About

hgen.pl generates c header files from special comments in c source files.

Note: I regard this program as legacy code. I personally don't use this for new applications.

Author

Goetz Pfeiffer <goetzpf@googlemail.com>

Description

Here is the online help from the program:

usage: hgen.pl {options} [filename(s)]

options:

  --help : this help
  -m --multiple: more than one input-file given
      all files will be processed, -h option required !!
  -h --header {header-file}:
      specify the name of the header-file to create

  -p [number {number ...}]
      specify the parts of the source-file that are to be processed, a
      source-file may have several parts (0..19) that may be intermixed.
      See also the @PE()-command
  -c check wether the new header-file differs from the old one. If no
     difference is found, the header file is left intact. Useful when
     hgen.p is called from within a makefile.
  -q less messages on the screen

hgen-commands in sourcecode:
A command starts with a '@' and is followed by 2 to 3 letters. A command
must always be splaced within a c-comment.  Example for a command:
/*@EX(1)*/ is the command 'EX(1)'

List of commands:
 EL  exclude line
 IL  include line
 ET  exclude text (until IT),
     U, IL, EX, EXI override this for their scope
 IT  include text (was excluded by ET)
 EX  generate extern-statement in next line
 EX(1)...EX(n)
     generate extern-statement and place finishing ';'
     0 bis n lines below
 ET, IT or EX followed by 'I' cause the command to take
     effect in the current line instead of the next line
 U   uncomment whole comment (that may span several lines)
     this command should not be followed immediately by
     alphanumeric chars for future compability
 EM("text")
     emit text (may contain '\n' and '\"')
     '/@' in the text is changed to '/*', '@/' is changed
      to '*/'
 PS(number)
 PE(number)
     PS: define the start of a <part> in the source-file.
     PE: define the end of a <part> in the source-file. This
     works together with the -p command-line option of hgen.
     PS and PE define "parts" in the source file. Only the parts, that
     were specified with the "-p" command are evaluated.

Installation

Install the script to DIRECTORY/bin with:

make install INSTALL_LOCATION=DIRECTORY

Using the program in EPICS

When used with EPICS as a support module build with:

make epics