libptpmgmt 2.0
libptpmgmt library that provides the functionality of linuxptp pmc
Loading...
Searching...
No Matches
opt.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: LGPL-3.0-or-later
2 SPDX-FileCopyrightText: Copyright © 2023 Erez Geva <ErezGeva2@gmail.com> */
3
12#ifndef __PTPMGMT_C_OPT_H
13#define __PTPMGMT_C_OPT_H
14
15#include "name.h"
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
32 const char *long_name;
33 bool have_arg;
34 bool long_only;
35 const char *help_msg;
36 const char *arg_help;
37 const char *def_val;
38};
39
41typedef struct ptpmgmt_opt_t *ptpmgmt_opt;
42
44typedef const struct ptpmgmt_opt_t *const_ptpmgmt_opt;
45
52 void *_this;
59 void (*free)(ptpmgmt_opt opt);
72 bool (*insert)(ptpmgmt_opt opt, struct ptpmgmt_opt_option *addOpt);
78 const char *(*get_help)(const_ptpmgmt_opt opt);
84 const char *(*get_msg)(const_ptpmgmt_opt opt);
97 char *argv[]);
104 bool (*have)(const_ptpmgmt_opt opt, char askOpt);
112 const char *(*val)(const_ptpmgmt_opt opt, char valOpt);
120 int (*val_i)(const_ptpmgmt_opt opt, char valOpt);
140};
141
152
153#ifdef __cplusplus
154}
155#endif
156
157#endif /* __PTPMGMT_C_OPT_H */
struct ptpmgmt_opt_t * ptpmgmt_opt
Definition opt.h:41
ptpmgmt_opt_loop_val
Definition opt.h:22
@ PTPMGMT_OPT_HELP
Definition opt.h:25
@ PTPMGMT_OPT_ERR
Definition opt.h:23
@ PTPMGMT_OPT_DONE
Definition opt.h:26
@ PTPMGMT_OPT_MSG
Definition opt.h:24
ptpmgmt_opt ptpmgmt_opt_alloc_empty()
ptpmgmt_opt ptpmgmt_opt_alloc()
const struct ptpmgmt_opt_t * const_ptpmgmt_opt
Definition opt.h:44
Define name space.
Definition opt.h:29
const char * help_msg
Definition opt.h:35
const char * def_val
Definition opt.h:37
char short_name
Definition opt.h:31
const char * arg_help
Definition opt.h:36
const char * long_name
Definition opt.h:32
bool long_only
Definition opt.h:34
bool have_arg
Definition opt.h:33
Definition opt.h:50
void(* free)(ptpmgmt_opt opt)
Definition opt.h:59
bool(* insert)(ptpmgmt_opt opt, struct ptpmgmt_opt_option *addOpt)
Definition opt.h:72
char(* get_net_transport)(const_ptpmgmt_opt opt)
Definition opt.h:127
int(* val_i)(const_ptpmgmt_opt opt, char valOpt)
Definition opt.h:120
bool(* have)(const_ptpmgmt_opt opt, char askOpt)
Definition opt.h:104
int(* process_next)(const_ptpmgmt_opt opt)
Definition opt.h:139
bool(* have_more)(const_ptpmgmt_opt opt)
Definition opt.h:133
void(* useDefOption)(ptpmgmt_opt opt)
Definition opt.h:64
enum ptpmgmt_opt_loop_val(* parse_options)(ptpmgmt_opt opt, int argc, char *argv[])
Definition opt.h:96