=================================================================== RCS file: /cvs/mandoc/mdoc.h,v retrieving revision 1.81 retrieving revision 1.91 diff -u -p -r1.81 -r1.91 --- mandoc/mdoc.h 2010/05/17 22:11:42 1.81 +++ mandoc/mdoc.h 2010/06/26 15:22:19 1.91 @@ -1,6 +1,6 @@ -/* $Id: mdoc.h,v 1.81 2010/05/17 22:11:42 kristaps Exp $ */ +/* $Id: mdoc.h,v 1.91 2010/06/26 15:22:19 kristaps Exp $ */ /* - * Copyright (c) 2008, 2009 Kristaps Dzonsons + * Copyright (c) 2008, 2009 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -149,11 +149,13 @@ enum mdoct { MDOC_br, MDOC_sp, MDOC__U, + MDOC_Ta, MDOC_MAX }; /* What follows is a list of ALL possible macro arguments. */ +/* FIXME: make this into an enum. */ #define MDOC_Split 0 #define MDOC_Nosplit 1 #define MDOC_Ragged 2 @@ -247,6 +249,43 @@ struct mdoc_arg { unsigned int refcnt; }; +enum mdoc_list { + LIST__NONE = 0, + LIST_bullet, + LIST_column, + LIST_dash, + LIST_diag, + LIST_enum, + LIST_hang, + LIST_hyphen, + LIST_inset, + LIST_item, + LIST_ohang, + LIST_tag +}; + +enum mdoc_disp { + DISP__NONE = 0, + DISP_centred, + DISP_ragged, + DISP_unfilled, + DISP_filled, + DISP_literal +}; + +struct mdoc_bd { + const char *offs; /* -offset */ + enum mdoc_disp type; /* -ragged, etc. */ + int comp; /* -compact */ +}; + +struct mdoc_bl { + const char *width; /* -width */ + const char *offs; /* -offset */ + enum mdoc_list type; /* -tag, -enum, etc. */ + int comp; /* -compact */ +}; + /* Node in AST. */ struct mdoc_node { struct mdoc_node *parent; /* parent AST node */ @@ -272,6 +311,11 @@ struct mdoc_node { struct mdoc_node *body; /* BLOCK */ struct mdoc_node *tail; /* BLOCK */ char *string; /* TEXT */ + + union { + struct mdoc_bl Bl; + struct mdoc_bd Bd; + } data; }; #define MDOC_IGN_SCOPE (1 << 0) /* Ignore scope violations. */