This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #90632] perlfunc: Rewrite `split'
[perl5.git] / NetWare / nw5sck.c
index 5a9ce47..35dee92 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * Copyright © 2001 Novell, Inc. All Rights Reserved.
+ * Copyright Â© 2001 Novell, Inc. All Rights Reserved.
  *
  * You may distribute under the terms of either the GNU General Public
  * License or the Artistic License, as specified in the README file.
 #include "EXTERN.h"
 #include "perl.h"
 
-#if defined(PERL_OBJECT)
-#define NO_XSLOCKS
-#include "XSUB.h"
-#endif
-
 #include "nw5iop.h"
 #include "nw5sck.h"
 #include <fcntl.h>
 #include <sys/stat.h>
 
+// This is defined here since  arpa\inet.h  defines this array as an extern,
+// and  arpa\inet.h  gets included by the  inet_ntoa  call.
+char nwinet_scratch[18] = {'\0'};
+
+
 u_long
 nw_htonl(u_long hostlong)
 {
@@ -185,25 +185,33 @@ nw_getservent(void)
 void
 nw_sethostent(int stayopen)
 {
+#ifdef HAS_SETHOSTENT
        sethostent(stayopen);
+#endif
 }
 
 void
 nw_setnetent(int stayopen)
 {
+#ifdef HAS_SETNETENT
        setnetent(stayopen);
+#endif
 }
 
 void
 nw_setprotoent(int stayopen)
 {
+#ifdef HAS_SETPROTENT
        setprotoent(stayopen);
+#endif
 }
 
 void
 nw_setservent(int stayopen)
 {
+#ifdef HAS_SETSERVENT
        setservent(stayopen);
+#endif
 }
 
 int
@@ -230,6 +238,12 @@ nw_inet_addr(const char *cp)
     return inet_addr((char*)cp);
 }
 
+char *
+nw_inet_ntoa(struct in_addr in)
+{
+    return inet_ntoa(in);
+}
+
 SOCKET
 nw_socket(int af, int type, int protocol)
 {