|
x-engine-c v0.2.13
The C engine for x-lang
|
Integer type for the x-lang type system. More...
#include "x-type.h"Go to the source code of this file.
Macros | |
| #define | X_TYPE_INT_NAME "INTEGER" |
| #define | x_obj_type_isint(B, X) x_obj_is_type((B), (X), X_TYPE_INT_NAME) |
| #define | x_intval(X) x_firstint((X)) |
| #define | x_mkint(B, I) x_make_int((B), X_OBJ_FLAG_NONE, (I)) |
| #define | x_mkfint(B, F, I) x_make_int((B), (F), (I)) |
Functions | |
| x_obj_t * | x_make_int (x_obj_t *p_base, x_obj_flag_t flags, x_int_t i) |
| x_obj_t * | x_type_int_register (x_obj_t *p_base, x_obj_t *p_args) |
| x_obj_t * | x_type_int_struct (x_obj_t *p_base, x_obj_t *p_args) |
| x_obj_t * | x_type_int_make (x_obj_t *p_base, x_obj_t *p_args) |
Integer type for the x-lang type system.
| #define x_intval | ( | X | ) | x_firstint((X)) |
Extract the integer value from an integer object.
| #define x_mkfint | ( | B, | |
| F, | |||
| I | |||
| ) | x_make_int((B), (F), (I)) |
Make an integer with explicit flags F.
| #define x_mkint | ( | B, | |
| I | |||
| ) | x_make_int((B), X_OBJ_FLAG_NONE, (I)) |
Make an integer with default flags.
| #define x_obj_type_isint | ( | B, | |
| X | |||
| ) | x_obj_is_type((B), (X), X_TYPE_INT_NAME) |
Test whether object X is an integer on base B.
| #define X_TYPE_INT_NAME "INTEGER" |
Type-system symbol name
| x_obj_t * x_make_int | ( | x_obj_t * | p_base, |
| x_obj_flag_t | flags, | ||
| x_int_t | i | ||
| ) |
Allocate a heap integer object with value i.
Allocate a heap integer object with a given value.
Builds a stack-based argument list and delegates to x_type_int_make.
| p_base | x_obj_t* – Base (execution context) |
| flags | x_obj_flag_t – Object flags |
| i | x_int_t – Integer value |
Type-system make callback for integer.
Type-system make callback for integer objects.
Extracts the integer value and optional flags from p_args, then allocates a heap object via x_obj_make.
| p_base | x_obj_t* – Base (execution context) |
| p_args | x_obj_t* – (int-value . (flags | nil)) |
Register (or retrieve) the integer type struct on p_base.
Register or retrieve the integer type on the base context.
| p_base | x_obj_t* – Base (execution context) |
| p_args | x_obj_t* – Unused |