OSDN Git Service

maketree.c was refined
[lha/olha.git] / prototypes.h
index a0faaf7..771d775 100644 (file)
@@ -7,48 +7,36 @@
 
 /* ar.c */
 struct lha_method *which_method P_((char *id));
-int init_opts P_((void));
-int get_byte P_((char *buf));
-uint16_t get_word P_((char *buf));
-uint32_t get_dword P_((char *buf));
-void get_char P_((char *buf, char *p, size_t size));
-void put_byte P_((char *buf, int c));
-void put_word P_((char *buf, uint16_t c));
-void put_dword P_((char *buf, uint32_t c));
-void put_char P_((char *buf, char *p, size_t size));
-void write_header_lv0 P_((FILE *fp, struct lzh_header *h));
-void write_header_lv1 P_((FILE *fp, struct lzh_header *h));
-void write_header_lv2 P_((FILE *fp, struct lzh_header *h));
-void write_header P_((FILE *fp, struct lzh_header *h));
+uint ratio P_((ulong a, ulong b));
+void skip P_((FILE *fp, struct lzh_header *h));
 int get_line P_((char *s, int n));
-int parse_args P_((int argc, char **argv));
+void parse_args P_((int argc, char **argv));
 FILE *open_tempfile P_((void));
 /* io.c */
-void error P_((char *fmt, ...));
 void make_crctable P_((void));
-void fillbuf P_((int n));
-uint getbits P_((int n));
-void putbits P_((int n, uint x));
-int fread_crc P_((uchar *p, int n, FILE *f));
-void fwrite_crc P_((uchar *p, int n, FILE *f));
-void init_getbits P_((void));
-void init_putbits P_((void));
+void fillbuf P_((struct lzh_istream *rp, int n));
+uint getbits P_((struct lzh_istream *rp, int n));
+void putbits P_((struct lzh_ostream *wp, int n, uint x));
+int fread_crc P_((void *p, int n, FILE *f, unsigned int *crc));
+void fwrite_crc P_((void *p, int n, FILE *f, unsigned int *crc));
+void init_getbits P_((struct lzh_istream *rp));
+void init_putbits P_((struct lzh_ostream *wp));
 /* encode.c */
-void encode P_((void));
+void encode P_((struct lzh_ostream *wp, FILE *rfp));
 /* decode.c */
-void decode_start P_((void));
-void decode P_((uint count, uchar buffer[]));
+void decode_start P_((struct lzh_istream *rp));
+void decode P_((struct huf_t *huf, struct lzh_istream *rp, uint count, char *buf, unsigned int *slide_off, int *slide_len));
 /* maketree.c */
-int make_tree P_((int nparm, ushort freqparm[], uchar lenparm[], ushort codeparm[]));
+int make_tree P_((uint16_t nparm, uint16_t *freqparm, uchar *lenparm, uint16_t *codeparm));
 /* maketbl.c */
-void make_table P_((int nchar, uchar bitlen[], int tablebits, ushort table[]));
+void make_table P_((struct huf_t *huf, int nchar, uchar bitlen[], int tablebits, ushort table[]));
 /* huf.c */
-void output P_((uint c, uint p));
-void huf_encode_start P_((struct lha_method *m));
-void huf_encode_end P_((void));
-uint decode_c P_((void));
-uint decode_p P_((void));
-void huf_decode_start P_((struct lha_method *m));
+void output P_((struct lzh_ostream *wp, uint c, uint p));
+void huf_encode_start P_((struct lzh_ostream *wp, struct lha_method *m));
+void huf_encode_end P_((struct lzh_ostream *wp));
+uint decode_c P_((struct huf_t *huf, struct lzh_istream *rp));
+uint decode_p P_((struct huf_t *huf, struct lzh_istream *rp));
+void huf_decode_start P_((struct lzh_istream *rp, struct lha_method *m));
 /* strlib.c */
 int string_equal P_((char *str1, char *str2));
 int string_copy P_((char *dst, char *src, int dstsz));
@@ -62,7 +50,26 @@ char *next_field P_((char *s));
 char *strip_space P_((char *s));
 /* pathlib.c */
 int path_addsep P_((char *path, size_t size));
+char *xbasename P_((char *path));
 int makepath P_((char *dest, int dest_size, char *dir, char *file, char *ext));
 /* filelib.c */
-int copy_stream P_((FILE *from, FILE *to));
+int file_exists P_((char *file));
+int file_mtime P_((char *file, time_t *t));
+int copy_stream P_((FILE *rfp, FILE *wfp));
+int move_file_to_stream P_((char *file, FILE *wfp));
 int xrename P_((char *from, char *to));
+/* header.c */
+int read_header P_((FILE *fp, struct lzh_header *h));
+void write_header P_((FILE *fp, struct lzh_header *h));
+/* add.c */
+int add_dir P_((struct lzh_ostream *wp, int replace_flag, struct lzh_header *h));
+int add P_((struct lzh_ostream *wp, int replace_flag, char *filename, int namelen));
+/* extract.c */
+void extract P_((struct lzh_istream *rp, int to_file, struct lzh_header *h));
+/* list.c */
+void list_start P_((void));
+void list P_((struct lzh_header *h));
+/* error.c */
+void error P_((char *fmt, ...));
+void message P_((char *fmt, ...));
+void warn P_((char *fmt, ...));