Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Utilities / cmcurl-7.19.0 / lib / nwos.c
blob0d08febde9dde223761be4801e0a01df61653fa2
1 /***************************************************************************
2 * _ _ ____ _
3 * Project ___| | | | _ \| |
4 * / __| | | | |_) | |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
8 * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
10 * This software is licensed as described in the file COPYING, which
11 * you should have received as part of this distribution. The terms
12 * are also available at http://curl.haxx.se/docs/copyright.html.
14 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 * copies of the Software, and permit persons to whom the Software is
16 * furnished to do so, under the terms of the COPYING file.
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
21 * $Id: nwos.c,v 1.1.1.1 2008-09-23 16:32:05 hoffman Exp $
22 ***************************************************************************/
24 #ifdef NETWARE /* Novell NetWare */
26 #include <stdlib.h>
28 #ifdef __NOVELL_LIBC__
29 /* For native LibC-based NLM we need to do nothing. */
30 int netware_init ( void )
32 return 0;
35 #else /* __NOVELL_LIBC__ */
37 /* For native CLib-based NLM we need to initialize the LONG namespace. */
38 #include <stdio.h>
39 #include <nwnspace.h>
40 #include <nwthread.h>
41 #include <nwadv.h>
42 /* Make the CLIB Ctx stuff link */
43 #include <netdb.h>
44 NETDB_DEFINE_CONTEXT
45 /* Make the CLIB Inet stuff link */
46 #include <netinet/in.h>
47 #include <arpa/inet.h>
48 NETINET_DEFINE_CONTEXT
50 int netware_init ( void )
52 int rc = 0;
53 unsigned int myHandle = GetNLMHandle();
54 /* import UnAugmentAsterisk dynamically for NW4.x compatibility */
55 void (*pUnAugmentAsterisk)(int) = (void(*)(int))
56 ImportSymbol(myHandle, "UnAugmentAsterisk");
57 /* import UseAccurateCaseForPaths dynamically for NW3.x compatibility */
58 void (*pUseAccurateCaseForPaths)(int) = (void(*)(int))
59 ImportSymbol(myHandle, "UseAccurateCaseForPaths");
60 if(pUnAugmentAsterisk)
61 pUnAugmentAsterisk(1);
62 if(pUseAccurateCaseForPaths)
63 pUseAccurateCaseForPaths(1);
64 UnimportSymbol(myHandle, "UnAugmentAsterisk");
65 UnimportSymbol(myHandle, "UseAccurateCaseForPaths");
66 /* set long name space */
67 if((SetCurrentNameSpace(4) == 255)) {
68 rc = 1;
70 if((SetTargetNameSpace(4) == 255)) {
71 rc = rc + 2;
73 return rc;
76 /* dummy function to satisfy newer prelude */
77 int __init_environment ( void )
79 return 0;
82 /* dummy function to satisfy newer prelude */
83 int __deinit_environment ( void )
85 return 0;
88 #endif /* __NOVELL_LIBC__ */
90 #endif /* NETWARE */