| Top |
| gretl_string_table * | gretl_string_table_new () |
| int | gretl_string_table_index () |
| int | gretl_string_table_print () |
| int | gretl_string_table_validate () |
| int | gretl_string_table_save () |
| void | gretl_string_table_destroy () |
| void | gretl_string_table_add_extra () |
| int | gretl_string_table_reset_column_id () |
| series_table * | series_table_new () |
| series_table * | series_table_copy () |
| void | series_table_destroy () |
| double | series_table_get_value () |
| const char * | series_table_get_string () |
| int | series_table_add_string () |
| char ** | series_table_get_strings () |
| int * | series_table_map () |
| void | gretl_insert_builtin_string () |
| char * | get_built_in_string_by_name () |
| void | builtin_strings_cleanup () |
| int | process_string_command () |
| int | substitute_named_strings () |
| char * | gretl_getenv () |
| char * | retrieve_date_string () |
| char * | retrieve_file_content () |
| char * | gretl_backtick () |
gretl_string_table *
gretl_string_table_new (const int *list);
These values in list
should correspond to the 0-based indices
of the series in question within the dataset. For example,
if strings are to be recorded for variables 2, 5 and 10 the
list
argument would be {3, 2, 5, 10}. If NULL is passed for
list
the return value is an initialized, empty string table.
int gretl_string_table_index (gretl_string_table *gst,const char *s,int col,int addcol,PRN *prn);
This function has two main uses: for lookup in the context of
a completed string table, or for constructing such a
table (with addcol
non-zero). The returned index reflects
any additions to the table that may be required (if column
col
does not already exist, or if string s
is not already
stored for column col
).
int gretl_string_table_print (gretl_string_table *gst,DATASET *dset,const char *fname,PRN *prn);
Prints table gst
to a file named string_table.txt in the
user's working directory.
int
gretl_string_table_validate (gretl_string_table *gst);
Checks that the "string values" in gst
are not in fact
undigested quasi-numerical values. We run this on
imported "CSV" data to ensure we don't produce
misleading results.
int gretl_string_table_save (gretl_string_table *gst,DATASET *dset);
Attaches the content of gst
to dset
.
void
gretl_string_table_destroy (gretl_string_table *gst);
Frees all resources associated with gst
.
void gretl_string_table_add_extra (gretl_string_table *gst,PRN *prn);
Steals the printing buffer from prn
and adds it to gst
.
The buffer will be appended when gst
is printed via
gretl_string_table_print().
int gretl_string_table_reset_column_id (gretl_string_table *gst,int oldid,int newid);
void
series_table_destroy (series_table *st);
Frees all resources associated with st
.
double series_table_get_value (series_table *st,const char *s);
the numerical value associated with s
in the
given series table, or NADBL in case there is no match.
int * series_table_map (series_table *st_from,series_table *st_to);
Constructs a mapping from the integer codes in st_from
to those in st_to
. For example, if the string "foo"
has code 3 in st_from
and code 12 in st_to
, then
element 3 in the mapping array will have value 12.
For any strings in st_from
that are not matched
in st_to
, the associated element of the map is set
to -1.
Element 0 of the map holds the number of following
elements, which is the same as the number of strings in
st_from
.
void gretl_insert_builtin_string (const char *name,const char *s);
Inserts value s
for string name
in gretl's table
of built-in string variables.
int process_string_command (const char *line,double ***pZ,DATASET *dset,PRN *prn);
char * retrieve_file_content (const char *fname,const char *codset,int *err);