ReactOS  r76032
types.h
Go to the documentation of this file.
1 /* $NetBSD: types.h,v 1.13 2000/06/13 01:02:44 thorpej Exp $ */
2 
3 /*
4  * Copyright (c) 2009, Sun Microsystems, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  * - Redistributions of source code must retain the above copyright notice,
10  * this list of conditions and the following disclaimer.
11  * - Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  * - Neither the name of Sun Microsystems, Inc. nor the names of its
15  * contributors may be used to endorse or promote products derived
16  * from this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  *
30  * from: @(#)types.h 1.18 87/07/24 SMI
31  * from: @(#)types.h 2.3 88/08/15 4.0 RPCSRC
32  * $FreeBSD: src/include/rpc/types.h,v 1.10.6.1 2003/12/18 00:59:50 peter Exp $
33  */
34 
35 /* NFSv4.1 client for Windows
36  * Copyright 2012 The Regents of the University of Michigan
37  *
38  * Olga Kornievskaia <aglo@umich.edu>
39  * Casey Bodley <cbodley@umich.edu>
40  *
41  * This library is free software; you can redistribute it and/or modify it
42  * under the terms of the GNU Lesser General Public License as published by
43  * the Free Software Foundation; either version 2.1 of the License, or (at
44  * your option) any later version.
45  *
46  * This library is distributed in the hope that it will be useful, but
47  * without any warranty; without even the implied warranty of merchantability
48  * or fitness for a particular purpose. See the GNU Lesser General Public
49  * License for more details.
50  *
51  * You should have received a copy of the GNU Lesser General Public License
52  * along with this library; if not, write to the Free Software Foundation,
53  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
54  */
55 
56 /*
57  * Rpc additions to <sys/types.h>
58  */
59 #ifndef _TIRPC_TYPES_H
60 #define _TIRPC_TYPES_H
61 
62 #include <sys/types.h>
63 #ifdef __REACTOS__
64 #include <windef.h>
65 #endif
66 //#include <sys/_null.h>
67 
68 // Windows mappings of data types
69 // Fixed size things
70 typedef INT16 int16_t;
71 typedef INT32 int32_t;
72 typedef INT64 int64_t;
73 typedef UINT16 u_int16_t;
74 typedef UINT32 u_int32_t;
75 typedef UINT32 uint32_t;
76 typedef UINT64 u_int64_t;
77 typedef UINT64 uint64_t;
78 typedef PCHAR caddr_t;
79 // Scalable things
80 typedef UCHAR u_char;
81 typedef unsigned short u_short;
82 typedef UINT32 u_int;
83 typedef UINT32 uint;
84 
85 typedef INT64 quad_t;
86 typedef UINT64 u_quad_t;
87 
88 typedef UINT uid_t;
89 typedef UINT gid_t;
90 #ifndef __REACTOS__
91 typedef DWORD pid_t;
92 #endif
93 
94 #ifndef _SSIZE_T_DEFINED
95 #define _SSIZE_T_DEFINED
96 //typedef SIZE_T size_t; //This is causing a "benign redefinition error"
97 typedef SSIZE_T ssize_t;
98 // End of Windows...
99 #endif
100 
101 typedef int32_t bool_t;
102 typedef int32_t enum_t;
103 
110 
111 #ifndef NULL
112 # define NULL 0
113 #endif
114 #define __dontcare__ -1
115 
116 #ifndef FALSE
117 # define FALSE (0)
118 #endif
119 #ifndef TRUE
120 # define TRUE (1)
121 #endif
122 
123 #define mem_alloc(bsize) calloc(1, bsize)
124 #define mem_free(ptr, bsize) free(ptr)
125 
126 //#include <sys/time.h>
127 //#include <sys/param.h>
128 #include <stdlib.h>
129 #include <netconfig.h>
130 #ifdef __REACTOS__
131 #include <ws2def.h>
132 #include <winsock2.h>
133 #endif
134 
135 /*
136  * The netbuf structure is defined here, because FreeBSD / NetBSD only use
137  * it inside the RPC code. It's in <xti.h> on SVR4, but it would be confusing
138  * to have an xti.h, since FreeBSD / NetBSD does not support XTI/TLI.
139  */
140 
141 /*
142  * The netbuf structure is used for transport-independent address storage.
143  */
144 struct netbuf {
145  unsigned int maxlen;
146  unsigned int len;
147  void *buf;
148 };
149 
150 /*
151  * The format of the addres and options arguments of the XTI t_bind call.
152  * Only provided for compatibility, it should not be used.
153  */
154 
155 struct t_bind {
156  struct netbuf addr;
157  unsigned int qlen;
158 };
159 
160 /*
161  * Internal library and rpcbind use. This is not an exported interface, do
162  * not use.
163  */
166  int si_proto;
168  int si_alen;
169 };
170 
171 #endif /* _TIRPC_TYPES_H */
signed char * PCHAR
Definition: retypes.h:7
PCHAR caddr_t
Definition: types.h:78
u_int32_t rpcproc_t
Definition: types.h:106
u_int32_t rpcport_t
Definition: types.h:108
u_int32_t rpcvers_t
Definition: types.h:105
ADDRESS_FAMILY si_af
Definition: types.h:165
int si_proto
Definition: types.h:166
int32_t bool_t
Definition: types.h:101
UINT16 u_int16_t
Definition: types.h:73
DWORD pid_t
Definition: types.h:91
void * buf
Definition: types.h:147
LONG_PTR SSIZE_T
Definition: basetsd.h:182
DWORD DWORD
Definition: winlogon.h:75
signed long long INT64
unsigned int UINT32
UINT64 u_quad_t
Definition: types.h:86
UINT gid_t
Definition: types.h:89
int si_socktype
Definition: types.h:167
UINT64 u_int64_t
Definition: types.h:76
int si_alen
Definition: types.h:168
UINT32 u_int32_t
Definition: types.h:74
u_int32_t rpcprog_t
Definition: types.h:104
unsigned int maxlen
Definition: types.h:145
unsigned int len
Definition: types.h:146
unsigned short u_short
Definition: types.h:81
USHORT ADDRESS_FAMILY
Definition: ws2def.h:25
unsigned char UCHAR
Definition: xmlstorage.h:181
int32_t enum_t
Definition: types.h:102
GLenum const GLvoid * addr
Definition: glext.h:9621
INT64 quad_t
Definition: types.h:85
SSIZE_T ssize_t
Definition: types.h:97
unsigned int u_int32_t
Definition: rosdhcp.h:35
INT32 int32_t
Definition: types.h:71
UINT64 uint64_t
Definition: types.h:77
UINT32 u_int
Definition: types.h:82
unsigned short UINT16
unsigned int UINT
Definition: ndis.h:50
UINT32 uint32_t
Definition: types.h:75
Definition: types.h:155
Definition: types.h:144
signed int INT32
INT16 int16_t
Definition: types.h:70
UINT32 uint
Definition: types.h:83
u_int32_t rpcprot_t
Definition: types.h:107
unsigned long long UINT64
UCHAR u_char
Definition: types.h:80
INT64 int64_t
Definition: types.h:72
int32_t rpc_inline_t
Definition: types.h:109
UINT uid_t
Definition: types.h:88
unsigned int qlen
Definition: types.h:157
signed short INT16