eĿlipsis
a language independent preprocessor
 
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Loading...
Searching...
No Matches
ellipsis‿options Struct Reference

Simple option processing in form of -xyz or --loongname More...

#include <ellipsis-options.h>

Public Member Functions

char constellipsis‿options‿argument (ellipsis‿options *p)
 get the argument to the current option character
 
char constellipsis‿options‿current (ellipsis‿options *p)
 get the current command line parameter
 
char ellipsis‿options‿get (ellipsis‿options *p)
 get the current option character
 
char constellipsis‿options‿longname (ellipsis‿options *p)
 get the long name of the current – option
 
void ellipsis‿options‿next (ellipsis‿options *p)
 move to the next option character
 
char constellipsis‿options‿progname (ellipsis‿options *p)
 get the program name of this argument list
 

Data Fields

char *const *const argv
 

Private Attributes

char const *constcur
 
char lname [ellipsis‿options‿longname‿max]
 
size_t pos
 

Related Symbols

(Note that these are not member symbols.)

enum  ellipsis‿options‿sizes : size_t
 maximal bytes of a long name handled by ellipsis‿options, including the null terminator More...
 
enum  ellipsis‿options‿specials : char
 symbolic value for an non-option More...
 

Detailed Description

Simple option processing in form of -xyz or --loongname

#bind options ellipsis‿options
int main(int argc, char* argv[argc+1]) {
switch (options‿get(&opts)) {
...
int main(void)
Definition predefined_c_attribute_generate.c:3
size_t pos
Definition ellipsis-options.h:90
char *const *const argv
Definition ellipsis-options.h:86

(If you are not not using ellipsis, use ellipsis‿options instead.)

Note that ellipsis‿options‿argument needs the option character to be the first after the -, otherwise only a null pointer is retrieved.

Possible option characters are all printable one byte characters (in the sense of isprint) with the exception of the character - which has a special meaning. Possible long option names after a -- are sequences of printable characters with exception of the = character, which starts the argument to the long option.

Command line arguments that are one of - or -- are special. The first is not an option. It is passed on as such and is retrievable with ellipsis‿options‿current as other non-options. -- changes the state such that all command line arguments coming after it are interpreted as non-options.

Special returns of ellipsis‿options‿get are

Warning
This is a file generated by eĿlipsis version 20250309, do not modify

Member Function Documentation

◆ ellipsis‿options‿argument()

char const * ellipsis‿options‿argument ( ellipsis‿options p)

get the argument to the current option character

Note that a call to this function marks the current option as having received an argument. Thus this information is then taken into account when passing to the next option character.

Remarks
this can be called multiple times for the same current option character

References cur, ellipsis‿options‿here, ellipsis‿options‿longoption, ellipsis‿options‿more, ellipsis‿options‿other, ellipsis‿options‿over, and pos.

◆ ellipsis‿options‿current()

char const * ellipsis‿options‿current ( ellipsis‿options p)

get the current command line parameter

this should only be used when the previous call to ellipsis‿options‿get returned ellipsis‿options‿none.

Remarks
this can be called multiple times for the same current option

References cur.

◆ ellipsis‿options‿get()

char ellipsis‿options‿get ( ellipsis‿options p)

get the current option character

Remarks
if that character is ellipsis‿options‿none, the current command line parameter can be retrieved by ellipsis‿options‿current
this can be called multiple times for the same current option

References argv, cur, ellipsis‿options‿end, ellipsis‿options‿here, ellipsis‿options‿longoption, ellipsis‿options‿more, ellipsis‿options‿none, ellipsis‿options‿other, ellipsis‿options‿start, and pos.

◆ ellipsis‿options‿longname()

char const * ellipsis‿options‿longname ( ellipsis‿options p)

get the long name of the current – option

Remarks
this can be called multiple times for the same current option character

References cur, ellipsis‿options‿get(), ellipsis‿options‿here, ellipsis‿options‿longname‿max, ellipsis‿options‿longoption, ellipsis‿options‿other, lname, and pos.

Here is the call graph for this function:

◆ ellipsis‿options‿next()

◆ ellipsis‿options‿progname()

char const * ellipsis‿options‿progname ( ellipsis‿options p)

get the program name of this argument list

Remarks
this can be called multiple times during argument processing

References argv.

Friends And Related Symbol Documentation

◆ ellipsis‿options‿sizes

maximal bytes of a long name handled by ellipsis‿options, including the null terminator

◆ ellipsis‿options‿specials

symbolic value for an non-option

See also
ellipsis‿options‿get

Field Documentation

◆ argv

◆ cur

◆ lname

◆ pos


The documentation for this struct was generated from the following file: