Component index
Section index | Component tlmpprogram |
Search |
Type | Function |
Summary | Initialization of a TLMP program |
Description | This handles library initialisation (linuxconf-lib, messages databases, ...), arguments parsing and various other kitchen and sink stuff every program needs. For argument initialisation, it support short and long name option, using single or double quota. Short name may have an argument either separated or not from the option letter: -pval or -p val are valid. Long name option support argument passed using an equal sign or as a separated command line word: "--port=1234" or "--port 1234" are valid. The -- is used to end the option sequence. The rest is passed to the main() functag (or main_noarg is there is no other command line argument). |
![]() ![]() | void init () | |
![]() ![]() | int main (int argc, char *argv[]) | |
![]() ![]() | int main_noarg () | |
![]() ![]() | int onearg (const char *opt, const char *val) | |
![]() ![]() | void showerror (const char *msg) | |
![]() ![]() | void usage () |
This is called after the various libraries are initialised and messages are loaded. You usually call setproginfo and setarg from there
An argument started with --. It may be followed by a value. The function return -1 if the option is not known. It returns 0 if the option is valid. It returns 1 if the option has a value.
A TLMP program generally use tlmp_error() to report error messages to the user. By default, this is sent to stderr. A GUI program may want to present them differently. This tag allows you to do so.
This will be used to validate command line argument and to generate the default usage functag. No need to use the onearg functag, unless you have very special command line argument parsing.
This will be used to validate command line argument and to generate the default usage functag. No need to use the onearg functag, unless you have very special command line argument parsing.
This will be used to validate command line argument and to generate the default usage functag. No need to use the onearg functag, unless you have very special command line argument parsing. This option may be repeated several time since an SSTRINGS variable is collecting the values. The SSTRINGS variable may contain default values. Whenever one command line option is used, the values are lost and replaced by the command line. This allows a program to have defaults and let the user completly override them.
This will be used to validate command line argument and to generate the default usage functag. No need to use the onearg functag, unless you have very special command line argument parsing.
This will be used to validate command line argument and to generate the default usage functag. No need to use the onearg functag, unless you have very special command line argument parsing.
Normally the name of the program is used. When multiple programs are sharing the same configuration file (home/.tlmp/db.conf), each program must use this function.
It is possible to split the presentation of the various command line option (when using --help) into section. Each section is named using this fhelper.
This information is used to implement the defaullt usage functag