summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2024-07-10 08:04:09 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2024-07-10 08:04:09 +0000
commitb17d851c8dadfdac212448bd7aa689ad23cf7145 (patch)
tree9ccbccf98aed193afd4fb1e6a9a981bc8fd9ebaa /lib
parent42f2a1707f15aaa349761220bdc11270ab4cc4fe (diff)
Update to libX11 1.8.9 part 3: unifdef legacy systems
Diffstat (limited to 'lib')
-rw-r--r--lib/libX11/modules/lc/def/lcDefConv.c2
-rw-r--r--lib/libX11/modules/lc/gen/lcGenConv.c2
-rw-r--r--lib/libX11/src/CrGlCur.c35
-rw-r--r--lib/libX11/src/GetDflt.c11
-rw-r--r--lib/libX11/src/ImUtil.c4
-rw-r--r--lib/libX11/src/PutImage.c4
-rw-r--r--lib/libX11/src/RdBitF.c3
-rw-r--r--lib/libX11/src/SetLocale.c47
-rw-r--r--lib/libX11/src/WMProps.c8
-rw-r--r--lib/libX11/src/WrBitF.c3
-rw-r--r--lib/libX11/src/XlibInt.c17
-rw-r--r--lib/libX11/src/Xrm.c17
-rw-r--r--lib/libX11/src/xcms/cmsColNm.c3
-rw-r--r--lib/libX11/src/xcms/cmsTrig.c4
-rw-r--r--lib/libX11/src/xkb/XKB.c4
-rw-r--r--lib/libX11/src/xkb/XKBCvt.c8
-rw-r--r--lib/libX11/src/xlibi18n/XlcDL.c58
-rw-r--r--lib/libX11/src/xlibi18n/lcDB.c13
-rw-r--r--lib/libX11/src/xlibi18n/lcFile.c68
19 files changed, 23 insertions, 288 deletions
diff --git a/lib/libX11/modules/lc/def/lcDefConv.c b/lib/libX11/modules/lc/def/lcDefConv.c
index 51ad2f8e7..cf68344c3 100644
--- a/lib/libX11/modules/lc/def/lcDefConv.c
+++ b/lib/libX11/modules/lc/def/lcDefConv.c
@@ -44,7 +44,7 @@
#define MB_LEN_MAX 6
#endif
-#if !defined(Lynx_22) && !defined(X_LOCALE)
+#ifndef X_LOCALE
#define STDCVT
#endif
diff --git a/lib/libX11/modules/lc/gen/lcGenConv.c b/lib/libX11/modules/lc/gen/lcGenConv.c
index dff4269c9..e1a13a286 100644
--- a/lib/libX11/modules/lc/gen/lcGenConv.c
+++ b/lib/libX11/modules/lc/gen/lcGenConv.c
@@ -53,7 +53,7 @@
#include "XlcGeneric.h"
#include <stdio.h>
-#if !defined(Lynx_22) && !defined(X_LOCALE)
+#ifndef X_LOCALE
#define STDCVT
#endif
diff --git a/lib/libX11/src/CrGlCur.c b/lib/libX11/src/CrGlCur.c
index 460660f81..88133b7f4 100644
--- a/lib/libX11/src/CrGlCur.c
+++ b/lib/libX11/src/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/lib/libX11/src/GetDflt.c b/lib/libX11/src/GetDflt.c
index c9222a2a5..f50238fed 100644
--- a/lib/libX11/src/GetDflt.c
+++ b/lib/libX11/src/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/lib/libX11/src/ImUtil.c b/lib/libX11/src/ImUtil.c
index fbfad33ed..bedcd0954 100644
--- a/lib/libX11/src/ImUtil.c
+++ b/lib/libX11/src/ImUtil.c
@@ -239,10 +239,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/lib/libX11/src/PutImage.c b/lib/libX11/src/PutImage.c
index ba411e364..40a10a50e 100644
--- a/lib/libX11/src/PutImage.c
+++ b/lib/libX11/src/PutImage.c
@@ -41,10 +41,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/lib/libX11/src/RdBitF.c b/lib/libX11/src/RdBitF.c
index 621304083..e5a8592e0 100644
--- a/lib/libX11/src/RdBitF.c
+++ b/lib/libX11/src/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/lib/libX11/src/SetLocale.c b/lib/libX11/src/SetLocale.c
index 81f4a7c35..409019b98 100644
--- a/lib/libX11/src/SetLocale.c
+++ b/lib/libX11/src/SetLocale.c
@@ -99,43 +99,20 @@ _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
+#if defined(CSRG_BASED) || defined(sun) || defined(SVR4) || defined(WIN32) || defined(linux)
+# if defined(WIN32)
+# define SKIPCOUNT 1
+# define STARTCHAR '='
+# define ENDCHAR ';'
+# define WHITEFILL
# else
-# ifdef ultrix
-# define SKIPCOUNT 2
-# define STARTCHAR '\001'
-# define ENDCHAR '\001'
+# if defined(linux)
+# define STARTSTR "LC_CTYPE="
+# define ENDCHAR ';'
# else
-# if defined(WIN32) || defined(__UNIXOS2__)
-# 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 ';'
-# else
-# if !defined(sun) || defined(SVR4)
-# define STARTCHAR '/'
-# define ENDCHAR '/'
-# endif
-# endif
-# endif
+# if !defined(sun) || defined(SVR4)
+# define STARTCHAR '/'
+# define ENDCHAR '/'
# endif
# endif
# endif
diff --git a/lib/libX11/src/WMProps.c b/lib/libX11/src/WMProps.c
index b99d35f23..a408e4a9b 100644
--- a/lib/libX11/src/WMProps.c
+++ b/lib/libX11/src/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/lib/libX11/src/WrBitF.c b/lib/libX11/src/WrBitF.c
index 0d4fb654d..fe5d2661d 100644
--- a/lib/libX11/src/WrBitF.c
+++ b/lib/libX11/src/WrBitF.c
@@ -106,9 +106,6 @@ XWriteBitmapFile(
else
name++;
-#ifdef __UNIXOS2__
- filename = (char*)__XOS2RedirRoot(filename);
-#endif
if (!(stream = fopen(filename, "w")))
return(BitmapOpenFailed);
diff --git a/lib/libX11/src/XlibInt.c b/lib/libX11/src/XlibInt.c
index 297b77119..a4a69b4e2 100644
--- a/lib/libX11/src/XlibInt.c
+++ b/lib/libX11/src/XlibInt.c
@@ -98,19 +98,10 @@ xthread_t (*_Xthread_self_fn)(void) = NULL;
#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
-#ifdef __UNIXOS2__
-#include <limits.h>
-#define MAX_PATH _POSIX_PATH_MAX
-#endif
/*
* The following routines are internal routines used by Xlib for protocol
@@ -1706,7 +1697,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
@@ -1857,10 +1848,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);
@@ -1873,7 +1860,6 @@ static int AccessFile (path, pathbuf, len_pathbuf, pathret)
return 1;
}
-#ifndef __UNIXOS2__
/* one last place to look */
drive = getenv ("HOMEDRIVE");
if (drive) {
@@ -1908,7 +1894,6 @@ static int AccessFile (path, pathbuf, len_pathbuf, pathret)
}
}
}
-#endif
return 0;
}
diff --git a/lib/libX11/src/Xrm.c b/lib/libX11/src/Xrm.c
index a8ebf8832..ae098009a 100644
--- a/lib/libX11/src/Xrm.c
+++ b/lib/libX11/src/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__)
+#ifdef WIN32
EOL, /* treat CR the same as LF, just in case */
#else
0,
@@ -1575,9 +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
@@ -1609,18 +1606,6 @@ ReadInFile(_Xconst char *filename)
return (char *)NULL;
}
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/lib/libX11/src/xcms/cmsColNm.c b/lib/libX11/src/xcms/cmsColNm.c
index eb26b9b03..805821811 100644
--- a/lib/libX11/src/xcms/cmsColNm.c
+++ b/lib/libX11/src/xcms/cmsColNm.c
@@ -734,9 +734,6 @@ LoadColornameDB(void)
if ((pathname = getenv("XCMSDB")) == NULL) {
pathname = XCMSDB;
}
-#ifdef __UNIXOS2__
- pathname = __XOS2RedirRoot(pathname);
-#endif
length = (int)strlen(pathname);
if ((length == 0) || (length >= (BUFSIZ - 5))){
diff --git a/lib/libX11/src/xcms/cmsTrig.c b/lib/libX11/src/xcms/cmsTrig.c
index ebb92be5b..b23033aa8 100644
--- a/lib/libX11/src/xcms/cmsTrig.c
+++ b/lib/libX11/src/xcms/cmsTrig.c
@@ -71,11 +71,7 @@ _XcmsModuloF(
#define XCMS_SIXTHPI 0.523598775598298820
#define XCMS_RADIANS(d) ((d) * XCMS_PI / 180.0)
#define XCMS_DEGREES(r) ((r) * 180.0 / XCMS_PI)
-#ifdef __vax__
-#define XCMS_X6_UNDERFLOWS (3.784659e-07) /* X**6 almost underflows*/
-#else
#define XCMS_X6_UNDERFLOWS (4.209340e-52) /* X**6 almost underflows */
-#endif
#define XCMS_X16_UNDERFLOWS (5.421010e-20) /* X**16 almost underflows*/
#define XCMS_CHAR_BIT 8
#define XCMS_LONG_MAX 0x7FFFFFFF
diff --git a/lib/libX11/src/xkb/XKB.c b/lib/libX11/src/xkb/XKB.c
index 4df82b24c..0f5c7a31c 100644
--- a/lib/libX11/src/xkb/XKB.c
+++ b/lib/libX11/src/xkb/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/lib/libX11/src/xkb/XKBCvt.c b/lib/libX11/src/xkb/XKBCvt.c
index 8cef2f729..457368f20 100644
--- a/lib/libX11/src/xkb/XKBCvt.c
+++ b/lib/libX11/src/xkb/XKBCvt.c
@@ -50,10 +50,6 @@ from The Open Group.
#include <ctype.h>
#include <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)
{
@@ -276,11 +272,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/lib/libX11/src/xlibi18n/XlcDL.c b/lib/libX11/src/xlibi18n/XlcDL.c
index c1abe79fb..351f2ee76 100644
--- a/lib/libX11/src/xlibi18n/XlcDL.c
+++ b/lib/libX11/src/xlibi18n/XlcDL.c
@@ -37,7 +37,7 @@ Sun Microsystems, Inc. or its licensors is granted.
*/
/*
- * Copyright 2000 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, Oracle and/or its affiliates.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -63,19 +63,11 @@ 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>
-#ifdef HAVE_DL_H
-#include <dl.h>
-#endif
-
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#endif
@@ -107,11 +99,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
@@ -157,7 +145,6 @@ strdup_with_underscore(const char *symbol)
return result;
}
-#ifndef hpux
static void *
try_both_dlsym (void *handle, char *name)
{
@@ -175,7 +162,6 @@ try_both_dlsym (void *handle, char *name)
}
return ret;
}
-#endif
static void
resolve_object(char *path, const char *lc_name)
@@ -303,11 +289,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)
@@ -324,31 +306,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;
}
@@ -359,11 +321,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;
}
}
@@ -468,10 +426,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;
@@ -516,10 +470,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;
@@ -572,10 +522,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/lib/libX11/src/xlibi18n/lcDB.c b/lib/libX11/src/xlibi18n/lcDB.c
index 8b02b67ef..848a97387 100644
--- a/lib/libX11/src/xlibi18n/lcDB.c
+++ b/lib/libX11/src/xlibi18n/lcDB.c
@@ -345,15 +345,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.
@@ -1289,11 +1280,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/lib/libX11/src/xlibi18n/lcFile.c b/lib/libX11/src/xlibi18n/lcFile.c
index 2af750f77..b6cf93f26 100644
--- a/lib/libX11/src/xlibi18n/lcFile.c
+++ b/lib/libX11/src/xlibi18n/lcFile.c
@@ -46,11 +46,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,41 +88,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)
-
+#ifdef WIN32
/* this is parse_line but skips drive letters at the beginning of the entry */
static int
parse_line1(
@@ -159,8 +121,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 +135,7 @@ _XlcParsePath(
char *p = path;
int n, i;
-#if !defined(__UNIXOS2__) && !defined(WIN32)
+#ifndef WIN32
n = parse_line(path, argv, argsize);
#else
n = parse_line1(path, argv, argsize);
@@ -234,7 +195,7 @@ xlocaledir(
*
* Note: this only protects setuid-root clients. It doesn't
* protect other setuid or any setgid clients. If this tradeoff
- * isn't acceptable, set DisableXLocaleDirEnv to YES in host.def.
+ * isn't acceptable, run configure with --disable-xlocaledir .
*/
unsigned int oldeuid;
oldeuid = geteuid();
@@ -265,11 +226,7 @@ xlocaledir(
#endif /* NO_XLOCALEDIR */
if (len < buf_len)
-#ifndef __UNIXOS2__
strncpy(p, XLOCALEDIR, (size_t) (buf_len - len));
-#else
- strncpy(p,__XOS2RedirRoot(XLOCALEDIR), buf_len - len);
-#endif
buf[buf_len-1] = '\0';
}
@@ -312,7 +269,7 @@ xlocalelibdir(
*
* Note: this only protects setuid-root clients. It doesn't
* protect other setuid or any setgid clients. If this tradeoff
- * isn't acceptable, set DisableXLocaleDirEnv to YES in host.def.
+ * isn't acceptable, run configure with --disable-xlocaledir .
*/
unsigned int oldeuid;
oldeuid = geteuid();
@@ -343,11 +300,7 @@ xlocalelibdir(
#endif /* NO_XLOCALEDIR */
if (len < buf_len)
-#ifndef __UNIXOS2__
strncpy(p, XLOCALELIBDIR, (size_t) (buf_len - len));
-#else
- strncpy(p,__XOS2RedirRoot(XLOCALELIBDIR), (size_t) (buf_len - len));
-#endif
buf[buf_len-1] = '\0';
}
@@ -374,17 +327,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;
}