aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-03-17 12:46:42 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-03-17 12:46:42 +0000
commit5b55f9ecb34a00af236b2275ffa9adab492a93b6 (patch)
treead9d9454ef28cd200bcdbacd760a2d33f22adda4 /lib
parent3417e0b0fc580393511fc1c603b7c4c6d022648f (diff)
Günter Knauf's NetWare changes.
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.netware277
-rw-r--r--lib/config-netware.h485
-rw-r--r--lib/connect.c7
-rw-r--r--lib/ftp.c5
-rw-r--r--lib/hostip.c5
-rw-r--r--lib/if2ip.c7
-rw-r--r--lib/libcurl.imp44
-rw-r--r--lib/nwlib.c329
-rw-r--r--lib/setup.h8
9 files changed, 1165 insertions, 2 deletions
diff --git a/lib/Makefile.netware b/lib/Makefile.netware
new file mode 100644
index 000000000..8275e143b
--- /dev/null
+++ b/lib/Makefile.netware
@@ -0,0 +1,277 @@
+#################################################################
+#
+## Makefile for building libcurl.nlm (NetWare version - gnu make)
+## Use: make -f Makefile.netware
+##
+## Comments to: Guenter Knauf <eflash@gmx.net>
+#
+#################################################################
+
+# Edit the path below to point to the base of your Novell NDK.
+BASE = c:/novell
+INSTDIR = s:/libcurl
+
+# Edit the path below to point to the base of your Zlib sources.
+ZLIB_PATH = ../../../cw/zlib-src-1.1.4
+
+# Edit the vars below to change NLM target settings.
+TARGET = libcurl
+VERSION = $(LIBCURL_VERSION)
+COPYR = Copyright (c) 1996 - 2004, Daniel Stenberg, <daniel@haxx.se>
+DESCR = cURL libcurl $(LIBCURL_VERSION_STR) - http://curl.haxx.se
+MTSAFE = YES
+STACK = 64000
+SCREEN = none
+#MODULES = libz.nlm
+EXPORTS = @libcurl.imp
+
+# Edit the var below to point to your lib architecture.
+ifndef LIBARCH
+LIBARCH = LIBC
+endif
+
+# must be equal to DEBUG or NDEBUG
+DB = NDEBUG
+# DB = DEBUG
+# Optimization: -O<n> or debugging: -g
+ifeq ($(DB),NDEBUG)
+ OPT = -O2
+ OBJDIR = release
+else
+ OPT = -g
+ OBJDIR = debug
+endif
+
+# Include the version info retrieved from jk_version.h
+-include $(OBJDIR)/version.inc
+
+# The following line defines your compiler.
+ifdef METROWERKS
+ CC = mwccnlm
+else
+ CC = gcc
+endif
+# RM = rm -f
+# CP = cp -fv
+# if you want to mark the target as MTSAFE you will need a tool for
+# generating the xdc data for the linker; here's a minimal tool:
+# http://www.gknw.de/development/prgtools/mkxdc.zip
+MPKXDC = mkxdc
+
+# Global flags for all compilers
+CFLAGS = $(OPT) -D$(DB) -DNETWARE -nostdinc
+#CFLAGS += -DHAVE_LIBZ
+
+ifeq ($(CC),mwccnlm)
+LD = mwldnlm
+LDFLAGS = -nostdlib $(PRELUDE) $(OBJDIR)/*.o -o $(OBJDIR)/$(TARGET).nlm -commandfile
+CFLAGS += -gccinc -inline off -opt nointrinsics
+CFLAGS += -relax_pointers
+#CFLAGS += -w on
+ifeq ($(LIBARCH),LIBC)
+ PRELUDE = $(SDK_LIBC)/imports/libcpre.o
+ CFLAGS += -align 4 -inst mmx -proc 686
+ CFLAGS += -D_POSIX_SOURCE
+# CFLAGS += -D__ANSIC__
+else
+ PRELUDE = "$(METROWERKS)/Novell Support/libraries/runtime/prelude.obj"
+# CFLAGS += -include "$(METROWERKS)/Novell Support/headers/nlm_prefix.h"
+ CFLAGS += -align 1 -proc 586
+endif
+else
+LD = nlmconv
+LDFLAGS = -T
+CFLAGS += -fno-builtin -fpack-struct -fpcc-struct-return
+CFLAGS += -Wall # -pedantic
+ifeq ($(LIBARCH),LIBC)
+ PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
+ CFLAGS += -D_POSIX_SOURCE
+# CFLAGS += -D__ANSIC__
+else
+ PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o
+ CFLAGS += -include $(BASE)/nlmconv/genlm.h
+endif
+endif
+
+LDLIBS =
+
+NDK_ROOT = $(BASE)/ndk
+SDK_CLIB = $(NDK_ROOT)/nwsdk
+SDK_LIBC = $(NDK_ROOT)/libc
+SDK_LDAP = $(NDK_ROOT)/cldapsdk/netware
+CURL_INC = ../include
+
+INCLUDES = -I$(CURL_INC)
+INCLUDES += -I$(ZLIB_PATH)
+
+ifeq ($(LIBARCH),LIBC)
+ INCLUDES += -I$(SDK_LIBC)/include -I$(SDK_LIBC)/include/nks
+ INCLUDES += -I$(SDK_LIBC)/include/winsock
+ INCLUDES += -I$(SDK_LDAP)/libc/inc
+else
+ INCLUDES += -I$(SDK_CLIB)/include/nlm -I$(SDK_CLIB)/include
+ # INCLUDES += -I$(SDK_CLIB)/include/nlm/obsolete
+ INCLUDES += -I$(SDK_LDAP)/clib/inc
+ CFLAGS += -DNETDB_USE_INTERNET
+endif
+CFLAGS += $(INCLUDES)
+
+ifeq ($(MTSAFE),YES)
+ XDCDATA = $(OBJDIR)/$(TARGET).xdc
+endif
+
+ifeq ($(OSTYPE),linux)
+DL = '
+-include $(BASE)/nlmconv/ncpfs.inc
+endif
+
+OBJS = \
+ $(OBJDIR)/file.o \
+ $(OBJDIR)/timeval.o \
+ $(OBJDIR)/base64.o \
+ $(OBJDIR)/hostip.o \
+ $(OBJDIR)/progress.o \
+ $(OBJDIR)/formdata.o \
+ $(OBJDIR)/cookie.o \
+ $(OBJDIR)/http.o \
+ $(OBJDIR)/sendf.o \
+ $(OBJDIR)/ftp.o \
+ $(OBJDIR)/url.o \
+ $(OBJDIR)/dict.o \
+ $(OBJDIR)/if2ip.o \
+ $(OBJDIR)/speedcheck.o \
+ $(OBJDIR)/getdate.o \
+ $(OBJDIR)/transfer.o \
+ $(OBJDIR)/ldap.o \
+ $(OBJDIR)/ssluse.o \
+ $(OBJDIR)/version.o \
+ $(OBJDIR)/getenv.o \
+ $(OBJDIR)/escape.o \
+ $(OBJDIR)/mprintf.o \
+ $(OBJDIR)/telnet.o \
+ $(OBJDIR)/netrc.o \
+ $(OBJDIR)/getinfo.o \
+ $(OBJDIR)/strequal.o \
+ $(OBJDIR)/easy.o \
+ $(OBJDIR)/security.o \
+ $(OBJDIR)/krb4.o \
+ $(OBJDIR)/memdebug.o \
+ $(OBJDIR)/http_chunks.o \
+ $(OBJDIR)/strtok.o \
+ $(OBJDIR)/connect.o \
+ $(OBJDIR)/hash.o \
+ $(OBJDIR)/llist.o \
+ $(OBJDIR)/multi.o \
+ $(OBJDIR)/share.o \
+ $(OBJDIR)/content_encoding.o \
+ $(OBJDIR)/http_digest.o \
+ $(OBJDIR)/http_negotiate.o \
+ $(OBJDIR)/http_ntlm.o \
+ $(OBJDIR)/md5.o \
+ $(OBJDIR)/strtoofft.o \
+ $(OBJDIR)/nwlib.o
+
+
+all: $(OBJDIR) $(OBJDIR)/version.inc $(OBJDIR)/$(TARGET).nlm
+
+$(OBJDIR)/%.o: %.c
+ @echo Compiling $<
+ @$(CC) $(CFLAGS) -c $< -o $@
+
+$(OBJDIR)/version.inc: $(CURL_INC)/curl/curl.h $(OBJDIR)
+ @echo Creating $@
+ @awk -f ../packages/netware/get_ver.awk $< > $@
+
+dist: all
+ -$(RM) $(OBJDIR)/*.o $(OBJDIR)/$(TARGET).map $(OBJDIR)/$(TARGET).ncv
+ -$(RM) $(OBJDIR)/$(TARGET).def $(OBJDIR)/version.inc $(XDCDATA)
+# -$(CP) ../changes.txt $(OBJDIR)/
+
+install: all
+ @[ -d $(INSTDIR) ] || mkdir $(INSTDIR)
+ @$(CP) $(TARGET).nlm $(INSTDIR)
+
+clean:
+ -$(RM) -r $(OBJDIR)
+
+$(OBJDIR):
+ @mkdir $(OBJDIR)
+
+$(OBJDIR)/$(TARGET).nlm: $(OBJS) $(OBJDIR)/$(TARGET).def $(XDCDATA)
+ @echo Linking $@
+ @-$(RM) $@
+ @$(LD) $(LDFLAGS) $(OBJDIR)/$(TARGET).def
+
+$(OBJDIR)/%.xdc: Makefile.netware
+ @echo Creating $@
+ @$(MPKXDC) $(XDCOPT) $@
+
+$(OBJDIR)/%.def: Makefile.netware
+ @echo $(DL)# DEF file for linking with $(LD)$(DL) > $@
+ @echo $(DL)# Do not edit this file - it is created by make!$(DL) >> $@
+ @echo $(DL)# All your changes will be lost!!$(DL) >> $@
+ @echo $(DL)#$(DL) >> $@
+ @echo $(DL)copyright "$(COPYR)"$(DL) >> $@
+ @echo $(DL)description "$(DESCR)"$(DL) >> $@
+ @echo $(DL)version $(VERSION)$(DL) >> $@
+ifdef NLMTYPE
+ @echo $(DL)type $(NLMTYPE)$(DL) >> $@
+endif
+ifdef STACK
+ @echo $(DL)stack $(STACK)$(DL) >> $@
+endif
+ifdef SCREEN
+ @echo $(DL)screenname "$(SCREEN)"$(DL) >> $@
+else
+ @echo $(DL)screenname "DEFAULT"$(DL) >> $@
+endif
+ifeq ($(DB),DEBUG)
+ @echo $(DL)debug$(DL) >> $@
+endif
+ @echo $(DL)threadname "$(TARGET)"$(DL) >> $@
+ifdef XDCDATA
+ @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@
+endif
+ifeq ($(LIBARCH),CLIB)
+ @echo $(DL)start _Prelude$(DL) >> $@
+ @echo $(DL)exit _Stop$(DL) >> $@
+ @echo $(DL)import @$(SDK_CLIB)/imports/clib.imp$(DL) >> $@
+ @echo $(DL)import @$(SDK_CLIB)/imports/threads.imp$(DL) >> $@
+ @echo $(DL)import @$(SDK_CLIB)/imports/nlmlib.imp$(DL) >> $@
+ @echo $(DL)import @$(SDK_CLIB)/imports/socklib.imp$(DL) >> $@
+ @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@
+ @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@
+ @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@
+ @echo $(DL)module clib$(DL) >> $@
+else
+ifeq ($(LD),nlmconv)
+ @echo $(DL)flag_on 64$(DL) >> $@
+else
+ @echo $(DL)autounload$(DL) >> $@
+endif
+ @echo $(DL)pseudopreemption$(DL) >> $@
+ @echo $(DL)start _LibCPrelude$(DL) >> $@
+ @echo $(DL)exit _LibCPostlude$(DL) >> $@
+ @echo $(DL)check _LibCCheckUnload$(DL) >> $@
+ @echo $(DL)import @$(SDK_LIBC)/imports/libc.imp$(DL) >> $@
+ @echo $(DL)import @$(SDK_LIBC)/imports/netware.imp$(DL) >> $@
+ @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@
+ @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@
+ @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@
+ @echo $(DL)module libc$(DL) >> $@
+endif
+ifdef MODULES
+ @echo $(DL)module $(MODULES)$(DL) >> $@
+endif
+ifdef EXPORTS
+ @echo $(DL)export $(EXPORTS)$(DL) >> $@
+endif
+ifdef IMPORTS
+ @echo $(DL)import $(IMPORTS)$(DL) >> $@
+endif
+ifeq ($(LD),nlmconv)
+ @echo $(DL)input $(OBJS)$(DL) >> $@
+ @echo $(DL)input $(PRELUDE)$(DL) >> $@
+ @echo $(DL)output $(TARGET).nlm$(DL) >> $@
+endif
+
diff --git a/lib/config-netware.h b/lib/config-netware.h
new file mode 100644
index 000000000..4a1d373bb
--- /dev/null
+++ b/lib/config-netware.h
@@ -0,0 +1,485 @@
+/* lib/config.h.in. Generated from configure.ac by autoheader. */
+
+/* to disable DICT */
+#undef CURL_DISABLE_DICT
+
+/* to disable FILE */
+#undef CURL_DISABLE_FILE
+
+/* to disable FTP */
+#undef CURL_DISABLE_FTP
+
+/* to disable GOPHER */
+#undef CURL_DISABLE_GOPHER
+
+/* to disable HTTP */
+#undef CURL_DISABLE_HTTP
+
+/* to disable LDAP */
+#undef CURL_DISABLE_LDAP
+
+/* to disable TELNET */
+#undef CURL_DISABLE_TELNET
+
+/* Set to explicitly specify we don't want to use thread-safe functions */
+#undef DISABLED_THREADSAFE
+
+/* your Entropy Gathering Daemon socket pathname */
+#undef EGD_SOCKET
+
+/* Define if you want to enable IPv6 support */
+#undef ENABLE_IPV6
+
+/* Define to 1 if you have the <alloca.h> header file. */
+#undef HAVE_ALLOCA_H
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#define HAVE_ARPA_INET_H 1
+
+/* Define to 1 if you have the <assert.h> header file. */
+#define HAVE_ASSERT_H 1
+
+/* Define to 1 if you have the `closesocket' function. */
+#undef HAVE_CLOSESOCKET
+
+/* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function. */
+#undef HAVE_CRYPTO_CLEANUP_ALL_EX_DATA
+
+/* Define to 1 if you have the <crypto.h> header file. */
+#undef HAVE_CRYPTO_H
+
+/* Define to 1 if you have the <des.h> header file. */
+#undef HAVE_DES_H
+
+/* disabled non-blocking sockets */
+#undef HAVE_DISABLED_NONBLOCKING
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* XXX: #undef HAVE_DLFCN_H */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the `dlopen' function. */
+#define HAVE_DLOPEN 1
+
+/* Define to 1 if you have the <err.h> header file. */
+#define HAVE_ERR_H 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* use FIONBIO for non-blocking sockets */
+/* XXX: #undef HAVE_FIONBIO */
+#define HAVE_FIONBIO 1
+
+/* Define if getaddrinfo exists and works */
+#undef HAVE_GETADDRINFO
+
+/* Define to 1 if you have the `geteuid' function. */
+#undef HAVE_GETEUID
+
+/* Define to 1 if you have the `gethostbyaddr' function. */
+#define HAVE_GETHOSTBYADDR 1
+
+/* Define to 1 if you have the `gethostbyaddr_r' function. */
+#undef HAVE_GETHOSTBYADDR_R
+
+/* gethostbyaddr_r() takes 5 args */
+#undef HAVE_GETHOSTBYADDR_R_5
+
+/* gethostbyaddr_r() takes 7 args */
+#undef HAVE_GETHOSTBYADDR_R_7
+
+/* gethostbyaddr_r() takes 8 args */
+#undef HAVE_GETHOSTBYADDR_R_8
+
+/* Define to 1 if you have the `gethostbyname_r' function. */
+#undef HAVE_GETHOSTBYNAME_R
+
+/* gethostbyname_r() takes 3 args */
+#undef HAVE_GETHOSTBYNAME_R_3
+
+/* gethostbyname_r() takes 5 args */
+#undef HAVE_GETHOSTBYNAME_R_5
+
+/* gethostbyname_r() takes 6 args */
+#undef HAVE_GETHOSTBYNAME_R_6
+
+/* Define to 1 if you have the `getpass_r' function. */
+#undef HAVE_GETPASS_R
+
+/* Define to 1 if you have the `getpwuid' function. */
+#undef HAVE_GETPWUID
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the `gmtime_r' function. */
+#undef HAVE_GMTIME_R
+
+/* if you have the gssapi libraries */
+#undef HAVE_GSSAPI
+
+/* if you have the Heimdal gssapi libraries */
+#undef HAVE_GSSHEIMDAL
+
+/* if you have the MIT gssapi libraries */
+#undef HAVE_GSSMIT
+
+/* Define to 1 if you have the `inet_addr' function. */
+#define HAVE_INET_ADDR 1
+
+/* Define to 1 if you have the `inet_ntoa' function. */
+#define HAVE_INET_NTOA 1
+
+/* Define to 1 if you have the `inet_ntoa_r' function. */
+#undef HAVE_INET_NTOA_R
+
+/* inet_ntoa_r() is declared */
+#undef HAVE_INET_NTOA_R_DECL
+
+/* Define to 1 if you have the `inet_pton' function. */
+#define HAVE_INET_PTON 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* use ioctlsocket() for non-blocking sockets */
+#undef HAVE_IOCTLSOCKET
+
+/* use Ioctlsocket() for non-blocking sockets */
+#undef HAVE_IOCTLSOCKET_CASE
+
+/* Define to 1 if you have the <io.h> header file. */
+#undef HAVE_IO_H
+
+/* if you have the Kerberos4 libraries (including -ldes) */
+#undef HAVE_KRB4
+
+/* Define to 1 if you have the `krb_get_our_ip_for_realm' function. */
+#undef HAVE_KRB_GET_OUR_IP_FOR_REALM
+
+/* Define to 1 if you have the <krb.h> header file. */
+#undef HAVE_KRB_H
+
+/* Define to 1 if you have the `crypto' library (-lcrypto). */
+#undef HAVE_LIBCRYPTO
+
+/* Define to 1 if you have the `dl' library (-ldl). */
+#undef HAVE_LIBDL
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+#undef HAVE_LIBNSL
+
+/* Define to 1 if you have the `resolv' library (-lresolv). */
+#undef HAVE_LIBRESOLV
+
+/* Define to 1 if you have the `resolve' library (-lresolve). */
+#undef HAVE_LIBRESOLVE
+
+/* Define to 1 if you have the `socket' library (-lsocket). */
+#undef HAVE_LIBSOCKET
+
+/* Define to 1 if you have the `ssl' library (-lssl). */
+#undef HAVE_LIBSSL
+
+/* If zlib is available */
+#undef HAVE_LIBZ
+//#define HAVE_LIBZ 1
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the `localtime_r' function. */
+#undef HAVE_LOCALTIME_R
+
+/* if your compiler supports 'long long' */
+#define HAVE_LONGLONG 1
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#define HAVE_MALLOC_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#define HAVE_NETDB_H 1
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#define HAVE_NETINET_IN_H 1
+
+/* Define to 1 if you have the <net/if.h> header file. */
+#undef HAVE_NET_IF_H
+
+/* Define to 1 if you have the <openssl/crypto.h> header file. */
+#undef HAVE_OPENSSL_CRYPTO_H
+
+/* Define to 1 if you have the <openssl/engine.h> header file. */
+#undef HAVE_OPENSSL_ENGINE_H
+
+/* Define to 1 if you have the <openssl/err.h> header file. */
+#undef HAVE_OPENSSL_ERR_H
+
+/* Define to 1 if you have the <openssl/pem.h> header file. */
+#undef HAVE_OPENSSL_PEM_H
+
+/* Define to 1 if you have the <openssl/rsa.h> header file. */
+#undef HAVE_OPENSSL_RSA_H
+
+/* Define to 1 if you have the <openssl/ssl.h> header file. */
+#undef HAVE_OPENSSL_SSL_H
+
+/* Define to 1 if you have the <openssl/x509.h> header file. */
+#undef HAVE_OPENSSL_X509_H
+
+/* use O_NONBLOCK for non-blocking sockets */
+#undef HAVE_O_NONBLOCK
+
+/* Define to 1 if you have the <pem.h> header file. */
+#undef HAVE_PEM_H
+
+/* Define to 1 if you have the `perror' function. */
+#undef HAVE_PERROR
+
+/* Define to 1 if you have the `poll' function. */
+#undef HAVE_POLL
+
+/* Define to 1 if you have the <pwd.h> header file. */
+#undef HAVE_PWD_H
+
+/* Define to 1 if you have the `RAND_egd' function. */
+#undef HAVE_RAND_EGD
+
+/* Define to 1 if you have the `RAND_screen' function. */
+#undef HAVE_RAND_SCREEN
+
+/* Define to 1 if you have the `RAND_status' function. */
+#undef HAVE_RAND_STATUS
+
+/* Define to 1 if you have the <rsa.h> header file. */
+#undef HAVE_RSA_H
+
+/* Define to 1 if you have the `select' function. */
+#define HAVE_SELECT 1
+
+/* Define to 1 if you have the <setjmp.h> header file. */
+#define HAVE_SETJMP_H 1
+
+/* Define to 1 if you have the <sgtty.h> header file. */
+#undef HAVE_SGTTY_H
+
+/* Define to 1 if you have the `sigaction' function. */
+#undef HAVE_SIGACTION
+
+/* Define to 1 if you have the `siginterrupt' function. */
+#undef HAVE_SIGINTERRUPT
+
+/* Define to 1 if you have the `signal' function. */
+#define HAVE_SIGNAL 1
+
+/* If you have sigsetjmp */
+#undef HAVE_SIGSETJMP
+
+/* Define to 1 if you have the `socket' function. */
+#define HAVE_SOCKET 1
+
+/* use SO_NONBLOCK for non-blocking sockets */
+#undef HAVE_SO_NONBLOCK
+
+/* Define this if you have the SPNEGO library fbopenssl */
+#undef HAVE_SPNEGO
+
+/* Define to 1 if you have the <ssl.h> header file. */
+#undef HAVE_SSL_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#define HAVE_STRCASECMP 1
+
+/* Define to 1 if you have the `strcmpi' function. */
+#undef HAVE_STRCMPI
+
+/* Define to 1 if you have the `strdup' function. */
+#define HAVE_STRDUP 1
+
+/* Define to 1 if you have the `strftime' function. */
+#define HAVE_STRFTIME 1
+
+/* Define to 1 if you have the `stricmp' function. */
+#undef HAVE_STRICMP
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcat' function. */
+#define HAVE_STRLCAT 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+#define HAVE_STRLCPY 1
+
+/* Define to 1 if you have the `strstr' function. */
+#define HAVE_STRSTR 1
+
+/* Define to 1 if you have the `strtok_r' function. */
+#undef HAVE_STRTOK_R
+
+/* Define to 1 if you have the `strtoll' function. */
+#undef HAVE_STRTOLL
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/poll.h> header file. */
+#undef HAVE_SYS_POLL_H
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#define HAVE_SYS_SELECT_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/sockio.h> header file. */
+#define HAVE_SYS_SOCKIO_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/utime.h> header file. */
+#undef HAVE_SYS_UTIME_H
+
+/* Define to 1 if you have the `tcgetattr' function. */
+#undef HAVE_TCGETATTR
+
+/* Define to 1 if you have the `tcsetattr' function. */
+#undef HAVE_TCSETATTR
+
+/* Define to 1 if you have the <termios.h> header file. */
+#define HAVE_TERMIOS_H 1
+
+/* Define to 1 if you have the <termio.h> header file. */
+#undef HAVE_TERMIO_H
+
+/* Define to 1 if you have the <time.h> header file. */
+#define HAVE_TIME_H 1
+
+/* Define to 1 if you have the `uname' function. */
+#define HAVE_UNAME 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `utime' function. */
+#undef HAVE_UTIME
+
+/* Define to 1 if you have the <utime.h> header file. */
+#undef HAVE_UTIME_H
+
+/* Define to 1 if you have the <winsock.h> header file. */
+#undef HAVE_WINSOCK_H
+
+/* Define this symbol if your OS supports changing the contents of argv */
+#undef HAVE_WRITABLE_ARGV
+
+/* Define to 1 if you have the <x509.h> header file. */
+#undef HAVE_X509_H
+
+/* if you have the zlib.h header file */
+#define HAVE_ZLIB_H 1
+
+/* need REENTRANT defined */
+#undef NEED_REENTRANT
+
+/* cpu-machine-OS */
+#define OS "i386-pc-NetWare"
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* a suitable file to read random data from */
+#undef RANDOM_FILE
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
+
+/* Define to the type of arg 1 for `select'. */
+#undef SELECT_TYPE_ARG1
+
+/* Define to the type of args 2, 3 and 4 for `select'. */
+#undef SELECT_TYPE_ARG234
+
+/* Define to the type of arg 5 for `select'. */
+#undef SELECT_TYPE_ARG5
+
+/* The size of a `curl_off_t', as computed by sizeof. */
+#define SIZEOF_CURL_OFF_T 4
+
+/* Define to 1 if you have the ANSI C header files. */
+/* XXX: #undef STDC_HEADERS */
+#define STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Define if you want to enable ares support */
+#undef USE_ARES
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to 1 if on AIX 3.
+ System headers sometimes define this.
+ We just want to avoid a redefinition error message. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* type to use in place of in_addr_t if not defined */
+#undef in_addr_t
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
+
+/* type to use in place of socklen_t if not defined */
+#define socklen_t int
+
+/* the signed version of size_t */
+#undef ssize_t
+
+
diff --git a/lib/connect.c b/lib/connect.c
index faa5c419a..1b57e3fec 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -52,6 +52,13 @@
#include <stdlib.h> /* required for free() prototype, without it, this crashes
on macos 68K */
#endif
+#if (defined(HAVE_FIONBIO) && defined(__NOVELL_LIBC__))
+#include <sys/filio.h>
+#endif
+#if (defined(NETWARE) && defined(__NOVELL_LIBC__))
+#undef in_addr_t
+#define in_addr_t unsigned long
+#endif
#ifdef VMS
#include <in.h>
#include <inet.h>
diff --git a/lib/ftp.c b/lib/ftp.c
index 758c918cc..369b61882 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -65,6 +65,11 @@
#include <errno.h>
#endif
+#if (defined(NETWARE) && defined(__NOVELL_LIBC__))
+#undef in_addr_t
+#define in_addr_t unsigned long
+#endif
+
#include <curl/curl.h>
#include "urldata.h"
#include "sendf.h"
diff --git a/lib/hostip.c b/lib/hostip.c
index 5f61579ef..1bf8fd4a3 100644
--- a/lib/hostip.c
+++ b/lib/hostip.c
@@ -60,6 +60,11 @@
#include <setjmp.h>
#endif
+#if (defined(NETWARE) && defined(__NOVELL_LIBC__))
+#undef in_addr_t
+#define in_addr_t unsigned long
+#endif
+
#include "urldata.h"
#include "sendf.h"
#include "hostip.h"
diff --git a/lib/if2ip.c b/lib/if2ip.c
index 299be75dd..63a634099 100644
--- a/lib/if2ip.c
+++ b/lib/if2ip.c
@@ -32,7 +32,7 @@
#endif
#if !defined(WIN32) && !defined(__BEOS__) && !defined(__CYGWIN32__) && \
- !defined(__riscos__) && !defined(__INTERIX)
+ !defined(__riscos__) && !defined(__INTERIX) && !defined(NETWARE)
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
@@ -125,5 +125,8 @@ char *Curl_if2ip(char *interface, char *buf, int buf_size)
/* -- end of if2ip() -- */
#else
-#define if2ip(x) NULL
+char *Curl_if2ip(char *interface, char *buf, int buf_size)
+{
+ return NULL;
+}
#endif
diff --git a/lib/libcurl.imp b/lib/libcurl.imp
new file mode 100644
index 000000000..50ce90a0b
--- /dev/null
+++ b/lib/libcurl.imp
@@ -0,0 +1,44 @@
+#
+# Definition file for the NLM version of the LIBCURL library from curl
+#
+# (LIBCURL)
+ curl_easy_cleanup,
+ curl_easy_getinfo,
+ curl_easy_init,
+ curl_easy_perform,
+ curl_easy_setopt,
+ curl_escape,
+ curl_unescape,
+ curl_formparse,
+ curl_formfree,
+ curl_getdate,
+ curl_getenv,
+ curl_global_cleanup,
+ curl_global_init,
+ curl_slist_append,
+ curl_slist_free_all,
+ curl_version,
+ curl_maprintf,
+ curl_mfprintf,
+ curl_mprintf,
+ curl_msprintf,
+ curl_msnprintf,
+ curl_mvfprintf,
+ curl_strequal,
+ curl_strnequal,
+ curl_easy_duphandle,
+ curl_formadd,
+ curl_multi_init,
+ curl_multi_add_handle,
+ curl_multi_remove_handle,
+ curl_multi_fdset,
+ curl_multi_perform,
+ curl_multi_cleanup,
+ curl_multi_info_read,
+ curl_free,
+ curl_version_info,
+ curl_share_init,
+ curl_share_setopt,
+ curl_share_cleanup
+
+
diff --git a/lib/nwlib.c b/lib/nwlib.c
new file mode 100644
index 000000000..410a6311b
--- /dev/null
+++ b/lib/nwlib.c
@@ -0,0 +1,329 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ * $Id$
+ ***************************************************************************/
+
+/* This file is only used in the NetWare build */
+
+#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
+#include <library.h>
+#include <netware.h>
+#include <screen.h>
+#include <nks/thread.h>
+#include <nks/synch.h>
+
+
+typedef struct
+{
+ int _errno;
+ void *twentybytes;
+} libthreaddata_t;
+
+typedef struct
+{
+ int x;
+ int y;
+ int z;
+ void *tenbytes;
+ NXKey_t perthreadkey; // if -1, no key obtained...
+ NXMutex_t *lock;
+} libdata_t;
+
+int gLibId = -1;
+void *gLibHandle = (void *) NULL;
+rtag_t gAllocTag = (rtag_t) NULL;
+NXMutex_t *gLibLock = (NXMutex_t *) NULL;
+
+
+
+// internal library function prototypes...
+int DisposeLibraryData ( void * );
+void DisposeThreadData ( void * );
+int GetOrSetUpData ( int id, libdata_t **data, libthreaddata_t **threaddata );
+
+
+int _NonAppStart
+(
+ void *NLMHandle,
+ void *errorScreen,
+ const char *cmdLine,
+ const char *loadDirPath,
+ size_t uninitializedDataLength,
+ void *NLMFileHandle,
+ int (*readRoutineP)( int conn, void *fileHandle, size_t offset,
+ size_t nbytes, size_t *bytesRead, void *buffer ),
+ size_t customDataOffset,
+ size_t customDataSize,
+ int messageCount,
+ const char **messages
+)
+{
+ NX_LOCK_INFO_ALLOC(liblock, "Per-Application Data Lock", 0);
+
+#ifndef __GNUC__
+#pragma unused(cmdLine)
+#pragma unused(loadDirPath)
+#pragma unused(uninitializedDataLength)
+#pragma unused(NLMFileHandle)
+#pragma unused(readRoutineP)
+#pragma unused(customDataOffset)
+#pragma unused(customDataSize)
+#pragma unused(messageCount)
+#pragma unused(messages)
+#endif
+
+/*
+** Here we process our command line, post errors (to the error screen),
+** perform initializations and anything else we need to do before being able
+** to accept calls into us. If we succeed, we return non-zero and the NetWare
+** Loader will leave us up, otherwise we fail to load and get dumped.
+*/
+ gAllocTag = AllocateResourceTag(NLMHandle,
+ "<library-name> memory allocations", AllocSignature);
+
+ if (!gAllocTag)
+ {
+ OutputToScreen(errorScreen, "Unable to allocate resource tag for "
+ "library memory allocations.\n");
+ return -1;
+ }
+
+ gLibId = register_library(DisposeLibraryData);
+
+ if (gLibId < -1)
+ {
+ OutputToScreen(errorScreen, "Unable to register library with kernel.\n");
+ return -1;
+ }
+
+ gLibHandle = NLMHandle;
+
+ gLibLock = NXMutexAlloc(0, 0, &liblock);
+
+ if (!gLibLock)
+ {
+ OutputToScreen(errorScreen, "Unable to allocate library data lock.\n");
+ return -1;
+ }
+
+ return 0;
+}
+
+void _NonAppStop( void )
+{
+/*
+** Here we clean up any resources we allocated. Resource tags is a big part
+** of what we created, but NetWare doesn't ask us to free those.
+*/
+ (void) unregister_library(gLibId);
+ NXMutexFree(gLibLock);
+}
+
+int _NonAppCheckUnload( void )
+{
+/*
+** This function cannot be the first in the file for if the file is linked
+** first, then the check-unload function's offset will be nlmname.nlm+0
+** which is how to tell that there isn't one. When the check function is
+** first in the linked objects, it is ambiguous. For this reason, we will
+** put it inside this file after the stop function.
+**
+** Here we check to see if it's alright to ourselves to be unloaded. If not,
+** we return a non-zero value. Right now, there isn't any reason not to allow
+** it.
+*/
+ return 0;
+}
+
+int GetOrSetUpData
+(
+ int id,
+ libdata_t **appData,
+ libthreaddata_t **threadData
+)
+{
+ int err;
+ libdata_t *app_data;
+ libthreaddata_t *thread_data;
+ NXKey_t key;
+// NXMutex_t *lock;
+ NX_LOCK_INFO_ALLOC(liblock, "Application Data Lock", 0);
+
+ err = 0;
+ thread_data = (libthreaddata_t *) NULL;
+
+/*
+** Attempt to get our data for the application calling us. This is where we
+** store whatever application-specific information we need to carry in support
+** of calling applications.
+*/
+ app_data = (libdata_t *) get_app_data(id);
+
+ if (!app_data)
+ {
+/*
+** This application hasn't called us before; set up application AND per-thread
+** data. Of course, just in case a thread from this same application is calling
+** us simultaneously, we better lock our application data-creation mutex. We
+** also need to recheck for data after we acquire the lock because WE might be
+** that other thread that was too late to create the data and the first thread
+** in will have created it.
+*/
+ NXLock(gLibLock);
+
+ if (!(app_data = (libdata_t *) get_app_data(id)))
+ {
+ app_data = (libdata_t *) malloc(sizeof(libdata_t));
+
+ if (app_data)
+ {
+ memset(app_data, 0, sizeof(libdata_t));
+
+ app_data->tenbytes = malloc(10);
+ app_data->lock = NXMutexAlloc(0, 0, &liblock);
+
+ if (!app_data->tenbytes || !app_data->lock)
+ {
+ if (app_data->lock)
+ NXMutexFree(app_data->lock);
+
+ free(app_data);
+ app_data = (libdata_t *) NULL;
+ err = ENOMEM;
+ }
+
+ if (app_data)
+ {
+/*
+** Here we burn in the application data that we were trying to get by calling
+** get_app_data(). Next time we call the first function, we'll get this data
+** we're just now setting. We also go on here to establish the per-thread data
+** for the calling thread, something we'll have to do on each application
+** thread the first time it calls us.
+*/
+ err = set_app_data(gLibId, app_data);
+
+ if (err)
+ {
+ free(app_data);
+ app_data = (libdata_t *) NULL;
+ err = ENOMEM;
+ }
+ else
+ {
+ // create key for thread-specific data...
+ err = NXKeyCreate(DisposeThreadData, (void *) NULL, &key);
+
+ if (err) // (no more keys left?)
+ key = -1;
+
+ app_data->perthreadkey = key;
+ }
+ }
+ }
+ }
+
+ NXUnlock(gLibLock);
+ }
+
+ if (app_data)
+ {
+ key = app_data->perthreadkey;
+
+ if ( key != -1 // couldn't create a key? no thread data
+ && !(err = NXKeyGetValue(key, (void **) &thread_data))
+ && !thread_data)
+ {
+/*
+** Allocate the per-thread data for the calling thread. Regardless of whether
+** there was already application data or not, this may be the first call by a
+** a new thread. The fact that we allocation 20 bytes on a pointer is not very
+** important, this just helps to demonstrate that we can have arbitrarily
+** complex per-thread data.
+*/
+ thread_data = (libthreaddata_t *) malloc(sizeof(libthreaddata_t));
+
+ if (thread_data)
+ {
+ thread_data->_errno = 0;
+ thread_data->twentybytes = malloc(20);
+
+ if (!thread_data->twentybytes)
+ {
+ free(thread_data);
+ thread_data = (libthreaddata_t *) NULL;
+ err = ENOMEM;
+ }
+
+ if ((err = NXKeySetValue(key, thread_data)))
+ {
+ free(thread_data->twentybytes);
+ free(thread_data);
+ thread_data = (libthreaddata_t *) NULL;
+ }
+ }
+ }
+ }
+
+ if (appData)
+ *appData = app_data;
+
+ if (threadData)
+ *threadData = thread_data;
+
+ return err;
+}
+
+int DisposeLibraryData
+(
+ void *data
+)
+{
+ if (data)
+ {
+ void *tenbytes = ((libdata_t *) data)->tenbytes;
+
+ if (tenbytes)
+ free(tenbytes);
+
+ free(data);
+ }
+
+ return 0;
+}
+
+void DisposeThreadData
+(
+ void *data
+)
+{
+ if (data)
+ {
+ void *twentybytes = ((libthreaddata_t *) data)->twentybytes;
+
+ if (twentybytes)
+ free(twentybytes);
+
+ free(data);
+ }
+}
diff --git a/lib/setup.h b/lib/setup.h
index a8b44134c..2aeb16f49 100644
--- a/lib/setup.h
+++ b/lib/setup.h
@@ -50,6 +50,10 @@
/* hand-modified VMS config.h! */
#include "config-vms.h"
#endif
+#ifdef NETWARE
+/* hand-modified NetWare config.h! */
+#include "config-netware.h"
+#endif
#ifdef macintosh
/* hand-modified MacOS config.h! */
#include "config-mac.h"
@@ -290,4 +294,8 @@ typedef struct in_addr Curl_ipconnect;
#endif
#endif
+#ifdef NETWARE
+#undef HAVE_ALARM
+#endif
+
#endif /* __CONFIG_H */