bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / tomcat-connectors-1.2.32-src / native / common / jk_nwmain.c
1 /*
2  *  Licensed to the Apache Software Foundation (ASF) under one or more
3  *  contributor license agreements.  See the NOTICE file distributed with
4  *  this work for additional information regarding copyright ownership.
5  *  The ASF licenses this file to You under the Apache License, Version 2.0
6  *  (the "License"); you may not use this file except in compliance with
7  *  the License.  You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  */
17
18 /***************************************************************************
19  * Description: Netware Wrapper                                            *
20  * Author:      Mike Anderson <mmander@novell.com>                         *
21  * Version:     $Revision: 466585 $                                           *
22  ***************************************************************************/
23
24 #ifdef NETWARE
25 /*
26  * NATIVE_MAIN
27  */
28
29 /*
30  * INCLUDES
31  */
32
33 #include <stdio.h>
34
35 /* Apache 2/APR uses NOVELL_LIBC which has a different way of handling
36  * "library" nlms.  If we aren't on LIBC, use the old method
37  */
38
39 #ifndef __NOVELL_LIBC__
40 #include <nwthread.h>
41 #include <netdb.h>
42
43 NETDB_DEFINE_CONTEXT
44 /*
45  * main ()
46  *
47  * Main entry point -- don't do much more than I've provided
48  *
49  * Entry:
50  *
51  * Exit:
52  *    Nothing
53  */
54 void main()
55 {
56     ExitThread(TSR_THREAD, 0);
57 }
58 #else /* __NOVELL_LIBC__ */
59
60 /* Since we are on LibC, we need to handle our own startup and shutdown */
61
62 #include <netware.h>
63 #include "novsock2.h"
64
65 int _NonAppStart
66     (void *NLMHandle,
67      void *errorScreen,
68      const char *cmdLine,
69      const char *loadDirPath,
70      size_t uninitializedDataLength,
71      void *NLMFileHandle,
72      int (*readRoutineP) (int conn, void *fileHandle, size_t offset,
73                           size_t nbytes, size_t * bytesRead, void *buffer),
74      size_t customDataOffset,
75      size_t customDataSize, int messageCount, const char **messages)
76 {
77 #pragma unused(cmdLine)
78 #pragma unused(loadDirPath)
79 #pragma unused(uninitializedDataLength)
80 #pragma unused(NLMFileHandle)
81 #pragma unused(readRoutineP)
82 #pragma unused(customDataOffset)
83 #pragma unused(customDataSize)
84 #pragma unused(messageCount)
85 #pragma unused(messages)
86
87     WSADATA wsaData;
88
89     return WSAStartup((WORD) MAKEWORD(2, 0), &wsaData);
90 }
91
92 void _NonAppStop(void)
93 {
94     WSACleanup();
95 }
96
97 int _NonAppCheckUnload(void)
98 {
99     return 0;
100 }
101 #endif /* __NOVELL_LIBC__ */
102
103 #endif