gretl  2020e
About: gretl (Gnu Regression, Econometrics and Time-series Library) is a cross-platform statistical package mainly for econometric analysis.
  Fossies Dox: gretl-2020e.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

gretl_typemap.c File Reference
#include "libgretl.h"
#include "gretl_typemap.h"
Include dependency graph for gretl_typemap.c:

Go to the source code of this file.

Data Structures

struct  type_map
 
struct  lookup
 

Functions

GretlType gretl_type_get_plural (GretlType type)
 
GretlType gretl_type_get_singular (GretlType type)
 
GretlType gretl_type_get_ref_type (GretlType type)
 
GretlType gretl_type_get_plain_type (GretlType type)
 
const char * gretl_type_get_name (GretlType type)
 
GretlType gretl_type_from_string (const char *s)
 
GretlType gretl_get_gen_type (const char *s)
 
int gretl_is_array_type (GretlType type)
 
int gretl_is_arrayable_type (GretlType type)
 
int gretl_is_scalar_type (GretlType type)
 
void gretl_typemap_cleanup (void)
 

Variables

static struct type_map gretl_type_map []
 
static const struct lookup gentypes []
 

Function Documentation

◆ gretl_get_gen_type()

GretlType gretl_get_gen_type ( const char *  s)

Definition at line 292 of file gretl_typemap.c.

References gentypes, ht, n, lookup::type, and lookup::word.

Referenced by gretl_typemap_cleanup(), gui_run_genr(), and try_for_command_index().

◆ gretl_is_array_type()

◆ gretl_is_arrayable_type()

int gretl_is_arrayable_type ( GretlType  type)

◆ gretl_is_scalar_type()

int gretl_is_scalar_type ( GretlType  type)

◆ gretl_type_from_string()

◆ gretl_type_get_name()

const char* gretl_type_get_name ( GretlType  type)

gretl_type_get_name: @type: a gretl type.

Returns: the name of @type, or "invalid" on failure.

Definition at line 128 of file gretl_typemap.c.

References GRETL_TYPE_ANY, GRETL_TYPE_ARRAY, GRETL_TYPE_ARRAY_REF, GRETL_TYPE_ARRAYS, GRETL_TYPE_ARRAYS_REF, GRETL_TYPE_BOOL, GRETL_TYPE_BUNDLE, GRETL_TYPE_BUNDLE_REF, GRETL_TYPE_BUNDLES, GRETL_TYPE_BUNDLES_REF, GRETL_TYPE_DATE, GRETL_TYPE_DOUBLE, GRETL_TYPE_INT, GRETL_TYPE_LIST, GRETL_TYPE_LIST_REF, GRETL_TYPE_LISTS, GRETL_TYPE_LISTS_REF, GRETL_TYPE_MATRICES, GRETL_TYPE_MATRICES_REF, GRETL_TYPE_MATRIX, GRETL_TYPE_MATRIX_REF, GRETL_TYPE_NONE, GRETL_TYPE_OBS, GRETL_TYPE_SCALAR_REF, GRETL_TYPE_SERIES, GRETL_TYPE_SERIES_REF, GRETL_TYPE_STRING, GRETL_TYPE_STRING_REF, GRETL_TYPE_STRINGS, GRETL_TYPE_STRINGS_REF, GRETL_TYPE_UNSIGNED, GRETL_TYPE_USERIES, and GRETL_TYPE_VOID.

Referenced by add_blist_item_to_menu(), allocate_function_args(), arg_type_xml_string(), bundle_item_destroy(), bundled_item_to_json(), check_function_args(), check_parm_min_max(), delete_user_vars_of_type(), execute_plot(), function_assign_returns(), function_call_dialog(), function_set_package_role(), gen_get_lhs_var(), gen_replace_lhs(), generate(), geojson_to_csv(), get_user_var_of_type_by_name(), gretl_array_print(), gretl_array_print_range(), gretl_array_serialize(), gretl_array_to_json(), jb_transmute_array(), lhs_type_check(), list_ok_dollar_vars(), parse_function_param(), parse_odbc_format_chunk(), print_bundled_item(), print_function_start(), real_destroy_user_vars_at_level(), real_user_function_help(), realgen(), reattach_data_error(), save_bundled_item_call(), set_array_value(), set_type_error(), user_var_new(), user_var_replace_value(), VECM_add_matrix(), write_function_xml(), and xml_put_bundled_item().

◆ gretl_type_get_plain_type()

GretlType gretl_type_get_plain_type ( GretlType  type)

◆ gretl_type_get_plural()

GretlType gretl_type_get_plural ( GretlType  type)

Definition at line 45 of file gretl_typemap.c.

References gretl_type_map, n, type_map::plural, and type_map::std.

◆ gretl_type_get_ref_type()

GretlType gretl_type_get_ref_type ( GretlType  type)

◆ gretl_type_get_singular()

◆ gretl_typemap_cleanup()

void gretl_typemap_cleanup ( void  )

Definition at line 351 of file gretl_typemap.c.

References gretl_get_gen_type().

Referenced by libgretl_cleanup().

Variable Documentation

◆ gentypes

const struct lookup gentypes[]
static
Initial value:
= {
{ "series", GRETL_TYPE_SERIES },
{ "scalar", GRETL_TYPE_DOUBLE },
{ "matrix", GRETL_TYPE_MATRIX },
{ "string", GRETL_TYPE_STRING },
{ "list", GRETL_TYPE_LIST },
{ "bundle", GRETL_TYPE_BUNDLE },
{ "strings", GRETL_TYPE_STRINGS },
{ "matrices", GRETL_TYPE_MATRICES },
{ "bundles", GRETL_TYPE_BUNDLES },
{ "lists", GRETL_TYPE_LISTS },
{ "arrays", GRETL_TYPE_ARRAYS },
}
@ GRETL_TYPE_BUNDLE
Definition: libgretl.h:139
@ GRETL_TYPE_LISTS
Definition: libgretl.h:146
@ GRETL_TYPE_SERIES
Definition: libgretl.h:129
@ GRETL_TYPE_MATRICES
Definition: libgretl.h:144
@ GRETL_TYPE_DOUBLE
Definition: libgretl.h:124
@ GRETL_TYPE_BUNDLES
Definition: libgretl.h:145
@ GRETL_TYPE_STRINGS
Definition: libgretl.h:143
@ GRETL_TYPE_LIST
Definition: libgretl.h:123
@ GRETL_TYPE_ARRAYS
Definition: libgretl.h:147
@ GRETL_TYPE_STRING
Definition: libgretl.h:127
@ GRETL_TYPE_MATRIX
Definition: libgretl.h:130

Definition at line 173 of file gretl_typemap.c.

Referenced by gretl_get_gen_type().

◆ gretl_type_map

struct type_map gretl_type_map[]
static
Initial value:
= {
}
@ GRETL_TYPE_SCALAR_REF
Definition: libgretl.h:132
@ GRETL_TYPE_BUNDLE
Definition: libgretl.h:139
@ GRETL_TYPE_LISTS
Definition: libgretl.h:146
@ GRETL_TYPE_ARRAY_REF
Definition: libgretl.h:142
@ GRETL_TYPE_SERIES
Definition: libgretl.h:129
@ GRETL_TYPE_STRINGS_REF
Definition: libgretl.h:148
@ GRETL_TYPE_MATRICES
Definition: libgretl.h:144
@ GRETL_TYPE_DOUBLE
Definition: libgretl.h:124
@ GRETL_TYPE_LISTS_REF
Definition: libgretl.h:151
@ GRETL_TYPE_BUNDLES
Definition: libgretl.h:145
@ GRETL_TYPE_ARRAYS_REF
Definition: libgretl.h:152
@ GRETL_TYPE_MATRICES_REF
Definition: libgretl.h:149
@ GRETL_TYPE_BUNDLE_REF
Definition: libgretl.h:140
@ GRETL_TYPE_MATRIX_REF
Definition: libgretl.h:134
@ GRETL_TYPE_BUNDLES_REF
Definition: libgretl.h:150
@ GRETL_TYPE_STRINGS
Definition: libgretl.h:143
@ GRETL_TYPE_LIST_REF
Definition: libgretl.h:136
@ GRETL_TYPE_STRING_REF
Definition: libgretl.h:135
@ GRETL_TYPE_LIST
Definition: libgretl.h:123
@ GRETL_TYPE_ARRAYS
Definition: libgretl.h:147
@ GRETL_TYPE_SERIES_REF
Definition: libgretl.h:133
@ GRETL_TYPE_STRING
Definition: libgretl.h:127
@ GRETL_TYPE_MATRIX
Definition: libgretl.h:130
@ GRETL_TYPE_ARRAY
Definition: libgretl.h:141

Definition at line 1 of file gretl_typemap.c.

Referenced by gretl_type_get_plain_type(), gretl_type_get_plural(), gretl_type_get_ref_type(), and gretl_type_get_singular().