diff --git a/binhex/binhex.c b/binhex/binhex.c index 4b8c0a0..7287373 100644 --- a/binhex/binhex.c +++ b/binhex/binhex.c @@ -12,7 +12,7 @@ #define LOCALOPT "RilqVH" -static void usage(); +static void usage(void); static char options[128]; static char *dir_stack; diff --git a/binhex/dofile.c b/binhex/dofile.c index 1abfd9e..dd815d0 100644 --- a/binhex/dofile.c +++ b/binhex/dofile.c @@ -16,13 +16,13 @@ static int savebits; static int rep_char; static int rep_count; -void doheader(); -void dofork(); -void outbyte(); -void finish(); -void outbyte1(); -void out6bit(); -void outchar(); +static void doheader(); +static void dofork(char *fork, int size); +static void outbyte(int b); +static void finish(void); +static void outbyte1(int b); +static void out6bit(int c); +static void outchar(int c); void dofile (void) @@ -42,7 +42,7 @@ dofile (void) (void)putchar('\n'); } -void +static void doheader (void) { uint32_t crc; @@ -95,7 +95,7 @@ int i; outbyte((int)(crc & 0xff)); } -void +static void outbyte (int b) { b &= 0xff; @@ -128,7 +128,7 @@ outbyte (int b) } } -void +static void finish (void) { if(rep_count > 0) { @@ -153,7 +153,7 @@ finish (void) } } -void +static void outbyte1 (int b) { switch(state) { @@ -177,13 +177,13 @@ outbyte1 (int b) } } -void +static void out6bit (int c) { outchar(codes[c & 0x3f]); } -void +static void outchar (int c) { (void)putchar(c); diff --git a/comm/frommac.c b/comm/frommac.c index 52f4cbe..55125c7 100644 --- a/comm/frommac.c +++ b/comm/frommac.c @@ -20,7 +20,7 @@ extern char info[]; -static void usage(); +static void usage(void); static char options[128]; static int multi_file = 0; diff --git a/comm/tomac.c b/comm/tomac.c index 0c74aad..aa796ff 100644 --- a/comm/tomac.c +++ b/comm/tomac.c @@ -17,7 +17,7 @@ #define LOCALOPT "ilqxyzoTVH" -static void usage(); +static void usage(void); static char options[128]; static char *dir_stack; diff --git a/comm/xm_from.c b/comm/xm_from.c index f22f424..c1f64a8 100644 --- a/comm/xm_from.c +++ b/comm/xm_from.c @@ -10,9 +10,9 @@ #include "protocol.h" #include "tty.h" -static void receive_part(); -static int receive_sync(); -static int receive_rec(); +static void receive_part(char *info, int size, int more); +static int receive_sync(void); +static int receive_rec(char *buf, int bufsize, int recno); char info[INFOBYTES]; diff --git a/comm/xm_from.h b/comm/xm_from.h index 95bc0fe..23c53a7 100644 --- a/comm/xm_from.h +++ b/comm/xm_from.h @@ -1 +1 @@ -void xm_from(); +void xm_from(void); diff --git a/comm/xm_to.c b/comm/xm_to.c index b34cc21..d8345cd 100644 --- a/comm/xm_to.c +++ b/comm/xm_to.c @@ -7,9 +7,9 @@ #include "protocol.h" #include "tty.h" -static void send_part(); -static int send_sync(); -static void send_rec(); +static void send_part(char *info, int size, int more); +static int send_sync(void); +static void send_rec(char *buf, int bufsize, int recno); void xm_to (void) diff --git a/comm/xm_to.h b/comm/xm_to.h index 7ebe8ae..de54df9 100644 --- a/comm/xm_to.h +++ b/comm/xm_to.h @@ -1 +1 @@ -void xm_to(); +void xm_to(void); diff --git a/crc/makecrc.c b/crc/makecrc.c index eaefd2b..9d153de 100644 --- a/crc/makecrc.c +++ b/crc/makecrc.c @@ -35,7 +35,7 @@ #include #include -static void initcrctab(); +static void initcrctab(char *name, int poly, int init, int swapped, int bits); int main (void) diff --git a/fileio/rdfile.c b/fileio/rdfile.c index a2db0a2..353d062 100644 --- a/fileio/rdfile.c +++ b/fileio/rdfile.c @@ -1,3 +1,5 @@ +#include "rdfile.h" + #include #include #include @@ -7,7 +9,6 @@ #endif /* TYPES_H */ #include #include "machdr.h" -#include "rdfile.h" #include "rdfileopt.h" #ifndef DIRENT_H #include @@ -46,11 +47,11 @@ #define RSRC_FORMAT 2 #define UNIX_FORMAT 3 -static void check_files(); -static void read_file(); -static void enter_dir(); -static void exit_dir(); -static int get_stdin_file(); +static void check_files(int initial); +static void read_file(void); +static void enter_dir(void); +static void exit_dir(void); +static int get_stdin_file(void); char file_info[INFOBYTES]; char *data_fork, *rsrc_fork; @@ -81,12 +82,12 @@ static char f_name[] = ".foldername"; #include "aufs.h" static char infodir[] = ".finderinfo"; static char rsrcdir[] = ".resource"; -static void read_aufs_info(); +static void read_aufs_info(FILE *fd); #endif /* AUFS */ #ifdef APPLEDOUBLE #include "appledouble.h" static char infodir[] = ".AppleDouble"; -static void read_appledouble_info(); +static void read_appledouble_info(FILE *fd); #endif /* APPLEDOUBLE */ #endif /* APPLESHARE */ static char filename[255]; diff --git a/fileio/rdfile.h b/fileio/rdfile.h index c8d8695..aa7ff0d 100644 --- a/fileio/rdfile.h +++ b/fileio/rdfile.h @@ -1,3 +1,5 @@ +#include "machdr.h" + #define ISATEND 0 #define ISFILE 1 #define ISDIR 2 diff --git a/fileio/rdfileopt.h b/fileio/rdfileopt.h index 74cafa1..cb1248f 100644 --- a/fileio/rdfileopt.h +++ b/fileio/rdfileopt.h @@ -1,5 +1,5 @@ -extern int rdfileopt(); -extern void give_rdfileopt(); -extern void set_norecurse(); -extern char *get_rdfileopt(); +extern int rdfileopt(int c); +extern void give_rdfileopt(void); +extern void set_norecurse(void); +extern char *get_rdfileopt(void); diff --git a/fileio/wrfile.c b/fileio/wrfile.c index 77f6a8a..2539fa3 100644 --- a/fileio/wrfile.c +++ b/fileio/wrfile.c @@ -4,6 +4,7 @@ #include #endif /* TYPES_H */ #include +#include #include #include #include @@ -44,17 +45,17 @@ char *sprintf(); #endif /* UNDEF */ #ifdef AUFS -static void check_aufs(); -static void aufs_namings(); -static void wr_aufs_info(); +static void check_aufs(void); +static void aufs_namings(void); +static void wr_aufs_info(FILE* fp); #endif /* AUFS */ #ifdef APPLEDOUBLE -static void check_appledouble(); -static void appledouble_namings(); -static void wr_appledouble_info(); +static void check_appledouble(void); +static void appledouble_namings(void); +static void wr_appledouble_info(FILE* fp); #endif /* APPLEDOUBLE */ #ifdef APPLESHARE -static void mk_share_name(); +static void mk_share_name(void); #endif /* APPLESHARE */ #ifndef BSD @@ -531,7 +532,7 @@ int i; #ifdef APPLESHARE #ifdef AUFS -static void check_aufs() +static void check_aufs(void) { /* check for .resource/ and .finderinfo/ */ struct stat stbuf; @@ -557,7 +558,7 @@ static void check_aufs() } } -static void aufs_namings() +static void aufs_namings(void) { mk_share_name(); (void)sprintf(f_info_aufs, "%s/%s", infodir, share_name); @@ -565,8 +566,7 @@ static void aufs_namings() (void)sprintf(f_data, "%s", share_name); } -static void wr_aufs_info(fp) -FILE *fp; +static void wr_aufs_info(FILE* fp) { FileInfo theinfo; int n; @@ -601,7 +601,7 @@ FILE *fp; #endif /* AUFS */ #ifdef APPLEDOUBLE -static void check_appledouble() +static void check_appledouble(void) { /* check for .AppleDouble/ */ struct stat stbuf; @@ -620,15 +620,14 @@ static void check_appledouble() } } -static void appledouble_namings() +static void appledouble_namings(void) { mk_share_name(); (void)snprintf(f_info_appledouble, sizeof(f_info_appledouble), "%s/%s", infodir, share_name); (void)snprintf(f_data, sizeof(f_data), "%s", share_name); } -static void wr_appledouble_info(fp) -FILE *fp; +static void wr_appledouble_info(FILE* fp) { FileInfo theinfo; int n; @@ -673,7 +672,7 @@ FILE *fp; } #endif /* APPLEDOUBLE */ -static void mk_share_name() +static void mk_share_name(void) { int ch; char *mp, *up; @@ -693,8 +692,7 @@ static void mk_share_name() } #endif /* APPLESHARE */ -int wrfileopt(c) -char c; +int wrfileopt(char c) { switch(c) { case 'b': @@ -767,7 +765,7 @@ char c; return 1; } -void give_wrfileopt() +void give_wrfileopt(void) { (void)fprintf(stderr, "File output options:\n"); (void)fprintf(stderr, "-b:\tMacBinary (default)\n"); @@ -810,7 +808,7 @@ void set_s_wrfileopt(int restricted) mode_s_restricted = restricted; } -char *get_wrfileopt() +char *get_wrfileopt(void) { static char options[20]; diff --git a/fileio/wrfile.h b/fileio/wrfile.h index ac05b32..f050750 100644 --- a/fileio/wrfile.h +++ b/fileio/wrfile.h @@ -8,7 +8,7 @@ extern void start_rsrc(void); extern void start_data(void); extern void end_file(void); #ifdef SCAN -extern void do_idf(); +extern void do_idf(char *name, int kind); #endif /* SCAN */ extern void do_mkdir(char *name, char *header); extern void enddir(void); diff --git a/fileio/wrfileopt.h b/fileio/wrfileopt.h index da3083a..0011909 100644 --- a/fileio/wrfileopt.h +++ b/fileio/wrfileopt.h @@ -1,6 +1,6 @@ -extern int wrfileopt(); -extern void give_wrfileopt(); -extern void set_wrfileopt(); -extern void set_s_wrfileopt(); -extern char *get_wrfileopt(); +extern int wrfileopt(char c); +extern void give_wrfileopt(void); +extern void set_wrfileopt(int restricted); +extern void set_s_wrfileopt(int restricted); +extern char *get_wrfileopt(void); diff --git a/hexbin/buffer.h b/hexbin/buffer.h index 1bd2dfa..77ad455 100644 --- a/hexbin/buffer.h +++ b/hexbin/buffer.h @@ -1,6 +1,6 @@ extern char *data_fork, *rsrc_fork; extern int data_size, rsrc_size; -extern void put_byte(); -extern void set_put(); -extern void end_put(); +extern void put_byte(int c); +extern void set_put(int data); +extern void end_put(void); diff --git a/hexbin/dl.c b/hexbin/dl.c index f0e0495..f1f8d6d 100644 --- a/hexbin/dl.c +++ b/hexbin/dl.c @@ -6,6 +6,7 @@ #include "../fileio/machdr.h" #include "../fileio/wrfile.h" #include "../util/util.h" +#include "../util/transname.h" #include "buffer.h" #include "printhdr.h" diff --git a/hexbin/globals.h b/hexbin/globals.h index 88c5110..0dd7655 100644 --- a/hexbin/globals.h +++ b/hexbin/globals.h @@ -2,15 +2,12 @@ #include #include #ifdef BSD -extern char *rindex(); +#include #define search_last rindex #else /* BSD */ -extern char *strrchr(); #define search_last strrchr #endif /* BSD */ -extern void transname(); - extern char info[]; extern char trname[]; @@ -36,5 +33,5 @@ extern int was_macbin; extern FILE *ifp; -extern void do_error(); +extern void do_error(char *string); diff --git a/hexbin/hecx.c b/hexbin/hecx.c index 7c7314f..a05c85b 100644 --- a/hexbin/hecx.c +++ b/hexbin/hecx.c @@ -4,6 +4,7 @@ #include "crc.h" #include "readline.h" #include "../util/masks.h" +#include "../util/transname.h" #include "../util/util.h" #include "../fileio/machdr.h" #include "../fileio/wrfile.h" @@ -12,13 +13,13 @@ #include -static void do_o_forks(); -static int32_t make_file(); -static void comp_c_crc(); -static void comp_e_crc(); -static int comp_to_bin(); -static int hex_to_bin(); -static int hexit(); +static void do_o_forks(void); +static int32_t make_file(int compressed); +static void comp_c_crc(int c); +static void comp_e_crc(int c); +static int comp_to_bin(void); +static int hex_to_bin(void); +static int hexit(int c); static int compressed; diff --git a/hexbin/hqx.c b/hexbin/hqx.c index adc5255..c0e8a6b 100644 --- a/hexbin/hqx.c +++ b/hexbin/hqx.c @@ -9,6 +9,7 @@ #include "../fileio/machdr.h" #include "../fileio/wrfile.h" #include "../util/util.h" +#include "../util/transname.h" #include "printhdr.h" static void get_header(void); diff --git a/hexbin/mu.c b/hexbin/mu.c index 4633379..939f20d 100644 --- a/hexbin/mu.c +++ b/hexbin/mu.c @@ -5,6 +5,7 @@ #include "readline.h" #include "../util/masks.h" #include "../util/util.h" +#include "../util/transname.h" #include "../fileio/machdr.h" #include "../fileio/wrfile.h" #include "buffer.h" @@ -12,9 +13,9 @@ #include -static void do_mu_fork(); -static int mu_comp_to_bin(); -static int mu_convert(); +static void do_mu_fork(void); +static int mu_comp_to_bin(void); +static int mu_convert(char *ibuf, char *obuf); /* mu format -- process .mu files */ void diff --git a/hexbin/printhdr.c b/hexbin/printhdr.c index d9ded7b..e8bd634 100644 --- a/hexbin/printhdr.c +++ b/hexbin/printhdr.c @@ -1,5 +1,6 @@ #include "printhdr.h" #include "globals.h" +#include "../util/transname.h" /* print out header information in human-readable format */ void print_header0(int skip) diff --git a/hexbin/printhdr.h b/hexbin/printhdr.h index 2cda600..4a8a667 100644 --- a/hexbin/printhdr.h +++ b/hexbin/printhdr.h @@ -1,4 +1,4 @@ -extern void print_header0(); -extern void print_header1(); -extern void print_header2(); +extern void print_header0(int skip); +extern void print_header1(int skip1, int skip2); +extern void print_header2(int skip); diff --git a/hexbin/readline.h b/hexbin/readline.h index bebe741..18d4b20 100644 --- a/hexbin/readline.h +++ b/hexbin/readline.h @@ -1,3 +1,3 @@ extern char line[]; -int readline(); +int readline(void); diff --git a/macunpack/bin.c b/macunpack/bin.c index 8bc757e..cef10f6 100644 --- a/macunpack/bin.c +++ b/macunpack/bin.c @@ -1,6 +1,7 @@ #include "macunpack.h" #include "bin.h" #ifdef BIN +#include #include #include "globals.h" #include "../fileio/machdr.h" diff --git a/macunpack/bits_be.h b/macunpack/bits_be.h index 3f8e549..18abbf9 100644 --- a/macunpack/bits_be.h +++ b/macunpack/bits_be.h @@ -4,7 +4,7 @@ extern unsigned int bit_be_bitbuf; extern char *bit_be_filestart; extern int bit_be_inbytes; -extern void bit_be_fillbuf(); -extern unsigned int bit_be_getbits(); -extern void bit_be_init_getbits(); +extern void bit_be_fillbuf(int n); +extern unsigned int bit_be_getbits(int n); +extern void bit_be_init_getbits(void); diff --git a/macunpack/cpt.c b/macunpack/cpt.c index c6fdc24..a830d32 100644 --- a/macunpack/cpt.c +++ b/macunpack/cpt.c @@ -5,15 +5,19 @@ #endif /* CPT */ #endif /* DD */ #ifdef CPT + +#define CPT_INTERNAL +#include "cpt.h" + #include #include "globals.h" -#include "cpt.h" #include "crc.h" #include "../util/util.h" #include "../fileio/machdr.h" #include "../fileio/wrfile.h" #include "../fileio/kind.h" #include "../util/masks.h" +#include "../util/transname.h" #include "huffman.h" #define ESC1 0x81 @@ -22,7 +26,6 @@ #define ESC1SEEN 1 #define ESC2SEEN 2 -static void cpt_uncompact(); static unsigned char *cpt_data; static uint32_t cpt_datamax; static uint32_t cpt_datasize; @@ -42,17 +45,17 @@ static int cpt_blocksize; static node cpt_Hufftree[512 + SLACK], cpt_LZlength[128 + SLACK], cpt_LZoffs[256 + SLACK]; -static int readcpthdr(); -static int cpt_filehdr(); -static void cpt_folder(); -static void cpt_uncompact(); -static void cpt_wrfile(); -static void cpt_outch(); -static void cpt_rle(); -static void cpt_rle_lzh(); -static void cpt_readHuff(); -static int cpt_get6bits(); -static int cpt_getbit(); +static int readcpthdr(struct cptHdr *s); +static int cpt_filehdr(struct cpt_fileHdr *f, char *hdr); +static void cpt_folder(char *name, struct cpt_fileHdr fileh, char *cptptr); +static void cpt_uncompact(struct cpt_fileHdr filehdr); +static void cpt_wrfile(uint32_t ibytes, uint32_t obytes, int type); +static void cpt_outch(int ch); +static void cpt_rle(void); +static void cpt_rle_lzh(void); +static void cpt_readHuff(int size, struct node *Hufftree); +static int cpt_get6bits(void); +static int cpt_getbit(void); void cpt (void) diff --git a/macunpack/cpt.h b/macunpack/cpt.h index cf53a63..0994eae 100644 --- a/macunpack/cpt.h +++ b/macunpack/cpt.h @@ -1,3 +1,7 @@ +#include "macunpack.h" +#ifdef CPT +#ifdef CPT_INTERNAL + #include #define C_SIGNATURE 0 @@ -93,9 +97,13 @@ typedef struct cpt_fileHdr { /* 78 bytes */ #define CIRCSIZE 8192 +#endif void cpt_wrfile1 (unsigned char *in_char, uint32_t ibytes, uint32_t obytes, int type, uint32_t blocksize); +void cpt (void); + +#endif diff --git a/macunpack/dd.c b/macunpack/dd.c index fb58788..cedc922 100644 --- a/macunpack/dd.c +++ b/macunpack/dd.c @@ -13,34 +13,35 @@ #include "../fileio/fileglob.h" #include "../util/masks.h" #include "../util/util.h" +#include "../util/transname.h" -static void dd_name(); -static int dd_filehdr(); -static void dd_cfilehdr(); -static int dd_valid(); -static int dd_valid1(); -static char *dd_methname(); -static uint32_t dd_checksum(); -static void dd_chksum(); -static uint32_t dd_checkor(); -static void dd_do_delta(); -static void dd_delta(); -static void dd_delta3(); -static void dd_copy(); -static void dd_copyfile(); -static void dd_expand(); -static void dd_expandfile(); -static void dd_nocomp(); -static void dd_lzc(); +static void dd_name(unsigned char *bin_hdr); +static int dd_filehdr(struct dd_fileHdr *f, struct dd_fileCHdr *cf, int skip); +static void dd_cfilehdr(struct dd_fileCHdr *f); +static int dd_valid(int dmethod, int rmethod); +static int dd_valid1(int method); +static char *dd_methname(int n); +static uint32_t dd_checksum(uint32_t init, char *buffer, uint32_t length); +static void dd_chksum(struct dd_fileHdr hdr, unsigned char *data); +static uint32_t dd_checkor(uint32_t init, char *buffer, uint32_t length); +static void dd_do_delta(char *out_ptr, uint32_t nbytes, int kind); +static void dd_delta(char *out_ptr, uint32_t nbytes); +static void dd_delta3(char *out_ptr, uint32_t nbytes); +static void dd_copy(struct dd_fileHdr hdr, unsigned char *data); +static void dd_copyfile(uint32_t obytes, unsigned char *data); +static void dd_expand(struct dd_fileCHdr hdr, unsigned char *data); +static void dd_expandfile(uint32_t obytes, uint32_t ibytes, int method, int kind, unsigned char *data, uint32_t chksum); +static void dd_nocomp(uint32_t obytes, unsigned char *data); +static void dd_lzc(uint32_t ibytes, uint32_t obytes, unsigned char *data, int mb, uint32_t chksum, uint32_t ckinit); #ifdef UNTESTED -static void dd_rle(); +static void dd_rle(uint32_t ibytes, unsigned char *data); #ifdef NOTIMPLEMENTED -static void dd_huffman(); +static void dd_huffman(uint32_t ibytes, unsigned char *data); #endif /* NOTIMPLEMENTED */ -static void dd_lzss(); -static int dd_getbits(); +static void dd_lzss(unsigned char *data, uint32_t chksum); +static int dd_getbits(int n); #endif /* UNTESTED */ -static void dd_cpt_compat(); +static void dd_cpt_compat(uint32_t ibytes, uint32_t obytes, unsigned char *data, int sub_method, uint32_t chksum); typedef struct methodinfo { char *name; diff --git a/macunpack/de_compress.c b/macunpack/de_compress.c index f5129c1..255d23c 100644 --- a/macunpack/de_compress.c +++ b/macunpack/de_compress.c @@ -1,4 +1,7 @@ #include "de_compress.h" + +#include + #include "macunpack.h" #ifdef SIT #define DECOMPRESS @@ -32,7 +35,7 @@ static unsigned short codetab [HSIZE]; static int32_t free_ent = 0; /* first unused entry */ -static int32_t getcode(); +static int32_t getcode(void); static int clear_flg = 0; @@ -121,8 +124,8 @@ static unsigned char rmask[9] = static int get_core_bytes; static char *core_ptr; -static int file_bytes(); -static int core_bytes(); +static int file_bytes(char *buf, int length); +static int core_bytes(char *buf, int length); static int32_t getcode (void) diff --git a/macunpack/de_huffman.c b/macunpack/de_huffman.c index 8f870b1..36d300c 100644 --- a/macunpack/de_huffman.c +++ b/macunpack/de_huffman.c @@ -23,15 +23,15 @@ #include "huffman.h" #include "../util/util.h" -int (*get_bit)(); +int (*get_bit)(void); int bytesread; /* 515 because StuffIt Classic needs more than the needed 511 */ struct node nodelist[515]; -static int getbit_be(); -static int getbit_le(); -static int getdecodebyte(); +static int getbit_be(void); +static int getbit_le(void); +static int getdecodebyte(void); -static node *nodeptr, *read_sub_tree(); +static node *nodeptr, *read_sub_tree(void); static int bit; @@ -72,7 +72,7 @@ read_tree (void) /* This routine recursively reads the Huffman encoding table and builds a decoding tree. */ -static node *read_sub_tree() +static node *read_sub_tree(void) { node *np; diff --git a/macunpack/de_huffman.h b/macunpack/de_huffman.h index 5bc18bc..746b6bc 100644 --- a/macunpack/de_huffman.h +++ b/macunpack/de_huffman.h @@ -1,6 +1,6 @@ #include void set_huffman(int endian); -void read_tree(); +void read_tree(void); void de_huffman(uint32_t obytes); void de_huffman_end(unsigned int term); \ No newline at end of file diff --git a/macunpack/de_lzah.c b/macunpack/de_lzah.c index 5af542d..fec324c 100644 --- a/macunpack/de_lzah.c +++ b/macunpack/de_lzah.c @@ -79,13 +79,13 @@ static short HuffLength[] = { 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8}; -unsigned char (*lzah_getbyte)(); +unsigned char (*lzah_getbyte)(void); -static void lzah_inithuf(); -static void lzah_reorder(); +static void lzah_inithuf(void); +static void lzah_reorder(void); static void lzah_move(int *p, int *q, int n); -static void lzah_getbit(); -static void lzah_outchar(); +static void lzah_getbit(void); +static void lzah_outchar(int ch); static char lzah_buf[4096]; static int lzah_bufptr; diff --git a/macunpack/de_lzah.h b/macunpack/de_lzah.h index 4f326ad..06606ff 100644 --- a/macunpack/de_lzah.h +++ b/macunpack/de_lzah.h @@ -4,7 +4,7 @@ #include extern void de_lzah(uint32_t obytes); -extern unsigned char (*lzah_getbyte)(); +extern unsigned char (*lzah_getbyte)(void); extern void de_lzh(int32_t ibytes, int32_t obytes, char **data, int bits); #endif diff --git a/macunpack/de_lzh.c b/macunpack/de_lzh.c index 182bafc..9a7d92e 100644 --- a/macunpack/de_lzh.c +++ b/macunpack/de_lzh.c @@ -19,9 +19,9 @@ static int decoded; static int bitsused; static unsigned int blocksize; -static unsigned int decode_c(); -static unsigned int decode_p(); -static void make_table(); +static unsigned int decode_c(void); +static unsigned int decode_p(void); +static void make_table(int nchar, unsigned char bitlen[], int tablebits, unsigned int table[]); /* lzh compression */ void de_lzh(int32_t ibytes, int32_t obytes, char **data, int bits) diff --git a/macunpack/dia.c b/macunpack/dia.c index a3090ee..ba37e5c 100644 --- a/macunpack/dia.c +++ b/macunpack/dia.c @@ -1,11 +1,14 @@ #include "macunpack.h" #ifdef DIA +#define DIA_INTERNAL +#include "dia.h" + #include #include #include "globals.h" -#include "dia.h" #include "../util/curtime.h" #include "../util/masks.h" +#include "../util/transname.h" #include "../fileio/machdr.h" #include "../fileio/wrfile.h" #include "../fileio/kind.h" @@ -26,14 +29,14 @@ static int dia_LZtab[BCHUNKSIZE]; static unsigned char *dia_bit_base; static int dia_imask; -static void dia_folder(); -static void dia_file(); -static void dia_getlength(); -static void dia_skipfork(); -static void dia_getfork(); -static void dia_getblock(); -static int dia_decode(); -static int dia_prevbit(); +static void dia_folder(unsigned char *name); +static void dia_file(int indicator, unsigned char *name); +static void dia_getlength(int nblocks); +static void dia_skipfork(int nblocks); +static void dia_getfork(int nblocks); +static void dia_getblock(unsigned char **archive_ptr, unsigned char **block_ptr); +static int dia_decode(unsigned char *ibuff, unsigned char *obuff, int in_length); +static int dia_prevbit(void); void dia (unsigned char *bin_hdr) diff --git a/macunpack/dia.h b/macunpack/dia.h index 10c73e2..d63930f 100644 --- a/macunpack/dia.h +++ b/macunpack/dia.h @@ -1,3 +1,7 @@ +#include "macunpack.h" +#ifdef DIA +#ifdef DIA_INTERNAL + #define IS_FOLDER 0x80 #define F_INFO 0x40 #define VOLUME 0x30 @@ -20,3 +24,8 @@ #define NOCOMP 1 #define COMP 2 + +#endif +void dia (unsigned char *bin_hdr); + +#endif diff --git a/macunpack/dir.c b/macunpack/dir.c index 1d9ba6b..90f8ad5 100644 --- a/macunpack/dir.c +++ b/macunpack/dir.c @@ -1,9 +1,12 @@ +#include "dir.h" + #include #include "globals.h" #include "../fileio/machdr.h" #include "../fileio/wrfile.h" #include "../util/util.h" #include "../util/masks.h" +#include "../util/transname.h" static char *dir_stack; static int dir_ptr = -64; diff --git a/macunpack/dir.h b/macunpack/dir.h new file mode 100644 index 0000000..3cddc0e --- /dev/null +++ b/macunpack/dir.h @@ -0,0 +1 @@ +void dir (char *hdr); \ No newline at end of file diff --git a/macunpack/globals.h b/macunpack/globals.h index e431048..502d2c2 100644 --- a/macunpack/globals.h +++ b/macunpack/globals.h @@ -1,8 +1,6 @@ #include -extern void exit(); -extern void transname(); -extern void do_error(); +void do_error (char *string); extern char info[]; extern char text[]; diff --git a/macunpack/huffman.h b/macunpack/huffman.h index 30bafe8..7a1f397 100644 --- a/macunpack/huffman.h +++ b/macunpack/huffman.h @@ -6,10 +6,10 @@ typedef struct node { struct node *one, *zero; } node; -extern int (*get_bit)(); -extern void clrhuff(); +extern int (*get_bit)(void); +extern void clrhuff(void); int gethuffbyte(node *l_nodelist); -int getihuffbyte(); +int getihuffbyte(void); extern struct node nodelist[]; extern int bytesread; diff --git a/macunpack/jdw.c b/macunpack/jdw.c index 172502b..5b163a4 100644 --- a/macunpack/jdw.c +++ b/macunpack/jdw.c @@ -1,17 +1,20 @@ #include "macunpack.h" #ifdef JDW +#define JDW_INTERNAL #include "jdw.h" + #include "globals.h" #include "huffman.h" #include "de_huffman.h" #include "../fileio/wrfile.h" #include "../fileio/machdr.h" #include "../util/util.h" +#include "../util/transname.h" #include "../util/masks.h" -static void jdw_wrfile(); -static void jdw_wrfork(); -static void jdw_block(); +static void jdw_wrfile(uint32_t rsrcLength, uint32_t dataLength); +static void jdw_wrfork(uint32_t length); +static void jdw_block(int olength); void jdw (uint32_t ibytes) diff --git a/macunpack/jdw.h b/macunpack/jdw.h index 88411d4..6ac7783 100644 --- a/macunpack/jdw.h +++ b/macunpack/jdw.h @@ -1,3 +1,7 @@ +#include "macunpack.h" +#ifdef JDW +#ifdef JDW_INTERNAL + #include #define J_MAGIC 0 @@ -23,3 +27,6 @@ typedef struct jdw_fileHdr { char fname[32]; /* actually flength */ } jdw_fileHdr; +#endif +void jdw (uint32_t ibytes); +#endif \ No newline at end of file diff --git a/macunpack/lzc.c b/macunpack/lzc.c index c349c99..5095e30 100644 --- a/macunpack/lzc.c +++ b/macunpack/lzc.c @@ -1,18 +1,22 @@ #include "macunpack.h" #ifdef LZC -#include -#include "globals.h" +#define LZC_INTERNAL #include "lzc.h" + +#include +#include +#include "globals.h" #include "../util/util.h" #include "../fileio/machdr.h" #include "../fileio/wrfile.h" #include "../util/masks.h" +#include "../util/transname.h" #include "de_compress.h" #include "mcb.h" -static void lzc_zivm(); -static void lzc_wrfile(); -static void lzc_zivu(); +static void lzc_zivm(char *ohdr); +static void lzc_wrfile(uint32_t obytes, uint32_t ibytes); +static void lzc_zivu(char *ohdr); void lzc (char *ohdr) diff --git a/macunpack/lzc.h b/macunpack/lzc.h index 10f7b96..b3d112a 100644 --- a/macunpack/lzc.h +++ b/macunpack/lzc.h @@ -1,3 +1,7 @@ +#include "macunpack.h" +#ifdef LZC +#ifdef LZC_INTERNAL + #include #define HEADERBYTES 48 @@ -28,3 +32,6 @@ typedef struct lzc_fileHdr { uint32_t flag1; uint32_t flag2; } lzc_fileHdr; +#endif +void lzc (char *ohdr); +#endif diff --git a/macunpack/lzh.c b/macunpack/lzh.c index 26a637f..83a884a 100644 --- a/macunpack/lzh.c +++ b/macunpack/lzh.c @@ -1,4 +1,7 @@ #include "macunpack.h" + +#define LZH_INTERNAL + #include #include #include "globals.h" @@ -7,8 +10,10 @@ #include "../fileio/wrfile.h" #include "../fileio/machdr.h" #include "../util/masks.h" +#include "../util/transname.h" #include "../util/util.h" #include "bits_be.h" +#include "de_lzah.h" #define LZ5LOOKAHEAD 18 /* look ahead buffer size for LArc */ #define LZ5BUFFSIZE 8192 @@ -18,10 +23,6 @@ #define LZSMASK 4095 #define LZBUFFSIZE 8192 /* Max of above buffsizes */ -extern void de_lzah(); -extern unsigned char (*lzah_getbyte)(); -extern void de_lzh(); - typedef struct methodinfo { char *name; int number; @@ -51,26 +52,26 @@ static char *lzh_current; static char *tmp_out_ptr; static char lzh_lzbuf[LZBUFFSIZE]; -static int lzh_filehdr(); -static int lzh_checkm(); -static char *lzh_methname(); -static void lzh_wrfile(); -static void lzh_skip(); -static void lzh_nocomp(); +static int lzh_filehdr(struct lzh_fileHdr *f); +static int lzh_checkm(struct lzh_fileHdr *f); +static char *lzh_methname(int n); +static void lzh_wrfile(struct lzh_fileHdr *filehdr, int method); +static void lzh_skip(struct lzh_fileHdr *filehdr); +static void lzh_nocomp(uint32_t obytes); #ifdef UNTESTED -static void lzh_lzss1(); -static void lzh_lzss2(); +static void lzh_lzss1(uint32_t obytes); +static void lzh_lzss2(uint32_t obytes); #endif /* UNTESTED */ -static void lzh_lzah(); -static unsigned char lzh_getbyte(); +static void lzh_lzah(uint32_t obytes); +static unsigned char lzh_getbyte(void); #ifdef UNDEF -static void lzh_lh2(); -static void lzh_lh3(); +static void lzh_lh2(uint32_t obytes); +static void lzh_lh3(uint32_t obytes); #endif /* UNDEF */ #ifdef UNTESTED -static void lzh_lzh12(); +static void lzh_lzh12(uint32_t obytes); #endif /* UNTESTED */ -static void lzh_lzh13(); +static void lzh_lzh13(uint32_t obytes); void lzh (int kind) diff --git a/macunpack/lzh.h b/macunpack/lzh.h index b572a56..7cbcd95 100644 --- a/macunpack/lzh.h +++ b/macunpack/lzh.h @@ -1,3 +1,7 @@ +#include "macunpack.h" +#ifdef LZH +#ifdef LZH_INTERNAL + #include #define FILEHDRSIZE 22 @@ -59,3 +63,9 @@ typedef struct lzh_fileHdr { /* 58 bytes */ #define lz4 6 #define lz5 7 #define lzs 8 + +#endif + +void lzh (int kind); + +#endif diff --git a/macunpack/macbinary.c b/macunpack/macbinary.c index 08bf6eb..986ee85 100644 --- a/macunpack/macbinary.c +++ b/macunpack/macbinary.c @@ -1,49 +1,38 @@ #include "macunpack.h" +#include "macbinary.h" + +#include #include -#include "globals.h" +#include "../fileio/kind.h" #include "../fileio/machdr.h" #include "../fileio/wrfile.h" -#include "../fileio/kind.h" -#include "zmahdr.h" #include "../util/util.h" -#include "stf.h" -#include "mcb.h" #include "bin.h" #include "dd.h" +#include "dir.h" +#include "globals.h" +#include "mcb.h" #include "sit.h" +#include "stf.h" +#include "zmahdr.h" +#include "jdw.h" +#include "lzc.h" +#include "pit.h" +#include "dia.h" +#include "cpt.h" +#include "zma.h" +#include "lzh.h" -extern void dir(char *hdr); -#ifdef JDW -extern void jdw(); -#endif /* JDW */ -#ifdef LZC -extern void lzc(); -#endif /* LZC */ #ifdef ASQ extern void asq(); #endif /* ASQ */ #ifdef ARC extern void arc(); #endif /* ARC */ -#ifdef PIT -extern void pit(); -#endif /* PIT */ -#ifdef DIA -extern void dia(); -#endif /* DIA */ -#ifdef CPT -extern void cpt(); -#endif /* CPT */ -#ifdef ZMA -extern void zma(); -#endif /* ZMA */ -#ifdef LZH -extern void lzh(); -#endif /* LZH */ -static void skip_file(); +static void skip_file(int skip); #ifdef SCAN -static void get_idf(); +static void get_idf(int kind); #endif /* SCAN */ #define Z (ZMAHDRS2 + 1) diff --git a/macunpack/macbinary.h b/macunpack/macbinary.h new file mode 100644 index 0000000..9d8049e --- /dev/null +++ b/macunpack/macbinary.h @@ -0,0 +1 @@ +void macbinary (void); diff --git a/macunpack/macunpack.c b/macunpack/macunpack.c index 09546e4..7e7a40a 100644 --- a/macunpack/macunpack.c +++ b/macunpack/macunpack.c @@ -1,4 +1,7 @@ #include "macunpack.h" + +#include +#include #include #include "globals.h" #include "../util/patchlevel.h" @@ -6,25 +9,15 @@ #include "../fileio/wrfileopt.h" #include "../fileio/kind.h" #include "../util/util.h" +#include "stf.h" +#include "pit.h" +#include "sit.h" +#include "cpt.h" +#include "macbinary.h" #define LOCALOPT "ilvqVH" -extern char *strcat(); -#ifdef STF -extern void stf(); -#endif /* STF */ -#ifdef PIT -extern void pit(); -#endif /* PIT */ -#ifdef SIT -extern void sit(); -#endif /* SIT */ -#ifdef CPT -extern void cpt(); -#endif /* CPT */ -void macbinary(); - -static void usage(); +static void usage(void); static char options[128]; diff --git a/macunpack/mcb.c b/macunpack/mcb.c index e713106..5d49c87 100644 --- a/macunpack/mcb.c +++ b/macunpack/mcb.c @@ -1,12 +1,17 @@ +#include "mcb.h" + +#include + #include "globals.h" #include "../fileio/machdr.h" #include "../fileio/wrfile.h" #include "../util/masks.h" #include "../util/util.h" +#include "../util/transname.h" static int mcb_read; -static void mcb_wrfile(); +static void mcb_wrfile(uint32_t ibytes); void mcb(char *hdr, uint32_t rsrcLength, uint32_t dataLength, int toread) { diff --git a/macunpack/mcb.h b/macunpack/mcb.h index c356c6a..1fc86e6 100644 --- a/macunpack/mcb.h +++ b/macunpack/mcb.h @@ -1 +1,3 @@ +#include + extern void mcb(char *hdr, uint32_t rsrcLength, uint32_t dataLength, int toread); diff --git a/macunpack/pit.c b/macunpack/pit.c index 17f594d..85dab1d 100644 --- a/macunpack/pit.c +++ b/macunpack/pit.c @@ -1,22 +1,26 @@ #include "macunpack.h" #ifdef PIT +#define PIT_INTERNAL +#include "pit.h" + +#include #include -#include "../fileio/wrfile.h" #include "../fileio/fileglob.h" #include "../fileio/kind.h" -#include "globals.h" -#include "pit.h" #include "../fileio/machdr.h" -#include "crc.h" +#include "../fileio/wrfile.h" #include "../util/masks.h" +#include "../util/transname.h" #include "../util/util.h" -#include "huffman.h" +#include "crc.h" #include "de_huffman.h" +#include "globals.h" +#include "huffman.h" -static int pit_filehdr(); -static void pit_wrfile(); -static void pit_nocomp(); -static void pit_huffman(); +static int pit_filehdr(struct pit_header *f, int compr); +static void pit_wrfile(uint32_t bytes, int type); +static void pit_nocomp(uint32_t ibytes); +static void pit_huffman(uint32_t obytes); void pit (void) diff --git a/macunpack/pit.h b/macunpack/pit.h index 0292b59..cdf0958 100644 --- a/macunpack/pit.h +++ b/macunpack/pit.h @@ -1,3 +1,9 @@ +#include "macunpack.h" +#ifdef PIT +#ifdef PIT_INTERNAL + +#include + #define H_NAMELEN 63 #define H_NLENOFF 0 @@ -30,3 +36,8 @@ struct pit_header { /* Packit file header (92 bytes) */ #define nocomp 0 #define huffman 1 +#endif + +void pit (void); + +#endif diff --git a/macunpack/sit.c b/macunpack/sit.c index 2d8ea66..ad5f61e 100644 --- a/macunpack/sit.c +++ b/macunpack/sit.c @@ -4,6 +4,7 @@ #ifdef SIT #include +#include #include "globals.h" #include "crc.h" #include "../util/util.h" @@ -11,6 +12,7 @@ #include "../fileio/wrfile.h" #include "../fileio/kind.h" #include "../util/masks.h" +#include "../util/transname.h" #include "huffman.h" #include "de_compress.h" #include "de_huffman.h" @@ -33,26 +35,26 @@ static struct methodinfo methods[] = { }; static int sit_nodeptr; -static int readsithdr(); -static int sit_filehdr(); -static int sit_valid(); -static int sit_checkm(); -static char *sit_methname(); -static void sit_folder(); -static void sit_unstuff(); -static void sit_wrfile(); -static void sit_skip(); -static void sit_nocomp(); -static void sit_rle(); -static void sit_lzc(); -static void sit_huffman(); -static void sit_lzah(); -static unsigned char sit_getbyte(); -static void sit_fixhuf(); -static void sit_dosplit(); -static void sit_mw(); -static void sit_mw_out(); -static int sit_mw_in(); +static int readsithdr(sitHdr *s); +static int sit_filehdr(struct sit_fileHdr *f, int skip); +static int sit_valid(struct sit_fileHdr f); +static int sit_checkm(int f); +static char *sit_methname(int n); +static void sit_folder(char *name); +static void sit_unstuff(struct sit_fileHdr filehdr); +static void sit_wrfile(uint32_t ibytes, uint32_t obytes, int type); +static void sit_skip(uint32_t ibytes); +static void sit_nocomp(uint32_t ibytes); +static void sit_rle(uint32_t ibytes); +static void sit_lzc(uint32_t ibytes); +static void sit_huffman(uint32_t obytes); +static void sit_lzah(uint32_t obytes); +static unsigned char sit_getbyte(void); +static void sit_fixhuf(uint32_t ibytes); +static void sit_dosplit(int ptr, int sum, int low, int upp); +static void sit_mw(uint32_t ibytes); +static void sit_mw_out(int ptr); +static int sit_mw_in(int bits, uint32_t *ibytes); static short code6[258] = { 1024, 512, 256, 256, 256, 256, 128, 128, diff --git a/macunpack/stf.c b/macunpack/stf.c index c9f12a9..973e13e 100644 --- a/macunpack/stf.c +++ b/macunpack/stf.c @@ -1,16 +1,16 @@ #include "macunpack.h" #ifdef STF #include +#include #include "stf.h" #include "globals.h" #include "huffman.h" #include "../util/curtime.h" #include "../fileio/wrfile.h" #include "../fileio/machdr.h" +#include "../util/transname.h" #include "../util/util.h" - -extern void de_huffman(); -extern void set_huffman(); +#include "de_huffman.h" typedef struct{ int num; @@ -20,9 +20,9 @@ typedef struct{ static table_struct table[511]; static char length[256]; -static void stf_wrfile(); -static void stf_wrfork(); -static void stf_construct(); +static void stf_wrfile(uint32_t rsrcLength, uint32_t dataLength, uint32_t ibytes); +static void stf_wrfork(uint32_t *num, uint32_t towrite, int offs); +static void stf_construct(int n); void stf (uint32_t ibytes) diff --git a/macunpack/zma.c b/macunpack/zma.c index dbf5b62..82bb91a 100644 --- a/macunpack/zma.c +++ b/macunpack/zma.c @@ -1,17 +1,20 @@ #include "macunpack.h" #ifdef ZMA +#define ZMA_INTERNAL +#include "zma.h" + #include #include #include "globals.h" -#include "zma.h" + #include "crc.h" #include "../fileio/machdr.h" #include "../fileio/wrfile.h" #include "../fileio/kind.h" #include "../util/masks.h" +#include "../util/transname.h" #include "../util/util.h" - -extern void de_lzh(); +#include "de_lzah.h" /* We do allow for possible backpointing, so we allocate the archive in core */ static char *zma_archive; @@ -20,12 +23,12 @@ static char *zma_filestart; static uint32_t zma_length; static int32_t zma_archlength; -static int zma_filehdr(); -static void zma_folder(); -static void zma_mooz(); -static void zma_wrfile(); -static void zma_nocomp(); -static void zma_lzh(); +static int zma_filehdr(struct zma_fileHdr *f, int skip); +static void zma_folder(struct zma_fileHdr fhdr); +static void zma_mooz(struct zma_fileHdr filehdr); +static void zma_wrfile(uint32_t ibytes, uint32_t obytes, int type); +static void zma_nocomp(uint32_t ibytes); +static void zma_lzh(uint32_t ibytes); void zma (char *start, uint32_t length) diff --git a/macunpack/zma.h b/macunpack/zma.h index 02e23da..759291d 100644 --- a/macunpack/zma.h +++ b/macunpack/zma.h @@ -1,3 +1,7 @@ +#include "macunpack.h" +#ifdef ZMA +#ifdef ZMA_INTERNAL + #include "zmahdr.h" #include @@ -53,3 +57,8 @@ typedef struct zma_fileHdr { /* 78 bytes */ #define z_dir 3 /* directory */ #define z_plug 4 /* for plug in, not supported */ +#endif + +void zma (char *start, uint32_t length); + +#endif diff --git a/mixed/dir.c b/mixed/dir.c index 276fb34..dfa7206 100644 --- a/mixed/dir.c +++ b/mixed/dir.c @@ -1,8 +1,11 @@ +#include "dir.h" + #include #include "globals.h" #include "../fileio/machdr.h" #include "../fileio/wrfile.h" #include "../util/util.h" +#include "../util/transname.h" #include "../util/masks.h" static char *dir_stack; diff --git a/mixed/dir.h b/mixed/dir.h new file mode 100644 index 0000000..ea9aa45 --- /dev/null +++ b/mixed/dir.h @@ -0,0 +1 @@ +void dir(char *hdr); diff --git a/mixed/globals.h b/mixed/globals.h index 6c058e8..71cb2e6 100644 --- a/mixed/globals.h +++ b/mixed/globals.h @@ -1,8 +1,5 @@ #include -extern void exit(); -extern void transname(); - extern char info[]; extern char text[]; diff --git a/mixed/macbinary.c b/mixed/macbinary.c index 12e5f7e..5e2de54 100644 --- a/mixed/macbinary.c +++ b/mixed/macbinary.c @@ -1,15 +1,19 @@ +#include "macbinary.h" + #include "globals.h" + +#include + #include "../fileio/machdr.h" #include "../fileio/kind.h" #include "../util/util.h" +#include "dir.h" +#include "mcb.h" -extern void dir(); -extern void mcb(); -extern void do_indent(); -static void skip_file(); +static void skip_file(int skip); #ifdef SCAN -static void get_idf(); +static void get_idf(int kind); #endif /* SCAN */ void diff --git a/mixed/macbinary.h b/mixed/macbinary.h new file mode 100644 index 0000000..11e3148 --- /dev/null +++ b/mixed/macbinary.h @@ -0,0 +1 @@ +void macbinary (void); \ No newline at end of file diff --git a/mixed/macsave.c b/mixed/macsave.c index effecd0..85c929a 100644 --- a/mixed/macsave.c +++ b/mixed/macsave.c @@ -1,16 +1,17 @@ #include #include +#include + #include "globals.h" #include "../util/patchlevel.h" #include "../fileio/wrfile.h" #include "../fileio/wrfileopt.h" #include "../util/util.h" +#include "macbinary.h" #define LOCALOPT "ilqVH" -void macbinary(); - -static void usage(); +static void usage(void); static char options[128]; diff --git a/mixed/macstream.c b/mixed/macstream.c index 344d35e..22837c6 100644 --- a/mixed/macstream.c +++ b/mixed/macstream.c @@ -9,11 +9,9 @@ #include "../util/transname.h" #include "../util/util.h" -extern void do_indent(); - #define LOCALOPT "ilqVH" -static void usage(); +static void usage(void); static char options[128]; static char *dir_stack; diff --git a/mixed/mcb.c b/mixed/mcb.c index 016a1f4..3712057 100644 --- a/mixed/mcb.c +++ b/mixed/mcb.c @@ -1,12 +1,17 @@ +#include "mcb.h" + +#include + #include "globals.h" #include "../fileio/machdr.h" #include "../fileio/wrfile.h" #include "../util/masks.h" #include "../util/util.h" +#include "../util/transname.h" static int mcb_read; -static void mcb_wrfile(); +static void mcb_wrfile(uint32_t ibytes); void mcb (char *hdr, uint32_t rsrcLength, uint32_t dataLength, int toread) diff --git a/mixed/mcb.h b/mixed/mcb.h new file mode 100644 index 0000000..7eb528e --- /dev/null +++ b/mixed/mcb.h @@ -0,0 +1,3 @@ +#include + +void mcb (char *hdr, uint32_t rsrcLength, uint32_t dataLength, int toread); \ No newline at end of file diff --git a/util/curtime.h b/util/curtime.h index f3533ca..095e14e 100644 --- a/util/curtime.h +++ b/util/curtime.h @@ -4,7 +4,6 @@ #ifdef BSD #include -extern time_t time(); #else /* BSD */ #include #endif /* BSD */ diff --git a/util/util.h b/util/util.h index 4dbbec9..69a7fb5 100644 --- a/util/util.h +++ b/util/util.h @@ -1,4 +1,5 @@ #include +#include typedef struct real_time { int year;