OSDN Git Service

should include sys/types.h for mode_t
[lha/olha.git] / prototypes.h
index de8b823..a218feb 100644 (file)
@@ -7,45 +7,35 @@
 
 /* ar.c */
 struct lha_method *which_method P_((char *id));
-void put_string P_((char *buf, int *n, size_t size, char *p));
-void get_string P_((char *buf, int *i, size_t size, char *p));
-time_t ftime_to_time_t P_((uint32_t ftime));
-uint32_t time_t_to_ftime P_((time_t t));
-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));
 void parse_args P_((int argc, char **argv));
 FILE *open_tempfile P_((void));
 /* io.c */
-void error P_((char *fmt, ...));
-void message P_((char *fmt, ...));
-void warn 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_((void *p, int n, FILE *f));
-void fwrite_crc P_((void *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, char *buf));
+void decode P_((struct lzh_istream *rp, FILE *outfile, unsigned long remainder, unsigned int *crc));
 /* maketree.c */
-int make_tree P_((int nparm, ushort freqparm[], uchar lenparm[], ushort codeparm[]));
+int make_tree P_((uint16_t nparm, uint16_t *freqparm, uint8_t *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));
@@ -59,11 +49,31 @@ 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));
+char *basename P_((char *path));
+char *dirname P_((char *path));
 int makepath P_((char *dest, int dest_size, char *dir, char *file, char *ext));
+int mkdir_p P_((char *dir, mode_t mode));
+int mkdir_parent P_((char *file));
 /* filelib.c */
 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 copy_stream_to_file P_((FILE *rfp, char *file));
 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_to_file P_((struct lzh_istream *rp, struct lzh_header *h));
+void extract_to_stdout P_((struct lzh_istream *rp, 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, ...));