blob: c6c22ccbbf0bf715e1502dee589b6786a26ee7a8 [file] [log] [blame]
Kristian Monsen5ab50182010-05-14 18:53:44 +01001/***************************************************************************
2 * _ _ ____ _
3 * Project ___| | | | _ \| |
4 * / __| | | | |_) | |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
7 *
Alex Deymo8f1a2142016-06-28 14:49:26 -07008 * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
Kristian Monsen5ab50182010-05-14 18:53:44 +01009 *
10 * This software is licensed as described in the file COPYING, which
11 * you should have received as part of this distribution. The terms
Alex Deymo8f1a2142016-06-28 14:49:26 -070012 * are also available at https://curl.haxx.se/docs/copyright.html.
Kristian Monsen5ab50182010-05-14 18:53:44 +010013 *
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.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ***************************************************************************/
22
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070023#include "curl_setup.h"
Kristian Monsen5ab50182010-05-14 18:53:44 +010024
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070025#ifdef NETWARE /* Novell NetWare */
Kristian Monsen5ab50182010-05-14 18:53:44 +010026
27#ifdef __NOVELL_LIBC__
28/* For native LibC-based NLM we need to do nothing. */
Elliott Hughes82be86d2017-09-20 17:00:17 -070029int netware_init(void)
Kristian Monsen5ab50182010-05-14 18:53:44 +010030{
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070031 return 0;
Kristian Monsen5ab50182010-05-14 18:53:44 +010032}
33
34#else /* __NOVELL_LIBC__ */
35
36/* For native CLib-based NLM we need to initialize the LONG namespace. */
Kristian Monsen5ab50182010-05-14 18:53:44 +010037#include <nwnspace.h>
38#include <nwthread.h>
39#include <nwadv.h>
40/* Make the CLIB Ctx stuff link */
41#include <netdb.h>
42NETDB_DEFINE_CONTEXT
43/* Make the CLIB Inet stuff link */
44#include <netinet/in.h>
45#include <arpa/inet.h>
46NETINET_DEFINE_CONTEXT
47
Elliott Hughes82be86d2017-09-20 17:00:17 -070048int netware_init(void)
Kristian Monsen5ab50182010-05-14 18:53:44 +010049{
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070050 int rc = 0;
51 unsigned int myHandle = GetNLMHandle();
52 /* import UnAugmentAsterisk dynamically for NW4.x compatibility */
53 void (*pUnAugmentAsterisk)(int) = (void(*)(int))
54 ImportSymbol(myHandle, "UnAugmentAsterisk");
55 /* import UseAccurateCaseForPaths dynamically for NW3.x compatibility */
56 void (*pUseAccurateCaseForPaths)(int) = (void(*)(int))
57 ImportSymbol(myHandle, "UseAccurateCaseForPaths");
58 if(pUnAugmentAsterisk)
59 pUnAugmentAsterisk(1);
60 if(pUseAccurateCaseForPaths)
61 pUseAccurateCaseForPaths(1);
62 UnimportSymbol(myHandle, "UnAugmentAsterisk");
63 UnimportSymbol(myHandle, "UseAccurateCaseForPaths");
64 /* set long name space */
65 if((SetCurrentNameSpace(4) == 255)) {
66 rc = 1;
67 }
68 if((SetTargetNameSpace(4) == 255)) {
69 rc = rc + 2;
70 }
71 return rc;
Kristian Monsen5ab50182010-05-14 18:53:44 +010072}
73
74/* dummy function to satisfy newer prelude */
Elliott Hughes82be86d2017-09-20 17:00:17 -070075int __init_environment(void)
Kristian Monsen5ab50182010-05-14 18:53:44 +010076{
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070077 return 0;
Kristian Monsen5ab50182010-05-14 18:53:44 +010078}
79
80/* dummy function to satisfy newer prelude */
Elliott Hughes82be86d2017-09-20 17:00:17 -070081int __deinit_environment(void)
Kristian Monsen5ab50182010-05-14 18:53:44 +010082{
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070083 return 0;
Kristian Monsen5ab50182010-05-14 18:53:44 +010084}
85
86#endif /* __NOVELL_LIBC__ */
87
Kristian Monsen5ab50182010-05-14 18:53:44 +010088#endif /* NETWARE */