GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> CMX / V2-13-8 > cid / rhel6-32
Main routine to drive the linker interface description file reader. More...
#include <stdio.h>#include <string.h>#include <CMX/CMX_interface_pub.h>Classes | |
| struct | _CID_Command |
| Standard structure for descibing a CID command. More... | |
| struct | _CID_Qualifier |
| Standard structure for describing a CID qualifier. More... | |
Typedefs | |
| typedef unsigned int | CID_dispatch (unsigned int pcnt, const char *parm[]) |
| Typedef for a command line callback routine. | |
Functions | |
| static unsigned int | abbrev (const char *left, unsigned int llen, const char *rite, unsigned int rlen, unsigned int min) |
| Test a string for being a minimally long abbreviation of another. | |
| static unsigned int | parse_arg (unsigned int *pcnt, const char *parm[], unsigned int qcnt, struct _CID_Qualifier *qlst) |
| Identify parameters and qualifiers in arguments. | |
| static unsigned int | check (unsigned int pcnt, const char *parm[]) |
| Check the syntax of an interface definition file. | |
| static unsigned int | compare (unsigned int pcnt, const char *parm[]) |
| Compare an "old" and a "new" interface definition file. | |
| static unsigned int | find (unsigned int pcnt, const char *parm[]) |
| Find a symbol in an interface definition file. | |
| static unsigned int | help (unsigned int pcnt, const char *parm[]) |
| Print some help information. | |
| static unsigned int | show (unsigned int pcnt, const char *parm[]) |
| Show some feature of an interface definition file. | |
| static unsigned int | show_interface (unsigned int pcnt, const char *parm[]) |
| Show the interface names in an interface definition file. | |
| static unsigned int | show_global (unsigned int pcnt, const char *parm[]) |
| Show global symbols in an interface file. | |
| static unsigned int | show_lookup (unsigned int pcnt, const char *parm[]) |
| Show lookup symbols in an interface file. | |
| int | main (int pcnt, const char *parm[]) |
| Main routine. | |
Variables | |
| const char * | s_few = "few" |
| The string "few". | |
| const char * | s_many = "many" |
| The string "many". | |
Main routine to drive the linker interface description file reader.
CVS $Id: cid.c,v 1.6 2010/04/22 23:41:29 apw Exp $
| unsigned int CID_dispatch |
Typedef for a command line callback routine.
| pcnt | Remaining parameter (token) count |
| parm | Remaining parameters (tokens) |
This defines the signature of a command line callback routine. The main routine peels off the first word (token) and tries to match it against a list of verbs. If a match is found, control is dispatched to the corresponding routine which must have this signature.
| static unsigned int abbrev | ( | const char * | left, |
| unsigned int | llen, | ||
| const char * | rite, | ||
| unsigned int | rlen, | ||
| unsigned int | min | ||
| ) | [static] |
Test a string for being a minimally long abbreviation of another.
| left | String to test |
| llen | Length of string to test |
| rite | String to test against |
| rlen | Length of string to test against |
| min | Minimum length of overlap |
| 0 | Success |
| 1 | Failure |
Referenced by main(), parse_arg(), and show().
| static unsigned int check | ( | unsigned int | pcnt, |
| const char * | parm[] | ||
| ) | [static] |
Check the syntax of an interface definition file.
| pcnt | Number of argument strings remaining |
| parm | Array of pointers to argument strings |
check() reads in the interface file and checks its syntax. If the syntax is good, the command will exit silently. If the syntax is bad, a list of syntax errors is printed.
| 0 | Success |
| 1 | Failure |
References parse_arg(), s_few, and s_many.
Referenced by main().
| static unsigned int compare | ( | unsigned int | pcnt, |
| const char * | parm[] | ||
| ) | [static] |
Compare an "old" and a "new" interface definition file.
| pcnt | Number of argument strings remaining |
| parm | Array of pointers to argument strings |
compare() tests an old and a new interface definition file for "compatibility". On an interface by interface basis, compare() reports (prints) an "opinion". If the new interface increments the major release number, the opinion is "major". If the new interface keeps the same major release number but extends the interface the opinion will be either "minor" or "patch" depending on how the interface has been extended. All other cases (e.g. major release number decreases, interface instance in old no longer present in new, global symbol content of an interface instance changed between old and new, ...) produce the opinion "error".
| 0 | Success |
| 1 | Failure |
References _CID_Qualifier::fnd, _CID_Qualifier::key, parse_arg(), s_few, and s_many.
Referenced by main().
| static unsigned int find | ( | unsigned int | pcnt, |
| const char * | parm[] | ||
| ) | [static] |
Find a symbol in an interface definition file.
| pcnt | Number of argument strings remaining |
| parm | Array of pointers to argument strings |
find() searches the instances in an interface definition file to find the requested global symbol(s). If found, the symbol is printed along with the name of the interface in which it was found. If the symbol cannot be found, the symbol name is still printed, but attributed to interface <untraceable>.
| 0 | Success |
| 1 | Failure |
References parse_arg().
Referenced by main().
| static unsigned int help | ( | unsigned int | pcnt, |
| const char * | parm[] | ||
| ) | [static] |
Print some help information.
| pcnt | Number of argument strings remaining |
| parm | Array of pointers to argument strings |
help() prints some help
| 0 | Success |
References parse_arg().
Referenced by main().
| static unsigned int show | ( | unsigned int | pcnt, |
| const char * | parm[] | ||
| ) | [static] |
Show some feature of an interface definition file.
| pcnt | Number of argument strings remaining |
| parm | Array of pointers to argument strings |
show() is simply a branch routine. It peels off the next parameter to identify either "global" or "interface" and branches to the relevant routine.
| 0 | Success |
| 1 | Failure |
References abbrev(), _CID_Command::cmd, _CID_Command::min, _CID_Command::rtn, show_global(), show_interface(), and show_lookup().
Referenced by main().
| static unsigned int show_global | ( | unsigned int | pcnt, |
| const char * | parm[] | ||
| ) | [static] |
Show global symbols in an interface file.
| pcnt | Number of argument strings remaining |
| parm | Array of pointers to argument strings |
show_global() simply lists all the symbols in all the interfaces defined in an interface definition file.
| 0 | Success |
| 1 | Failure |
References parse_arg(), s_few, and s_many.
Referenced by show().
| static unsigned int show_interface | ( | unsigned int | pcnt, |
| const char * | parm[] | ||
| ) | [static] |
Show the interface names in an interface definition file.
| pcnt | Number of argument strings remaining |
| parm | Array of pointers to argument strings |
show_interface() prints information about the interfaces defined in an interface definition file. There are several options (see the "CMX User Manual" for details). The major options control (1) whether the display is indented to show the interface instance hierarchy, (2) whether the "symbol strength" of an interface instance is printed and (3) whether the globals defined in an interface instance are printed.
| 0 | Success |
| 1 | Failure |
References _CID_Qualifier::fnd, _CID_Qualifier::key, parse_arg(), s_few, and s_many.
Referenced by show().
| static unsigned int show_lookup | ( | unsigned int | pcnt, |
| const char * | parm[] | ||
| ) | [static] |
Show lookup symbols in an interface file.
| pcnt | Number of argument strings remaining |
| parm | Array of pointers to argument strings |
show_lookup() lists all the symbols in all the interfaces marked for inclusion by the CMX symbol lookup mechanism.
| 0 | Success |
| 1 | Failure |
References parse_arg(), s_few, and s_many.
Referenced by show().
1.7.4