version 1.269, 2015/04/23 16:17:44 |
version 1.272, 2015/06/27 13:29:14 |
Line 397 static enum rofferr roff_cond_text(ROFF_ARGS); |
|
Line 397 static enum rofferr roff_cond_text(ROFF_ARGS); |
|
static enum rofferr roff_cond_sub(ROFF_ARGS); |
static enum rofferr roff_cond_sub(ROFF_ARGS); |
static enum rofferr roff_ds(ROFF_ARGS); |
static enum rofferr roff_ds(ROFF_ARGS); |
static enum rofferr roff_eqndelim(struct roff *, struct buf *, int); |
static enum rofferr roff_eqndelim(struct roff *, struct buf *, int); |
static int roff_evalcond(struct roff *r, int, |
static int roff_evalcond(struct roff *r, int, char *, int *); |
const char *, int *); |
|
static int roff_evalnum(struct roff *, int, |
static int roff_evalnum(struct roff *, int, |
const char *, int *, int *, int); |
const char *, int *, int *, int); |
static int roff_evalpar(struct roff *, int, |
static int roff_evalpar(struct roff *, int, |
Line 415 static int roff_getregn(const struct roff *, |
|
Line 414 static int roff_getregn(const struct roff *, |
|
static int roff_getregro(const char *name); |
static int roff_getregro(const char *name); |
static const char *roff_getstrn(const struct roff *, |
static const char *roff_getstrn(const struct roff *, |
const char *, size_t); |
const char *, size_t); |
|
static int roff_hasregn(const struct roff *, |
|
const char *, size_t); |
static enum rofferr roff_insec(ROFF_ARGS); |
static enum rofferr roff_insec(ROFF_ARGS); |
static enum rofferr roff_it(ROFF_ARGS); |
static enum rofferr roff_it(ROFF_ARGS); |
static enum rofferr roff_line_ignore(ROFF_ARGS); |
static enum rofferr roff_line_ignore(ROFF_ARGS); |
Line 1022 roff_node_append(struct roff_man *man, struct roff_nod |
|
Line 1023 roff_node_append(struct roff_man *man, struct roff_nod |
|
/* NOTREACHED */ |
/* NOTREACHED */ |
} |
} |
n->parent->nchild++; |
n->parent->nchild++; |
|
n->parent->last = n; |
|
|
/* |
/* |
* Copy over the normalised-data pointer of our parent. Not |
* Copy over the normalised-data pointer of our parent. Not |
|
|
* or string condition. |
* or string condition. |
*/ |
*/ |
static int |
static int |
roff_evalcond(struct roff *r, int ln, const char *v, int *pos) |
roff_evalcond(struct roff *r, int ln, char *v, int *pos) |
{ |
{ |
|
char *cp, *name; |
|
size_t sz; |
int number, savepos, wanttrue; |
int number, savepos, wanttrue; |
|
|
if ('!' == v[*pos]) { |
if ('!' == v[*pos]) { |
Line 2157 roff_evalcond(struct roff *r, int ln, const char *v, i |
|
Line 2161 roff_evalcond(struct roff *r, int ln, const char *v, i |
|
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case 'e': |
case 'e': |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case 'r': |
|
/* FALLTHROUGH */ |
|
case 't': |
case 't': |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case 'v': |
case 'v': |
(*pos)++; |
(*pos)++; |
return(!wanttrue); |
return(!wanttrue); |
|
case 'r': |
|
cp = name = v + ++*pos; |
|
sz = roff_getname(r, &cp, ln, *pos); |
|
*pos = cp - v; |
|
return((sz && roff_hasregn(r, name, sz)) == wanttrue); |
default: |
default: |
break; |
break; |
} |
} |
Line 2258 roff_cond(ROFF_ARGS) |
|
Line 2265 roff_cond(ROFF_ARGS) |
|
if (buf->buf[pos] == '\\' && buf->buf[pos + 1] == '{') { |
if (buf->buf[pos] == '\\' && buf->buf[pos + 1] == '{') { |
r->last->endspan = -1; |
r->last->endspan = -1; |
pos += 2; |
pos += 2; |
|
while (buf->buf[pos] == ' ') |
|
pos++; |
goto out; |
goto out; |
} |
} |
|
|
Line 2622 roff_getregn(const struct roff *r, const char *name, s |
|
Line 2631 roff_getregn(const struct roff *r, const char *name, s |
|
if (len == reg->key.sz && |
if (len == reg->key.sz && |
0 == strncmp(name, reg->key.p, len)) |
0 == strncmp(name, reg->key.p, len)) |
return(reg->val); |
return(reg->val); |
|
|
|
return(0); |
|
} |
|
|
|
static int |
|
roff_hasregn(const struct roff *r, const char *name, size_t len) |
|
{ |
|
struct roffreg *reg; |
|
int val; |
|
|
|
if ('.' == name[0] && 2 == len) { |
|
val = roff_getregro(name + 1); |
|
if (-1 != val) |
|
return(1); |
|
} |
|
|
|
for (reg = r->regtab; reg; reg = reg->next) |
|
if (len == reg->key.sz && |
|
0 == strncmp(name, reg->key.p, len)) |
|
return(1); |
|
|
return(0); |
return(0); |
} |
} |