From 67fb342b086501f95fdadb3cf69ff9abb7a714e7 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Mon, 15 Jan 2001 13:16:59 +0000 Subject: Makeheader files be more like GNU --- include/features.h | 1 - include/fstab.h | 83 +++++++++++++++++++++++++++++++++++++++++++++++++ include/netinet/in.h | 14 ++++++--- include/rpc/auth.h | 10 +++--- include/rpc/clnt.h | 12 +++---- include/rpc/pmap_clnt.h | 2 +- include/rpc/rpc.h | 4 +-- include/rpc/svc.h | 14 ++++----- include/rpc/xdr.h | 22 ++++++------- include/sys/syslog.h | 2 +- include/sys/un.h | 46 ++++++++++++++++++++++++++- 11 files changed, 170 insertions(+), 40 deletions(-) create mode 100644 include/fstab.h diff --git a/include/features.h b/include/features.h index f51ebd7e2..3d79d618d 100644 --- a/include/features.h +++ b/include/features.h @@ -1,4 +1,3 @@ - #ifndef __FEATURES_H #define __FEATURES_H diff --git a/include/fstab.h b/include/fstab.h new file mode 100644 index 000000000..274f23aae --- /dev/null +++ b/include/fstab.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 1980, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)fstab.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _FSTAB_H +#define _FSTAB_H 1 + +#include + +/* + * File system table, see fstab(5). + * + * Used by dump, mount, umount, swapon, fsck, df, ... + * + * For ufs fs_spec field is the block special name. Programs that want to + * use the character special name must create that name by prepending a 'r' + * after the right most slash. Quota files are always named "quotas", so + * if type is "rq", then use concatenation of fs_file and "quotas" to locate + * quota file. + */ +#define _PATH_FSTAB "/etc/fstab" +#define FSTAB "/etc/fstab" /* deprecated */ + +#define FSTAB_RW "rw" /* read/write device */ +#define FSTAB_RQ "rq" /* read/write with quotas */ +#define FSTAB_RO "ro" /* read-only device */ +#define FSTAB_SW "sw" /* swap device */ +#define FSTAB_XX "xx" /* ignore totally */ + +struct fstab + { + char *fs_spec; /* block special device name */ + char *fs_file; /* file system path prefix */ + char *fs_vfstype; /* File system type, ufs, nfs */ + char *fs_mntops; /* Mount options ala -o */ + const char *fs_type; /* FSTAB_* from fs_mntops */ + int fs_freq; /* dump frequency, in days */ + int fs_passno; /* pass number on parallel dump */ + }; + + +__BEGIN_DECLS + +extern struct fstab *getfsent __P ((void)); +extern struct fstab *getfsspec __P ((__const char *__name)); +extern struct fstab *getfsfile __P ((__const char *__name)); +extern int setfsent __P ((void)); +extern void endfsent __P ((void)); + +__END_DECLS + +#endif /* fstab.h */ diff --git a/include/netinet/in.h b/include/netinet/in.h index 0fc347a4c..07b7193e5 100644 --- a/include/netinet/in.h +++ b/include/netinet/in.h @@ -223,8 +223,6 @@ struct ipv6_mreq /* Get system-specific definitions. */ #include -#include -#include /* Functions to convert between host and network byte order. @@ -233,6 +231,16 @@ struct ipv6_mreq this was a short-sighted decision since on different systems the types may have different representations but the values are always the same. */ +extern uint32_t ntohl __P ((uint32_t __netlong)); +extern uint16_t ntohs __P ((uint16_t __netshort)); +extern uint32_t htonl __P ((uint32_t __hostlong)); +extern uint16_t htons __P ((uint16_t __hostshort)); + +#include + +/* Get machine dependent optimized versions of byte swapping functions. */ +#include + #if __BYTE_ORDER == __BIG_ENDIAN /* The host byte order is the same as network byte order, so these functions are all just identity. */ @@ -246,8 +254,6 @@ struct ipv6_mreq # define ntohs(x) __bswap_16 (x) # define htonl(x) __bswap_32 (x) # define htons(x) __bswap_16 (x) -# else -# error "What kind of system is this?" # endif #endif diff --git a/include/rpc/auth.h b/include/rpc/auth.h index 35f30e4a3..e0e1e5f67 100644 --- a/include/rpc/auth.h +++ b/include/rpc/auth.h @@ -97,12 +97,12 @@ struct AUTH { struct opaque_auth ah_verf; union des_block ah_key; struct auth_ops { - void (*ah_nextverf) __P ((AUTH *)); - int (*ah_marshal) __P ((AUTH *, XDR *)); /* nextverf & serialize */ - int (*ah_validate) __P ((AUTH *, struct opaque_auth *)); + void (*ah_nextverf) __PMT ((AUTH *)); + int (*ah_marshal) __PMT ((AUTH *, XDR *)); /* nextverf & serialize */ + int (*ah_validate) __PMT ((AUTH *, struct opaque_auth *)); /* validate verifier */ - int (*ah_refresh) __P ((AUTH *)); /* refresh credentials */ - void (*ah_destroy) __P ((AUTH *)); /* destroy this structure */ + int (*ah_refresh) __PMT ((AUTH *)); /* refresh credentials */ + void (*ah_destroy) __PMT ((AUTH *)); /* destroy this structure */ } *ah_ops; caddr_t ah_private; }; diff --git a/include/rpc/clnt.h b/include/rpc/clnt.h index f98d4ccf0..b3852927a 100644 --- a/include/rpc/clnt.h +++ b/include/rpc/clnt.h @@ -133,17 +133,17 @@ typedef struct CLIENT CLIENT; struct CLIENT { AUTH *cl_auth; /* authenticator */ struct clnt_ops { - enum clnt_stat (*cl_call) __P ((CLIENT *, u_long, xdrproc_t, + enum clnt_stat (*cl_call) __PMT ((CLIENT *, u_long, xdrproc_t, caddr_t, xdrproc_t, caddr_t, struct timeval)); /* call remote procedure */ - void (*cl_abort) __P ((void)); /* abort a call */ - void (*cl_geterr) __P ((CLIENT *, struct rpc_err *)); + void (*cl_abort) __PMT ((void)); /* abort a call */ + void (*cl_geterr) __PMT ((CLIENT *, struct rpc_err *)); /* get specific error code */ - bool_t (*cl_freeres) __P ((CLIENT *, xdrproc_t, caddr_t)); + bool_t (*cl_freeres) __PMT ((CLIENT *, xdrproc_t, caddr_t)); /* frees results */ - void (*cl_destroy) __P ((CLIENT *)); /* destroy this structure */ - bool_t (*cl_control) __P ((CLIENT *, int, char *)); + void (*cl_destroy) __PMT ((CLIENT *)); /* destroy this structure */ + bool_t (*cl_control) __PMT ((CLIENT *, int, char *)); /* the ioctl() of rpc */ } *cl_ops; caddr_t cl_private; /* private stuff */ diff --git a/include/rpc/pmap_clnt.h b/include/rpc/pmap_clnt.h index a36f7b72f..d9800d400 100644 --- a/include/rpc/pmap_clnt.h +++ b/include/rpc/pmap_clnt.h @@ -45,7 +45,7 @@ __BEGIN_DECLS -typedef bool_t (*resultproc_t) __P ((caddr_t resp, +typedef bool_t (*resultproc_t) __PMT ((caddr_t resp, struct sockaddr_in *raddr)); /* diff --git a/include/rpc/rpc.h b/include/rpc/rpc.h index 725103507..74e529d82 100644 --- a/include/rpc/rpc.h +++ b/include/rpc/rpc.h @@ -65,8 +65,6 @@ * defined by included in . */ /* routines for parsing /etc/rpc */ -#if 0 -#include /* structures and routines to parse /etc/rpc */ -#endif +//#include /* structures and routines to parse /etc/rpc */ #endif /* rpc/rpc.h */ diff --git a/include/rpc/svc.h b/include/rpc/svc.h index 1039bcc15..4ac2a5cdf 100644 --- a/include/rpc/svc.h +++ b/include/rpc/svc.h @@ -78,18 +78,18 @@ struct SVCXPRT { int xp_sock; u_short xp_port; /* associated port number */ const struct xp_ops { - bool_t (*xp_recv) __P ((SVCXPRT *__xprt, struct rpc_msg *__msg)); + bool_t (*xp_recv) __PMT ((SVCXPRT *__xprt, struct rpc_msg *__msg)); /* receive incoming requests */ - enum xprt_stat (*xp_stat) __P ((SVCXPRT *__xprt)); + enum xprt_stat (*xp_stat) __PMT ((SVCXPRT *__xprt)); /* get transport status */ - bool_t (*xp_getargs) __P ((SVCXPRT *__xprt, xdrproc_t __xdr_args, + bool_t (*xp_getargs) __PMT ((SVCXPRT *__xprt, xdrproc_t __xdr_args, caddr_t args_ptr)); /* get arguments */ - bool_t (*xp_reply) __P ((SVCXPRT *__xprt, struct rpc_msg *__msg)); + bool_t (*xp_reply) __PMT ((SVCXPRT *__xprt, struct rpc_msg *__msg)); /* send reply */ - bool_t (*xp_freeargs) __P ((SVCXPRT *__xprt, xdrproc_t __xdr_args, + bool_t (*xp_freeargs) __PMT ((SVCXPRT *__xprt, xdrproc_t __xdr_args, caddr_t args_ptr)); /* free mem allocated for args */ - void (*xp_destroy) __P ((SVCXPRT *__xprt)); + void (*xp_destroy) __PMT ((SVCXPRT *__xprt)); /* destroy this struct */ } *xp_ops; int xp_addrlen; /* length of remote address */ @@ -157,7 +157,7 @@ struct svc_req { #ifndef __DISPATCH_FN_T #define __DISPATCH_FN_T -typedef void (*__dispatch_fn_t) __P ((struct svc_req*, SVCXPRT*)); +typedef void (*__dispatch_fn_t) __PMT ((struct svc_req*, SVCXPRT*)); #endif /* diff --git a/include/rpc/xdr.h b/include/rpc/xdr.h index c2505ca95..91dbcc3da 100644 --- a/include/rpc/xdr.h +++ b/include/rpc/xdr.h @@ -114,27 +114,27 @@ struct XDR enum xdr_op x_op; /* operation; fast additional param */ struct xdr_ops { - bool_t (*x_getlong) __P ((XDR *__xdrs, long *__lp)); + bool_t (*x_getlong) __PMT ((XDR *__xdrs, long *__lp)); /* get a long from underlying stream */ - bool_t (*x_putlong) __P ((XDR *__xdrs, __const long *__lp)); + bool_t (*x_putlong) __PMT ((XDR *__xdrs, __const long *__lp)); /* put a long to " */ - bool_t (*x_getbytes) __P ((XDR *__xdrs, caddr_t __addr, + bool_t (*x_getbytes) __PMT ((XDR *__xdrs, caddr_t __addr, u_int __len)); /* get some bytes from " */ - bool_t (*x_putbytes) __P ((XDR *__xdrs, __const char *__addr, + bool_t (*x_putbytes) __PMT ((XDR *__xdrs, __const char *__addr, u_int __len)); /* put some bytes to " */ - u_int (*x_getpostn) __P ((__const XDR *__xdrs)); + u_int (*x_getpostn) __PMT ((__const XDR *__xdrs)); /* returns bytes off from beginning */ - bool_t (*x_setpostn) __P ((XDR *__xdrs, u_int pos)); + bool_t (*x_setpostn) __PMT ((XDR *__xdrs, u_int pos)); /* lets you reposition the stream */ - int32_t *(*x_inline) __P ((XDR *__xdrs, int len)); + int32_t *(*x_inline) __PMT ((XDR *__xdrs, int len)); /* buf quick ptr to buffered data */ - void (*x_destroy) __P ((XDR *__xdrs)); + void (*x_destroy) __PMT ((XDR *__xdrs)); /* free privates of this xdr_stream */ - bool_t (*x_getint32) __P ((XDR *__xdrs, int32_t *__ip)); + bool_t (*x_getint32) __PMT ((XDR *__xdrs, int32_t *__ip)); /* get a int from underlying stream */ - bool_t (*x_putint32) __P ((XDR *__xdrs, __const int32_t *__ip)); + bool_t (*x_putint32) __PMT ((XDR *__xdrs, __const int32_t *__ip)); /* put a int to " */ } *x_ops; @@ -153,7 +153,7 @@ struct XDR * allocate dynamic storage of the appropriate size and return it. * bool_t (*xdrproc_t)(XDR *, caddr_t *); */ -typedef bool_t (*xdrproc_t) __P ((XDR *, void *,...)); +typedef bool_t (*xdrproc_t) __PMT ((XDR *, void *,...)); /* diff --git a/include/sys/syslog.h b/include/sys/syslog.h index 38d74a03b..e11965e9b 100644 --- a/include/sys/syslog.h +++ b/include/sys/syslog.h @@ -181,7 +181,7 @@ __BEGIN_DECLS void closelog __P((void)); void openlog __P((__const char *, int, int)); -int setlogmask __P((int)); +void setlogmask __P((int)); void syslog __P((int, __const char *, ...)) #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5) __attribute__ ((format (printf, 2, 0))) diff --git a/include/sys/un.h b/include/sys/un.h index efb674cc3..03f36058b 100644 --- a/include/sys/un.h +++ b/include/sys/un.h @@ -1 +1,45 @@ -#include +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_UN_H +#define _SYS_UN_H 1 + +#include + +#include /* For prototype of `strlen'. */ + +/* Get the definition of the macro to define the common sockaddr members. */ +#include + +__BEGIN_DECLS + +/* Structure describing the address of an AF_LOCAL (aka AF_UNIX) socket. */ +struct sockaddr_un + { + __SOCKADDR_COMMON (sun_); + char sun_path[108]; /* Path name. */ + }; + + +/* Evaluate to actual length of the `sockaddr_un' structure. */ +#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \ + + strlen ((ptr)->sun_path)) + +__END_DECLS + +#endif /* sys/un.h */ -- cgit v1.2.3