|
x-engine-c v0.2.13
The C engine for x-lang
|
Core definitions for computational expressions. More...
#include <stdarg.h>Go to the source code of this file.
Macros | |
Constants | |
| #define | X_VERSION "0.1.0" |
| #define | X_MACHINE "undefined" |
| #define | X_ARCH "undefined" |
Debug Utilities | |
| #define | x_debug_va(fd, fmt, ap) {} |
| #define | x_debug(fd, fmt, ...) {} |
Functions | |
| void | x_error (int fd, x_char_t *message, x_char_t *p_text) |
Basic Types | |
| #define | X_INT_STR_PRINTF_CONV "l" |
| #define | X_INT_CHAR_PRINTF_CONV "c" |
| #define | X_STR_LITERAL(s) (x_char_t *)(s), (sizeof(s) - 1) |
| typedef long | x_int_t |
| typedef char | x_assert_int_ptr_size[sizeof(x_int_t)==sizeof(void *) ? 1 :-1] |
| typedef char | x_char_t |
Core definitions for computational expressions.
Provides fundamental types, architecture detection, debug utilities, and error handling for the x-expr library.
Compile-time toggles (disabled by default, define on the compiler command line or uncomment below):
., .,
{O,O}
( )
" "
| #define X_ARCH "undefined" |
The C compiler's target CPU architecture as a string literal.
Determined by probing compiler predefined macros for known architecture values. Resolves to one of: "alpha", "amd64", "arm", "arm64", "blackfin", "convex", "epiphany", "pa_risc", "x86", "ia64", "m68k", "mips", "powerpc", "pyramid9810", "rs6000", "sparc", "superh", "systemz", "tms320", "tms470", or "undefined".
Adapted from https://sourceforge.net/p/predef/wiki/Architectures/
| #define x_debug | ( | fd, | |
| fmt, | |||
| ... | |||
| ) | {} |
| #define x_debug_va | ( | fd, | |
| fmt, | |||
| ap | |||
| ) | {} |
| #define X_INT_CHAR_PRINTF_CONV "c" |
Printf conversion specifier for x_char_t values.
| #define X_INT_STR_PRINTF_CONV "l" |
Printf length modifier for x_int_t values (e.g. "l" for long).
| #define X_MACHINE "undefined" |
The C compiler's target machine identifier.
For example, i686-pc-linux-gnu. To override the default value of "undefined", pass a value to the C preprocessor via the command line. When supported by the compiler, this is typically the output of the -dumpmachine switch.
| #define X_STR_LITERAL | ( | s | ) | (x_char_t *)(s), (sizeof(s) - 1) |
Expand a string literal into a pointer and length pair.
Produces two arguments: a (x_char_t *) pointer and the string length (excluding the null terminator). Useful with x_sys_write().
| s | A string literal. |
| #define X_VERSION "0.1.0" |
The current version of the x-expr library.
Version numbering conforms to the Semantic Versioning specification.
| typedef char x_assert_int_ptr_size[sizeof(x_int_t)==sizeof(void *) ? 1 :-1] |
Compile-time assertion that x_int_t and pointers are the same size.
| typedef char x_char_t |
The character type used throughout x-expr.
| typedef long x_int_t |
The integer type used throughout x-expr. Sized to match pointer width.
Output an error message to a file descriptor.
Output an error message to a file descriptor.
Writes "*** ERROR: " followed by message. If p_text is non-NULL, appends ‘" ’"` and the context text.
| fd | File descriptor to write the error to. |
| message | A C string error message to output. |
| p_text | A C string with additional context, or NULL. |