Kristian Monsen | 5ab5018 | 2010-05-14 18:53:44 +0100 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * _ _ ____ _ |
| 3 | * Project ___| | | | _ \| | |
| 4 | * / __| | | | |_) | | |
| 5 | * | (__| |_| | _ <| |___ |
| 6 | * \___|\___/|_| \_\_____| |
| 7 | * |
Alex Deymo | 8f1a214 | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 8 | * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. |
Kristian Monsen | 5ab5018 | 2010-05-14 18:53:44 +0100 | [diff] [blame] | 9 | * |
| 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 Deymo | 8f1a214 | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 12 | * are also available at https://curl.haxx.se/docs/copyright.html. |
Kristian Monsen | 5ab5018 | 2010-05-14 18:53:44 +0100 | [diff] [blame] | 13 | * |
| 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 SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 23 | #include "curl_setup.h" |
Kristian Monsen | 5ab5018 | 2010-05-14 18:53:44 +0100 | [diff] [blame] | 24 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 25 | #ifdef NETWARE /* Novell NetWare */ |
Kristian Monsen | 5ab5018 | 2010-05-14 18:53:44 +0100 | [diff] [blame] | 26 | |
| 27 | #ifdef __NOVELL_LIBC__ |
| 28 | /* For native LibC-based NLM we need to do nothing. */ |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 29 | int netware_init(void) |
Kristian Monsen | 5ab5018 | 2010-05-14 18:53:44 +0100 | [diff] [blame] | 30 | { |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 31 | return 0; |
Kristian Monsen | 5ab5018 | 2010-05-14 18:53:44 +0100 | [diff] [blame] | 32 | } |
| 33 | |
| 34 | #else /* __NOVELL_LIBC__ */ |
| 35 | |
| 36 | /* For native CLib-based NLM we need to initialize the LONG namespace. */ |
Kristian Monsen | 5ab5018 | 2010-05-14 18:53:44 +0100 | [diff] [blame] | 37 | #include <nwnspace.h> |
| 38 | #include <nwthread.h> |
| 39 | #include <nwadv.h> |
| 40 | /* Make the CLIB Ctx stuff link */ |
| 41 | #include <netdb.h> |
| 42 | NETDB_DEFINE_CONTEXT |
| 43 | /* Make the CLIB Inet stuff link */ |
| 44 | #include <netinet/in.h> |
| 45 | #include <arpa/inet.h> |
| 46 | NETINET_DEFINE_CONTEXT |
| 47 | |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 48 | int netware_init(void) |
Kristian Monsen | 5ab5018 | 2010-05-14 18:53:44 +0100 | [diff] [blame] | 49 | { |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 50 | 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 Monsen | 5ab5018 | 2010-05-14 18:53:44 +0100 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | /* dummy function to satisfy newer prelude */ |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 75 | int __init_environment(void) |
Kristian Monsen | 5ab5018 | 2010-05-14 18:53:44 +0100 | [diff] [blame] | 76 | { |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 77 | return 0; |
Kristian Monsen | 5ab5018 | 2010-05-14 18:53:44 +0100 | [diff] [blame] | 78 | } |
| 79 | |
| 80 | /* dummy function to satisfy newer prelude */ |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 81 | int __deinit_environment(void) |
Kristian Monsen | 5ab5018 | 2010-05-14 18:53:44 +0100 | [diff] [blame] | 82 | { |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 83 | return 0; |
Kristian Monsen | 5ab5018 | 2010-05-14 18:53:44 +0100 | [diff] [blame] | 84 | } |
| 85 | |
| 86 | #endif /* __NOVELL_LIBC__ */ |
| 87 | |
Kristian Monsen | 5ab5018 | 2010-05-14 18:53:44 +0100 | [diff] [blame] | 88 | #endif /* NETWARE */ |