diff options
Diffstat (limited to 'libsyscalls')
-rw-r--r-- | libsyscalls/advanced.h | 13 | ||||
-rw-r--r-- | libsyscalls/internal-begin.h | 76 | ||||
-rw-r--r-- | libsyscalls/internal-end.h | 21 |
3 files changed, 110 insertions, 0 deletions
diff --git a/libsyscalls/advanced.h b/libsyscalls/advanced.h new file mode 100644 index 0000000..22ed3d0 --- /dev/null +++ b/libsyscalls/advanced.h @@ -0,0 +1,13 @@ +/* See LICENSE file for copyright and license details. */ +#ifndef LIBSYSCALLS_H +# error Do not include this header file directly +#endif + + +#define LIBSYSCALLS_TYPEOFFSET_SPECIAL_TYPES 0 /* does not use LIBSYSCALLS_TYPEBITSMASK */ +#define LIBSYSCALLS_TYPEOFFSET_SPLIT_PRIMITIVES 8 +#define LIBSYSCALLS_TYPEOFFSET_COMPOSITE_PRIMITIVES 48 +#define LIBSYSCALLS_TYPEOFFSET_UNANNOTATED_NUMERICALS 64 +#define LIBSYSCALLS_TYPEOFFSET_ANNOTATED_NUMERICALS 256 +#define LIBSYSCALLS_TYPEOFFSET_FIXED_ARRAYS 512 +#define LIBSYSCALLS_TYPEOFFSET_STRUCTS_AND_UNIONS 1024 diff --git a/libsyscalls/internal-begin.h b/libsyscalls/internal-begin.h new file mode 100644 index 0000000..9741632 --- /dev/null +++ b/libsyscalls/internal-begin.h @@ -0,0 +1,76 @@ +/* See LICENSE file for copyright and license details. */ +#ifndef LIBSYSCALLS_H +# error Do not include this header file directly +#endif + + +#include <limits.h> +#include <stddef.h> + +/* a comma possible into a macro */ +#define LIBSYSCALLS_COMMA_ , + +/* used to make flexible arrays non-flexible if required for static instantiation */ +#ifndef LIBSYSCALLS_FLEXABLE_OR_NPARAMS_ +# define LIBSYSCALLS_FLEXABLE_OR_NPARAMS_ +#endif + +#if defined(__GNUC__) +# define LIBSYSCALLS_GCC_ATTRIBUTES_(...) __attribute__((__VA_ARGS__)) +#else +# define LIBSYSCALLS_GCC_ATTRIBUTES_(...) +#endif + +#define LIBSYSCALLS_PAD_(WANT, HAVE) (((WANT) - (HAVE) % (WANT)) % (WANT)) + + +/** + * Opaque type for symbol printer function identification + */ +typedef unsigned short int LIBSYSCALLS_SYMBOL_PRINTER; + +/** + * Opaque type for symbol printer function parameters + */ +typedef struct libsyscalls_symbol_printer_data LIBSYSCALLS_SYMBOL_PRINTER_DATA; + + +#define LIBSYSCALLS_LIST_ERRORS_X_(ENUM, STR) ENUM + +#define LIBSYSCALLS_DATATYPE_X_(NAME, ASSIGNMENT, ...) NAME ASSIGNMENT + +#define LIBSYSCALLS_TYPEBITS LIBSYSCALLS_TYPEBITS_SCALAR + +#define LIBSYSCALLS_MAKE_SPECIAL_TYPES_()\ + LIBSYSCALLS_LIST_SPECIAL_TYPES(LIBSYSCALLS_DATATYPE_X_,, LIBSYSCALLS_COMMA_,\ + = LIBSYSCALLS_TYPEOFFSET_SPECIAL_TYPES) + +#define LIBSYSCALLS_MAKE_SPLIT_PRIMITIVES_(SUFFIX)\ + LIBSYSCALLS_LIST_SPLIT_PRIMITIVES(LIBSYSCALLS_DATATYPE_X_, SUFFIX, LIBSYSCALLS_COMMA_,\ + = LIBSYSCALLS_TYPEOFFSET_SPLIT_PRIMITIVES\ + | LIBSYSCALLS_TYPEBITS##SUFFIX) + +#define LIBSYSCALLS_MAKE_COMPOSITE_PRIMITIVES_(SUFFIX)\ + LIBSYSCALLS_LIST_COMPOSITE_PRIMITIVES(LIBSYSCALLS_DATATYPE_X_, SUFFIX, LIBSYSCALLS_COMMA_,\ + = LIBSYSCALLS_TYPEOFFSET_COMPOSITE_PRIMITIVES\ + | LIBSYSCALLS_TYPEBITS##SUFFIX) + +#define LIBSYSCALLS_MAKE_UNANNOTATED_NUMERICALS_(SUFFIX)\ + LIBSYSCALLS_LIST_UNANNOTATED_NUMERICALS(LIBSYSCALLS_DATATYPE_X_, SUFFIX, LIBSYSCALLS_COMMA_,\ + = LIBSYSCALLS_TYPEOFFSET_UNANNOTATED_NUMERICALS\ + | LIBSYSCALLS_TYPEBITS##SUFFIX) + +#define LIBSYSCALLS_MAKE_ANNOTATED_NUMERICALS_(SUFFIX)\ + LIBSYSCALLS_LIST_ANNOTATED_NUMERICALS(LIBSYSCALLS_DATATYPE_X_, SUFFIX, LIBSYSCALLS_COMMA_,\ + = LIBSYSCALLS_TYPEOFFSET_ANNOTATED_NUMERICALS\ + | LIBSYSCALLS_TYPEBITS##SUFFIX) + +#define LIBSYSCALLS_MAKE_STRUCTS_AND_UNIONS_(SUFFIX)\ + LIBSYSCALLS_LIST_STRUCTS_AND_UNIONS(LIBSYSCALLS_DATATYPE_X_, SUFFIX, LIBSYSCALLS_COMMA_,\ + = LIBSYSCALLS_TYPEOFFSET_STRUCTS_AND_UNIONS\ + | LIBSYSCALLS_TYPEBITS##SUFFIX) + +#define LIBSYSCALLS_MAKE_FIXED_ARRAYS_(SUFFIX)\ + LIBSYSCALLS_LIST_FIXED_ARRAYS(LIBSYSCALLS_DATATYPE_X_, SUFFIX, LIBSYSCALLS_COMMA_,\ + = LIBSYSCALLS_TYPEOFFSET_FIXED_ARRAYS\ + | LIBSYSCALLS_TYPEBITS##SUFFIX) diff --git a/libsyscalls/internal-end.h b/libsyscalls/internal-end.h new file mode 100644 index 0000000..ed7af58 --- /dev/null +++ b/libsyscalls/internal-end.h @@ -0,0 +1,21 @@ +/* See LICENSE file for copyright and license details. */ +#ifndef LIBSYSCALLS_H +# error Do not include this header file directly +#endif + + +#undef LIBSYSCALLS_COMMA_ +#undef LIBSYSCALLS_FLEXABLE_OR_NPARAMS_ +#undef LIBSYSCALLS_GCC_ATTRIBUTES_ +#undef LIBSYSCALLS_PAD_ + +#undef LIBSYSCALLS_LIST_ERRORS_X_ +#undef LIBSYSCALLS_DATATYPE_X_ +#undef LIBSYSCALLS_TYPEBITS +#undef LIBSYSCALLS_MAKE_SPECIAL_TYPES_ +#undef LIBSYSCALLS_MAKE_SPLIT_PRIMITIVES_ +#undef LIBSYSCALLS_MAKE_COMPOSITE_PRIMITIVES_ +#undef LIBSYSCALLS_MAKE_UNANNOTATED_NUMERICALS_ +#undef LIBSYSCALLS_MAKE_ANNOTATED_NUMERICALS_ +#undef LIBSYSCALLS_MAKE_STRUCTS_AND_UNIONS_ +#undef LIBSYSCALLS_MAKE_FIXED_ARRAYS_ |