Bsoft 2.1.4
Bernard's software package
options.h File Reference

Header file for option handlers. More...

#include "Bstring.h"
#include "Vector3.h"
#include "View.h"
#include "View2.h"
#include "Euler.h"
#include "symmetry.h"
#include "UnitCell.h"
#include "Complex.h"

Classes

class  Boption
 A class for a command line input option. More...
 

Functions

Boptionget_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)
 

Variables

int verbose
 

Detailed Description

Header file for option handlers.

Author
Bernard Heymann
Date
Created: 20010613
Modified: 20220718

Function Documentation

◆ get_option_list()

Boption * get_option_list ( const char *  use[],
int  argc,
char *  argv[],
int &  optind 
)

Parses command line arguments based on a template.

Parameters
*use[]usage list of strings, the template.
argcnumber of command line arguments.
*argv[]array of command line argument strings.
&optindfirst argument after option list.
Returns
Boption* linked list of tag-value pairs.
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.

◆ get_option_verbose() [1/2]

int get_option_verbose ( Bstring optarg)

◆ get_option_verbose() [2/2]

int get_option_verbose ( char *  optarg)

Sets the verbose option.

Parameters
&optargverbosity level.
Returns
int verbosity number, <0 on error.
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

◆ option_kill()

int option_kill ( Boption option)

Deallocates a linked list of option structures.

Parameters
*optionlinked list of tag-value pairs.
Returns
int 0.

Variable Documentation

◆ verbose

int verbose
extern