version 1.155, 2011/07/27 07:32:26 |
version 1.159, 2011/07/27 14:19:26 |
Line 166 static const char *roff_getstrn(const struct roff *, |
|
Line 166 static const char *roff_getstrn(const struct roff *, |
|
const char *, size_t); |
const char *, size_t); |
static enum rofferr roff_line_ignore(ROFF_ARGS); |
static enum rofferr roff_line_ignore(ROFF_ARGS); |
static enum rofferr roff_nr(ROFF_ARGS); |
static enum rofferr roff_nr(ROFF_ARGS); |
|
static void roff_openeqn(struct roff *, const char *, |
|
int, int, const char *); |
static enum rofft roff_parse(struct roff *, const char *, int *); |
static enum rofft roff_parse(struct roff *, const char *, int *); |
static enum rofferr roff_parsetext(char *); |
static enum rofferr roff_parsetext(char *); |
static void roff_res(struct roff *, |
static void roff_res(struct roff *, |
Line 528 roff_parsetext(char *p) |
|
Line 530 roff_parsetext(char *p) |
|
sz = strcspn(p, "-\\"); |
sz = strcspn(p, "-\\"); |
p += sz; |
p += sz; |
|
|
|
if ('\0' == *p) |
|
break; |
|
|
if ('\\' == *p) { |
if ('\\' == *p) { |
/* Skip over escapes. */ |
/* Skip over escapes. */ |
p++; |
p++; |
Line 536 roff_parsetext(char *p) |
|
Line 541 roff_parsetext(char *p) |
|
if (ESCAPE_ERROR == esc) |
if (ESCAPE_ERROR == esc) |
break; |
break; |
continue; |
continue; |
} else if ('-' != *p || p == start) |
} else if (p == start) { |
|
p++; |
continue; |
continue; |
|
} |
|
|
l = *(p - 1); |
l = *(p - 1); |
r = *(p + 1); |
r = *(p + 1); |
|
|
if ('\\' != l && |
if ('\\' != l && |
'\t' != r && '\t' != l && |
'\t' != r && '\t' != l && |
' ' != r && ' ' != l && |
' ' != r && ' ' != l && |
'-' != r && '-' != l && |
'-' != r && '-' != l && |
! isdigit((unsigned char)l) && |
! isdigit((unsigned char)l) && |
! isdigit((unsigned char)r)) |
! isdigit((unsigned char)r)) |
*p = ASCII_HYPH; |
*p = ASCII_HYPH; |
p++; |
p++; |
} |
} |
Line 1258 roff_T_(ROFF_ARGS) |
|
Line 1264 roff_T_(ROFF_ARGS) |
|
return(ROFF_IGN); |
return(ROFF_IGN); |
} |
} |
|
|
int |
#if 0 |
|
static int |
roff_closeeqn(struct roff *r) |
roff_closeeqn(struct roff *r) |
{ |
{ |
|
|
return(r->eqn && ROFF_EQN == eqn_end(&r->eqn) ? 1 : 0); |
return(r->eqn && ROFF_EQN == eqn_end(&r->eqn) ? 1 : 0); |
} |
} |
|
#endif |
|
|
void |
static void |
roff_openeqn(struct roff *r, const char *name, int line, |
roff_openeqn(struct roff *r, const char *name, int line, |
int offs, const char *buf) |
int offs, const char *buf) |
{ |
{ |
Line 1515 roff_getstrn(const struct roff *r, const char *name, s |
|
Line 1523 roff_getstrn(const struct roff *r, const char *name, s |
|
{ |
{ |
const struct roffstr *n; |
const struct roffstr *n; |
|
|
n = r->first_string; |
for (n = r->first_string; n; n = n->next) |
while (n && (strncmp(name, n->name, len) || '\0' != n->name[(int)len])) |
if (0 == strncmp(name, n->name, len) && |
n = n->next; |
'\0' == n->name[(int)len]) |
|
return(n->string); |
|
|
return(n ? n->string : NULL); |
return(NULL); |
} |
} |
|
|
static void |
static void |