| Top |
| #define | BUNDLE_PRINT |
| #define | BUNDLE_PLOT |
| #define | BUNDLE_TEST |
| #define | BUNDLE_FCAST |
| #define | BUNDLE_EXTRA |
| #define | GUI_MAIN |
| #define | GUI_PRECHECK |
| #define | LIST_MAKER |
| enum | BundleType |
| typedef | gretl_bundle |
| typedef | bundled_item |
void * gretl_bundle_get_data (gretl_bundle *bundle,const char *key,GretlType *type,int *size,int *err);
bundle |
bundle to access. |
|
key |
name of key to access. |
|
type |
location to receive data type, or NULL. |
|
size |
location to receive size of data (= series length for GRETL_TYPE_SERIES, otherwise 0), or NULL. |
|
err |
location to receive error code. |
the item pointer associated with key
in the
specified bundle
, or NULL if there is no such item.
If err
is non-NULL, its content is set to a non-zero
value if bundle
contains no item with key key
. If
the intent is simply to determine whether bundle
contains
an item under the specified key
, err
should generally be
left NULL.
Note that the value returned is the actual data pointer from within the bundle, not a copy of the data; so the pointer must not be freed, and in general its content should not be modified.
void * gretl_bundle_steal_data (gretl_bundle *bundle,const char *key,GretlType *type,int *size,int *err);
Works like gretl_bundle_get_data() except that the data
pointer in question is removed from bundle
before it is
returned to the caller; so in effect the caller assumes
ownership of the item.
GretlType gretl_bundle_get_member_type (gretl_bundle *bundle,const char *key,int *err);
gretl_matrix * gretl_bundle_get_matrix (gretl_bundle *bundle,const char *key,int *err);
double * gretl_bundle_get_series (gretl_bundle *bundle,const char *key,int *n,int *err);
int * gretl_bundle_get_list (gretl_bundle *bundle,const char *key,int *err);
double gretl_bundle_get_scalar (gretl_bundle *bundle,const char *key,int *err);
const char * gretl_bundle_get_string (gretl_bundle *bundle,const char *key,int *err);
void * gretl_bundle_get_array (gretl_bundle *bundle,const char *key,int *err);
const char * gretl_bundle_get_note (gretl_bundle *bundle,const char *key);
void * bundled_item_get_data (bundled_item *item,GretlType *type,int *size);
int gretl_bundle_donate_data (gretl_bundle *bundle,const char *key,void *ptr,GretlType type,int size);
Sets the data type and pointer to be associated with key
in
the bundle given by name
. If key
is already present in
the bundle's hash table the original value is replaced
and destroyed. The value of ptr
is transcribed into the
bundle, which therefore "takes ownership" of the data;
compare gretl_bundle_set_data().
int gretl_bundle_set_data (gretl_bundle *bundle,const char *key,void *ptr,GretlType type,int size);
Sets the data type and pointer to be associated with key
in
the bundle given by name
. If key
is already present in
the bundle's hash table the original value is replaced
and destroyed. The content of ptr
is copied into the
bundle; compare gretl_bundle_donate_data().
int gretl_bundle_set_string (gretl_bundle *bundle,const char *key,const char *str);
Sets str
as a member of bundle
under the name key
.
If key
is already present in the bundle the original
value is replaced and destroyed.
int gretl_bundle_set_scalar (gretl_bundle *bundle,const char *key,double val);
Sets val
as a member of bundle
under the name key
.
If key
is already present in the bundle the original
value is replaced and destroyed.
int gretl_bundle_set_int (gretl_bundle *bundle,const char *key,int val);
Sets val
as a member of bundle
under the name key
.
If key
is already present in the bundle the original
value is replaced and destroyed.
int gretl_bundle_set_series (gretl_bundle *bundle,const char *key,const double *x,int n);
Sets x
as a member of bundle
under the name key
.
If key
is already present in the bundle the original
value is replaced and destroyed.
int gretl_bundle_set_list (gretl_bundle *bundle,const char *key,const int *list);
Sets list
as a member of bundle
under the name key
.
If key
is already present in the bundle the original
value is replaced and destroyed.
int gretl_bundle_set_matrix (gretl_bundle *bundle,const char *key,const gretl_matrix *m);
Sets m
as a member of bundle
under the name key
.
If key
is already present in the bundle the original
value is replaced and destroyed.
int gretl_bundle_set_note (gretl_bundle *bundle,const char *key,const char *note);
Adds a descriptive note to the item under key
in bundle
.
If a note is already present it is replaced by the new one.
int gretl_bundle_delete_data (gretl_bundle *bundle,const char *key);
Deletes the data item under key
from bundle
, if
such an item is present.
int gretl_bundle_add_or_replace (gretl_bundle *bundle,const char *name);
int gretl_bundle_copy_as (const char *name,const char *copyname);
Look for a saved bundle specified by name
, and if found,
make a full copy and save it under copyname
. This is
called from geneval.c on completion of assignment to a
bundle named copyname
, where the returned value on the
right-hand side is a pre-existing saved bundle.
int gretl_bundle_set_creator (gretl_bundle *b,const char *name);
Sets the "creator" attribute of bundle
. This is called
automatically when a bundle is returned to top-level
userspace by a packaged function.
int gretl_bundle_print (gretl_bundle *bundle,PRN *prn);
Prints to prn
a list of the keys defined in bundle
, along
with descriptive notes, if any.
gretl_bundle * gretl_bundle_pull_from_stack (const char *name,int *err);
gretl_bundle * gretl_bundle_union (const gretl_bundle *bundle1,const gretl_bundle *bundle2,int *err);
void
gretl_bundle_destroy (gretl_bundle *bundle);
Frees all contents of bundle
as well as the pointer itself.
void
gretl_bundle_void_content (gretl_bundle *bundle);
Frees all contents of bundle
.
void gretl_bundle_serialize (gretl_bundle *b,const char *name,FILE *fp);
int gretl_bundle_write_to_file (gretl_bundle *b,const char *fname,int to_dotdir);
char * gretl_bundle_write_to_buffer (gretl_bundle *b,int *bytes,int *err);
gretl_bundle * gretl_bundle_read_from_file (const char *fname,int from_dotdir,int *err);
gretl_bundle * gretl_bundle_read_from_buffer (const char *buf,int len,int *err);
void * sysinfo_bundle_get_data (const char *key,GretlType *type,int *err);
gretl_bundle * kalman_bundle_new (gretl_matrix *M[],int copy[],int nmat,int *err);