From: Erwin Janssen Date: Fri, 9 Sep 2016 01:36:30 +0000 (+0200) Subject: Removed old-style function defintions from sfio X-Git-Tag: untagged-4431b9bde391f1b69fe5^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d0ecabe6363d36fd0842477bc7a3dfc2175f970e;p=graphviz Removed old-style function defintions from sfio The functions definitions in sfio are all surrounded by an `#if __STD_C`, if __STD_C is not defined than the old style function definition is used. These days STD C is the standard and the old style function defintions are obsolete. They have been removed from lib/sfio and its subprojects, comments have been preserved by converting time to a Doxygen style. --- diff --git a/lib/sfio/Sfio_dc/sfdcdio.c b/lib/sfio/Sfio_dc/sfdcdio.c index 182d0c415..c42a40c2e 100644 --- a/lib/sfio/Sfio_dc/sfdcdio.c +++ b/lib/sfio/Sfio_dc/sfdcdio.c @@ -31,17 +31,8 @@ typedef struct _direct_s { #define P2I(p) (Sfulong_t)((char*)(p) - (char*)0) #ifdef HAVE_STRUCT_DIOATTR -#if __STD_C static ssize_t diordwr(Sfio_t * f, Void_t * buf, size_t n, Direct_t * di, int type) -#else -static ssize_t diordwr(f, buf, n, di, type) -Sfio_t *f; -Void_t *buf; -size_t n; -Direct_t *di; -int type; -#endif { size_t rw, done; ssize_t rv = 0; @@ -89,42 +80,18 @@ int type; return done ? done : rv; } -#if __STD_C static ssize_t dioread(Sfio_t * f, Void_t * buf, size_t n, Sfdisc_t * disc) -#else -static ssize_t dioread(f, buf, n, disc) -Sfio_t *f; -Void_t *buf; -size_t n; -Sfdisc_t *disc; -#endif { return diordwr(f, buf, n, (Direct_t *) disc, SF_READ); } -#if __STD_C static ssize_t diowrite(Sfio_t * f, const Void_t * buf, size_t n, Sfdisc_t * disc) -#else -static ssize_t diowrite(f, buf, n, disc) -Sfio_t *f; -Void_t *buf; -size_t n; -Sfdisc_t *disc; -#endif { return diordwr(f, (Void_t *) buf, n, (Direct_t *) disc, SF_WRITE); } -#if __STD_C static int dioexcept(Sfio_t * f, int type, Void_t * data, Sfdisc_t * disc) -#else -static int dioexcept(f, type, data, disc) -Sfio_t *f; -int type; -Void_t *data; -Sfdisc_t *disc; -#endif { Direct_t *di = (Direct_t *) disc; @@ -140,13 +107,7 @@ Sfdisc_t *disc; } #endif /*HAVE_STRUCT_DIOATTR */ -#if __STD_C int sfdcdio(Sfio_t * f, size_t bufsize) -#else -int sfdcdio(f, bufsize) -Sfio_t *f; -size_t bufsize; -#endif { #ifndef HAVE_STRUCT_DIOATTR return -1; diff --git a/lib/sfio/Sfio_dc/sfdcdos.c b/lib/sfio/Sfio_dc/sfdcdos.c index 51465c69c..7909b92bb 100644 --- a/lib/sfio/Sfio_dc/sfdcdos.c +++ b/lib/sfio/Sfio_dc/sfdcdos.c @@ -46,12 +46,7 @@ typedef struct _dosdisc { int bsize; } Dosdisc_t; -#if __STD_C static void addmapping(register Dosdisc_t * dp) -#else -static void addmapping(dp) -register Dosdisc_t *dp; -#endif { register int n; if ((n = dp->maptop++) >= dp->mapsize) { @@ -71,15 +66,8 @@ register Dosdisc_t *dp; dp->maptable[dp->maptop].logical = 0; } -#if __STD_C static struct map *getmapping(Dosdisc_t * dp, off_t offset, register int whence) -#else -static struct map *getmapping(dp, offset, whence) -Dosdisc_t *dp; -off_t offset; -register int whence; -#endif { register struct map *mp; static struct map dummy; @@ -97,16 +85,8 @@ register int whence; return (mp - 1); } -#if __STD_C static ssize_t dos_read(Sfio_t * iop, void *buff, size_t size, Sfdisc_t * disc) -#else -static ssize_t dos_read(iop, buff, size, disc) -Sfio_t *iop; -void *buff; -size_t size; -Sfdisc_t *disc; -#endif { register Dosdisc_t *dp = (Dosdisc_t *) disc; register char *cp = (char *) buff, *first, *cpmax; @@ -210,16 +190,8 @@ Sfdisc_t *disc; * if is SEEK_CUR, physical offset converted to logical offset * otherwise, logical offset is converted to physical offset */ -#if __STD_C static off_t cur_offset(Dosdisc_t * dp, off_t offset, Sfio_t * iop, register int whence) -#else -static off_t cur_offset(dp, offset, iop, whence) -Dosdisc_t *dp; -off_t offset; -Sfio_t *iop; -register int whence; -#endif { register off_t n, m = 0; register char *cp; @@ -251,16 +223,8 @@ register int whence; return (offset + m); } -#if __STD_C static Sfoff_t dos_seek(Sfio_t * iop, Sfoff_t offset, register int whence, Sfdisc_t * disc) -#else -static Sfoff_t dos_seek(iop, offset, whence, disc) -Sfio_t *iop; -Sfoff_t offset; -register int whence; -Sfdisc_t *disc; -#endif { register Dosdisc_t *dp = (Dosdisc_t *) disc; struct map dummy, *mp = 0; @@ -335,15 +299,7 @@ Sfdisc_t *disc; return (offset); } -#if __STD_C static int dos_except(Sfio_t * iop, int type, void *arg, Sfdisc_t * disc) -#else -static int dos_except(iop, type, arg, disc) -Sfio_t *iop; -int type; -void *arg; -Sfdisc_t *disc; -#endif { register Dosdisc_t *dp = (Dosdisc_t *) disc; if (type == SF_DPOP || type == SF_FINAL) { @@ -356,12 +312,7 @@ Sfdisc_t *disc; return (0); } -#if __STD_C int sfdcdos(Sfio_t * f) -#else -int sfdcdos(f) -Sfio_t *f; -#endif { Dosdisc_t *dos; diff --git a/lib/sfio/Sfio_dc/sfdcfilter.c b/lib/sfio/Sfio_dc/sfdcfilter.c index 6166c1bab..39605d120 100644 --- a/lib/sfio/Sfio_dc/sfdcfilter.c +++ b/lib/sfio/Sfio_dc/sfdcfilter.c @@ -32,16 +32,14 @@ typedef struct _filter_s { } Filter_t; /* read data from the filter */ -#if __STD_C +/** + * @param f stream reading from + * @param buf buffer to read into + * @param n number of bytes requested + * @param disc discipline + */ static ssize_t filterread(Sfio_t * f, Void_t * buf, size_t n, Sfdisc_t * disc) -#else -static ssize_t filterread(f, buf, n, disc) -Sfio_t *f; /* stream reading from */ -Void_t *buf; /* buffer to read into */ -size_t n; /* number of bytes requested */ -Sfdisc_t *disc; /* discipline */ -#endif { Filter_t *fi; ssize_t r, w; @@ -83,31 +81,21 @@ Sfdisc_t *disc; /* discipline */ } } -#if __STD_C +/** + * @param f stream reading from + * @param buf buffer to read into + * @param n number of bytes requested + * @param disc discipline + */ static ssize_t filterwrite(Sfio_t * f, const Void_t * buf, size_t n, Sfdisc_t * disc) -#else -static ssize_t filterwrite(f, buf, n, disc) -Sfio_t *f; /* stream reading from */ -Void_t *buf; /* buffer to read into */ -size_t n; /* number of bytes requested */ -Sfdisc_t *disc; /* discipline */ -#endif { return -1; } /* for the duration of this discipline, the stream is unseekable */ -#if __STD_C static Sfoff_t filterseek(Sfio_t * f, Sfoff_t addr, int offset, Sfdisc_t * disc) -#else -static Sfoff_t filterseek(f, addr, offset, disc) -Sfio_t *f; -Sfoff_t addr; -int offset; -Sfdisc_t *disc; -#endif { f = NIL(Sfio_t *); addr = 0; @@ -117,16 +105,8 @@ Sfdisc_t *disc; } /* on close, remove the discipline */ -#if __STD_C static int filterexcept(Sfio_t * f, int type, Void_t * data, Sfdisc_t * disc) -#else -static int filterexcept(f, type, data, disc) -Sfio_t *f; -int type; -Void_t *data; -Sfdisc_t *disc; -#endif { if (type == SF_FINAL || type == SF_DPOP) { sfclose(((Filter_t *) disc)->filter); @@ -136,13 +116,11 @@ Sfdisc_t *disc; return 0; } -#if __STD_C +/** + * @param f stream to filter data + * @param cmd program to run as a filter + */ int sfdcfilter(Sfio_t * f, const char *cmd) -#else -int sfdcfilter(f, cmd) -Sfio_t *f; /* stream to filter data */ -char *cmd; /* program to run as a filter */ -#endif { reg Filter_t *fi; reg Sfio_t *filter; diff --git a/lib/sfio/Sfio_dc/sfdclzw.c b/lib/sfio/Sfio_dc/sfdclzw.c index 0133d1820..88869bf4d 100644 --- a/lib/sfio/Sfio_dc/sfdclzw.c +++ b/lib/sfio/Sfio_dc/sfdclzw.c @@ -111,16 +111,8 @@ typedef struct { static char_type rmask[9] = { 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff }; -#if __STD_C static int peek(Sfio_t * f, char_type ** bufp, int count, reg LZW_Disc * disc) -#else -static int peek(f, bufp, count, disc) -Sfio_t *f; -char_type **bufp; -int count; -reg LZW_Disc *disc; -#endif { reg int io_sz, j; @@ -156,13 +148,7 @@ reg LZW_Disc *disc; * code or -1 is returned. */ -#if __STD_C static code_int getcode(Sfio_t * f, LZW_Disc * disc) -#else -static code_int getcode(f, disc) -Sfio_t *f; -LZW_Disc *disc; -#endif { reg code_int code; reg int r_off, bits; @@ -220,15 +206,7 @@ LZW_Disc *disc; } -#if __STD_C static int lzwExcept(Sfio_t * f, int type, Void_t * data, Sfdisc_t * disc) -#else -static int lzwExcept(f, type, data, disc) -Sfio_t *f; -int type; -Void_t *data; -Sfdisc_t *disc; -#endif { if (type == SF_FINAL || type == SF_DPOP) free(disc); @@ -243,16 +221,8 @@ Sfdisc_t *disc; * with those of the compress() routine. See the definitions above. */ -#if __STD_C ssize_t lzwRead(Sfio_t * f, Void_t * iobuf, size_t iocnt, Sfdisc_t * sfdisc) -#else -ssize_t lzwRead(f, iobuf, iocnt, sfdisc) -Sfio_t *f; -Void_t *iobuf; -size_t iocnt; -Sfdisc_t *sfdisc; -#endif { LZW_Disc *disc = (LZW_Disc *) sfdisc; reg char_type *stackp; @@ -358,42 +328,21 @@ Sfdisc_t *sfdisc; END_REGS return ioptr - (char *) iobuf; } -#if __STD_C static Sfoff_t lzwSeek(Sfio_t * f, Sfoff_t offset, int whence, Sfdisc_t * disc) -#else -static Sfoff_t lzwSeek(f, offset, whence, disc) -Sfio_t *f; -Sfoff_t offset; -int whence; -Sfdisc_t *disc; -#endif { return (Sfoff_t) (-1); } -#if __STD_C static ssize_t lzwWrite(Sfio_t * f, const Void_t * buf, size_t count, Sfdisc_t * disc) -#else -static ssize_t lzwWrite(f, buf, count, disc) -Sfio_t *f; -Void_t *buf; -size_t count; -Sfdisc_t *disc; -#endif { return (ssize_t) (-1); } -#if __STD_C int sfdclzw(Sfio_t * f) -#else -int sfdclzw(f) -Sfio_t *f; -#endif { LZW_Disc *lz; diff --git a/lib/sfio/Sfio_dc/sfdcseekable.c b/lib/sfio/Sfio_dc/sfdcseekable.c index 9f8952276..6f5ebbb7e 100644 --- a/lib/sfio/Sfio_dc/sfdcseekable.c +++ b/lib/sfio/Sfio_dc/sfdcseekable.c @@ -24,29 +24,25 @@ typedef struct _skable_s { int eof; /* if eof has been reached */ } Seek_t; -#if __STD_C +/** + * @param f stream involved + * @param buf buffer to read into + * @param n number of bytes to read + * @param disc discipline + */ static ssize_t skwrite(Sfio_t * f, const Void_t * buf, size_t n, Sfdisc_t * disc) -#else -static ssize_t skwrite(f, buf, n, disc) -Sfio_t *f; /* stream involved */ -Void_t *buf; /* buffer to read into */ -size_t n; /* number of bytes to read */ -Sfdisc_t *disc; /* discipline */ -#endif { return (ssize_t) (-1); } -#if __STD_C +/** + * @param f stream involved + * @param buf buffer to read into + * @param n number of bytes to read + * @param disc discipline + */ static ssize_t skread(Sfio_t * f, Void_t * buf, size_t n, Sfdisc_t * disc) -#else -static ssize_t skread(f, buf, n, disc) -Sfio_t *f; /* stream involved */ -Void_t *buf; /* buffer to read into */ -size_t n; /* number of bytes to read */ -Sfdisc_t *disc; /* discipline */ -#endif { Seek_t *sk; Sfio_t *sf; @@ -81,15 +77,7 @@ Sfdisc_t *disc; /* discipline */ return r + w; } -#if __STD_C static Sfoff_t skseek(Sfio_t * f, Sfoff_t addr, int type, Sfdisc_t * disc) -#else -static Sfoff_t skseek(f, addr, type, disc) -Sfio_t *f; -Sfoff_t addr; -int type; -Sfdisc_t *disc; -#endif { Sfoff_t extent; Seek_t *sk; @@ -139,15 +127,7 @@ Sfdisc_t *disc; } /* on close, remove the discipline */ -#if __STD_C static int skexcept(Sfio_t * f, int type, Void_t * data, Sfdisc_t * disc) -#else -static int skexcept(f, type, data, disc) -Sfio_t *f; -int type; -Void_t *data; -Sfdisc_t *disc; -#endif { if (type == SF_FINAL || type == SF_DPOP) { sfclose(((Seek_t *) disc)->shadow); @@ -156,12 +136,7 @@ Sfdisc_t *disc; return 0; } -#if __STD_C int sfdcseekable(Sfio_t * f) -#else -int sfdcseekable(f) -Sfio_t *f; -#endif { reg Seek_t *sk; diff --git a/lib/sfio/Sfio_dc/sfdcslow.c b/lib/sfio/Sfio_dc/sfdcslow.c index ababa84a2..65aaf1e9b 100644 --- a/lib/sfio/Sfio_dc/sfdcslow.c +++ b/lib/sfio/Sfio_dc/sfdcslow.c @@ -19,15 +19,7 @@ ** Written by Glenn Fowler (03/18/1998). */ -#if __STD_C static int slowexcept(Sfio_t * f, int type, Void_t * v, Sfdisc_t * disc) -#else -static int slowexcept(f, type, v, disc) -Sfio_t *f; -int type; -Void_t *v; -Sfdisc_t *disc; -#endif { NOTUSED(f); NOTUSED(v); @@ -48,12 +40,7 @@ Sfdisc_t *disc; return (0); } -#if __STD_C int sfdcslow(Sfio_t * f) -#else -int sfdcslow(f) -Sfio_t *f; -#endif { Sfdisc_t *disc; diff --git a/lib/sfio/Sfio_dc/sfdcsubstream.c b/lib/sfio/Sfio_dc/sfdcsubstream.c index 9d50e9b2d..ab9000ad6 100644 --- a/lib/sfio/Sfio_dc/sfdcsubstream.c +++ b/lib/sfio/Sfio_dc/sfdcsubstream.c @@ -29,17 +29,8 @@ typedef struct _subfile_s { Sfoff_t here; /* current seek location */ } Subfile_t; -#if __STD_C static ssize_t streamio(Sfio_t * f, Void_t * buf, size_t n, Sfdisc_t * disc, int type) -#else -static ssize_t streamio(f, buf, n, disc, type) -Sfio_t *f; -Void_t *buf; -size_t n; -Sfdisc_t *disc; -int type; -#endif { reg Subfile_t *su; reg Sfoff_t here, parent; @@ -76,44 +67,20 @@ int type; return io; } -#if __STD_C static ssize_t streamwrite(Sfio_t * f, const Void_t * buf, size_t n, Sfdisc_t * disc) -#else -static ssize_t streamwrite(f, buf, n, disc) -Sfio_t *f; -Void_t *buf; -size_t n; -Sfdisc_t *disc; -#endif { return streamio(f, (Void_t *) buf, n, disc, SF_WRITE); } -#if __STD_C static ssize_t streamread(Sfio_t * f, Void_t * buf, size_t n, Sfdisc_t * disc) -#else -static ssize_t streamread(f, buf, n, disc) -Sfio_t *f; -Void_t *buf; -size_t n; -Sfdisc_t *disc; -#endif { return streamio(f, buf, n, disc, SF_READ); } -#if __STD_C static Sfoff_t streamseek(Sfio_t * f, Sfoff_t pos, int type, Sfdisc_t * disc) -#else -static Sfoff_t streamseek(f, pos, type, disc) -Sfio_t *f; -Sfoff_t pos; -int type; -Sfdisc_t *disc; -#endif { reg Subfile_t *su; reg Sfoff_t here, parent; @@ -150,32 +117,22 @@ Sfdisc_t *disc; return (su->here = pos); } -#if __STD_C static int streamexcept(Sfio_t * f, int type, Void_t * data, Sfdisc_t * disc) -#else -static int streamexcept(f, type, data, disc) -Sfio_t *f; -int type; -Void_t *data; -Sfdisc_t *disc; -#endif { if (type == SF_FINAL || type == SF_DPOP) free(disc); return 0; } -#if __STD_C +/** + * @param f stream + * @param parent parent stream + * @param offset offset in parent stream + * @param extent desired size + */ int sfdcsubstream(Sfio_t * f, Sfio_t * parent, Sfoff_t offset, Sfoff_t extent) -#else -int sfdcsubstream(f, parent, offset, extent) -Sfio_t *f; /* stream */ -Sfio_t *parent; /* parent stream */ -Sfoff_t offset; /* offset in parent stream */ -Sfoff_t extent; /* desired size */ -#endif { reg Subfile_t *su; reg Sfoff_t here; diff --git a/lib/sfio/Sfio_dc/sfdctee.c b/lib/sfio/Sfio_dc/sfdctee.c index c6b1c2416..bca96f9dd 100644 --- a/lib/sfio/Sfio_dc/sfdctee.c +++ b/lib/sfio/Sfio_dc/sfdctee.c @@ -28,16 +28,14 @@ typedef struct _tee_s { } Tee_t; /* write to the teed stream. */ -#if __STD_C +/** + * @param f the stream being written to + * @param buf the buffer of data being output + * @param size the data size + * @param disc the tee discipline + */ static ssize_t teewrite(Sfio_t * f, const Void_t * buf, size_t size, Sfdisc_t * disc) -#else -static ssize_t teewrite(f, buf, size, disc) -Sfio_t *f; /* the stream being written to */ -Void_t *buf; /* the buffer of data being output */ -size_t size; /* the data size */ -Sfdisc_t *disc; /* the tee discipline */ -#endif { reg Tee_t *te = (Tee_t *) disc; @@ -50,15 +48,7 @@ Sfdisc_t *disc; /* the tee discipline */ } /* on close, remove the discipline */ -#if __STD_C static int teeexcept(Sfio_t * f, int type, Void_t * data, Sfdisc_t * disc) -#else -static int teeexcept(f, type, data, disc) -Sfio_t *f; -int type; -Void_t *data; -Sfdisc_t *disc; -#endif { if (type == SF_FINAL || type == SF_DPOP) free(disc); @@ -66,13 +56,11 @@ Sfdisc_t *disc; return 0; } -#if __STD_C +/** + * @param f stream to tee from + * @param tee stream to tee to + */ int sfdctee(Sfio_t * f, Sfio_t * tee) -#else -int sfdctee(f, tee) -Sfio_t *f; /* stream to tee from */ -Sfio_t *tee; /* stream to tee to */ -#endif { reg Tee_t *te; diff --git a/lib/sfio/Sfio_dc/sfdcunion.c b/lib/sfio/Sfio_dc/sfdcunion.c index 8e4fc0650..dce65e872 100644 --- a/lib/sfio/Sfio_dc/sfdcunion.c +++ b/lib/sfio/Sfio_dc/sfdcunion.c @@ -36,29 +36,25 @@ typedef struct _union_s { File_t f[1]; /* array of streams */ } Union_t; -#if __STD_C +/** + * @param f stream involved + * @param buf buffer to read into + * @param n number of bytes to read + * @param disc discipline + */ static ssize_t unwrite(Sfio_t * f, const Void_t * buf, size_t n, Sfdisc_t * disc) -#else -static ssize_t unwrite(f, buf, n, disc) -Sfio_t *f; /* stream involved */ -Void_t *buf; /* buffer to read into */ -size_t n; /* number of bytes to read */ -Sfdisc_t *disc; /* discipline */ -#endif { return -1; } -#if __STD_C +/** + * @param f stream involved + * @param buf buffer to read into + * @param n number of bytes to read + * @param disc discipline + */ static ssize_t unread(Sfio_t * f, Void_t * buf, size_t n, Sfdisc_t * disc) -#else -static ssize_t unread(f, buf, n, disc) -Sfio_t *f; /* stream involved */ -Void_t *buf; /* buffer to read into */ -size_t n; /* number of bytes to read */ -Sfdisc_t *disc; /* discipline */ -#endif { reg Union_t *un; reg ssize_t r, m; @@ -83,15 +79,7 @@ Sfdisc_t *disc; /* discipline */ return n - m; } -#if __STD_C static Sfoff_t unseek(Sfio_t * f, Sfoff_t addr, int type, Sfdisc_t * disc) -#else -static Sfoff_t unseek(f, addr, type, disc) -Sfio_t *f; -Sfoff_t addr; -int type; -Sfdisc_t *disc; -#endif { reg Union_t *un; reg int i; @@ -135,15 +123,7 @@ Sfdisc_t *disc; } /* on close, remove the discipline */ -#if __STD_C static int unexcept(Sfio_t * f, int type, Void_t * data, Sfdisc_t * disc) -#else -static int unexcept(f, type, data, disc) -Sfio_t *f; -int type; -Void_t *data; -Sfdisc_t *disc; -#endif { if (type == SF_FINAL || type == SF_DPOP) free(disc); @@ -151,14 +131,7 @@ Sfdisc_t *disc; return 0; } -#if __STD_C int sfdcunion(Sfio_t * f, Sfio_t ** array, int n) -#else -int sfdcunion(f, array, n) -Sfio_t *f; -Sfio_t **array; -int n; -#endif { reg Union_t *un; reg int i; diff --git a/lib/sfio/Sfio_f/_sfclrerr.c b/lib/sfio/Sfio_f/_sfclrerr.c index b830757e9..25ce5e012 100644 --- a/lib/sfio/Sfio_f/_sfclrerr.c +++ b/lib/sfio/Sfio_f/_sfclrerr.c @@ -15,12 +15,7 @@ #undef sfclrerr -#if __STD_C int sfclrerr(reg Sfio_t * f) -#else -int sfclrerr(f) -reg Sfio_t *f; -#endif { return __sf_clrerr(f); } diff --git a/lib/sfio/Sfio_f/_sfdlen.c b/lib/sfio/Sfio_f/_sfdlen.c index 7dee2d7ca..ab71d583c 100644 --- a/lib/sfio/Sfio_f/_sfdlen.c +++ b/lib/sfio/Sfio_f/_sfdlen.c @@ -15,12 +15,7 @@ #undef sfdlen -#if __STD_C int sfdlen(reg Sfdouble_t v) -#else -int sfdlen(v) -reg Sfdouble_t v; -#endif { return __sf_dlen(v); } diff --git a/lib/sfio/Sfio_f/_sfeof.c b/lib/sfio/Sfio_f/_sfeof.c index 6d93f5ada..42d976f98 100644 --- a/lib/sfio/Sfio_f/_sfeof.c +++ b/lib/sfio/Sfio_f/_sfeof.c @@ -15,12 +15,7 @@ #undef sfeof -#if __STD_C int sfeof(reg Sfio_t * f) -#else -int sfeof(f) -reg Sfio_t *f; -#endif { return __sf_eof(f); } diff --git a/lib/sfio/Sfio_f/_sferror.c b/lib/sfio/Sfio_f/_sferror.c index 84c3e12d2..499a68748 100644 --- a/lib/sfio/Sfio_f/_sferror.c +++ b/lib/sfio/Sfio_f/_sferror.c @@ -15,12 +15,7 @@ #undef sferror -#if __STD_C int sferror(reg Sfio_t * f) -#else -int sferror(f) -reg Sfio_t *f; -#endif { return __sf_error(f); } diff --git a/lib/sfio/Sfio_f/_sffileno.c b/lib/sfio/Sfio_f/_sffileno.c index d55440d13..4e874954f 100644 --- a/lib/sfio/Sfio_f/_sffileno.c +++ b/lib/sfio/Sfio_f/_sffileno.c @@ -15,12 +15,7 @@ #undef sffileno -#if __STD_C int sffileno(reg Sfio_t * f) -#else -int sffileno(f) -reg Sfio_t *f; -#endif { return __sf_fileno(f); } diff --git a/lib/sfio/Sfio_f/_sfgetc.c b/lib/sfio/Sfio_f/_sfgetc.c index 02dd0cf23..229c78d08 100644 --- a/lib/sfio/Sfio_f/_sfgetc.c +++ b/lib/sfio/Sfio_f/_sfgetc.c @@ -15,12 +15,7 @@ #undef sfgetc -#if __STD_C int sfgetc(reg Sfio_t * f) -#else -int sfgetc(f) -reg Sfio_t *f; -#endif { return __sf_getc(f); } diff --git a/lib/sfio/Sfio_f/_sfllen.c b/lib/sfio/Sfio_f/_sfllen.c index fb4df0345..954b703e4 100644 --- a/lib/sfio/Sfio_f/_sfllen.c +++ b/lib/sfio/Sfio_f/_sfllen.c @@ -15,12 +15,7 @@ #undef sfllen -#if __STD_C int sfllen(reg Sflong_t v) -#else -int sfllen(v) -reg Sflong_t v; -#endif { return __sf_llen(v); } diff --git a/lib/sfio/Sfio_f/_sfputc.c b/lib/sfio/Sfio_f/_sfputc.c index dc2ee6c82..53e5d8360 100644 --- a/lib/sfio/Sfio_f/_sfputc.c +++ b/lib/sfio/Sfio_f/_sfputc.c @@ -15,13 +15,7 @@ #undef sfputc -#if __STD_C int sfputc(reg Sfio_t * f, reg int c) -#else -int sfputc(f, c) -reg Sfio_t *f; -reg int c; -#endif { return __sf_putc(f, c); } diff --git a/lib/sfio/Sfio_f/_sfputd.c b/lib/sfio/Sfio_f/_sfputd.c index e52ceed3d..1017c43d0 100644 --- a/lib/sfio/Sfio_f/_sfputd.c +++ b/lib/sfio/Sfio_f/_sfputd.c @@ -15,13 +15,7 @@ #undef sfputd -#if __STD_C int sfputd(reg Sfio_t * f, Sfdouble_t d) -#else -int sfputd(f, d) -reg Sfio_t *f; -reg Sfdouble_t d; -#endif { return __sf_putd(f, d); } diff --git a/lib/sfio/Sfio_f/_sfputl.c b/lib/sfio/Sfio_f/_sfputl.c index 7598f3ae6..7bd08d2b9 100644 --- a/lib/sfio/Sfio_f/_sfputl.c +++ b/lib/sfio/Sfio_f/_sfputl.c @@ -15,13 +15,7 @@ #undef sfputl -#if __STD_C int sfputl(reg Sfio_t * f, Sflong_t l) -#else -int sfputl(f, l) -reg Sfio_t *f; -reg Sflong_t l; -#endif { return __sf_putl(f, l); } diff --git a/lib/sfio/Sfio_f/_sfputm.c b/lib/sfio/Sfio_f/_sfputm.c index 00363efea..2107b3909 100644 --- a/lib/sfio/Sfio_f/_sfputm.c +++ b/lib/sfio/Sfio_f/_sfputm.c @@ -15,14 +15,7 @@ #undef sfputm -#if __STD_C int sfputm(reg Sfio_t * f, Sfulong_t u, Sfulong_t m) -#else -int sfputm(f, u, m) -reg Sfio_t *f; -reg Sfulong_t u; -reg Sfulong_t m; -#endif { return __sf_putm(f, u, m); } diff --git a/lib/sfio/Sfio_f/_sfputu.c b/lib/sfio/Sfio_f/_sfputu.c index 9a15c3795..ce65aeeab 100644 --- a/lib/sfio/Sfio_f/_sfputu.c +++ b/lib/sfio/Sfio_f/_sfputu.c @@ -15,13 +15,7 @@ #undef sfputu -#if __STD_C int sfputu(reg Sfio_t * f, Sfulong_t u) -#else -int sfputu(f, u) -reg Sfio_t *f; -reg Sfulong_t u; -#endif { return __sf_putu(f, u); } diff --git a/lib/sfio/Sfio_f/_sfslen.c b/lib/sfio/Sfio_f/_sfslen.c index 494736c23..b076d52c0 100644 --- a/lib/sfio/Sfio_f/_sfslen.c +++ b/lib/sfio/Sfio_f/_sfslen.c @@ -15,11 +15,7 @@ #undef sfslen -#if __STD_C ssize_t sfslen(void) -#else -ssize_t sfslen() -#endif { return __sf_slen(); } diff --git a/lib/sfio/Sfio_f/_sfstacked.c b/lib/sfio/Sfio_f/_sfstacked.c index 9877ed679..440a33371 100644 --- a/lib/sfio/Sfio_f/_sfstacked.c +++ b/lib/sfio/Sfio_f/_sfstacked.c @@ -15,12 +15,7 @@ #undef sfstacked -#if __STD_C int sfstacked(reg Sfio_t * f) -#else -int sfstacked(f) -reg Sfio_t *f; -#endif { return __sf_stacked(f); } diff --git a/lib/sfio/Sfio_f/_sfulen.c b/lib/sfio/Sfio_f/_sfulen.c index ec8a93637..1c0afdc69 100644 --- a/lib/sfio/Sfio_f/_sfulen.c +++ b/lib/sfio/Sfio_f/_sfulen.c @@ -15,12 +15,7 @@ #undef sfulen -#if __STD_C int sfulen(reg Sfulong_t v) -#else -int sfulen(v) -reg Sfulong_t v; -#endif { return __sf_ulen(v); } diff --git a/lib/sfio/Sfio_f/_sfvalue.c b/lib/sfio/Sfio_f/_sfvalue.c index a82bad95a..e172ed9f6 100644 --- a/lib/sfio/Sfio_f/_sfvalue.c +++ b/lib/sfio/Sfio_f/_sfvalue.c @@ -15,12 +15,7 @@ #undef sfvalue -#if __STD_C ssize_t sfvalue(reg Sfio_t * f) -#else -ssize_t sfvalue(f) -reg Sfio_t *f; -#endif { return __sf_value(f); } diff --git a/lib/sfio/sfclose.c b/lib/sfio/sfclose.c index 2119fe317..31ab15d7e 100644 --- a/lib/sfio/sfclose.c +++ b/lib/sfio/sfclose.c @@ -18,12 +18,7 @@ ** Written by Kiem-Phong Vo */ -#if __STD_C int sfclose(reg Sfio_t * f) -#else -int sfclose(f) -reg Sfio_t *f; -#endif { reg int local, ex, rv; Void_t *data = NIL(Void_t *); diff --git a/lib/sfio/sfclrlock.c b/lib/sfio/sfclrlock.c index edf820f64..047db9e34 100644 --- a/lib/sfio/sfclrlock.c +++ b/lib/sfio/sfclrlock.c @@ -19,12 +19,7 @@ ** ** Written by Kiem-Phong Vo */ -#if __STD_C int sfclrlock(reg Sfio_t * f) -#else -int sfclrlock(f) -reg Sfio_t *f; -#endif { int rv; diff --git a/lib/sfio/sfcvt.c b/lib/sfio/sfcvt.c index b3c85ee95..46c90c904 100644 --- a/lib/sfio/sfcvt.c +++ b/lib/sfio/sfcvt.c @@ -23,16 +23,14 @@ static char *Inf = "Inf", *Zero = "0"; #define SF_INFINITE ((_Sfi = 3), Inf) #define SF_ZERO ((_Sfi = 1), Zero) -#if __STD_C +/** + * @param dv value to convert + * @param n_digit number of digits wanted + * @param decpt return decimal point + * @param sign return sign + * @param format conversion format + */ char *_sfcvt(Void_t * dv, int n_digit, int *decpt, int *sign, int format) -#else -char *_sfcvt(dv, n_digit, decpt, sign, format) -Void_t *dv; /* value to convert */ -int n_digit; /* number of digits wanted */ -int *decpt; /* to return decimal point */ -int *sign; /* to return sign */ -int format; /* conversion format */ -#endif { reg char *sp; reg long n, v; diff --git a/lib/sfio/sfdisc.c b/lib/sfio/sfdisc.c index 7363b2bd8..fc9f739c8 100644 --- a/lib/sfio/sfdisc.c +++ b/lib/sfio/sfdisc.c @@ -18,13 +18,7 @@ ** Written by Kiem-Phong Vo */ -#if __STD_C Sfdisc_t *sfdisc(reg Sfio_t * f, reg Sfdisc_t * disc) -#else -Sfdisc_t *sfdisc(f, disc) -reg Sfio_t *f; -reg Sfdisc_t *disc; -#endif { reg Sfdisc_t *d, *rdisc; reg Sfread_f oreadf; diff --git a/lib/sfio/sfdlen.c b/lib/sfio/sfdlen.c index 6670ed4ba..2b4f8b0a3 100644 --- a/lib/sfio/sfdlen.c +++ b/lib/sfio/sfdlen.c @@ -18,12 +18,7 @@ ** Written by Kiem-Phong Vo */ -#if __STD_C int _sfdlen(Sfdouble_t v) -#else -int _sfdlen(v) -Sfdouble_t v; -#endif { #define N_ARRAY (16*sizeof(Sfdouble_t)) reg int n, w; diff --git a/lib/sfio/sfexcept.c b/lib/sfio/sfexcept.c index 85e2b3ccd..bd8e0d1c0 100644 --- a/lib/sfio/sfexcept.c +++ b/lib/sfio/sfexcept.c @@ -17,15 +17,13 @@ ** Written by Kiem-Phong Vo */ -#if __STD_C +/** + * @param f stream where the exception happened + * @param type type that was performed + * @param io return value that indicated exception + * @param disc discipline in use + */ int _sfexcept(Sfio_t * f, int type, ssize_t io, Sfdisc_t * disc) -#else -int _sfexcept(f, type, io, disc) -Sfio_t *f; /* stream where the exception happened */ -int type; /* io type that was performed */ -ssize_t io; /* the io return value that indicated exception */ -Sfdisc_t *disc; /* discipline in use */ -#endif { reg int ev, local, lock; reg ssize_t size; diff --git a/lib/sfio/sfexit.c b/lib/sfio/sfexit.c index b2eb7ae11..506c192f2 100644 --- a/lib/sfio/sfexit.c +++ b/lib/sfio/sfexit.c @@ -25,12 +25,7 @@ int _AST_already_has_them; #if !_lib_atexit #if _lib_onexit -#if __STD_C int atexit(void (*exitf) (void)) -#else -int atexit(exitf) -void (*exitf) (); -#endif { #if _lib_onexit return onexit(exitf); @@ -45,12 +40,7 @@ typedef struct _exit_s { } Exit_t; static Exit_t *Exit; -#if __STD_C atexit(void (*exitf) (void)) -#else -atexit(exitf) -void (*exitf) (); -#endif { Exit_t *e; int rv; @@ -73,11 +63,7 @@ void (*exitf) (); #if _exit_cleanup /* since exit() calls _cleanup(), we only need to redefine _cleanup() */ -#if __STD_C _cleanup(void) -#else -_cleanup() -#endif { Exit_t *e; for (e = Exit; e; e = e->next) @@ -89,12 +75,7 @@ _cleanup() #else /* in this case, we have to redefine exit() itself */ -#if __STD_C exit(int type) -#else -exit(type) -int type; -#endif { Exit_t *e; for (e = Exit; e; e = e->next) @@ -124,14 +105,7 @@ typedef struct _wait_ { static Waitpid_t *Wait; #ifndef WIN32 -#if __STD_C waitpid(int pid, int *status, int options) -#else -waitpid(pid, status, options) -int pid; -int *status; -int options; -#endif { int id, ps; Waitpid_t *w; diff --git a/lib/sfio/sffcvt.c b/lib/sfio/sffcvt.c index 841d01036..1e035a2bd 100644 --- a/lib/sfio/sffcvt.c +++ b/lib/sfio/sffcvt.c @@ -13,15 +13,13 @@ #include "sfhdr.h" -#if __STD_C +/** + * @param dval value to convert + * @param n_digit number of digits wanted + * @param decpt to return decimal point + * @param sign to return sign + */ char *sffcvt(double dval, int n_digit, int *decpt, int *sign) -#else -char *sffcvt(dval, n_digit, decpt, sign) -double dval; /* value to convert */ -int n_digit; /* number of digits wanted */ -int *decpt; /* to return decimal point */ -int *sign; /* to return sign */ -#endif { return _sfcvt(&dval, n_digit, decpt, sign, 0); } diff --git a/lib/sfio/sffilbuf.c b/lib/sfio/sffilbuf.c index a176aa1ba..e44c668f2 100644 --- a/lib/sfio/sffilbuf.c +++ b/lib/sfio/sffilbuf.c @@ -23,13 +23,11 @@ ** Written by Kiem-Phong Vo */ -#if __STD_C +/** + * @param f fill the read buffer of this stream + * @param n see above + */ int _sffilbuf(Sfio_t * f, reg int n) -#else -int _sffilbuf(f, n) -Sfio_t *f; /* fill the read buffer of this stream */ -reg int n; /* see above */ -#endif { reg ssize_t r; reg int first, local, rcrv, rc, justseek; diff --git a/lib/sfio/sfflsbuf.c b/lib/sfio/sfflsbuf.c index 288eee95c..e54ce8e79 100644 --- a/lib/sfio/sfflsbuf.c +++ b/lib/sfio/sfflsbuf.c @@ -19,13 +19,11 @@ ** Written by Kiem-Phong Vo */ -#if __STD_C +/** + * @param f write out the buffered content of this stream + * @param c if c>=0, c is also written out + */ int _sfflsbuf(reg Sfio_t * f, reg int c) -#else -int _sfflsbuf(f, c) -reg Sfio_t *f; /* write out the buffered content of this stream */ -reg int c; /* if c>=0, c is also written out */ -#endif { reg ssize_t n, w; reg uchar *data; diff --git a/lib/sfio/sfgetd.c b/lib/sfio/sfgetd.c index 8c373998f..535b2cb9a 100644 --- a/lib/sfio/sfgetd.c +++ b/lib/sfio/sfgetd.c @@ -18,12 +18,7 @@ ** Written by Kiem-Phong Vo */ -#if __STD_C Sfdouble_t sfgetd(Sfio_t * f) -#else -Sfdouble_t sfgetd(f) -Sfio_t *f; -#endif { reg uchar *s, *ends, c; reg int p, sign, exp; diff --git a/lib/sfio/sfgetl.c b/lib/sfio/sfgetl.c index a00dbe784..a85cd9a21 100644 --- a/lib/sfio/sfgetl.c +++ b/lib/sfio/sfgetl.c @@ -18,12 +18,7 @@ ** Written by Kiem-Phong Vo */ -#if __STD_C Sflong_t sfgetl(reg Sfio_t * f) -#else -Sflong_t sfgetl(f) -reg Sfio_t *f; -#endif { Sflong_t v; reg uchar *s, *ends, c; diff --git a/lib/sfio/sfgetm.c b/lib/sfio/sfgetm.c index a2071b404..cd3e5ed0e 100644 --- a/lib/sfio/sfgetm.c +++ b/lib/sfio/sfgetm.c @@ -18,13 +18,7 @@ ** Written by Kiem-Phong Vo */ -#if __STD_C Sfulong_t sfgetm(reg Sfio_t * f, Sfulong_t m) -#else -Sfulong_t sfgetm(f, m) -reg Sfio_t *f; -Sfulong_t m; -#endif { Sfulong_t v; reg uchar *s, *ends, c; diff --git a/lib/sfio/sfgetr.c b/lib/sfio/sfgetr.c index 0fe9d56cb..30fbcbce9 100644 --- a/lib/sfio/sfgetr.c +++ b/lib/sfio/sfgetr.c @@ -19,14 +19,12 @@ ** Written by Kiem-Phong Vo */ -#if __STD_C +/** + * @param f stream to read from. r11 on vax + * @param rc record separator. r10 on Vax + * @param type + */ char *sfgetr(reg Sfio_t * f, reg int rc, int type) -#else -char *sfgetr(f, rc, type) -reg Sfio_t *f; /* stream to read from. r11 on vax */ -reg int rc; /* record separator. r10 on Vax */ -int type; -#endif { reg ssize_t n; reg uchar *s, *ends, *us; diff --git a/lib/sfio/sfgetu.c b/lib/sfio/sfgetu.c index 748f8d5b3..8d3f89711 100644 --- a/lib/sfio/sfgetu.c +++ b/lib/sfio/sfgetu.c @@ -18,12 +18,7 @@ ** Written by Kiem-Phong Vo */ -#if __STD_C Sfulong_t sfgetu(reg Sfio_t * f) -#else -Sfulong_t sfgetu(f) -reg Sfio_t *f; -#endif { Sfulong_t v; reg uchar *s, *ends, c; diff --git a/lib/sfio/sfllen.c b/lib/sfio/sfllen.c index da5c2f116..2807af637 100644 --- a/lib/sfio/sfllen.c +++ b/lib/sfio/sfllen.c @@ -17,12 +17,7 @@ ** ** Written by Kiem-Phong Vo */ -#if __STD_C int _sfllen(Sflong_t v) -#else -int _sfllen(v) -Sflong_t v; -#endif { if (v < 0) v = -(v + 1); diff --git a/lib/sfio/sfmode.c b/lib/sfio/sfmode.c index 2a84e86c0..b6f8ad538 100644 --- a/lib/sfio/sfmode.c +++ b/lib/sfio/sfmode.c @@ -45,11 +45,7 @@ typedef void (*Sfsignal_f) _ARG_((int)); static int _Sfsigp = 0; /* # of streams needing SIGPIPE protection */ /* done at exiting time */ -#if __STD_C static void _sfcleanup(void) -#else -static void _sfcleanup() -#endif { reg Sfpool_t *p; reg Sfio_t *f; @@ -94,12 +90,7 @@ static void _sfcleanup() } /* put into discrete pool */ -#if __STD_C int _sfsetpool(Sfio_t * f) -#else -int _sfsetpool(f) -Sfio_t *f; -#endif { reg Sfpool_t *p; reg Sfio_t **array; @@ -148,13 +139,7 @@ Sfio_t *f; } /* create an auxiliary buffer for sfgetr/sfreserve/sfputr */ -#if __STD_C Sfrsrv_t *_sfrsrv(reg Sfio_t * f, reg ssize_t size) -#else -Sfrsrv_t *_sfrsrv(f, size) -reg Sfio_t *f; -reg ssize_t size; -#endif { Sfrsrv_t *rsrv, *rs; @@ -182,26 +167,19 @@ reg ssize_t size; } #ifdef SIGPIPE -#if __STD_C static void ignoresig(int sig) -#else -static void ignoresig(sig) -int sig; -#endif { signal(sig, ignoresig); } #endif -#if __STD_C +/** + * @param f + * @param fd + * @param pid + * @param stdio stdio popen() does not reset SIGPIPE handler + */ int _sfpopen(reg Sfio_t * f, int fd, int pid, int stdio) -#else -int _sfpopen(f, fd, pid, stdio) -reg Sfio_t *f; -int fd; -int pid; -int stdio; /* stdio popen() does not reset SIGPIPE handler */ -#endif { reg Sfproc_t *p; @@ -233,12 +211,10 @@ int stdio; /* stdio popen() does not reset SIGPIPE handler */ return 0; } -#if __STD_C +/** + * @param f stream to close + */ int _sfpclose(reg Sfio_t * f) -#else -int _sfpclose(f) -reg Sfio_t *f; /* stream to close */ -#endif { Sfproc_t *p; int pid, status; @@ -287,13 +263,7 @@ reg Sfio_t *f; /* stream to close */ return status; } -#if __STD_C static int _sfpmode(Sfio_t * f, int type) -#else -static int _sfpmode(f, type) -Sfio_t *f; -int type; -#endif { Sfproc_t *p; @@ -335,14 +305,12 @@ int type; return 0; } -#if __STD_C +/** + * @param f change r/w mode and sync file pointer for this stream + * @param wanted desired mode + * @param local a local call + */ int _sfmode(reg Sfio_t * f, reg int wanted, reg int local) -#else -int _sfmode(f, wanted, local) -reg Sfio_t *f; /* change r/w mode and sync file pointer for this stream */ -reg int wanted; /* desired mode */ -reg int local; /* a local call */ -#endif { reg int n; Sfoff_t addr; diff --git a/lib/sfio/sfmove.c b/lib/sfio/sfmove.c index 9df5f3678..e94fbd3a4 100644 --- a/lib/sfio/sfmove.c +++ b/lib/sfio/sfmove.c @@ -22,15 +22,13 @@ */ #define MAX_SSIZE ((ssize_t)((~((size_t)0)) >> 1)) -#if __STD_C +/** + * @param fr moving data from this stream + * @param fw moving data to this stream + * @param n number of bytes/records to move. <0 for unbounded move + * @param rc record separator + */ Sfoff_t sfmove(Sfio_t * fr, Sfio_t * fw, Sfoff_t n, reg int rc) -#else -Sfoff_t sfmove(fr, fw, n, rc) -Sfio_t *fr; /* moving data from this stream */ -Sfio_t *fw; /* moving data to this stream */ -Sfoff_t n; /* number of bytes/records to move. <0 for unbounded move */ -reg int rc; /* record separator */ -#endif { reg uchar *cp, *next; reg ssize_t r, w; diff --git a/lib/sfio/sfmutex.c b/lib/sfio/sfmutex.c index 03dfb8b5b..883a0fd65 100644 --- a/lib/sfio/sfmutex.c +++ b/lib/sfio/sfmutex.c @@ -19,13 +19,7 @@ */ /* the main locking/unlocking interface */ -#if __STD_C int sfmutex(Sfio_t * f, int type) -#else -int sfmutex(f, type) -Sfio_t *f; -int type; -#endif { #if !vt_threaded return 0; diff --git a/lib/sfio/sfnew.c b/lib/sfio/sfnew.c index 3664f5794..dda63e28e 100644 --- a/lib/sfio/sfnew.c +++ b/lib/sfio/sfnew.c @@ -20,17 +20,15 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C +/** + * @param oldf old stream to be reused + * @param buf a buffer to read/write, if NULL, will be allocated + * @param size buffer size if buf is given or desired buffer size + * @param file file descriptor to read/write from + * @param flags type of file stream + */ Sfio_t *sfnew(Sfio_t * oldf, Void_t * buf, size_t size, int file, int flags) -#else -Sfio_t *sfnew(oldf, buf, size, file, flags) -Sfio_t *oldf; /* old stream to be reused */ -Void_t *buf; /* a buffer to read/write, if NULL, will be allocated */ -size_t size; /* buffer size if buf is given or desired buffer size */ -int file; /* file descriptor to read/write from */ -int flags; /* type of file stream */ -#endif { reg Sfio_t *f; reg int sflags; diff --git a/lib/sfio/sfnotify.c b/lib/sfio/sfnotify.c index 028396a94..38229348e 100644 --- a/lib/sfio/sfnotify.c +++ b/lib/sfio/sfnotify.c @@ -18,12 +18,7 @@ ** ** Written by Kiem-Phong Vo. */ -#if __STD_C int sfnotify(void (*notify) (Sfio_t *, int, int)) -#else -int sfnotify(notify) -void (*notify) (); -#endif { _Sfnotify = notify; return 0; diff --git a/lib/sfio/sfnputc.c b/lib/sfio/sfnputc.c index 98092164b..7fd24fc80 100644 --- a/lib/sfio/sfnputc.c +++ b/lib/sfio/sfnputc.c @@ -18,14 +18,12 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C +/** + * @param f file to write + * @param c char to be written + * @param number of time to repeat + */ ssize_t sfnputc(reg Sfio_t * f, reg int c, reg size_t n) -#else -ssize_t sfnputc(f, c, n) -reg Sfio_t *f; /* file to write */ -reg int c; /* char to be written */ -reg size_t n; /* number of time to repeat */ -#endif { reg uchar *ps; reg ssize_t p, w; diff --git a/lib/sfio/sfopen.c b/lib/sfio/sfopen.c index 2082e4695..19b832371 100644 --- a/lib/sfio/sfopen.c +++ b/lib/sfio/sfopen.c @@ -23,14 +23,12 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C +/** + * @param f old stream structure + * @param file file/string to be opened + * @param mode mode of the stream + */ Sfio_t *sfopen(reg Sfio_t * f, const char *file, const char *mode) -#else -Sfio_t *sfopen(f, file, mode) -reg Sfio_t *f; /* old stream structure */ -char *file; /* file/string to be opened */ -reg char *mode; /* mode of the stream */ -#endif { int fd, oldfd, oflags, sflags; @@ -126,14 +124,7 @@ reg char *mode; /* mode of the stream */ return f; } -#if __STD_C int _sftype(reg const char *mode, int *oflagsp, int *uflagp) -#else -int _sftype(mode, oflagsp, uflagp) -reg char *mode; -int *oflagsp; -int *uflagp; -#endif { reg int sflags, oflags, uflag; diff --git a/lib/sfio/sfpkrd.c b/lib/sfio/sfpkrd.c index efd5bf608..6ce4333eb 100644 --- a/lib/sfio/sfpkrd.c +++ b/lib/sfio/sfpkrd.c @@ -28,21 +28,18 @@ #define STREAM_PEEK 001 #define SOCKET_PEEK 002 -#if __STD_C +/** + * @param fd file descriptor + * @param argbuf buffer to read data + * @param n buffer size + * @param rc record character + * @param tm time-out + * @param action >0: peeking, if rc>=0, get action records, + * <0: no peeking, if rc>=0, get -action records, + * =0: no peeking, if rc>=0, must get a single record + */ ssize_t sfpkrd(int fd, Void_t * argbuf, size_t n, int rc, long tm, int action) -#else -ssize_t sfpkrd(fd, argbuf, n, rc, tm, action) -int fd; /* file descriptor */ -Void_t *argbuf; /* buffer to read data */ -size_t n; /* buffer size */ -int rc; /* record character */ -long tm; /* time-out */ -int action; /* >0: peeking, if rc>=0, get action records, - <0: no peeking, if rc>=0, get -action records, - =0: no peeking, if rc>=0, must get a single record - */ -#endif { reg ssize_t r; reg int ntry, t; diff --git a/lib/sfio/sfpoll.c b/lib/sfio/sfpoll.c index ddd28449c..55f05f3a3 100644 --- a/lib/sfio/sfpoll.c +++ b/lib/sfio/sfpoll.c @@ -20,14 +20,12 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C +/** + * @param fa array of streams to poll + * @param n number of streams in array + * @param tm the amount of time in ms to wait for selecting + */ int sfpoll(Sfio_t ** fa, reg int n, int tm) -#else -int sfpoll(fa, n, tm) -Sfio_t **fa; /* array of streams to poll */ -reg int n; /* number of streams in array */ -int tm; /* the amount of time in ms to wait for selecting */ -#endif { reg int r, c, m; reg Sfio_t *f; diff --git a/lib/sfio/sfpool.c b/lib/sfio/sfpool.c index 7c179dbc9..064cb8a70 100644 --- a/lib/sfio/sfpool.c +++ b/lib/sfio/sfpool.c @@ -26,12 +26,7 @@ ** link list and during such walks may free up streams&pools. Free pools will be ** reused in newpool(). */ -#if __STD_C static int delpool(reg Sfpool_t * p) -#else -static int delpool(p) -reg Sfpool_t *p; -#endif { POOLMTXSTART(p); @@ -42,12 +37,7 @@ reg Sfpool_t *p; POOLMTXRETURN(p, 0); } -#if __STD_C static Sfpool_t *newpool(reg int mode) -#else -static Sfpool_t *newpool(mode) -reg int mode; -#endif { reg Sfpool_t *p, *last = &_Sfpool; @@ -87,14 +77,12 @@ reg int mode; } /* move a stream to head */ -#if __STD_C +/** + * @param p the pool + * @param f the stream + * @param n current position in pool + */ static int _sfphead(Sfpool_t * p, Sfio_t * f, int n) -#else -static int _sfphead(p, f, n) -Sfpool_t *p; /* the pool */ -Sfio_t *f; /* the stream */ -int n; /* current position in pool */ -#endif { reg Sfio_t *head; reg ssize_t k, w, v; @@ -159,14 +147,12 @@ int n; /* current position in pool */ } /* delete a stream from its pool */ -#if __STD_C +/** + * @param p the pool + * @param f the stream + * @param n position in pool + */ static int _sfpdelete(Sfpool_t * p, Sfio_t * f, int n) -#else -static int _sfpdelete(p, f, n) -Sfpool_t *p; /* the pool */ -Sfio_t *f; /* the stream */ -int n; /* position in pool */ -#endif { POOLMTXSTART(p); @@ -209,13 +195,11 @@ int n; /* position in pool */ POOLMTXRETURN(p, 0); } -#if __STD_C +/** + * @param f + * @param type <0 : deleting, 0: move-to-front, >0: inserting + */ static int _sfpmove(reg Sfio_t * f, reg int type) -#else -static int _sfpmove(f, type) -reg Sfio_t *f; -reg int type; /* <0 : deleting, 0: move-to-front, >0: inserting */ -#endif { reg Sfpool_t *p; reg int n; @@ -235,14 +219,7 @@ reg int type; /* <0 : deleting, 0: move-to-front, >0: inserting */ } } -#if __STD_C Sfio_t *sfpool(reg Sfio_t * f, reg Sfio_t * pf, reg int mode) -#else -Sfio_t *sfpool(f, pf, mode) -reg Sfio_t *f; -reg Sfio_t *pf; -reg int mode; -#endif { reg Sfpool_t *p; reg Sfio_t *rv; diff --git a/lib/sfio/sfpopen.c b/lib/sfio/sfpopen.c index 4f504da0f..b439bf1e8 100644 --- a/lib/sfio/sfpopen.c +++ b/lib/sfio/sfpopen.c @@ -32,12 +32,7 @@ static char Meta[1 << CHAR_BIT], **Path; /* execute command directly if possible; else use the shell */ -#if __STD_C static void execute(const char *argcmd) -#else -static void execute(argcmd) -char *argcmd; -#endif { reg char *s, *cmd, **argv, **p, *interp; reg int n; @@ -126,14 +121,12 @@ char *argcmd; #endif /*defined(_PACKAGE_ast)*/ #ifndef WIN32 -#if __STD_C +/** + * @param f + * @param command command to execute + * @param mode mode of the stream + */ Sfio_t *sfpopen(Sfio_t * f, const char *command, const char *mode) -#else -Sfio_t *sfpopen(f, command, mode) -Sfio_t *f; -char *command; /* command to execute */ -char *mode; /* mode of the stream */ -#endif { #if defined(_PACKAGE_ast) reg Proc_t *proc; diff --git a/lib/sfio/sfprintf.c b/lib/sfio/sfprintf.c index 0ee28f50d..d04211fea 100644 --- a/lib/sfio/sfprintf.c +++ b/lib/sfio/sfprintf.c @@ -18,12 +18,7 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C int sfprintf(Sfio_t * f, const char *form, ...) -#else -int sfprintf(va_alist) -va_dcl -#endif { va_list args; reg int rv; @@ -43,15 +38,7 @@ va_dcl return rv; } -#if __STD_C int sfvsprintf(char *s, int n, const char *form, va_list args) -#else -int sfvsprintf(s, n, form, args) -char *s; -int n; -char *form; -va_list args; -#endif { Sfio_t f; reg int rv; @@ -75,12 +62,7 @@ va_list args; return rv; } -#if __STD_C int sfsprintf(char *s, int n, const char *form, ...) -#else -int sfsprintf(va_alist) -va_dcl -#endif { va_list args; reg int rv; diff --git a/lib/sfio/sfprints.c b/lib/sfio/sfprints.c index e9159de9d..8bbac855d 100644 --- a/lib/sfio/sfprints.c +++ b/lib/sfio/sfprints.c @@ -20,12 +20,7 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C char *sfprints(const char *form, ...) -#else -char *sfprints(va_alist) -va_dcl -#endif { va_list args; reg int rv; diff --git a/lib/sfio/sfpurge.c b/lib/sfio/sfpurge.c index f52436377..dc0117cda 100644 --- a/lib/sfio/sfpurge.c +++ b/lib/sfio/sfpurge.c @@ -18,12 +18,7 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C int sfpurge(reg Sfio_t * f) -#else -int sfpurge(f) -reg Sfio_t *f; -#endif { reg int mode; diff --git a/lib/sfio/sfputd.c b/lib/sfio/sfputd.c index ba0a46e46..beee7a493 100644 --- a/lib/sfio/sfputd.c +++ b/lib/sfio/sfputd.c @@ -18,13 +18,7 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C int _sfputd(Sfio_t * f, Sfdouble_t v) -#else -int _sfputd(f, v) -Sfio_t *f; -Sfdouble_t v; -#endif { #define N_ARRAY (16*sizeof(Sfdouble_t)) reg ssize_t n, w; diff --git a/lib/sfio/sfputl.c b/lib/sfio/sfputl.c index 3204d8ff4..668c6e0fd 100644 --- a/lib/sfio/sfputl.c +++ b/lib/sfio/sfputl.c @@ -18,13 +18,11 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C +/** + * @param f write a portable long to this stream + * @param v the value to be written + */ int _sfputl(reg Sfio_t * f, Sflong_t v) -#else -int _sfputl(f, v) -reg Sfio_t *f; /* write a portable long to this stream */ -Sflong_t v; /* the value to be written */ -#endif { #define N_ARRAY (2*sizeof(Sflong_t)) reg uchar *s, *ps; diff --git a/lib/sfio/sfputm.c b/lib/sfio/sfputm.c index fc374f892..372da9cc5 100644 --- a/lib/sfio/sfputm.c +++ b/lib/sfio/sfputm.c @@ -18,14 +18,12 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C +/** + * @param f write a portable ulong to this stream + * @param v the unsigned value to be written + * @param max the max value of the range + */ int _sfputm(reg Sfio_t * f, Sfulong_t v, Sfulong_t max) -#else -int _sfputm(f, v, max) -reg Sfio_t *f; /* write a portable ulong to this stream */ -Sfulong_t v; /* the unsigned value to be written */ -Sfulong_t max; /* the max value of the range */ -#endif { #define N_ARRAY (2*sizeof(Sfulong_t)) reg uchar *s, *ps; diff --git a/lib/sfio/sfputr.c b/lib/sfio/sfputr.c index 8258ded9d..7f784868a 100644 --- a/lib/sfio/sfputr.c +++ b/lib/sfio/sfputr.c @@ -17,14 +17,12 @@ ** ** Written by Kiem-Phong Vo. */ -#if __STD_C +/** + * @param f write to this stream + * @param s string to write + * @param rc record separator + */ ssize_t sfputr(reg Sfio_t * f, const char *s, reg int rc) -#else -ssize_t sfputr(f, s, rc) -reg Sfio_t *f; /* write to this stream */ -char *s; /* string to write */ -reg int rc; /* record separator. */ -#endif { reg ssize_t p, n, w; reg uchar *ps; diff --git a/lib/sfio/sfputu.c b/lib/sfio/sfputu.c index a3bf0e379..8791ac7c4 100644 --- a/lib/sfio/sfputu.c +++ b/lib/sfio/sfputu.c @@ -18,13 +18,13 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C +/** + * @param f write a portable ulong to this stream + * @param v the unsigned value to be written + * @param + * @param + */ int _sfputu(reg Sfio_t * f, Sfulong_t v) -#else -int _sfputu(f, v) -reg Sfio_t *f; /* write a portable ulong to this stream */ -Sfulong_t v; /* the unsigned value to be written */ -#endif { #define N_ARRAY (2*sizeof(Sfulong_t)) reg uchar *s, *ps; diff --git a/lib/sfio/sfraise.c b/lib/sfio/sfraise.c index 5755b34b2..a8b814898 100644 --- a/lib/sfio/sfraise.c +++ b/lib/sfio/sfraise.c @@ -17,14 +17,13 @@ ** ** Written by Kiem-Phong Vo. */ -#if __STD_C +/** + * @param f stream + * @param type type of event + * @param data associated data + * @param + */ int sfraise(Sfio_t * f, int type, Void_t * data) -#else -int sfraise(f, type, data) -Sfio_t *f; /* stream */ -int type; /* type of event */ -Void_t *data; /* associated data */ -#endif { reg Sfdisc_t *disc, *next, *d; reg int local, rv; diff --git a/lib/sfio/sfrd.c b/lib/sfio/sfrd.c index 268ba0849..0dbc72ef7 100644 --- a/lib/sfio/sfrd.c +++ b/lib/sfio/sfrd.c @@ -20,11 +20,7 @@ */ /* synchronize unseekable write streams */ -#if __STD_C static void _sfwrsync(void) -#else -static void _sfwrsync() -#endif { reg Sfpool_t *p; reg Sfio_t *f; @@ -50,16 +46,8 @@ static void _sfwrsync() } } -#if __STD_C ssize_t sfrd(reg Sfio_t * f, reg Void_t * buf, reg size_t n, Sfdisc_t * disc) -#else -ssize_t sfrd(f, buf, n, disc) -reg Sfio_t *f; -reg Void_t *buf; -reg size_t n; -Sfdisc_t *disc; -#endif { Sfoff_t r; reg Sfdisc_t *dc; diff --git a/lib/sfio/sfread.c b/lib/sfio/sfread.c index fd91a098b..5aba2fde1 100644 --- a/lib/sfio/sfread.c +++ b/lib/sfio/sfread.c @@ -18,14 +18,13 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C +/** + * @param f read from this stream + * @param buf buffer to read into + * @param n number of bytes to be read + * @param + */ ssize_t sfread(reg Sfio_t * f, Void_t * buf, reg size_t n) -#else -ssize_t sfread(f, buf, n) -reg Sfio_t *f; /* read from this stream. */ -Void_t *buf; /* buffer to read into */ -reg size_t n; /* number of bytes to be read. */ -#endif { reg uchar *s, *begs; reg ssize_t r; diff --git a/lib/sfio/sfreserve.c b/lib/sfio/sfreserve.c index fc4468188..c0b7ce7d4 100644 --- a/lib/sfio/sfreserve.c +++ b/lib/sfio/sfreserve.c @@ -18,14 +18,12 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C +/** + * @param f file to peek + * @param size size of peek + * @param type LOCKR: lock stream, LASTR: last record + */ Void_t *sfreserve(reg Sfio_t * f, ssize_t size, int type) -#else -Void_t *sfreserve(f, size, type) -reg Sfio_t *f; /* file to peek */ -ssize_t size; /* size of peek */ -int type; /* LOCKR: lock stream, LASTR: last record */ -#endif { reg ssize_t n, sz; reg Sfrsrv_t *rsrv; diff --git a/lib/sfio/sfresize.c b/lib/sfio/sfresize.c index 2229ccff5..665080f6f 100644 --- a/lib/sfio/sfresize.c +++ b/lib/sfio/sfresize.c @@ -17,13 +17,7 @@ Written by Kiem-Phong Vo. */ -#if __STD_C int sfresize(Sfio_t * f, Sfoff_t size) -#else -int sfresize(f, size) -Sfio_t *f; -Sfoff_t size; -#endif { SFMTXSTART(f, -1); diff --git a/lib/sfio/sfscanf.c b/lib/sfio/sfscanf.c index 59e03630f..0a2f4b3fa 100644 --- a/lib/sfio/sfscanf.c +++ b/lib/sfio/sfscanf.c @@ -18,12 +18,7 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C int sfscanf(Sfio_t * f, const char *form, ...) -#else -int sfscanf(va_alist) -va_dcl -#endif { va_list args; reg int rv; @@ -43,14 +38,7 @@ va_dcl return rv; } -#if __STD_C int sfvsscanf(const char *s, const char *form, va_list args) -#else -int sfvsscanf(s, form, args) -char *s; -char *form; -va_list args; -#endif { Sfio_t f; @@ -69,12 +57,7 @@ va_list args; return sfvscanf(&f, form, args); } -#if __STD_C int sfsscanf(const char *s, const char *form, ...) -#else -int sfsscanf(va_alist) -va_dcl -#endif { va_list args; reg int rv; diff --git a/lib/sfio/sfseek.c b/lib/sfio/sfseek.c index d022514be..1a61e3214 100644 --- a/lib/sfio/sfseek.c +++ b/lib/sfio/sfseek.c @@ -18,13 +18,7 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C static void newpos(Sfio_t * f, Sfoff_t p) -#else -static void newpos(f, p) -Sfio_t *f; -Sfoff_t p; -#endif { #ifdef MAP_TYPE if ((f->bits & SF_MMAP) && f->data) { @@ -40,14 +34,12 @@ Sfoff_t p; } } -#if __STD_C +/** + * @param f seek to a new location in this stream + * @param p place to seek to + * @param type 0: from org, 1: from here, 2: from end + */ Sfoff_t sfseek(Sfio_t * f, Sfoff_t p, int type) -#else -Sfoff_t sfseek(f, p, type) -Sfio_t *f; /* seek to a new location in this stream */ -Sfoff_t p; /* place to seek to */ -int type; /* 0: from org, 1: from here, 2: from end */ -#endif { Sfoff_t r, s; size_t a, b, c; diff --git a/lib/sfio/sfset.c b/lib/sfio/sfset.c index 0f343ecf6..0d75481ef 100644 --- a/lib/sfio/sfset.c +++ b/lib/sfio/sfset.c @@ -18,14 +18,7 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C int sfset(reg Sfio_t * f, reg int flags, reg int set) -#else -int sfset(f, flags, set) -reg Sfio_t *f; -reg int flags; -reg int set; -#endif { reg int oflags; diff --git a/lib/sfio/sfsetbuf.c b/lib/sfio/sfsetbuf.c index 36803e91f..2d959d887 100644 --- a/lib/sfio/sfsetbuf.c +++ b/lib/sfio/sfsetbuf.c @@ -44,14 +44,12 @@ _END_EXTERNS_ #define fstat(fd,st) (-1) #endif /*_sys_stat*/ -#if __STD_C +/** + * @param f stream to be buffered + * @param buf new buffer + * @param size buffer size, -1 for default size + */ Void_t *sfsetbuf(reg Sfio_t * f, reg Void_t * buf, reg size_t size) -#else -Void_t *sfsetbuf(f, buf, size) -reg Sfio_t *f; /* stream to be buffered */ -reg Void_t *buf; /* new buffer */ -reg size_t size; /* buffer size, -1 for default size */ -#endif { reg int sf_malloc; reg uchar *obuf; diff --git a/lib/sfio/sfsetfd.c b/lib/sfio/sfsetfd.c index 87fdb67f9..d1aedf629 100644 --- a/lib/sfio/sfsetfd.c +++ b/lib/sfio/sfsetfd.c @@ -18,13 +18,7 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C static int _sfdup(reg int fd, reg int newfd) -#else -static int _sfdup(fd, newfd) -reg int fd; -reg int newfd; -#endif { reg int dupfd; @@ -47,13 +41,7 @@ reg int newfd; #endif } -#if __STD_C int sfsetfd(reg Sfio_t * f, reg int newfd) -#else -int sfsetfd(f, newfd) -reg Sfio_t *f; -reg int newfd; -#endif { reg int oldfd; diff --git a/lib/sfio/sfsize.c b/lib/sfio/sfsize.c index 57116acee..8ff1087b9 100644 --- a/lib/sfio/sfsize.c +++ b/lib/sfio/sfsize.c @@ -17,12 +17,7 @@ ** ** Written by Kiem-Phong Vo. */ -#if __STD_C Sfoff_t sfsize(reg Sfio_t * f) -#else -Sfoff_t sfsize(f) -reg Sfio_t *f; -#endif { Sfdisc_t *disc; reg int mode; diff --git a/lib/sfio/sfsk.c b/lib/sfio/sfsk.c index 12e341044..2b82c1b52 100644 --- a/lib/sfio/sfsk.c +++ b/lib/sfio/sfsk.c @@ -17,15 +17,7 @@ ** ** Written by Kiem-Phong Vo. */ -#if __STD_C Sfoff_t sfsk(reg Sfio_t * f, Sfoff_t addr, reg int type, Sfdisc_t * disc) -#else -Sfoff_t sfsk(f, addr, type, disc) -reg Sfio_t *f; -Sfoff_t addr; -reg int type; -Sfdisc_t *disc; -#endif { Sfoff_t p; reg Sfdisc_t *dc; diff --git a/lib/sfio/sfstack.c b/lib/sfio/sfstack.c index 38a2e81ff..b3cbbe9de 100644 --- a/lib/sfio/sfstack.c +++ b/lib/sfio/sfstack.c @@ -29,13 +29,11 @@ return(rv); \ } -#if __STD_C +/** + * @param f1 base of stack + * @param f2 top of stack + */ Sfio_t *sfstack(Sfio_t * f1, Sfio_t * f2) -#else -Sfio_t *sfstack(f1, f2) -Sfio_t *f1; /* base of stack */ -Sfio_t *f2; /* top of stack */ -#endif { reg int n; reg Sfio_t *rf; diff --git a/lib/sfio/sfstrtod.c b/lib/sfio/sfstrtod.c index d3fec778a..b4d2cb966 100644 --- a/lib/sfio/sfstrtod.c +++ b/lib/sfio/sfstrtod.c @@ -24,12 +24,7 @@ #define FPART 1 /* doing fractional part */ #define EPART 2 /* doing exponent part */ -#if __STD_C static Sfdouble_t sfpow10(reg int n) -#else -static Sfdouble_t sfpow10(n) -reg int n; -#endif { Sfdouble_t dval; @@ -63,13 +58,11 @@ reg int n; return dval; } -#if __STD_C +/** + * @param s string to convert + * @param retp to return the remainder of string + */ Sfdouble_t _sfstrtod(reg const char *s, char **retp) -#else -Sfdouble_t _sfstrtod(s, retp) -reg char *s; /* string to convert */ -char **retp; /* to return the remainder of string */ -#endif { reg int n, c, m; reg int mode, fexp, sign, expsign; diff --git a/lib/sfio/sfswap.c b/lib/sfio/sfswap.c index fdc8e90cf..524fbd88d 100644 --- a/lib/sfio/sfswap.c +++ b/lib/sfio/sfswap.c @@ -21,13 +21,7 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C Sfio_t *sfswap(reg Sfio_t * f1, reg Sfio_t * f2) -#else -Sfio_t *sfswap(f1, f2) -reg Sfio_t *f1; -reg Sfio_t *f2; -#endif { Sfio_t tmp; int f1pool, f2pool, f1mode, f2mode, f1flags, f2flags; diff --git a/lib/sfio/sfsync.c b/lib/sfio/sfsync.c index 3dbd7e028..3309b8f15 100644 --- a/lib/sfio/sfsync.c +++ b/lib/sfio/sfsync.c @@ -19,11 +19,7 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C static int _sfall(void) -#else -static int _sfall() -#endif { reg Sfpool_t *p, *next; reg Sfio_t *f; @@ -70,12 +66,10 @@ static int _sfall() return rv; } -#if __STD_C +/** + * @param f stream to be synchronized + */ int sfsync(reg Sfio_t * f) -#else -int sfsync(f) -reg Sfio_t *f; /* stream to be synchronized */ -#endif { int local, rv, mode; Sfio_t *origf; diff --git a/lib/sfio/sftable.c b/lib/sfio/sftable.c index 7c38f11e1..1aef9efae 100644 --- a/lib/sfio/sftable.c +++ b/lib/sfio/sftable.c @@ -18,13 +18,7 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C static char *sffmtint(const char *str, int *v) -#else -static char *sffmtint(str, v) -char *str; -int *v; -#endif { for (*v = 0; isdigit(*str); ++str) *v = *v * 10 + (*str - '0'); @@ -32,16 +26,8 @@ int *v; return (char *) str; } -#if __STD_C static Fmtpos_t *sffmtpos(Sfio_t * f, const char *form, va_list args, int type) -#else -static Fmtpos_t *sffmtpos(f, form, args, type) -Sfio_t *f; -char *form; -va_list args; -int type; -#endif { int base, fmt, flags, dot, width, precis; ssize_t n_str, size = 0; diff --git a/lib/sfio/sftell.c b/lib/sfio/sftell.c index e1ae01e6f..913c6fda6 100644 --- a/lib/sfio/sftell.c +++ b/lib/sfio/sftell.c @@ -18,12 +18,7 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C Sfoff_t sftell(reg Sfio_t * f) -#else -Sfoff_t sftell(f) -reg Sfio_t *f; -#endif { reg int mode; Sfoff_t p; diff --git a/lib/sfio/sftmp.c b/lib/sfio/sftmp.c index 60696d4f5..464dcf534 100644 --- a/lib/sfio/sftmp.c +++ b/lib/sfio/sftmp.c @@ -44,15 +44,7 @@ struct _file_s { static File_t *File; /* list pf temp files */ -#if __STD_C static int _tmprmfile(Sfio_t * f, int type, Void_t * val, Sfdisc_t * disc) -#else -static int _tmprmfile(f, type, val, disc) -Sfio_t *f; -int type; -Void_t *val; -Sfdisc_t *disc; -#endif { reg File_t *ff, *last; @@ -87,11 +79,7 @@ Sfdisc_t *disc; return 0; } -#if __STD_C static void _rmfiles(void) -#else -static void _rmfiles() -#endif { reg File_t *ff, *next; @@ -109,13 +97,7 @@ NIL(Sfdisc_t *) }; #endif /*_tmp_rmfail*/ -#if __STD_C static int _rmtmp(Sfio_t * f, char *file) -#else -static int _rmtmp(f, file) -Sfio_t *f; -char *file; -#endif { #if _tmp_rmfail /* remove only when stream is closed */ reg File_t *ff; @@ -145,12 +127,7 @@ char *file; #define TMPDFLT "/tmp" static char **Tmppath, **Tmpcur; -#if __STD_C char **_sfgetpath(char *path) -#else -char **_sfgetpath(path) -char *path; -#endif { reg char *p, **dirs; reg int n; @@ -192,12 +169,7 @@ char *path; #endif /*!defined(_PACKAGE_ast) */ -#if __STD_C static int _tmpfd(Sfio_t * f) -#else -static int _tmpfd(f) -Sfio_t *f; -#endif { reg char *file; reg int fd; @@ -280,15 +252,7 @@ Sfio_t *f; return fd; } -#if __STD_C static int _tmpexcept(Sfio_t * f, int type, Void_t * val, Sfdisc_t * disc) -#else -static int _tmpexcept(f, type, val, disc) -Sfio_t *f; -int type; -Void_t *val; -Sfdisc_t *disc; -#endif { reg int fd, m; reg Sfio_t *sf; @@ -368,12 +332,7 @@ Sfdisc_t *disc; return 1; } -#if __STD_C Sfio_t *sftmp(reg size_t s) -#else -Sfio_t *sftmp(s) -reg size_t s; -#endif { reg Sfio_t *f; static Sfdisc_t Tmpdisc = diff --git a/lib/sfio/sfungetc.c b/lib/sfio/sfungetc.c index a3b879484..ff48288cb 100644 --- a/lib/sfio/sfungetc.c +++ b/lib/sfio/sfungetc.c @@ -17,16 +17,8 @@ ** ** Written by Kiem-Phong Vo. */ -#if __STD_C static int _uexcept(reg Sfio_t * f, reg int type, Void_t * val, reg Sfdisc_t * disc) -#else -static int _uexcept(f, type, val, disc) -reg Sfio_t *f; -reg int type; -Void_t *val; -reg Sfdisc_t *disc; -#endif { NOTUSED(val); @@ -41,13 +33,11 @@ reg Sfdisc_t *disc; return 1; } -#if __STD_C +/** + * @param f push back one byte to this stream + * @param c the value to be pushed back + */ int sfungetc(reg Sfio_t * f, reg int c) -#else -int sfungetc(f, c) -reg Sfio_t *f; /* push back one byte to this stream */ -reg int c; /* the value to be pushed back */ -#endif { reg Sfio_t *uf; diff --git a/lib/sfio/sfvprintf.c b/lib/sfio/sfvprintf.c index c0c482c40..405ab52cb 100644 --- a/lib/sfio/sfvprintf.c +++ b/lib/sfio/sfvprintf.c @@ -26,14 +26,12 @@ #define FPRECIS 6 /* default precision for floats */ -#if __STD_C +/** + * @param f file to print to + * @param form format to use + * @param args arg list if !argf + */ int sfvprintf(Sfio_t * f, const char *form, va_list args) -#else -int sfvprintf(f, form, args) -Sfio_t *f; /* file to print to */ -char *form; /* format to use */ -va_list args; /* arg list if !argf */ -#endif { reg int v = 0, n_s, base, fmt, flags; Sflong_t lv; diff --git a/lib/sfio/sfvscanf.c b/lib/sfio/sfvscanf.c index 54e3f66c2..f624c12b2 100644 --- a/lib/sfio/sfvscanf.c +++ b/lib/sfio/sfvscanf.c @@ -20,13 +20,11 @@ #define MAXWIDTH (int)(((uint)~0)>>1) /* max amount to scan */ -#if __STD_C +/** + * @param form format string + * @param accept accepted characters are set to 1 + */ static char *setclass(reg char *form, reg char *accept) -#else -static char *setclass(form, accept) -reg char *form; /* format string */ -reg char *accept; /* accepted characters are set to 1 */ -#endif { reg int fmt, c, yes; @@ -59,13 +57,7 @@ reg char *accept; /* accepted characters are set to 1 */ return form; } -#if __STD_C static void _sfbuf(Sfio_t * f, int *rs) -#else -static void _sfbuf(f, rs) -Sfio_t *f; -int *rs; -#endif { if (f->next >= f->endb) { if (*rs > 0) { /* try peeking for a share stream if possible */ @@ -80,14 +72,12 @@ int *rs; } } -#if __STD_C +/** + * @param f file to be scanned + * @param form scanning format + * @param args + */ int sfvscanf(Sfio_t * f, reg const char *form, va_list args) -#else -int sfvscanf(f, form, args) -Sfio_t *f; /* file to be scanned */ -reg char *form; /* scanning format */ -va_list args; -#endif { reg uchar *d, *endd, *data; reg int inp, shift, base, width; diff --git a/lib/sfio/sfwr.c b/lib/sfio/sfwr.c index ec030e8f3..0c260317d 100644 --- a/lib/sfio/sfwr.c +++ b/lib/sfio/sfwr.c @@ -19,14 +19,7 @@ */ /* hole preserving writes */ -#if __STD_C static ssize_t sfoutput(Sfio_t * f, reg char *buf, reg size_t n) -#else -static ssize_t sfoutput(f, buf, n) -Sfio_t *f; -reg char *buf; -reg size_t n; -#endif { reg char *sp, *wbuf, *endbuf; reg ssize_t s, w, wr; @@ -111,16 +104,8 @@ reg size_t n; return w > 0 ? w : -1; } -#if __STD_C ssize_t sfwr(reg Sfio_t * f, reg const Void_t * buf, reg size_t n, reg Sfdisc_t * disc) -#else -ssize_t sfwr(f, buf, n, disc) -reg Sfio_t *f; -reg Void_t *buf; -reg size_t n; -reg Sfdisc_t *disc; -#endif { reg ssize_t w; reg Sfdisc_t *dc; diff --git a/lib/sfio/sfwrite.c b/lib/sfio/sfwrite.c index 00e756de9..e69e9e1f9 100644 --- a/lib/sfio/sfwrite.c +++ b/lib/sfio/sfwrite.c @@ -18,14 +18,12 @@ ** Written by Kiem-Phong Vo. */ -#if __STD_C +/** + * @param f write to this stream + * @param buf buffer to be written + * @param n number of bytes + */ ssize_t sfwrite(reg Sfio_t * f, const Void_t * buf, reg size_t n) -#else -ssize_t sfwrite(f, buf, n) -reg Sfio_t *f; /* write to this stream. */ -Void_t *buf; /* buffer to be written. */ -reg size_t n; /* number of bytes. */ -#endif { reg uchar *s, *begs, *next; reg ssize_t w;