[BACK]Return to mdoc.h CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/mdoc.h between version 1.105 and 1.119

version 1.105, 2010/10/04 07:01:02 version 1.119, 2011/03/20 16:02:05
Line 1 
Line 1 
 /*      $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 283  enum mdoc_list {
Line 285  enum mdoc_list {
         LIST_inset,          LIST_inset,
         LIST_item,          LIST_item,
         LIST_ohang,          LIST_ohang,
         LIST_tag          LIST_tag,
           LIST_MAX
 };  };
   
 /*  /*
Line 352  struct mdoc_an {
Line 355  struct mdoc_an {
         enum mdoc_auth    auth; /* -split, etc. */          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   * Consists of normalised node arguments.  These should be used instead
  * of iterating through the mdoc_arg pointers of a node: defaults are   * of iterating through the mdoc_arg pointers of a node: defaults are
  * provided, etc.   * provided, etc.
  */   */
 union mdoc_data {  union   mdoc_data {
         struct mdoc_an    An;          struct mdoc_an    An;
         struct mdoc_bd   *Bd;          struct mdoc_bd    Bd;
         struct mdoc_bf   *Bf;          struct mdoc_bf    Bf;
         struct mdoc_bl   *Bl;          struct mdoc_bl    Bl;
           struct mdoc_rs    Rs;
 };  };
   
 /*  /*
Line 370  union mdoc_data {
Line 378  union mdoc_data {
 struct  mdoc_node {  struct  mdoc_node {
         struct mdoc_node *parent; /* parent AST node */          struct mdoc_node *parent; /* parent AST node */
         struct mdoc_node *child; /* first child AST node */          struct mdoc_node *child; /* first child AST node */
           struct mdoc_node *last; /* last child AST node */
         struct mdoc_node *next; /* sibling AST node */          struct mdoc_node *next; /* sibling AST node */
         struct mdoc_node *prev; /* prior sibling AST node */          struct mdoc_node *prev; /* prior sibling AST node */
         int               nchild; /* number children */          int               nchild; /* number children */
Line 378  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 */
 #define MDOC_ENDED       (1 << 5) /* rendering has been ended */  #define MDOC_ENDED       (1 << 5) /* rendering has been ended */
         enum mdoc_type    type; /* AST node type */          enum mdoc_type    type; /* AST node type */
         enum mdoc_sec     sec; /* current named section */          enum mdoc_sec     sec; /* current named section */
           union mdoc_data  *norm; /* normalised args */
         /* FIXME: these can be union'd to shave a few bytes. */          /* FIXME: these can be union'd to shave a few bytes. */
         struct mdoc_arg  *args; /* BLOCK/ELEM */          struct mdoc_arg  *args; /* BLOCK/ELEM */
         struct mdoc_node *pending; /* BLOCK */          struct mdoc_node *pending; /* BLOCK */
Line 392  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 */
         union mdoc_data   data;  
 };  };
   
 /*  /*
Line 414  __BEGIN_DECLS
Line 424  __BEGIN_DECLS
 struct  mdoc;  struct  mdoc;
   
 void              mdoc_free(struct mdoc *);  void              mdoc_free(struct mdoc *);
 struct  mdoc     *mdoc_alloc(struct regset *, void *, mandocmsg);  struct  mdoc     *mdoc_alloc(struct regset *, struct mparse *);
 void              mdoc_reset(struct mdoc *);  void              mdoc_reset(struct mdoc *);
 int               mdoc_parseln(struct mdoc *, int, char *, int);  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
   

Legend:
Removed from v.1.105  
changed lines
  Added in v.1.119

CVSweb