Commit | Line | Data |
---|---|---|
c9987f3b LM |
1 | #ifndef __CODE_H__ |
2 | #define __CODE_H__ | |
3 | ||
4 | #define NB_BYTES 256 | |
5 | ||
6 | /* byte type */ | |
7 | ||
8 | typedef unsigned char byte_t; | |
9 | ||
10 | /* code structure */ | |
11 | ||
12 | typedef struct { | |
13 | char code[NB_BYTES - 1 + 1]; | |
14 | } code_t; | |
15 | ||
92fc2c44 | 16 | int codcat (char *dst, int n, char *src); |
c9987f3b | 17 | int codcmp (char *cod1, char *cod2); |
92fc2c44 | 18 | int codcpy (char *dst, int n, char *src); |
c9987f3b LM |
19 | int codlen (char *code); |
20 | ||
c84ea202 LM |
21 | /* leaf structure */ |
22 | ||
23 | typedef struct _leaf_t | |
24 | { | |
25 | struct _leaf_t *left; | |
26 | struct _leaf_t *right; | |
27 | int occ; | |
28 | byte_t c; | |
29 | } leaf_t; | |
30 | ||
31 | leaf_t *getleaf (int n); | |
32 | ||
c9987f3b LM |
33 | #endif /* __CODE_H__ */ |
34 | ||
5f83300c | 35 | /* vim: set ts=4 sw=4 et */ |