![]() |
Bsoft 2.1.4
Bernard's software package
|
Functions to handle general options. More...
Macros | |
#define | MAX_TAG_LEN 20 |
Functions | |
Boption * | get_option_list (const char *use[], int argc, char *argv[], int &optind) |
Parses command line arguments based on a template. More... | |
int | option_kill (Boption *option) |
Deallocates a linked list of option structures. More... | |
int | get_option_verbose (char *optarg) |
Sets the verbose option. More... | |
int | get_option_verbose (Bstring &optarg) |
double | get_option_mass (Bstring &optarg) |
Returns the adjusted mass based on the added character. More... | |
Variables | |
int | verbose |
string | command |
int | thread_limit |
Functions to handle general options.
#define MAX_TAG_LEN 20 |
Boption * get_option_list | ( | const char * | use[], |
int | argc, | ||
char * | argv[], | ||
int & | optind | ||
) |
Parses command line arguments based on a template.
*use[] | usage list of strings, the template. |
argc | number of command line arguments. |
*argv[] | array of command line argument strings. |
&optind | first argument after option list. |
The usage list is parsed to find the desired option tag. Each option in the usage list must have the following format: -<tag> <value,value,...> The first character on the line must be '-', the tag may not extend beyond the 17'th character and the value must start before the 19'th character. A partial input tag is tolerated as long as it is unambiguous. An ambiguous or unknown tag or a tag requiring a value but without one causes program abortion. Special tags: -verbose 3 sets the verbosity level for all programs. -help returns the usage information and quits.
double get_option_mass | ( | Bstring & | optarg | ) |
Returns the adjusted mass based on the added character.
&optarg | mass with added character. |
int get_option_verbose | ( | Bstring & | optarg | ) |
int get_option_verbose | ( | char * | optarg | ) |
Sets the verbose option.
&optarg | verbosity level. |
The verbosity level is defined by the following constants setting particular bits: VERB_NONE 0 No output VERB_RESULT 1 Program results VERB_LABEL 2 Function information VERB_PROCESS 4 Selected processing information VERB_STATS 8 Statistical information on objects VERB_FULL 16 All processing information VERB_TIME 32 Timing information VERB_MEMORY 64 Memory allocation and freeing VERB_DEBUG 256 Debugging information VERB_DEBUG_STAR 512 STAR code debugging information VERB_DEBUG_DM 1024 Digital Micrograph format debugging information VERB_DEBUG_ND2 2048 Nikon ND2 format debugging information
int option_kill | ( | Boption * | option | ) |
Deallocates a linked list of option structures.
*option | linked list of tag-value pairs. |
|
extern |
|
extern |
|
extern |