=================================================================== RCS file: /cvs/mandoc/mdoc.h,v retrieving revision 1.109 retrieving revision 1.116 diff -u -p -r1.109 -r1.116 --- mandoc/mdoc.h 2010/12/22 11:15:16 1.109 +++ mandoc/mdoc.h 2011/02/06 21:44:36 1.116 @@ -1,4 +1,4 @@ -/* $Id: mdoc.h,v 1.109 2010/12/22 11:15:16 kristaps Exp $ */ +/* $Id: mdoc.h,v 1.116 2011/02/06 21:44:36 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * @@ -190,6 +190,8 @@ enum mdoc_type { MDOC_TAIL, MDOC_BODY, MDOC_BLOCK, + MDOC_TBL, + MDOC_EQN, MDOC_ROOT }; @@ -353,6 +355,10 @@ struct mdoc_an { enum mdoc_auth auth; /* -split, etc. */ }; +struct mdoc_rs { + int quote_T; /* whether to quote %T */ +}; + /* * Consists of normalised node arguments. These should be used instead * of iterating through the mdoc_arg pointers of a node: defaults are @@ -363,17 +369,9 @@ union mdoc_data { struct mdoc_bd Bd; struct mdoc_bf Bf; struct mdoc_bl Bl; + struct mdoc_rs Rs; }; -/* - * Reference-counted structure for containing normalised arguments of - * certain macros (those listed in union mdoc_data). - */ -struct mdoc_norm { - int refcnt; - union mdoc_data d; -}; - /* * Single node in tree-linked AST. */ @@ -389,14 +387,13 @@ struct mdoc_node { enum mdoct tok; /* tok or MDOC__MAX if none */ int flags; #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_LINE (1 << 3) /* first macro/text on line */ #define MDOC_SYNPRETTY (1 << 4) /* SYNOPSIS-style formatting */ #define MDOC_ENDED (1 << 5) /* rendering has been ended */ enum mdoc_type type; /* AST node type */ enum mdoc_sec sec; /* current named section */ - struct mdoc_norm *norm; /* ref-counted, normalised args */ + union mdoc_data *norm; /* normalised args */ /* FIXME: these can be union'd to shave a few bytes. */ struct mdoc_arg *args; /* BLOCK/ELEM */ struct mdoc_node *pending; /* BLOCK */ @@ -404,6 +401,7 @@ struct mdoc_node { struct mdoc_node *body; /* BLOCK */ struct mdoc_node *tail; /* BLOCK */ char *string; /* TEXT */ + const struct tbl_span *span; /* TBL */ enum mdoc_endbody end; /* BODY */ }; @@ -431,6 +429,8 @@ int mdoc_parseln(struct mdoc *, int, char *, int); const struct mdoc_node *mdoc_node(const struct mdoc *); const struct mdoc_meta *mdoc_meta(const struct mdoc *); int mdoc_endparse(struct mdoc *); +int mdoc_addspan(struct mdoc *, + const struct tbl_span *); __END_DECLS