BurgerLib
Defines | Functions | Variables
clstdlib.cpp File Reference
#include "clstdlib.h"
#include "brendian.h"
#include "mmmemory.h"
#include "pfprefs.h"
#include "ststring.h"
#include <stdlib.h>
Include dependency graph for clstdlib.cpp:

Defines

#define BASE   65521L /* largest prime smaller than 65536 */
#define NMAX   5552 /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
#define BASE16   251 /* largest prime smaller than 256 */
#define NMAX16   5802 /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
#define ROTATE_LEFT(x, n)   (((x) << (n)) | ((x) >> (32-(n))))
#define S411   3
#define S412   7
#define S413   11
#define S414   19
#define S421   3
#define S422   5
#define S423   9
#define S424   13
#define S431   3
#define S432   9
#define S433   11
#define S434   15
#define F4(x, y, z)   (((x) & (y)) | ((~x) & (z)))
#define G4(x, y, z)   (((x) & (y)) | ((x) & (z)) | ((y) & (z)))
#define H4(x, y, z)   ((x) ^ (y) ^ (z))
#define FF4(a, b, c, d, x, s)
#define GG4(a, b, c, d, x, s)
#define HH4(a, b, c, d, x, s)
#define S11   7
#define S12   12
#define S13   17
#define S14   22
#define S21   5
#define S22   9
#define S23   14
#define S24   20
#define S31   4
#define S32   11
#define S33   16
#define S34   23
#define S41   6
#define S42   10
#define S43   15
#define S44   21
#define F(x, y, z)   (((x) & (y)) | ((~x) & (z)))
#define G(x, y, z)   (((x) & (z)) | ((y) & (~z)))
#define H(x, y, z)   ((x) ^ (y) ^ (z))
#define I(x, y, z)   ((y) ^ ((x) | (~z)))
#define FF(a, b, c, d, x, s, ac)
#define GG(a, b, c, d, x, s, ac)
#define HH(a, b, c, d, x, s, ac)
#define II(a, b, c, d, x, s, ac)

Functions

void *BURGER_API ExtractAString (const char *SrcPtr, Word32 *BufSize, Word Flags)
void BURGER_API ExtractAString2 (const char *SrcPtr, Word32 *BufSize, Word Flags, char *DestPtr, Word32 DestSize)
char *BURGER_API midstr (char *DestPtr, const char *SourcePtr, WordPtr Start, WordPtr Length)
char *BURGER_API stristr (const char *Input, const char *SubStr)
static Word BURGER_API RemoveParm (char *argv[], Word Index, Word Count, Word argc)
Word BURGER_API Switches (Word argc, char *argv[], const Switch_t *SwitchList)
Word32 BURGER_API CalcMoreAdler (const Word8 *Buffer, Word32 Length, Word32 CheckSum)
Word BURGER_API CalcMoreAdler16 (const Word8 *Buffer, Word32 Length, Word CheckSum)
Word32 BURGER_API CalcMoreCRC32 (const Word8 *buffPtr, Word32 buffSize, Word32 crc)
static void MD2Transform (Word8 *state, Word8 *checksum, const Word8 *block)
void BURGER_API MD2Init (MD2_t *Input)
void BURGER_API MD2Update (MD2_t *context, const Word8 *input, Word32 inputLen)
void BURGER_API MD2Final (Word8 *digest, MD2_t *context)
void BURGER_API MD2Quick (Word8 *Output, const Word8 *BufferPtr, Word32 Length)
static void MD4Transform (Word32 *state, const Word8 *block)
void BURGER_API MD4Init (MD4_t *Input)
void BURGER_API MD4Update (MD4_t *context, const Word8 *input, Word32 inputLen)
void BURGER_API MD4Final (Word8 *Output, MD4_t *Input)
void BURGER_API MD4Quick (Word8 *Output, const Word8 *BufferPtr, Word32 Length)
static void BURGER_API MD5Transform (Word32 *state, const Word8 *block)
void BURGER_API MD5Init (MD5_t *Input)
void BURGER_API MD5Update (MD5_t *context, const Word8 *input, Word32 inputLen)
void BURGER_API MD5Final (Word8 *Output, MD5_t *Input)
void BURGER_API MD5Quick (Word8 *Output, const Word8 *BufferPtr, Word32 Length)
Word BURGER_API BurgerlibVersion (void)
void *BURGER_API LibRefGetFunctionInLib (const char *LibName, const char *ProcName)

Variables

static const Word32 crcTable [256]
static const Word8 PI_SUBST [256]

Define Documentation

#define BASE   65521L /* largest prime smaller than 65536 */
#define BASE16   251 /* largest prime smaller than 256 */
#define F (   x,
  y,
 
)    (((x) & (y)) | ((~x) & (z)))
#define F4 (   x,
  y,
 
)    (((x) & (y)) | ((~x) & (z)))
#define FF (   a,
  b,
  c,
  d,
  x,
  s,
  ac 
)
Value:
{ \
    (a) += F ((b), (c), (d)) + (x) + (Word32)(ac); \
    (a) = ROTATE_LEFT ((a), (s)); \
    (a) += (b); \
  }
#define FF4 (   a,
  b,
  c,
  d,
  x,
 
)
Value:
{ \
    (a) += F4((b), (c), (d)) + (x); \
    (a) = ROTATE_LEFT ((a), (s)); \
  }
#define G (   x,
  y,
 
)    (((x) & (z)) | ((y) & (~z)))
#define G4 (   x,
  y,
 
)    (((x) & (y)) | ((x) & (z)) | ((y) & (z)))
#define GG (   a,
  b,
  c,
  d,
  x,
  s,
  ac 
)
Value:
{ \
    (a) += G ((b), (c), (d)) + (x) + (Word32)(ac); \
    (a) = ROTATE_LEFT ((a), (s)); \
    (a) += (b); \
  }
#define GG4 (   a,
  b,
  c,
  d,
  x,
 
)
Value:
{ \
    (a) += G4((b), (c), (d)) + (x) + (Word32)0x5a827999; \
    (a) = ROTATE_LEFT ((a), (s)); \
  }
#define H (   x,
  y,
 
)    ((x) ^ (y) ^ (z))
#define H4 (   x,
  y,
 
)    ((x) ^ (y) ^ (z))
#define HH (   a,
  b,
  c,
  d,
  x,
  s,
  ac 
)
Value:
{ \
    (a) += H ((b), (c), (d)) + (x) + (Word32)(ac); \
    (a) = ROTATE_LEFT ((a), (s)); \
    (a) += (b); \
  }
#define HH4 (   a,
  b,
  c,
  d,
  x,
 
)
Value:
{ \
    (a) += H4((b), (c), (d)) + (x) + (Word32)0x6ed9eba1; \
    (a) = ROTATE_LEFT ((a), (s)); \
  }
#define I (   x,
  y,
 
)    ((y) ^ ((x) | (~z)))
#define II (   a,
  b,
  c,
  d,
  x,
  s,
  ac 
)
Value:
{ \
    (a) += I ((b), (c), (d)) + (x) + (Word32)(ac); \
    (a) = ROTATE_LEFT ((a), (s)); \
    (a) += (b); \
  }
#define NMAX   5552 /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
#define NMAX16   5802 /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
#define ROTATE_LEFT (   x,
 
)    (((x) << (n)) | ((x) >> (32-(n))))
#define S11   7
#define S12   12
#define S13   17
#define S14   22
#define S21   5
#define S22   9
#define S23   14
#define S24   20
#define S31   4
#define S32   11
#define S33   16
#define S34   23
#define S41   6
#define S411   3
#define S412   7
#define S413   11
#define S414   19
#define S42   10
#define S421   3
#define S422   5
#define S423   9
#define S424   13
#define S43   15
#define S431   3
#define S432   9
#define S433   11
#define S434   15
#define S44   21

Function Documentation

Word32 BURGER_API CalcMoreAdler ( const Word8 Buffer,
Word32  Length,
Word32  CheckSum 
)
Word BURGER_API CalcMoreAdler16 ( const Word8 Buffer,
Word32  Length,
Word  CheckSum 
)
Word32 BURGER_API CalcMoreCRC32 ( const Word8 buffPtr,
Word32  buffSize,
Word32  crc 
)
void* BURGER_API ExtractAString ( const char *  SrcPtr,
Word32 BufSize,
Word  Flags 
)
void BURGER_API ExtractAString2 ( const char *  SrcPtr,
Word32 BufSize,
Word  Flags,
char *  DestPtr,
Word32  DestSize 
)
void* BURGER_API LibRefGetFunctionInLib ( const char *  LibName,
const char *  ProcName 
)
void BURGER_API MD2Final ( Word8 digest,
MD2_t context 
)
void BURGER_API MD2Init ( MD2_t Input)
void BURGER_API MD2Quick ( Word8 Output,
const Word8 BufferPtr,
Word32  Length 
)
static void MD2Transform ( Word8 state,
Word8 checksum,
const Word8 block 
) [static]
void BURGER_API MD2Update ( MD2_t context,
const Word8 input,
Word32  inputLen 
)
void BURGER_API MD4Final ( Word8 Output,
MD4_t Input 
)
void BURGER_API MD4Init ( MD4_t Input)
void BURGER_API MD4Quick ( Word8 Output,
const Word8 BufferPtr,
Word32  Length 
)
static void MD4Transform ( Word32 state,
const Word8 block 
) [static]
void BURGER_API MD4Update ( MD4_t context,
const Word8 input,
Word32  inputLen 
)
void BURGER_API MD5Final ( Word8 Output,
MD5_t Input 
)
void BURGER_API MD5Init ( MD5_t Input)
void BURGER_API MD5Quick ( Word8 Output,
const Word8 BufferPtr,
Word32  Length 
)
static void BURGER_API MD5Transform ( Word32 state,
const Word8 block 
) [static]
void BURGER_API MD5Update ( MD5_t context,
const Word8 input,
Word32  inputLen 
)
char* BURGER_API midstr ( char *  DestPtr,
const char *  SourcePtr,
WordPtr  Start,
WordPtr  Length 
)
static Word BURGER_API RemoveParm ( char *  argv[],
Word  Index,
Word  Count,
Word  argc 
) [static]
char* BURGER_API stristr ( const char *  Input,
const char *  SubStr 
)
Word BURGER_API Switches ( Word  argc,
char *  argv[],
const Switch_t SwitchList 
)

Variable Documentation

const Word32 crcTable[256] [static]
const Word8 PI_SUBST[256] [static]
Initial value:
 {
     41, 46, 67,201,162,216,124,  1, 61, 54, 84,161,236,240,  6, 19,
     98,167,  5,243,192,199,115,140,152,147, 43,217,188, 76,130,202,
     30,155, 87, 60,253,212,224, 22,103, 66,111, 24,138, 23,229, 18,
    190, 78,196,214,218,158,222, 73,160,251,245,142,187, 47,238,122,
    169,104,121,145, 21,178,  7, 63,148,194, 16,137, 11, 34, 95, 33,
    128,127, 93,154, 90,144, 50, 39, 53, 62,204,231,191,247,151,  3,
    255, 25, 48,179, 72,165,181,209,215, 94,146, 42,172, 86,170,198,
     79,184, 56,210,150,164,125,182,118,252,107,226,156,116,  4,241,
     69,157,112, 89,100,113,135, 32,134, 91,207,101,230, 45,168,  2,
     27, 96, 37,173,174,176,185,246, 28, 70, 97,105, 52, 64,126, 15,
     85, 71,163, 35,221, 81,175, 58,195, 92,249,206,186,197,234, 38,
     44, 83, 13,110,133, 40,132,  9,211,223,205,244, 65,129, 77, 82,
    106,220, 55,200,108,193,171,250, 36,225,123,  8, 12,189,177, 74,
    120,136,149,139,227, 99,232,109,233,203,213,254, 59,  0, 29, 57,
    242,239,183, 14,102, 88,208,228,166,119,114,248,235,117, 75, 10,
     49, 68, 80,180,143,237, 31, 26,219,153,141, 51,159, 17,131, 20
}