diff options
| author | Mattias Andrée <maandree@kth.se> | 2016-03-01 18:37:05 +0100 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2016-03-01 18:37:05 +0100 |
| commit | b0c1cae18066d0103a440894b5256939852021eb (patch) | |
| tree | b90f419aba218eedf1cc664c7269666306e6ccaf /src/internals.h | |
| parent | Add .gitignore (diff) | |
| download | libzahl-b0c1cae18066d0103a440894b5256939852021eb.tar.gz libzahl-b0c1cae18066d0103a440894b5256939852021eb.tar.bz2 libzahl-b0c1cae18066d0103a440894b5256939852021eb.tar.xz | |
Add zsetup, zunsetup, zinit, zfree, zswap, zsave, zload, zbits, and zlsb
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/internals.h')
| -rw-r--r-- | src/internals.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/internals.h b/src/internals.h new file mode 100644 index 0000000..ac74bd5 --- /dev/null +++ b/src/internals.h @@ -0,0 +1,30 @@ +/* See LICENSE file for copyright and license details. */ +#include "../zahl.h" + +#define BITS_PER_CHAR 32 +#define FLOOR_BITS_TO_CHARS(bits) ((bits) >> 5) +#define CEILING_BITS_TO_CHARS(bits) (((bits) + (BITS_PER_CHAR - 1)) >> 5) +#define BITS_IN_LAST_CHAR(bits) ((bits) & (BITS_PER_CHAR - 1)) + +#define LIST_TEMPS\ + X(libzahl_tmp_a)\ + X(libzahl_tmp_b)\ + X(libzahl_tmp_c)\ + X(libzahl_tmp_d)\ + X(libzahl_tmp_e)\ + X(libzahl_tmp_f)\ + X(libzahl_tmp_g)\ + X(libzahl_tmp_i)\ + X(libzahl_tmp_j)\ + X(libzahl_tmp_k)\ + X(libzahl_tmp_l)\ + X(libzahl_tmp_m) + +#define X(x) extern z_t x; +LIST_TEMPS +#undef X + +extern jmp_buf libzahl_jmp_buf; +extern int libzahl_set_up; + +#define FAILURE_JUMP() (longjmp(libzahl_jmp_buf, 1)) |
