version 1.1, 1996/07/04 20:34:41 |
version 1.2, 1997/01/20 19:43:20 |
|
|
/* to be seen literally; \056 is not a metacharacter. */ |
/* to be seen literally; \056 is not a metacharacter. */ |
|
|
int hexstr(char **pp) /* find and eval hex string at pp, return new p */ |
int hexstr(char **pp) /* find and eval hex string at pp, return new p */ |
{ |
{ /* only pick up one 8-bit byte (2 chars) */ |
char *p; |
char *p; |
int n = 0; |
int n = 0; |
|
int i; |
|
|
for (p = *pp; isxdigit(*p); p++) { |
for (i = 0, p = *pp; i < 2 && isxdigit(*p); i++, p++) { |
if (isdigit(*p)) |
if (isdigit(*p)) |
n = 16 * n + *p - '0'; |
n = 16 * n + *p - '0'; |
else if (*p >= 'a' && *p <= 'f') |
else if (*p >= 'a' && *p <= 'f') |
|
|
return n; |
return n; |
} |
} |
|
|
#define isoctdigit(c) ((c) >= '0' && (c) <= '8') /* multiple use of arg */ |
#define isoctdigit(c) ((c) >= '0' && (c) <= '7') /* multiple use of arg */ |
|
|
int quoted(char **pp) /* pick up next thing after a \\ */ |
int quoted(char **pp) /* pick up next thing after a \\ */ |
/* and increment *pp */ |
/* and increment *pp */ |