GME  13
apr_private.h
Go to the documentation of this file.
00001 /* Licensed to the Apache Software Foundation (ASF) under one or more
00002  * contributor license agreements.  See the NOTICE file distributed with
00003  * this work for additional information regarding copyright ownership.
00004  * The ASF licenses this file to You under the Apache License, Version 2.0
00005  * (the "License"); you may not use this file except in compliance with
00006  * the License.  You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 /*
00018  * Note: 
00019  * This is the netware-specific autoconf-like config file
00020  * which unix creates at ./configure time.
00021  */
00022 
00023 #ifdef NETWARE
00024 
00025 #ifndef APR_PRIVATE_H
00026 #define APR_PRIVATE_H
00027 
00028 /* Pick up publicly advertised headers and symbols before the
00029  * APR internal private headers and symbols
00030  */
00031 #include <apr.h>
00032 
00033 /* Pick up privately consumed headers */
00034 #include <ndkvers.h>
00035 
00036 /* Include alloca.h to get compiler-dependent defines */ 
00037 #include <alloca.h>
00038 
00039 #include <sys/types.h>
00040 #include <stddef.h>
00041 #include <stdio.h>
00042 #include <stdlib.h>
00043 #include <time.h>
00044 #include <library.h>
00045 #include <netware.h>
00046 
00047 /* Use this section to define all of the HAVE_FOO_H
00048  * that are required to build properly.
00049  */
00050 #define HAVE_DLFCN_H    1
00051 #define HAVE_LIMITS_H   1
00052 #define HAVE_SIGNAL_H   1
00053 #define HAVE_STDDEF_H   1
00054 #define HAVE_STDLIB_H   1
00055 #ifndef USE_WINSOCK
00056 #define HAVE_SYS_SELECT_H 1
00057 #define HAVE_WRITEV       1
00058 #endif
00059 #define HAVE_SYS_STAT_H 1
00060 #define HAVE_SYS_MMAN_H 1
00061 #define HAVE_FCNTL_H    1
00062 #define HAVE_ICONV_H    1
00063 #define HAVE_UTIME_H    1
00064 
00065 #define HAVE_STRICMP    1
00066 #define HAVE_STRNICMP   1
00067 #define HAVE_STRDUP     1
00068 #define HAVE_STRSTR     1
00069 #define HAVE_MEMCHR     1
00070 #define HAVE_CALLOC     1
00071 #define HAVE_UTIME      1
00072 
00073 #define HAVE_GETENV     1
00074 #define HAVE_SETENV     1
00075 #define HAVE_UNSETENV   1
00076 
00077 #define HAVE_WRITEV     1
00078 
00079 #define HAVE_GETPASS_R  1
00080 /*
00081  * Hack around older NDKs which have only the getpassword() function,
00082  * a threadsafe, API-equivilant of getpass_r().
00083  */
00084 #if (CURRENT_NDK_THRESHOLD < 709060000)
00085 #define getpass_r       getpassword
00086 #endif
00087 
00088 /*#define DSO_USE_DLFCN */
00089 
00090 #ifdef NW_BUILD_IPV6
00091 #define HAVE_GETADDRINFO 1
00092 #define HAVE_GETNAMEINFO 1
00093 #endif
00094 
00095 /* 1 is used for SIGABRT on netware */
00096 /* 2 is used for SIGFPE on netware */
00097 /* 3 is used for SIGILL on netware */
00098 /* 4 is used for SIGINT on netware */
00099 /* 5 is used for SIGSEGV on netware */
00100 /* 6 is used for SIGTERM on netware */
00101 /* 7 is used for SIGPOLL on netware */
00102 
00103 #if (CURRENT_NDK_THRESHOLD < 306030000)
00104 #define SIGKILL         11
00105 #define SIGALRM         13
00106 #define SIGCHLD         14 
00107 #define SIGCONT         15
00108 #define SIGHUP          16
00109 #define SIGPIPE         17
00110 #define SIGQUIT         18
00111 #define SIGSTOP         19
00112 #define SIGTSTP         20
00113 #define SIGTTIN         21
00114 #define SIGTTOU         22
00115 #define SIGUSR1         23
00116 #define SIGUSR2         24
00117 #endif
00118 
00119 #define SIGTRAP         25
00120 #define SIGIOT          26
00121 #define SIGSTKFLT       28
00122 #define SIGURG          29
00123 #define SIGXCPU         30
00124 #define SIGXFSZ         31
00125 #define SIGVTALRM       32
00126 #define SIGPROF         33
00127 #define SIGWINCH        34
00128 #define SIGIO           35
00129 
00130 #if (CURRENT_NDK_THRESHOLD < 406230000)
00131 #undef  SA_NOCLDSTOP
00132 #define SA_NOCLDSTOP    0x00000001
00133 #endif
00134 #ifndef SIGBUS
00135 #define SIGBUS          SIGSEGV
00136 #endif
00137 
00138 #define _getch          getcharacter
00139 
00140 #define SIZEOF_SHORT    2
00141 #define SIZEOF_INT      4
00142 #define SIZEOF_LONGLONG 8
00143 #define SIZEOF_CHAR     1
00144 #define SIZEOF_SSIZE_T  SIZEOF_INT
00145 
00146 void netware_pool_proc_cleanup();
00147 
00148 /* NLM registration routines for managing which NLMs
00149     are using the library. */
00150 int register_NLM(void *NLMHandle);
00151 int unregister_NLM(void *NLMHandle);
00152 
00153 /* Application global data management */
00154 extern int  gLibId;
00155 extern void *gLibHandle;
00156 
00157 typedef struct app_data {
00158     int     initialized;
00159     void*   gPool;
00160     void*   gs_aHooksToSort;
00161     void*   gs_phOptionalHooks;
00162     void*   gs_phOptionalFunctions;
00163     void*   gs_nlmhandle;
00164     rtag_t  gs_startup_rtag;
00165     rtag_t  gs_socket_rtag;
00166     rtag_t  gs_lookup_rtag;
00167     rtag_t  gs_event_rtag;
00168     rtag_t  gs_pcp_rtag;
00169     void*   gs_ldap_xref_lock;
00170     void*   gs_xref_head;
00171 } APP_DATA;
00172 
00173 int setGlobalPool(void *data);
00174 void* getGlobalPool();
00175 int setStatCache(void *data);
00176 void* getStatCache();
00177 
00178 /* Redefine malloc to use the library malloc call so 
00179     that all of the memory resources will be owned
00180     and can be shared by the library. */
00181 #undef malloc
00182 #define malloc(x) library_malloc(gLibHandle,x)
00183 #ifndef __MWERKS__
00184 #define _alloca         alloca
00185 #endif
00186 
00187 /* 64-bit integer conversion function */
00188 #define APR_INT64_STRFN strtoll
00189 
00190 #if APR_HAS_LARGE_FILES
00191 #define APR_OFF_T_STRFN strtoll
00192 #else
00193 #define APR_OFF_T_STRFN strtol
00194 #endif
00195 
00196 /* used to check DWORD overflow for 64bit compiles */
00197 #define APR_DWORD_MAX   0xFFFFFFFFUL
00198 
00199 /*
00200  * Include common private declarations.
00201  */
00202 #include "../apr_private_common.h"
00203 
00204 #endif  /*APR_PRIVATE_H*/
00205 #endif  /*NETWARE*/