|
x-engine-c v0.2.13
The C engine for x-lang
|
String type implementation. More...
#include "x-eval.h"#include "x-type/str.h"#include "x-token/sexp/str.h"#include "x-type/char.h"#include "x-type/int.h"Functions | |
| x_obj_t * | x_make_str (x_obj_t *p_base, x_obj_flag_t flags, x_char_t *s) |
| x_obj_t * | x_type_str_save (x_obj_t *p_base, x_obj_t *p_args) |
| x_obj_t * | x_type_str_struct (x_obj_t *p_base, x_obj_t *p_obj) |
| x_obj_t * | x_type_str_register (x_obj_t *p_base, x_obj_t *p_args) |
| x_obj_t * | x_type_str_make (x_obj_t *p_base, x_obj_t *p_args) |
| x_obj_t * | x_type_str_length (x_obj_t *p_base, x_obj_t *p_args) |
| x_obj_t * | x_type_str_call (x_obj_t *p_base, x_obj_t *p_args) |
String type implementation.
| x_obj_t * x_make_str | ( | x_obj_t * | p_base, |
| x_obj_flag_t | flags, | ||
| x_char_t * | s | ||
| ) |
Allocate a heap string object wrapping a C string pointer.
Builds a stack-based argument list and delegates to x_type_str_make.
| p_base | x_obj_t* – Base (execution context) |
| flags | x_obj_flag_t – Object flags (e.g. X_OBJ_FLAG_OWN) |
| s | x_char_t* – C string pointer to wrap |
Type-system call callback – string as callable.
Supports three calling conventions:
| p_base | x_obj_t* – Base (execution context) |
| p_args | x_obj_t* – (string-object . evaluated-args) |
Type-system length callback – returns string length as an integer.
| p_base | x_obj_t* – Base (execution context) |
| p_args | x_obj_t* – (string-object . ...) |
Type-system make callback for string objects.
Extracts the string pointer 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* – (str-value . (flags | nil)) |
Register or retrieve the string type on the base context.
| p_base | x_obj_t* – Base (execution context) |
| p_args | x_obj_t* – Unused |
Build the string type descriptor struct.
Populates name, length, make, call, analyse, read, write, and display callbacks.
| p_base | x_obj_t* – Base (execution context) |
| p_obj | x_obj_t* – Unused |
Build the string type descriptor struct.
| x_satom_t x_type_str_call_prim = x_obj_set(x_type_atom_obj, X_OBJ_FLAG_NONE, { (x_obj_t *)&x_type_str_call }) |
| x_satom_t x_type_str_length_prim = x_obj_set(x_type_atom_obj, X_OBJ_FLAG_NONE, { (x_obj_t *)&x_type_str_length }) |
| x_satom_t x_type_str_make_prim = x_obj_set(x_type_atom_obj, X_OBJ_FLAG_NONE, { (x_obj_t *)&x_type_str_make }) |
| x_satom_t x_type_str_name = x_obj_set(x_type_atom_obj, X_OBJ_FLAG_NONE, { .s = (x_char_t *)X_TYPE_STR_NAME }) |
| x_satom_t x_type_str_save_prim = x_obj_set(x_type_atom_obj, X_OBJ_FLAG_NONE, { (x_obj_t *)&x_type_str_save }) |
| x_satom_t x_type_str_struct_prim = x_obj_set(x_type_atom_obj, X_OBJ_FLAG_NONE, { (x_obj_t *)&x_type_str_struct }) |