summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbnicholes <bnicholes@13f79535-47bb-0310-9956-ffa450edef68>2002-02-08 19:14:30 +0000
committerbnicholes <bnicholes@13f79535-47bb-0310-9956-ffa450edef68>2002-02-08 19:14:30 +0000
commit2f608dbc599f91d93ee2c45ef76376db2e832268 (patch)
tree96e94fe967187b6a9e32ad2bcba1e701eee24f99
parent2528d2f833a159a4263f526c5ff4a7201bc38ae6 (diff)
downloadlibapr-2f608dbc599f91d93ee2c45ef76376db2e832268.tar.gz
Getting ready for some API name changes in the NetWare libraries
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62932 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--file_io/netware/pipe.c17
-rw-r--r--include/apr.hnw4
-rw-r--r--include/arch/netware/apr_private.h3
-rw-r--r--include/arch/netware/internal_time.h5
-rw-r--r--misc/netware/aprlib.def3
-rw-r--r--misc/netware/rand.c9
6 files changed, 39 insertions, 2 deletions
diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c
index bb86788ab..f69b88aea 100644
--- a/file_io/netware/pipe.c
+++ b/file_io/netware/pipe.c
@@ -54,6 +54,7 @@
#include <stdio.h>
#include <nks/fsio.h>
+#include <nks/errno.h>
#include "fileio.h"
#include "apr_strings.h"
@@ -92,9 +93,18 @@ apr_status_t apr_netware_pipe_cleanup(void *thefile)
return rv;
}
+#ifdef WAITING_FOR_UPDATE
+#ifndef NX_CTL_FLAGS
+#define NX_CTL_FLAGS 0x00000001
+int NXGetCtlInfo(NXHandle_t handle, unsigned long command, ...);
+int NXSetCtlInfo(NXHandle_t handle, unsigned long command, ...);
+#endif
+#endif
+
static apr_status_t pipeblock(apr_file_t *thepipe)
{
int err;
+#ifdef WAITING_FOR_UPDATE
unsigned long flags;
if (!(err = NXGetCtlInfo(thepipe->filedes, NX_CTL_FLAGS, &flags)))
@@ -102,6 +112,9 @@ static apr_status_t pipeblock(apr_file_t *thepipe)
flags &= ~NX_O_NONBLOCK;
err = NXSetCtlInfo(thepipe->filedes, NX_CTL_FLAGS, flags);
}
+#else
+ err = NXIoSetBlockingState(thepipe->filedes, 1);
+#endif
if (err)
return convert_error (err);
@@ -113,6 +126,7 @@ static apr_status_t pipeblock(apr_file_t *thepipe)
static apr_status_t pipenonblock(apr_file_t *thepipe)
{
int err;
+#ifdef WAITING_FOR_UPDATE
unsigned long flags;
if (!(err = NXGetCtlInfo(thepipe->filedes, NX_CTL_FLAGS, &flags)))
@@ -120,6 +134,9 @@ static apr_status_t pipenonblock(apr_file_t *thepipe)
flags |= NX_O_NONBLOCK;
err = NXSetCtlInfo(thepipe->filedes, NX_CTL_FLAGS, flags);
}
+#else
+ err = NXIoSetBlockingState(thepipe->filedes, 0);
+#endif
if (err)
return convert_error (err);
diff --git a/include/apr.hnw b/include/apr.hnw
index e36acfdf1..882cf0c32 100644
--- a/include/apr.hnw
+++ b/include/apr.hnw
@@ -223,8 +223,8 @@ typedef unsigned short apr_uint16_t;
typedef int apr_int32_t;
typedef unsigned int apr_uint32_t;
-typedef INT64 apr_int64_t;
-typedef unsigned INT64 apr_uint64_t;
+typedef long long apr_int64_t;
+typedef unsigned long long apr_uint64_t;
typedef size_t apr_size_t;
typedef ssize_t apr_ssize_t;
diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h
index d3b6dca01..66483d312 100644
--- a/include/arch/netware/apr_private.h
+++ b/include/arch/netware/apr_private.h
@@ -174,5 +174,8 @@ int unregister_NLM(void *NLMHandle);
#undef malloc
#define malloc(x) library_malloc(gLibHandle,x)
+/* Changes that are waiting for an updated runtime library. */
+#define WAITING_FOR_UPDATE
+
#endif /*APR_PRIVATE_H*/
#endif /*NETWARE*/
diff --git a/include/arch/netware/internal_time.h b/include/arch/netware/internal_time.h
index d4e13f4d7..9f1ea7398 100644
--- a/include/arch/netware/internal_time.h
+++ b/include/arch/netware/internal_time.h
@@ -57,6 +57,11 @@
#include "apr.h"
+#ifdef WAITING_FOR_UPDATE
+#undef timezone
+# define timezone (*___timezone())
+#endif
+
void apr_netware_setup_time(void);
#endif /* TIME_INTERNAL_H */
diff --git a/misc/netware/aprlib.def b/misc/netware/aprlib.def
index 0a2a01eb8..ed42c9350 100644
--- a/misc/netware/aprlib.def
+++ b/misc/netware/aprlib.def
@@ -1,3 +1,6 @@
MODULE LIBC.NLM
MODULE WS2_32.NLM
+IMPORT NXGetRandom
+IMPORT NXGetCtlInfo
+IMPORT NXSetCtlInfo
EXPORT @aprlib.imp
diff --git a/misc/netware/rand.c b/misc/netware/rand.c
index 01329d114..7c4544c24 100644
--- a/misc/netware/rand.c
+++ b/misc/netware/rand.c
@@ -55,15 +55,24 @@
#define APR_WANT_MEMFUNC
#include "apr_want.h"
#include "apr_general.h"
+#include "apr_private.h"
#if APR_HAS_RANDOM
#include <nks/plat.h>
+#ifdef WAITING_FOR_UPDATE
+int NXGetRandom( size_t width, void *result );
+#endif
+
APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf,
int length)
{
+#ifdef WAITING_FOR_UPDATE
return NXGetRandom(length, buf);
+#else
+ return NXSeedRandom(length, buf);
+#endif
}
#endif /* APR_HAS_RANDOM */