111 #ifndef OPAL_CMD_LINE_H
112 #define OPAL_CMD_LINE_H
114 #include "opal_config.h"
160 OPAL_CMD_LINE_TYPE_NULL,
161 OPAL_CMD_LINE_TYPE_STRING,
162 OPAL_CMD_LINE_TYPE_INT,
163 OPAL_CMD_LINE_TYPE_SIZE_T,
164 OPAL_CMD_LINE_TYPE_BOOL,
166 OPAL_CMD_LINE_TYPE_MAX
303 const char *long_name,
305 const char *desc) __opal_attribute_deprecated__;
338 const char *long_name,
408 int argc,
char **argv);
453 const char *opt) __opal_attribute_nonnull__(1) __opal_attribute_nonnull__(2);
509 const
char *opt) __opal_attribute_nonnull__(1) __opal_attribute_nonnull__(2);
571 char ***tailv) __opal_attribute_nonnull__(1) __opal_attribute_nonnull__(2);
opal_mutex_t lcl_mutex
Thread safety.
Definition: cmd_line.h:131
const char * ocl_cmd_single_dash_name
"Single dash" name (i.e., "-foo").
Definition: cmd_line.h:197
OPAL_DECLSPEC char * opal_cmd_line_get_argv(opal_cmd_line_t *cmd, int index)
Return a string argument parsed on a OPAL command line handle.
Definition: cmd_line.c:856
OPAL_DECLSPEC OBJ_CLASS_DECLARATION(opal_cmd_line_t)
Top-level command line handle.
OPAL_DECLSPEC int opal_cmd_line_make_opt_mca(opal_cmd_line_t *cmd, opal_cmd_line_init_t entry)
Create a command line option.
Definition: cmd_line.c:190
int ocl_num_params
Number of parameters that this option takes.
Definition: cmd_line.h:202
const char * ocl_mca_param_name
If want to set an MCA parameter, set its parameter name here.
Definition: cmd_line.h:191
OPAL_DECLSPEC char * opal_cmd_line_get_usage_msg(opal_cmd_line_t *cmd) __opal_attribute_malloc__ __opal_attribute_warn_unused_result__
Return a consolidated "usage" message for a OPAL command line handle.
Definition: cmd_line.c:537
OPAL_DECLSPEC int opal_cmd_line_make_opt3(opal_cmd_line_t *cmd, char short_name, const char *sd_name, const char *long_name, int num_params, const char *desc)
Create a command line option.
Definition: cmd_line.c:235
char ** lcl_argv
Duplicate of argv from opal_cmd_line_parse()
Definition: cmd_line.h:139
Definition: mutex_unix.h:53
OPAL_DECLSPEC bool opal_cmd_line_is_taken(opal_cmd_line_t *cmd, const char *opt) __opal_attribute_nonnull__(1) __opal_attribute_nonnull__(2)
Test if a given option was taken on the parsed command line.
Definition: cmd_line.c:746
OPAL_DECLSPEC int opal_cmd_line_get_argc(opal_cmd_line_t *cmd) __opal_attribute_unused__
Return the number of arguments parsed on a OPAL command line handle.
Definition: cmd_line.c:847
const char * ocl_description
Description of the command line option, to be used with opal_cmd_line_get_usage_msg().
Definition: cmd_line.h:214
const char * ocl_mca_type_name
If want to set an MCA parameter, set its type name here.
Definition: cmd_line.h:183
The opal_list_t interface is used to provide a generic doubly-linked list container for Open MPI...
OPAL_DECLSPEC int opal_cmd_line_create(opal_cmd_line_t *cmd, opal_cmd_line_init_t *table)
Make a command line handle from a table of initializers.
Definition: cmd_line.c:146
const char * ocl_cmd_long_name
Long name (i.e., "--foo").
Definition: cmd_line.h:199
int lcl_argc
Duplicate of argc from opal_cmd_line_parse()
Definition: cmd_line.h:137
OPAL_DECLSPEC int opal_cmd_line_get_tail(opal_cmd_line_t *cmd, int *tailc, char ***tailv) __opal_attribute_nonnull__(1) __opal_attribute_nonnull__(2)
Return the entire "tail" of unprocessed argv from a OPAL command line handle.
Definition: cmd_line.c:867
OPAL_DECLSPEC char * opal_cmd_line_get_param(opal_cmd_line_t *cmd, const char *opt, int instance_num, int param_num)
Return a specific parameter for a specific instance of a option from the parsed command line...
Definition: cmd_line.c:796
Definition: cmd_line.h:126
OPAL_DECLSPEC int opal_cmd_line_make_opt(opal_cmd_line_t *cmd, char short_name, const char *long_name, int num_params, const char *desc) __opal_attribute_deprecated__
Definition: cmd_line.c:207
opal_cmd_line_type_t ocl_variable_type
If an ocl_variable_dest is given, its datatype must be supplied as well.
Definition: cmd_line.h:210
OPAL_DECLSPEC int opal_cmd_line_parse(opal_cmd_line_t *cmd, bool ignore_unknown, int argc, char **argv)
Parse a command line according to a pre-built OPAL command line handle.
Definition: cmd_line.c:264
void * ocl_variable_dest
If this parameter is encountered, its first parameter it saved here.
Definition: cmd_line.h:207
const char * ocl_mca_component_name
If want to set an MCA parameter, set its component name here.
Definition: cmd_line.h:187
opal_list_t lcl_params
Parsed output; list of cmd_line_param_t's (defined internally)
Definition: cmd_line.h:142
opal_list_t lcl_options
List of cmd_line_option_t's (defined internally)
Definition: cmd_line.h:134
char ** lcl_tail_argv
List of tail (unprocessed) arguments.
Definition: cmd_line.h:147
Base object.
Definition: opal_object.h:182
Definition: opal_list.h:147
Datatype used to construct a command line handle; see opal_cmd_line_create().
Definition: cmd_line.h:179
opal_object_t super
Make this an OBJ handle.
Definition: cmd_line.h:128
char ocl_cmd_short_name
"Short" name (i.e., "-X", where "X" is a single letter)
Definition: cmd_line.h:194
opal_cmd_line_type_t
Data types supported by the parser.
Definition: cmd_line.h:159
int lcl_tail_argc
List of tail (unprocessed) arguments.
Definition: cmd_line.h:145
OPAL_DECLSPEC int opal_cmd_line_get_ninsts(opal_cmd_line_t *cmd, const char *opt) __opal_attribute_nonnull__(1) __opal_attribute_nonnull__(2)
Return the number of instances of an option found during parsing.
Definition: cmd_line.c:755
Mutual exclusion functions.
A simple C-language object-oriented system with single inheritance and ownership-based memory managem...