From 1cb9ab528b090a9fe991852ed6c15214451fabb7 Mon Sep 17 00:00:00 2001 From: Ianos Gnatiuc Date: Sat, 6 May 2006 09:13:21 +0000 Subject: [PATCH] Refactoring! --- golded3/gckeys.cpp | 14 ++-- golded3/gcmisc.cpp | 47 +++++++------- goldlib/gall/gcrcall.h | 7 +- goldlib/gall/gfile.h | 6 +- goldlib/glibc/glob.c | 2 +- goldlib/glibc/regex.h | 134 +++++++++++++++------------------------ goldlib/uulib/fptools.h | 55 ++++++---------- goldlib/uulib/uudeview.h | 121 +++++++++++------------------------ goldlib/uulib/uuint.h | 73 ++++++++------------- 9 files changed, 171 insertions(+), 288 deletions(-) diff --git a/golded3/gckeys.cpp b/golded3/gckeys.cpp index 348b85f..d1544f4 100644 --- a/golded3/gckeys.cpp +++ b/golded3/gckeys.cpp @@ -997,11 +997,10 @@ bool operator<(CmdKey &a, CmdKey &b) { // ------------------------------------------------------------------ -int ReadKeysCfg(int force) { - +int ReadKeysCfg(int force) +{ byte ch; gkey* mac; - FILE *ifp; char* ptr; char* ptr2; int keytype; @@ -1011,8 +1010,8 @@ int ReadKeysCfg(int force) { uint line=0; const char* cfg = AddPath(CFG->goldpath, CFG->keyscfg); - ifp = fsopen(cfg, "rt", CFG->sharemode); - if (ifp) + gfile ifp(cfg, "rt", CFG->sharemode); + if (ifp.isopen()) { const char* cfgname = strrchr(cfg, '\\'); cfgname = cfgname ? cfgname+1 : cfg; @@ -1025,7 +1024,8 @@ int ReadKeysCfg(int force) { if(CFG->switches.get(keybdefaults)) SetKeybDefaults(); - while(fgets(buf, sizeof(buf), ifp)) { + while (ifp.Fgets(buf, sizeof(buf))) + { line++; ptr = strskip_wht(buf); if(*ptr == ';' or strblank(ptr)) @@ -1146,7 +1146,7 @@ int ReadKeysCfg(int force) { continue; } } - fclose(ifp); + ifp.Fclose(); } // Setup default keyset when no keys are defined diff --git a/golded3/gcmisc.cpp b/golded3/gcmisc.cpp index 2192430..cba3e1c 100644 --- a/golded3/gcmisc.cpp +++ b/golded3/gcmisc.cpp @@ -613,41 +613,42 @@ static int CmpEsc(const char* a, const char* b) { // ------------------------------------------------------------------ // Read the translation tables -void ReadXlatTables() { - - if(not CFG->xlatcharset.empty() or not CFG->xlatescset.empty()) { - +void ReadXlatTables() +{ + if (not CFG->xlatcharset.empty() or not CFG->xlatescset.empty()) + { Esc EscTable; Chs ChsTable; char buf[256]; char* ptr; char* ptr2; - FILE *ifp, *ofp; int line, n, x, y, ch=0; - ofp = fsopen(AddPath(CFG->goldpath, CFG->xlatged), "wb", CFG->sharemode); - if(ofp) { - + gfile ofp(AddPath(CFG->goldpath, CFG->xlatged), "wb", CFG->sharemode); + if (ofp.isopen()) + { // Compile CHARSET tables std::vector::iterator xlt; - for(xlt = CFG->xlatcharset.begin(); xlt != CFG->xlatcharset.end(); xlt++) { - + for (xlt = CFG->xlatcharset.begin(); xlt != CFG->xlatcharset.end(); xlt++) + { // Assign table defaults memset(&ChsTable, 0, sizeof(Chs)); for(n=0; n<256; n++) { ChsTable.t[n][0] = 1; ChsTable.t[n][1] = (uint8_t)n; // The character } + strcpy(buf, AddPath(CFG->xlatpath, xlt->mapfile)); - ifp = fsopen(buf, "rb", CFG->sharemode); - if (ifp) + gfile ifp(buf, "rb", CFG->sharemode); + if (ifp.isopen()) { if (not quiet) STD_PRINTNL("* Reading " << buf); // Read the definition file line = 1; - while(fgets(buf, sizeof(buf), ifp)) { + while (ifp.Fgets(buf, sizeof(buf))) + { ptr = buf; if(*ptr != ';' and not strblank(ptr)) { if((ptr2 = strchr(ptr+2, ';')) != NULL) @@ -722,29 +723,29 @@ void ReadXlatTables() { line++; } } - fclose(ifp); } else STD_PRINTNL("* XLAT table " << buf << " could not be opened."); - fwrite(&ChsTable, sizeof(Chs), 1, ofp); + ofp.Fwrite(&ChsTable, sizeof(Chs)); } // Compile ESCSET tables - for(xlt = CFG->xlatescset.begin(); xlt != CFG->xlatescset.end(); xlt++) { - + for (xlt = CFG->xlatescset.begin(); xlt != CFG->xlatescset.end(); xlt++) + { // Assign defaults memset(&EscTable, 0, sizeof(Esc)); strcpy(buf, AddPath(CFG->xlatpath, xlt->mapfile)); - ifp = fsopen(buf, "rb", CFG->sharemode); - if (ifp) + gfile ifp(buf, "rb", CFG->sharemode); + if (ifp.isopen()) { if (not quiet) STD_PRINTNL("* Reading " << buf); // Read the definition file line = 1; - while(fgets(buf, sizeof(buf), ifp)) { + while (ifp.Fgets(buf, sizeof(buf))) + { ptr = buf; if(*ptr != ';' and not strblank(ptr)) { if((ptr2 = strchr(ptr+2, ';')) != NULL) @@ -800,16 +801,12 @@ void ReadXlatTables() { } qsort(EscTable.t, EscTable.size, 5, (StdCmpCP)CmpEsc); - - fclose(ifp); } else STD_PRINTNL("* XLAT table " << buf << " could not be opened."); - fwrite(&EscTable, sizeof(Esc), 1, ofp); + ofp.Fwrite(&EscTable, sizeof(Esc)); } - - fclose(ofp); } } } diff --git a/goldlib/gall/gcrcall.h b/goldlib/gall/gcrcall.h index 49e7e87..e09b763 100644 --- a/goldlib/gall/gcrcall.h +++ b/goldlib/gall/gcrcall.h @@ -37,10 +37,8 @@ // ------------------------------------------------------------------ // Declare the CRC tables -extern "C" { extern word __crc16_table[]; extern dword __crc32_table[]; -} // ------------------------------------------------------------------ // Generate/update a CRC-16 or CRC-32 value @@ -76,6 +74,10 @@ dword strHash32(const char* s, bool nocase=true); word memCrc16(const void* m, long l, bool nocase=true, word mask=CRC16_MASK_NORMAL); dword memCrc32(const void* m, long l, bool nocase=true, dword mask=CRC32_MASK_NORMAL); +inline dword memCrc32(dword crc, const void* m, long l, bool nocase=true, dword mask=CRC32_MASK_NORMAL) +{ + return memCrc32(m, l, nocase, crc ^ mask) ^ mask; +} // ------------------------------------------------------------------ // Get keyword/value pairs and crc @@ -90,4 +92,3 @@ word getkeyvalcrc(char** key, char** val); #endif // ------------------------------------------------------------------ - diff --git a/goldlib/gall/gfile.h b/goldlib/gall/gfile.h index 9bed583..a96c381 100644 --- a/goldlib/gall/gfile.h +++ b/goldlib/gall/gfile.h @@ -74,7 +74,7 @@ public: gfile(); // Bare constructor // gfile(int __fh); // Construct from Unix file handle // gfile(FILE* __fp); // Construct from ANSI stream pointer - gfile(const char* __path, int __access, int __shflag=SH_DENYNO, int __mode=S_IREAD|S_IWRITE); + gfile(const char* __path, int __access, int __shflag=SH_DENYNO, int __mode=S_STDRW); gfile(const char* __path, const char* __mode, int __shflag=SH_DENYNO); ~gfile(); // Destructor (closes file) @@ -90,8 +90,8 @@ public: // -------------------------------------------------------------- // UNIX-style raw I/O - int Open (const char* __path, int __access, int __shflag=SH_DENYNO, int __mode=S_IREAD|S_IWRITE); - int Open (const char* __path, int __access, const char* __fmode, int __shflag=SH_DENYNO, int __mode=S_IREAD|S_IWRITE); + int Open (const char* __path, int __access, int __shflag=SH_DENYNO, int __mode=S_STDRW); + int Open (const char* __path, int __access, const char* __fmode, int __shflag=SH_DENYNO, int __mode=S_STDRW); int Close (); int Read (void* __ptr, size_t __len); diff --git a/goldlib/glibc/glob.c b/goldlib/glibc/glob.c index 7e2b2dc..4d77f2b 100644 --- a/goldlib/glibc/glob.c +++ b/goldlib/glibc/glob.c @@ -286,7 +286,7 @@ extern char *alloca (); # undef GLOB_PERIOD #endif #include - + static #if __GNUC__ - 0 >= 2 __inline__ diff --git a/goldlib/glibc/regex.h b/goldlib/glibc/regex.h index c1ac1d3..a9cc6c4 100644 --- a/goldlib/glibc/regex.h +++ b/goldlib/glibc/regex.h @@ -23,6 +23,8 @@ #ifndef _REGEX_H #define _REGEX_H 1 +#include + /* Allow the use in C++ code. */ #ifdef __cplusplus extern "C" { @@ -37,8 +39,6 @@ extern "C" { # include #endif -#include - /* The following two types have to be signed and unsigned integer type wide enough to hold a value of a pointer. For most ANSI compilers ptrdiff_t and size_t should be likely OK. Still size of these two @@ -167,7 +167,7 @@ typedef unsigned long int reg_syntax_t; stored in the pattern buffer, so changing this does not affect already-compiled regexps. */ extern reg_syntax_t re_syntax_options; - + /* Define combinations of the above bits for the standard possibilities. (The [[[ comments delimit what gets put into the Texinfo file, so don't delete them!) */ @@ -236,7 +236,7 @@ extern reg_syntax_t re_syntax_options; | RE_NO_BK_PARENS | RE_NO_BK_REFS \ | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD) /* [[[end syntaxes]]] */ - + /* Maximum number of duplicates an interval can allow. Some systems (erroneously) define this in other header files, but we want our value, so remove any previous define. */ @@ -311,7 +311,7 @@ typedef enum REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */ REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */ } reg_errcode_t; - + /* This data structure represents a compiled pattern. Before calling the pattern compiler, the fields `buffer', `allocated', `fastmap', `translate', and `no_sub' can be set. After the pattern has been @@ -391,7 +391,7 @@ struct re_pattern_buffer }; typedef struct re_pattern_buffer regex_t; - + /* Type for byte offsets within the string. POSIX mandates this. */ typedef int regoff_t; @@ -422,46 +422,28 @@ typedef struct regoff_t rm_so; /* Byte offset from string's start to substring's start. */ regoff_t rm_eo; /* Byte offset from string's start to substring's end. */ } regmatch_t; - + /* Declarations for routines. */ -/* To avoid duplicating every routine declaration -- once with a - prototype (if we are ANSI), and once without (if we aren't) -- we - use the following macro to declare argument types. This - unfortunately clutters up the declarations a bit, but I think it's - worth it. */ - -#if 1 /*__STDC__*/ - -# define _RE_ARGS(args) args - -#else /* not __STDC__ */ - -# define _RE_ARGS(args) () - -#endif /* not __STDC__ */ - /* Sets the current default syntax to SYNTAX, and return the old syntax. You can also simply assign to the `re_syntax_options' variable. */ -extern reg_syntax_t __re_set_syntax _RE_ARGS ((reg_syntax_t syntax)); -extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax)); +extern reg_syntax_t __re_set_syntax(reg_syntax_t syntax); +extern reg_syntax_t re_set_syntax(reg_syntax_t syntax); /* Compile the regular expression PATTERN, with length LENGTH and syntax given by the global `re_syntax_options', into the buffer BUFFER. Return NULL if successful, and an error string if not. */ -extern const char *__re_compile_pattern - _RE_ARGS ((const char *pattern, size_t length, - struct re_pattern_buffer *buffer)); -extern const char *re_compile_pattern - _RE_ARGS ((const char *pattern, size_t length, - struct re_pattern_buffer *buffer)); +extern const char *__re_compile_pattern(const char *pattern, size_t length, + struct re_pattern_buffer *buffer); +extern const char *re_compile_pattern(const char *pattern, size_t length, + struct re_pattern_buffer *buffer); /* Compile a fastmap for the compiled pattern in BUFFER; used to accelerate searches. Return 0 if successful and -2 if was an internal error. */ -extern int __re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer)); -extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer)); +extern int __re_compile_fastmap(struct re_pattern_buffer *buffer); +extern int re_compile_fastmap(struct re_pattern_buffer *buffer); /* Search in the string STRING (with length LENGTH) for the pattern @@ -469,45 +451,37 @@ extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer)); characters. Return the starting position of the match, -1 for no match, or -2 for an internal error. Also return register information in REGS (if REGS and BUFFER->no_sub are nonzero). */ -extern int __re_search - _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, - int length, int start, int range, struct re_registers *regs)); -extern int re_search - _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, - int length, int start, int range, struct re_registers *regs)); +extern int __re_search(struct re_pattern_buffer *buffer, const char *string, + int length, int start, int range, struct re_registers *regs); +extern int re_search(struct re_pattern_buffer *buffer, const char *string, + int length, int start, int range, struct re_registers *regs); /* Like `re_search', but search in the concatenation of STRING1 and STRING2. Also, stop searching at index START + STOP. */ -extern int __re_search_2 - _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, +extern int __re_search_2(struct re_pattern_buffer *buffer, const char *string1, int length1, const char *string2, int length2, - int start, int range, struct re_registers *regs, int stop)); -extern int re_search_2 - _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, + int start, int range, struct re_registers *regs, int stop); +extern int re_search_2(struct re_pattern_buffer *buffer, const char *string1, int length1, const char *string2, int length2, - int start, int range, struct re_registers *regs, int stop)); + int start, int range, struct re_registers *regs, int stop); /* Like `re_search', but return how many characters in STRING the regexp in BUFFER matched, starting at position START. */ -extern int __re_match - _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, - int length, int start, struct re_registers *regs)); -extern int re_match - _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, - int length, int start, struct re_registers *regs)); +extern int __re_match(struct re_pattern_buffer *buffer, const char *string, + int length, int start, struct re_registers *regs); +extern int re_match(struct re_pattern_buffer *buffer, const char *string, + int length, int start, struct re_registers *regs); /* Relates to `re_match' as `re_search_2' relates to `re_search'. */ -extern int __re_match_2 - _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, +extern int __re_match_2(struct re_pattern_buffer *buffer, const char *string1, int length1, const char *string2, int length2, - int start, struct re_registers *regs, int stop)); -extern int re_match_2 - _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, + int start, struct re_registers *regs, int stop); +extern int re_match_2(struct re_pattern_buffer *buffer, const char *string1, int length1, const char *string2, int length2, - int start, struct re_registers *regs, int stop)); + int start, struct re_registers *regs, int stop); /* Set REGS to hold NUM_REGS registers, storing them in STARTS and @@ -522,41 +496,37 @@ extern int re_match_2 Unless this function is called, the first search or match using PATTERN_BUFFER will allocate its own register data, without freeing the old data. */ -extern void __re_set_registers - _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs, - unsigned num_regs, regoff_t *starts, regoff_t *ends)); -extern void re_set_registers - _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs, - unsigned num_regs, regoff_t *starts, regoff_t *ends)); +extern void __re_set_registers(struct re_pattern_buffer *buffer, + struct re_registers *regs, + unsigned num_regs, regoff_t *starts, regoff_t *ends); +extern void re_set_registers(struct re_pattern_buffer *buffer, + struct re_registers *regs, + unsigned num_regs, regoff_t *starts, regoff_t *ends); #ifdef _REGEX_RE_COMP # ifndef _CRAY /* 4.2 bsd compatibility. */ -extern char *re_comp _RE_ARGS ((const char *)); -extern int re_exec _RE_ARGS ((const char *)); +extern char *re_comp (const char *)); +extern int re_exec(const char *); # endif #endif /* POSIX compatibility. */ -extern int __regcomp _RE_ARGS ((regex_t *__preg, const char *__pattern, - int __cflags)); -extern int regcomp _RE_ARGS ((regex_t *__preg, const char *__pattern, - int __cflags)); +extern int __regcomp(regex_t *__preg, const char *__pattern, int __cflags); +extern int regcomp(regex_t *__preg, const char *__pattern, int __cflags); -extern int __regexec _RE_ARGS ((const regex_t *__preg, - const char *__string, size_t __nmatch, - regmatch_t __pmatch[], int __eflags)); -extern int regexec _RE_ARGS ((const regex_t *__preg, - const char *__string, size_t __nmatch, - regmatch_t __pmatch[], int __eflags)); +extern int __regexec(const regex_t *__preg, const char *__string, + size_t __nmatch, regmatch_t __pmatch[], int __eflags); +extern int regexec(const regex_t *__preg, const char *__string, + size_t __nmatch, regmatch_t __pmatch[], int __eflags); -extern size_t __regerror _RE_ARGS ((int __errcode, const regex_t *__preg, - char *__errbuf, size_t __errbuf_size)); -extern size_t regerror _RE_ARGS ((int __errcode, const regex_t *__preg, - char *__errbuf, size_t __errbuf_size)); +extern size_t __regerror(int __errcode, const regex_t *__preg, + char *__errbuf, size_t __errbuf_size); +extern size_t regerror(int __errcode, const regex_t *__preg, + char *__errbuf, size_t __errbuf_size); -extern void __regfree _RE_ARGS ((regex_t *__preg)); -extern void regfree _RE_ARGS ((regex_t *__preg)); +extern void __regfree(regex_t *__preg); +extern void regfree(regex_t *__preg); #ifdef __cplusplus @@ -564,7 +534,7 @@ extern void regfree _RE_ARGS ((regex_t *__preg)); #endif /* C++ */ #endif /* regex.h */ - + /* Local variables: make-backup-files: t diff --git a/goldlib/uulib/fptools.h b/goldlib/uulib/fptools.h index 148f985..c922684 100644 --- a/goldlib/uulib/fptools.h +++ b/goldlib/uulib/fptools.h @@ -16,46 +16,31 @@ #ifndef __FPTOOLS_H__ #define __FPTOOLS_H__ -#ifndef _ANSI_ARGS_ -#ifdef PROTOTYPES -#define _ANSI_ARGS_(c) c -#else -#define _ANSI_ARGS_(c) () -#endif -#endif - #ifndef TOOLEXPORT #define TOOLEXPORT #endif -#ifdef __cplusplus -extern "C" { -#endif - -void TOOLEXPORT _FP_free _ANSI_ARGS_((void *)); -char * TOOLEXPORT _FP_strdup _ANSI_ARGS_((char *)); -char * TOOLEXPORT _FP_strncpy _ANSI_ARGS_((char *, char *, int)); -void * TOOLEXPORT _FP_memdup _ANSI_ARGS_((void *, int)); -int TOOLEXPORT _FP_stricmp _ANSI_ARGS_((char *, char *)); -int TOOLEXPORT _FP_strnicmp _ANSI_ARGS_((char *, char *, int)); -char * TOOLEXPORT _FP_strrstr _ANSI_ARGS_((char *, char *)); -char * TOOLEXPORT _FP_stoupper _ANSI_ARGS_((char *)); -char * TOOLEXPORT _FP_stolower _ANSI_ARGS_((char *)); -int TOOLEXPORT _FP_strmatch _ANSI_ARGS_((char *, char *)); -char * TOOLEXPORT _FP_strstr _ANSI_ARGS_((char *, char *)); -char * TOOLEXPORT _FP_stristr _ANSI_ARGS_((char *, char *)); -char * TOOLEXPORT _FP_strirstr _ANSI_ARGS_((char *, char *)); -char * TOOLEXPORT _FP_strrchr _ANSI_ARGS_((char *, int)); -char * TOOLEXPORT _FP_fgets _ANSI_ARGS_((char *, int, FILE *)); -char * TOOLEXPORT _FP_strpbrk _ANSI_ARGS_((char *, char *)); -char * TOOLEXPORT _FP_strtok _ANSI_ARGS_((char *, char *)); -char * TOOLEXPORT _FP_cutdir _ANSI_ARGS_((char *)); +void TOOLEXPORT _FP_free (void *); +char * TOOLEXPORT _FP_strdup (char *); +char * TOOLEXPORT _FP_strncpy (char *, char *, int); +void * TOOLEXPORT _FP_memdup (void *, int); +int TOOLEXPORT _FP_stricmp (char *, char *); +int TOOLEXPORT _FP_strnicmp(char *, char *, int); +char * TOOLEXPORT _FP_strrstr (char *, char *); +char * TOOLEXPORT _FP_stoupper(char *); +char * TOOLEXPORT _FP_stolower(char *); +int TOOLEXPORT _FP_strmatch(char *, char *); +char * TOOLEXPORT _FP_strstr (char *, char *); +char * TOOLEXPORT _FP_stristr (char *, char *); +char * TOOLEXPORT _FP_strirstr(char *, char *); +char * TOOLEXPORT _FP_strrchr (char *, int); +char * TOOLEXPORT _FP_fgets (char *, int, FILE *); +char * TOOLEXPORT _FP_strpbrk (char *, char *); +char * TOOLEXPORT _FP_strtok (char *, char *); +char * TOOLEXPORT _FP_cutdir (char *); #if 0 -char * TOOLEXPORT _FP_strerror _ANSI_ARGS_((int)); -char * TOOLEXPORT _FP_tempnam _ANSI_ARGS_((char *, char *)); +char * TOOLEXPORT _FP_strerror(int); +char * TOOLEXPORT _FP_tempnam (char *, char *); #endif -#ifdef __cplusplus -} -#endif #endif diff --git a/goldlib/uulib/uudeview.h b/goldlib/uulib/uudeview.h index e406240..592a663 100644 --- a/goldlib/uulib/uudeview.h +++ b/goldlib/uulib/uudeview.h @@ -24,14 +24,6 @@ * $Id$ */ -#ifndef _ANSI_ARGS_ -#ifdef PROTOTYPES -#define _ANSI_ARGS_(c) c -#else -#define _ANSI_ARGS_(c) () -#endif -#endif - /* * Message Types */ @@ -182,81 +174,40 @@ typedef struct { #define UUEXPORT #endif -#ifdef __cplusplus -extern "C" { -#endif - -int UUEXPORT UUInitialize _ANSI_ARGS_((void)); -int UUEXPORT UUGetOption _ANSI_ARGS_((int, int *, char *, int)); -int UUEXPORT UUSetOption _ANSI_ARGS_((int, int, char *)); -char * UUEXPORT UUstrerror _ANSI_ARGS_((int)); -int UUEXPORT UUSetMsgCallback _ANSI_ARGS_((void *, - void (*) (void *, - char *, - int))); -int UUEXPORT UUSetBusyCallback _ANSI_ARGS_((void *, - int (*) (void *, - uuprogress *), - long)); -int UUEXPORT UUSetFileCallback _ANSI_ARGS_((void *, - int (*) (void *, char *, - char *, int))); -int UUEXPORT UUSetFNameFilter _ANSI_ARGS_((void *, - char * (*) (void *, - char *))); -char * UUEXPORT UUFNameFilter _ANSI_ARGS_((char *)); -int UUEXPORT UULoadFile _ANSI_ARGS_((char *, char *, int)); -uulist *UUEXPORT UUGetFileListItem _ANSI_ARGS_((int)); -int UUEXPORT UURenameFile _ANSI_ARGS_((uulist *, char *)); -int UUEXPORT UUDecodeToTemp _ANSI_ARGS_((uulist *)); -int UUEXPORT UURemoveTemp _ANSI_ARGS_((uulist *)); -int UUEXPORT UUDecodeFile _ANSI_ARGS_((uulist *, char *)); -int UUEXPORT UUInfoFile _ANSI_ARGS_((uulist *, void *, - int (*) (void *, - char *))); -int UUEXPORT UUSmerge _ANSI_ARGS_((int)); -int UUEXPORT UUCleanUp _ANSI_ARGS_((void)); - -int UUEXPORT UUQuickDecode _ANSI_ARGS_((FILE *, FILE *, - char *, long)); - -int UUEXPORT UUEncodeMulti _ANSI_ARGS_((FILE *, FILE *, - char *, int, - char *, char *, int)); -int UUEXPORT UUEncodePartial _ANSI_ARGS_((FILE *, FILE *, - char *, int, - char *, char *, - int, int, long, - unsigned long*)); -int UUEXPORT UUEncodeToStream _ANSI_ARGS_((FILE *, FILE *, - char *, int, - char *, int)); -int UUEXPORT UUEncodeToFile _ANSI_ARGS_((FILE *, char *, int, - char *, char *, long)); -int UUEXPORT UUE_PrepSingle _ANSI_ARGS_((FILE *, FILE *, - char *, int, - char *, int, - char *, char *, - char *, int)); -int UUEXPORT UUE_PrepPartial _ANSI_ARGS_((FILE *, FILE *, - char *, int, - char *, int, - int, long, long, char *, - char *, char *, int)); - -int UUEXPORT UUE_PrepSingleExt _ANSI_ARGS_((FILE *, FILE *, - char *, int, - char *, int, - char *, char *, - char *, char *, - int)); -int UUEXPORT UUE_PrepPartialExt _ANSI_ARGS_((FILE *, FILE *, - char *, int, - char *, int, - int, long, long, char *, - char *, char *, char *, - int)); -#ifdef __cplusplus -} -#endif +int UUEXPORT UUInitialize (void); +int UUEXPORT UUGetOption (int, int *, char *, int); +int UUEXPORT UUSetOption (int, int, char *); +char * UUEXPORT UUstrerror (int); +int UUEXPORT UUSetMsgCallback (void *, void (*) (void *, char *, int)); +int UUEXPORT UUSetBusyCallback (void *, int (*) (void *, uuprogress *), long); +int UUEXPORT UUSetFileCallback (void *, int (*) (void *, char *, char *, int)); +int UUEXPORT UUSetFNameFilter (void *, char * (*) (void *, char *)); +char * UUEXPORT UUFNameFilter (char *); +int UUEXPORT UULoadFile (char *, char *, int); +uulist *UUEXPORT UUGetFileListItem(int); +int UUEXPORT UURenameFile (uulist *, char *); +int UUEXPORT UUDecodeToTemp (uulist *); +int UUEXPORT UURemoveTemp (uulist *); +int UUEXPORT UUDecodeFile (uulist *, char *); +int UUEXPORT UUInfoFile (uulist *, void *, int (*) (void *, char *)); +int UUEXPORT UUSmerge (int); +int UUEXPORT UUCleanUp (void); + +int UUEXPORT UUQuickDecode (FILE *, FILE *, char *, long); + +int UUEXPORT UUEncodeMulti (FILE *, FILE *, char *, int, + char *, char *, int); +int UUEXPORT UUEncodePartial (FILE *, FILE *, char *, int, char *, + char *, int, int, long, unsigned long*); +int UUEXPORT UUEncodeToStream (FILE *, FILE *, char *, int, char *, int); +int UUEXPORT UUEncodeToFile (FILE *, char *, int, char *, char *, long); +int UUEXPORT UUE_PrepSingle (FILE *, FILE *, char *, int, char *, int, + char *, char *, char *, int); +int UUEXPORT UUE_PrepPartial (FILE *, FILE *, char *, int, char *, int, + int, long, long, char *, char *, char *, int); +int UUEXPORT UUE_PrepSingleExt (FILE *, FILE *, char *, int, char *, int, + char *, char *, char *, char *, int); +int UUEXPORT UUE_PrepPartialExt (FILE *, FILE *, char *, int, char *, int, + int, long, long, char *, char *, char *, + char *, int); #endif diff --git a/goldlib/uulib/uuint.h b/goldlib/uulib/uuint.h index 4dfdaaf..993473b 100644 --- a/goldlib/uulib/uuint.h +++ b/goldlib/uulib/uuint.h @@ -25,14 +25,6 @@ * $Id$ */ -#ifndef _ANSI_ARGS_ -#ifdef PROTOTYPES -#define _ANSI_ARGS_(c) c -#else -#define _ANSI_ARGS_(c) () -#endif -#endif - /* * Busy Polls will be made after processing ... lines */ @@ -260,14 +252,10 @@ extern char *uunconc_UUxlat, *uunconc_UUxlen; extern char *uunconc_B64xlat, *uunconc_XXxlat; extern char *uunconc_BHxlat, *uunconc_save; -#ifdef __cplusplus -extern "C" { -#endif - -extern void (*uu_MsgCallback) _ANSI_ARGS_((void *, char *, int)); -extern int (*uu_BusyCallback) _ANSI_ARGS_((void *, uuprogress *)); -extern int (*uu_FileCallback) _ANSI_ARGS_((void *, char *, char *, int)); -extern char * (*uu_FNameFilter) _ANSI_ARGS_((void *, char *)); +extern void (*uu_MsgCallback) (void *, char *, int); +extern int (*uu_BusyCallback) (void *, uuprogress *); +extern int (*uu_FileCallback) (void *, char *, char *, int); +extern char * (*uu_FNameFilter) (void *, char *); /* * Functions from uulib.c that aren't defined in @@ -275,66 +263,57 @@ extern char * (*uu_FNameFilter) _ANSI_ARGS_((void *, char *)); */ #if defined(STDC_HEADERS) || defined(HAVE_STDARG_H) -int UUMessage _ANSI_ARGS_((char *, int, - int, char *, ...)); +int UUMessage (char *, int, int, char *, ...); #else int UUMessage (); #endif -int UUBusyPoll _ANSI_ARGS_((void)); +int UUBusyPoll (void); /* * Functions from uucheck.c */ -uufile * UUPreProcessPart _ANSI_ARGS_((fileread *, int *)); -int UUInsertPartToList _ANSI_ARGS_((uufile *)); -uulist * UUCheckGlobalList _ANSI_ARGS_((void)); +uufile * UUPreProcessPart (fileread *, int *); +int UUInsertPartToList (uufile *); +uulist * UUCheckGlobalList (void); /* * Functions from uuutil.c */ -void UUkillfread _ANSI_ARGS_((fileread *)); -void UUkillfile _ANSI_ARGS_((uufile *)); -void UUkilllist _ANSI_ARGS_((uulist *)); -void UUkillheaders _ANSI_ARGS_((headers *)); +void UUkillfread (fileread *); +void UUkillfile (uufile *); +void UUkilllist (uulist *); +void UUkillheaders (headers *); -fileread * ScanPart _ANSI_ARGS_((FILE *, char *, int *)); - -int UUbhdecomp _ANSI_ARGS_((char *, char *, - char *, int *, - size_t, size_t, - size_t *)); -size_t UUbhwrite _ANSI_ARGS_((char *, size_t, size_t, - FILE *)); +fileread * ScanPart (FILE *, char *, int *); +int UUbhdecomp (char *, char *, char *, int *, + size_t, size_t, size_t *); +size_t UUbhwrite (char *, size_t, size_t, FILE *); /* * Functions from uunconc.c */ -int UURepairData _ANSI_ARGS_((FILE *, char *, - int, int *)); +int UURepairData (FILE *, char *, int, int *); -void UUInitConc _ANSI_ARGS_((void)); -int UUValidData _ANSI_ARGS_((char *, int, int *)); -size_t UUDecodeLine _ANSI_ARGS_((char *, char *, int)); -int UUDecodePart _ANSI_ARGS_((FILE *, FILE *, int *, - long, int, int, char *)); -int UUDecode _ANSI_ARGS_((uulist *)); +void UUInitConc (void); +int UUValidData (char *, int, int *); +size_t UUDecodeLine (char *, char *, int); +int UUDecodePart (FILE *, FILE *, int *, long, int, int, char *); +int UUDecode (uulist *); /* * Message retrieval from uustring.c */ -char * uustring _ANSI_ARGS_((int)); +char * uustring (int); /* * From uuscan.c */ -int UUScanHeader _ANSI_ARGS_((FILE *, headers *)); +int UUScanHeader (FILE *, headers *); + -#ifdef __cplusplus -} -#endif #endif