]> granicus.if.org Git - graphviz/commitdiff
Removed old-style function defintions from sfio
authorErwin Janssen <erwinjanssen@outlook.com>
Fri, 9 Sep 2016 01:36:30 +0000 (03:36 +0200)
committerErwin Janssen <erwinjanssen@outlook.com>
Mon, 19 Sep 2016 12:47:45 +0000 (14:47 +0200)
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.

84 files changed:
lib/sfio/Sfio_dc/sfdcdio.c
lib/sfio/Sfio_dc/sfdcdos.c
lib/sfio/Sfio_dc/sfdcfilter.c
lib/sfio/Sfio_dc/sfdclzw.c
lib/sfio/Sfio_dc/sfdcseekable.c
lib/sfio/Sfio_dc/sfdcslow.c
lib/sfio/Sfio_dc/sfdcsubstream.c
lib/sfio/Sfio_dc/sfdctee.c
lib/sfio/Sfio_dc/sfdcunion.c
lib/sfio/Sfio_f/_sfclrerr.c
lib/sfio/Sfio_f/_sfdlen.c
lib/sfio/Sfio_f/_sfeof.c
lib/sfio/Sfio_f/_sferror.c
lib/sfio/Sfio_f/_sffileno.c
lib/sfio/Sfio_f/_sfgetc.c
lib/sfio/Sfio_f/_sfllen.c
lib/sfio/Sfio_f/_sfputc.c
lib/sfio/Sfio_f/_sfputd.c
lib/sfio/Sfio_f/_sfputl.c
lib/sfio/Sfio_f/_sfputm.c
lib/sfio/Sfio_f/_sfputu.c
lib/sfio/Sfio_f/_sfslen.c
lib/sfio/Sfio_f/_sfstacked.c
lib/sfio/Sfio_f/_sfulen.c
lib/sfio/Sfio_f/_sfvalue.c
lib/sfio/sfclose.c
lib/sfio/sfclrlock.c
lib/sfio/sfcvt.c
lib/sfio/sfdisc.c
lib/sfio/sfdlen.c
lib/sfio/sfexcept.c
lib/sfio/sfexit.c
lib/sfio/sffcvt.c
lib/sfio/sffilbuf.c
lib/sfio/sfflsbuf.c
lib/sfio/sfgetd.c
lib/sfio/sfgetl.c
lib/sfio/sfgetm.c
lib/sfio/sfgetr.c
lib/sfio/sfgetu.c
lib/sfio/sfllen.c
lib/sfio/sfmode.c
lib/sfio/sfmove.c
lib/sfio/sfmutex.c
lib/sfio/sfnew.c
lib/sfio/sfnotify.c
lib/sfio/sfnputc.c
lib/sfio/sfopen.c
lib/sfio/sfpkrd.c
lib/sfio/sfpoll.c
lib/sfio/sfpool.c
lib/sfio/sfpopen.c
lib/sfio/sfprintf.c
lib/sfio/sfprints.c
lib/sfio/sfpurge.c
lib/sfio/sfputd.c
lib/sfio/sfputl.c
lib/sfio/sfputm.c
lib/sfio/sfputr.c
lib/sfio/sfputu.c
lib/sfio/sfraise.c
lib/sfio/sfrd.c
lib/sfio/sfread.c
lib/sfio/sfreserve.c
lib/sfio/sfresize.c
lib/sfio/sfscanf.c
lib/sfio/sfseek.c
lib/sfio/sfset.c
lib/sfio/sfsetbuf.c
lib/sfio/sfsetfd.c
lib/sfio/sfsize.c
lib/sfio/sfsk.c
lib/sfio/sfstack.c
lib/sfio/sfstrtod.c
lib/sfio/sfswap.c
lib/sfio/sfsync.c
lib/sfio/sftable.c
lib/sfio/sftell.c
lib/sfio/sftmp.c
lib/sfio/sfungetc.c
lib/sfio/sfvprintf.c
lib/sfio/sfvscanf.c
lib/sfio/sfwr.c
lib/sfio/sfwrite.c

index 182d0c4151de24dffe408f86a96b7136135fad2d..c42a40c2eaf0cbf6b7dd81f8fd504b294cd3decd 100644 (file)
@@ -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;
index 51465c69c49fb957d25153df0e34066b66da5f35..7909b92bbaa83403625711a3a55f4cef70f3905e 100644 (file)
@@ -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 <whence> 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;
 
index 6166c1bab02c6a9b0d5c88a244cbeb4a3629589c..39605d12045e2f4b7dfd1120579a0b59b51a4566 100644 (file)
@@ -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;
index 0133d18206fe5207dca876d1ff916037f519ed0c..88869bf4dcd969f6ef73aabc20aeb3c2a94a98fe 100644 (file)
@@ -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;
 
index 9f895227658c9a2a2fea79a14b66b5ed5ef18ee1..6f5ebbb7e6d25c366342e729f1c4afa37d389ebe 100644 (file)
@@ -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;
 
index ababa84a2c66c66417a6bcc5141de7058ed9d68a..65aaf1e9b33429d79f02544fdc1b24a61921085c 100644 (file)
 **     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;
 
index 9d50e9b2d057af608b2ce086a3252680e00a8dba..ab9000ad6c0ea041ce870d02e42bece6c2c0bdc3 100644 (file)
@@ -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;
index c6b1c241653441922b68592beda1cf6a6e40bedb..bca96f9dd273d3e7d165b112eaadd66dba3ed38d 100644 (file)
@@ -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;
 
index 8e4fc0650f920e502f4244f0e21135faa1c038c2..dce65e8729dc717a1bb09db75b477896e579c1b6 100644 (file)
@@ -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;
index b830757e9baa8f552625f3319b5a22f0cf3c76f4..25ce5e01277d29d7bae1ba9401cb6a8b3fbe142d 100644 (file)
 
 #undef sfclrerr
 
-#if __STD_C
 int sfclrerr(reg Sfio_t * f)
-#else
-int sfclrerr(f)
-reg Sfio_t *f;
-#endif
 {
     return __sf_clrerr(f);
 }
index 7dee2d7cac129f5fd03cf399e6811f51ecf706ab..ab71d583caca040823b0c59bbd7863cdb2e243a9 100644 (file)
 
 #undef sfdlen
 
-#if __STD_C
 int sfdlen(reg Sfdouble_t v)
-#else
-int sfdlen(v)
-reg Sfdouble_t v;
-#endif
 {
     return __sf_dlen(v);
 }
index 6d93f5ada54ebcab8e69f244a26c967fbf6b664b..42d976f988d882d2c1e4096b3a138b9efbd746aa 100644 (file)
 
 #undef sfeof
 
-#if __STD_C
 int sfeof(reg Sfio_t * f)
-#else
-int sfeof(f)
-reg Sfio_t *f;
-#endif
 {
     return __sf_eof(f);
 }
index 84c3e12d2018b6e1fa4aeab2f3556f5f8914b552..499a68748e5a8a5a2df1c75f43aae29b2aff2624 100644 (file)
 
 #undef sferror
 
-#if __STD_C
 int sferror(reg Sfio_t * f)
-#else
-int sferror(f)
-reg Sfio_t *f;
-#endif
 {
     return __sf_error(f);
 }
index d55440d13f58cde6eaefdcfd04142641bf3d423f..4e874954f23bbb3f35327c22f10d8c47e6844f22 100644 (file)
 
 #undef sffileno
 
-#if __STD_C
 int sffileno(reg Sfio_t * f)
-#else
-int sffileno(f)
-reg Sfio_t *f;
-#endif
 {
     return __sf_fileno(f);
 }
index 02dd0cf2313ae1db27d79d260ff16077cb244802..229c78d084e551c84dcbb0f113ee8a45302f1f9f 100644 (file)
 
 #undef sfgetc
 
-#if __STD_C
 int sfgetc(reg Sfio_t * f)
-#else
-int sfgetc(f)
-reg Sfio_t *f;
-#endif
 {
     return __sf_getc(f);
 }
index fb4df0345abdc01906d73ed7f48879ab5f198624..954b703e4ce25ea02e55162f26d56466b6f448c8 100644 (file)
 
 #undef sfllen
 
-#if __STD_C
 int sfllen(reg Sflong_t v)
-#else
-int sfllen(v)
-reg Sflong_t v;
-#endif
 {
     return __sf_llen(v);
 }
index dc2ee6c825dc925dbf83410e29932f6e8da7ee5a..53e5d836046bc29b3a2d1b538be112ce23b66dd6 100644 (file)
 
 #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);
 }
index e52ceed3d10b4e6f28ae2461fe261fabd82f3512..1017c43d0aa1e8f96e866a4e2d559ecb3c60cdec 100644 (file)
 
 #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);
 }
index 7598f3ae60d0bcb39c047c9fd8e8667ccfa069c1..7bd08d2b9ce9f8c70ce4244f511233f6782eb9ec 100644 (file)
 
 #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);
 }
index 00363efea61aa43068b488d92856c684628ba269..2107b390970c7694d5b12bd4366a15d2760c2015 100644 (file)
 
 #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);
 }
index 9a15c37951551e51ace04abd1b724c28a5b657c4..ce65aeeab466dc576c961352831425d802023eb0 100644 (file)
 
 #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);
 }
index 494736c233d5131c7add80b039d765a66a59b020..b076d52c01320ef406cdb9a012033c2f4d478372 100644 (file)
 
 #undef sfslen
 
-#if __STD_C
 ssize_t sfslen(void)
-#else
-ssize_t sfslen()
-#endif
 {
     return __sf_slen();
 }
index 9877ed679a53aaa9d86452ca3a0ab3e3cbc8fe33..440a33371444615a999190855eaa067656947294 100644 (file)
 
 #undef sfstacked
 
-#if __STD_C
 int sfstacked(reg Sfio_t * f)
-#else
-int sfstacked(f)
-reg Sfio_t *f;
-#endif
 {
     return __sf_stacked(f);
 }
index ec8a936373ca3910c0ea0af2b51f0299f03cf911..1c0afdc69ceaa360f064781ad057c2710d722f47 100644 (file)
 
 #undef sfulen
 
-#if __STD_C
 int sfulen(reg Sfulong_t v)
-#else
-int sfulen(v)
-reg Sfulong_t v;
-#endif
 {
     return __sf_ulen(v);
 }
index a82bad95a4c288cec0ac6405d7cb8c613f52d83f..e172ed9f632a47c1b058588d025fcec2fa10320e 100644 (file)
 
 #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);
 }
index 2119fe317d083094adf65e5a568d3e1334c7561f..31ab15d7ee6aaec1af403353b50c4464e8d4661d 100644 (file)
 **     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 *);
index edf820f64d08d610eea96b15eadc5abeae1debd4..047db9e34adbf4ec99509f6aa276312b1173916e 100644 (file)
 **
 **     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;
 
index b3c85ee9550e98ed0fb70d178e423a13d8d73dbd..46c90c90476679c47bf7dc50b58803b57fa1b56f 100644 (file)
@@ -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;
index 7363b2bd8647c7c392a459392f7a8cf4980b6bc3..fc9f739c852f874e694657b6a6af35223034f5b0 100644 (file)
 **     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;
index 6670ed4ba893d94a90fc87dfc8a069550c71c64c..2b4f8b0a3283b4c366c743b122860704b87dfcd2 100644 (file)
 **     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;
index 85e2b3ccdd9cd5fe8d54bd55fc42db2a05d35a8d..bd8e0d1c03f8e9849c2afbac0adfeb5507cb91a9 100644 (file)
 **     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;
index b2eb7ae11fa50178f35e3a4bcf08512a4e66256f..506c192f26af68088871628beef151bd3b080c05 100644 (file)
@@ -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;
index 841d010367ab9289c8c457aa9c7b559bc0ecf2b0..1e035a2bd100bc592b027f88f41b792448902312 100644 (file)
 
 #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);
 }
index a176aa1badbf5d10a7c48cfd95599df2f9698d02..e44c668f2f15ee5fbcaa560055fa5b67e52601b1 100644 (file)
 **     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;
index 288eee95cb20a2fafa40185c3e52012646efab7d..e54ce8e7906faf2c851ec8dcc2db38c62b74b4e0 100644 (file)
 **     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;
index 8c373998f28796f54f6049056e8cb5eae4981e42..535b2cb9ad00888cbd90b505a108552232a14400 100644 (file)
 **     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;
index a00dbe7841cfa549cca3a80b1dce212e603973ca..a85cd9a21326eecd2623799285b4923a17dd9946 100644 (file)
 **     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;
index a2071b404c823d396b2d9fb73d360763be65576a..cd3e5ed0e464a7039258528e9f09612d0d0df30f 100644 (file)
 **     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;
index 0fe9d56cba37853fe958bd5818430312b2f39faf..30fbcbce95657f6112846d8b42d4dbb33b317a2a 100644 (file)
 **     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;
index 748f8d5b3d71704f8b7f5d873ab2cd2fafd314a0..8d3f897116c2357cdf5c300cd7ed7f99fe8ba546 100644 (file)
 **     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;
index da5c2f1163dbc27a06103c4dc2de1b4f791300c9..2807af63709a91a1cb121c2c98cd919ac56beb08 100644 (file)
 **
 **     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);
index 2a84e86c064b4e659652a801aefcc871f83cc3a0..b6f8ad53812d3202e497ec24e65859772f0a363d 100644 (file)
@@ -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;
index 9df5f3678e48cd74a7e4806b203bbb6e386cac2a..e94fbd3a468e6358a9dcb32f521e0cc148c8c0bf 100644 (file)
 */
 #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;
index 03dfb8b5b852505bc5623e6e28bf871f7111698c..883a0fd65300582051df344a263161e3ec7089cf 100644 (file)
 */
 
 /* 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;
index 3664f5794d9130588925b9569ccbd3c241997c8f..dda63e28e59a82fa33f1647e7b2272b89477d5b8 100644 (file)
 **     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;
index 028396a94b95e77170d9c75c5ee665488afd2d9b..38229348ed39e83726bb99df74c3240fff5d3bc6 100644 (file)
 **
 **     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;
index 98092164b1651a883dc4b9687c123c6bb2c31553..7fd24fc808b85566c9de1e79e10bc0791ea39f65 100644 (file)
 **     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;
index 2082e4695c26cc2ac81f3bd4385a480280c292d6..19b832371dd8ec8e7e0cb514420a032b67fd27e5 100644 (file)
 **     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;
 
index efd5bf608b84307f7f4804b3b753f8aec8d5d80b..6ce4333eb115ce263e196fa26b6ee40ce54273ec 100644 (file)
 #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;
index ddd28449c8db3f60c453b8a77e744c907fee1ec8..55f05f3a3fe45a1f5006fe6cc50d0cc66c5aa3c5 100644 (file)
 **     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;
index 7c179dbc9c52e150444fc2b27ba97f87ebc58fbe..064cb8a704449110c7a76fea05da7bdf1d9217ed 100644 (file)
 ** 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;
index 4f504da0fba2b15d45ab4cabde0552f939418dfa..b439bf1e8a28d8df9af4b1e7992d55f4e89a4ac0 100644 (file)
 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;
index 0ee28f50dedf568fffd973508e4b871ab355f8c5..d04211fea5368c975f019c1e310feeee1f570b92 100644 (file)
 **     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;
index e9159de9d62c09a618e6860c4f9820498c6ddccf..8bbac855d1a0ccb4d6fc25ce433d022138b8a3d0 100644 (file)
 **     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;
index f5243637722561e8881f45f9e5b97f1f9f8b25b9..dc0117cda6adb83879a70eaaf052ccfa0331310f 100644 (file)
 **     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;
 
index ba0a46e467c7bda087d77aacd4d2055b3be1d30c..beee7a4931071bc725e2eba1f6a7081ab7b14611 100644 (file)
 **     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;
index 3204d8ff460dd3e584e5b7a48ac812ea2220b12b..668c6e0fd59dfb0de74550037facda01c71418dd 100644 (file)
 **     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;
index fc374f892db853073c278fc44ef7b2cd336f80a2..372da9cc58131a76a25db4f5d86801fd04b2eeed 100644 (file)
 **     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;
index 8258ded9d6eddb8f62b5230d3f0ef3a954ffa0eb..7f784868a0e14a382fd8447f08d68420c2905f7c 100644 (file)
 **
 **     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;
index a3bf0e37928bcb215e323423467e68a9cfd7d1c9..8791ac7c41a92715b5c2439e5d1e70cf83d584da 100644 (file)
 **     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;
index 5755b34b25ca6b8b374e2a4bc95460434f1f39b6..a8b81489805d5e814914047328f1dabe5aa246b8 100644 (file)
 **
 **     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;
index 268ba084945b0698c611061c33a23906bbefffbc..0dbc72ef7bab908e37f705dcd5181c491e8aa8e1 100644 (file)
 */
 
 /* 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;
index fd91a098b3785de3936a46ab3653efdd8723177f..5aba2fde185e908547771f50e027bb40dbf3e774 100644 (file)
 **     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;
index fc44681882de74a35561ef3f061ff5f52a322eee..c0b7ce7d45d4427fd442500e47727eb0313284e2 100644 (file)
 **     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;
index 2229ccff59b054799d530f87425cc9f6ad70719a..665080f6f867a0c70eb9ebc6c689f8400211cb39 100644 (file)
        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);
 
index 59e03630fae9fe267f90b4e0227d0990e76600d3..0a2f4b3fa57179ba9053264d283b3de75964d436 100644 (file)
 **     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;
index d022514be5171eea2cfa52c1d2e6e57ac31d543f..1a61e32147c733877d4ff4611b82708839d2fe54 100644 (file)
 **     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;
index 0f343ecf6ad5c2aa999ce1c2da321c52c05494a2..0d75481ef9a865a4dedd9c1953eddb78b139a164 100644 (file)
 **     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;
 
index 36803e91fd731893d58b77d54688457b4e7d2317..2d959d88778ecf6960035a40e55d3b7a275757be 100644 (file)
@@ -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;
index 87fdb67f9085f29b85dc6f8188dae1aae6155d63..d1aedf629ff809974418272b8bc5a16476f82a91 100644 (file)
 **     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;
 
index 57116acee8be2214bd1951bc12aca0870674b8ed..8ff1087b9ea3d8ee87d7387d23000aa7332b1c0e 100644 (file)
 **
 **     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;
index 12e34104418089f2efe67486f9a0318e8ffcf37b..2b82c1b5210a1878de8a36afeb5e14f78925774a 100644 (file)
 **
 **     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;
index 38a2e81ff3d5eae6da74210d5ad64d854f83f63e..b3cbbe9dee89da17ccb547445567a5a7120f45fe 100644 (file)
          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;
index d3fec778afb5bb474825ae173aa71555caa9eb3f..b4d2cb9666baf4d06fb65d3f9f822b19ff3d0d0e 100644 (file)
 #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;
index fdc8e90cf99715ffddadeaf6ffc0e1374e09e2aa..524fbd88df1b04bbfdaf408957e688b67e857145 100644 (file)
 **     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;
index 3dbd7e028183f19bc5527df894e8e70639dbf9c5..3309b8f157ed2a2ece04e3e3e9e647069dd1fde9 100644 (file)
 **     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;
index 7c38f11e17f93e7673beacfa11c89e91e58b3aca..1aef9efae2b888afbee099db1b1f2fadf68552e3 100644 (file)
 **     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;
index e1ae01e6f591382c7196e94a2b94f189efe6a6d9..913c6fda6729b490d33e046e26bc2ea93eaa49ea 100644 (file)
 **     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;
index 60696d4f5ae1a114265948b7a759fe7a097182ea..464dcf53422b6ef57af8ce6fbbb0b251c6ebcab4 100644 (file)
@@ -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 =
index a3b87948413eaff0f9d83f2a84ecb715c9eb99a9..ff48288cbc4b419f8bd395b8e824b0d3d820d6c1 100644 (file)
 **
 **     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;
 
index c0c482c4030c3e1e3cf3183290cf2ac278aa4892..405ab52cbb6d169301d1a8ec2ca78603966a9b5b 100644 (file)
 #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;
index 54e3f66c26d29a2615e7267382212ade02b6c914..f624c12b23d982a4eb59ea589579d1af5c67b278 100644 (file)
 
 #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;
index ec030e8f38a0536b6eec04a328b16a30adcc5b34..0c260317db6650f5cc141a839a45899452fd7d36 100644 (file)
 */
 
 /* 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;
index 00e756de9b5e638bfffcb151ccc090116f1aa579..e69e9e1f97a1ed7c5dcec061659178713557740b 100644 (file)
 **     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;