aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/X11
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/lib/X11')
-rw-r--r--nx-X11/lib/X11/AuGetBest.c35
-rw-r--r--nx-X11/lib/X11/ConnDis.c4
-rw-r--r--nx-X11/lib/X11/CrGlCur.c35
-rw-r--r--nx-X11/lib/X11/GetDflt.c11
-rw-r--r--nx-X11/lib/X11/ImUtil.c4
-rw-r--r--nx-X11/lib/X11/Imakefile16
-rw-r--r--nx-X11/lib/X11/PutImage.c4
-rw-r--r--nx-X11/lib/X11/RdBitF.c3
-rw-r--r--nx-X11/lib/X11/SetLocale.c24
-rw-r--r--nx-X11/lib/X11/UIThrStubs.c2
-rw-r--r--nx-X11/lib/X11/WMProps.c8
-rw-r--r--nx-X11/lib/X11/WrBitF.c3
-rw-r--r--nx-X11/lib/X11/XKB.c4
-rw-r--r--nx-X11/lib/X11/XKBCvt.c8
-rw-r--r--nx-X11/lib/X11/Xaixlcint.h53
-rw-r--r--nx-X11/lib/X11/XlcDL.c52
-rw-r--r--nx-X11/lib/X11/Xlib.h4
-rw-r--r--nx-X11/lib/X11/XlibInt.c21
-rw-r--r--nx-X11/lib/X11/Xlibint.h9
-rw-r--r--nx-X11/lib/X11/Xrm.c17
-rw-r--r--nx-X11/lib/X11/cmsColNm.c3
-rw-r--r--nx-X11/lib/X11/lcDB.c13
-rw-r--r--nx-X11/lib/X11/lcDefConv.c2
-rw-r--r--nx-X11/lib/X11/lcFile.c65
-rw-r--r--nx-X11/lib/X11/lcGenConv.c2
-rw-r--r--nx-X11/lib/X11/os2Stubs.c428
26 files changed, 16 insertions, 814 deletions
diff --git a/nx-X11/lib/X11/AuGetBest.c b/nx-X11/lib/X11/AuGetBest.c
index fce9ddead..2518805cc 100644
--- a/nx-X11/lib/X11/AuGetBest.c
+++ b/nx-X11/lib/X11/AuGetBest.c
@@ -33,11 +33,6 @@ in this Software without prior written authorization from The Open Group.
#ifdef XTHREADS
#include <nx-X11/Xthreads.h>
#endif
-#ifdef hpux
-#define X_INCLUDE_NETDB_H
-#define XOS_USE_NO_LOCKING
-#include <nx-X11/Xos_r.h>
-#endif
static int
binaryEqual (_Xconst char *a, _Xconst char *b, int len)
@@ -74,10 +69,6 @@ XauGetBestAuthByAddr (
Xauth *best;
int best_type;
int type;
-#ifdef hpux
- char *fully_qual_address;
- unsigned short fully_qual_address_length;
-#endif
auth_name = XauFileName ();
if (!auth_name)
@@ -88,26 +79,6 @@ XauGetBestAuthByAddr (
if (!auth_file)
return 0;
-#ifdef hpux
- if (family == FamilyLocal) {
-#ifdef XTHREADS_NEEDS_BYNAMEPARAMS
- _Xgethostbynameparams hparams;
-#endif
- struct hostent *hostp;
-
- /* make sure we try fully-qualified hostname */
- if ((hostp = _XGethostbyname(address,hparams)) != NULL) {
- fully_qual_address = hostp->h_name;
- fully_qual_address_length = strlen(fully_qual_address);
- }
- else
- {
- fully_qual_address = NULL;
- fully_qual_address_length = 0;
- }
- }
-#endif /* hpux */
-
best = 0;
best_type = types_length;
for (;;) {
@@ -131,12 +102,6 @@ XauGetBestAuthByAddr (
(entry->family == family &&
((address_length == entry->address_length &&
binaryEqual (entry->address, address, (int)address_length))
-#ifdef hpux
- || (family == FamilyLocal &&
- fully_qual_address_length == entry->address_length &&
- binaryEqual (entry->address, fully_qual_address,
- (int) fully_qual_address_length))
-#endif
))) &&
(number_length == 0 || entry->number_length == 0 ||
(number_length == entry->number_length &&
diff --git a/nx-X11/lib/X11/ConnDis.c b/nx-X11/lib/X11/ConnDis.c
index 660b67645..dfc0227fe 100644
--- a/nx-X11/lib/X11/ConnDis.c
+++ b/nx-X11/lib/X11/ConnDis.c
@@ -67,12 +67,8 @@ in this Software without prior written authorization from The Open Group.
#include <unistd.h>
#if !defined(WIN32)
-#ifndef Lynx
#include <sys/socket.h>
#else
-#include <socket.h>
-#endif
-#else
#include <nx-X11/Xwindows.h>
#endif
diff --git a/nx-X11/lib/X11/CrGlCur.c b/nx-X11/lib/X11/CrGlCur.c
index 460660f81..88133b7f4 100644
--- a/nx-X11/lib/X11/CrGlCur.c
+++ b/nx-X11/lib/X11/CrGlCur.c
@@ -31,28 +31,16 @@ in this Software without prior written authorization from The Open Group.
#ifdef USE_DYNAMIC_XCURSOR
-#ifdef __UNIXOS2__
-#define RTLD_LAZY 1
-#define LIBXCURSOR "Xcursor.dll"
-#endif
#include <stdio.h>
#include <string.h>
-#if defined(hpux)
-#include <dl.h>
-#else
#include <dlfcn.h>
-#endif
#include "Cr.h"
#ifdef __CYGWIN__
#define LIBXCURSOR "cygXcursor-1.dll"
#endif
-#if defined(hpux)
-typedef shl_t XModuleType;
-#else
typedef void *XModuleType;
-#endif
#ifndef LIBXCURSOR
#define LIBXCURSOR "libXcursor.so.1"
@@ -68,11 +56,7 @@ open_library (void)
XModuleType module;
for (;;)
{
-#if defined(hpux)
- module = shl_load(library, BIND_DEFERRED, 0L);
-#else
module = dlopen(library, RTLD_LAZY);
-#endif
if (module)
return module;
dot = strrchr (library, '.');
@@ -88,28 +72,9 @@ fetch_symbol (XModuleType module, const char *under_symbol)
{
void *result = NULL;
const char *symbol = under_symbol + 1;
-#if defined(hpux)
- int getsyms_cnt, i;
- struct shl_symbol *symbols;
-
- getsyms_cnt = shl_getsymbols(module, TYPE_PROCEDURE,
- EXPORT_SYMBOLS, malloc, &symbols);
-
- for(i=0; i<getsyms_cnt; i++) {
- if(!strcmp(symbols[i].name, symbol)) {
- result = symbols[i].value;
- break;
- }
- }
-
- if(getsyms_cnt > 0) {
- free(symbols);
- }
-#else
result = dlsym (module, symbol);
if (!result)
result = dlsym (module, under_symbol);
-#endif
return result;
}
diff --git a/nx-X11/lib/X11/GetDflt.c b/nx-X11/lib/X11/GetDflt.c
index f2098dff3..c2cc1da47 100644
--- a/nx-X11/lib/X11/GetDflt.c
+++ b/nx-X11/lib/X11/GetDflt.c
@@ -184,10 +184,6 @@ XGetDefault(
#ifdef WIN32
char *progname2;
#endif
-#ifdef __UNIXOS2__
- char *progname2;
- char *dotpos;
-#endif
/*
* strip path off of program name (XXX - this is OS specific)
@@ -198,13 +194,6 @@ XGetDefault(
if (progname2 && (!progname || progname < progname2))
progname = progname2;
#endif
-#ifdef __UNIXOS2__ /* Very similar to WIN32 */
- progname2 = strrchr (prog, '\\');
- if (progname2 && (!progname || progname < progname2))
- progname = progname2;
- dotpos = strrchr (prog, '.');
- if (dotpos && (dotpos>progname2)) *dotpos='\0';
-#endif /* We take out the .exe suffix */
if (progname)
progname++;
diff --git a/nx-X11/lib/X11/ImUtil.c b/nx-X11/lib/X11/ImUtil.c
index b0d421680..79ba80ecc 100644
--- a/nx-X11/lib/X11/ImUtil.c
+++ b/nx-X11/lib/X11/ImUtil.c
@@ -238,10 +238,6 @@ static void _putbits(
*
*/
-#if defined(Lynx) && defined(ROUNDUP)
-#undef ROUNDUP
-#endif
-
#define ROUNDUP(nbytes, pad) ((((nbytes) + ((pad)-1)) / (pad)) * ((pad)>>3))
#define XYNORMALIZE(bp, img) \
diff --git a/nx-X11/lib/X11/Imakefile b/nx-X11/lib/X11/Imakefile
index b3fc07adf..061f2e33e 100644
--- a/nx-X11/lib/X11/Imakefile
+++ b/nx-X11/lib/X11/Imakefile
@@ -806,7 +806,7 @@ SRCS3 = \
LockDis.c \
x11_trans.c \
xim_trans.c \
- $(XKBSRCS) $(LCSRCS) $(MISCSRCS)
+ $(XKBSRCS) $(LCSRCS)
OBJS3 = \
Lab.o \
@@ -889,7 +889,7 @@ OBJS3 = \
LockDis.o \
x11_trans.o \
xim_trans.o \
- $(XKBOBJS) $(LCOBJS) $(MISCOBJS)
+ $(XKBOBJS) $(LCOBJS)
SHAREDLCDEPSYMSRCS = XlcDL.c XlcSL.c
@@ -1036,14 +1036,6 @@ SHAREDLCOBJS = \
$(SHAREDLCDEPOBJS) \
$(SHAREDI18NSTATICOBJS)
-#ifdef OS2Architecture
-MISCSRCS = os2Stubs.c
-#endif
-
-#ifdef OS2Architecture
-MISCOBJS = os2Stubs.o
-#endif
-
OBJS = $(OBJS1) $(OBJS2) $(OBJS3)
EXTRAUNSHAREDOBJS = $(STATICLCOBJS)
@@ -1086,10 +1078,6 @@ InstallNonExecFile(Xcms.txt,$(LIBDIR))
InstallNonExecFile(XErrorDB,$(LIBDIR))
InstallLintLibrary(X11,$(LINTLIBDIR))
-#ifdef QNX4Architecture
-LOCAL_LDFLAGS=-F
-#endif
-
MAKEKEYS = ./makekeys
KEYSYMDEFS = $(XINCLUDESRC)/keysymdef.h $(XINCLUDESRC)/XF86keysym.h $(XINCLUDESRC)/Sunkeysym.h $(XINCLUDESRC)/DECkeysym.h $(XINCLUDESRC)/HPkeysym.h
diff --git a/nx-X11/lib/X11/PutImage.c b/nx-X11/lib/X11/PutImage.c
index de085bcde..daf172cf0 100644
--- a/nx-X11/lib/X11/PutImage.c
+++ b/nx-X11/lib/X11/PutImage.c
@@ -39,10 +39,6 @@ in this Software without prior written authorization from The Open Group.
#define RConst const
#endif
-#if defined(Lynx) && defined(ROUNDUP)
-#undef ROUNDUP
-#endif
-
/* assumes pad is a power of 2 */
#define ROUNDUP(nbytes, pad) (((nbytes) + ((pad) - 1)) & ~(long)((pad) - 1))
diff --git a/nx-X11/lib/X11/RdBitF.c b/nx-X11/lib/X11/RdBitF.c
index c2316ae0c..319a0ee0b 100644
--- a/nx-X11/lib/X11/RdBitF.c
+++ b/nx-X11/lib/X11/RdBitF.c
@@ -129,9 +129,6 @@ XReadBitmapFileData (
int hx = -1; /* x hotspot */
int hy = -1; /* y hotspot */
-#ifdef __UNIXOS2__
- filename = __XOS2RedirRoot(filename);
-#endif
if (!(fstream = fopen(filename, "r")))
return BitmapOpenFailed;
diff --git a/nx-X11/lib/X11/SetLocale.c b/nx-X11/lib/X11/SetLocale.c
index f4d2aca21..3bbfd3ee6 100644
--- a/nx-X11/lib/X11/SetLocale.c
+++ b/nx-X11/lib/X11/SetLocale.c
@@ -99,33 +99,21 @@ _XlcMapOSLocaleName(
char *osname,
char *siname)
{
-#if defined(hpux) || defined(CSRG_BASED) || defined(sun) || defined(SVR4) || defined(sgi) || defined(__osf__) || defined(AIXV3) || defined(ultrix) || defined(WIN32) || defined(__UNIXOS2__) || defined(linux)
-# ifdef hpux
-# ifndef _LastCategory
- /* HPUX 9 and earlier */
-# define SKIPCOUNT 2
-# define STARTCHAR ':'
-# define ENDCHAR ';'
-# else
- /* HPUX 10 */
-# define ENDCHAR ' '
-# endif
-# else
+
+/* FIXME: correct indentation levels after ancient platform clean-up */
+
+#if defined(CSRG_BASED) || defined(sun) || defined(SVR4) || defined(ultrix) || defined(WIN32) || defined(linux)
# ifdef ultrix
# define SKIPCOUNT 2
# define STARTCHAR '\001'
# define ENDCHAR '\001'
# else
-# if defined(WIN32) || defined(__UNIXOS2__)
+# if defined(WIN32)
# define SKIPCOUNT 1
# define STARTCHAR '='
# define ENDCHAR ';'
# define WHITEFILL
# else
-# if defined(__osf__) || (defined(AIXV3) && !defined(AIXV4))
-# define STARTCHAR ' '
-# define ENDCHAR ' '
-# else
# if defined(linux)
# define STARTSTR "LC_CTYPE="
# define ENDCHAR ';'
@@ -135,10 +123,8 @@ _XlcMapOSLocaleName(
# define ENDCHAR '/'
# endif
# endif
-# endif
# endif
# endif
-# endif
char *start;
char *end;
diff --git a/nx-X11/lib/X11/UIThrStubs.c b/nx-X11/lib/X11/UIThrStubs.c
index 8f4ea076b..0c913d41f 100644
--- a/nx-X11/lib/X11/UIThrStubs.c
+++ b/nx-X11/lib/X11/UIThrStubs.c
@@ -66,7 +66,7 @@ typedef cthread_t xthread_t;
#pragma weak condition_signal = _Xthr_zero_stub_
#pragma weak condition_broadcast = _Xthr_zero_stub_
#else /* !CTHREADS */
-#if defined(SVR4) && !defined(__sgi)
+#if defined(SVR4)
#include <thread.h>
typedef thread_t xthread_t;
#pragma weak thr_self = _Xthr_self_stub_
diff --git a/nx-X11/lib/X11/WMProps.c b/nx-X11/lib/X11/WMProps.c
index 249072936..e77f7ba56 100644
--- a/nx-X11/lib/X11/WMProps.c
+++ b/nx-X11/lib/X11/WMProps.c
@@ -122,14 +122,6 @@ void XSetWMProperties (
* systems will have to change this.
*/
char *cp = strrchr (argv[0], '/');
-#ifdef __UNIXOS2__
- char *os2_cp = strrchr (argv[0],'\\');
- char *dot_cp = strrchr (argv[0],'.');
- if (os2_cp && (os2_cp > cp)) {
- if(dot_cp && (dot_cp > os2_cp)) *dot_cp = '\0';
- cp=os2_cp;
- }
-#endif
tmp.res_name = (cp ? cp + 1 : argv[0]);
}
tmp.res_class = classHints->res_class;
diff --git a/nx-X11/lib/X11/WrBitF.c b/nx-X11/lib/X11/WrBitF.c
index 0b27d5adf..47b47208f 100644
--- a/nx-X11/lib/X11/WrBitF.c
+++ b/nx-X11/lib/X11/WrBitF.c
@@ -105,9 +105,6 @@ XWriteBitmapFile(
else
name++;
-#ifdef __UNIXOS2__
- filename = (char*)__XOS2RedirRoot(filename);
-#endif
if (!(stream = fopen(filename, "w")))
return(BitmapOpenFailed);
diff --git a/nx-X11/lib/X11/XKB.c b/nx-X11/lib/X11/XKB.c
index 7ecd39706..6df9c3ebc 100644
--- a/nx-X11/lib/X11/XKB.c
+++ b/nx-X11/lib/X11/XKB.c
@@ -373,11 +373,7 @@ XkbGetXlibControls(Display *dpy)
unsigned int
XkbXlibControlsImplemented(void)
{
-#ifdef __sgi
- return XkbLC_AllControls;
-#else
return XkbLC_AllControls & ~XkbLC_AllComposeControls;
-#endif
}
Bool
diff --git a/nx-X11/lib/X11/XKBCvt.c b/nx-X11/lib/X11/XKBCvt.c
index f4df3fcfc..c42c3af1c 100644
--- a/nx-X11/lib/X11/XKBCvt.c
+++ b/nx-X11/lib/X11/XKBCvt.c
@@ -50,10 +50,6 @@ from The Open Group.
#include <ctype.h>
#include <nx-X11/Xos.h>
-#ifdef __sgi_not_xconsortium
-#define XKB_EXTEND_LOOKUP_STRING
-#endif
-
static int
_XkbHandleSpecialSym(KeySym keysym, char *buffer, int nbytes, int *extra_rtrn)
{
@@ -279,11 +275,7 @@ _XkbGetCharset(void)
else {
struct stat sbuf;
FILE *file;
-#ifndef __UNIXOS2__
char *cf = CHARSET_FILE;
-#else
- char *cf = __XOS2RedirRoot(CHARSET_FILE);
-#endif
#ifndef S_ISREG
# define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
diff --git a/nx-X11/lib/X11/Xaixlcint.h b/nx-X11/lib/X11/Xaixlcint.h
deleted file mode 100644
index 446ba2581..000000000
--- a/nx-X11/lib/X11/Xaixlcint.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- *
- * Copyright IBM Corporation 1993
- *
- * All Rights Reserved
- *
- * License to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS, AND
- * NONINFRINGEMENT OF THIRD PARTY RIGHTS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-/************************************************************************/
-/* Xaixlcint.h */
-/*----------------------------------------------------------------------*/
-/* This file contains Xlcint.h extension for AIX. */
-/************************************************************************/
-#ifndef _Xaixlcint_h
-#define _Xaixlcint_h
-
-#include "Xlcint.h"
-#include <sys/lc_core.h>
-
-#define _LC_LDX 11
-#define _LC_LDX_R6 (_LC_LDX+1)
-#define _LC_VERSION_R5 5
-#define _LC_VERSION_R6 6
-
-typedef struct _LC_core_ldx_t {
- _LC_object_t lc_object_header;
- XLCd (*default_loader)();
- Bool sticky;
-} _XlcCoreObjRec, *_XlcCoreObj;
-
-#if _LC_VERSION < 0x40000000
-#define __type_id type_id
-#define __magic magic
-#define __version version
-#endif
-
-#endif /*_Xaixlcint_h*/
diff --git a/nx-X11/lib/X11/XlcDL.c b/nx-X11/lib/X11/XlcDL.c
index bc71900a0..032bcf51c 100644
--- a/nx-X11/lib/X11/XlcDL.c
+++ b/nx-X11/lib/X11/XlcDL.c
@@ -63,11 +63,7 @@ Sun Microsystems, Inc. or its licensors is granted.
#ifdef HAVE_CONFIG_H
# include <config.h>
#else
-# if defined(hpux)
-# define HAVE_DL_H
-# else
-# define HAVE_DLFCN_H
-# endif
+# define HAVE_DLFCN_H
#endif
#include <stdio.h>
@@ -106,11 +102,7 @@ typedef struct {
char *im_unregister;
int dl_release;
unsigned int refcount;
-#if defined(hpux)
- shl_t dl_module;
-#else
void *dl_module;
-#endif
} XI18NObjectsListRec, *XI18NObjectsList;
#define OBJECT_INIT_LEN 8
@@ -156,7 +148,6 @@ strdup_with_underscore(const char *symbol)
return result;
}
-#ifndef hpux
static void *
try_both_dlsym (void *handle, char *name)
{
@@ -174,7 +165,6 @@ try_both_dlsym (void *handle, char *name)
}
return ret;
}
-#endif
static void
resolve_object(char *path, const char *lc_name)
@@ -301,11 +291,7 @@ open_object(
path = __lc_path(object->dl_name, lc_dir);
if (!path)
return False;
-#if defined(hpux)
- object->dl_module = shl_load(path, BIND_DEFERRED, 0L);
-#else
object->dl_module = dlopen(path, RTLD_LAZY);
-#endif
Xfree(path);
if (!object->dl_module)
@@ -322,31 +308,11 @@ fetch_symbol(
char *symbol)
{
void *result = NULL;
-#if defined(hpux)
- int getsyms_cnt, i;
- struct shl_symbol *symbols;
-#endif
if (symbol == NULL)
return NULL;
-#if defined(hpux)
- getsyms_cnt = shl_getsymbols(object->dl_module, TYPE_PROCEDURE,
- EXPORT_SYMBOLS, malloc, &symbols);
-
- for(i=0; i<getsyms_cnt; i++) {
- if(!strcmp(symbols[i].name, symbol)) {
- result = symbols[i].value;
- break;
- }
- }
-
- if(getsyms_cnt > 0) {
- free(symbols);
- }
-#else
result = try_both_dlsym(object->dl_module, symbol);
-#endif
return result;
}
@@ -357,11 +323,7 @@ close_object(XI18NObjectsList object)
object->refcount--;
if (object->refcount == 0)
{
-#if defined(hpux)
- shl_unload(object->dl_module);
-#else
dlclose(object->dl_module);
-#endif
object->dl_module = NULL;
}
}
@@ -466,10 +428,6 @@ _XDynamicRegisterIMInstantiateCallback(
Bool ret_flag = False;
int count;
XI18NObjectsList objects_list = xi18n_objects_list;
-#if defined(hpux)
- int getsyms_cnt, i;
- struct shl_symbol *symbols;
-#endif
lc_name = lcd->core->name;
@@ -514,10 +472,6 @@ _XDynamicUnRegisterIMInstantiateCallback(
Bool ret_flag = False;
int count;
XI18NObjectsList objects_list = xi18n_objects_list;
-#if defined(hpux)
- int getsyms_cnt, i;
- struct shl_symbol *symbols;
-#endif
lc_name = lcd->core->name;
if (_XlcLocaleDirName(lc_dir, BUFSIZE, lc_name) == NULL) return False;
@@ -570,10 +524,6 @@ _XDynamicOpenOM(XLCd lcd, Display *display, XrmDatabase rdb,
char *lc_name;
dynamicIOpenProcp om_openOM = (dynamicIOpenProcp)NULL;
XI18NObjectsList objects_list = xi18n_objects_list;
-#if defined(hpux)
- int getsyms_cnt, i;
- struct shl_symbol *symbols;
-#endif
lc_name = lcd->core->name;
diff --git a/nx-X11/lib/X11/Xlib.h b/nx-X11/lib/X11/Xlib.h
index 1ac1ef181..b68a09f2b 100644
--- a/nx-X11/lib/X11/Xlib.h
+++ b/nx-X11/lib/X11/Xlib.h
@@ -51,13 +51,9 @@ in this Software without prior written authorization from The Open Group.
#ifndef X_WCHAR
#include <stddef.h>
#else
-#ifdef __UNIXOS2__
-#include <stdlib.h>
-#else
/* replace this with #include or typedef appropriate for your system */
typedef unsigned long wchar_t;
#endif
-#endif
extern int
diff --git a/nx-X11/lib/X11/XlibInt.c b/nx-X11/lib/X11/XlibInt.c
index 42b928fd5..912c52989 100644
--- a/nx-X11/lib/X11/XlibInt.c
+++ b/nx-X11/lib/X11/XlibInt.c
@@ -169,14 +169,9 @@ extern int _X11TransSocketCongestionChange(XtransConnInfo, int *);
#define ECHECK(err) (WSAGetLastError() == err)
#define ESET(val) WSASetLastError(val)
#else
-#ifdef __UNIXOS2__
-#define ECHECK(err) (errno == err)
-#define ESET(val)
-#else
#define ECHECK(err) (errno == err)
#define ESET(val) errno = val
#endif
-#endif
#if defined(LOCALCONN) || defined(LACHMAN)
#ifdef EMSGSIZE
@@ -190,14 +185,6 @@ extern int _X11TransSocketCongestionChange(XtransConnInfo, int *);
#endif
#endif
-#ifdef __UNIXOS2__
-#if !USE_XCB
-#define select(n,r,w,x,t) os2ClientSelect(n,r,w,x,t)
-#endif /* !USE_XCB */
-#include <limits.h>
-#define MAX_PATH _POSIX_PATH_MAX
-#endif
-
#if !USE_XCB
#define STARTITERATE(tpvar,type,start,endcond) \
@@ -3904,7 +3891,7 @@ _XData32(
* and so, you may be better off using gethostname (if it exists).
*/
-#if (defined(_POSIX_SOURCE) && !defined(AIXV3) && !defined(__QNX__)) || defined(hpux) || defined(SVR4)
+#if defined(_POSIX_SOURCE) || defined(SVR4)
#define NEED_UTSNAME
#include <sys/utsname.h>
#else
@@ -4054,10 +4041,6 @@ static int AccessFile (path, pathbuf, len_pathbuf, pathret)
/* try the places set in the environment */
drive = getenv ("_XBASEDRIVE");
-#ifdef __UNIXOS2__
- if (!drive)
- drive = getenv ("X11ROOT");
-#endif
if (!drive)
drive = "C:";
len = strlen (drive) + strlen (path);
@@ -4070,7 +4053,6 @@ static int AccessFile (path, pathbuf, len_pathbuf, pathret)
return 1;
}
-#ifndef __UNIXOS2__
/* one last place to look */
drive = getenv ("HOMEDRIVE");
if (drive) {
@@ -4105,7 +4087,6 @@ static int AccessFile (path, pathbuf, len_pathbuf, pathret)
}
}
}
-#endif
return 0;
}
diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h
index 932ed745e..b325182e3 100644
--- a/nx-X11/lib/X11/Xlibint.h
+++ b/nx-X11/lib/X11/Xlibint.h
@@ -248,9 +248,6 @@ typedef struct _XSQEvent
#endif
#include <nx-X11/Xproto.h>
-#ifdef __sgi
-#define _SGI_MP_SOURCE /* turn this on to get MP safe errno */
-#endif
#include <errno.h>
#define _XBCOPYFUNC _Xbcopy
#include <nx-X11/Xfuncs.h>
@@ -1249,12 +1246,6 @@ struct _XConnWatchInfo { /* info from XAddConnectionWatch */
struct _XConnWatchInfo *next;
};
-#ifdef __UNIXOS2__
-extern char* __XOS2RedirRoot(
- char*
-);
-#endif
-
extern int _XTextHeight(
XFontStruct* /* font_struct */,
_Xconst char* /* string */,
diff --git a/nx-X11/lib/X11/Xrm.c b/nx-X11/lib/X11/Xrm.c
index 3b90346d8..e3587d021 100644
--- a/nx-X11/lib/X11/Xrm.c
+++ b/nx-X11/lib/X11/Xrm.c
@@ -305,7 +305,7 @@ typedef unsigned char XrmBits;
static XrmBits const xrmtypes[256] = {
EOS,0,0,0,0,0,0,0,
0,SPACE,EOL,0,0,
-#if defined(WIN32) || defined(__UNIXOS2__)
+#if defined(WIN32)
EOL, /* treat CR the same as LF, just in case */
#else
0,
@@ -1575,10 +1575,6 @@ ReadInFile(_Xconst char *filename)
register int fd, size;
char * filebuf;
-#ifdef __UNIXOS2__
- filename = __XOS2RedirRoot(filename);
-#endif
-
/*
* MS-Windows and OS/2 note: Default open mode includes O_TEXT
*/
@@ -1610,17 +1606,6 @@ ReadInFile(_Xconst char *filename)
}
size = read (fd, filebuf, size);
-#ifdef __UNIXOS2__
- { /* kill CRLF */
- int i,k;
- for (i=k=0; i<size; i++)
- if (filebuf[i] != 0x0d) {
- filebuf[k++] = filebuf[i];
- }
- filebuf[k] = 0;
- }
-#endif
-
if (size < 0) {
close (fd);
Xfree(filebuf);
diff --git a/nx-X11/lib/X11/cmsColNm.c b/nx-X11/lib/X11/cmsColNm.c
index e43a829f2..c6f1e0f31 100644
--- a/nx-X11/lib/X11/cmsColNm.c
+++ b/nx-X11/lib/X11/cmsColNm.c
@@ -730,9 +730,6 @@ LoadColornameDB(void)
if ((pathname = getenv("XCMSDB")) == NULL) {
pathname = XCMSDB;
}
-#ifdef __UNIXOS2__
- pathname = __XOS2RedirRoot(pathname);
-#endif
length = strlen(pathname);
if ((length == 0) || (length >= (BUFSIZ - 5))){
diff --git a/nx-X11/lib/X11/lcDB.c b/nx-X11/lib/X11/lcDB.c
index 1111ec955..cc14bed72 100644
--- a/nx-X11/lib/X11/lcDB.c
+++ b/nx-X11/lib/X11/lcDB.c
@@ -344,15 +344,6 @@ read_line(
cur += len;
str[cur] = '\0';
-#ifdef __UNIXOS2__ /* Take out carriage returns under OS/2 */
- if (cur>1) {
- if (str[cur-2] == '\r' && str[cur-1] == '\n') {
- str[cur-2] = '\n';
- str[cur-1] = '\0';
- cur--;
- }
- }
-#endif
if (!quoted && cur > 1 && str[cur - 2] == SYM_BACKSLASH &&
(str[cur - 1] == SYM_NEWLINE || str[cur-1] == SYM_CR)) {
/* the line is ended backslash followed by newline.
@@ -1286,11 +1277,7 @@ _XlcCreateLocaleDataBase(
if (name == NULL)
return (XPointer)NULL;
-#ifndef __UNIXOS2__
name_q = XrmStringToQuark(name);
-#else
- name_q = XrmStringToQuark((char*)__XOS2RedirRoot(name));
-#endif
for (list = _db_list; list; list = list->next) {
if (name_q == list->name_q) {
list->ref_count++;
diff --git a/nx-X11/lib/X11/lcDefConv.c b/nx-X11/lib/X11/lcDefConv.c
index 51ad2f8e7..2096d871b 100644
--- a/nx-X11/lib/X11/lcDefConv.c
+++ b/nx-X11/lib/X11/lcDefConv.c
@@ -44,7 +44,7 @@
#define MB_LEN_MAX 6
#endif
-#if !defined(Lynx_22) && !defined(X_LOCALE)
+#if !defined(X_LOCALE)
#define STDCVT
#endif
diff --git a/nx-X11/lib/X11/lcFile.c b/nx-X11/lib/X11/lcFile.c
index eeb6ce312..cf03a90a7 100644
--- a/nx-X11/lib/X11/lcFile.c
+++ b/nx-X11/lib/X11/lcFile.c
@@ -36,9 +36,6 @@
/************************************************************************/
-#ifdef __UNIXOS2__
-# define seteuid setuid
-#endif
#define iscomment(ch) ((ch) == '#' || (ch) == '\0')
#if defined(WIN32)
#define isreadable(f) (_XAccessFile(f))
@@ -46,11 +43,7 @@
#define isreadable(f) ((access((f), R_OK) != -1) ? 1 : 0)
#endif
-#ifndef __UNIXOS2__
#define LC_PATHDELIM ':'
-#else
-#define LC_PATHDELIM ';'
-#endif
#define XLC_BUFSIZE 256
@@ -92,40 +85,7 @@ parse_line(
return argc;
}
-#ifdef __UNIXOS2__
-
-/* fg021216: entries in locale files are separated by colons while under
- OS/2, path entries are separated by semicolon, so we need two functions */
-
-static int
-parse_line1(
- char *line,
- char **argv,
- int argsize)
-{
- int argc = 0;
- char *p = line;
-
- while (argc < argsize) {
- while (isspace(*p)) {
- ++p;
- }
- if (*p == '\0') {
- break;
- }
- argv[argc++] = p;
- while (*p != ';' && *p != '\n' && *p != '\0') {
- ++p;
- }
- if (*p == '\0') {
- break;
- }
- *p++ = '\0';
- }
-
- return argc;
-}
-#elif defined(WIN32)
+#if defined(WIN32)
/* this is parse_line but skips drive letters at the beginning of the entry */
static int
@@ -160,7 +120,7 @@ parse_line1(
return argc;
}
-#endif /* __UNIXOS2__ */
+#endif /* WIN32 */
/* Splits a colon separated list of directories, and returns the constituent
paths (without trailing slash). At most argsize constituents are stored
@@ -174,7 +134,7 @@ _XlcParsePath(
char *p = path;
int n, i;
-#if !defined(__UNIXOS2__) && !defined(WIN32)
+#if !defined(WIN32)
n = parse_line(path, argv, argsize);
#else
n = parse_line1(path, argv, argsize);
@@ -265,11 +225,7 @@ xlocaledir(
#endif /* NO_XLOCALEDIR */
if (len < buf_len)
-#ifndef __UNIXOS2__
strncpy(p, XLOCALEDIR, buf_len - len);
-#else
- strncpy(p,__XOS2RedirRoot(XLOCALEDIR), buf_len - len);
-#endif
buf[buf_len-1] = '\0';
}
@@ -343,11 +299,7 @@ xlocalelibdir(
#endif /* NO_XLOCALEDIR */
if (len < buf_len)
-#ifndef __UNIXOS2__
strncpy(p, XLOCALELIBDIR, buf_len - len);
-#else
- strncpy(p,__XOS2RedirRoot(XLOCALELIBDIR), buf_len - len);
-#endif
buf[buf_len-1] = '\0';
}
@@ -374,17 +326,6 @@ resolve_name(
char *p = buf;
int n;
char *args[2], *from, *to;
-#ifdef __UNIXOS2__ /* Take out CR under OS/2 */
- int len;
-
- len = strlen(p);
- if (len > 1) {
- if (*(p+len-2) == '\r' && *(p+len-1) == '\n') {
- *(p+len-2) = '\n';
- *(p+len-1) = '\0';
- }
- }
-#endif
while (isspace(*p)) {
++p;
}
diff --git a/nx-X11/lib/X11/lcGenConv.c b/nx-X11/lib/X11/lcGenConv.c
index eede76807..799f49a30 100644
--- a/nx-X11/lib/X11/lcGenConv.c
+++ b/nx-X11/lib/X11/lcGenConv.c
@@ -53,7 +53,7 @@
#include "XlcGeneric.h"
#include <stdio.h>
-#if !defined(Lynx_22) && !defined(X_LOCALE)
+#if !defined(X_LOCALE)
#define STDCVT
#endif
diff --git a/nx-X11/lib/X11/os2Stubs.c b/nx-X11/lib/X11/os2Stubs.c
deleted file mode 100644
index 5ffc4824c..000000000
--- a/nx-X11/lib/X11/os2Stubs.c
+++ /dev/null
@@ -1,428 +0,0 @@
-/*
- * (c) Copyright 1996 by Sebastien Marineau and Holger Veit
- * <marineau@genie.uottawa.ca>
- * <Holger.Veit@gmd.de>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * HOLGER VEIT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Sebastien Marineau or Holger Veit
- * shall not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from Holger Veit or
- * Sebastien Marineau.
- *
- */
-
-
-/* A few OS/2 functions needed in the X11 lib. Mainly, the file path redirection
- * functions and the "optimized" select() for the clients */
-
-#define I_NEED_OS2_H
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <nx-X11/Xpoll.h>
-#include <stdio.h>
-#include <sys/errno.h>
-#define INCL_DOSSEMAPHORES
-#define INCL_DOSNPIPES
-#define INCL_DOSMISC
-#define INCL_DOSMODULEMGR
-#undef BOOL
-#undef BYTE
-#include <os2.h>
-#include <sys/select.h>
-#include <sys/time.h>
-
-char *__XOS2RedirRoot(char *fname)
-{
- /* This adds a further redirection by allowing the ProjectRoot
- * to be prepended by the content of the envvar X11ROOT.
- * This is for the purpose to move the whole X11 stuff to a different
- * disk drive.
- * The feature was added despite various environment variables
- * because not all file opens respect them.
- */
- static char redirname[300]; /* enough for long filenames */
- char *root;
-
- /* if name does not start with /, assume it is not root-based */
- if (fname==0 || !(fname[0]=='/' || fname[0]=='\\'))
- return fname;
-
- root = (char*)getenv("X11ROOT");
- if (root==0 ||
- (fname[1]==':' && isalpha(fname[0])) ||
- (strlen(fname)+strlen(root)+2) > 300)
- return fname;
- sprintf(redirname,"%s%s",root,fname);
- return redirname;
-}
-
-char *__XOS2RedirRoot1(char *format, char *arg1, char *arg2, char *arg3)
-{
- /* this first constructs a name from a format and up to three
- * components, then adds a path
- */
- char buf[300];
- sprintf(buf,format,arg1,arg2,arg3);
- return __XOS2RedirRoot(buf);
-}
-
-/* This below implements select() for the calls in this file. It has been */
-/* somewhat optimized for improved performance, but assumes a few */
-/* things so it cannot be used as a general select. If both pipes and */
-/* sockets are present, this may call the emx select */
-
-
-HEV hPipeSem;
-HMODULE hmod_so32dll;
-static int (*os2_tcp_select)(int*,int,int,int,long);
-ULONG os2_get_sys_millis();
-extern int _files[];
-
-#define MAX_TCP 256
-/* These lifted from sys/emx.h. Change if that changes there! */
-#define F_SOCKET 0x10000000
-#define F_PIPE 0x20000000
-
-struct select_data
-{
- fd_set read_copy;
- fd_set write_copy;
- BOOL have_read;
- BOOL have_write;
- int tcp_select_mask[MAX_TCP];
- int tcp_emx_handles[MAX_TCP];
- int tcp_select_copy[MAX_TCP];
- int socket_nread;
- int socket_nwrite;
- int socket_ntotal;
- int pipe_ntotal;
- int pipe_have_write;
- int max_fds;
-};
-
-int os2ClientSelect(int nfds, fd_set *readfds, fd_set *writefds,
- fd_set *exceptfds, struct timeval *timeout)
-{
-static BOOL FirstTime=TRUE;
-static haveTCPIP=TRUE;
-ULONG timeout_ms;
-ULONG postCount, start_millis,now_millis;
-char faildata[16];
-struct select_data sd;
-BOOL any_ready;
-int np,ns, i,ready_handles,n;
-APIRET rc;
-
-sd.have_read=FALSE; sd.have_write=FALSE;
-sd.socket_nread=0; sd.socket_nwrite=0; sd.socket_ntotal=0;
-sd.max_fds=31; ready_handles=0; any_ready=FALSE;
-sd.pipe_ntotal=0; sd.pipe_have_write=FALSE;
-
-if(FirstTime){
- /* First load the so32dll.dll module and get a pointer to the SELECT fn */
-
- if((rc=DosLoadModule(faildata,sizeof(faildata),"SO32DLL",&hmod_so32dll))!=0){
- fprintf(stderr, "Could not load module so32dll.dll, rc = %d. Error note %s\n",rc,faildata);
- haveTCPIP=FALSE;
- }
- if((rc = DosQueryProcAddr(hmod_so32dll, 0, "SELECT", (PPFN)&os2_tcp_select))!=0){
- fprintf(stderr, "Could not query address of SELECT, rc = %d.\n",rc);
- haveTCPIP=FALSE;
- }
- /* Call these a first time to set the semaphore */
- rc = DosCreateEventSem(NULL, &hPipeSem, DC_SEM_SHARED, FALSE);
- if(rc) {
- fprintf(stderr, "Could not create event semaphore, rc=%d\n",rc);
- return(-1);
- }
- rc = DosResetEventSem(hPipeSem, &postCount);
- FirstTime = FALSE;
-}
-
-/* Set up the time delay structs */
-
- if(timeout!=NULL) {
- timeout_ms=timeout->tv_sec*1000+timeout->tv_usec/1000;
- }
- else { timeout_ms=1000000; } /* This should be large enough... */
- if(timeout_ms>0) start_millis=os2_get_sys_millis();
-
-/* Copy the masks */
- {FD_ZERO(&sd.read_copy);}
- {FD_ZERO(&sd.write_copy);}
- if(readfds!=NULL){ XFD_COPYSET(readfds,&sd.read_copy); sd.have_read=TRUE;}
- if(writefds!=NULL) {XFD_COPYSET(writefds,&sd.write_copy);sd.have_write=TRUE;}
-
-/* And zero the original masks */
- if(sd.have_read){ FD_ZERO(readfds);}
- if(sd.have_write) {FD_ZERO(writefds);}
- if(exceptfds != NULL) {FD_ZERO(exceptfds);}
-
-/* Now we parse the fd_sets passed to select and separate pipe/sockets */
- n = os2_parse_select(&sd,nfds);
- if(n == -1) {
- errno = EBADF;
- return (-1);
- }
-
-/* Now we have three cases: either we have sockets, pipes, or both */
-/* We handle all three cases differently to optimize things */
-
-/* Case 1: only pipes! */
- if((sd.pipe_ntotal >0) && (!sd.socket_ntotal)){
- np = os2_check_pipes(&sd,readfds,writefds);
- if(np > 0){
- return (np);
- }
- else if (np == -1) { return(-1); }
- while(!any_ready){
- rc = DosWaitEventSem(hPipeSem, timeout_ms);
- if(rc == 640) {
- return(0);
- }
- if((rc != 0) && (rc != 95)) {errno= EBADF; return(-1);}
- np = os2_check_pipes(&sd,readfds,writefds);
- if (np > 0){
- return(np);
- }
- else if (np < 0){ return(-1); }
- }
- }
-
-/* Case 2: only sockets. Just let the os/2 tcp select do the work */
- if((sd.socket_ntotal > 0) && (!sd.pipe_ntotal)){
- ns = os2_check_sockets(&sd, readfds, writefds, timeout_ms);
- return (ns);
- }
-
-/* Case 3: combination of both */
- if((sd.socket_ntotal > 0) && (sd.pipe_ntotal)){
- np = os2_check_pipes(&sd,readfds,writefds);
- if(np > 0){
- any_ready=TRUE;
- ready_handles += np;
- }
- else if (np == -1) { return(-1); }
-
- ns = os2_check_sockets(&sd,readfds,writefds, 0);
- if(ns>0){
- ready_handles+=ns;
- any_ready = TRUE;
- }
- else if (ns == -1) {return(-1);}
-
- while (!any_ready && timeout_ms){
-
- rc = DosWaitEventSem(hPipeSem, 10L);
- if(rc == 0){
- np = os2_check_pipes(&sd,readfds,writefds);
- if(np > 0){
- ready_handles+=np;
- any_ready = TRUE;
- }
- else if (np == -1) {
- return(-1); }
- }
-
- ns = os2_check_sockets(&sd,readfds,writefds,exceptfds, 0);
- if(ns>0){
- ready_handles+=ns;
- any_ready = TRUE;
- }
- else if (ns == -1) {return(-1);}
-
- if (i%8 == 0) {
- now_millis = os2_get_sys_millis();
- if((now_millis-start_millis) > timeout_ms) timeout_ms = 0;
- }
- i++;
- }
- }
-
-return(ready_handles);
-}
-
-
-ULONG os2_get_sys_millis()
-{
- APIRET rc;
- ULONG milli;
-
- rc = DosQuerySysInfo(14, 14, &milli, sizeof(milli));
- if(rc) {
- fprintf(stderr,"Bad return code querying the millisecond counter! rc=%d\n",rc);
- return(0);
- }
- return(milli);
-}
-
-int os2_parse_select(sd,nfds)
-struct select_data *sd;
-int nfds;
-{
- int i;
- APIRET rc;
-/* First we determine up to which descriptor we need to check. */
-/* No need to check up to 256 if we don't have to (and usually we dont...)*/
-/* Note: stuff here is hardcoded for fd_sets which are int[8] as in EMX!!! */
-
- if(nfds > sd->max_fds){
- for(i=0;i<((FD_SETSIZE+31)/32);i++){
- if(sd->read_copy.fds_bits[i] ||
- sd->write_copy.fds_bits[i])
- sd->max_fds=(i*32) +32;
- }
- }
- else { sd->max_fds = nfds; }
-/* Check if result is greater than specified in select() call */
- if(sd->max_fds > nfds) sd->max_fds = nfds;
-
- if (sd->have_read)
- {
- for (i = 0; i < sd->max_fds; ++i) {
- if (FD_ISSET (i, &sd->read_copy)){
- if(_files[i] & F_SOCKET)
- {
- sd->tcp_select_mask[sd->socket_ntotal]=_getsockhandle(i);
- sd->tcp_emx_handles[sd->socket_ntotal]=i;
- sd->socket_ntotal++; sd->socket_nread++;
- }
- else if (_files[i] & F_PIPE)
- {
- sd -> pipe_ntotal++;
- rc = DosSetNPipeSem((HPIPE)i, (HSEM) hPipeSem, i);
- if(rc) { fprintf(stderr,"Error SETNPIPE rc = %d\n",rc); return -1;}
- }
- }
- }
- }
-
- if (sd->have_write)
- {
- for (i = 0; i < sd->max_fds; ++i) {
- if (FD_ISSET (i, &sd->write_copy)){
- if(_files[i] & F_SOCKET)
- {
- sd->tcp_select_mask[sd->socket_ntotal]=_getsockhandle(i);
- sd->tcp_emx_handles[sd->socket_ntotal]=i;
- sd->socket_ntotal++; sd->socket_nwrite++;
- }
- else if (_files[i] & F_PIPE)
- {
- sd -> pipe_ntotal++;
- rc = DosSetNPipeSem((HPIPE)i, (HSEM) hPipeSem, i);
- if(rc) { fprintf(stderr,"Error SETNPIPE rc = %d\n",rc); return -1;}
- sd -> pipe_have_write=TRUE;
- }
- }
- }
- }
-
-
-return(sd->socket_ntotal);
-}
-
-
-int os2_check_sockets(sd,readfds,writefds)
-struct select_data *sd;
-fd_set *readfds,*writefds;
-{
- int e,i;
- int j,n;
- memcpy(sd->tcp_select_copy,sd->tcp_select_mask,
- sd->socket_ntotal*sizeof(int));
-
- e = os2_tcp_select(sd->tcp_select_copy,sd->socket_nread,
- sd->socket_nwrite, 0, 0);
-
- if(e == 0) return(e);
-/* We have something ready? */
- if(e>0){
- j = 0; n = 0;
- for (i = 0; i < sd->socket_nread; ++i, ++j)
- if (sd->tcp_select_copy[j] != -1)
- {
- FD_SET (sd->tcp_emx_handles[j], readfds);
- n ++;
- }
- for (i = 0; i < sd->socket_nwrite; ++i, ++j)
- if (sd->tcp_select_copy[j] != -1)
- {
- FD_SET (sd->tcp_emx_handles[j], writefds);
- n ++;
- }
- errno = 0;
-
- return n;
- }
- if(e<0){
- /*Error -- TODO */
- fprintf(stderr,"Error in server select! e=%d\n",e);
- errno = EBADF;
- return (-1);
- }
- }
-
-/* Check to see if anything is ready on pipes */
-
-int os2_check_pipes(sd,readfds,writefds)
-struct select_data *sd;
-fd_set *readfds,*writefds;
-{
-int i,e;
-ULONG ulPostCount;
-PIPESEMSTATE pipeSemState[128];
-APIRET rc;
- e = 0;
- rc = DosResetEventSem(hPipeSem,&ulPostCount);
- rc = DosQueryNPipeSemState((HSEM) hPipeSem, (PPIPESEMSTATE)&pipeSemState,
- sizeof(pipeSemState));
- if(rc) fprintf(stderr,"SELECT: rc from QueryNPipeSem: %d\n",rc);
- i=0;
- while (pipeSemState[i].fStatus != 0) {
- /*fprintf(stderr,"SELECT: sem entry, stat=%d, flag=%d, key=%d,avail=%d\n",
- pipeSemState[i].fStatus,pipeSemState[i].fFlag,pipeSemState[i].usKey,
- pipeSemState[i].usAvail); */
- if((pipeSemState[i].fStatus == 1) &&
- (FD_ISSET(pipeSemState[i].usKey,&sd->read_copy))){
- FD_SET(pipeSemState[i].usKey,readfds);
- e++;
- }
- else if((pipeSemState[i].fStatus == 2) &&
- (FD_ISSET(pipeSemState[i].usKey,&sd->write_copy))){
- FD_SET(pipeSemState[i].usKey,writefds);
- e++;
- }
- else if( (pipeSemState[i].fStatus == 3) &&
- ( (FD_ISSET(pipeSemState[i].usKey,&sd->read_copy)) ||
- (FD_ISSET(pipeSemState[i].usKey,&sd->write_copy)) )){
- errno = EBADF;
- return (-1);
- }
- i++;
- } /* endwhile */
- /*fprintf(stderr,"Done listing pipe sem entries, total %d entries, total ready entries %d\n",i,e);*/
-errno = 0;
-return(e);
-}
-
-
-