libptpmgmt  1.4
libptpmgmt library that provides the functionality of linuxptp pmc
Public Attributes | List of all members
ptpmgmt_opt_t Struct Reference

#include <opt.h>

Public Attributes

void(* free )(ptpmgmt_opt opt)
 
void(* useDefOption )(ptpmgmt_opt opt)
 
bool(* insert )(ptpmgmt_opt opt, struct ptpmgmt_opt_option *addOpt)
 
const char *(* get_help )(ptpmgmt_opt opt)
 
const char *(* get_msg )(ptpmgmt_opt opt)
 
enum ptpmgmt_opt_loop_val(* parse_options )(ptpmgmt_opt opt, int argc, char *argv[])
 
bool(* have )(ptpmgmt_opt opt, char askOpt)
 
const char *(* val )(ptpmgmt_opt opt, char valOpt)
 
int(* val_i )(ptpmgmt_opt opt, char valOpt)
 
char(* get_net_transport )(ptpmgmt_opt opt)
 
bool(* have_more )(ptpmgmt_opt opt)
 
int(* process_next )(ptpmgmt_opt opt)
 

Detailed Description

The ptpmgmt options structure hold the options object and call backs to call C++ methods

Member Data Documentation

◆ free

void(* ptpmgmt_opt_t::free) (ptpmgmt_opt opt)

< Free an options object

Parameters
[in,out]optoptions object to free

◆ get_help

const char*(* ptpmgmt_opt_t::get_help) (ptpmgmt_opt opt)

Get help message

Parameters
[in,out]optoptions object
Returns
help message

◆ get_msg

const char*(* ptpmgmt_opt_t::get_msg) (ptpmgmt_opt opt)

Get parse_options() message

Parameters
[in,out]optoptions object
Returns
message from last parse_options()

◆ get_net_transport

char(* ptpmgmt_opt_t::get_net_transport) (ptpmgmt_opt opt)

get Network Transport value

Parameters
[in,out]optoptions object
Returns
Network Transport
Note
return 0 if not select on command line

◆ have

bool(* ptpmgmt_opt_t::have) (ptpmgmt_opt opt, char askOpt)

Is option on command line

Parameters
[in,out]optoptions object
[in]askOptshort option character
Returns
true if option on command line

◆ have_more

bool(* ptpmgmt_opt_t::have_more) (ptpmgmt_opt opt)

Do we have more argumends on the command line, left unprocessed

Parameters
[in,out]optoptions object
Returns
true if we have more to process

◆ insert

bool(* ptpmgmt_opt_t::insert) (ptpmgmt_opt opt, struct ptpmgmt_opt_option *addOpt)

Insert option

Parameters
[in,out]optoptions object
[in]addOptnew option parameters
Returns
true on adding the option
Note
should be called before calling parse_options()

◆ parse_options

enum ptpmgmt_opt_loop_val(* ptpmgmt_opt_t::parse_options) (ptpmgmt_opt opt, int argc, char *argv[])

Parse command line

Parameters
[in,out]optoptions object
[in]argcnumber of arguments
[in]argvarray of command line arguments
Returns
Parse state
Note
Follow the command line. Argument 0 is the application name,
as appear in the command line.
The class do not store it.

◆ process_next

int(* ptpmgmt_opt_t::process_next) (ptpmgmt_opt opt)

First argumend on the command line, left unprocessed

Parameters
[in,out]optoptions object
Returns
index of argument

◆ useDefOption

void(* ptpmgmt_opt_t::useDefOption) (ptpmgmt_opt opt)

Use PMC default options

Parameters
[in,out]optoptions object

◆ val

const char*(* ptpmgmt_opt_t::val) (ptpmgmt_opt opt, char valOpt)

get option value

Parameters
[in,out]optoptions object
[in]valOptshort option character
Returns
option char pointer of value string (C style)
Note
relevant for option with argument

◆ val_i

int(* ptpmgmt_opt_t::val_i) (ptpmgmt_opt opt, char valOpt)

get option integer value

Parameters
[in,out]optoptions object
[in]valOptshort option character
Returns
option integer value
Note
relevant for option with argument of integer value

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