OSDN Git Service

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