]> granicus.if.org Git - curl/commitdiff
minor patches to enable building for NetWare CLIB.
authorGunter Knauf <gk@gknw.de>
Sat, 30 Jun 2007 20:08:13 +0000 (20:08 +0000)
committerGunter Knauf <gk@gknw.de>
Sat, 30 Jun 2007 20:08:13 +0000 (20:08 +0000)
sent by Dmitry Mityugov.

lib/connect.c
lib/hostip.h
lib/hostip4.c
lib/inet_ntop.c
lib/timeval.c
src/curlutil.c
src/getpass.c
src/main.c

index 0aeaf7959f7e36453a0a040e49e3a0d4d5bac34e..8fbdd8661e07185e5c329d6ffe7a4a77f0d59d6b 100644 (file)
 #include <stdlib.h> /* required for free() prototype, without it, this crashes */
 #endif              /* on macos 68K */
 
-#if (defined(HAVE_FIONBIO) && defined(__NOVELL_LIBC__))
+#if (defined(HAVE_FIONBIO) && defined(NETWARE))
 #include <sys/filio.h>
 #endif
-#if (defined(NETWARE) && defined(__NOVELL_LIBC__))
+#ifdef NETWARE
+#ifndef __NOVELL_LIBC__
+NETDB_DEFINE_CONTEXT
+#endif
 #undef in_addr_t
 #define in_addr_t unsigned long
 #endif
index e6d63ca7105d74c510e5506d906f25e7e5e3bbdd..199c666bd91cc423613cbe83e488a79d41ed679c 100644 (file)
@@ -26,9 +26,9 @@
 #include "setup.h"
 #include "hash.h"
 
-#if (defined(NETWARE) && defined(__NOVELL_LIBC__))
+#ifdef NETWARE
 #undef in_addr_t
-#define in_addr_t uint32_t
+#define in_addr_t unsigned long
 #endif
 
 /*
index d092d271853935ea1e29fd272f07e5446784e9cc..43b7c69618c224abca3f91e39c301c043d6988df 100644 (file)
@@ -284,7 +284,12 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
      * which the gethostbyname() is the preferred() function.
      */
   else {
+#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
+    NETDB_DEFINE_CONTEXT
+    h = gethostbyname((char*)hostname);
+#else
     h = gethostbyname(hostname);
+#endif
     if (!h)
       infof(conn->data, "gethostbyname(2) failed for %s\n", hostname);
 #endif /*HAVE_GETHOSTBYNAME_R */
index a05689adbf996de8d31e53fc2fd59897f2ed4c19..e81cb5c55d6581456a9c75da2fd280382f2937b7 100644 (file)
 
 #include "inet_ntop.h"
 
+#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
+NETINET_DEFINE_CONTEXT
+#endif
+
 #if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL)
 /* this platform has a inet_ntoa_r() function, but no proto declared anywhere
    so we include our own proto to make compilers happy */
index bb9c0a174d9e73179a2401d19ba7f21ac3ae8d9f..a2e9665bbc381d8a0e41ff1536964a038b8f73a0 100644 (file)
@@ -68,6 +68,9 @@ static int gettimeofday(struct timeval *tp, void *nothing)
 }
 #else /* WIN32 */
 /* non-win32 version of Curl_gettimeofday() */
+#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
+#include <sys/timeval.h>
+#endif
 static int gettimeofday(struct timeval *tp, void *nothing)
 {
   (void)nothing; /* we don't support specific time-zones */
index 0394d80e2b68de444948a3867c26b0441e4bb928..2bb3f8e79fd55338f802ec92e9902db9217b92f3 100644 (file)
@@ -70,6 +70,9 @@ static int gettimeofday(struct timeval *tp, void *nothing)
 }
 #else /* WIN32 */
 /* non-win32 version of Curl_gettimeofday() */
+#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
+#include <sys/timeval.h>
+#endif
 static int gettimeofday(struct timeval *tp, void *nothing)
 {
   (void)nothing; /* we don't support specific time-zones */
index 93b061f2d01f4450e4d02f2f8c82c189bb1f9498..244b29b9e81c896942d5adb0f9a6cd58c94c4496 100644 (file)
@@ -126,11 +126,31 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
 
 #ifdef NETWARE
 /* NetWare implementation */
+#ifdef __NOVELL_LIBC__
 #include <screen.h>
 char *getpass_r(const char *prompt, char *buffer, size_t buflen)
 {
   return getpassword(prompt, buffer, buflen);
 }
+#else
+#include <nwconio.h>
+char *getpass_r(const char *prompt, char *buffer, size_t buflen)
+{
+  int i = 0;
+  int c;
+
+  printf("%s", prompt);
+  do {
+    c = getch();
+    if (c != 13) {
+      buffer[i] = c;
+      i++;
+      printf("%s", "*");
+    }
+  } while ((c != 13) && (i < buflen));
+  return buffer;
+}
+#endif /* __NOVELL_LIBC__ */
 #define DONE
 #endif /* NETWARE */
 
index 71616212654b4987a1adc12da731b53048ff40ad..1869ce16e771faec9e3d9f5977b528abe5a41a35 100644 (file)
 
 #define CURLseparator   "--_curl_--"
 
+#ifdef NETWARE
 #ifdef __NOVELL_LIBC__
 #include <screen.h>
+#else
+#include <nwconio.h>
+#define mkdir mkdir_510
+#endif
 #endif
 
 #include "version.h"
@@ -731,7 +736,7 @@ static void help(void)
   };
   for(i=0; helptext[i]; i++) {
     puts(helptext[i]);
-#ifdef __NOVELL_LIBC__
+#ifdef NETWARE
     if (i && ((i % 23) == 0))
       pressanykey();
 #endif