=================================================================== RCS file: /cvs/mandoc/mdoc.h,v retrieving revision 1.94 retrieving revision 1.100 diff -u -p -r1.94 -r1.100 --- mandoc/mdoc.h 2010/06/27 16:18:13 1.94 +++ mandoc/mdoc.h 2010/07/04 21:59:30 1.100 @@ -1,4 +1,4 @@ -/* $Id: mdoc.h,v 1.94 2010/06/27 16:18:13 kristaps Exp $ */ +/* $Id: mdoc.h,v 1.100 2010/07/04 21:59:30 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -249,6 +249,12 @@ struct mdoc_arg { unsigned int refcnt; }; +enum mdoc_endbody { + ENDBODY_NOT = 0, + ENDBODY_SPACE, + ENDBODY_NOSPACE +}; + enum mdoc_list { LIST__NONE = 0, LIST_bullet, @@ -273,6 +279,19 @@ enum mdoc_disp { DISP_literal }; +enum mdoc_auth { + AUTH__NONE = 0, + AUTH_split, + AUTH_nosplit +}; + +enum mdoc_font { + FONT__NONE = 0, + FONT_Em, + FONT_Li, + FONT_Sy +}; + struct mdoc_bd { const char *offs; /* -offset */ enum mdoc_disp type; /* -ragged, etc. */ @@ -284,8 +303,18 @@ struct mdoc_bl { const char *offs; /* -offset */ enum mdoc_list type; /* -tag, -enum, etc. */ int comp; /* -compact */ + size_t ncols; /* -column arg count */ + const char **cols; /* -column val ptr */ }; +struct mdoc_bf { + enum mdoc_font font; /* font */ +}; + +struct mdoc_an { + enum mdoc_auth auth; /* -split, etc. */ +}; + /* Node in AST. */ struct mdoc_node { struct mdoc_node *parent; /* parent AST node */ @@ -302,6 +331,7 @@ struct mdoc_node { #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 */ /* FIXME: these can be union'd to shave a few bytes. */ @@ -311,10 +341,13 @@ struct mdoc_node { struct mdoc_node *body; /* BLOCK */ struct mdoc_node *tail; /* BLOCK */ char *string; /* TEXT */ + enum mdoc_endbody end; /* BODY */ union { - struct mdoc_bl Bl; - struct mdoc_bd Bd; + struct mdoc_an An; + struct mdoc_bd *Bd; + struct mdoc_bf *Bf; + struct mdoc_bl *Bl; } data; };