JasPer  3.0.5
Command-Line Interface (CLI) Option Processing

Command-Line Interface (CLI) Option Processing. More...

Classes

struct  jas_opt_t
 Command line option type. More...
 

Macros

#define JAS_GETOPT_EOF   (-1)
 
#define JAS_GETOPT_ERR   '?'
 
#define JAS_OPT_HASARG   0x01 /* option has argument */
 

Functions

JAS_EXPORT int jas_getopt (int argc, char **argv, const jas_opt_t *opts)
 Get the next option. More...
 

Variables

JAS_EXPORT int jas_optind
 The current option index. More...
 
const JAS_EXPORT char * jas_optarg
 The current option argument. More...
 
JAS_EXPORT int jas_opterr
 The debug level. More...
 

Detailed Description

Command-Line Interface (CLI) Option Processing.

General information can be found here.

Macro Definition Documentation

◆ JAS_GETOPT_EOF

#define JAS_GETOPT_EOF   (-1)

Last CLI option.

◆ JAS_GETOPT_ERR

#define JAS_GETOPT_ERR   '?'

Error while processing CLI options.

◆ JAS_OPT_HASARG

#define JAS_OPT_HASARG   0x01 /* option has argument */

Option has argument.

Function Documentation

◆ jas_getopt()

JAS_EXPORT int jas_getopt ( int  argc,
char **  argv,
const jas_opt_t opts 
)

Get the next option.

Gets the next CLI option.

Warning
This function is not thread safe, due to its use of jas_optind, jas_optarg, and jas_opterr.

Variable Documentation

◆ jas_optarg

const JAS_EXPORT char* jas_optarg

The current option argument.

◆ jas_opterr

JAS_EXPORT int jas_opterr

The debug level.

◆ jas_optind

JAS_EXPORT int jas_optind

The current option index.