Top |
int gretl_xml_open_doc_root (const char *fname
,const char *rootname
,xmlDocPtr *pdoc
,xmlNodePtr *pnode
);
int gretl_xml_read_buffer (const char *buf
,const char *rootname
,xmlDocPtr *pdoc
,xmlNodePtr *pnode
);
void gretl_xml_put_int (const char *tag
,int i
,PRN *prn
);
Writes to fp
a string of the form "%s=%d".
void gretl_xml_put_unsigned (const char *tag
,unsigned int u
,PRN *prn
);
Writes to fp
a string of the form "%s=%u".
void gretl_xml_put_double (const char *tag
,double x
,PRN *prn
);
Writes to fp
a string of the form "%s=%.17g" if the value of
x
is valid, otherwise "%s=NA".
void gretl_xml_put_double_array (const char *tag
,double *x
,int n
,PRN *prn
);
void gretl_xml_put_strings_array (const char *tag
,const char **strs
,int n
,PRN *prn
);
void gretl_xml_put_strings_array_quoted (const char *tag
,const char **strs
,int n
,PRN *prn
);
void gretl_xml_put_tagged_list (const char *tag
,const int *list
,PRN *prn
);
int gretl_xml_put_string (const char *str
,PRN *prn
);
Write str
to fp
. If str
needs to have XML-special
characters escaped, this will be done automatically.
If str
is NULL, this is considered a no-op.
int gretl_xml_get_prop_as_int (xmlNodePtr node
,const char *tag
,int *i
);
int gretl_xml_get_prop_as_opt (xmlNodePtr node
,const char *tag
,gretlopt *o
);
unsigned int gretl_xml_get_prop_as_unsigned_int (xmlNodePtr node
,const char *tag
,unsigned int *u
);
int gretl_xml_get_prop_as_uchar (xmlNodePtr node
,const char *tag
,unsigned char *u
);
int gretl_xml_get_prop_as_double (xmlNodePtr node
,const char *tag
,double *x
);
int gretl_xml_get_prop_as_string (xmlNodePtr node
,const char *tag
,char **pstr
);
int gretl_xml_node_get_unsigned (xmlNodePtr node
,xmlDocPtr doc
,unsigned int *u
);
int gretl_xml_node_get_double (xmlNodePtr node
,xmlDocPtr doc
,double *x
);
int gretl_xml_node_get_string (xmlNodePtr node
,xmlDocPtr doc
,char **pstr
);
int gretl_xml_node_get_trimmed_string (xmlNodePtr node
,xmlDocPtr doc
,char **pstr
);
Reads a string from node
and trims both leading and trailing
white space.
int gretl_xml_child_get_string (xmlNodePtr node
,xmlDocPtr doc
,const char *name
,char **pstr
);
int * gretl_xml_get_int_array (xmlNodePtr node
,xmlDocPtr doc
,int *nelem
,int *err
);
double * gretl_xml_get_double_array (xmlNodePtr node
,xmlDocPtr doc
,int *nelem
,int *err
);
cmplx * gretl_xml_get_cmplx_array (xmlNodePtr node
,xmlDocPtr doc
,int *nelem
,int *err
);
char ** gretl_xml_get_strings_array (xmlNodePtr node
,xmlDocPtr doc
,int *nelem
,int slop
,int *err
);
int gretl_xml_child_get_strings_array (xmlNodePtr node
,xmlDocPtr doc
,const char *name
,char ***pstrs
,int *nstrs
);
gretl_matrix * gretl_xml_get_matrix (xmlNodePtr node
,xmlDocPtr doc
,int *err
);
int gretl_xml_get_submask (xmlNodePtr node
,xmlDocPtr doc
,char **pmask
);
void gretl_xml_put_tagged_string (const char *tag
,const char *str
,PRN *prn
);
Write str
to fp
, enclosed in simple starting and ending
tags specified by tag
. If str
needs to have XML-special
characters escaped, this will be done automatically.
If str
is NULL, this is considered a no-op.
void gretl_xml_put_tagged_string_plus (const char *tag
,const char *str
,const char *attrib
,const char *attval
,PRN *prn
);
Similar to gretl_xml_put_tagged_string()
, but allows
(in fact, requires) an attribute name and value along
with the element name and value.
void gretl_matrix_serialize (const gretl_matrix *m
,const char *name
,PRN *prn
);
void gretl_finite_scalar_serialize (double x
,const char *name
,PRN *prn
);
Note: not suitable for writing non-finite values.
int gretl_matrix_write_as_gdt (const char *fname
,const gretl_matrix *X
,const char **varnames
,const char **labels
);
Write out a .gdt data file containing the elements of of the given matrix.
fname |
name of file to write. |
|
X |
matrix, variable in columns. |
|
varnames |
column names. |
|
labels |
descriptive labels for the variables, or |
int gretl_write_gdt (const char *fname
,const int *list
,const DATASET *dset
,gretlopt opt
,int progress
);
Write out in xml a data file containing the values of the given set of variables.
int gretl_write_gdt_to_prn (PRN *prn
,const int *list
,const DATASET *dset
);
int gretl_read_gdt (const char *fname
,DATASET *dset
,gretlopt opt
,PRN *prn
);
Read data from native file into gretl's workspace.
int gretl_read_gdt_subset (const char *fname
,DATASET *dset
,int *vlist
,gretlopt opt
);
Read specified series from native file into dset
,
which should be "empty" on input.
int gretl_read_gdt_varnames (const char *fname
,char ***vnames
,int *nvars
);
Read the array of series names from the specified file.
char * gretl_get_gdt_description (const char *fname
,int *err
);
Read data description for gretl native data file.