Atoms are arbitary values.
Set atom values | |
void | fts_set_void (fts_atom_t *atom) |
Set atom value to void. | |
void | fts_set_int (fts_atom_t *atom, int value) |
Set atom value to given int. | |
void | fts_set_float (fts_atom_t *atom, float value) |
Set atom value to given float. | |
void | fts_set_symbol (fts_atom_t *atom, fts_symbol_t sym) |
Set atom value to given symbol. | |
void | fts_set_object (fts_atom_t *atom, fts_object_t *obj) |
Set atom value to given FTS object (reference). | |
void | fts_set_pointer (fts_atom_t *atom, void *ptr) |
Set atom value to given pointer. | |
void | fts_set_string (fts_atom_t *atom, char *string) |
Set atom value to given string. | |
Get atom values | |
int | fts_get_int (const fts_atom_t *atom) |
Get int from given atom. | |
float | fts_get_float (const fts_atom_t *atom) |
Get float from given atom. | |
int | fts_get_number_int (const fts_atom_t *atom) |
Get int from given atom. | |
float | fts_get_number_float (const fts_atom_t *atom) |
Get float from given atom. | |
fts_symbol_t | fts_get_symbol (const fts_atom_t *atom) |
Get symbol from given atom. | |
fts_object_t * | fts_get_object (const fts_atom_t *atom) |
Get object from given atom. | |
void * | fts_get_pointer (const fts_atom_t *atom) |
Get pointer from given atom. | |
char * | fts_get_string (const fts_atom_t *atom) |
Get string from given atom. | |
Get and test atom type/class | |
int | fts_is_void (const fts_atom_t *atom) |
Tests whether the given atom contains a void value. | |
int | fts_is_int (const fts_atom_t *atom) |
Tests whether the given atom contains a int value. | |
int | fts_is_float (const fts_atom_t *atom) |
Tests whether the given atom contains a float value. | |
int | fts_is_number (const fts_atom_t *atom) |
Tests whether the given atom contains a number value. | |
int | fts_is_symbol (const fts_atom_t *atom) |
Tests whether the given atom contains a symbol value. | |
int | fts_is_object (const fts_atom_t *atom) |
Tests whether the given atom contains an fts_object value. | |
int | fts_is_pointer (const fts_atom_t *atom) |
Tests whether the given atom contains a pointer value. | |
int | fts_is_string (const fts_atom_t *atom) |
Tests whether the given atom contains a string value. | |
fts_class_t * | fts_get_class (const fts_atom_t *atom) |
Get FTS class of the atom value. | |
fts_symbol_t | fts_get_class_name (const fts_atom_t *atom) |
Get FTS class name of the atom value. | |
int | fts_get_class_id (const fts_atom_t *atom) |
Get FTS class id of the atom value. | |
int | fts_is_a (const fts_atom_t *atom, fts_class_t *type) |
Tests whether the atom value is of the given type (FTS class). | |
Misc atom functions | |
void | fts_atom_void (const fts_atom_t *p) |
Sets atom value to void (releases FTS object reference). | |
void | fts_atom_refer (const fts_atom_t *atom) |
Adds reference to atom of FTS object reference. | |
void | fts_atom_release (const fts_atom_t *atom) |
Release reference to atom of FTS object reference. | |
void | fts_atom_assign (const fts_atom_t *dest, const fts_atom_t *src) |
Assign the value of one atom to another. | |
FTS_API void | fts_atom_copy (const fts_atom_t *from, fts_atom_t *to) |
Copies atom value or object (not just reference) from one atom to another. | |
int | fts_atom_same_type (const fts_atom_t *atom1, const fts_atom_t *atom2) |
Tests whether two atoms values are of the same type (class). | |
FTS_API int | fts_atom_identical (const fts_atom_t *atom1, const fts_atom_t *atom2) |
Tests whether two atoms values have identical values. | |
FTS_API int | fts_atom_equals (const fts_atom_t *atom1, const fts_atom_t *atom2) |
Tests whether two atoms have equal values. | |
FTS_API int | fts_atom_compare (const fts_atom_t *atom1, const fts_atom_t *atom2) |
Compares atoms of number, symbol, and FTS objects (compares the references). | |
Variables | |
FTS_API fts_atom_t * | fts_null |
Constant representing a 'void' atom. | |
FTS_API fts_atom_t * | fts_zero |
Constant representing an int 0 (zero) atom. | |
FTS_API fts_atom_t * | fts_nix |
Constant representing a useless dummy atom for various occasions (might change to any value). |
void fts_atom_assign | ( | const fts_atom_t * | dest, | |
const fts_atom_t * | src | |||
) |
Assign the value of one atom to another.
Assigns src atom value to dest atom (handles references to FTS object). For atoms containing FTS objects only the reference is copied. The function properly handles references to FTS objects and requires initialized atoms.
dest | destination atom pointer | |
src | source atom pointer |
FTS_API int fts_atom_compare | ( | const fts_atom_t * | atom1, | |
const fts_atom_t * | atom2 | |||
) |
Compares atoms of number, symbol, and FTS objects (compares the references).
atom1 | pointer to atom | |
atom2 | pointer to atom |
FTS_API void fts_atom_copy | ( | const fts_atom_t * | from, | |
fts_atom_t * | to | |||
) |
Copies atom value or object (not just reference) from one atom to another.
For FTM objects the copy function of the class is used. The function properly handles references to FTS objects and requires initialized atoms.
from | pointer to original atom | |
to | pointer to destination atom |
FTS_API int fts_atom_equals | ( | const fts_atom_t * | atom1, | |
const fts_atom_t * | atom2 | |||
) |
Tests whether two atoms have equal values.
For atoms containing FTS objects the class dependent comparison function is used.
atom1 | first atom | |
atom2 | second atom |
FTS_API int fts_atom_identical | ( | const fts_atom_t * | atom1, | |
const fts_atom_t * | atom2 | |||
) |
Tests whether two atoms values have identical values.
For atoms containing FTS objects only the references are compared.
atom1 | first atom | |
atom2 | second atom |
void fts_atom_refer | ( | const fts_atom_t * | atom | ) |
Adds reference to atom of FTS object reference.
Has no effect for primitive atom values.
atom | atom pointer |
void fts_atom_release | ( | const fts_atom_t * | atom | ) |
Release reference to atom of FTS object reference.
Has no effect for primitive atom values.
atom | atom pointer |
int fts_atom_same_type | ( | const fts_atom_t * | atom1, | |
const fts_atom_t * | atom2 | |||
) |
Tests whether two atoms values are of the same type (class).
atom1 | pointer to an atom | |
atom2 | another pointer to an atom |
void fts_atom_void | ( | const fts_atom_t * | p | ) |
Sets atom value to void (releases FTS object reference).
p | atom pointer |
fts_class_t* fts_get_class | ( | const fts_atom_t * | atom | ) |
Get FTS class of the atom value.
atom | pointer to the atom |
int fts_get_class_id | ( | const fts_atom_t * | atom | ) |
Get FTS class id of the atom value.
atom | pointer to the atom |
fts_symbol_t fts_get_class_name | ( | const fts_atom_t * | atom | ) |
Get FTS class name of the atom value.
atom | pointer to the atom |
float fts_get_float | ( | const fts_atom_t * | atom | ) |
Get float from given atom.
atom | pointer to the atom |
int fts_get_int | ( | const fts_atom_t * | atom | ) |
Get int from given atom.
atom | pointer to the atom |
float fts_get_number_float | ( | const fts_atom_t * | atom | ) |
Get float from given atom.
atom | pointer to the atom |
int fts_get_number_int | ( | const fts_atom_t * | atom | ) |
Get int from given atom.
atom | pointer to the atom |
fts_object_t* fts_get_object | ( | const fts_atom_t * | atom | ) |
Get object from given atom.
atom | pointer to the atom |
void* fts_get_pointer | ( | const fts_atom_t * | atom | ) |
Get pointer from given atom.
atom | pointer to the atom |
char* fts_get_string | ( | const fts_atom_t * | atom | ) |
Get string from given atom.
atom | pointer to the atom |
fts_symbol_t fts_get_symbol | ( | const fts_atom_t * | atom | ) |
Get symbol from given atom.
atom | pointer to the atom |
int fts_is_a | ( | const fts_atom_t * | atom, | |
fts_class_t * | type | |||
) |
Tests whether the atom value is of the given type (FTS class).
atom | pointer to the atom | |
type | pointer to FTS class |
int fts_is_float | ( | const fts_atom_t * | atom | ) |
Tests whether the given atom contains a float value.
atom | pointer to the atom |
int fts_is_int | ( | const fts_atom_t * | atom | ) |
Tests whether the given atom contains a int value.
atom | pointer to the atom |
int fts_is_number | ( | const fts_atom_t * | atom | ) |
Tests whether the given atom contains a number value.
atom | pointer to the atom |
int fts_is_object | ( | const fts_atom_t * | atom | ) |
Tests whether the given atom contains an fts_object value.
atom | pointer to the atom |
int fts_is_pointer | ( | const fts_atom_t * | atom | ) |
Tests whether the given atom contains a pointer value.
atom | pointer to the atom |
int fts_is_string | ( | const fts_atom_t * | atom | ) |
Tests whether the given atom contains a string value.
atom | pointer to the atom |
int fts_is_symbol | ( | const fts_atom_t * | atom | ) |
Tests whether the given atom contains a symbol value.
atom | pointer to the atom |
int fts_is_void | ( | const fts_atom_t * | atom | ) |
Tests whether the given atom contains a void value.
atom | pointer to the atom |
void fts_set_float | ( | fts_atom_t * | atom, | |
float | value | |||
) |
Set atom value to given float.
atom | pointer to the atom | |
value | float value |
void fts_set_int | ( | fts_atom_t * | atom, | |
int | value | |||
) |
Set atom value to given int.
atom | pointer to the atom | |
value | int value |
void fts_set_object | ( | fts_atom_t * | atom, | |
fts_object_t * | obj | |||
) |
Set atom value to given FTS object (reference).
atom | pointer to the atom | |
obj | FTS object value |
void fts_set_pointer | ( | fts_atom_t * | atom, | |
void * | ptr | |||
) |
Set atom value to given pointer.
atom | pointer to the atom | |
ptr | pointer value |
void fts_set_string | ( | fts_atom_t * | atom, | |
char * | string | |||
) |
Set atom value to given string.
atom | pointer to the atom | |
string | string value |
void fts_set_symbol | ( | fts_atom_t * | atom, | |
fts_symbol_t | sym | |||
) |
Set atom value to given symbol.
atom | pointer to the atom | |
sym | symbol value |
void fts_set_void | ( | fts_atom_t * | atom | ) |
Set atom value to void.
atom | pointer to the atom |