version 1.112, 2010/12/25 23:25:53 |
version 1.118, 2011/03/07 01:35:51 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
Line 190 enum mdoc_type { |
|
Line 190 enum mdoc_type { |
|
MDOC_TAIL, |
MDOC_TAIL, |
MDOC_BODY, |
MDOC_BODY, |
MDOC_BLOCK, |
MDOC_BLOCK, |
|
MDOC_TBL, |
|
MDOC_EQN, |
MDOC_ROOT |
MDOC_ROOT |
}; |
}; |
|
|
Line 230 struct mdoc_meta { |
|
Line 232 struct mdoc_meta { |
|
char *msec; /* `Dt' section (1, 3p, etc.) */ |
char *msec; /* `Dt' section (1, 3p, etc.) */ |
char *vol; /* `Dt' volume (implied) */ |
char *vol; /* `Dt' volume (implied) */ |
char *arch; /* `Dt' arch (i386, etc.) */ |
char *arch; /* `Dt' arch (i386, etc.) */ |
time_t date; /* `Dd' normalised date */ |
char *date; /* `Dd' normalised date */ |
char *title; /* `Dt' title (FOO, etc.) */ |
char *title; /* `Dt' title (FOO, etc.) */ |
char *os; /* `Os' system (OpenBSD, etc.) */ |
char *os; /* `Os' system (OpenBSD, etc.) */ |
char *name; /* leading `Nm' name */ |
char *name; /* leading `Nm' name */ |
Line 354 struct mdoc_an { |
|
Line 356 struct mdoc_an { |
|
}; |
}; |
|
|
struct mdoc_rs { |
struct mdoc_rs { |
struct mdoc_node *child_J; /* pointer to %J */ |
int quote_T; /* whether to quote %T */ |
}; |
}; |
|
|
/* |
/* |
Line 385 struct mdoc_node { |
|
Line 387 struct mdoc_node { |
|
enum mdoct tok; /* tok or MDOC__MAX if none */ |
enum mdoct tok; /* tok or MDOC__MAX if none */ |
int flags; |
int flags; |
#define MDOC_VALID (1 << 0) /* has been validated */ |
#define MDOC_VALID (1 << 0) /* has been validated */ |
#define MDOC_ACTED (1 << 1) /* has been acted upon */ |
|
#define MDOC_EOS (1 << 2) /* at sentence boundary */ |
#define MDOC_EOS (1 << 2) /* at sentence boundary */ |
#define MDOC_LINE (1 << 3) /* first macro/text on line */ |
#define MDOC_LINE (1 << 3) /* first macro/text on line */ |
#define MDOC_SYNPRETTY (1 << 4) /* SYNOPSIS-style formatting */ |
#define MDOC_SYNPRETTY (1 << 4) /* SYNOPSIS-style formatting */ |
Line 400 struct mdoc_node { |
|
Line 401 struct mdoc_node { |
|
struct mdoc_node *body; /* BLOCK */ |
struct mdoc_node *body; /* BLOCK */ |
struct mdoc_node *tail; /* BLOCK */ |
struct mdoc_node *tail; /* BLOCK */ |
char *string; /* TEXT */ |
char *string; /* TEXT */ |
|
const struct tbl_span *span; /* TBL */ |
|
const struct eqn *eqn; /* EQN */ |
enum mdoc_endbody end; /* BODY */ |
enum mdoc_endbody end; /* BODY */ |
}; |
}; |
|
|
Line 427 int mdoc_parseln(struct mdoc *, int, char *, int); |
|
Line 430 int mdoc_parseln(struct mdoc *, int, char *, int); |
|
const struct mdoc_node *mdoc_node(const struct mdoc *); |
const struct mdoc_node *mdoc_node(const struct mdoc *); |
const struct mdoc_meta *mdoc_meta(const struct mdoc *); |
const struct mdoc_meta *mdoc_meta(const struct mdoc *); |
int mdoc_endparse(struct mdoc *); |
int mdoc_endparse(struct mdoc *); |
|
int mdoc_addspan(struct mdoc *, |
|
const struct tbl_span *); |
|
int mdoc_addeqn(struct mdoc *, |
|
const struct eqn *); |
|
|
__END_DECLS |
__END_DECLS |
|
|