Standardize License information
[openafs.git] / src / rx / rx_user.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 #ifdef  VALIDATE
11 error-foo error-foo error-foo
12 #endif /* VALIDATE */
13 #ifndef RX_USER_INCLUDE
14 #define RX_USER_INCLUDE
15
16 /* rx_user.h:  definitions specific to the user-level implementation of Rx */
17
18 #include <afs/param.h>
19 #include <stdio.h>
20 #include <stdlib.h>     /* for malloc() */
21 #include <lwp.h>
22
23 /* These routines are no-ops in the user level implementation */
24 #define SPLVAR
25 #define NETPRI
26 #define USERPRI
27
28 #define AFS_GLOCK()
29 #define AFS_GUNLOCK()
30 #define ISAFS_GLOCK()
31 #define AFS_ASSERT_GLOCK()
32
33 #define AFS_RXGLOCK()
34 #define AFS_RXGUNLOCK()
35 #define ISAFS_RXGLOCK()
36 #define AFS_ASSERT_RXGLOCK()
37
38 extern void rxi_StartListener();
39 extern void rxi_StartServerProc();
40 extern void rxi_ReScheduleEvents();
41
42 /* Some "operating-system independent" stuff, for the user mode implementation */
43 #ifdef UAFS_CLIENT
44 typedef void *osi_socket;
45 #define OSI_NULLSOCKET  ((osi_socket) 0)
46 #else /* UAFS_CLIENT */
47 typedef afs_int32 osi_socket;
48 #define OSI_NULLSOCKET  ((osi_socket) -1)
49 #endif /* UAFS_CLIENT */
50
51 #define osi_rxSleep(x)              rxi_Sleep(x)
52 #define osi_rxWakeup(x)             rxi_Wakeup(x)
53
54 #ifndef AFS_AIX32_ENV
55
56 #ifndef osi_Alloc
57 #define osi_Alloc(size)             malloc(size)
58 #endif
59
60 #ifndef osi_Free
61 #define osi_Free(ptr, size)         free(ptr)
62 #endif
63
64 #endif
65
66 #define osi_GetTime(timevalptr)     gettimeofday(timevalptr, 0)
67
68 /* Just in case it's possible to distinguish between relatively long-lived stuff and stuff which will be freed very soon, but which needs quick allocation (e.g. dynamically allocated xdr things) */
69 #define osi_QuickFree(ptr, size)    osi_Free(ptr, size)
70 #define osi_QuickAlloc(size)        osi_Alloc(size)
71
72 extern void osi_Panic();
73 extern void osi_AssertFailU(const char *expr, const char *file, int line);
74 #define osi_Assert(e) (void)((e) || (osi_AssertFailU(#e, __FILE__, __LINE__), 0))
75
76 #if  !defined(_ANSI_C_SOURCE) || defined(AFS_SUN_ENV)
77 #if defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)
78 extern int fprintf();
79 #endif
80 #endif  /* ANSI_C_SOURCE */
81
82 #define osi_Msg                     fprintf)(stderr,
83
84 #endif /* RX_USER_INCLUDE */