version 1.25, 2008/12/10 10:43:57 |
version 1.28, 2008/12/10 13:41:58 |
|
|
MD_INLINE_IN, |
MD_INLINE_IN, |
MD_INLINE_OUT, |
MD_INLINE_OUT, |
MD_BLK_IN, |
MD_BLK_IN, |
MD_BLK_OUT, |
MD_BLK_OUT |
}; |
}; |
|
|
struct md_mlg { |
struct md_mlg { |
Line 59 static int mlg_roffmsg(void *arg, |
|
Line 59 static int mlg_roffmsg(void *arg, |
|
static int mlg_roffhead(void *, const struct tm *, |
static int mlg_roffhead(void *, const struct tm *, |
const char *, const char *, |
const char *, const char *, |
enum roffmsec, enum roffvol); |
enum roffmsec, enum roffvol); |
static int mlg_rofftail(void *); |
static int mlg_rofftail(void *, const struct tm *, |
|
const char *, const char *, |
|
enum roffmsec, enum roffvol); |
static int mlg_roffin(void *, int, |
static int mlg_roffin(void *, int, |
int *, const char **); |
int *, const char **); |
static int mlg_roffdata(void *, int, |
static int mlg_roffdata(void *, int, |
Line 90 static int mlg_function_special(struct md_mlg *, |
|
Line 92 static int mlg_function_special(struct md_mlg *, |
|
const char *, const char **); |
const char *, const char **); |
static int mlg_atom_special(struct md_mlg *, int, |
static int mlg_atom_special(struct md_mlg *, int, |
const char *, const char **); |
const char *, const char **); |
|
static int mlg_link_special(struct md_mlg *, int, |
|
const char *, const char **); |
|
static int mlg_anchor_special(struct md_mlg *, |
|
int, const char **); |
|
|
static int mlg_begintag(struct md_mlg *, enum md_ns, |
static int mlg_begintag(struct md_mlg *, enum md_ns, |
int, int *, const char **); |
int, int *, const char **); |
Line 413 mlg_roffhead(void *arg, const struct tm *tm, const cha |
|
Line 419 mlg_roffhead(void *arg, const struct tm *tm, const cha |
|
|
|
mlg_mode(p, MD_BLK_IN); |
mlg_mode(p, MD_BLK_IN); |
|
|
if ( ! (*p->cbs.ml_begin)(p->mbuf, p->args, tm, os, title, sec, vol)) |
if ( ! (*p->cbs.ml_begin)(p->mbuf, p->args, |
|
tm, os, title, sec, vol)) |
return(0); |
return(0); |
|
|
p->indent++; |
p->indent++; |
Line 422 mlg_roffhead(void *arg, const struct tm *tm, const cha |
|
Line 429 mlg_roffhead(void *arg, const struct tm *tm, const cha |
|
|
|
|
|
static int |
static int |
mlg_rofftail(void *arg) |
mlg_rofftail(void *arg, const struct tm *tm, const char *os, |
|
const char *title, enum roffmsec sec, enum roffvol vol) |
{ |
{ |
struct md_mlg *p; |
struct md_mlg *p; |
|
|
Line 433 mlg_rofftail(void *arg) |
|
Line 441 mlg_rofftail(void *arg) |
|
if ( ! mlg_newline(p)) |
if ( ! mlg_newline(p)) |
return(0); |
return(0); |
|
|
if ( ! (*p->cbs.ml_end)(p->mbuf, p->args)) |
if ( ! (*p->cbs.ml_end)(p->mbuf, p->args, |
|
tm, os, title, sec, vol)) |
return(0); |
return(0); |
|
|
mlg_mode(p, MD_BLK_OUT); |
mlg_mode(p, MD_BLK_OUT); |
|
|
return(mlg_newline(p)); |
return(mlg_newline(p)); |
} |
} |
|
|
Line 494 mlg_ref_special(struct md_mlg *p, int tok, |
|
Line 502 mlg_ref_special(struct md_mlg *p, int tok, |
|
} |
} |
|
|
|
|
|
/* ARGSUSED */ |
static int |
static int |
mlg_formatted_special(struct md_mlg *p, int tok, const char *start, |
mlg_formatted_special(struct md_mlg *p, int tok, const char *start, |
const int *argc, const char **argv, const char **more) |
const int *argc, const char **argv, const char **more) |
Line 529 mlg_atom_special(struct md_mlg *p, int tok, |
|
Line 538 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);*/ /* FIXME: ROFF_Sx */ |
|
return(mlg_endtag(p, MD_NS_INLINE, tok)); |
return(mlg_endtag(p, MD_NS_INLINE, tok)); |
} |
} |
|
|
Line 578 mlg_function_special(struct md_mlg *p, |
|
Line 586 mlg_function_special(struct md_mlg *p, |
|
} |
} |
|
|
|
|
|
static int |
|
mlg_anchor_special(struct md_mlg *p, int tok, const char **more) |
|
{ |
|
if ( ! mlg_begintag(p, MD_NS_INLINE, tok, NULL, more)) |
|
return(0); |
|
return(mlg_endtag(p, MD_NS_INLINE, tok)); |
|
} |
|
|
|
|
|
static int |
|
mlg_link_special(struct md_mlg *p, int tok, |
|
const char *start, const char **more) |
|
{ |
|
|
|
if ( ! mlg_begintag(p, MD_NS_INLINE, tok, NULL, more)) |
|
return(0); |
|
if ( ! mlg_string(p, start, *more++)) |
|
return(0); |
|
while (*more) { |
|
if ( ! mlg_string(p, start, " ")) |
|
return(0); |
|
if ( ! mlg_string(p, start, *more++)) |
|
return(0); |
|
} |
|
return(mlg_endtag(p, MD_NS_INLINE, tok)); |
|
} |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
static int |
static int |
mlg_roffspecial(void *arg, int tok, const char *start, |
mlg_roffspecial(void *arg, int tok, const char *start, |
Line 606 mlg_roffspecial(void *arg, int tok, const char *start, |
|
Line 642 mlg_roffspecial(void *arg, int tok, const char *start, |
|
|
|
case (ROFF_Xr): |
case (ROFF_Xr): |
return(mlg_ref_special(p, tok, start, more)); |
return(mlg_ref_special(p, tok, start, more)); |
|
|
|
case (ROFF_Sh): |
|
return(mlg_anchor_special(p, tok, more)); |
|
|
case (ROFF_Sx): /* FIXME */ |
case (ROFF_Sx): |
/* FALLTHROUGH */ |
return(mlg_link_special(p, tok, start, more)); |
|
|
case (ROFF_Nm): |
case (ROFF_Nm): |
return(mlg_atom_special(p, tok, start, more)); |
return(mlg_atom_special(p, tok, start, more)); |
|
|