Home | History | Annotate | Download | only in rpc
      1 /*
      2  * CDDL HEADER START
      3  *
      4  * The contents of this file are subject to the terms of the
      5  * Common Development and Distribution License (the "License").
      6  * You may not use this file except in compliance with the License.
      7  *
      8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9  * or http://www.opensolaris.org/os/licensing.
     10  * See the License for the specific language governing permissions
     11  * and limitations under the License.
     12  *
     13  * When distributing Covered Code, include this CDDL HEADER in each
     14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15  * If applicable, add the following below this CDDL HEADER, with the
     16  * fields enclosed by brackets "[]" replaced with your own identifying
     17  * information: Portions Copyright [yyyy] [name of copyright owner]
     18  *
     19  * CDDL HEADER END
     20  */
     21 
     22 /*
     23  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
     24  * Use is subject to license terms.
     25  */
     26 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
     27 /* All Rights Reserved */
     28 /*
     29  * Portions of this source code were derived from Berkeley
     30  * 4.3 BSD under license from the Regents of the University of
     31  * California.
     32  */
     33 
     34 #ifndef _RPC_TYPES_H
     35 #define	_RPC_TYPES_H
     36 
     37 #pragma ident	"%Z%%M%	%I%	%E% SMI"
     38 
     39 /*
     40  * Rpc additions to <sys/types.h>
     41  */
     42 #include <sys/types.h>
     43 
     44 #ifdef __cplusplus
     45 extern "C" {
     46 #endif
     47 
     48 typedef int bool_t;
     49 typedef int enum_t;
     50 
     51 /*
     52  * The ulonglong_t type was introduced to workaround an rpcgen bug
     53  * that has been fixed, this next typedef will be removed in a future release.
     54  * Do *NOT* use!
     55  */
     56 typedef u_longlong_t ulonglong_t;
     57 
     58 #if defined(_LP64) || defined(_I32LPx)
     59 typedef	uint32_t rpcprog_t;
     60 typedef	uint32_t rpcvers_t;
     61 typedef	uint32_t rpcproc_t;
     62 typedef uint32_t rpcprot_t;
     63 typedef uint32_t rpcport_t;
     64 typedef int32_t rpc_inline_t;
     65 #else
     66 typedef	unsigned long rpcprog_t;
     67 typedef	unsigned long rpcvers_t;
     68 typedef	unsigned long rpcproc_t;
     69 typedef unsigned long rpcprot_t;
     70 typedef unsigned long rpcport_t;
     71 typedef long rpc_inline_t;
     72 #endif
     73 
     74 
     75 #define	__dontcare__	-1
     76 
     77 #ifndef	FALSE
     78 #define	FALSE	(0)
     79 #endif
     80 
     81 #ifndef	TRUE
     82 #define	TRUE	(1)
     83 #endif
     84 
     85 #ifndef	NULL
     86 #define	NULL	0
     87 #endif
     88 
     89 #ifndef	_KERNEL
     90 #define	mem_alloc(bsize)	malloc(bsize)
     91 #define	mem_free(ptr, bsize)	free(ptr)
     92 #else
     93 #include <sys/kmem.h>		/* XXX */
     94 
     95 #define	mem_alloc(bsize)	kmem_alloc(bsize, KM_SLEEP)
     96 #define	mem_free(ptr, bsize)	kmem_free(ptr, bsize)
     97 
     98 extern const char *rpc_tpiprim2name(uint_t prim);
     99 extern const char *rpc_tpierr2name(uint_t err);
    100 #define	RPCDEBUG
    101 #if defined(DEBUG) && !defined(RPCDEBUG)
    102 #define	RPCDEBUG
    103 #endif
    104 
    105 #ifdef RPCDEBUG
    106 extern uint_t	rpclog;
    107 
    108 #define	RPCLOG(A, B, C)	\
    109 	((void)((rpclog) && (rpclog & (A)) && (printf((B), (C)), TRUE)))
    110 #define	RPCLOG0(A, B)	\
    111 	((void)((rpclog) && (rpclog & (A)) && (printf(B), TRUE)))
    112 #else
    113 #define		RPCLOG(A, B, C)
    114 #define		RPCLOG0(A, B)
    115 #endif
    116 
    117 #endif
    118 
    119 /* messaging stuff. */
    120 #ifndef _KERNEL
    121 #ifdef __STDC__
    122 extern const char __nsl_dom[];
    123 #else
    124 extern char __nsl_dom[];
    125 #endif
    126 #endif
    127 
    128 #ifdef __cplusplus
    129 }
    130 #endif
    131 
    132 #include <sys/time.h>
    133 
    134 #endif	/* _RPC_TYPES_H */
    135