version 1.20, 2008/12/07 22:40:18 |
version 1.22, 2008/12/08 16:29:57 |
Line 64 static void mlg_roffmsg(void *arg, |
|
Line 64 static void mlg_roffmsg(void *arg, |
|
const char *, const char *); |
const char *, const char *); |
static int mlg_roffhead(void *, const struct tm *, |
static int mlg_roffhead(void *, const struct tm *, |
const char *, const char *, |
const char *, const char *, |
const char *, const char *); |
enum roffmsec, const char *); |
static int mlg_rofftail(void *); |
static int mlg_rofftail(void *); |
static int mlg_roffin(void *, int, |
static int mlg_roffin(void *, int, |
int *, const char **); |
int *, const char **); |
Line 362 mlg_exit(struct md_mlg *p, int flush) |
|
Line 362 mlg_exit(struct md_mlg *p, int flush) |
|
int c; |
int c; |
|
|
c = roff_free(p->tree, flush); |
c = roff_free(p->tree, flush); |
free(p); |
|
|
|
(*p->cbs.ml_free)(p->data); |
(*p->cbs.ml_free)(p->data); |
|
|
|
free(p); |
|
|
return(c); |
return(c); |
} |
} |
|
|
Line 415 mlg_alloc(const struct md_args *args, |
|
Line 415 mlg_alloc(const struct md_args *args, |
|
|
|
static int |
static int |
mlg_roffhead(void *arg, const struct tm *tm, const char *os, |
mlg_roffhead(void *arg, const struct tm *tm, const char *os, |
const char *title, const char *sec, const char *vol) |
const char *title, enum roffmsec sec, const char *vol) |
{ |
{ |
struct md_mlg *p; |
struct md_mlg *p; |
|
|
Line 462 mlg_literal_special(struct md_mlg *p, int tok, const c |
|
Line 462 mlg_literal_special(struct md_mlg *p, int tok, const c |
|
if ( ! mlg_begintag(p, MD_NS_INLINE, tok, NULL, more)) |
if ( ! mlg_begintag(p, MD_NS_INLINE, tok, NULL, more)) |
return(0); |
return(0); |
|
|
|
/* FIXME: must be ml-filtered. */ |
|
|
lit = ml_literal(tok, argc, argv, more); |
lit = ml_literal(tok, argc, argv, more); |
assert(lit); |
assert(lit); |
|
|
Line 510 mlg_formatted_special(struct md_mlg *p, int tok, |
|
Line 512 mlg_formatted_special(struct md_mlg *p, int tok, |
|
{ |
{ |
char buf[256], *lit; |
char buf[256], *lit; |
|
|
/* FIXME: *more must be ml-filtered. */ |
|
|
|
if ( ! mlg_begintag(p, MD_NS_INLINE, tok, NULL, more)) |
if ( ! mlg_begintag(p, MD_NS_INLINE, tok, NULL, more)) |
return(0); |
return(0); |
|
|
|
/* FIXME: must be ml-filtered. */ |
|
|
lit = ml_literal(tok, argc, argv, more); |
lit = ml_literal(tok, argc, argv, more); |
|
|
assert(lit); |
assert(lit); |
assert(*more); |
assert(*more); |
(void)snprintf(buf, sizeof(buf), lit, *more++); |
(void)snprintf(buf, sizeof(buf), lit, *more++); |
Line 540 mlg_atom_special(struct md_mlg *p, int tok, |
|
Line 543 mlg_atom_special(struct md_mlg *p, int tok, |
|
if ( ! mlg_string(p, start, *more++)) |
if ( ! mlg_string(p, start, *more++)) |
return(0); |
return(0); |
|
|
assert(NULL == *more); |
/*assert(NULL == *more);*/ /* FIXME: ROFF_Sx */ |
return(mlg_endtag(p, MD_NS_INLINE, tok)); |
return(mlg_endtag(p, MD_NS_INLINE, tok)); |
} |
} |
|
|
Line 787 mlg_msg(struct md_mlg *p, enum roffmsg lvl, |
|
Line 790 mlg_msg(struct md_mlg *p, enum roffmsg lvl, |
|
const char *buf, const char *pos, const char *msg) |
const char *buf, const char *pos, const char *msg) |
{ |
{ |
char *level; |
char *level; |
|
char b[256]; |
|
int i; |
|
|
switch (lvl) { |
switch (lvl) { |
case (ROFF_WARN): |
case (ROFF_WARN): |
Line 800 mlg_msg(struct md_mlg *p, enum roffmsg lvl, |
|
Line 805 mlg_msg(struct md_mlg *p, enum roffmsg lvl, |
|
default: |
default: |
abort(); |
abort(); |
} |
} |
|
|
if (pos) |
if (pos) { |
(void)fprintf(stderr, "%s:%zu: %s: %s (column %zu)\n", |
assert(pos >= buf); |
p->rbuf->name, p->rbuf->line, level, |
if (0 < p->args->verbosity) { |
msg, pos - buf); |
(void)snprintf(b, sizeof(b), |
else |
"%s:%zu: %s: %s\n", |
(void)fprintf(stderr, "%s: %s: %s\n", |
p->rbuf->name, p->rbuf->line, |
|
level, msg); |
|
(void)strlcat(b, "Error at: ", sizeof(b)); |
|
(void)strlcat(b, p->rbuf->linebuf, sizeof(b)); |
|
|
|
(void)strlcat(b, "\n ", sizeof(b)); |
|
for (i = 0; i < pos - buf; i++) |
|
(void)strlcat(b, " ", sizeof(b)); |
|
(void)strlcat(b, "^", sizeof(b)); |
|
|
|
} else |
|
(void)snprintf(b, sizeof(b), |
|
"%s:%zu: %s: %s (col %zu)", |
|
p->rbuf->name, p->rbuf->line, |
|
level, msg, pos - buf); |
|
} else |
|
(void)snprintf(b, sizeof(b), "%s: %s: %s", |
p->rbuf->name, level, msg); |
p->rbuf->name, level, msg); |
|
|
|
(void)fprintf(stderr, "%s\n", b); |
} |
} |
|
|