Here's a copy paste of relevant areas of code.
Code:
#define ZIC signed char
#define ZUC unsigned char
#define ZIS signed short
#define ZUS unsigned short
#define ZI signed int
#define ZU unsigned int
#define ZIL signed long
#define ZUL unsigned long
typedef bool zb_t;
typedef ZIC zic_t;
typedef ZUC zuc_t;
typedef ZIS zis_t;
typedef ZUS zus_t;
typedef ZI zi_t;
typedef ZU zu_t;
typedef ZIL zil_t;
typedef ZUL zul_t;
// ...
typedef struct ZUV {
zus_t size;
zul_t bits;
char const *endian;
zuc_t *buff;
} zuv_t;
// ...
void _zuvMax( zuv_t *num, zuc_t *max, zuc_t *end, zus_t *pos ) {
zul_t bits = num->bits % CHAR_BIT;
*pos = num->size - 1;
*end = num->buff[pos];
*max = ~(UCHAR_MAX << bits);
}