# endif
#endif /*_BEGIN_EXTERNS_*/
-/* _ARG_ simplifies function prototyping among flavors of C */
-#ifndef _ARG_
-#define _ARG_(x) x
-#endif /*_ARG_*/
-
/* __INLINE__ is the inline keyword */
#if !defined(__INLINE__) && defined(__cplusplus)
#define __INLINE__ inline
#endif
#endif /*_BEGIN_EXTERNS_*/
- /* _ARG_ simplifies function prototyping among flavors of C */
- #ifndef _ARG_
- #define _ARG_(x) x
- #endif /*_ARG_*/
-
/* __INLINE__ is the inline keyword */
#if !defined(__INLINE__) && defined(__cplusplus)
#define __INLINE__ inline
#endif
_BEGIN_EXTERNS_
- extern int printf _ARG_((const char*, ...));
+ extern int printf(const char*, ...);
_END_EXTERNS_
#if N == 0
#endif
#undef printf
_BEGIN_EXTERNS_
- extern int printf _ARG_((const char*, ...));
+ extern int printf(const char*, ...);
_END_EXTERNS_
static va_list ap;
main()
following at the top to hide dialect differences:]{
[+#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)?]
[+#define _STD_ 1?]
- [+#define _ARG_(x) x?]
[+#define _VOID_ void?]
[+#else?]
[+#define _STD_ 0?]
- [+#define _ARG_(x) ()?]
[+#define _VOID_ char?]
[+#endif?]
[+#if defined(__cplusplus)?]
std='#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
#define _STD_ 1
-#define _ARG_(x) x
#define _VOID_ void
#else
#define _STD_ 0
-#define _ARG_(x) ()
#define _VOID_ char
#endif
#if defined(__cplusplus)
$ext
_BEGIN_EXTERNS_
struct _iffe_struct { int _iffe_member; };
-extern struct _iffe_struct* $v _ARG_((struct _iffe_struct*));
+extern struct _iffe_struct* $v (struct _iffe_struct*);
_END_EXTERNS_
"
$cc -c $tmp.c <&$nullin >&$nullout
#define Void_t void
#endif
-#ifndef _ARG_
-#define _ARG_(x) x
-#endif
-
#include <stddef.h> /* size_t */
#include <string.h>
typedef struct _dt_s Dt_t;
typedef struct _dt_s Dict_t; /* for libdict compatibility */
typedef struct _dtstat_s Dtstat_t;
-typedef Void_t* (*Dtmemory_f)_ARG_((Dt_t*,Void_t*,size_t,Dtdisc_t*));
-typedef Void_t* (*Dtsearch_f)_ARG_((Dt_t*,Void_t*,int));
-typedef Void_t* (*Dtmake_f)_ARG_((Dt_t*,Void_t*,Dtdisc_t*));
-typedef void (*Dtfree_f)_ARG_((Dt_t*,Void_t*,Dtdisc_t*));
-typedef int (*Dtcompar_f)_ARG_((Dt_t*,Void_t*,Void_t*,Dtdisc_t*));
-typedef unsigned int (*Dthash_f)_ARG_((Dt_t*,Void_t*,Dtdisc_t*));
-typedef int (*Dtevent_f)_ARG_((Dt_t*,int,Void_t*,Dtdisc_t*));
+typedef Void_t* (*Dtmemory_f)(Dt_t*,Void_t*,size_t,Dtdisc_t*);
+typedef Void_t* (*Dtsearch_f)(Dt_t*,Void_t*,int);
+typedef Void_t* (*Dtmake_f)(Dt_t*,Void_t*,Dtdisc_t*);
+typedef void (*Dtfree_f)(Dt_t*,Void_t*,Dtdisc_t*);
+typedef int (*Dtcompar_f)(Dt_t*,Void_t*,Void_t*,Dtdisc_t*);
+typedef unsigned int (*Dthash_f)(Dt_t*,Void_t*,Dtdisc_t*);
+typedef int (*Dtevent_f)(Dt_t*,int,Void_t*,Dtdisc_t*);
struct _dtlink_s
{ Dtlink_t* right; /* right child */
#define extern __EXPORT__
#endif
-extern Dt_t* dtopen _ARG_((Dtdisc_t*, Dtmethod_t*));
-extern int dtclose _ARG_((Dt_t*));
-extern Dt_t* dtview _ARG_((Dt_t*, Dt_t*));
-extern Dtdisc_t* dtdisc _ARG_((Dt_t* dt, Dtdisc_t*, int));
-extern Dtmethod_t* dtmethod _ARG_((Dt_t*, Dtmethod_t*));
+extern Dt_t* dtopen(Dtdisc_t*, Dtmethod_t*);
+extern int dtclose(Dt_t*);
+extern Dt_t* dtview(Dt_t*, Dt_t*);
+extern Dtdisc_t* dtdisc(Dt_t* dt, Dtdisc_t*, int);
+extern Dtmethod_t* dtmethod(Dt_t*, Dtmethod_t*);
-extern Dtlink_t* dtflatten _ARG_((Dt_t*));
-extern Dtlink_t* dtextract _ARG_((Dt_t*));
-extern int dtrestore _ARG_((Dt_t*, Dtlink_t*));
+extern Dtlink_t* dtflatten(Dt_t*);
+extern Dtlink_t* dtextract(Dt_t*);
+extern int dtrestore(Dt_t*, Dtlink_t*);
-extern int dttreeset _ARG_((Dt_t*, int, int));
+extern int dttreeset(Dt_t*, int, int);
-extern int dtwalk _ARG_((Dt_t*, int(*)(Dt_t*,Void_t*,Void_t*), Void_t*));
+extern int dtwalk(Dt_t*, int(*)(Dt_t*,Void_t*,Void_t*), Void_t*);
-extern Void_t* dtrenew _ARG_((Dt_t*, Void_t*));
+extern Void_t* dtrenew(Dt_t*, Void_t*);
-extern int dtsize _ARG_((Dt_t*));
-extern int dtstat _ARG_((Dt_t*, Dtstat_t*, int));
-extern unsigned int dtstrhash _ARG_((unsigned int, Void_t*, int));
+extern int dtsize(Dt_t*);
+extern int dtstat(Dt_t*, Dtstat_t*, int);
+extern unsigned int dtstrhash(unsigned int, Void_t*, int);
#undef extern
_END_EXTERNS_
#endif
#endif /*_BEGIN_EXTERNS_*/
- /* _ARG_ simplifies function prototyping among flavors of C */
- #ifndef _ARG_
- #define _ARG_(x) x
- #endif /*_ARG_*/
-
/* __INLINE__ is the inline keyword */
#if !defined(__INLINE__) && defined(__cplusplus)
#define __INLINE__ inline
#endif
_BEGIN_EXTERNS_
- extern int printf _ARG_((const char*, ...));
+ extern int printf(const char*, ...);
_END_EXTERNS_
#if N == 0
#endif
#undef printf
_BEGIN_EXTERNS_
- extern int printf _ARG_((const char*, ...));
+ extern int printf(const char*, ...);
_END_EXTERNS_
static va_list ap;
main()
_BEGIN_EXTERNS_
/* functions to create disciplines */
- extern int sfdcdio _ARG_((Sfio_t *, size_t));
- extern int sfdcdos _ARG_((Sfio_t *));
- extern int sfdcfilter _ARG_((Sfio_t *, const char *));
- extern int sfdclzw _ARG_((Sfio_t *));
- extern int sfdcseekable _ARG_((Sfio_t *));
- extern int sfdcslow _ARG_((Sfio_t *));
- extern int sfdcsubstream _ARG_((Sfio_t *, Sfio_t *, Sfoff_t, Sfoff_t));
- extern int sfdctee _ARG_((Sfio_t *, Sfio_t *));
- extern int sfdcunion _ARG_((Sfio_t *, Sfio_t **, int));
+ extern int sfdcdio(Sfio_t *, size_t);
+ extern int sfdcdos(Sfio_t *);
+ extern int sfdcfilter(Sfio_t *, const char *);
+ extern int sfdclzw(Sfio_t *);
+ extern int sfdcseekable(Sfio_t *);
+ extern int sfdcslow(Sfio_t *);
+ extern int sfdcsubstream(Sfio_t *, Sfio_t *, Sfoff_t, Sfoff_t);
+ extern int sfdctee(Sfio_t *, Sfio_t *);
+ extern int sfdcunion(Sfio_t *, Sfio_t **, int);
_END_EXTERNS_
#endif
#ifdef __cplusplus
#endif
#endif /*_BEGIN_EXTERNS_*/
- /* _ARG_ simplifies function prototyping among flavors of C */
- #ifndef _ARG_
- #define _ARG_(x) x
- #endif /*_ARG_*/
-
/* __INLINE__ is the inline keyword */
#if !defined(__INLINE__) && defined(__cplusplus)
#define __INLINE__ inline
#endif
_BEGIN_EXTERNS_
- extern int printf _ARG_((const char*, ...));
+ extern int printf(const char*, ...);
_END_EXTERNS_
#if N == 0
#endif
#undef printf
_BEGIN_EXTERNS_
- extern int printf _ARG_((const char*, ...));
+ extern int printf(const char*, ...);
_END_EXTERNS_
static va_list ap;
main()
exit cleanup note{ stuck with standard _cleanup }end execute{
#include <stdio.h>
_BEGIN_EXTERNS_
- extern void exit _ARG_((int));
- extern void _exit _ARG_((int));
+ extern void exit(int);
+ extern void _exit(int);
extern void _cleanup();
void _cleanup() { _exit(0); }
_END_EXTERNS_
#include <sys/times.h>
_BEGIN_EXTERNS_
- int creat _ARG_((char*, int));
- int open _ARG_((char*, int));
- int unlink _ARG_((char*));
- int read _ARG_((int, char*, int));
+ int creat(char*, int);
+ int open(char*, int);
+ int unlink(char*);
+ int read(int, char*, int);
_END_EXTERNS_
#define MAPSIZE (64*1024)
tmp rmfail note{ file not removable if still opened }end execute{
#include <sys/time.h>
_BEGIN_EXTERNS_
- extern int creat _ARG_((char*, int));
- extern int unlink _ARG_((char*));
- extern int write _ARG_((int, char*, int));
+ extern int creat(char*, int);
+ extern int unlink(char*);
+ extern int write(int, char*, int);
_END_EXTERNS_
main()
{ int fw, fr;
#include <fcntl.h>
_BEGIN_EXTERNS_
- extern int open _ARG_((const char*,int,...));
+ extern int open(const char*,int,...);
_END_EXTERNS_
main()
{
lib poll_fd_1 note{ fd is first arg to poll() }end execute{
#include <poll.h>
_BEGIN_EXTERNS_
- extern int pipe _ARG_((int*));
+ extern int pipe(int*);
_END_EXTERNS_
main()
{ int rw[2];
lib poll_fd_2 note{ fd is second arg to poll() }end execute{
#include <poll.h>
_BEGIN_EXTERNS_
- extern int pipe _ARG_((int*));
+ extern int pipe(int*);
_END_EXTERNS_
main()
{ int rw[2];
typedef struct _exit_s {
struct _exit_s *next;
- void (*exitf) _ARG_((void));
+ void (*exitf) (void);
} Exit_t;
static Exit_t *Exit;
/* global variables used internally to the package */
Sfextern_t _Sfextern = { 0, /* _Sfpage */
{NIL(Sfpool_t *), 0, 0, 0, NIL(Sfio_t **)}, /* _Sfpool */
- NIL(int (*)_ARG_((Sfio_t *, int))), /* _Sfpmove */
- NIL(Sfio_t * (*)_ARG_((Sfio_t *, Sfio_t *))), /* _Sfstack */
- NIL(void (*)_ARG_((Sfio_t *, int, int))), /* _Sfnotify */
- NIL(int (*)_ARG_((Sfio_t *))), /* _Sfstdsync */
+ NIL(int (*)(Sfio_t *, int)), /* _Sfpmove */
+ NIL(Sfio_t * (*)(Sfio_t *, Sfio_t *)), /* _Sfstack */
+ NIL(void (*)(Sfio_t *, int, int)), /* _Sfnotify */
+ NIL(int (*)(Sfio_t *)), /* _Sfstdsync */
{NIL(Sfread_f), /* _Sfudisc */
NIL(Sfwrite_f),
NIL(Sfseek_f),
NIL(Sfexcept_f),
NIL(Sfdisc_t *)
},
- NIL(void (*)_ARG_((void))), /* _Sfcleanup */
+ NIL(void (*)(void)), /* _Sfcleanup */
0, /* _Sfexiting */
0, /* _Sfdone */
&Sfonce, /* _Sfonce */
typedef struct _sfextern_s {
ssize_t sf_page;
struct _sfpool_s sf_pool;
- int (*sf_pmove) _ARG_((Sfio_t *, int));
- Sfio_t *(*sf_stack) _ARG_((Sfio_t *, Sfio_t *));
- void (*sf_notify) _ARG_((Sfio_t *, int, int));
- int (*sf_stdsync) _ARG_((Sfio_t *));
+ int (*sf_pmove) (Sfio_t *, int);
+ Sfio_t *(*sf_stack) (Sfio_t *, Sfio_t *);
+ void (*sf_notify) (Sfio_t *, int, int);
+ int (*sf_stdsync) (Sfio_t *);
struct _sfdisc_s sf_udisc;
- void (*sf_cleanup) _ARG_((void));
+ void (*sf_cleanup) (void);
int sf_exiting;
int sf_done;
Vtonce_t *sf_once;
- void (*sf_oncef) _ARG_((void));
+ void (*sf_oncef) (void);
Vtmutex_t *sf_mutex;
} Sfextern_t;
char *sf_digits; /* digits for general bases */
int (*sf_cvinitf) (void); /* initialization function */
int sf_cvinit; /* initialization state */
- Fmtpos_t *(*sf_fmtposf)
- _ARG_((Sfio_t *, const char *, va_list, int));
- char *(*sf_fmtintf) _ARG_((const char *, int *));
+ Fmtpos_t *(*sf_fmtposf) (Sfio_t *, const char *, va_list, int);
+ char *(*sf_fmtintf) (const char *, int *);
uchar sf_cv36[SF_MAXCHAR + 1]; /* conversion for base [2-36] */
uchar sf_cv64[SF_MAXCHAR + 1]; /* conversion for base [37-64] */
uchar sf_type[SF_MAXCHAR + 1]; /* conversion formats&types */
_BEGIN_EXTERNS_ extern Sfextern_t _Sfextern;
extern Sftab_t _Sftable;
- extern int _sfpopen _ARG_((Sfio_t *, int, int, int));
- extern int _sfpclose _ARG_((Sfio_t *));
- extern int _sfmode _ARG_((Sfio_t *, int, int));
- extern int _sftype _ARG_((const char *, int *, int *));
- extern int _sfexcept _ARG_((Sfio_t *, int, ssize_t, Sfdisc_t *));
- extern Sfrsrv_t *_sfrsrv _ARG_((Sfio_t *, ssize_t));
- extern int _sfsetpool _ARG_((Sfio_t *));
- extern char *_sfcvt _ARG_((Void_t *, int, int *, int *, int));
- extern char **_sfgetpath _ARG_((char *));
- extern Sfdouble_t _sfstrtod _ARG_((const char *, char **));
+ extern int _sfpopen(Sfio_t *, int, int, int);
+ extern int _sfpclose(Sfio_t *);
+ extern int _sfmode(Sfio_t *, int, int);
+ extern int _sftype(const char *, int *, int *);
+ extern int _sfexcept(Sfio_t *, int, ssize_t, Sfdisc_t *);
+ extern Sfrsrv_t *_sfrsrv(Sfio_t *, ssize_t);
+ extern int _sfsetpool(Sfio_t *);
+ extern char *_sfcvt(Void_t *, int, int *, int *, int);
+ extern char **_sfgetpath(char *);
+ extern Sfdouble_t _sfstrtod(const char *, char **);
#if !_lib_strtod
#define strtod _sfstrtod
/* for portable encoding of double values */
#if !__STDC__
#ifndef WIN32
- extern double frexp _ARG_((double, int *));
- extern double ldexp _ARG_((double, int));
+ extern double frexp(double, int *);
+ extern double ldexp(double, int);
#endif
#endif
#if !defined(_hdr_mman) && !_sys_mman
- extern Void_t *mmap _ARG_((Void_t *, size_t, int, int, int, off_t));
- extern int munmap _ARG_((Void_t *, size_t));
+ extern Void_t *mmap(Void_t *, size_t, int, int, int, off_t);
+ extern int munmap(Void_t *, size_t);
#endif
#if !defined(_PACKAGE_ast)
#define SF_ERROR 0000400 /* an error happened */
#else
#if !_hdr_unistd
- extern int close _ARG_((int));
- extern ssize_t read _ARG_((int, void *, size_t));
- extern ssize_t write _ARG_((int, const void *, size_t));
- extern off_t lseek _ARG_((int, off_t, int));
- extern int dup _ARG_((int));
- extern int isatty _ARG_((int));
- extern int wait _ARG_((int *));
- extern int pipe _ARG_((int *));
- extern int access _ARG_((const char *, int));
- extern uint sleep _ARG_((uint));
- extern int execl _ARG_((const char *, const char *, ...));
- extern int execv _ARG_((const char *, char **));
+ extern int close(int);
+ extern ssize_t read(int, void *, size_t);
+ extern ssize_t write(int, const void *, size_t);
+ extern off_t lseek(int, off_t, int);
+ extern int dup(int);
+ extern int isatty(int);
+ extern int wait(int *);
+ extern int pipe(int *);
+ extern int access(const char *, int);
+ extern uint sleep(uint);
+ extern int execl(const char *, const char *, ...);
+ extern int execv(const char *, char **);
#if !defined(fork)
- extern int fork _ARG_((void));
+ extern int fork(void);
#endif
#if _lib_unlink
- extern int unlink _ARG_((const char *));
+ extern int unlink(const char *);
#endif
#endif /*_hdr_unistd*/
#endif /* WIN32 */
#if _lib_bcopy && !_proto_bcopy
- extern void bcopy _ARG_((const void *, void *, size_t));
+ extern void bcopy(const void *, void *, size_t);
#endif
#if _lib_bzero && !_proto_bzero
- extern void bzero _ARG_((void *, size_t));
+ extern void bzero(void *, size_t);
#endif
- extern time_t time _ARG_((time_t *));
- extern int waitpid _ARG_((int, int *, int));
+ extern time_t time(time_t *);
+ extern int waitpid(int, int *, int);
#ifndef WIN32
- extern void _exit _ARG_((int));
+ extern void _exit(int);
#endif
- typedef int (*Onexit_f) _ARG_((void));
- extern Onexit_f onexit _ARG_((Onexit_f));
+ typedef int (*Onexit_f)(void);
+ extern Onexit_f onexit(Onexit_f);
#if _sys_stat
- extern int fstat _ARG_((int, Stat_t *));
+ extern int fstat(int, Stat_t *);
#endif
#if _lib_vfork && !defined(_hdr_vfork) && !defined(_sys_vfork)
- extern pid_t vfork _ARG_((void));
+ extern pid_t vfork(void);
#endif /*_lib_vfork*/
#if defined(_lib_poll)
#if _lib_poll_fd_1
- extern int poll _ARG_((struct pollfd *, ulong, int));
+ extern int poll(struct pollfd *, ulong, int);
#else
- extern int poll _ARG_((ulong, struct pollfd *, int));
+ extern int poll(ulong, struct pollfd *, int);
#endif
#endif /*_lib_poll*/
#if _proto_open && defined(__cplusplus)
- extern int open _ARG_((const char *, int, ...));
+ extern int open(const char *, int, ...);
#endif
#endif /* defined(_PACKAGE_ast) */
typedef struct _sfdisc_s Sfdisc_t;
typedef ssize_t(*Sfread_f)
- _ARG_((Sfio_t *, Void_t *, size_t, Sfdisc_t *));
+ (Sfio_t *, Void_t *, size_t, Sfdisc_t *);
typedef ssize_t(*Sfwrite_f)
- _ARG_((Sfio_t *, const Void_t *, size_t, Sfdisc_t *));
- typedef Sfoff_t(*Sfseek_f) _ARG_((Sfio_t *, Sfoff_t, int, Sfdisc_t *));
- typedef int (*Sfexcept_f) _ARG_((Sfio_t *, int, Void_t *, Sfdisc_t *));
+ (Sfio_t *, const Void_t *, size_t, Sfdisc_t *);
+ typedef Sfoff_t(*Sfseek_f) (Sfio_t *, Sfoff_t, int, Sfdisc_t *);
+ typedef int (*Sfexcept_f) (Sfio_t *, int, Void_t *, Sfdisc_t *);
/* discipline structure */
struct _sfdisc_s {
/* formatting environment */
typedef struct _sffmt_s Sffmt_t;
- typedef int (*Sffmtext_f) _ARG_((Sfio_t *, Void_t *, Sffmt_t *));
- typedef int (*Sffmtevent_f)
- _ARG_((Sfio_t *, int, Void_t *, Sffmt_t *));
+ typedef int (*Sffmtext_f)(Sfio_t *, Void_t *, Sffmt_t *);
+ typedef int (*Sffmtevent_f)(Sfio_t *, int, Void_t *, Sffmt_t *);
struct _sffmt_s {
long version; /* version of this structure */
Sffmtext_f extf; /* function to process arguments */
#define extern __EXPORT__
#endif
- extern Sfio_t *sfnew _ARG_((Sfio_t *, Void_t *, size_t, int, int));
- extern Sfio_t *sfopen _ARG_((Sfio_t *, const char *, const char *));
- extern Sfio_t *sfpopen _ARG_((Sfio_t *, const char *, const char *));
- extern Sfio_t *sfstack _ARG_((Sfio_t *, Sfio_t *));
- extern Sfio_t *sfswap _ARG_((Sfio_t *, Sfio_t *));
- extern Sfio_t *sftmp _ARG_((size_t));
- extern int sfpurge _ARG_((Sfio_t *));
- extern int sfpoll _ARG_((Sfio_t **, int, int));
- extern Void_t *sfreserve _ARG_((Sfio_t *, ssize_t, int));
- extern int sfsync _ARG_((Sfio_t *));
- extern int sfclrlock _ARG_((Sfio_t *));
- extern Void_t *sfsetbuf _ARG_((Sfio_t *, Void_t *, size_t));
- extern Sfdisc_t *sfdisc _ARG_((Sfio_t *, Sfdisc_t *));
- extern int sfraise _ARG_((Sfio_t *, int, Void_t *));
- extern int sfnotify _ARG_((void (*)(Sfio_t *, int, int)));
- extern int sfset _ARG_((Sfio_t *, int, int));
- extern int sfsetfd _ARG_((Sfio_t *, int));
- extern Sfio_t *sfpool _ARG_((Sfio_t *, Sfio_t *, int));
- extern ssize_t sfread _ARG_((Sfio_t *, Void_t *, size_t));
- extern ssize_t sfwrite _ARG_((Sfio_t *, const Void_t *, size_t));
- extern Sfoff_t sfmove _ARG_((Sfio_t *, Sfio_t *, Sfoff_t, int));
- extern int sfclose _ARG_((Sfio_t *));
- extern Sfoff_t sftell _ARG_((Sfio_t *));
- extern Sfoff_t sfseek _ARG_((Sfio_t *, Sfoff_t, int));
- extern ssize_t sfputr _ARG_((Sfio_t *, const char *, int));
- extern char *sfgetr _ARG_((Sfio_t *, int, int));
- extern ssize_t sfnputc _ARG_((Sfio_t *, int, size_t));
- extern int sfungetc _ARG_((Sfio_t *, int));
- extern int sfprintf _ARG_((Sfio_t *, const char *, ...));
- extern char *sfprints _ARG_((const char *, ...));
- extern int sfsprintf _ARG_((char *, int, const char *, ...));
- extern int sfvsprintf _ARG_((char *, int, const char *, va_list));
- extern int sfvprintf _ARG_((Sfio_t *, const char *, va_list));
- extern int sfscanf _ARG_((Sfio_t *, const char *, ...));
- extern int sfsscanf _ARG_((const char *, const char *, ...));
- extern int sfvsscanf _ARG_((const char *, const char *, va_list));
- extern int sfvscanf _ARG_((Sfio_t *, const char *, va_list));
- extern int sfresize _ARG_((Sfio_t *, Sfoff_t));
+ extern Sfio_t *sfnew(Sfio_t *, Void_t *, size_t, int, int);
+ extern Sfio_t *sfopen(Sfio_t *, const char *, const char *);
+ extern Sfio_t *sfpopen(Sfio_t *, const char *, const char *);
+ extern Sfio_t *sfstack(Sfio_t *, Sfio_t *);
+ extern Sfio_t *sfswap(Sfio_t *, Sfio_t *);
+ extern Sfio_t *sftmp(size_t);
+ extern int sfpurge(Sfio_t *);
+ extern int sfpoll(Sfio_t **, int, int);
+ extern Void_t *sfreserve(Sfio_t *, ssize_t, int);
+ extern int sfsync(Sfio_t *);
+ extern int sfclrlock(Sfio_t *);
+ extern Void_t *sfsetbuf(Sfio_t *, Void_t *, size_t);
+ extern Sfdisc_t *sfdisc(Sfio_t *, Sfdisc_t *);
+ extern int sfraise(Sfio_t *, int, Void_t *);
+ extern int sfnotify(void (*)(Sfio_t *, int, int));
+ extern int sfset(Sfio_t *, int, int);
+ extern int sfsetfd(Sfio_t *, int);
+ extern Sfio_t *sfpool(Sfio_t *, Sfio_t *, int);
+ extern ssize_t sfread(Sfio_t *, Void_t *, size_t);
+ extern ssize_t sfwrite(Sfio_t *, const Void_t *, size_t);
+ extern Sfoff_t sfmove(Sfio_t *, Sfio_t *, Sfoff_t, int);
+ extern int sfclose(Sfio_t *);
+ extern Sfoff_t sftell(Sfio_t *);
+ extern Sfoff_t sfseek(Sfio_t *, Sfoff_t, int);
+ extern ssize_t sfputr(Sfio_t *, const char *, int);
+ extern char *sfgetr(Sfio_t *, int, int);
+ extern ssize_t sfnputc(Sfio_t *, int, size_t);
+ extern int sfungetc(Sfio_t *, int);
+ extern int sfprintf(Sfio_t *, const char *, ...);
+ extern char *sfprints(const char *, ...);
+ extern int sfsprintf(char *, int, const char *, ...);
+ extern int sfvsprintf(char *, int, const char *, va_list);
+ extern int sfvprintf(Sfio_t *, const char *, va_list);
+ extern int sfscanf(Sfio_t *, const char *, ...);
+ extern int sfsscanf(const char *, const char *, ...);
+ extern int sfvsscanf(const char *, const char *, va_list);
+ extern int sfvscanf(Sfio_t *, const char *, va_list);
+ extern int sfresize(Sfio_t *, Sfoff_t);
/* mutex locking for thread-safety */
- extern int sfmutex _ARG_((Sfio_t *, int));
+ extern int sfmutex(Sfio_t *, int);
/* io functions with discipline continuation */
- extern ssize_t sfrd _ARG_((Sfio_t *, Void_t *, size_t, Sfdisc_t *));
- extern ssize_t sfwr
- _ARG_((Sfio_t *, const Void_t *, size_t, Sfdisc_t *));
- extern Sfoff_t sfsk _ARG_((Sfio_t *, Sfoff_t, int, Sfdisc_t *));
- extern ssize_t sfpkrd _ARG_((int, Void_t *, size_t, int, long, int));
+ extern ssize_t sfrd(Sfio_t *, Void_t *, size_t, Sfdisc_t *);
+ extern ssize_t sfwr(Sfio_t *, const Void_t *, size_t, Sfdisc_t *);
+ extern Sfoff_t sfsk(Sfio_t *, Sfoff_t, int, Sfdisc_t *);
+ extern ssize_t sfpkrd(int, Void_t *, size_t, int, long, int);
/* portable handling of primitive types */
- extern int sfdlen _ARG_((Sfdouble_t));
- extern int sfllen _ARG_((Sflong_t));
- extern int sfulen _ARG_((Sfulong_t));
-
- extern int sfputd _ARG_((Sfio_t *, Sfdouble_t));
- extern int sfputl _ARG_((Sfio_t *, Sflong_t));
- extern int sfputu _ARG_((Sfio_t *, Sfulong_t));
- extern int sfputm _ARG_((Sfio_t *, Sfulong_t, Sfulong_t));
- extern int sfputc _ARG_((Sfio_t *, int));
-
- extern Sfdouble_t sfgetd _ARG_((Sfio_t *));
- extern Sflong_t sfgetl _ARG_((Sfio_t *));
- extern Sfulong_t sfgetu _ARG_((Sfio_t *));
- extern Sfulong_t sfgetm _ARG_((Sfio_t *, Sfulong_t));
- extern int sfgetc _ARG_((Sfio_t *));
-
- extern int _sfputd _ARG_((Sfio_t *, Sfdouble_t));
- extern int _sfputl _ARG_((Sfio_t *, Sflong_t));
- extern int _sfputu _ARG_((Sfio_t *, Sfulong_t));
- extern int _sfputm _ARG_((Sfio_t *, Sfulong_t, Sfulong_t));
- extern int _sfflsbuf _ARG_((Sfio_t *, int));
-
- extern int _sffilbuf _ARG_((Sfio_t *, int));
-
- extern int _sfdlen _ARG_((Sfdouble_t));
- extern int _sfllen _ARG_((Sflong_t));
- extern int _sfulen _ARG_((Sfulong_t));
+ extern int sfdlen(Sfdouble_t);
+ extern int sfllen(Sflong_t);
+ extern int sfulen(Sfulong_t);
+
+ extern int sfputd(Sfio_t *, Sfdouble_t);
+ extern int sfputl(Sfio_t *, Sflong_t);
+ extern int sfputu(Sfio_t *, Sfulong_t);
+ extern int sfputm(Sfio_t *, Sfulong_t, Sfulong_t);
+ extern int sfputc(Sfio_t *, int);
+
+ extern Sfdouble_t sfgetd(Sfio_t *);
+ extern Sflong_t sfgetl(Sfio_t *);
+ extern Sfulong_t sfgetu(Sfio_t *);
+ extern Sfulong_t sfgetm(Sfio_t *, Sfulong_t);
+ extern int sfgetc(Sfio_t *);
+
+ extern int _sfputd(Sfio_t *, Sfdouble_t);
+ extern int _sfputl(Sfio_t *, Sflong_t);
+ extern int _sfputu(Sfio_t *, Sfulong_t);
+ extern int _sfputm(Sfio_t *, Sfulong_t, Sfulong_t);
+ extern int _sfflsbuf(Sfio_t *, int);
+
+ extern int _sffilbuf(Sfio_t *, int);
+
+ extern int _sfdlen(Sfdouble_t);
+ extern int _sfllen(Sflong_t);
+ extern int _sfulen(Sfulong_t);
/* miscellaneous function analogues of fast in-line functions */
- extern Sfoff_t sfsize _ARG_((Sfio_t *));
- extern int sfclrerr _ARG_((Sfio_t *));
- extern int sfeof _ARG_((Sfio_t *));
- extern int sferror _ARG_((Sfio_t *));
- extern int sffileno _ARG_((Sfio_t *));
- extern int sfstacked _ARG_((Sfio_t *));
- extern ssize_t sfvalue _ARG_((Sfio_t *));
- extern ssize_t sfslen _ARG_((void));
+ extern Sfoff_t sfsize(Sfio_t *);
+ extern int sfclrerr(Sfio_t *);
+ extern int sfeof(Sfio_t *);
+ extern int sferror(Sfio_t *);
+ extern int sffileno(Sfio_t *);
+ extern int sfstacked(Sfio_t *);
+ extern ssize_t sfvalue(Sfio_t *);
+ extern ssize_t sfslen(void);
#undef extern
_END_EXTERNS_
#define Sfsignal_f Sig_handler_t
#else
#include <signal.h>
-typedef void (*Sfsignal_f) _ARG_((int));
+typedef void (*Sfsignal_f) (int);
#endif
static int _Sfsigp = 0; /* # of streams needing SIGPIPE protection */
#endif
#if _lib_getpagesize
-_BEGIN_EXTERNS_ extern int getpagesize _ARG_((void));
+_BEGIN_EXTERNS_ extern int getpagesize(void);
_END_EXTERNS_
#endif
/* Set a (new) buffer for a stream.
reg int fd, m;
reg Sfio_t *sf;
Sfio_t newf, savf;
- void (*notifyf) _ARG_((Sfio_t *, int, int));
+ void (*notifyf) (Sfio_t *, int, int);
NOTUSED(val);
#define EPERM 1
#endif
- _BEGIN_EXTERNS_ extern Vthread_t *vtopen _ARG_((Vthread_t *, int));
- extern int vtclose _ARG_((Vthread_t *));
- extern int vtset _ARG_((Vthread_t *, int, Void_t *));
- extern int vtrun _ARG_((Vthread_t *, void *(*)(void *), void *));
- extern int vtkill _ARG_((Vthread_t *));
- extern int vtwait _ARG_((Vthread_t *));
-
-/* extern int vtonce _ARG_((Vtonce_t *, void (*)())); */
-
- extern Vtmutex_t *vtmtxopen _ARG_((Vtmutex_t *, int));
- extern int vtmtxclose _ARG_((Vtmutex_t *));
- extern int vtmtxlock _ARG_((Vtmutex_t *));
- extern int vtmtxtrylock _ARG_((Vtmutex_t *));
- extern int vtmtxunlock _ARG_((Vtmutex_t *));
- extern int vtmtxclrlock _ARG_((Vtmutex_t *));
-
- extern Void_t *vtstatus _ARG_((Vthread_t *));
- extern int vterror _ARG_((Vthread_t *));
- extern int vtmtxerror _ARG_((Vtmutex_t *));
- extern int vtonceerror _ARG_((Vtonce_t *));
+ _BEGIN_EXTERNS_ extern Vthread_t *vtopen(Vthread_t *, int);
+ extern int vtclose(Vthread_t *);
+ extern int vtset(Vthread_t *, int, Void_t *);
+ extern int vtrun(Vthread_t *, void *(*)(void *), void *);
+ extern int vtkill(Vthread_t *);
+ extern int vtwait(Vthread_t *);
+
+/* extern int vtonce(Vtonce_t *, void (*)()); */
+
+ extern Vtmutex_t *vtmtxopen(Vtmutex_t *, int);
+ extern int vtmtxclose(Vtmutex_t *);
+ extern int vtmtxlock(Vtmutex_t *);
+ extern int vtmtxtrylock(Vtmutex_t *);
+ extern int vtmtxunlock(Vtmutex_t *);
+ extern int vtmtxclrlock(Vtmutex_t *);
+
+ extern Void_t *vtstatus(Vthread_t *);
+ extern int vterror(Vthread_t *);
+ extern int vtmtxerror(Vtmutex_t *);
+ extern int vtonceerror(Vtonce_t *);
_END_EXTERNS_
#if defined(vt_threaded) && vt_threaded
#endif
#endif /*_BEGIN_EXTERNS_*/
- /* _ARG_ simplifies function prototyping among flavors of C */
- #ifndef _ARG_
- #define _ARG_(x) x
- #endif /*_ARG_*/
-
/* __INLINE__ is the inline keyword */
#if !defined(__INLINE__) && defined(__cplusplus)
#define __INLINE__ inline
#endif
_BEGIN_EXTERNS_
- extern int printf _ARG_((const char*, ...));
+ extern int printf(const char*, ...);
_END_EXTERNS_
#if N == 0
#endif
#undef printf
_BEGIN_EXTERNS_
- extern int printf _ARG_((const char*, ...));
+ extern int printf(const char*, ...);
_END_EXTERNS_
static va_list ap;
main()
std malloc note{ stuck with standard malloc }end noexecute{
_BEGIN_EXTERNS_
- extern void _exit _ARG_((int));
- extern char* strdup _ARG_((const char*));
+ extern void _exit(int);
+ extern char* strdup(const char*);
#if _STD_
char* malloc(unsigned n) { _exit(0); return 0; }
#else
exit cleanup note{ stuck with standard _cleanup }end execute{
#include <stdio.h>
_BEGIN_EXTERNS_
- extern void exit _ARG_((int));
- extern void _exit _ARG_((int));
+ extern void exit(int);
+ extern void _exit(int);
extern void _cleanup();
void _cleanup() { _exit(0); }
_END_EXTERNS_
typedef struct _vmdisc_s Vmdisc_t;
typedef struct _vmethod_s Vmethod_t;
typedef Void_t *(*Vmemory_f)
- _ARG_((Vmalloc_t *, Void_t *, size_t, size_t, Vmdisc_t *));
+ (Vmalloc_t *, Void_t *, size_t, size_t, Vmdisc_t *);
typedef int (*Vmexcept_f)
- _ARG_((Vmalloc_t *, int, Void_t *, Vmdisc_t *));
+ (Vmalloc_t *, int, Void_t *, Vmdisc_t *);
struct _vmstat_s {
int n_busy; /* number of busy blocks */
};
struct _vmethod_s {
- Void_t *(*allocf) _ARG_((Vmalloc_t *, size_t));
- Void_t *(*resizef) _ARG_((Vmalloc_t *, Void_t *, size_t, int));
- int (*freef) _ARG_((Vmalloc_t *, Void_t *));
- long (*addrf) _ARG_((Vmalloc_t *, Void_t *));
- long (*sizef) _ARG_((Vmalloc_t *, Void_t *));
- int (*compactf) _ARG_((Vmalloc_t *));
- Void_t *(*alignf) _ARG_((Vmalloc_t *, size_t, size_t));
+ Void_t *(*allocf) (Vmalloc_t *, size_t);
+ Void_t *(*resizef) (Vmalloc_t *, Void_t *, size_t, int);
+ int (*freef) (Vmalloc_t *, Void_t *);
+ long (*addrf) (Vmalloc_t *, Void_t *);
+ long (*sizef) (Vmalloc_t *, Void_t *);
+ int (*compactf) (Vmalloc_t *);
+ Void_t *(*alignf) (Vmalloc_t *, size_t, size_t);
unsigned short meth;
};
#if _BLD_vmalloc && defined(__EXPORT__)
#define extern __EXPORT__
#endif
- extern Vmalloc_t *vmopen _ARG_((Vmdisc_t *, Vmethod_t *, int));
- extern int vmclose _ARG_((Vmalloc_t *));
- extern int vmclear _ARG_((Vmalloc_t *));
- extern int vmcompact _ARG_((Vmalloc_t *));
+ extern Vmalloc_t *vmopen(Vmdisc_t *, Vmethod_t *, int);
+ extern int vmclose(Vmalloc_t *);
+ extern int vmclear(Vmalloc_t *);
+ extern int vmcompact(Vmalloc_t *);
- extern Vmdisc_t *vmdisc _ARG_((Vmalloc_t *, Vmdisc_t *));
+ extern Vmdisc_t *vmdisc(Vmalloc_t *, Vmdisc_t *);
- extern Void_t *vmalloc _ARG_((Vmalloc_t *, size_t));
- extern Void_t *vmalign _ARG_((Vmalloc_t *, size_t, size_t));
- extern Void_t *vmresize _ARG_((Vmalloc_t *, Void_t *, size_t, int));
- extern int vmfree _ARG_((Vmalloc_t *, Void_t *));
+ extern Void_t *vmalloc(Vmalloc_t *, size_t);
+ extern Void_t *vmalign(Vmalloc_t *, size_t, size_t);
+ extern Void_t *vmresize(Vmalloc_t *, Void_t *, size_t, int);
+ extern int vmfree(Vmalloc_t *, Void_t *);
- extern long vmaddr _ARG_((Vmalloc_t *, Void_t *));
- extern long vmsize _ARG_((Vmalloc_t *, Void_t *));
+ extern long vmaddr(Vmalloc_t *, Void_t *);
+ extern long vmsize(Vmalloc_t *, Void_t *);
- extern Vmalloc_t *vmregion _ARG_((Void_t *));
- extern Void_t *vmsegment _ARG_((Vmalloc_t *, Void_t *));
- extern int vmset _ARG_((Vmalloc_t *, int, int));
+ extern Vmalloc_t *vmregion(Void_t *);
+ extern Void_t *vmsegment(Vmalloc_t *, Void_t *);
+ extern int vmset(Vmalloc_t *, int, int);
- extern Void_t *vmdbwatch _ARG_((Void_t *));
- extern int vmdbcheck _ARG_((Vmalloc_t *));
+ extern Void_t *vmdbwatch(Void_t *);
+ extern int vmdbcheck(Vmalloc_t *);
- extern int vmprofile _ARG_((Vmalloc_t *, int));
+ extern int vmprofile(Vmalloc_t *, int);
- extern int vmtrace _ARG_((int));
- extern int vmtrbusy _ARG_((Vmalloc_t *));
+ extern int vmtrace(int);
+ extern int vmtrbusy(Vmalloc_t *);
- extern int vmstat _ARG_((Vmalloc_t *, Vmstat_t *));
+ extern int vmstat(Vmalloc_t *, Vmstat_t *);
- extern int vmwalk _ARG_((Vmalloc_t *,
+ extern int vmwalk(Vmalloc_t *,
int (*)(Vmalloc_t *, Void_t *, size_t,
- Vmdisc_t *)));
- extern char *vmstrdup _ARG_((Vmalloc_t *, const char *));
+ Vmdisc_t *));
+ extern char *vmstrdup(Vmalloc_t *, const char *);
#undef extern
typedef struct _exit_s {
struct _exit_s *next;
- void (*exitf) _ARG_((void));
+ void (*exitf)(void);
} Exit_t;
static Exit_t *Exit;
#define ASSERT(p)
#define COUNT(n)
#else
- extern int printf _ARG_((const char *, ...));
+ extern int printf(const char *, ...);
#if defined(__LINE__) && defined(__FILE__)
#define PRFILELINE printf("Assertion failed at %s:%d\n",__FILE__,__LINE__)
#else
}
/* external symbols for internal use by vmalloc */
- typedef Block_t *(*Vmsearch_f) _ARG_((Vmdata_t *, size_t, Block_t *));
+ typedef Block_t *(*Vmsearch_f) (Vmdata_t *, size_t, Block_t *);
typedef struct _vmextern_ {
- Block_t *(*vm_extend) _ARG_((Vmalloc_t *, size_t, Vmsearch_f));
- int (*vm_truncate) _ARG_((Vmalloc_t *, Seg_t *, size_t, int));
+ Block_t *(*vm_extend) (Vmalloc_t *, size_t, Vmsearch_f);
+ int (*vm_truncate) (Vmalloc_t *, Seg_t *, size_t, int);
size_t vm_pagesize;
- char *(*vm_strcpy) _ARG_((char *, char *, int));
- char *(*vm_itoa) _ARG_((Vmulong_t, int));
- void (*vm_trace) _ARG_((Vmalloc_t *,
- Vmuchar_t *, Vmuchar_t *, size_t, size_t));
- void (*vm_pfclose) _ARG_((Vmalloc_t *));
+ char *(*vm_strcpy) (char *, char *, int);
+ char *(*vm_itoa) (Vmulong_t, int);
+ void (*vm_trace) (Vmalloc_t *,
+ Vmuchar_t *, Vmuchar_t *, size_t, size_t);
+ void (*vm_pfclose) (Vmalloc_t *);
} Vmextern_t;
#define _Vmextend (_Vmextern.vm_extend)
#if !defined(_PACKAGE_ast)
- extern size_t getpagesize _ARG_((void));
+ extern size_t getpagesize(void);
#ifndef WIN32
- extern void abort _ARG_((void));
- extern ssize_t write _ARG_((int, const void *, size_t));
+ extern void abort(void);
+ extern ssize_t write(int, const void *, size_t);
#endif
#ifndef cfree
/* for malloc.c */
#ifndef WIN32
- extern int creat _ARG_((const char *, int));
- extern int close _ARG_((int));
+ extern int creat(const char *, int);
+ extern int close(int);
#endif
- extern int getpid _ARG_((void));
+ extern int getpid(void);
/* for vmexit.c */
#ifndef WIN32
- extern int onexit _ARG_((void (*)(void)));
- extern void _exit _ARG_((int));
+ extern int onexit(void(*)(void));
+ extern void _exit(int);
#endif
- extern void _cleanup _ARG_((void));
+ extern void _cleanup(void);
#endif /*!PACKAGE_ast */
typedef int ssize_t;
#endif
#if !defined(_WIN32)
- extern Vmuchar_t *sbrk _ARG_((ssize_t));
+ extern Vmuchar_t *sbrk(ssize_t);
#endif
_END_EXTERNS_
Vmextern_t _Vmextern = { vmextend, /* _Vmextend */
vmtruncate, /* _Vmtruncate */
0, /* _Vmpagesize */
- NIL(char *(*)_ARG_((char *, char *, int))), /* _Vmstrcpy */
- NIL(char *(*)_ARG_((Vmulong_t, int))), /* _Vmitoa */
- NIL(void (*)_ARG_((Vmalloc_t *,
- Vmuchar_t *, Vmuchar_t *, size_t, size_t))), /* _Vmtrace */
- NIL(void (*)_ARG_((Vmalloc_t *))) /* _Vmpfclose */
+ NIL(char *(*)(char *, char *, int)), /* _Vmstrcpy */
+ NIL(char *(*)(Vmulong_t, int)), /* _Vmitoa */
+ NIL(void (*)(Vmalloc_t *,
+ Vmuchar_t *, Vmuchar_t *, size_t, size_t)), /* _Vmtrace */
+ NIL(void (*)(Vmalloc_t *)) /* _Vmpfclose */
};
#endif
#endif /*_BEGIN_EXTERNS_*/
-/* _ARG_ simplifies function prototyping among flavors of C */
-#ifndef _ARG_
-#define _ARG_(x) x
-#endif /*_ARG_*/
-
/* __INLINE__ is the inline keyword */
#if !defined(__INLINE__) && defined(__cplusplus)
#define __INLINE__ inline