options

options

Functions

Types and Values

enum OptStatus

Description

Functions

opt_from_flag ()

gretlopt
opt_from_flag (unsigned char c);

Returns

the gretl option value associated with a given single-character flag. Gives 0 if there is no associated option.


print_flags ()

const char *
print_flags (gretlopt oflags,
             int ci);

Parameters

oflags

options.

 

ci

command index, for context.

 

Returns

a string representation of the options in oflags , or an empty string if no options are found. The returned value should not be modified in any way.


get_opts_for_command ()

const char **
get_opts_for_command (int ci,
                      int *nopt);

set_options_for_command ()

int
set_options_for_command (const char *cmdword,
                         const char *param,
                         gretlopt opt);

maybe_get_stored_options ()

void
maybe_get_stored_options (int ci,
                          gretlopt *popt);

check_for_loop_only_options ()

int
check_for_loop_only_options (int ci,
                             gretlopt opt,
                             PRN *prn);

Parameters

ci

gretl command index.

 

opt

option flag to be tested.

 

prn

gretl printing struct.

 

Returns

1 if option opt is applicable for command ci only in the context of a command loop (in which case a warning is printed to prn ), otherwise 0.


cluster_option_ok ()

int
cluster_option_ok (int ci);

matrix_data_option ()

int
matrix_data_option (int ci,
                    gretlopt opt);

get_all_option_strings ()

char **
get_all_option_strings (int *pn);

transcribe_option_flags ()

gretlopt
transcribe_option_flags (gretlopt *targ,
                         gretlopt src,
                         gretlopt test);

delete_option_flags ()

gretlopt
delete_option_flags (gretlopt *targ,
                     gretlopt test);

If the intersection of the flags in targ and test is non- empty, unset the corresponding flags in targ .

Parameters

targ

pointer to target option flags.

 

test

bitwise OR of flags that to be deleted.

 

Returns

the (possibly modified) targ .


incompatible_options ()

int
incompatible_options (gretlopt opt,
                      gretlopt test);

Parameters

opt

option flags to be tested.

 

test

bitwise OR of flags that are incompatible in context.

 

Returns

E_BADOPT if opt contains more than one of the flags in test , otherwise 0.


option_prereq_missing ()

int
option_prereq_missing (gretlopt opt,
                       gretlopt test,
                       gretlopt prereq);

Parameters

opt

option flags to be tested.

 

test

bitwise OR of flags that have a deinite prequisite.

 

prereq

bitwise OR of prequisite flags.

 

Returns

E_BADOPT if opt contains at least one element of test but no elements of prereq , otherwise 0.


inapplicable_option_error ()

int
inapplicable_option_error (int ci,
                           gretlopt opt);

Flags an error: to be used when opt is not applicable for command ci , in context.

Parameters

ci

command index.

 

opt

bad option flag.

 

Returns

E_BADOPT.


push_option_param ()

int
push_option_param (int ci,
                   gretlopt opt,
                   char *val);

Pushes onto an internal stack a record of the val to be associated with opt for the current ci . Note that the command option apparatus takes ownership of val , so the value passed in should be copied if need be.

Parameters

ci

gretl command index.

 

opt

gretl option flag.

 

val

parameter value as string.

 

Returns

0 on success, non-zero on failure.


get_optval_double ()

double
get_optval_double (int ci,
                   gretlopt opt,
                   int *err);

Parameters

ci

gretl command index.

 

opt

gretl option value.

 

err

location to receive error code.

 

Returns

the double-precision ancillary value currently associated with option opt for command ci , if any, otherwise NADBL. If opt is an active option for ci but the parameter for this option cannot be interpreted as a numerical value, E_INVARG is written into err .


set_optval_double ()

int
set_optval_double (int ci,
                   gretlopt opt,
                   double x);

Sets a double-precision ancillary value to be associated with option opt for command ci .

Parameters

ci

gretl command index.

 

opt

gretl option value.

 

x

value to set.

 

Returns

0 on success, non-zero on failure.


get_optval_string ()

const char *
get_optval_string (int ci,
                   gretlopt opt);

Parameters

ci

gretl command index.

 

opt

gretl option value.

 

Returns

the ancillary string value currently associated with option opt for command ci , if any, otherwise NULL.


set_optval_string ()

int
set_optval_string (int ci,
                   gretlopt opt,
                   const char *s);

Sets a ancillary string value to be associated with option opt for command ci .

Parameters

ci

gretl command index.

 

opt

gretl option value.

 

s

value to set.

 

Returns

0 on success, non-zero on failure.


set_optval_int ()

int
set_optval_int (int ci,
                gretlopt opt,
                int k);

Sets a integer ancillary value to be associated with option opt for command ci .

Parameters

ci

gretl command index.

 

opt

gretl option value.

 

k

value to set.

 

Returns

0 on success, non-zero on failure.


get_optval_int ()

int
get_optval_int (int ci,
                gretlopt opt,
                int *err);

Parameters

ci

gretl command index.

 

opt

gretl option value.

 

err

location to receive error code.

 

Returns

the integer ancillary value currently associated with option opt for command ci , if any, otherwise 0. A non-zero value written to err if such a value is required for the option in question but is not present.


get_compression_option ()

int
get_compression_option (int ci);

destroy_option_params_at_level ()

void
destroy_option_params_at_level (int level);

clear_stored_options_for_command ()

void
clear_stored_options_for_command (int ci);

Clears any (non-persistent) option information currently associated with the given command, identified by its index.

Parameters

ci

target command index.

 

stored_options_cleanup ()

void
stored_options_cleanup (void);

setopt_cleanup ()

void
setopt_cleanup (void);

option_printing_cleanup ()

void
option_printing_cleanup (void);

valid_long_opt ()

gretlopt
valid_long_opt (int ci,
                const char *s,
                OptStatus *status);

valid_short_opt ()

gretlopt
valid_short_opt (int ci,
                 char c);

debug_print_option_flags ()

void
debug_print_option_flags (const char *msg,
                          gretlopt opt);

Types and Values

enum OptStatus

Members

OPT_NO_PARM

   

OPT_ACCEPTS_PARM

   

OPT_NEEDS_PARM

   

OPT_AMBIGUOUS