1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

dtwm: In CDE we always build with MULTIBYTE support, disable unused singlebyte only

This commit is contained in:
Peter Howkins 2018-06-25 00:20:55 +01:00
parent 6bf175ef2d
commit 115c1a25d8
10 changed files with 4 additions and 416 deletions

View file

@ -12,7 +12,7 @@ MWMDEFINES = $(VFORK_DEFINE) -DLARGECURSORS -DR2_COMPAT -DOPAQUE -DSHAPE \
DTWMDEFINES = DTWMDEFINES =
DEPEND_DEFINES = $(DEPENDDEFINES) DEPEND_DEFINES = $(DEPENDDEFINES)
DEFINES = $(MWMDEFINES) $(DTWMDEFINES) -DMULTIBYTE DEFINES = $(MWMDEFINES) $(DTWMDEFINES)
INCLUDES = $(TIRPCINC) INCLUDES = $(TIRPCINC)
DEPLIBS = DepDtClientLibs DEPLIBS = DepDtClientLibs

View file

@ -87,10 +87,6 @@ header file include flags, and macros (e.g. ABS).
Vestigal/experimental code to reduce output to feedback window Vestigal/experimental code to reduce output to feedback window
(WmFeedback.c). (WmFeedback.c).
NO_MULTIBYTE
If defined, then code to support multibyte character sets is
removed.
NO_OL_COMPAT NO_OL_COMPAT
If defined, then code to read and interpret Open Look window If defined, then code to read and interpret Open Look window
manager hints is removed. manager hints is removed.

View file

@ -55,9 +55,7 @@
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#ifndef NO_MULTIBYTE
#include <stdlib.h> #include <stdlib.h>
#endif
#include "WmIPC.h" /* must be after DtP.h */ #include "WmIPC.h" /* must be after DtP.h */
/************************************** /**************************************
@ -191,9 +189,7 @@ ProcessBackdropResources(
static String none_string = NULL; static String none_string = NULL;
static String no_backdrop_string = NULL; static String no_backdrop_string = NULL;
Boolean bNone = False; Boolean bNone = False;
#ifndef NO_MULTIBYTE
unsigned int chlen; unsigned int chlen;
#endif /* NO_MULTIBYTE */
if (callFlags & CHANGE_BACKDROP) if (callFlags & CHANGE_BACKDROP)
{ {
@ -226,7 +222,6 @@ ProcessBackdropResources(
* Strip off leading '@', if any * Strip off leading '@', if any
*/ */
pch = (unsigned char *) pWS->backdrop.image; pch = (unsigned char *) pWS->backdrop.image;
#ifndef NO_MULTIBYTE
chlen = mblen ((char *)pch, MB_CUR_MAX); chlen = mblen ((char *)pch, MB_CUR_MAX);
if (chlen == 1 && *pch++ == '@') if (chlen == 1 && *pch++ == '@')
{ {
@ -244,19 +239,6 @@ ProcessBackdropResources(
} }
} }
} }
#else /* NO_MULTIBYTE */
if (*pch++ == '@' && *pch)
{
int il = 1+strlen ((char *)pch);
unsigned char *pchD = (unsigned char *)pWS->backdrop.image;
while (il)
{
*pchD++ = *pch++;
il--;
}
}
#endif /* NO_MULTIBYTE */
/* /*
* Use a copy of the string because our parsing routines * Use a copy of the string because our parsing routines

View file

@ -64,7 +64,6 @@ unsigned int TitleTextHeight (ClientData *pcd)
{ {
unsigned int ttextheight; unsigned int ttextheight;
#ifndef NO_MULTIBYTE
if (DECOUPLE_TITLE_APPEARANCE(pcd)) if (DECOUPLE_TITLE_APPEARANCE(pcd))
{ {
ttextheight = CLIENT_TITLE_APPEARANCE(pcd).titleHeight; ttextheight = CLIENT_TITLE_APPEARANCE(pcd).titleHeight;
@ -73,34 +72,6 @@ unsigned int TitleTextHeight (ClientData *pcd)
{ {
ttextheight = CLIENT_APPEARANCE(pcd).titleHeight; ttextheight = CLIENT_APPEARANCE(pcd).titleHeight;
} }
#else
XFontStruct *font;
if (DECOUPLE_TITLE_APPEARANCE(pcd))
{
font = CLIENT_TITLE_APPEARANCE(pcd).font;
}
else
{
font = CLIENT_APPEARANCE(pcd).font;
}
if (font)
{
ttextheight = TEXT_HEIGHT(font) + WM_TITLE_BAR_PADDING;
}
else
{
/*
* Failed to load any font! (probably due to error in
* font path, toolkit, or resource converter. Set to
* arbitrary value for robustness.
*
*/
ttextheight = 16;
}
#endif
return (ttextheight); return (ttextheight);
} }

View file

@ -891,9 +891,7 @@ typedef struct _AppearanceData
{ {
XmFontList fontList; /* resource */ XmFontList fontList; /* resource */
XFontStruct *font; XFontStruct *font;
#ifndef NO_MULTIBYTE
unsigned int titleHeight; /* title bar's height */ unsigned int titleHeight; /* title bar's height */
#endif
Boolean saveUnder; /* resource */ Boolean saveUnder; /* resource */
Pixel background; /* resource */ Pixel background; /* resource */
Pixel foreground; /* resource */ Pixel foreground; /* resource */

View file

@ -36,9 +36,7 @@
#include "WmGlobal.h" #include "WmGlobal.h"
#ifndef NO_MULTIBYTE
#include <locale.h> #include <locale.h>
#endif
#include <Dt/Message.h> #include <Dt/Message.h>
#include <Dt/EnvControlP.h> #include <Dt/EnvControlP.h>
/* /*
@ -104,7 +102,6 @@ main (int argc, char *argv [], char *environ [])
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
#ifndef NO_MULTIBYTE
/* /*
* Set up environment variables for this HP DT client * Set up environment variables for this HP DT client
*/ */
@ -119,7 +116,7 @@ main (int argc, char *argv [], char *environ [])
char * foo = ((char *)GETMESSAGE(44, 1, "")); char * foo = ((char *)GETMESSAGE(44, 1, ""));
} }
XtSetLanguageProc (NULL, (XtLanguageProc)NULL, NULL); XtSetLanguageProc (NULL, (XtLanguageProc)NULL, NULL);
#endif
/* /*
* Get Identity * Get Identity
*/ */

View file

@ -60,9 +60,7 @@
#include "WmGlobal.h" #include "WmGlobal.h"
#include "WmParse.h" #include "WmParse.h"
#include "WmParseP.h" #include "WmParseP.h"
#ifdef MULTIBYTE
#include <stdlib.h> #include <stdlib.h>
#endif /* MULTIBYTE */
#include <ctype.h> #include <ctype.h>
/* /*
@ -271,7 +269,6 @@ _DtWmParseBackUp (
if ((pchTok > pWmPB->pchLine) && if ((pchTok > pWmPB->pchLine) &&
(pchTok < (pWmPB->pchLine + pWmPB->cLineSize))) (pchTok < (pWmPB->pchLine + pWmPB->cLineSize)))
{ {
#ifdef MULTIBYTE
unsigned char *pch; unsigned char *pch;
unsigned char *pchLast; unsigned char *pchLast;
int chlen; int chlen;
@ -317,29 +314,6 @@ _DtWmParseBackUp (
} }
pWmPB->pchNext = pchLast; pWmPB->pchNext = pchLast;
#else /* MULTIBYTE */
/*
* Replace preceding NULL with a space.
*/
pchTok--;
if (*pchTok == '\0')
{
*pchTok = DTWM_CHAR_SPACE;
}
/*
* Back up to next NULL or beginning of line.
*/
while ((pchTok >= pWmPB->pchLine) && *pchTok)
{
pchTok--;
}
pWmPB->pchNext = pchTok + 1;
#endif /* MULTIBYTE */
} }
return (pWmPB->pchNext); return (pWmPB->pchNext);
} }
@ -374,13 +348,9 @@ _DtWmParseBackUp (
void _DtWmParseSkipWhitespaceC(unsigned char **linePP) void _DtWmParseSkipWhitespaceC(unsigned char **linePP)
{ {
#ifdef MULTIBYTE
while (*linePP && while (*linePP &&
(mblen ((char *)*linePP, MB_CUR_MAX) == 1) && (mblen ((char *)*linePP, MB_CUR_MAX) == 1) &&
isspace (**linePP)) isspace (**linePP))
#else
while (*linePP && isspace (**linePP))
#endif
{ {
(*linePP)++; (*linePP)++;
} }
@ -446,7 +416,6 @@ _DtWmParseNextTokenC (
unsigned char *curP; unsigned char *curP;
unsigned char *lnwsP; unsigned char *lnwsP;
unsigned int level = 0, checkLev, i, quoteLevel[MAX_QUOTE_DEPTH]; unsigned int level = 0, checkLev, i, quoteLevel[MAX_QUOTE_DEPTH];
#ifdef MULTIBYTE
int chlen; int chlen;
/* get rid of leading white space */ /* get rid of leading white space */
@ -560,90 +529,6 @@ _DtWmParseNextTokenC (
} }
} }
} }
#else /* MULTIBYTE */
/* get rid of leading white space */
ScanWhitespace (&lineP);
/* Return NULL if line is empty, whitespace, or begins with a comment. */
if ((lineP == NULL || *lineP == '\0') ||
(!SmBehavior && (*lineP == '#')))
{
*linePP = lineP;
return (NULL);
}
if (*lineP == '"')
/* Quoted string */
{
quoteLevel[level] = 1;
/*
* Start beyond double quote and find the end of the quoted string.
* '\' quotes the next character.
* Otherwise, matching double quote or NULL terminates the string.
*
* We use lnwsP to point to the last non-whitespace character in the
* quoted string. When we have found the end of the quoted string,
* increment lnwsP and if lnwsP < endP, write NULL into *lnwsP.
* This removes any trailing whitespace without overwriting the
* matching quote, needed later. If the quoted string was all
* whitespace, then this will write a NULL at the beginning of the
* string that will be returned -- OK.
*/
lnwsP = lineP++; /* lnwsP points to first '"' */
curP = endP = lineP; /* other pointers point beyond */
while ((*endP = *curP) && (*endP != '"'))
/* haven't found matching quote yet */
{
/* point curP to next character */
curP++;
if ((*endP == '\\') && (*curP != NULL))
/* shift quoted nonNULL character down and curP ahead */
{
if (SmBehavior)
{
/*
* Check to see if this is a quoted quote - if it is
* strip off a level - if not - it's sacred leave it alone
*/
checkLev = PeekAhead((curP - 1), quoteLevel[level]);
if(checkLev > 0)
{
if(quoteLevel[level] >= checkLev)
{
if (level > 0) level--;
}
else if (level < MAX_QUOTE_DEPTH)
{
level++;
quoteLevel[level] = checkLev;
}
for(i = 0;i < (checkLev - 2);i++)
{
*endP++ = *curP++;curP++;
}
*endP = *curP++;
}
}
else
{
*endP = *curP++;
}
}
if (isspace (*endP))
/* whitespace character: leave lnwsP unchanged. */
{
endP++;
}
else
/* non-whitespace character: point lnwsP to it. */
{
lnwsP = endP++;
}
}
#endif /* MULTIBYTE */
/* /*
* Found matching quote or NULL. * Found matching quote or NULL.
@ -667,7 +552,6 @@ _DtWmParseNextTokenC (
*/ */
curP = endP = lineP; curP = endP = lineP;
#ifdef MULTIBYTE
while ((*endP = *curP) && while ((*endP = *curP) &&
((chlen = mblen ((char *)curP, MB_CUR_MAX)) > 0) && ((chlen = mblen ((char *)curP, MB_CUR_MAX)) > 0) &&
((chlen > 1) || (!isspace (*curP) && ((chlen > 1) || (!isspace (*curP) &&
@ -696,20 +580,6 @@ _DtWmParseNextTokenC (
} }
} }
} }
#else /* MULTIBYTE */
while ((*endP = *curP) && !isspace (*endP) &&
(SmBehavior || (*endP != '#')))
{
/* point curP to next character */
curP++;
if ((*endP == '\\') && (*curP != '\0'))
/* shift quoted nonNULL character down and curP ahead */
{
*endP = *curP++;
}
endP++;
}
#endif /* MULTIBYTE */
} }
/* /*
@ -1040,14 +910,11 @@ _DtWmParseNextLine (
register unsigned char *string; register unsigned char *string;
int len; int len;
#ifdef MULTIBYTE
int chlen; int chlen;
wchar_t last; wchar_t last;
wchar_t wdelim; wchar_t wdelim;
char delim; char delim;
int lastlen; int lastlen;
#endif
if (cfileP != NULL) if (cfileP != NULL)
/* read fopened file */ /* read fopened file */
@ -1067,7 +934,6 @@ _DtWmParseNextLine (
(pWmPB->cLineSize)); (pWmPB->cLineSize));
} }
#endif /* PARSE_LIB */ #endif /* PARSE_LIB */
#ifndef NO_MULTIBYTE
lastlen = 0; lastlen = 0;
while (*string && while (*string &&
@ -1099,21 +965,6 @@ _DtWmParseNextLine (
while (lastlen == 1 && last == wdelim); while (lastlen == 1 && last == wdelim);
} }
string = line; string = line;
#else
len = strlen((char *)string) - 2;
if ((len > 0) && string[len] == '\\')
{
do {
string = &string[len];
if (fgets((char *)string,
MAXLINE - (string-line), cfileP) == NULL)
break;
len = strlen((char *)string) - 2;
linec++;
} while ((len >= 0) && string[len] == '\\');
string = line;
}
#endif
} }
} }
else if ((parseP != NULL) && (*parseP != '\0')) else if ((parseP != NULL) && (*parseP != '\0'))
@ -1132,7 +983,7 @@ _DtWmParseNextLine (
} }
#endif /* PARSE_LIB */ #endif /* PARSE_LIB */
string = line; string = line;
#ifdef MULTIBYTE
while ((*parseP != '\0') && while ((*parseP != '\0') &&
((chlen = mblen ((char *)parseP, MB_CUR_MAX)) != 0) && ((chlen = mblen ((char *)parseP, MB_CUR_MAX)) != 0) &&
(*parseP != '\n')) (*parseP != '\n'))
@ -1148,13 +999,6 @@ _DtWmParseNextLine (
} }
} }
} }
#else
while ((*parseP != '\0') && (*parseP != '\n'))
/* copy all but end-of-line and newlines to line buffer */
{
*(string++) = *(parseP++);
}
#endif
*string = '\0'; *string = '\0';
if (*parseP == '\n') if (*parseP == '\n')
{ {
@ -1255,19 +1099,12 @@ _DtWmParseNextChar (
unsigned char *pch = NULL; unsigned char *pch = NULL;
int chlen; int chlen;
#ifdef MULTIBYTE
if (pWmPB && if (pWmPB &&
pWmPB->pchNext && pWmPB->pchNext &&
(chlen = mblen((char *)pWmPB->pchNext, MB_CUR_MAX) > 0)) (chlen = mblen((char *)pWmPB->pchNext, MB_CUR_MAX) > 0))
{ {
pch = (pWmPB->pchNext += chlen); pch = (pWmPB->pchNext += chlen);
} }
#else /* MULTIBYTE */
if (pWmPB && pWmPB->pchNext && *pWmPB->pchNext)
{
pch = ++pWmPB->pchNext;
}
#endif /* MULTIBYTE */
return (pch); return (pch);
} }
@ -1341,7 +1178,6 @@ _DtWmParseLineNumber (
void _DtWmParseToLower (char *string) void _DtWmParseToLower (char *string)
{ {
char *pch = string; char *pch = string;
#ifdef MULTIBYTE
int chlen; int chlen;
while ((chlen = mblen (pch, MB_CUR_MAX)) > 0) while ((chlen = mblen (pch, MB_CUR_MAX)) > 0)
@ -1352,16 +1188,6 @@ void _DtWmParseToLower (char *string)
} }
pch += chlen; pch += chlen;
} }
#else
while (*pch != NULL)
{
if (isupper (*pch))
{
*pch = tolower(*pch);
}
pch++;
}
#endif
} /* END OF FUNCTION _DtWmParseToLower */ } /* END OF FUNCTION _DtWmParseToLower */
@ -1400,7 +1226,6 @@ unsigned int _DtWmParsePeekAhead(unsigned char *currentChar,
{ {
Boolean done = False; Boolean done = False;
unsigned int tmpLev = 1; unsigned int tmpLev = 1;
#ifdef MULTIBYTE
unsigned int chlen; unsigned int chlen;
while (((chlen = mblen ((char *)currentChar, MB_CUR_MAX)) > 0) && while (((chlen = mblen ((char *)currentChar, MB_CUR_MAX)) > 0) &&
@ -1424,26 +1249,6 @@ unsigned int _DtWmParsePeekAhead(unsigned char *currentChar,
} }
} }
} }
#else
while((*currentChar != NULL) && (done == False) &&
((*currentChar == '"') || (*currentChar == '\\')))
{
currentChar++;
if((*currentChar != NULL) &&
((*currentChar == '"') || (*currentChar == '\\')))
{
tmpLev++;
if(*currentChar == '"')
{
done = True;
}
else
{
currentChar++;
}
}
}
#endif /*MULTIBYTE*/
/* /*
* Figure out if this is truly a new level of nesting - else ignore it * Figure out if this is truly a new level of nesting - else ignore it
@ -1658,11 +1463,7 @@ _DtWmParseExpandEnvironmentVariables (
) )
{ {
#ifdef MULTIBYTE
int chlen; int chlen;
#else /* MULTIBYTE */
int chlen = 1; /* length of character is always '1' */
#endif /* MULTIBYTE */
unsigned char *pchStart; unsigned char *pchStart;
unsigned char chSave; unsigned char chSave;
unsigned char *pchEnvStart; unsigned char *pchEnvStart;
@ -1699,9 +1500,7 @@ _DtWmParseExpandEnvironmentVariables (
pchStart = pch; pchStart = pch;
lenOriginal = strlen ((char *)pch); lenOriginal = strlen ((char *)pch);
#ifdef MULTIBYTE
chlen = mblen ((char *)pch, MB_CUR_MAX); chlen = mblen ((char *)pch, MB_CUR_MAX);
#endif /* MULTIBYTE */
chSave = '\0'; chSave = '\0';
while (*pch && (chlen > 0)) while (*pch && (chlen > 0))
@ -1732,18 +1531,14 @@ _DtWmParseExpandEnvironmentVariables (
* The next character is "escaped", skip over it. * The next character is "escaped", skip over it.
*/ */
pchStart = pch += chlen; pchStart = pch += chlen;
#ifdef MULTIBYTE
chlen = mblen ((char *)pch, MB_CUR_MAX); chlen = mblen ((char *)pch, MB_CUR_MAX);
#endif /* MULTIBYTE */
break; break;
case DTWM_CHAR_ENVIRONMENT: case DTWM_CHAR_ENVIRONMENT:
/* save start of environment variable */ /* save start of environment variable */
pchEnvStart = pch; pchEnvStart = pch;
pch += chlen; pch += chlen;
#ifdef MULTIBYTE
chlen = mblen ((char *)pch, MB_CUR_MAX); chlen = mblen ((char *)pch, MB_CUR_MAX);
#endif /* MULTIBYTE */
/* /*
* Copy up to start of environment variable * Copy up to start of environment variable
@ -1773,9 +1568,7 @@ _DtWmParseExpandEnvironmentVariables (
(*pch == DTWM_CHAR_L_PAREN)) (*pch == DTWM_CHAR_L_PAREN))
{ {
pch += chlen; pch += chlen;
#ifdef MULTIBYTE
chlen = mblen ((char *)pch, MB_CUR_MAX); chlen = mblen ((char *)pch, MB_CUR_MAX);
#endif /* MULTIBYTE */
pchBreak = pchParenBrk; pchBreak = pchParenBrk;
bEatBreak = True; bEatBreak = True;
} }
@ -1783,9 +1576,7 @@ _DtWmParseExpandEnvironmentVariables (
(*pch == DTWM_CHAR_L_BRACE)) (*pch == DTWM_CHAR_L_BRACE))
{ {
pch += chlen; pch += chlen;
#ifdef MULTIBYTE
chlen = mblen ((char *)pch, MB_CUR_MAX); chlen = mblen ((char *)pch, MB_CUR_MAX);
#endif /* MULTIBYTE */
pchBreak = pchBraceBrk; pchBreak = pchBraceBrk;
bEatBreak = True; bEatBreak = True;
} }
@ -1867,16 +1658,12 @@ _DtWmParseExpandEnvironmentVariables (
*/ */
if (bEatBreak) if (bEatBreak)
{ {
#ifdef MULTIBYTE
chlen = mblen ((char *)pchNext, MB_CUR_MAX); chlen = mblen ((char *)pchNext, MB_CUR_MAX);
#endif /* MULTIBYTE */
pchNext += chlen; pchNext += chlen;
} }
} }
pchStart = pch = pchNext; pchStart = pch = pchNext;
#ifdef MULTIBYTE
chlen = mblen ((char *)pch, MB_CUR_MAX); chlen = mblen ((char *)pch, MB_CUR_MAX);
#endif /* MULTIBYTE */
/* /*
* We're already pointing at the next character * We're already pointing at the next character
* to process, don't advance again! * to process, don't advance again!
@ -1897,18 +1684,14 @@ _DtWmParseExpandEnvironmentVariables (
if (!bAlreadyAdvanced) if (!bAlreadyAdvanced)
{ {
pch += chlen; pch += chlen;
#ifdef MULTIBYTE
chlen = mblen ((char *)pch, MB_CUR_MAX); chlen = mblen ((char *)pch, MB_CUR_MAX);
#endif /* MULTIBYTE */
} }
} }
#ifdef MULTIBYTE
else else
{ {
pch += chlen; pch += chlen;
chlen = mblen ((char *)pch, MB_CUR_MAX); chlen = mblen ((char *)pch, MB_CUR_MAX);
} }
#endif /* MULTIBYTE */
} }
if (pchReturn && *pchStart) if (pchReturn && *pchStart)
@ -1956,9 +1739,7 @@ _DtWmParseMakeQuotedString (unsigned char *pchLine)
int iLen0, iLen1; int iLen0, iLen1;
int cSpecial; int cSpecial;
int i,j; int i,j;
#ifdef MULTIBYTE
int chlen; int chlen;
#endif
iLen0 = strlen ((char *)pchLine); iLen0 = strlen ((char *)pchLine);
iLen1 = iLen0 + 2; /* for starting, ending quotes */ iLen1 = iLen0 + 2; /* for starting, ending quotes */
@ -1968,7 +1749,6 @@ _DtWmParseMakeQuotedString (unsigned char *pchLine)
/* /*
* Count special chars to get estimate of new length * Count special chars to get estimate of new length
*/ */
#ifdef MULTIBYTE
chlen = mblen ((char *) &pchLine[i], MB_CUR_MAX); chlen = mblen ((char *) &pchLine[i], MB_CUR_MAX);
if ((chlen == 1) && if ((chlen == 1) &&
((pchLine[i] == '\\') || ((pchLine[i] == '\\') ||
@ -1984,13 +1764,6 @@ _DtWmParseMakeQuotedString (unsigned char *pchLine)
{ {
i += chlen-1; i += chlen-1;
} }
#else /* MULTIBYTE */
if ((pchLine[i] == '\\') ||
(pchLine[i] == '"'))
{
iLen1++;
}
#endif /* MULTIBYTE */
} }
pchRet = (unsigned char *) XtMalloc (1+iLen1); pchRet = (unsigned char *) XtMalloc (1+iLen1);
@ -2003,7 +1776,6 @@ _DtWmParseMakeQuotedString (unsigned char *pchLine)
*/ */
for (i=0, j=1; i < iLen0; i++, j++) for (i=0, j=1; i < iLen0; i++, j++)
{ {
#ifdef MULTIBYTE
chlen = mblen ((char *) &pchLine[i], MB_CUR_MAX); chlen = mblen ((char *) &pchLine[i], MB_CUR_MAX);
if ((chlen == 1) && if ((chlen == 1) &&
((pchLine[i] == '\\') || ((pchLine[i] == '\\') ||
@ -2022,14 +1794,6 @@ _DtWmParseMakeQuotedString (unsigned char *pchLine)
pchRet[j++] = pchLine[i++]; pchRet[j++] = pchLine[i++];
chlen--; chlen--;
} }
#else /* MULTIBYTE */
if ((pchLine[i] == '\\') ||
(pchLine[i] == '"'))
{
/* quote next char */
pchRet[j++] = '\\';
}
#endif /* MULTIBYTE */
/* copy char */ /* copy char */
pchRet[j] = pchLine[i]; pchRet[j] = pchLine[i];
} }

View file

@ -39,9 +39,7 @@
#include <ctype.h> #include <ctype.h>
#include <stdio.h> #include <stdio.h>
#ifndef NO_MULTIBYTE
#include <stdlib.h> #include <stdlib.h>
#endif
#include <Xm/XmosP.h> #include <Xm/XmosP.h>
@ -1501,7 +1499,6 @@ unsigned char *NextToken (unsigned char *pchIn, int *pLen,
unsigned char *pchR = pchIn; unsigned char *pchR = pchIn;
register int i; register int i;
#ifndef NO_MULTIBYTE
register int chlen; register int chlen;
for (i = 0; for (i = 0;
@ -1516,13 +1513,6 @@ unsigned char *NextToken (unsigned char *pchIn, int *pLen,
pchIn += chlen; pchIn += chlen;
} }
#else
for (i = 0; *pchIn && !isspace (*pchIn); i++, pchIn++)
/* find end of word */
{
}
#endif
/* skip to next word */ /* skip to next word */
ScanWhitespace (&pchIn); ScanWhitespace (&pchIn);
@ -1571,7 +1561,6 @@ unsigned char *NextToken (unsigned char *pchIn, int *pLen,
Boolean StringsAreEqual (unsigned char *pch1, unsigned char *pch2, int len) Boolean StringsAreEqual (unsigned char *pch1, unsigned char *pch2, int len)
{ {
#ifndef NO_MULTIBYTE
int chlen1; int chlen1;
int chlen2; int chlen2;
wchar_t wch1; wchar_t wch1;
@ -1603,15 +1592,6 @@ Boolean StringsAreEqual (unsigned char *pch1, unsigned char *pch2, int len)
len--; len--;
} }
#else
while (len && *pch1 && *pch2 &&
((isupper (*pch1) ? tolower(*pch1++) : *pch1++) ==
(isupper (*pch2) ? tolower(*pch2++) : *pch2++)))
{
len--;
}
#endif
return (len == 0); return (len == 0);
} /* END OF StringsAreEqual */ } /* END OF StringsAreEqual */
@ -1653,26 +1633,16 @@ long DecStrToL (unsigned char *str, unsigned char **ptr)
long val = 0; long val = 0;
*ptr = str; *ptr = str;
#ifndef NO_MULTIBYTE
while ((mblen ((char *)str, MB_CUR_MAX) == 1) && isspace (*str)) while ((mblen ((char *)str, MB_CUR_MAX) == 1) && isspace (*str))
#else
while (isspace (*str))
#endif
/* Ignore leading whitespace */ /* Ignore leading whitespace */
{ {
str++; str++;
} }
/* If we can start, we will reset *ptr */ /* If we can start, we will reset *ptr */
#ifndef NO_MULTIBYTE
if ((mblen ((char *)str, MB_CUR_MAX) == 1) && isdigit (*str)) if ((mblen ((char *)str, MB_CUR_MAX) == 1) && isdigit (*str))
{ {
while ((mblen ((char *)str, MB_CUR_MAX) == 1) && isdigit (*str)) while ((mblen ((char *)str, MB_CUR_MAX) == 1) && isdigit (*str))
#else
if (isdigit (*str))
{
while (isdigit (*str))
#endif
{ {
val = val * 10 + (*str - '0'); val = val * 10 + (*str - '0');
str++; str++;

View file

@ -66,9 +66,7 @@
#include <locale.h> #include <locale.h>
#ifndef NO_MULTIBYTE
#include <stdlib.h> #include <stdlib.h>
#endif
#include <Xm/XmP.h> /* for XmeGetHomeDirName */ #include <Xm/XmP.h> /* for XmeGetHomeDirName */
#include <signal.h> #include <signal.h>
@ -1483,7 +1481,6 @@ unsigned int PeekAhead(unsigned char *currentChar,
{ {
Boolean done = False; Boolean done = False;
unsigned int tmpLev = 1; unsigned int tmpLev = 1;
#ifndef NO_MULTIBYTE
unsigned int chlen; unsigned int chlen;
while (((chlen = mblen ((char *)currentChar, MB_CUR_MAX)) > 0) && while (((chlen = mblen ((char *)currentChar, MB_CUR_MAX)) > 0) &&
@ -1506,26 +1503,6 @@ unsigned int PeekAhead(unsigned char *currentChar,
} }
} }
} }
#else
while((*currentChar != NULL) && (done == False) &&
((*currentChar == '"') || (*currentChar == '\\')))
{
currentChar++;
if((*currentChar != NULL) &&
((*currentChar == '"') || (*currentChar == '\\')))
{
tmpLev++;
if(*currentChar == '"')
{
done = True;
}
else
{
currentChar++;
}
}
}
#endif /*NO_MULTIBYTE*/
/* /*
* Figure out if this is truly a new level of nesting - else ignore it * Figure out if this is truly a new level of nesting - else ignore it
@ -2708,7 +2685,6 @@ static void ParseWmMnemonic (unsigned char **linePP, MenuItem *menuItem)
lineP++; lineP++;
mnemonic = GetString(&lineP); mnemonic = GetString(&lineP);
#ifndef NO_MULTIBYTE
if (menuItem->labelType == XmSTRING && if (menuItem->labelType == XmSTRING &&
mnemonic != NULL && mnemonic != NULL &&
(ks = XStringToKeysym((char *)mnemonic)) != NoSymbol && (ks = XStringToKeysym((char *)mnemonic)) != NoSymbol &&
@ -2716,16 +2692,6 @@ static void ParseWmMnemonic (unsigned char **linePP, MenuItem *menuItem)
{ {
menuItem->mnemonic = ks; menuItem->mnemonic = ks;
} }
#else
if ((mnemonic != NULL) &&
(*mnemonic != '\0') &&
(menuItem->labelType == XmSTRING) &&
(strchr (menuItem->label, *mnemonic) != NULL))
/* valid mnemonic */
{
menuItem->mnemonic = *mnemonic;
}
#endif
else else
{ {
PWarning (((char *)GETMESSAGE(60, 14, "Invalid mnemonic specification"))); PWarning (((char *)GETMESSAGE(60, 14, "Invalid mnemonic specification")));
@ -3102,13 +3068,11 @@ Boolean ParseWmFuncStrArg (unsigned char **linePP,
{ {
unsigned char *string; unsigned char *string;
unsigned int len; unsigned int len;
#ifndef NO_MULTIBYTE
char *p; char *p;
wchar_t last; wchar_t last;
char delim; char delim;
wchar_t wdelim; wchar_t wdelim;
int lastlen; int lastlen;
#endif
if ((string = GetString (linePP)) != NULL) if ((string = GetString (linePP)) != NULL)
/* nonNULL string argument */ /* nonNULL string argument */
@ -3125,7 +3089,6 @@ Boolean ParseWmFuncStrArg (unsigned char **linePP,
* Insure that an argument for F_Exec ends in '&' . * Insure that an argument for F_Exec ends in '&' .
*/ */
#ifndef NO_MULTIBYTE
if (wmFunction == F_Exec) if (wmFunction == F_Exec)
{ {
lastlen = 0; lastlen = 0;
@ -3145,13 +3108,6 @@ Boolean ParseWmFuncStrArg (unsigned char **linePP,
*p = '\0'; *p = '\0';
} }
} }
#else
if ((wmFunction == F_Exec) && ((*pArgs)[len - 1] != '&'))
{
(*pArgs)[len] = '&';
(*pArgs)[len + 1] = '\0';
}
#endif
} }
else else
/* NULL string argument */ /* NULL string argument */
@ -4576,14 +4532,11 @@ static Boolean ParseKeySym (unsigned char **linePP, unsigned int closure,
unsigned char *startP; unsigned char *startP;
char keySymName[MAX_KEYSYM_STRLEN+1]; char keySymName[MAX_KEYSYM_STRLEN+1];
int len; int len;
#ifndef NO_MULTIBYTE
int chlen; int chlen;
#endif
ScanWhitespace (&lineP); ScanWhitespace (&lineP);
startP = lineP; startP = lineP;
#ifndef NO_MULTIBYTE
while (*lineP && while (*lineP &&
((chlen = mblen ((char *)lineP, MB_CUR_MAX)) > 0) && ((chlen = mblen ((char *)lineP, MB_CUR_MAX)) > 0) &&
((chlen > 1) || ((chlen > 1) ||
@ -4592,24 +4545,13 @@ static Boolean ParseKeySym (unsigned char **linePP, unsigned int closure,
/* Skip next character */ /* Skip next character */
lineP += chlen; lineP += chlen;
} }
#else
while (*lineP && !isspace (*lineP) && *lineP != ',' && *lineP != ':' )
{
/* Skip next character */
lineP++;
}
#endif
len = min (lineP - startP, MAX_KEYSYM_STRLEN); len = min (lineP - startP, MAX_KEYSYM_STRLEN);
(void) strncpy (keySymName, (char *)startP, len); (void) strncpy (keySymName, (char *)startP, len);
keySymName[len] = '\0'; keySymName[len] = '\0';
#ifndef NO_MULTIBYTE
if ((*detail = XStringToKeysym(keySymName)) == NoSymbol && if ((*detail = XStringToKeysym(keySymName)) == NoSymbol &&
(mblen (keySymName, MB_CUR_MAX) == 1)) (mblen (keySymName, MB_CUR_MAX) == 1))
#else
if ((*detail = XStringToKeysym(keySymName)) == NoSymbol)
#endif
{ {
if (!isdigit (keySymName[0]) || if (!isdigit (keySymName[0]) ||
((*detail = StrToNum ((unsigned char *)&keySymName[0])) == -1)) ((*detail = StrToNum ((unsigned char *)&keySymName[0])) == -1))
@ -4811,7 +4753,6 @@ static unsigned int StrToOct(unsigned char *str)
void ScanAlphanumeric (unsigned char **linePP) void ScanAlphanumeric (unsigned char **linePP)
{ {
#ifndef NO_MULTIBYTE
int chlen; int chlen;
while (*linePP && while (*linePP &&
@ -4820,13 +4761,6 @@ void ScanAlphanumeric (unsigned char **linePP)
{ {
(*linePP) += chlen; (*linePP) += chlen;
} }
#else
while (*linePP && isalnum (**linePP))
{
(*linePP)++;
}
#endif
} /* END OF FUNCTION ScanAlphanumeric */ } /* END OF FUNCTION ScanAlphanumeric */
@ -4938,9 +4872,7 @@ static void InitKeySubs (
unsigned char *pch0; unsigned char *pch0;
unsigned char *pch1; unsigned char *pch1;
int len; int len;
#ifndef NO_MULTIBYTE
int chlen; int chlen;
#endif
pch0 = (unsigned char *)GETMESSAGE(60, 40, ""); pch0 = (unsigned char *)GETMESSAGE(60, 40, "");
@ -4975,7 +4907,6 @@ static void InitKeySubs (
/* get "from" string */ /* get "from" string */
pch1 = pch0; pch1 = pch0;
#ifndef NO_MULTIBYTE
while (*pch1 && ((chlen = mblen ((char *)pch1, MB_CUR_MAX)) > 0)) while (*pch1 && ((chlen = mblen ((char *)pch1, MB_CUR_MAX)) > 0))
{ {
if ((chlen == 1) && (*pch1 == ' ')) if ((chlen == 1) && (*pch1 == ' '))
@ -4984,9 +4915,6 @@ static void InitKeySubs (
} }
pch1 += chlen; pch1 += chlen;
} }
#else /* NO_MULTIBYTE */
while (*pch1 && (*pch1 != ' ')) pch1++;
#endif /* NO_MULTIBYTE */
pKS->lenFrom = pch1 - pch0; pKS->lenFrom = pch1 - pch0;
if (pKS->lenFrom < 1) if (pKS->lenFrom < 1)
{ {
@ -5003,7 +4931,6 @@ static void InitKeySubs (
ScanWhitespace (&pch1); ScanWhitespace (&pch1);
pch0 = pch1; pch0 = pch1;
#ifndef NO_MULTIBYTE
while (*pch1 && ((chlen = mblen ((char *)pch1, MB_CUR_MAX)) > 0)) while (*pch1 && ((chlen = mblen ((char *)pch1, MB_CUR_MAX)) > 0))
{ {
if ((chlen == 1) && (*pch1 == ' ')) if ((chlen == 1) && (*pch1 == ' '))
@ -5012,9 +4939,6 @@ static void InitKeySubs (
} }
pch1 += chlen; pch1 += chlen;
} }
#else /* NO_MULTIBYTE */
while (*pch1 && (*pch1 != ' ')) pch1++;
#endif /* NO_MULTIBYTE */
len = pch1 - pch0; len = pch1 - pch0;
if (len < 1) if (len < 1)
@ -5070,9 +4994,7 @@ static void InitKeySubs (
static void ProcessAccelText (unsigned char *startP, unsigned char *endP, static void ProcessAccelText (unsigned char *startP, unsigned char *endP,
unsigned char *destP) unsigned char *destP)
{ {
#ifndef NO_MULTIBYTE
int chlen; int chlen;
#endif
static Boolean bAccelInit = False; static Boolean bAccelInit = False;
static KeySub *pKeySub; static KeySub *pKeySub;
static int numKeySubs; static int numKeySubs;
@ -5101,7 +5023,6 @@ static void ProcessAccelText (unsigned char *startP, unsigned char *endP,
} }
pchFirst = startP; pchFirst = startP;
#ifndef NO_MULTIBYTE
while (*startP && while (*startP &&
(((chlen = mblen ((char *)startP, MB_CUR_MAX)) > 1) (((chlen = mblen ((char *)startP, MB_CUR_MAX)) > 1)
|| isalnum (*startP))) || isalnum (*startP)))
@ -5111,12 +5032,7 @@ static void ProcessAccelText (unsigned char *startP, unsigned char *endP,
startP++; startP++;
} }
} }
#else
while (isalnum (*startP))
{
startP++;
}
#endif
/* find substitution */ /* find substitution */
pchSub = NULL; pchSub = NULL;
lenSub = 0; lenSub = 0;
@ -5155,11 +5071,7 @@ static void ProcessAccelText (unsigned char *startP, unsigned char *endP,
startP++; /* skip '<' */ startP++; /* skip '<' */
while (*startP != '>') while (*startP != '>')
{ {
#ifndef NO_MULTIBYTE
startP += mblen ((char *)startP, MB_CUR_MAX); startP += mblen ((char *)startP, MB_CUR_MAX);
#else
startP++;
#endif
} }
startP++; /* skip '>' */ startP++; /* skip '>' */

View file

@ -4340,13 +4340,11 @@ MakeAppearanceResources (WmScreenData *pSD, AppearanceData *pAData, Boolean make
#endif #endif
} else { } else {
/* got default font successfully, hack was not needed */ /* got default font successfully, hack was not needed */
#ifndef NO_MULTIBYTE
/* /*
* Calculate title bar's height (using selected font) and store it in pAData. * Calculate title bar's height (using selected font) and store it in pAData.
*/ */
pAData->titleHeight = (pAData->font)->ascent + (pAData->font)->descent pAData->titleHeight = (pAData->font)->ascent + (pAData->font)->descent
+ WM_TITLE_BAR_PADDING; + WM_TITLE_BAR_PADDING;
#endif
} }