|
#define | YASM_LIB_DECL |
|
#define | yasm__splitpath(path, tail) yasm__splitpath_unix(path, tail) |
| Split a pathname into head (directory) and tail (base filename) portions. More...
|
|
#define | yasm__combpath(from, to) yasm__combpath_unix(from, to) |
| Build a pathname that is equivalent to accessing the "to" pathname when you're in the directory containing "from". More...
|
|
#define | yasm__createpath(path) yasm__createpath_common(path, 0) |
| Recursively create tree of directories needed for pathname. More...
|
|
#define | YASM_WRITE_8(ptr, val) *((ptr)++) = (unsigned char)((val) & 0xFF) |
| Write an 8-bit value to a buffer, incrementing buffer pointer. More...
|
|
#define | YASM_WRITE_16_L(ptr, val) |
| Write a 16-bit value to a buffer in little endian, incrementing buffer pointer. More...
|
|
#define | YASM_WRITE_32_L(ptr, val) |
| Write a 32-bit value to a buffer in little endian, incrementing buffer pointer. More...
|
|
#define | YASM_WRITE_16_B(ptr, val) |
| Write a 16-bit value to a buffer in big endian, incrementing buffer pointer. More...
|
|
#define | YASM_WRITE_32_B(ptr, val) |
| Write a 32-bit value to a buffer in big endian, incrementing buffer pointer. More...
|
|
#define | YASM_SAVE_8(ptr, val) *(ptr) = (unsigned char)((val) & 0xFF) |
| Write an 8-bit value to a buffer. More...
|
|
#define | YASM_SAVE_16_L(ptr, val) |
| Write a 16-bit value to a buffer in little endian. More...
|
|
#define | YASM_SAVE_32_L(ptr, val) |
| Write a 32-bit value to a buffer in little endian. More...
|
|
#define | YASM_SAVE_16_B(ptr, val) |
| Write a 16-bit value to a buffer in big endian. More...
|
|
#define | YASM_SAVE_32_B(ptr, val) |
| Write a 32-bit value to a buffer in big endian. More...
|
|
#define | YASM_READ_8(val, ptr) (val) = *((ptr)++) & 0xFF |
| Read an 8-bit value from a buffer, incrementing buffer pointer. More...
|
|
#define | YASM_READ_16_L(val, ptr) |
| Read a 16-bit value from a buffer in little endian, incrementing buffer pointer. More...
|
|
#define | YASM_READ_32_L(val, ptr) |
| Read a 32-bit value from a buffer in little endian, incrementing buffer pointer. More...
|
|
#define | YASM_READ_16_B(val, ptr) |
| Read a 16-bit value from a buffer in big endian, incrementing buffer pointer. More...
|
|
#define | YASM_READ_32_B(val, ptr) |
| Read a 32-bit value from a buffer in big endian, incrementing buffer pointer. More...
|
|
#define | YASM_LOAD_8(val, ptr) (val) = *(ptr) & 0xFF |
| Read an 8-bit value from a buffer. More...
|
|
#define | YASM_LOAD_16_L(val, ptr) |
| Read a 16-bit value from a buffer in little endian. More...
|
|
#define | YASM_LOAD_32_L(val, ptr) |
| Read a 32-bit value from a buffer in little endian. More...
|
|
#define | YASM_LOAD_16_B(val, ptr) |
| Read a 16-bit value from a buffer in big endian. More...
|
|
#define | YASM_LOAD_32_B(val, ptr) |
| Read a 32-bit value from a buffer in big endian. More...
|
|
|
YASM_LIB_DECL void | yasm_scanner_initialize (yasm_scanner *scanner) |
| Initialize scanner state. More...
|
|
YASM_LIB_DECL void | yasm_scanner_delete (yasm_scanner *scanner) |
| Frees any memory used by scanner state; does not free state itself. More...
|
|
YASM_LIB_DECL int | yasm_fill_helper (yasm_scanner *scanner, unsigned char **cursor, size_t(*input_func)(void *d, unsigned char *buf, size_t max), void *input_func_data) |
| Fill a scanner state structure with data coming from an input function. More...
|
|
YASM_LIB_DECL void | yasm_unescape_cstring (unsigned char *str, size_t *len) |
| Unescape a string with C-style escapes. More...
|
|
YASM_LIB_DECL size_t | yasm__splitpath_unix (const char *path, const char **tail) |
| Split a UNIX pathname into head (directory) and tail (base filename) portions. More...
|
|
YASM_LIB_DECL size_t | yasm__splitpath_win (const char *path, const char **tail) |
| Split a Windows pathname into head (directory) and tail (base filename) portions. More...
|
|
YASM_LIB_DECL char * | yasm__getcwd (void) |
| Get the current working directory. More...
|
|
YASM_LIB_DECL char * | yasm__abspath (const char *path) |
| Convert a relative or absolute pathname into an absolute pathname. More...
|
|
YASM_LIB_DECL char * | yasm__combpath_unix (const char *from, const char *to) |
| Build a UNIX pathname that is equivalent to accessing the "to" pathname when you're in the directory containing "from". More...
|
|
YASM_LIB_DECL char * | yasm__combpath_win (const char *from, const char *to) |
| Build a Windows pathname that is equivalent to accessing the "to" pathname when you're in the directory containing "from". More...
|
|
YASM_LIB_DECL size_t | yasm__createpath_common (const char *path, int win) |
| Recursively create tree of directories needed for pathname. More...
|
|
YASM_LIB_DECL FILE * | yasm_fopen_include (const char *iname, const char *from, const char *mode, char **oname) |
| Try to find and open an include file, searching through include paths. More...
|
|
YASM_LIB_DECL void | yasm_delete_include_paths (void) |
| Delete any stored include paths added by yasm_add_include_path().
|
|
YASM_LIB_DECL const char * | yasm_get_include_dir (void **iter) |
| Iterate through include paths.
|
|
YASM_LIB_DECL void | yasm_add_include_path (const char *path) |
| Add an include path for use by yasm_fopen_include(). More...
|
|
YASM_LIB_DECL size_t | yasm_fwrite_16_l (unsigned short val, FILE *f) |
| Direct-to-file version of YASM_SAVE_16_L(). More...
|
|
YASM_LIB_DECL size_t | yasm_fwrite_32_l (unsigned long val, FILE *f) |
| Direct-to-file version of YASM_SAVE_32_L(). More...
|
|
YASM_LIB_DECL size_t | yasm_fwrite_16_b (unsigned short val, FILE *f) |
| Direct-to-file version of YASM_SAVE_16_B(). More...
|
|
YASM_LIB_DECL size_t | yasm_fwrite_32_b (unsigned long val, FILE *f) |
| Direct-to-file version of YASM_SAVE_32_B(). More...
|
|
YASM file helpers.
Definition in file file.h.
YASM_LIB_DECL FILE* yasm_fopen_include |
( |
const char * |
iname, |
|
|
const char * |
from, |
|
|
const char * |
mode, |
|
|
char ** |
oname |
|
) |
| |
Try to find and open an include file, searching through include paths.
First iname is looked for relative to the directory containing "from", then it's looked for relative to each of the include paths.
All pathnames may be either absolute or relative; from, oname, and include paths, if relative, are relative from the current working directory.
First match wins; the full pathname (newly allocated) to the opened file is saved into oname, and the fopen'ed FILE * is returned. If not found, NULL is returned.
- Parameters
-
iname | file to include |
from | file doing the including |
mode | fopen mode string |
oname | full pathname of included file (may be relative). NULL may be passed if this is unwanted. |
- Returns
- fopen'ed include file, or NULL if not found.
YASM_LIB_DECL void yasm_unescape_cstring |
( |
unsigned char * |
str, |
|
|
size_t * |
len |
|
) |
| |
Unescape a string with C-style escapes.
Handles b, f, n, r, t, and hex and octal escapes. String is updated in-place. Edge cases:
- hex escapes: reads as many hex digits as possible, takes last 2 as value.
- oct escapes: takes up to 3 digits 0-9 and scales appropriately, with warning.
- Parameters
-
str | C-style string (updated in place) |
len | length of string (updated with new length) |