git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/branches/embryo-1.7@76492
7cbeb6ba-43b4-40fd-8cce-
4c39aea84d33
2012-08-30 Carsten Haitzler (The Rasterman)
1.7.0 release
2012-08-30 Carsten Haitzler (The Rasterman)
1.7.0 release
+
+2012-09-12 Carsten Haitzler (The Rasterman)
+
+ * Fix windows utf/whitespace parsing issue in windows
+
+Embryo 1.7.1
+
+Changes since Embryo 1.7.0:
+---------------------------
+
+Fixes:
+
+ * Fix windows utf8 shitepsace parse issue.
Changes since Embryo 1.2.0:
---------------------------
Changes since Embryo 1.2.0:
---------------------------
extern jmp_buf errbuf; /* target of longjmp() on a fatal error */
extern jmp_buf errbuf; /* target of longjmp() on a fatal error */
+#define sc_isspace(x) isspace ((int)((unsigned char)x))
+#define sc_isalpha(x) isalpha ((int)((unsigned char)x))
+#define sc_isdigit(x) isdigit ((int)((unsigned char)x))
+#define sc_isupper(x) isupper ((int)((unsigned char)x))
+#define sc_isxdigit(x) isxdigit((int)((unsigned char)x))
+
/* tagname currently unknown, add it */
tag = last + 1; /* guaranteed not to exist already */
/* tagname currently unknown, add it */
tag = last + 1; /* guaranteed not to exist already */
tag |= (int)FIXEDTAG;
append_constval(&tagname_tab, name, (cell) tag, 0);
return tag;
tag |= (int)FIXEDTAG;
append_constval(&tagname_tab, name, (cell) tag, 0);
return tag;
tag &= TAGMASK;
assert(tag >= 0);
sprintf(dest, "0%x", tag);
tag &= TAGMASK;
assert(tag >= 0);
sprintf(dest, "0%x", tag);
- return isdigit(dest[1]) ? &dest[1] : dest;
+ return sc_isdigit(dest[1]) ? &dest[1] : dest;
} /* if */
assert(!unary || *tag1 == 0);
assert(*ptr != '\0');
} /* if */
assert(!unary || *tag1 == 0);
assert(*ptr != '\0');
- for (name = opname; !isdigit(*ptr);)
+ for (name = opname; !sc_isdigit(*ptr);)
*name++ = *ptr++;
*name = '\0';
*tag2 = (int)strtol(ptr, NULL, 16);
*name++ = *ptr++;
*name = '\0';
*tag2 = (int)strtol(ptr, NULL, 16);
constvalue *tagsym[2];
int unary;
constvalue *tagsym[2];
int unary;
- if (isalpha(*funcname) || *funcname == '_' || *funcname == PUBLIC_CHAR
+ if (sc_isalpha(*funcname) || *funcname == '_' || *funcname == PUBLIC_CHAR
|| *funcname == '\0')
{
if (dest != funcname)
|| *funcname == '\0')
{
if (dest != funcname)
- if (!isdigit(*ptr)) /* should start with digit */
+ if (!sc_isdigit(*ptr)) /* should start with digit */
- while (isdigit(*ptr) || *ptr == '_')
+ while (sc_isdigit(*ptr) || *ptr == '_')
{
if (*ptr != '_')
*val = (*val * 10) + (*ptr - '0');
{
if (*ptr != '_')
*val = (*val * 10) + (*ptr - '0');
} /* while */
if (alphanum(*ptr)) /* number must be delimited by non-alphanumerical */
return 0;
} /* while */
if (alphanum(*ptr)) /* number must be delimited by non-alphanumerical */
return 0;
- if (*ptr == '.' && isdigit(*(ptr + 1)))
+ if (*ptr == '.' && sc_isdigit(*(ptr + 1)))
return 0; /* but a fractional part must not be present */
return (int)(ptr - curptr);
}
return 0; /* but a fractional part must not be present */
return (int)(ptr - curptr);
}
- if (!isdigit(*ptr)) /* should start with digit */
+ if (!sc_isdigit(*ptr)) /* should start with digit */
return 0;
if (*ptr == '0' && *(ptr + 1) == 'x')
{ /* C style hexadecimal notation */
ptr += 2;
return 0;
if (*ptr == '0' && *(ptr + 1) == 'x')
{ /* C style hexadecimal notation */
ptr += 2;
- while (isxdigit(*ptr) || *ptr == '_')
+ while (sc_isxdigit(*ptr) || *ptr == '_')
- assert(isxdigit(*ptr));
+ assert(sc_isxdigit(*ptr));
*val += (*ptr - '0');
else
*val += (tolower(*ptr) - 'a' + 10);
*val += (*ptr - '0');
else
*val += (tolower(*ptr) - 'a' + 10);
fnum = 0.0;
dnum = 0L;
ptr = curptr;
fnum = 0.0;
dnum = 0L;
ptr = curptr;
- if (!isdigit(*ptr)) /* should start with digit */
+ if (!sc_isdigit(*ptr)) /* should start with digit */
- while (isdigit(*ptr) || *ptr == '_')
+ while (sc_isdigit(*ptr) || *ptr == '_')
if (*ptr != '.')
return 0; /* there must be a period */
ptr++;
if (*ptr != '.')
return 0; /* there must be a period */
ptr++;
- if (!isdigit(*ptr)) /* there must be at least one digit after the dot */
+ if (!sc_isdigit(*ptr)) /* there must be at least one digit after the dot */
return 0;
ffrac = 0.0;
fmult = 1.0;
ignore = FALSE;
return 0;
ffrac = 0.0;
fmult = 1.0;
ignore = FALSE;
- while (isdigit(*ptr) || *ptr == '_')
+ while (sc_isdigit(*ptr) || *ptr == '_')
- if (!isdigit(*ptr)) /* 'e' should be followed by a digit */
+ if (!sc_isdigit(*ptr)) /* 'e' should be followed by a digit */
+ while (sc_isdigit(*ptr))
{
exp = (exp * 10) + (*ptr - '0');
ptr++;
{
exp = (exp * 10) + (*ptr - '0');
ptr++;
lptr++;
for (i = 0;
(i < (int)(sizeof(name))) &&
lptr++;
for (i = 0;
(i < (int)(sizeof(name))) &&
i++, lptr++)
name[i] = *lptr;
name[i] = '\0';
i++, lptr++)
name[i] = *lptr;
name[i] = '\0';
while (*lptr <= ' ' && *lptr != '\0')
lptr++;
while (*lptr <= ' ' && *lptr != '\0')
lptr++;
- for (i = 0; i < 40 && (isalpha(*lptr) || *lptr == '.'); i++, lptr++)
+ for (i = 0; i < 40 && (sc_isalpha(*lptr) || *lptr == '.'); i++, lptr++)
name[i] = (char)tolower(*lptr);
name[i] = '\0';
stgwrite("\t");
name[i] = (char)tolower(*lptr);
name[i] = '\0';
stgwrite("\t");
} /* while */
end = lptr;
/* check pattern to match */
} /* while */
end = lptr;
/* check pattern to match */
- if (!isalpha(*start) && *start != '_')
+ if (!sc_isalpha(*start) && *start != '_')
{
error(74); /* pattern must start with an alphabetic character */
break;
{
error(74); /* pattern must start with an alphabetic character */
break;
} /* while */
pattern[count] = '\0';
/* special case, erase trailing variable, because it could match anything */
} /* while */
pattern[count] = '\0';
/* special case, erase trailing variable, because it could match anything */
- if (count >= 2 && isdigit(pattern[count - 1])
+ if (count >= 2 && sc_isdigit(pattern[count - 1])
&& pattern[count - 2] == '%')
pattern[count - 2] = '\0';
/* find substitution string */
&& pattern[count - 2] == '%')
pattern[count - 2] = '\0';
/* find substitution string */
substitution[count] = '\0';
/* check whether the definition already exists */
for (prefixlen = 0, start = pattern;
substitution[count] = '\0';
/* check whether the definition already exists */
for (prefixlen = 0, start = pattern;
- isalpha(*start) || isdigit(*start) || *start == '_';
+ sc_isalpha(*start) || sc_isdigit(*start) || *start == '_';
prefixlen++, start++)
/* nothing */ ;
assert(prefixlen > 0);
prefixlen++, start++)
/* nothing */ ;
assert(prefixlen > 0);
memset(args, 0, sizeof args);
/* check the length of the prefix */
memset(args, 0, sizeof args);
/* check the length of the prefix */
- for (prefixlen = 0, s = pattern; isalpha(*s) || isdigit(*s) || *s == '_';
+ for (prefixlen = 0, s = pattern; sc_isalpha(*s) || sc_isdigit(*s) || *s == '_';
prefixlen++, s++)
/* nothing */ ;
assert(prefixlen > 0);
prefixlen++, s++)
/* nothing */ ;
assert(prefixlen > 0);
if (*p == '%')
{
p++; /* skip '%' */
if (*p == '%')
{
p++; /* skip '%' */
{
arg = *p - '0';
assert(arg >= 0 && arg <= 9);
{
arg = *p - '0';
assert(arg >= 0 && arg <= 9);
/* calculate the length of the substituted string */
for (e = substitution, len = 0; *e != '\0'; e++)
{
/* calculate the length of the substituted string */
for (e = substitution, len = 0; *e != '\0'; e++)
{
- if (*e == '%' && isdigit(*(e + 1)))
+ if (*e == '%' && sc_isdigit(*(e + 1)))
{
arg = *(e + 1) - '0';
assert(arg >= 0 && arg <= 9);
{
arg = *(e + 1) - '0';
assert(arg >= 0 && arg <= 9);
strdel(line, (int)(s - line));
for (e = substitution, s = line; *e != '\0'; e++)
{
strdel(line, (int)(s - line));
for (e = substitution, s = line; *e != '\0'; e++)
{
- if (*e == '%' && isdigit(*(e + 1)))
+ if (*e == '%' && sc_isdigit(*(e + 1)))
{
arg = *(e + 1) - '0';
assert(arg >= 0 && arg <= 9);
{
arg = *(e + 1) - '0';
assert(arg >= 0 && arg <= 9);
/* find the start of a prefix (skip all non-alphabetic characters),
* also skip strings
*/
/* find the start of a prefix (skip all non-alphabetic characters),
* also skip strings
*/
- while (!isalpha(*start) && *start != '_' && *start != '\0')
+ while (!sc_isalpha(*start) && *start != '_' && *start != '\0')
{
/* skip strings */
if (is_startstring(start))
{
/* skip strings */
if (is_startstring(start))
/* get the prefix (length), look for a matching definition */
prefixlen = 0;
end = start;
/* get the prefix (length), look for a matching definition */
prefixlen = 0;
end = start;
- while (isalpha(*end) || isdigit(*end) || *end == '_')
+ while (sc_isalpha(*end) || sc_isdigit(*end) || *end == '_')
cptr += 1;
break;
default:
cptr += 1;
break;
default:
{ /* \ddd */
c = 0;
while (*cptr >= '0' && *cptr <= '9') /* decimal! */
{ /* \ddd */
c = 0;
while (*cptr >= '0' && *cptr <= '9') /* decimal! */
static int
alpha(char c)
{
static int
alpha(char c)
{
- return (isalpha(c) || c == '_' || c == PUBLIC_CHAR);
+ return (sc_isalpha(c) || c == '_' || c == PUBLIC_CHAR);
- return (alpha(c) || isdigit(c));
+ return (alpha(c) || sc_isdigit(c));
}
/* The local variable table must be searched backwards, so that the deepest
}
/* The local variable table must be searched backwards, so that the deepest
/* for user defined operators, also remove the "prototyped" flag, as
* user-defined operators *must* be declared before use
*/
/* for user defined operators, also remove the "prototyped" flag, as
* user-defined operators *must* be declared before use
*/
- if (sym->ident == iFUNCTN && !isalpha(*sym->name)
+ if (sym->ident == iFUNCTN && !sc_isalpha(*sym->name)
&& *sym->name != '_' && *sym->name != PUBLIC_CHAR)
sym->usage &= ~uPROTOTYPED;
root = sym; /* skip the symbol */
&& *sym->name != '_' && *sym->name != PUBLIC_CHAR)
sym->usage &= ~uPROTOTYPED;
root = sym; /* skip the symbol */
static char *
skipwhitespace(char *str)
{
static char *
skipwhitespace(char *str)
{
+ while (sc_isspace(*str))
if (fbin)
write_encoded(fbin, &p, 1);
num++;
if (fbin)
write_encoded(fbin, &p, 1);
num++;
- while (isspace(*params))
+ while (sc_isspace(*params))
params++;
} /* while */
return num * sizeof(cell);
params++;
} /* while */
return num * sizeof(cell);
- for (i = 0; !isspace(*params); i++, params++)
+ for (i = 0; !sc_isspace(*params); i++, params++)
{
assert(*params != '\0');
assert(i < sNAMEMAX);
{
assert(*params != '\0');
assert(i < sNAMEMAX);
p = hex2long(params, ¶ms);
/* remove leading and trailing white space from the filename */
p = hex2long(params, ¶ms);
/* remove leading and trailing white space from the filename */
- while (isspace(*params))
+ while (sc_isspace(*params))
params++;
len = strlen(params);
params++;
len = strlen(params);
- while (len > 0 && isspace(params[len - 1]))
+ while (len > 0 && sc_isspace(params[len - 1]))
len--;
params[len++] = '\0'; /* zero-terminate */
while (len % sizeof(cell) != 0)
len--;
params[len++] = '\0'; /* zero-terminate */
while (len % sizeof(cell) != 0)
int len;
unsigned char mclass, type;
int len;
unsigned char mclass, type;
- for (endptr = params; !isspace(*endptr) && endptr != '\0'; endptr++)
+ for (endptr = params; !sc_isspace(*endptr) && endptr != '\0'; endptr++)
/* nothing */ ;
assert(*endptr == ' ');
/* nothing */ ;
assert(*endptr == ' ');
/* get to the end of the instruction (make use of the '\n' that fgets()
* added at the end of the line; this way we will *always* drop on a
* whitespace character) */
/* get to the end of the instruction (make use of the '\n' that fgets()
* added at the end of the line; this way we will *always* drop on a
* whitespace character) */
- for (params = instr; *params != '\0' && !isspace(*params);
+ for (params = instr; *params != '\0' && !sc_isspace(*params);
params++)
/* nothing */ ;
assert(params > instr);
params++)
/* nothing */ ;
assert(params > instr);
/* get to the end of the instruction (make use of the '\n' that fgets()
* added at the end of the line; this way we will *always* drop on a
* whitespace character) */
/* get to the end of the instruction (make use of the '\n' that fgets()
* added at the end of the line; this way we will *always* drop on a
* whitespace character) */
- for (params = instr; *params != '\0' && !isspace(*params);
+ for (params = instr; *params != '\0' && !sc_isspace(*params);
params++)
/* nothing */ ;
assert(params > instr);
params++)
/* nothing */ ;
assert(params > instr);
{
case '%': /* new "symbol" */
pattern++;
{
case '%': /* new "symbol" */
pattern++;
- assert(isdigit(*pattern));
+ assert(sc_isdigit(*pattern));
var = atoi(pattern) - 1;
assert(var >= 0 && var < _maxoptvars);
assert(alphanum(*start));
var = atoi(pattern) - 1;
assert(var >= 0 && var < _maxoptvars);
assert(alphanum(*start));
{
case '%':
lptr++; /* skip '%' */
{
case '%':
lptr++; /* skip '%' */
- assert(isdigit(*lptr));
+ assert(sc_isdigit(*lptr));
var = atoi(lptr) - 1;
assert(var >= 0 && var < _maxoptvars);
assert(symbols[var][0] != '\0'); /* variable should be defined */
var = atoi(lptr) - 1;
assert(var >= 0 && var < _maxoptvars);
assert(symbols[var][0] != '\0'); /* variable should be defined */
case '%':
/* write out the symbol */
pattern++;
case '%':
/* write out the symbol */
pattern++;
- assert(isdigit(*pattern));
+ assert(sc_isdigit(*pattern));
var = atoi(pattern) - 1;
assert(var >= 0 && var < _maxoptvars);
assert(symbols[var][0] != '\0'); /* variable should be defined */
var = atoi(pattern) - 1;
assert(var >= 0 && var < _maxoptvars);
assert(symbols[var][0] != '\0'); /* variable should be defined */