gsasl  1.10.0
About: GNU SASL is an implementation of the Simple Authentication and Security Layer (SASL). Development version.
  Fossies Dox: gsasl-1.10.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

gsasl_cmd.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
#include "gsasl_cmd.h"
Include dependency graph for gsasl_cmd.c:

Go to the source code of this file.

Macros

#define FIX_UNUSED(X)   (void) (X) /* avoid warnings for unused params */
 

Enumerations

enum  cmdline_parser_arg_type { ARG_NO , ARG_FLAG , ARG_STRING , ARG_INT }
 

Functions

static void clear_given (struct gengetopt_args_info *args_info)
 
static void clear_args (struct gengetopt_args_info *args_info)
 
static int cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params, const char *additional_error)
 
static char * gengetopt_strdup (const char *s)
 replacement of strdup, which is not standard More...
 
static void init_args_info (struct gengetopt_args_info *args_info)
 
void cmdline_parser_print_version (void)
 
static void print_help_common (void)
 
void cmdline_parser_print_help (void)
 
void cmdline_parser_init (struct gengetopt_args_info *args_info)
 
void cmdline_parser_params_init (struct cmdline_parser_params *params)
 
struct cmdline_parser_paramscmdline_parser_params_create (void)
 
static void free_string_field (char **s)
 
static void cmdline_parser_release (struct gengetopt_args_info *args_info)
 
static void write_into_file (FILE *outfile, const char *opt, const char *arg, const char *values[])
 
int cmdline_parser_dump (FILE *outfile, struct gengetopt_args_info *args_info)
 
int cmdline_parser_file_save (const char *filename, struct gengetopt_args_info *args_info)
 
void cmdline_parser_free (struct gengetopt_args_info *args_info)
 
int cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
 
int cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params)
 
int cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
 
int cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name)
 
static int update_arg (void *field, char **orig_field, unsigned int *field_given, unsigned int *prev_given, char *value, const char *possible_values[], const char *default_value, cmdline_parser_arg_type arg_type, int check_ambiguity, int override, int no_free, int multiple_option, const char *long_opt, char short_opt, const char *additional_error)
 updates an option More...
 

Variables

const char * gengetopt_args_info_purpose = "Authenticate user to a server using Simple Authentication and\nSecurity Layer. Currently IMAP and SMTP servers are supported. This\nis a command line interface for the GNU SASL library."
 the purpose string of the program More...
 
const char * gengetopt_args_info_usage = "Usage: " PACKAGE " [OPTIONS]... [HOST [PORT]]..."
 the usage string of the program More...
 
const char * gengetopt_args_info_versiontext = ""
 
const char * gengetopt_args_info_description = ""
 the description string of the program More...
 
const char * gengetopt_args_info_help []
 all the lines making the help output More...
 
static char * package_name = 0
 

Macro Definition Documentation

◆ FIX_UNUSED

#define FIX_UNUSED (   X)    (void) (X) /* avoid warnings for unused params */

Definition at line 21 of file gsasl_cmd.c.

Enumeration Type Documentation

◆ cmdline_parser_arg_type

Enumerator
ARG_NO 
ARG_FLAG 
ARG_STRING 
ARG_INT 

Definition at line 82 of file gsasl_cmd.c.

Function Documentation

◆ clear_args()

static void clear_args ( struct gengetopt_args_info args_info)
static

Definition at line 143 of file gsasl_cmd.c.

References gengetopt_args_info::anonymous_token_arg, gengetopt_args_info::anonymous_token_orig, gengetopt_args_info::application_data_flag, args_info, gengetopt_args_info::authentication_id_arg, gengetopt_args_info::authentication_id_orig, gengetopt_args_info::authorization_id_arg, gengetopt_args_info::authorization_id_orig, gengetopt_args_info::client_flag, gengetopt_args_info::client_mechanisms_flag, gengetopt_args_info::connect_arg, gengetopt_args_info::connect_orig, gengetopt_args_info::disable_cleartext_validate_flag, gengetopt_args_info::enable_cram_md5_validate_flag, FIX_UNUSED, gengetopt_args_info::hostname_arg, gengetopt_args_info::hostname_orig, gengetopt_args_info::imap_flag, gengetopt_args_info::iteration_count_arg, gengetopt_args_info::iteration_count_orig, gengetopt_args_info::mechanism_arg, gengetopt_args_info::mechanism_orig, gengetopt_args_info::mkpasswd_flag, gengetopt_args_info::no_cb_flag, gengetopt_args_info::no_client_first_flag, gengetopt_args_info::no_starttls_flag, NULL, gengetopt_args_info::passcode_arg, gengetopt_args_info::passcode_orig, gengetopt_args_info::password_arg, gengetopt_args_info::password_orig, gengetopt_args_info::priority_arg, gengetopt_args_info::priority_orig, gengetopt_args_info::quality_of_protection_arg, gengetopt_args_info::quality_of_protection_orig, gengetopt_args_info::quiet_flag, gengetopt_args_info::realm_arg, gengetopt_args_info::realm_orig, gengetopt_args_info::salt_arg, gengetopt_args_info::salt_orig, gengetopt_args_info::server_flag, gengetopt_args_info::server_mechanisms_flag, gengetopt_args_info::service_arg, gengetopt_args_info::service_name_arg, gengetopt_args_info::service_name_orig, gengetopt_args_info::service_orig, gengetopt_args_info::smtp_flag, gengetopt_args_info::starttls_flag, gengetopt_args_info::verbose_flag, gengetopt_args_info::x509_ca_file_arg, gengetopt_args_info::x509_ca_file_orig, gengetopt_args_info::x509_cert_file_arg, gengetopt_args_info::x509_cert_file_orig, gengetopt_args_info::x509_key_file_arg, and gengetopt_args_info::x509_key_file_orig.

Referenced by cmdline_parser_init().

◆ clear_given()

static void clear_given ( struct gengetopt_args_info args_info)
static

Definition at line 102 of file gsasl_cmd.c.

References gengetopt_args_info::anonymous_token_given, gengetopt_args_info::application_data_given, args_info, gengetopt_args_info::authentication_id_given, gengetopt_args_info::authorization_id_given, gengetopt_args_info::client_given, gengetopt_args_info::client_mechanisms_given, gengetopt_args_info::connect_given, gengetopt_args_info::disable_cleartext_validate_given, gengetopt_args_info::enable_cram_md5_validate_given, gengetopt_args_info::help_given, gengetopt_args_info::hostname_given, gengetopt_args_info::imap_given, gengetopt_args_info::iteration_count_given, gengetopt_args_info::mechanism_given, gengetopt_args_info::mkpasswd_given, gengetopt_args_info::no_cb_given, gengetopt_args_info::no_client_first_given, gengetopt_args_info::no_starttls_given, gengetopt_args_info::passcode_given, gengetopt_args_info::password_given, gengetopt_args_info::priority_given, gengetopt_args_info::quality_of_protection_given, gengetopt_args_info::quiet_given, gengetopt_args_info::realm_given, gengetopt_args_info::salt_given, gengetopt_args_info::server_given, gengetopt_args_info::server_mechanisms_given, gengetopt_args_info::service_given, gengetopt_args_info::service_name_given, gengetopt_args_info::smtp_given, gengetopt_args_info::starttls_given, gengetopt_args_info::verbose_given, gengetopt_args_info::version_given, gengetopt_args_info::x509_ca_file_given, gengetopt_args_info::x509_cert_file_given, and gengetopt_args_info::x509_key_file_given.

Referenced by cmdline_parser_init(), and cmdline_parser_release().

◆ cmdline_parser()

int cmdline_parser ( int  argc,
char **  argv,
struct gengetopt_args_info args_info 
)

The command line parser

Parameters
argcthe number of command line options
argvthe command line options
args_infothe structure where option information will be stored
Returns
0 if everything went fine, NON 0 if an error took place

Definition at line 518 of file gsasl_cmd.c.

References args_info, and cmdline_parser2().

Referenced by main().

◆ cmdline_parser2()

int cmdline_parser2 ( int  argc,
char **  argv,
struct gengetopt_args_info args_info,
int  override,
int  initialize,
int  check_required 
)

The command line parser (version with additional parameters - deprecated)

Parameters
argcthe number of command line options
argvthe command line options
args_infothe structure where option information will be stored
overridewhether to override possibly already present options
initializewhether to initialize the option structure my_args_info
check_requiredwhether to check that all required options were provided
Returns
0 if everything went fine, NON 0 if an error took place
Deprecated:
use cmdline_parser_ext() instead

Definition at line 540 of file gsasl_cmd.c.

References args_info, cmdline_parser_params::check_ambiguity, cmdline_parser_params::check_required, cmdline_parser_free(), cmdline_parser_internal(), EXIT_FAILURE, cmdline_parser_params::initialize, cmdline_parser_params::override, and cmdline_parser_params::print_errors.

Referenced by cmdline_parser().

◆ cmdline_parser_dump()

int cmdline_parser_dump ( FILE *  outfile,
struct gengetopt_args_info args_info 
)

Save the contents of the option struct into an already open FILE stream.

Parameters
outfilethe stream where to dump options
args_infothe option struct to dump
Returns
0 if everything went fine, NON 0 if an error took place

Definition at line 388 of file gsasl_cmd.c.

References gengetopt_args_info::anonymous_token_given, gengetopt_args_info::anonymous_token_orig, gengetopt_args_info::application_data_given, args_info, gengetopt_args_info::authentication_id_given, gengetopt_args_info::authentication_id_orig, gengetopt_args_info::authorization_id_given, gengetopt_args_info::authorization_id_orig, gengetopt_args_info::client_given, gengetopt_args_info::client_mechanisms_given, CMDLINE_PARSER_PACKAGE, gengetopt_args_info::connect_given, gengetopt_args_info::connect_orig, gengetopt_args_info::disable_cleartext_validate_given, gengetopt_args_info::enable_cram_md5_validate_given, EXIT_FAILURE, EXIT_SUCCESS, gengetopt_args_info::help_given, gengetopt_args_info::hostname_given, gengetopt_args_info::hostname_orig, gengetopt_args_info::imap_given, gengetopt_args_info::iteration_count_given, gengetopt_args_info::iteration_count_orig, gengetopt_args_info::mechanism_given, gengetopt_args_info::mechanism_orig, gengetopt_args_info::mkpasswd_given, gengetopt_args_info::no_cb_given, gengetopt_args_info::no_client_first_given, gengetopt_args_info::no_starttls_given, gengetopt_args_info::passcode_given, gengetopt_args_info::passcode_orig, gengetopt_args_info::password_given, gengetopt_args_info::password_orig, gengetopt_args_info::priority_given, gengetopt_args_info::priority_orig, gengetopt_args_info::quality_of_protection_given, gengetopt_args_info::quality_of_protection_orig, gengetopt_args_info::quiet_given, gengetopt_args_info::realm_given, gengetopt_args_info::realm_orig, gengetopt_args_info::salt_given, gengetopt_args_info::salt_orig, gengetopt_args_info::server_given, gengetopt_args_info::server_mechanisms_given, gengetopt_args_info::service_given, gengetopt_args_info::service_name_given, gengetopt_args_info::service_name_orig, gengetopt_args_info::service_orig, gengetopt_args_info::smtp_given, gengetopt_args_info::starttls_given, gengetopt_args_info::verbose_given, gengetopt_args_info::version_given, write_into_file(), gengetopt_args_info::x509_ca_file_given, gengetopt_args_info::x509_ca_file_orig, gengetopt_args_info::x509_cert_file_given, gengetopt_args_info::x509_cert_file_orig, gengetopt_args_info::x509_key_file_given, and gengetopt_args_info::x509_key_file_orig.

Referenced by cmdline_parser_file_save().

◆ cmdline_parser_ext()

int cmdline_parser_ext ( int  argc,
char **  argv,
struct gengetopt_args_info args_info,
struct cmdline_parser_params params 
)

The command line parser (version with additional parameters)

Parameters
argcthe number of command line options
argvthe command line options
args_infothe structure where option information will be stored
paramsadditional parameters for the parser
Returns
0 if everything went fine, NON 0 if an error took place

Definition at line 524 of file gsasl_cmd.c.

References args_info, cmdline_parser_free(), cmdline_parser_internal(), and EXIT_FAILURE.

◆ cmdline_parser_file_save()

int cmdline_parser_file_save ( const char *  filename,
struct gengetopt_args_info args_info 
)

Save the contents of the option struct into a (text) file. This file can be read by the config file parser (if generated by gengetopt)

Parameters
filenamethe file where to save
args_infothe option struct to save
Returns
0 if everything went fine, NON 0 if an error took place

Definition at line 477 of file gsasl_cmd.c.

References args_info, cmdline_parser_dump(), CMDLINE_PARSER_PACKAGE, and EXIT_FAILURE.

◆ cmdline_parser_free()

void cmdline_parser_free ( struct gengetopt_args_info args_info)

Deallocates the string fields of the gengetopt_args_info structure (but does not deallocate the structure itself)

Parameters
args_infothe structure to deallocate

Definition at line 497 of file gsasl_cmd.c.

References args_info, and cmdline_parser_release().

Referenced by cmdline_parser2(), cmdline_parser_ext(), and cmdline_parser_internal().

◆ cmdline_parser_init()

void cmdline_parser_init ( struct gengetopt_args_info args_info)

Initializes the passed gengetopt_args_info structure's fields (also set default values for options that have a default)

Parameters
args_infothe structure to initialize

Definition at line 281 of file gsasl_cmd.c.

References args_info, clear_args(), clear_given(), init_args_info(), gengetopt_args_info::inputs, and gengetopt_args_info::inputs_num.

Referenced by cmdline_parser_internal().

◆ cmdline_parser_internal()

int cmdline_parser_internal ( int  argc,
char **  argv,
struct gengetopt_args_info args_info,
struct cmdline_parser_params params,
const char *  additional_error 
)
static

Definition at line 688 of file gsasl_cmd.c.

References gengetopt_args_info::anonymous_token_arg, gengetopt_args_info::anonymous_token_given, gengetopt_args_info::anonymous_token_orig, gengetopt_args_info::application_data_flag, gengetopt_args_info::application_data_given, ARG_FLAG, ARG_INT, ARG_NO, ARG_STRING, args_info, gengetopt_args_info::authentication_id_arg, gengetopt_args_info::authentication_id_given, gengetopt_args_info::authentication_id_orig, gengetopt_args_info::authorization_id_arg, gengetopt_args_info::authorization_id_given, gengetopt_args_info::authorization_id_orig, c, cmdline_parser_params::check_ambiguity, cmdline_parser_params::check_required, gengetopt_args_info::client_flag, gengetopt_args_info::client_given, gengetopt_args_info::client_mechanisms_flag, gengetopt_args_info::client_mechanisms_given, cmdline_parser_free(), cmdline_parser_init(), CMDLINE_PARSER_PACKAGE, cmdline_parser_release(), gengetopt_args_info::connect_arg, gengetopt_args_info::connect_given, gengetopt_args_info::connect_orig, gengetopt_args_info::disable_cleartext_validate_flag, gengetopt_args_info::disable_cleartext_validate_given, gengetopt_args_info::enable_cram_md5_validate_flag, gengetopt_args_info::enable_cram_md5_validate_given, EXIT_FAILURE, gengetopt_strdup(), getopt_long(), gengetopt_args_info::help_given, gengetopt_args_info::hostname_arg, gengetopt_args_info::hostname_given, gengetopt_args_info::hostname_orig, gengetopt_args_info::imap_flag, gengetopt_args_info::imap_given, cmdline_parser_params::initialize, gengetopt_args_info::inputs, gengetopt_args_info::inputs_num, gengetopt_args_info::iteration_count_arg, gengetopt_args_info::iteration_count_given, gengetopt_args_info::iteration_count_orig, gengetopt_args_info::mechanism_arg, gengetopt_args_info::mechanism_given, gengetopt_args_info::mechanism_orig, gengetopt_args_info::mkpasswd_flag, gengetopt_args_info::mkpasswd_given, name, gengetopt_args_info::no_cb_flag, gengetopt_args_info::no_cb_given, gengetopt_args_info::no_client_first_flag, gengetopt_args_info::no_client_first_given, gengetopt_args_info::no_starttls_flag, gengetopt_args_info::no_starttls_given, NULL, optarg, opterr, optind, optopt, cmdline_parser_params::override, package_name, gengetopt_args_info::passcode_arg, gengetopt_args_info::passcode_given, gengetopt_args_info::passcode_orig, gengetopt_args_info::password_arg, gengetopt_args_info::password_given, gengetopt_args_info::password_orig, cmdline_parser_params::print_errors, gengetopt_args_info::priority_arg, gengetopt_args_info::priority_given, gengetopt_args_info::priority_orig, gengetopt_args_info::quality_of_protection_arg, gengetopt_args_info::quality_of_protection_given, gengetopt_args_info::quality_of_protection_orig, gengetopt_args_info::quiet_flag, gengetopt_args_info::quiet_given, gengetopt_args_info::realm_arg, gengetopt_args_info::realm_given, gengetopt_args_info::realm_orig, gengetopt_args_info::salt_arg, gengetopt_args_info::salt_given, gengetopt_args_info::salt_orig, gengetopt_args_info::server_flag, gengetopt_args_info::server_given, gengetopt_args_info::server_mechanisms_flag, gengetopt_args_info::server_mechanisms_given, gengetopt_args_info::service_arg, gengetopt_args_info::service_given, gengetopt_args_info::service_name_arg, gengetopt_args_info::service_name_given, gengetopt_args_info::service_name_orig, gengetopt_args_info::service_orig, gengetopt_args_info::smtp_flag, gengetopt_args_info::smtp_given, gengetopt_args_info::starttls_flag, gengetopt_args_info::starttls_given, update_arg(), gengetopt_args_info::verbose_flag, gengetopt_args_info::verbose_given, gengetopt_args_info::version_given, gengetopt_args_info::x509_ca_file_arg, gengetopt_args_info::x509_ca_file_given, gengetopt_args_info::x509_ca_file_orig, gengetopt_args_info::x509_cert_file_arg, gengetopt_args_info::x509_cert_file_given, gengetopt_args_info::x509_cert_file_orig, gengetopt_args_info::x509_key_file_arg, gengetopt_args_info::x509_key_file_given, and gengetopt_args_info::x509_key_file_orig.

Referenced by cmdline_parser2(), and cmdline_parser_ext().

◆ cmdline_parser_params_create()

struct cmdline_parser_params* cmdline_parser_params_create ( void  )

Allocates dynamically a cmdline_parser_params structure and initializes all its fields to their default values

Returns
the created and initialized cmdline_parser_params structure

Definition at line 305 of file gsasl_cmd.c.

References cmdline_parser_params_init().

◆ cmdline_parser_params_init()

void cmdline_parser_params_init ( struct cmdline_parser_params params)

Initializes all the fields a cmdline_parser_params structure to their default values

Parameters
paramsthe structure to initialize

Definition at line 292 of file gsasl_cmd.c.

References cmdline_parser_params::check_ambiguity, cmdline_parser_params::check_required, cmdline_parser_params::initialize, cmdline_parser_params::override, and cmdline_parser_params::print_errors.

Referenced by cmdline_parser_params_create().

◆ cmdline_parser_print_help()

void cmdline_parser_print_help ( void  )

Print the help

Definition at line 272 of file gsasl_cmd.c.

References gengetopt_args_info_help, and print_help_common().

Referenced by main(), and usage().

◆ cmdline_parser_print_version()

void cmdline_parser_print_version ( void  )

◆ cmdline_parser_release()

static void cmdline_parser_release ( struct gengetopt_args_info args_info)
static

Definition at line 325 of file gsasl_cmd.c.

References gengetopt_args_info::anonymous_token_arg, gengetopt_args_info::anonymous_token_orig, args_info, gengetopt_args_info::authentication_id_arg, gengetopt_args_info::authentication_id_orig, gengetopt_args_info::authorization_id_arg, gengetopt_args_info::authorization_id_orig, clear_given(), gengetopt_args_info::connect_arg, gengetopt_args_info::connect_orig, free_string_field(), gengetopt_args_info::hostname_arg, gengetopt_args_info::hostname_orig, gengetopt_args_info::inputs, gengetopt_args_info::inputs_num, gengetopt_args_info::iteration_count_orig, gengetopt_args_info::mechanism_arg, gengetopt_args_info::mechanism_orig, gengetopt_args_info::passcode_arg, gengetopt_args_info::passcode_orig, gengetopt_args_info::password_arg, gengetopt_args_info::password_orig, gengetopt_args_info::priority_arg, gengetopt_args_info::priority_orig, gengetopt_args_info::quality_of_protection_arg, gengetopt_args_info::quality_of_protection_orig, gengetopt_args_info::realm_arg, gengetopt_args_info::realm_orig, gengetopt_args_info::salt_arg, gengetopt_args_info::salt_orig, gengetopt_args_info::service_arg, gengetopt_args_info::service_name_arg, gengetopt_args_info::service_name_orig, gengetopt_args_info::service_orig, gengetopt_args_info::x509_ca_file_arg, gengetopt_args_info::x509_ca_file_orig, gengetopt_args_info::x509_cert_file_arg, gengetopt_args_info::x509_cert_file_orig, gengetopt_args_info::x509_key_file_arg, and gengetopt_args_info::x509_key_file_orig.

Referenced by cmdline_parser_free(), and cmdline_parser_internal().

◆ cmdline_parser_required()

int cmdline_parser_required ( struct gengetopt_args_info args_info,
const char *  prog_name 
)

Checks that all the required options were specified

Parameters
args_infothe structure to check
prog_namethe name of the program that will be used to print possible errors
Returns

Definition at line 563 of file gsasl_cmd.c.

References args_info, EXIT_SUCCESS, and FIX_UNUSED.

◆ free_string_field()

static void free_string_field ( char **  s)
static

Definition at line 314 of file gsasl_cmd.c.

Referenced by cmdline_parser_release().

◆ gengetopt_strdup()

char * gengetopt_strdup ( const char *  s)
static

replacement of strdup, which is not standard

Definition at line 504 of file gsasl_cmd.c.

Referenced by cmdline_parser_internal(), and update_arg().

◆ init_args_info()

static void init_args_info ( struct gengetopt_args_info args_info)
static

Definition at line 202 of file gsasl_cmd.c.

References gengetopt_args_info::anonymous_token_help, gengetopt_args_info::application_data_help, args_info, gengetopt_args_info::authentication_id_help, gengetopt_args_info::authorization_id_help, gengetopt_args_info::client_help, gengetopt_args_info::client_mechanisms_help, gengetopt_args_info::connect_help, gengetopt_args_info::disable_cleartext_validate_help, gengetopt_args_info::enable_cram_md5_validate_help, gengetopt_args_info_help, gengetopt_args_info::help_help, gengetopt_args_info::hostname_help, gengetopt_args_info::imap_help, gengetopt_args_info::iteration_count_help, gengetopt_args_info::mechanism_help, gengetopt_args_info::mkpasswd_help, gengetopt_args_info::no_cb_help, gengetopt_args_info::no_client_first_help, gengetopt_args_info::no_starttls_help, gengetopt_args_info::passcode_help, gengetopt_args_info::password_help, gengetopt_args_info::priority_help, gengetopt_args_info::quality_of_protection_help, gengetopt_args_info::quiet_help, gengetopt_args_info::realm_help, gengetopt_args_info::salt_help, gengetopt_args_info::server_help, gengetopt_args_info::server_mechanisms_help, gengetopt_args_info::service_help, gengetopt_args_info::service_name_help, gengetopt_args_info::smtp_help, gengetopt_args_info::starttls_help, gengetopt_args_info::verbose_help, gengetopt_args_info::version_help, gengetopt_args_info::x509_ca_file_help, gengetopt_args_info::x509_cert_file_help, and gengetopt_args_info::x509_key_file_help.

Referenced by cmdline_parser_init().

◆ print_help_common()

static void print_help_common ( void  )
static

◆ update_arg()

static int update_arg ( void *  field,
char **  orig_field,
unsigned int *  field_given,
unsigned int *  prev_given,
char *  value,
const char *  possible_values[],
const char *  default_value,
cmdline_parser_arg_type  arg_type,
int  check_ambiguity,
int  override,
int  no_free,
int  multiple_option,
const char *  long_opt,
char  short_opt,
const char *  additional_error 
)
static

updates an option

Parameters
fieldthe generic pointer to the field to update
orig_fieldthe pointer to the orig field
field_giventhe pointer to the number of occurrence of this option
prev_giventhe pointer to the number of occurrence already seen
valuethe argument for this option (if null no arg was specified)
possible_valuesthe possible values for this option (if specified)
default_valuethe default value (in case the option only accepts fixed values)
arg_typethe type of this option
check_ambiguity
See also
cmdline_parser_params.check_ambiguity
Parameters
override
See also
cmdline_parser_params.override
Parameters
no_freewhether to free a possible previous value
multiple_optionwhether this is a multiple option
long_optthe corresponding long option
short_optthe corresponding short option (or '-' if none)
additional_errorpossible further error specification

Definition at line 592 of file gsasl_cmd.c.

References ARG_FLAG, ARG_INT, ARG_NO, ARG_STRING, cmdline_parser_params::check_ambiguity, FIX_UNUSED, gengetopt_strdup(), and package_name.

Referenced by cmdline_parser_internal().

◆ write_into_file()

static void write_into_file ( FILE *  outfile,
const char *  opt,
const char *  arg,
const char *  values[] 
)
static

Definition at line 376 of file gsasl_cmd.c.

References FIX_UNUSED, and values.

Referenced by cmdline_parser_dump().

Variable Documentation

◆ gengetopt_args_info_description

const char* gengetopt_args_info_description = ""

the description string of the program

Definition at line 34 of file gsasl_cmd.c.

Referenced by print_help_common().

◆ gengetopt_args_info_help

const char* gengetopt_args_info_help[]

all the lines making the help output

Definition at line 36 of file gsasl_cmd.c.

Referenced by cmdline_parser_print_help(), and init_args_info().

◆ gengetopt_args_info_purpose

const char* gengetopt_args_info_purpose = "Authenticate user to a server using Simple Authentication and\nSecurity Layer. Currently IMAP and SMTP servers are supported. This\nis a command line interface for the GNU SASL library."

the purpose string of the program

Definition at line 28 of file gsasl_cmd.c.

Referenced by print_help_common().

◆ gengetopt_args_info_usage

const char* gengetopt_args_info_usage = "Usage: " PACKAGE " [OPTIONS]... [HOST [PORT]]..."

the usage string of the program

Definition at line 30 of file gsasl_cmd.c.

Referenced by print_help_common().

◆ gengetopt_args_info_versiontext

const char* gengetopt_args_info_versiontext = ""

Definition at line 32 of file gsasl_cmd.c.

Referenced by cmdline_parser_print_version().

◆ package_name

char* package_name = 0
static

Definition at line 571 of file gsasl_cmd.c.

Referenced by cmdline_parser_internal(), and update_arg().