diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-02-11 14:56:22 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-02-11 14:56:22 -0800 |
commit | 225a4bbbbd174e26cc408640e10f3c37f81f3a3f (patch) | |
tree | dc8fc9f4b581a22e7c95a84c3fcf2fda0a2f0656 | |
parent | 0df284b450933e0239d1a85a7ff2d0c9d44d22af (diff) |
unifdef __UNIXOS2__
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | include/X11/Xlib.h | 4 | ||||
-rw-r--r-- | include/X11/Xlibint.h | 6 | ||||
-rw-r--r-- | src/CrGlCur.c | 4 | ||||
-rw-r--r-- | src/GetDflt.c | 11 | ||||
-rw-r--r-- | src/RdBitF.c | 3 | ||||
-rw-r--r-- | src/SetLocale.c | 4 | ||||
-rw-r--r-- | src/WMProps.c | 8 | ||||
-rw-r--r-- | src/WrBitF.c | 3 | ||||
-rw-r--r-- | src/XlibInt.c | 15 | ||||
-rw-r--r-- | src/Xrm.c | 17 | ||||
-rw-r--r-- | src/xcms/cmsColNm.c | 3 | ||||
-rw-r--r-- | src/xkb/XKBCvt.c | 4 | ||||
-rw-r--r-- | src/xlibi18n/lcDB.c | 13 | ||||
-rw-r--r-- | src/xlibi18n/lcFile.c | 94 |
14 files changed, 4 insertions, 185 deletions
diff --git a/include/X11/Xlib.h b/include/X11/Xlib.h index 29ea5715..4952e9e0 100644 --- a/include/X11/Xlib.h +++ b/include/X11/Xlib.h @@ -50,13 +50,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/include/X11/Xlibint.h b/include/X11/Xlibint.h index 50099b43..22705936 100644 --- a/include/X11/Xlibint.h +++ b/include/X11/Xlibint.h @@ -1327,12 +1327,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/src/CrGlCur.c b/src/CrGlCur.c index 460660f8..11c04709 100644 --- a/src/CrGlCur.c +++ b/src/CrGlCur.c @@ -31,10 +31,6 @@ 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) diff --git a/src/GetDflt.c b/src/GetDflt.c index c9222a2a..f50238fe 100644 --- a/src/GetDflt.c +++ b/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/src/RdBitF.c b/src/RdBitF.c index 62130408..e5a8592e 100644 --- a/src/RdBitF.c +++ b/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/src/SetLocale.c b/src/SetLocale.c index f590761d..e98eb17d 100644 --- a/src/SetLocale.c +++ b/src/SetLocale.c @@ -99,7 +99,7 @@ _XlcMapOSLocaleName( char *osname, char *siname) { -#if defined(hpux) || defined(CSRG_BASED) || defined(sun) || defined(SVR4) || defined(sgi) || defined(WIN32) || defined(__UNIXOS2__) || defined(linux) +#if defined(hpux) || defined(CSRG_BASED) || defined(sun) || defined(SVR4) || defined(sgi) || defined(WIN32) || defined(linux) # ifdef hpux # ifndef _LastCategory /* HPUX 9 and earlier */ @@ -111,7 +111,7 @@ _XlcMapOSLocaleName( # define ENDCHAR ' ' # endif # else -# if defined(WIN32) || defined(__UNIXOS2__) +# if defined(WIN32) # define SKIPCOUNT 1 # define STARTCHAR '=' # define ENDCHAR ';' diff --git a/src/WMProps.c b/src/WMProps.c index b99d35f2..a408e4a9 100644 --- a/src/WMProps.c +++ b/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/src/WrBitF.c b/src/WrBitF.c index 0d4fb654..fe5d2661 100644 --- a/src/WrBitF.c +++ b/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/src/XlibInt.c b/src/XlibInt.c index b303b652..f603ce62 100644 --- a/src/XlibInt.c +++ b/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 @@ -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; } @@ -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/src/xcms/cmsColNm.c b/src/xcms/cmsColNm.c index eb26b9b0..80582181 100644 --- a/src/xcms/cmsColNm.c +++ b/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/src/xkb/XKBCvt.c b/src/xkb/XKBCvt.c index 8cef2f72..5e483ef4 100644 --- a/src/xkb/XKBCvt.c +++ b/src/xkb/XKBCvt.c @@ -276,11 +276,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/src/xlibi18n/lcDB.c b/src/xlibi18n/lcDB.c index 8b02b67e..848a9738 100644 --- a/src/xlibi18n/lcDB.c +++ b/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/src/xlibi18n/lcFile.c b/src/xlibi18n/lcFile.c index f9cf69b7..4e2b3212 100644 --- a/src/xlibi18n/lcFile.c +++ b/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,75 +88,6 @@ 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) - -/* this is parse_line but skips drive letters at the beginning of the entry */ -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; - if (isalpha(*p) && p[1] == ':') { - p+= 2; /* skip drive letters */ - } - while (*p != ':' && *p != '\n' && *p != '\0') { - ++p; - } - if (*p == '\0') { - break; - } - *p++ = '\0'; - } - - return argc; -} - -#endif /* __UNIXOS2__ */ /* Splits a colon separated list of directories, and returns the constituent paths (without trailing slash). At most argsize constituents are stored @@ -174,7 +101,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); @@ -265,11 +192,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'; } @@ -343,11 +266,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 +293,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; } |