Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

basex.h File Reference

#include "compiler_opt.h"
#include "endianness.h"

Go to the source code of this file.

Defines

#define BASE16_LOOKUP_TABLE
#define BASE64_LOOKUP_TABLE
#define BASE64_LOOKUP_8K
#define BASE16_LOOKUP_LARGE
#define ALIGN_POINTER(p, type)   ((type*) ((long)((char*)(p)+sizeof(type)-1)&~(long)(sizeof(type)-1)))
#define ALIGN_UINT_POINTER(p)   ALIGN_POINTER(p, unsigned int)
#define HEX_HI(h)   _bx_hexdig_hi[(unsigned char)(h)]
#define HEX_LOW(h)   _bx_hexdig_low[(unsigned char)(h)]
#define UNHEX(h)   _bx_unhexdig256[(h)]
#define BASE64_12(a, b)   _bx_b64_12[((a)<<4)|((b)>>4)]
#define BASE64_34(b, c)   _bx_b64_12[(((b)&0xf)<<8)|(c)]
#define UNBASE64(v)   _bx_ub64[(v)]
#define base16_enc_len(l)   (l*2)
#define base16_max_dec_len(l)   (l/2)
#define base16_dec_len(b, l)   base16_max_dec_len(l)
#define base16_dec_min_len()   2
#define base16_enc_min_len()   0
#define base64_enc_len(l)   (((l)+2)/3*4)
#define base64_max_dec_len(l)   ((l)/4*3)
#define base64_dec_len(b, l)   (base64_max_dec_len(l)-((b)[(l)-2]=='=') -((b)[(l)-1]=='='))
#define base64_dec_min_len()   4
#define base64_enc_min_len()   0
#define q_b64_base   '0'
#define q_b64_pad   'z'
#define Q_BASE64(v)   (unsigned char)((v)+q_b64_base)
#define Q_UNBASE64(v)   (unsigned char)((v)-q_b64_base)

Functions

int base16_enc (unsigned char *src, int slen, unsigned char *dst, int dlen)
int base16_dec (unsigned char *src, int slen, unsigned char *dst, int dlen)
unsigned char base64_enc_char (unsigned char v)
unsigned base64_dec_char (unsigned char v)
int base64_enc (unsigned char *src, int slen, unsigned char *dst, int dlen)
int base64_dec (unsigned char *src, int slen, unsigned char *dst, int dlen)
int q_base64_enc (unsigned char *src, int slen, unsigned char *dst, int dlen)
int q_base64_dec (unsigned char *src, int slen, unsigned char *dst, int dlen)
int init_basex ()

Variables

unsigned char _bx_hexdig_hi [256]
unsigned char _bx_hexdig_low [256]
unsigned char _bx_unhexdig256 [256]
unsigned short _bx_b64_12 [4096]
unsigned char _bx_ub64 [256]


Define Documentation

#define ALIGN_POINTER p,
type   )     ((type*) ((long)((char*)(p)+sizeof(type)-1)&~(long)(sizeof(type)-1)))
 

Definition at line 133 of file basex.h.

#define ALIGN_UINT_POINTER  )     ALIGN_POINTER(p, unsigned int)
 

Definition at line 136 of file basex.h.

#define base16_dec_len b,
 )     base16_max_dec_len(l)
 

Definition at line 262 of file basex.h.

 
#define base16_dec_min_len  )     2
 

Definition at line 264 of file basex.h.

#define base16_enc_len  )     (l*2)
 

Definition at line 258 of file basex.h.

 
#define base16_enc_min_len  )     0
 

Definition at line 266 of file basex.h.

#define BASE16_LOOKUP_LARGE
 

Definition at line 119 of file basex.h.

#define BASE16_LOOKUP_TABLE
 

Definition at line 107 of file basex.h.

#define base16_max_dec_len  )     (l/2)
 

Definition at line 260 of file basex.h.

#define BASE64_12 a,
 )     _bx_b64_12[((a)<<4)|((b)>>4)]
 

Definition at line 210 of file basex.h.

Referenced by base64_enc().

#define BASE64_34 b,
 )     _bx_b64_12[(((b)&0xf)<<8)|(c)]
 

Definition at line 211 of file basex.h.

Referenced by base64_enc().

#define base64_dec_len b,
 )     (base64_max_dec_len(l)-((b)[(l)-2]=='=') -((b)[(l)-1]=='='))
 

Definition at line 273 of file basex.h.

 
#define base64_dec_min_len  )     4
 

Definition at line 276 of file basex.h.

#define base64_enc_len  )     (((l)+2)/3*4)
 

Definition at line 269 of file basex.h.

 
#define base64_enc_min_len  )     0
 

Definition at line 278 of file basex.h.

#define BASE64_LOOKUP_8K
 

Definition at line 115 of file basex.h.

#define BASE64_LOOKUP_TABLE
 

Definition at line 111 of file basex.h.

#define base64_max_dec_len  )     ((l)/4*3)
 

Definition at line 271 of file basex.h.

#define HEX_HI  )     _bx_hexdig_hi[(unsigned char)(h)]
 

Definition at line 149 of file basex.h.

Referenced by base16_enc().

#define HEX_LOW  )     _bx_hexdig_low[(unsigned char)(h)]
 

Definition at line 150 of file basex.h.

Referenced by base16_enc().

#define q_b64_base   '0'
 

#define q_b64_pad   'z'
 

Referenced by q_base64_dec().

#define Q_BASE64  )     (unsigned char)((v)+q_b64_base)
 

Referenced by q_base64_enc().

#define Q_UNBASE64  )     (unsigned char)((v)-q_b64_base)
 

Referenced by q_base64_dec().

#define UNBASE64  )     _bx_ub64[(v)]
 

Definition at line 224 of file basex.h.

Referenced by base64_dec().

#define UNHEX  )     _bx_unhexdig256[(h)]
 

Definition at line 154 of file basex.h.

Referenced by base16_dec().


Function Documentation

int base16_dec unsigned char *  src,
int  slen,
unsigned char *  dst,
int  dlen
[inline, static]
 

Definition at line 482 of file basex.h.

References UNHEX, and unlikely.

int base16_enc unsigned char *  src,
int  slen,
unsigned char *  dst,
int  dlen
[inline, static]
 

Definition at line 462 of file basex.h.

References HEX_HI, HEX_LOW, and unlikely.

int base64_dec unsigned char *  src,
int  slen,
unsigned char *  dst,
int  dlen
[inline, static]
 

Definition at line 663 of file basex.h.

References UNBASE64, and unlikely.

Referenced by check_nonce().

unsigned base64_dec_char unsigned char  v  )  [inline, static]
 

Definition at line 524 of file basex.h.

int base64_enc unsigned char *  src,
int  slen,
unsigned char *  dst,
int  dlen
[inline, static]
 

Definition at line 565 of file basex.h.

References _bx_b64_12, BASE64_12, BASE64_34, and unlikely.

Referenced by calc_nonce().

unsigned char base64_enc_char unsigned char  v  )  [inline, static]
 

Definition at line 504 of file basex.h.

int init_basex  ) 
 

Definition at line 187 of file basex.c.

References _bx_b64_12, _bx_ub64, b64_dec_char, and b64_enc_char.

Referenced by main().

int q_base64_dec unsigned char *  src,
int  slen,
unsigned char *  dst,
int  dlen
[inline, static]
 

Definition at line 781 of file basex.h.

References q_b64_pad, Q_UNBASE64, and unlikely.

int q_base64_enc unsigned char *  src,
int  slen,
unsigned char *  dst,
int  dlen
[inline, static]
 

Definition at line 733 of file basex.h.

References Q_BASE64, and unlikely.


Variable Documentation

unsigned short _bx_b64_12[4096]
 

Definition at line 159 of file basex.c.

Referenced by base64_enc(), and init_basex().

unsigned char _bx_hexdig_hi[256]
 

Definition at line 35 of file basex.c.

unsigned char _bx_hexdig_low[256]
 

Definition at line 70 of file basex.c.

unsigned char _bx_ub64[256]
 

Definition at line 160 of file basex.c.

Referenced by init_basex().

unsigned char _bx_unhexdig256[256]
 

Definition at line 105 of file basex.c.


Generated on Thu Jul 29 04:15:52 2010 for SIPExpressRouter by  doxygen 1.3.9.1