Print this page
9718 update mandoc to 1.14.4
   1 /*      $Id: mandoc.h,v 1.245 2017/07/08 14:51:04 schwarze Exp $ */
   2 /*
   3  * Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
   4  * Copyright (c) 2010-2017 Ingo Schwarze <schwarze@openbsd.org>
   5  *
   6  * Permission to use, copy, modify, and distribute this software for any
   7  * purpose with or without fee is hereby granted, provided that the above
   8  * copyright notice and this permission notice appear in all copies.
   9  *
  10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
  11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
  13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  17  */
  18 
  19 #define ASCII_NBRSP      31  /* non-breaking space */
  20 #define ASCII_HYPH       30  /* breakable hyphen */
  21 #define ASCII_BREAK      29  /* breakable zero-width space */
  22 
  23 /*
  24  * Status level.  This refers to both internal status (i.e., whilst


  39 
  40 /*
  41  * All possible things that can go wrong within a parse, be it libroff,
  42  * libmdoc, or libman.
  43  */
  44 enum    mandocerr {
  45         MANDOCERR_OK,
  46 
  47         MANDOCERR_BASE, /* ===== start of base system conventions ===== */
  48 
  49         MANDOCERR_MDOCDATE, /* Mdocdate found: Dd ... */
  50         MANDOCERR_MDOCDATE_MISSING, /* Mdocdate missing: Dd ... */
  51         MANDOCERR_ARCH_BAD,  /* unknown architecture: Dt ... arch */
  52         MANDOCERR_OS_ARG,  /* operating system explicitly specified: Os ... */
  53         MANDOCERR_RCS_MISSING, /* RCS id missing */
  54         MANDOCERR_XR_BAD,  /* referenced manual not found: Xr name sec */
  55 
  56         MANDOCERR_STYLE, /* ===== start of style suggestions ===== */
  57 
  58         MANDOCERR_DATE_LEGACY, /* legacy man(7) date format: Dd ... */

  59         MANDOCERR_TITLE_CASE, /* lower case character in document title */
  60         MANDOCERR_RCS_REP, /* duplicate RCS id: ... */
  61         MANDOCERR_SEC_TYPO,  /* typo in section name: Sh ... */
  62         MANDOCERR_ARG_QUOTE, /* unterminated quoted argument */
  63         MANDOCERR_MACRO_USELESS, /* useless macro: macro */
  64         MANDOCERR_BX, /* consider using OS macro: macro */
  65         MANDOCERR_ER_ORDER, /* errnos out of order: Er ... */
  66         MANDOCERR_ER_REP, /* duplicate errno: Er ... */
  67         MANDOCERR_DELIM, /* trailing delimiter: macro ... */
  68         MANDOCERR_DELIM_NB, /* no blank before trailing delimiter: macro ... */
  69         MANDOCERR_FI_SKIP, /* fill mode already enabled, skipping: fi */
  70         MANDOCERR_NF_SKIP, /* fill mode already disabled, skipping: nf */

  71         MANDOCERR_FUNC, /* function name without markup: name() */
  72         MANDOCERR_SPACE_EOL, /* whitespace at end of input line */
  73         MANDOCERR_COMMENT_BAD, /* bad comment style */
  74 
  75         MANDOCERR_WARNING, /* ===== start of warnings ===== */
  76 
  77         /* related to the prologue */
  78         MANDOCERR_DT_NOTITLE, /* missing manual title, using UNTITLED: line */
  79         MANDOCERR_TH_NOTITLE, /* missing manual title, using "": [macro] */
  80         MANDOCERR_MSEC_MISSING, /* missing manual section, using "": macro */
  81         MANDOCERR_MSEC_BAD, /* unknown manual section: Dt ... section */
  82         MANDOCERR_DATE_MISSING, /* missing date, using today's date */
  83         MANDOCERR_DATE_BAD, /* cannot parse date, using it verbatim: date */
  84         MANDOCERR_DATE_FUTURE, /* date in the future, using it anyway: date */
  85         MANDOCERR_OS_MISSING, /* missing Os macro, using "" */
  86         MANDOCERR_PROLOG_LATE, /* late prologue macro: macro */
  87         MANDOCERR_PROLOG_ORDER, /* prologue macros out of order: macros */
  88 
  89         /* related to document structure */
  90         MANDOCERR_SO, /* .so is fragile, better use ln(1): so path */


   1 /*      $Id: mandoc.h,v 1.248 2018/07/28 18:34:15 schwarze Exp $ */
   2 /*
   3  * Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
   4  * Copyright (c) 2010-2018 Ingo Schwarze <schwarze@openbsd.org>
   5  *
   6  * Permission to use, copy, modify, and distribute this software for any
   7  * purpose with or without fee is hereby granted, provided that the above
   8  * copyright notice and this permission notice appear in all copies.
   9  *
  10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
  11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
  13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  17  */
  18 
  19 #define ASCII_NBRSP      31  /* non-breaking space */
  20 #define ASCII_HYPH       30  /* breakable hyphen */
  21 #define ASCII_BREAK      29  /* breakable zero-width space */
  22 
  23 /*
  24  * Status level.  This refers to both internal status (i.e., whilst


  39 
  40 /*
  41  * All possible things that can go wrong within a parse, be it libroff,
  42  * libmdoc, or libman.
  43  */
  44 enum    mandocerr {
  45         MANDOCERR_OK,
  46 
  47         MANDOCERR_BASE, /* ===== start of base system conventions ===== */
  48 
  49         MANDOCERR_MDOCDATE, /* Mdocdate found: Dd ... */
  50         MANDOCERR_MDOCDATE_MISSING, /* Mdocdate missing: Dd ... */
  51         MANDOCERR_ARCH_BAD,  /* unknown architecture: Dt ... arch */
  52         MANDOCERR_OS_ARG,  /* operating system explicitly specified: Os ... */
  53         MANDOCERR_RCS_MISSING, /* RCS id missing */
  54         MANDOCERR_XR_BAD,  /* referenced manual not found: Xr name sec */
  55 
  56         MANDOCERR_STYLE, /* ===== start of style suggestions ===== */
  57 
  58         MANDOCERR_DATE_LEGACY, /* legacy man(7) date format: Dd ... */
  59         MANDOCERR_DATE_NORM, /* normalizing date format to: ... */
  60         MANDOCERR_TITLE_CASE, /* lower case character in document title */
  61         MANDOCERR_RCS_REP, /* duplicate RCS id: ... */
  62         MANDOCERR_SEC_TYPO,  /* possible typo in section name: Sh ... */
  63         MANDOCERR_ARG_QUOTE, /* unterminated quoted argument */
  64         MANDOCERR_MACRO_USELESS, /* useless macro: macro */
  65         MANDOCERR_BX, /* consider using OS macro: macro */
  66         MANDOCERR_ER_ORDER, /* errnos out of order: Er ... */
  67         MANDOCERR_ER_REP, /* duplicate errno: Er ... */
  68         MANDOCERR_DELIM, /* trailing delimiter: macro ... */
  69         MANDOCERR_DELIM_NB, /* no blank before trailing delimiter: macro ... */
  70         MANDOCERR_FI_SKIP, /* fill mode already enabled, skipping: fi */
  71         MANDOCERR_NF_SKIP, /* fill mode already disabled, skipping: nf */
  72         MANDOCERR_DASHDASH, /* verbatim "--", maybe consider using \(em */
  73         MANDOCERR_FUNC, /* function name without markup: name() */
  74         MANDOCERR_SPACE_EOL, /* whitespace at end of input line */
  75         MANDOCERR_COMMENT_BAD, /* bad comment style */
  76 
  77         MANDOCERR_WARNING, /* ===== start of warnings ===== */
  78 
  79         /* related to the prologue */
  80         MANDOCERR_DT_NOTITLE, /* missing manual title, using UNTITLED: line */
  81         MANDOCERR_TH_NOTITLE, /* missing manual title, using "": [macro] */
  82         MANDOCERR_MSEC_MISSING, /* missing manual section, using "": macro */
  83         MANDOCERR_MSEC_BAD, /* unknown manual section: Dt ... section */
  84         MANDOCERR_DATE_MISSING, /* missing date, using today's date */
  85         MANDOCERR_DATE_BAD, /* cannot parse date, using it verbatim: date */
  86         MANDOCERR_DATE_FUTURE, /* date in the future, using it anyway: date */
  87         MANDOCERR_OS_MISSING, /* missing Os macro, using "" */
  88         MANDOCERR_PROLOG_LATE, /* late prologue macro: macro */
  89         MANDOCERR_PROLOG_ORDER, /* prologue macros out of order: macros */
  90 
  91         /* related to document structure */
  92         MANDOCERR_SO, /* .so is fragile, better use ln(1): so path */