OSDN Git Service

Merge branch 'master' of github.com:jca02266/lha
[lha/lha.git] / src / prototypes.h
1 /* This file was generated by cproto. */
2
3 /* append.c */
4 int encode_lzhuf(FILE *infp, FILE *outfp, off_t size, off_t *original_size_var, off_t *packed_size_var, char *name, char *hdr_method);
5 /* bitio.c */
6 void fillbuf(int n);
7 unsigned short getbits(int n);
8 void putcode(int n, int x);
9 void putbits(int n, int x);
10 void init_getbits(void);
11 void init_putbits(void);
12 /* crcio.c */
13 void make_crctable(void);
14 unsigned int calccrc(unsigned int crc, char *p, unsigned int n);
15 int fread_crc(unsigned int *crcp, void *p, int n, FILE *fp);
16 void fwrite_crc(unsigned int *crcp, void *p, int n, FILE *fp);
17 void init_code_cache(void);
18 int fwrite_txt(void *vp, int n, FILE *fp);
19 int fread_txt(void *vp, int n, FILE *fp);
20 /* dhuf.c */
21 void start_c_dyn(void);
22 void decode_start_dyn(void);
23 unsigned short decode_c_dyn(void);
24 unsigned short decode_p_dyn(void);
25 void output_dyn(unsigned int code, unsigned int pos);
26 void encode_end_dyn(void);
27 /* extract.c */
28 int decode_lzhuf(FILE *infp, FILE *outfp, off_t original_size, off_t packed_size, char *name, int method, off_t *read_sizep);
29 /* header.c */
30 int calc_sum(void *p, int len);
31 void convert_filename(char *name, int len, int size, int from_code, int to_code, char *from_delim, char *to_delim, int case_to);
32 boolean get_header(FILE *fp, LzHeader *hdr);
33 int seek_lha_header(FILE *fp);
34 void init_header(char *name, struct stat *v_stat, LzHeader *hdr);
35 void write_header(FILE *fp, LzHeader *hdr);
36 char *sjis_to_utf8(char *dst, const char *src, size_t dstsize);
37 char *utf8_to_sjis(char *dst, const char *src, size_t dstsize);
38 void euc2sjis(int *p1, int *p2);
39 void sjis2euc(int *p1, int *p2);
40 int cap_to_sjis(char *dst, const char *src, size_t dstsize);
41 int sjis_to_cap(char *dst, const char *src, size_t dstsize);
42 /* huf.c */
43 void output_st1(int c, int p);
44 unsigned char *alloc_buf(void);
45 void encode_start_st1(void);
46 void encode_end_st1(void);
47 unsigned short decode_c_st1(void);
48 unsigned short decode_p_st1(void);
49 void decode_start_st1(void);
50 /* indicator.c */
51 void start_indicator(char *name, off_t size, char *msg, long def_indicator_threshold);
52 void put_indicator(long int count);
53 void finish_indicator2(char *name, char *msg, int pcnt);
54 void finish_indicator(char *name, char *msg);
55 /* larc.c */
56 unsigned short decode_c_lzs(void);
57 unsigned short decode_p_lzs(void);
58 void decode_start_lzs(void);
59 unsigned short decode_c_lz5(void);
60 unsigned short decode_p_lz5(void);
61 void decode_start_lz5(void);
62 /* lhadd.c */
63 FILE *append_it(char *name, FILE *oafp, FILE *nafp);
64 FILE *build_temporary_file(void);
65 void temporary_to_new_archive_file(off_t new_archive_size);
66 void cmd_add(void);
67 void cmd_delete(void);
68 /* lharc.c */
69 int main(int argc, char *argv[]);
70 void message(char *fmt, ...);
71 void warning(char *fmt, ...);
72 void error(char *fmt, ...);
73 void fatal_error(char *fmt, ...);
74 void cleanup(void);
75 RETSIGTYPE interrupt(int signo);
76 void *xmalloc(size_t size);
77 void *xrealloc(void *old, size_t size);
78 char *xstrdup(char *str);
79 void init_sp(struct string_pool *sp);
80 void add_sp(struct string_pool *sp, char *name, int len);
81 void finish_sp(register struct string_pool *sp, int *v_count, char ***v_vector);
82 void free_sp(char **vector);
83 void cleaning_files(int *v_filec, char ***v_filev);
84 boolean find_files(char *name, int *v_filec, char ***v_filev);
85 void free_files(int filec, char **filev);
86 int build_temporary_name(void);
87 void build_backup_name(char *buffer, char *original, size_t size);
88 void build_standard_archive_name(char *buffer, char *original, size_t size);
89 boolean need_file(char *name);
90 FILE *xfopen(char *name, char *mode);
91 FILE *open_old_archive(void);
92 int inquire(char *msg, char *name, char *selective);
93 void write_archive_tail(FILE *nafp);
94 void lha_exit(int status);
95 /* lhext.c */
96 void cmd_extract(void);
97 int is_directory_traversal(char *path);
98 /* lhlist.c */
99 void cmd_list(void);
100 /* maketbl.c */
101 void make_table(int nchar, unsigned char bitlen[], int tablebits, unsigned short table[]);
102 /* maketree.c */
103 short make_tree(int nchar, unsigned short *freq, unsigned char *bitlen, unsigned short *code);
104 /* patmatch.c */
105 int patmatch(register char *p, register char *s, int f);
106 /* shuf.c */
107 void decode_start_st0(void);
108 void encode_p_st0(int j);
109 void encode_start_fix(void);
110 void decode_start_fix(void);
111 unsigned short decode_c_st0(void);
112 unsigned short decode_p_st0(void);
113 /* slide.c */
114 int encode_alloc(int method);
115 unsigned int encode(struct interfacing *interface);
116 unsigned int decode(struct interfacing *interface);
117 /* util.c */
118 off_t copyfile(FILE *f1, FILE *f2, off_t size, int text_flg, unsigned int *crcp);
119 int encode_stored_crc(FILE *ifp, FILE *ofp, off_t size, off_t *original_size_var, off_t *write_size_var);
120 boolean archive_is_msdos_sfx1(char *name);
121 int xsnprintf(char *dest, size_t size, char *fmt, ...);
122 char *xstrchr(const char *s, int c);
123 char *xstrrchr(const char *s, int c);
124 char *xmemchr(const char *s, int c, size_t n);
125 char *xmemrchr(const char *s, int c, size_t n);
126 int str_safe_copy(char *dst, const char *src, int dstsz);
127 /* pm2.c */
128 void decode_start_pm2(void);
129 unsigned short decode_c_pm2(void);
130 unsigned short decode_p_pm2(void);
131 /* pm2tree.c */
132 void maketree1(void);
133 void maketree2(int tree2bound);
134 int tree1_get(void);
135 int tree2_get(void);
136 /* pm2hist.c */
137 void hist_init(void);
138 unsigned char hist_lookup(int n);
139 void hist_update(unsigned char data);
140
141 /* util.c */
142 #if !HAVE_MEMMOVE
143 void *memmove(void *dst, const void *src, size_t cnt);
144 #endif
145 #if !HAVE_STRDUP
146 char *strdup(const char *buf);
147 #endif
148 #if !HAVE_MEMSET
149 char *memset(char *s, int c, size_t n);
150 #endif
151 #if !HAVE_STRCASECMP
152 int strcasecmp(const char *p1, const char *p2);
153 #endif
154 #if defined HAVE_DECL_BASENAME && !HAVE_DECL_BASENAME
155 char *basename(char *s);
156 #endif
157
158 /* vsnprintf.c */
159 #if !HAVE_VSNPRINTF
160 int vsnprintf(char *str, size_t n, const char *fmt, va_list ap);
161 int snprintf(char *str, size_t n, char const *fmt, ...);
162 #endif