Macros | Typedefs | Functions | Variables
binary_to_compressed_c.cpp File Reference
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
Include dependency graph for binary_to_compressed_c.cpp:

Go to the source code of this file.

Macros

#define _CRT_SECURE_NO_WARNINGS
 
#define stb__hc(q, h, c)   (((h) << 7) + ((h) >> 25) + q[c])
 
#define stb__hc2(q, h, c, d)   (((h) << 14) + ((h) >> 18) + (q[c] << 7) + q[d])
 
#define stb__hc3(q, c, d, e)   ((q[c] << 14) + (q[d] << 7) + q[e])
 
#define stb__nc(b, d)   ((d) <= window && ((b) > 9 || stb_not_crap(b,d)))
 
#define STB__SCRAMBLE(h)   (((h) + ((h) >> 16)) & mask)
 
#define STB__TRY(t, p)
 
#define stb_out(v)   do { if (stb__out) *stb__out++ = (stb_uchar) (v); else stb__write((stb_uchar) (v)); } while (0)
 

Typedefs

typedef unsigned char stb_uchar
 
typedef unsigned int stb_uint
 

Functions

static bool binary_to_compressed_c (const char *filename, const char *symbol, bool use_base85_encoding, bool use_compression)
 
char Encode85Byte (unsigned int x)
 
int main (int argc, char **argv)
 
static void outliterals (stb_uchar *in, int numlit)
 
static void stb__write (unsigned char v)
 
static stb_uint stb_adler32 (stb_uint adler32, stb_uchar *buffer, stb_uint buflen)
 
stb_uint stb_compress (stb_uchar *out, stb_uchar *in, stb_uint len)
 
static int stb_compress_chunk (stb_uchar *history, stb_uchar *start, stb_uchar *end, int length, int *pending_literals, stb_uchar **chash, stb_uint mask)
 
static int stb_compress_inner (stb_uchar *input, stb_uint length)
 
static unsigned int stb_matchlen (stb_uchar *m1, stb_uchar *m2, stb_uint maxlen)
 
static int stb_not_crap (int best, int dist)
 
static void stb_out2 (stb_uint v)
 
static void stb_out3 (stb_uint v)
 
static void stb_out4 (stb_uint v)
 

Variables

static stb_uint stb__hashsize = 32768
 
static stb_ucharstb__out
 
static stb_uint stb__outbytes
 
static FILE * stb__outfile
 
static unsigned int stb__running_adler
 
static int stb__window = 0x40000
 

Macro Definition Documentation

◆ _CRT_SECURE_NO_WARNINGS

#define _CRT_SECURE_NO_WARNINGS

Definition at line 22 of file binary_to_compressed_c.cpp.

◆ stb__hc

#define stb__hc (   q,
  h,
 
)    (((h) << 7) + ((h) >> 25) + q[c])

Definition at line 230 of file binary_to_compressed_c.cpp.

◆ stb__hc2

#define stb__hc2 (   q,
  h,
  c,
  d 
)    (((h) << 14) + ((h) >> 18) + (q[c] << 7) + q[d])

Definition at line 231 of file binary_to_compressed_c.cpp.

◆ stb__hc3

#define stb__hc3 (   q,
  c,
  d,
 
)    ((q[c] << 14) + (q[d] << 7) + q[e])

Definition at line 232 of file binary_to_compressed_c.cpp.

◆ stb__nc

#define stb__nc (   b,
  d 
)    ((d) <= window && ((b) > 9 || stb_not_crap(b,d)))

◆ STB__SCRAMBLE

#define STB__SCRAMBLE (   h)    (((h) + ((h) >> 16)) & mask)

◆ STB__TRY

#define STB__TRY (   t,
  p 
)
Value:
/* avoid retrying a match we already tried */ \
if (p ? dist != q-t : 1) \
if ((m = stb_matchlen(t, q, match_max)) > best) \
if (stb__nc(m,q-(t))) \
best = m, dist = q - (t)

◆ stb_out

#define stb_out (   v)    do { if (stb__out) *stb__out++ = (stb_uchar) (v); else stb__write((stb_uchar) (v)); } while (0)

Definition at line 191 of file binary_to_compressed_c.cpp.

Typedef Documentation

◆ stb_uchar

typedef unsigned char stb_uchar

Definition at line 30 of file binary_to_compressed_c.cpp.

◆ stb_uint

typedef unsigned int stb_uint

Definition at line 29 of file binary_to_compressed_c.cpp.

Function Documentation

◆ binary_to_compressed_c()

bool binary_to_compressed_c ( const char *  filename,
const char *  symbol,
bool  use_base85_encoding,
bool  use_compression 
)
static

Definition at line 69 of file binary_to_compressed_c.cpp.

◆ Encode85Byte()

char Encode85Byte ( unsigned int  x)

Definition at line 63 of file binary_to_compressed_c.cpp.

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 35 of file binary_to_compressed_c.cpp.

◆ outliterals()

static void outliterals ( stb_uchar in,
int  numlit 
)
static

Definition at line 197 of file binary_to_compressed_c.cpp.

◆ stb__write()

static void stb__write ( unsigned char  v)
static

Definition at line 184 of file binary_to_compressed_c.cpp.

◆ stb_adler32()

static stb_uint stb_adler32 ( stb_uint  adler32,
stb_uchar buffer,
stb_uint  buflen 
)
static

Definition at line 139 of file binary_to_compressed_c.cpp.

◆ stb_compress()

stb_uint stb_compress ( stb_uchar out,
stb_uchar in,
stb_uint  len 
)

Definition at line 376 of file binary_to_compressed_c.cpp.

◆ stb_compress_chunk()

static int stb_compress_chunk ( stb_uchar history,
stb_uchar start,
stb_uchar end,
int  length,
int *  pending_literals,
stb_uchar **  chash,
stb_uint  mask 
)
static

Definition at line 236 of file binary_to_compressed_c.cpp.

◆ stb_compress_inner()

static int stb_compress_inner ( stb_uchar input,
stb_uint  length 
)
static

Definition at line 341 of file binary_to_compressed_c.cpp.

◆ stb_matchlen()

static unsigned int stb_matchlen ( stb_uchar m1,
stb_uchar m2,
stb_uint  maxlen 
)
static

Definition at line 170 of file binary_to_compressed_c.cpp.

◆ stb_not_crap()

static int stb_not_crap ( int  best,
int  dist 
)
static

Definition at line 219 of file binary_to_compressed_c.cpp.

◆ stb_out2()

static void stb_out2 ( stb_uint  v)
static

Definition at line 193 of file binary_to_compressed_c.cpp.

◆ stb_out3()

static void stb_out3 ( stb_uint  v)
static

Definition at line 194 of file binary_to_compressed_c.cpp.

◆ stb_out4()

static void stb_out4 ( stb_uint  v)
static

Definition at line 195 of file binary_to_compressed_c.cpp.

Variable Documentation

◆ stb__hashsize

stb_uint stb__hashsize = 32768
static

Definition at line 226 of file binary_to_compressed_c.cpp.

◆ stb__out

stb_uchar* stb__out
static

Definition at line 180 of file binary_to_compressed_c.cpp.

◆ stb__outbytes

stb_uint stb__outbytes
static

Definition at line 182 of file binary_to_compressed_c.cpp.

◆ stb__outfile

FILE* stb__outfile
static

Definition at line 181 of file binary_to_compressed_c.cpp.

◆ stb__running_adler

unsigned int stb__running_adler
static

Definition at line 234 of file binary_to_compressed_c.cpp.

◆ stb__window

int stb__window = 0x40000
static

Definition at line 217 of file binary_to_compressed_c.cpp.

stb_matchlen
static unsigned int stb_matchlen(stb_uchar *m1, stb_uchar *m2, stb_uint maxlen)
Definition: binary_to_compressed_c.cpp:170
p
const char * p
Definition: gmock-matchers_test.cc:3863
m
const upb_json_parsermethod * m
Definition: ruby/ext/google/protobuf_c/upb.h:10501
stb__nc
#define stb__nc(b, d)


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:02