Macros | |
#define | QFOSTR(q, s) QFO_GETSTR (q, s) |
#define | QFOTYPE(t) |
#define | REF(r) (work->spaces[(r)->space].defs + (r)->def) |
Retreive a def from a defref. More... | |
#define | WORKSTR(s) QFOSTR (work, s) |
#define | WORKTYPE(t) |
Typedefs | |
typedef struct builtin_sym_s | builtin_sym_t |
typedef struct defref_s | defref_t |
Safe handling of defs in hash tables and other containers. More... | |
typedef struct path_s | path_t |
typedef int(* | space_func )(qfo_t *qfo, qfo_mspace_t *space, int pass) |
Functions | |
void | linker_add_def (const char *name, type_t *type, unsigned flags, void *val) |
int | linker_add_lib (const char *libname) |
int | linker_add_object_file (const char *filename) |
void | linker_add_path (const char *path) |
int | linker_add_qfo (qfo_t *qfo) |
int | linker_add_string (const char *str) |
Add a string to the working qfo string pool. More... | |
void | linker_begin (void) |
Initialize the linker state. More... | |
qfo_def_t * | linker_find_def (const char *name) |
qfo_t * | linker_finish (void) |
#define QFOSTR | ( | q, | |
s | |||
) | QFO_GETSTR (q, s) |
#define QFOTYPE | ( | t | ) |
Retreive a def from a defref.
r | The defref pointing to the def (defref_t *). |
#define WORKSTR | ( | s | ) | QFOSTR (work, s) |
#define WORKTYPE | ( | t | ) |
typedef struct builtin_sym_s builtin_sym_t |
typedef struct defref_s defref_t |
Safe handling of defs in hash tables and other containers.
As defs are stored in dynamic arrays, storing pointers to the defs is a recipe for disaster when using realloc(). By storing the address of the pointer to the array and the index into that that array, realloc is allowed to do its magic.
typedef struct path_s path_t |
typedef int(* space_func)(qfo_t *qfo, qfo_mspace_t *space, int pass) |
void linker_add_path | ( | const char * | path | ) |
Add a string to the working qfo string pool.
If the string is already in the string pool, the already existing string index will be returned instead of adding a second copy of the string.
The strings space in the working qfo is kept up to date.
str | The string to add. |
void linker_begin | ( | void | ) |
Initialize the linker state.
qfo_t* linker_finish | ( | void | ) |