Go to the documentation of this file.
61 #define CRAM_KEY(a,b) (((a)<<8)|((b)))
95 #define itf8_get(c,v) (((uc)(c)[0]<0x80)?(*(v)=(uc)(c)[0],1):(((uc)(c)[0]<0xc0)?(*(v)=(((uc)(c)[0]<<8)|(uc)(c)[1])&0x3fff,2):(((uc)(c)[0]<0xe0)?(*(v)=(((uc)(c)[0]<<16)|((uc)(c)[1]<<8)|(uc)(c)[2])&0x1fffff,3):(((uc)(c)[0]<0xf0)?(*(v)=(((uc)(c)[0]<<24)|((uc)(c)[1]<<16)|((uc)(c)[2]<<8)|(uc)(c)[3])&0x0fffffff,4):(*(v)=(((uc)(c)[0]&0x0f)<<28)|((uc)(c)[1]<<20)|((uc)(c)[2]<<12)|((uc)(c)[3]<<4)|((uc)(c)[4]&0x0f),5)))))
97 #define itf8_put(c,v) ((!((v)&~0x7f))?((c)[0]=(v),1):(!((v)&~0x3fff))?((c)[0]=((v)>>8)|0x80,(c)[1]=(v)&0xff,2):(!((v)&~0x1fffff))?((c)[0]=((v)>>16)|0xc0,(c)[1]=((v)>>8)&0xff,(c)[2]=(v)&0xff,3):(!((v)&~0xfffffff))?((c)[0]=((v)>>24)|0xe0,(c)[1]=((v)>>16)&0xff,(c)[2]=((v)>>8)&0xff,(c)[3]=(v)&0xff,4):((c)[0]=0xf0|(((v)>>28)&0xff),(c)[1]=((v)>>20)&0xff,(c)[2]=((v)>>12)&0xff,(c)[3]=((v)>>4)&0xff,(c)[4]=(v)&0xf,5))
99 #define itf8_size(v) ((!((v)&~0x7f))?1:(!((v)&~0x3fff))?2:(!((v)&~0x1fffff))?3:(!((v)&~0xfffffff))?4:5)
182 int level,
int strat,
183 int level2,
int strat2);
192 #define BLOCK_SIZE(b) ((b)->byte)
193 #define BLOCK_DATA(b) ((b)->data)
196 #define BLOCK_END(b) (&(b)->data[(b)->byte])
199 #define BLOCK_RESIZE(b,l) \
201 while((b)->alloc <= (l)) { \
202 (b)->alloc = (b)->alloc ? (b)->alloc*1.5 : 1024; \
203 (b)->data = realloc((b)->data, (b)->alloc); \
208 #define BLOCK_GROW(b,l) BLOCK_RESIZE((b), BLOCK_SIZE((b)) + (l))
211 #define BLOCK_APPEND(b,s,l) \
213 BLOCK_GROW((b),(l)); \
214 memcpy(BLOCK_END((b)), (s), (l)); \
215 BLOCK_SIZE((b)) += (l); \
219 #define BLOCK_APPEND_CHAR(b,c) \
222 (b)->data[(b)->byte++] = (c); \
226 #define BLOCK_APPENDF_1(b,buf,fmt, a1) \
228 int l = sprintf((buf), (fmt), (a1)); \
229 BLOCK_APPEND((b), (buf), l); \
233 #define BLOCK_APPENDF_2(b,buf,fmt, a1,a2) \
235 int l = sprintf((buf), (fmt), (a1), (a2)); \
236 BLOCK_APPEND((b), (buf), l); \
239 #define BLOCK_UPLEN(b) \
240 (b)->comp_size = (b)->uncomp_size = BLOCK_SIZE((b))