diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-05-05 13:30:02 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-05-05 13:30:02 +0800 |
commit | 980df4d9684121dca6964247784ea7983f6ea4c4 (patch) | |
tree | 0c5fb0ec3002b8395d82de47a514bf314ab35e65 /innbbsd/file.c | |
parent | 332d5e7882804269784b976f1cb468d69c21af37 (diff) | |
download | pttbbs-980df4d9684121dca6964247784ea7983f6ea4c4.tar pttbbs-980df4d9684121dca6964247784ea7983f6ea4c4.tar.gz pttbbs-980df4d9684121dca6964247784ea7983f6ea4c4.tar.bz2 pttbbs-980df4d9684121dca6964247784ea7983f6ea4c4.tar.lz pttbbs-980df4d9684121dca6964247784ea7983f6ea4c4.tar.xz pttbbs-980df4d9684121dca6964247784ea7983f6ea4c4.tar.zst pttbbs-980df4d9684121dca6964247784ea7983f6ea4c4.zip |
replace varvars.h by stdarg.h
(because gcc 3.3 no longer support varvars.h)
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@821 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'innbbsd/file.c')
-rw-r--r-- | innbbsd/file.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/innbbsd/file.c b/innbbsd/file.c index d4df15b2..7016f940 100644 --- a/innbbsd/file.c +++ b/innbbsd/file.c @@ -1,7 +1,7 @@ #include <stdio.h> #include <sys/stat.h> #include <sys/types.h> -#include <varargs.h> +#include <stdarg.h> #define MAXARGS 100 /* isfile is called by @@ -25,20 +25,14 @@ FILE *fp; fileglue("%s/%s",home,".newsrc"); */ -char *fileglue(va_alist) -va_dcl +char *fileglue(char *fmt, ...) { - va_list ap; - register char* fmt; - static char *newstring; - static char gluebuffer[8192]; - - va_start(ap); - fmt = va_arg(ap, char *) ; - vsprintf(gluebuffer, fmt, ap); - newstring = gluebuffer; - va_end(ap); - return newstring; + va_list ap; + static char gluebuffer[8192]; + va_start(ap, fmt); + vsprintf(gluebuffer, fmt, ap); + va_end(ap); + return gluebuffer; } long @@ -71,8 +65,8 @@ char* filename; return 1; } +#ifdef TEST int isfilev(va_alist) -va_dcl { va_list ap; struct stat st; @@ -88,6 +82,7 @@ va_dcl va_end(ap); return isfile(FILEBUF); } +#endif int isdir(filename) @@ -100,8 +95,8 @@ char* filename; return 1; } +#ifdef TEST int isdirv(va_alist) -va_dcl { va_list ap; struct stat st; @@ -116,6 +111,7 @@ va_dcl va_end(ap); return isdir(FILEBUF); } +#endif unsigned long mtime(filename) char* filename; @@ -125,8 +121,8 @@ char* filename; return st.st_mtime; } +#ifdef TEST unsigned long mtimev(va_alist) -va_dcl { va_list ap; struct stat st; @@ -141,6 +137,7 @@ va_dcl va_end(ap); return mtime(FILEBUF); } +#endif unsigned long atime(filename) char *filename; @@ -150,8 +147,8 @@ char *filename; return st.st_atime; } +#ifdef TEST unsigned long atimev(va_alist) -va_dcl { va_list ap; struct stat st; @@ -166,6 +163,7 @@ va_dcl va_end(ap); return atime(FILEBUF); } +#endif /*#undef TEST*/ #ifdef TEST |