Module: sip-router Branch: andrei/cdefs2doc Commit: a9255ea7e90978fcd6f955f51aae28883efc6282 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a9255ea7...
Author: Andrei Pelinescu-Onciul andrei@iptel.org Committer: Andrei Pelinescu-Onciul andrei@iptel.org Date: Mon Oct 19 18:05:25 2009 +0200
doc: script to generate cfg var lists from C code
Added a perl script that generates the list of config variables defined in a C file. The script uses gcc to generate a syntax tree structure for an entire file and then parses and uses the tree to locate the config vars. definition, initialization and default values.
E.g.: dump_cfg_defs.pl --file ../../../cfg_core.c --grp core => ... 31. core.udp_mtu fallback to a congestion controlled protocol if send size exceeds udp_mtu. Default: 0. Range: 0 - 65535. Type: integer. ...
The config group (--grp) needs to be specified only if it cannot be auto-detected (under normal circumstances it is auto-detected from the type name of the variable holding the default values, e.g. cfg_group_core). If the default values are set in the same .c file, they will be added to the list.
Note: the script requires a patched version of the GCC:TranslationUnit perl package. To get the patch use: dump_cfg_defs.pl --patch
---
doc/scripts/cdefs2doc/dump_cfg_defs.pl | 434 ++++++++++++++++++++++++++++++++ 1 files changed, 434 insertions(+), 0 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=a925...