1/*
2 * Copyright (c) 2010, Oracle America, Inc.
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are
5 * met:
6 *
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above
10 * copyright notice, this list of conditions and the following
11 * disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 * * Neither the name of the "Oracle America, Inc." nor the names of its
14 * contributors may be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
22 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30/* fixincludes should not add extern "C" to this file */
31/*
32 * Rpc additions to <sys/types.h>
33 */
34#ifndef _RPC_TYPES_H
35#define _RPC_TYPES_H 1
36
37typedef int bool_t;
38typedef int enum_t;
39/* This needs to be changed to uint32_t in the future */
40typedef unsigned long rpcprog_t;
41typedef unsigned long rpcvers_t;
42typedef unsigned long rpcproc_t;
43typedef unsigned long rpcprot_t;
44typedef unsigned long rpcport_t;
45
46#define __dontcare__ -1
47
48#ifndef FALSE
49# define FALSE (0)
50#endif
51
52#ifndef TRUE
53# define TRUE (1)
54#endif
55
56#ifndef NULL
57# define NULL 0
58#endif
59
60#include <stdlib.h> /* For malloc decl. */
61#define mem_alloc(bsize) malloc(bsize)
62/*
63 * XXX: This must not use the second argument, or code in xdr_array.c needs
64 * to be modified.
65 */
66#define mem_free(ptr, bsize) free(ptr)
67
68#ifndef makedev /* ie, we haven't already included it */
69#include <sys/types.h>
70#endif
71
72#if defined __APPLE_CC__ || defined __FreeBSD__
73# define __u_char_defined
74# define __daddr_t_defined
75#endif
76
77#ifndef __u_char_defined
78typedef __u_char u_char;
79typedef __u_short u_short;
80typedef __u_int u_int;
81typedef __u_long u_long;
82typedef __quad_t quad_t;
83typedef __u_quad_t u_quad_t;
84typedef __fsid_t fsid_t;
85# define __u_char_defined
86#endif
87#ifndef __daddr_t_defined
88typedef __daddr_t daddr_t;
89typedef __caddr_t caddr_t;
90# define __daddr_t_defined
91#endif
92
93#include <sys/time.h>
94#include <sys/param.h>
95
96#include <netinet/in.h>
97
98#ifndef INADDR_LOOPBACK
99#define INADDR_LOOPBACK (u_long)0x7F000001
100#endif
101#ifndef MAXHOSTNAMELEN
102#define MAXHOSTNAMELEN 64
103#endif
104
105#endif /* rpc/types.h */
106

source code of glibc/sunrpc/rpc/types.h