Next Previous Contents

9. Programmer's Interface

This section provides an overview of the most likely to be used C-language functions. This list is not all inclusive.

9.1 bltin_get_ent

Synopsis

Get an entity from a Datum.

Syntax

Ent * bltin_get_ent ( Datum arg[] )

Description

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.

9.2 ent_Clean

Synopsis

Destroy an entity if possible.

Syntax

void ent_Clean ( Ent *entity )

Description

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.

9.3 class_double

Synopsis

Given an entity, return a double value via the class interface.

Syntax

double class_double ( Ent *entity )

Description

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.

9.4 class_char_pointer

Synopsis

Given an entity, return a character pointer via the class interface.

Syntax

char * class_char_pointer ( Ent *entity )

Description

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.

9.5 class_matrix_real

Synopsis

Given an entity, return a full-real-matrix via the class interface.

Syntax

MDR * class_matrix_real ( Ent *entity )

Description

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.

9.6 get_file_ds

Synopsis

Get a new, or existing file-descriptor.

Syntax

FILE * get_file_ds ( char *name, char *mode, int buffsize )

Description

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.

9.7 close_file_ds

Synopsis

Close the named file-descriptor.

Syntax

int close_file_ds ( char *name )

Description

Close the file-descriptor associated with name.


Next Previous Contents