version 1.18, 2015/11/19 23:20:34 |
version 1.19, 2015/11/19 23:34:56 |
|
|
char *str; |
char *str; |
{ |
{ |
while (*str) { |
while (*str) { |
if (!isascii((Char) * str) || !islower((Char) * str)) |
if (!isascii((u_char) * str) || !islower((u_char) * str)) |
return 0; |
return 0; |
++str; |
++str; |
} |
} |
|
|
char *str; |
char *str; |
{ |
{ |
while (*str) { |
while (*str) { |
if (!isascii((Char) * str) || !isupper((Char) * str)) |
if (!isascii((u_char) * str) || !isupper((u_char) * str)) |
return 0; |
return 0; |
++str; |
++str; |
} |
} |
|
|
|
|
/* clower - replace upper-case letter to lower-case */ |
/* clower - replace upper-case letter to lower-case */ |
|
|
Char |
u_char |
clower(c) |
clower(c) |
int c; |
int c; |
{ |
{ |
return (Char) ((isascii(c) && isupper(c)) ? tolower(c) : c); |
return (u_char) ((isascii(c) && isupper(c)) ? tolower(c) : c); |
} |
} |
|
|
|
|
|
|
* returns a dynamically allocated copy of a (potentially) unsigned string |
* returns a dynamically allocated copy of a (potentially) unsigned string |
*/ |
*/ |
|
|
Char * |
u_char * |
copy_unsigned_string(str) |
copy_unsigned_string(str) |
Char *str; |
u_char *str; |
{ |
{ |
Char *c; |
u_char *c; |
Char *copy; |
u_char *copy; |
|
|
/* find length */ |
/* find length */ |
for (c = str; *c; ++c); |
for (c = str; *c; ++c); |
|
|
int |
int |
cclcmp(const void *a, const void *b) |
cclcmp(const void *a, const void *b) |
{ |
{ |
if (!*(const Char *) a) |
if (!*(const u_char *) a) |
return 1; |
return 1; |
else if (!*(const Char *) b) |
else if (!*(const u_char *) b) |
return -1; |
return -1; |
else |
else |
return *(const Char *) a - *(const Char *) b; |
return *(const u_char *) a - *(const u_char *) b; |
} |
} |
|
|
|
|
|
|
|
|
int |
int |
htoi(str) |
htoi(str) |
Char str[]; |
u_char str[]; |
{ |
{ |
unsigned int result; |
unsigned int result; |
|
|
|
|
|
|
/* myesc - return character corresponding to escape sequence */ |
/* myesc - return character corresponding to escape sequence */ |
|
|
Char |
u_char |
myesc(array) |
myesc(array) |
Char array[]; |
u_char array[]; |
{ |
{ |
Char c, esc_char; |
u_char c, esc_char; |
|
|
switch (array[1]) { |
switch (array[1]) { |
case 'b': |
case 'b': |
|
|
|
|
int |
int |
otoi(str) |
otoi(str) |
Char str[]; |
u_char str[]; |
{ |
{ |
unsigned int result; |
unsigned int result; |
|
|