This section provides an overview of the most likely to be used C-language functions. This list is not all inclusive.
Get an entity from a Datum.
Ent * bltin_get_ent ( Datum arg[] )
bltin_get_ent
returns the entity, or creates a new one if
necessary, from the Datum arg. bltin_get_ent
is most
often used to extract argument entities from the argument Datum
array. For example: bltin_get_ent(args[2])
will return the
argument entity associated with the third argument to the builtin
function.
Destroy an entity if possible.
void ent_Clean ( Ent *entity )
If possible, clean (destroy/free) the entity,
entity. ent_Clean
must always be used for this
purpose, since a reference counting scheme is used to allow more
than one variable point to the same entity.
Given an entity, return a double value via the class interface.
double class_double ( Ent *entity )
class_double
uses Rlab's class-interface to get a double
value from an arbitrary entity. If the class that
entity belongs to does not support this operation, an error
message is generated, and program control returns to the
interpreter.
Given an entity, return a character pointer via the class interface.
char * class_char_pointer ( Ent *entity )
class_char_pointer
uses Rlab's class-interface to get a
character pointer from an arbitrary entity. If the class that
entity belongs to does not support this operation, an error
message is generated, and program control returns to the
interpreter.
Given an entity, return a full-real-matrix via the class interface.
MDR * class_matrix_real ( Ent *entity )
class_matrix_real
uses Rlab's class-interface to get a
pointer to a Matrix-Dense-Real (MDR) from an arbitrary
entity. If the class that entity belongs to does not
support this operation, an error message is generated, and program
control returns to the interpreter.
The user must not destroy, or change the matrix in any
way. The returned matrix should be treated as read-only! If you must
modify the matrix, use mdr_Copy
to generate a copy of the
matrix.
Get a new, or existing file-descriptor.
FILE * get_file_ds ( char *name, char *mode, int buffsize )
Get the file-descriptor associated with the character string name. If the file-descriptor already exists (Rlab keeps track of them), then the existing descriptor is returned. Otherwise, a new file-descriptor is returned. The new file is opened with mode mode, and buffersize buffsize. If buffsize is zero, then the system's default buffersize is used.
Close the named file-descriptor.
int close_file_ds ( char *name )
Close the file-descriptor associated with name.