"SfR Fresh" - the SfR Freeware/Shareware Archive

Member "slirp-1.0.16/src/ppp/bsd-comp.h" of archive slirp-1.0.16.tar.gz:


As a special service "SfR Fresh" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
    1 /*
    2  * A dictionary for doing BSD compress.
    3  */
    4 struct bsd_db {
    5 	int     totlen;                     /* length of this structure */
    6 	u_int   hsize;                      /* size of the hash table */
    7 	u_char  hshift;                     /* used in hash function */
    8 	u_char  n_bits;                     /* current bits/code */
    9 	u_char  maxbits;
   10 	u_char  debug;
   11 	u_char  unit;
   12 	u_int16_t seqno;                      /* sequence # of next packet */
   13 	u_int   hdrlen;                     /* header length to preallocate */
   14 	u_int   mru;
   15 	u_int   maxmaxcode;                 /* largest valid code */
   16 	u_int   max_ent;                    /* largest code in use */
   17 	u_int   in_count;                   /* uncompressed bytes, aged */
   18 	u_int   bytes_out;                  /* compressed bytes, aged */
   19 	u_int   ratio;                      /* recent compression ratio */
   20 	u_int   checkpoint;                 /* when to next check the ratio */
   21 	u_int   clear_count;                /* times dictionary cleared */
   22 	u_int   incomp_count;               /* incompressible packets */
   23 	u_int   incomp_bytes;               /* incompressible bytes */
   24 	u_int   uncomp_count;               /* uncompressed packets */
   25 	u_int   uncomp_bytes;               /* uncompressed bytes */
   26 	u_int   comp_count;                 /* compressed packets */
   27 	u_int   comp_bytes;                 /* compressed bytes */
   28 	u_int16_t *lens;                      /* array of lengths of codes */
   29 	struct bsd_dict {
   30 		union {
   31 			/* hash value */
   32 			u_int32_t   fcode;
   33 			struct {
   34 #ifdef WORDS_BIGENDIAN
   35 				u_char  pad;
   36 				u_char  suffix;         /* last character of new code */
   37 				u_int16_t prefix;         /* preceding code */
   38 #else
   39 				u_int16_t prefix;         /* preceding code */
   40 				u_char  suffix;         /* last character of new code */
   41 				u_char  pad;
   42 #endif
   43 			} hs;
   44 		} f;
   45 		u_int16_t codem1;                 /* output of hash table -1 */
   46 		u_int16_t cptr;                   /* map code to hash table entry */
   47 	} dict[1];
   48 };
   49