home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / texipf21.zip / texi2ipf / table.h < prev    next >
C/C++ Source or Header  |  1997-02-15  |  19KB  |  322 lines

  1. /*
  2.  * table.h -  table and other explicit ipfc command strings
  3.  *
  4.  * texi2roff history:
  5.  *             Release 1.0a    August 1988
  6.  *             Release 2.0     January 1990
  7.  *
  8.  * Copyright 1988, 1989, 1990  Beverly A.Erlebacher
  9.  * erlebach@cs.toronto.edu    ...uunet!utai!erlebach
  10.  *
  11.  * texi2ipf history:
  12.  *             Release 1.0     February 1993
  13.  *
  14.  * Modified by Marcus Gröber, Fido 2:2402/61.1
  15.  *
  16.  * Modified by Martin "Herbert" Dietze, Email herbert@wiloyee.shnet.org
  17.  *
  18.  */
  19.  
  20. /*
  21.  * History:
  22.  *
  23.  * $Log: table.h,v $
  24.  * Revision 1.8  1997/02/06 12:45:16  herbert
  25.  * - Added documentation in Texinfo format.
  26.  * - Minor bug fixes.
  27.  *
  28.  * Revision 1.7  1997/01/17 14:53:32  herbert
  29.  * Corrected all the "@def*" commands (for index entries).
  30.  *
  31.  * Revision 1.6  1997/01/15 13:34:18  herbert
  32.  * - Fixed the index entry generating for some @def* commands.
  33.  *
  34.  * Revision 1.5  1997/01/15 12:18:19  herbert
  35.  * - Fixed a bug in eat_first_word() that made the program crash sometimes.
  36.  * - "@ignore" environments will now be handled like real comments.
  37.  *
  38.  * Revision 1.4  1997/01/08 13:19:15  herbert
  39.  * Added file change.log and changed the handling of the @*heading commands.
  40.  * The OS/2 executable texi2ipf.exe will now be part of the archive.
  41.  *
  42.  * Revision 1.3  1996/12/17 15:14:22  herbert
  43.  * Only some cosmetic changes. The code looks still rather ugly to me :-)
  44.  *
  45.  * Revision 1.2  1996/12/17 14:10:00  herbert
  46.  * Added support for pseudo-Texinfo-commands: @ifhtml (ignored) and @ipfline{}
  47.  * (my invention) for putting IPF code into the Texinfo source.
  48.  * Added @macro command to table.h, will be ignored.
  49.  *
  50.  * Revision 1.1.1.1  1996/12/02 12:10:01  herbert
  51.  * Texi2IPF 1.0
  52.  *
  53.  */
  54.  
  55. #define FONT_MONO ":font facename=Courier size=16x8."
  56. #define EFNT_MONO ":font facename=default size=0x0."
  57.  
  58. /*
  59.  * miscellaneous commands, described in texi2roff.h
  60.  */
  61. struct misccmds mscmds = { 
  62.     ":userdoc.\n:docprof toc=1234.",    /* init string */
  63.     ":euserdoc.",                       /* end string */
  64.     ":p.",                              /* text paragraph */
  65.     ":li.",                             /* list item */
  66.     ":pd.",                             /* paragraph inside list item */
  67.     "",
  68.     "",
  69.     "\n:h%d%s."                         /* heading */
  70. };
  71.  
  72. struct tablerecd
  73.   tempframe =   { "","\n","",EFNT_MONO"\n.br\n",FONT_MONO,INPARA },
  74.   temp1stbrac = { "","}",":hp2.","&colon.:ehp2."FONT_MONO,"",INPARA },
  75.   temp1stword = { ""," ",":hp2.","&colon.:ehp2. "FONT_MONO,"",INPARA };
  76.  
  77.  
  78. /*
  79.  * Herbert: changed the trbegin fields of the @def* commands and added the 
  80.  *  @shortcontents command. @menu now has the command type MENU.
  81.  */
  82.  
  83. struct tablerecd mstable[] = {
  84.     {"@",               "",     "@",            "",     "",     ESCAPED},
  85.     {"@&colon.",        "",     "",             "",     "",     ESCAPED},
  86.     {"@&per.",          "",     "&per.",        "",     "",     ESCAPED},
  87.     {"@*",              "",     "\n.br\n",      "",     "",     ESCAPED},
  88.     {"@@",              "",     "@",            "",     "",     ESCAPED},
  89.     {"@Arrow",          "\n",   "->",           "",     "",     CHAR},
  90.     {"@TeX{",           "}",    "TeX",          "",     "",     INPARA},
  91.     {"@afourpaper",     "\n",   "",             "",     "",     DISCARD},
  92.     {"@appendix",       "\n",   "",             "\n",   "",     HEADING1},
  93.     {"@appendixsec",    "\n",   "",             "\n",   "",     HEADING2},
  94.     {"@appendixsection","\n",   "",             "\n",   "",     HEADING2},
  95.     {"@appendixsubsec", "\n",   "",             "\n",   "",     HEADING3},
  96.     {"@appendixsubsubsec","\n", "",             "\n",   "",     HEADING4},
  97.     {"@arrow",          "\n",   "->",           "\n",   "",     CHAR},
  98.     {"@asis",           "\n",   "",             "\n",   "",     PARAGRAPH},
  99.     {"@asis{",          "}",    "",             "",     "",     INPARA},
  100.     {"@author",         "\n",   "\n:lines align=center.\n",
  101.                                 "\n:elines.\n", "",             DISPLAY},
  102.     {"@author{",        "}",    "\n:lines align=center.\n",
  103.                                 "\n:elines.\n", "",             DISPLAY},
  104.     {"@br",             "\n",   "\n.br\n",      "",     "",     PARAGRAPH},
  105.     {"@bullet{",        "}",    "&sqbul.",      "",     "",     CHAR},
  106.     {"@bye",            "\n",   "",             "",     "",     BYE},
  107.     {"@b{",             "}",    ":hp2.",        ":ehp2.","",    INPARA},
  108.     {"@c",              "\n",   "",             "",     "",     COMMENT},
  109.     {"@cartouche",      "@end", "",             "",     "",     PARAGRAPH},
  110.     {"@center",         "\n",   "\n:lines align=center.\n",
  111.                                 "\n:elines.\n", "",             PARAGRAPH},
  112.     {"@center{",        "}",    "\n:lines align=center.\n",
  113.                                 "\n:elines.\n", "",             PARAGRAPH},
  114.     {"@chapheading",    "\n",   ":hp2.", ":ehp2.\n", 
  115.                                                         "",     PARAGRAPH},
  116.     {"@chapter",        "\n",   "",             "\n",   "",     HEADING1},
  117.     {"@cindex",         "\n",   "\n:i1.",       "\n",   "",     INDEX},
  118.     {"@cite{",          "}",    ":hp1.",        ":ehp1.","",    INPARA},
  119.     {"@clear",          "\n",   "",             "",     "",     SETCLEAR},
  120.     {"@code",           "\n",   FONT_MONO,      "\n",   FONT_MONO,
  121.                                                                 INPARA},
  122.     {"@code{",          "}",    FONT_MONO,      "",     FONT_MONO,
  123.                                                                INPARA},
  124.     {"@comment",        "\n",   "",             "",     "",     COMMENT},
  125.     {"@contents",       "\n",   "",             "",     "",     INPARA},
  126.     {"@copyright{",     "}",    "(C)",          "",     "",     CHAR},
  127.     {"@ctrl{",          "}",    FONT_MONO"^",   "",     FONT_MONO,INPARA},
  128.     {"@dag",            "}{",   "+",            "",     "",     CHAR},
  129.     {"@dag{",           "}",    "+",            "",     "",     CHAR},
  130.     {"@ddag",           "}{",   "++",           "",     "",     CHAR},
  131.     {"@ddag{",          "}",    "++",           "",     "",     CHAR},
  132.     {"@defcmd",         "@end", ":p.Command",   "",     "",     TEMPLATE2},
  133.     {"@defcmdx",        "\n",   ":p.Command",   "",     "",     TEMPLATE2},
  134.     {"@defconst",       "@end", ":p.Constant",  "",     "",     TEMPLATE2},
  135.     {"@defconstx",      "\n",   ":p.Constant",  "",     "",     TEMPLATE2},
  136.     {"@defcv",          "@end", ":p.",          "",     "",     TEMPLATE},
  137.     {"@defcvx",         "\n",   ":p.",          "",     "",     TEMPLATE},
  138.     {"@deffn",          "@end", ":p.",          "",     "",     TEMPLATE3},
  139.     {"@deffnx",         "\n",   ":p.",          "",     "",     TEMPLATE3},
  140.     {"@defivar",        "@end", ":p.Instance Variable",
  141.                                                 "",     "",     TEMPLATE2},
  142.     {"@defivarx",       "\n",   ":p.Instance Variable",
  143.                                                 "",     "",     TEMPLATE2},
  144.     {"@defmac",         "@end", ":p.Macro",     "",     "",     TEMPLATE4},
  145.     {"@defmacx",        "\n",   ":p.Macro",     "",     "",     TEMPLATE4},
  146.     {"@defmethod",      "@end", ":p.Method",    "",     "",     TEMPLATE2},
  147.     {"@defmethodx",     "\n",   ":p.Method",    "",     "",     TEMPLATE2},
  148.     {"@defop",          "@end", ":p.",          "",     "",     TEMPLATE}, 
  149.     {"@defopx",         "\n",   ":p.",          "",     "",     TEMPLATE}, 
  150.     {"@defopt",         "@end", ":p.User Option","",    "",     TEMPLATE4},
  151.     {"@defoptx",        "\n",   ":p.User Option","",    "",     TEMPLATE4},
  152.     {"@defspec",        "@end", ":p.Special Form","",   "",     TEMPLATE4},
  153.     {"@defspecx",       "\n",   ":p.Special Form","",   "",     TEMPLATE4},
  154.     {"@deftp",          "@end", ":p.",          "",     "",     TEMPLATE3},
  155.     {"@deftypefn",      "@end", ":p.",          "",     "",     TEMPLATE},
  156.     {"@deftypefnx",     "\n",   ":p.",          "",     "",     TEMPLATE},
  157.     {"@deftypefun",     "@end", ":p.Function",  "",     "",     TEMPLATE2},
  158.     {"@deftypefunx",    "\n",   ":p.Function",  "",     "",     TEMPLATE2},
  159.     {"@deftypevar",     "@end", ":p.Variable",  "",     "",     TEMPLATE2},
  160.     {"@deftypevarx",    "\n",   ":p.Variable",  "",     "",     TEMPLATE2},
  161.     {"@deftypevr",      "@end", ":p.",          "",     "",     TEMPLATE},
  162.     {"@deftypevrx",     "\n",   ":p.",          "",     "",     TEMPLATE},
  163.     {"@defun",          "@end", ":p.Function",  "",     "",     TEMPLATE4},
  164.     {"@defunx",         "\n",   ":p.Function",  "",     "",     TEMPLATE4},
  165.     {"@defvr",          "@end", ":p.",          "",     "",     TEMPLATE3},
  166.     {"@defvrx",         "\n",   ":p.",          "",     "",     TEMPLATE3},
  167.     {"@defvar",         "@end", ":p.Variable",  "",     "",     TEMPLATE4},
  168.     {"@defvarx",        "\n",   ":p.Variable",  "",     "",     TEMPLATE4},
  169.     {"@dfn{",           "}",    ":hp1.",        ":ehp1.","",    INPARA},
  170.     {"@display",        "@end", "\n:lines.\n",  "\n:elines.\n",
  171.                                                         "",     PARAGRAPH},
  172.     {"@dmn{",           "}",    "",             "",     "",     INPARA},
  173.     {"@dots{",          "}",    "&per.&per.&per.","",   "",     INPARA},
  174.     {"@eject",          "\n",   "",             "",     "",     DISCARD},
  175.     {"@emph{",          "}",    ":hp1.",        ":ehp1.","",    INPARA},
  176.     {"@end",            "\n",   "",             "",   "",       END},
  177.     {"@enumerate",      "@end", "\n:ol.\n",     "\n:eol.\n","", ITEMIZING},
  178.     {"@equiv{",         "}",    "==",           "",     "",     CHAR},
  179.     {"@error{",         "}",    "error-->",     "",     "",     CHAR},
  180.     {"@example",        "@end", "\n:xmp.\n",    "\n:exmp.\n",
  181.                                                        FONT_MONO,DISPLAY},
  182.     {"@example{",       "}",    FONT_MONO,      "",     FONT_MONO,INPARA},
  183.     {"@exdent",         "\n",   "",             "\n",   "",     PARAGRAPH},
  184.     {"@expansion{",     "}",    "->",           "",     "",     CHAR},
  185.     {"@file{",          "}",    FONT_MONO"`",   "'",    FONT_MONO,INPARA},
  186.     {"@finalout",       "\n",   "",             "\n",   "",     DISCARD},
  187.     {"@findex",         "\n",   "\n:i1.",       "\n",   "",     INDEX},
  188.     {"@flushleft",      "@end", "\n:lines align=left.\n",
  189.                                "\n:elines.\n", "",             PARAGRAPH},
  190.     {"@flushright",     "@end", "\n:lines align=right.\n",
  191.                                "\n:elines.\n", "",             PARAGRAPH},
  192.     {"@format",         "@end", "",             "",     "",     PARAGRAPH},
  193.     {"@footnote{",      "}",    ":link refid=", ":efn.","",     FOOTNOTE},
  194.     {"@ftable",         "@end", "\n:parml.\n",  "\n:eparml.\n","",
  195.                                                         ITEMIZING},
  196.     {"@group",          "@end", "\n",   "\n",   "",     PARAGRAPH},
  197.     {"@heading",        "\n",   ":hp7.",":ehp7.\n",
  198.                                                 "",     PARAGRAPH},
  199.     {"@headings",       "\n",   "",     "",     "",     DISCARD},
  200.     {"@iappendix",      "\n",   "",     "\n",   "",     HEADING1},
  201.     {"@iappendixsec",   "\n",   "",     "\n",   "",     HEADING2},
  202.     {"@iappendixsubsec","\n",   "",     "\n",   "",     HEADING3},
  203.     {"@ichapter",       "\n",   "",     "\n",   "",     HEADING1},
  204.     {"@ifclear",        "@end", "",     "",     "",     CONDITION},
  205.     {"@ifhtml",         "@end", "",     "",     "",     DISCARD}, /* no *real*
  206.                                                                    * Texinfo */
  207.     {"@ifinfo",         "@end", "\n",   "\n",   "",     PARAGRAPH},
  208.     {"@ipfline{",       "}",    "",     "",     "",     VERBATIM},
  209.     {"@ifset",          "@end", "",     "",     "",     CONDITION},
  210.     {"@iftex",          "@end", "",     "",     "",     DISCARD},
  211.     {"@ignore",         "@end", "",     "",     "",     DISCARD},
  212.     {"@include",        "\n",   "",     "\n",   "",     INCLUDE},
  213.     {"@inforef{",       "}",    "See Info file ","",    "",     PARAGRAPH},
  214.     {"@isection",       "\n",   "",     "\n",   "",     HEADING2},
  215.     {"@isubsection",    "\n",   "",     "\n",   "",     HEADING3},
  216.     {"@isubsubsection", "\n",   "",     "\n",   "",     HEADING4},
  217.     {"@item",           "\n",   "",     "",   "",       ITEM},
  218.     {"@itemize",        "@end", "\n:ul.\n",     "\n:eul.\n","", ITEMIZING},
  219.     {"@itemx",          "\n",   "",     "",   "",       ITEM},
  220.     {"@iunnumbered",    "\n",   "",     "\n","",        HEADING1},
  221.     {"@iunnumberedsec", "\n",   "",     "\n","",        HEADING2},
  222.     {"@iunnumberedsubsec","\n", "",     "\n",   "",     HEADING3},
  223.     {"@i{",             "}",    ":hp1.",        ":ehp1.","",    INPARA},
  224.     {"@kbd{",           "}",    FONT_MONO,      "",     FONT_MONO,INPARA},
  225.     {"@key{",           "}",    FONT_MONO,      "",     FONT_MONO,INPARA},
  226.     {"@kindex",         "\n",   "\n:i1.",       "\n",   "",     INDEX},
  227.     {"@lisp",           "@end", "\n:xmp.\n",    "\n:exmp.\n",
  228.                                                         FONT_MONO,DISPLAY},
  229.     {"@macro",          "@end", "",      "",    "",     DISCARD},
  230.     {"@majorheading",   "\n",   ":hp2.", ":ehp2.\n", 
  231.                                                         "",     PARAGRAPH},
  232.     {"@menu",           "@end", "",             "",     "",     MENU},
  233.     {"@minus{",         "}",    "-",            "",     "",     CHAR},
  234.     {"@need",           "\n",   "",             "",     "",     DISCARD},
  235.     {"@node",           "\n",   "",             "",     "",     NODE},
  236.     {"@noindent",       "\n",   "\n",           "",     "",     PARAGRAPH},
  237.     {"@page",           "\n",   ":p.:p.\n",     "",     "",     PARAGRAPH},
  238.     {"@pindex",         "\n",   "\n:i1.",       "\n",   "",     INDEX},
  239.     {"@point{",         "}",    "-!-",          "",     "",     CHAR},
  240.     {"@printindex",     "\n",   "Sorry, no ",   " index\n","",  PARAGRAPH},
  241.     {"@prints{",        "}",    "-|",           "",     "",     CHAR},
  242.     {"@print{",         "}",    "-|",           "",     "",     CHAR},
  243.     {"@pxref{",         "}",    "see :link reftype=hd %s refid='%s'.",
  244.                                                ":elink.","",   XREF},
  245.     {"@quotation",      "@end", "",             "",     "",     PARAGRAPH},
  246.     {"@refill",         "\n",   "",             "\n",   "",     DISCARD},
  247.     {"@ref{",           "}",    ":link reftype=hd %s refid='%s'.",
  248.                                                 ":elink.","",   XREF},
  249.     {"@result",         "\n",   "=>",           "\n",   "",     CHAR},
  250.     {"@result{",        "}",    "=>",           "",     "",     CHAR},
  251.     {"@r{",             "}",    EFNT_MONO,      "",     EFNT_MONO,
  252.                                                                 INPARA},
  253.     {"@samp{",          "}",    FONT_MONO"`",   "'",    FONT_MONO,INPARA},
  254.     {"@sc{",            "}",    ":hp2.",        ":ehp2.","",    INPARA},
  255.     {"@section",        "\n",   "",             "\n",   "",     HEADING2},
  256.     {"@set",            "\n",   "",             "",     "",     SETCLEAR},
  257.     {"@setchapternewpage","\n", "",             "\n",   "",     DISCARD},
  258.     {"@setfilename",    "\n",   "",             "",     "",     DISCARD},
  259.     {"@settitle",       "\n",   ":title.",      "\n",   "",     PARAM},
  260.     {"@shortcontents",  "\n",   "",             "",     "",     DISCARD},
  261.     {"@smallbook",      "\n",   "",             "\n",   "",     DISCARD},
  262.     {"@smallexample",   "@end", "\n:xmp.\n",    "\n:exmp.\n",FONT_MONO,
  263.                                                                 DISPLAY},
  264.     {"@sp",             "\n",   "\n:p.",        "",     "",     DISCARD},
  265.     {"@sp2",            "\n",   "\n:p.",        "",     "",     DISCARD},
  266.     {"@strong{",        "}",    ":hp2.*",       "*:ehp2.","",   INPARA},
  267.     {"@subheading",     "\n",   ":hp6.",        ":ehp6.\n",
  268.                                                         "",     PARAGRAPH},
  269.     {"@subsection",     "\n",   "",             "\n",   "",     HEADING3},
  270.     {"@subsubheading",  "\n",   ":hp5.",        ":ehp5.\n",
  271.                                                         "",     PARAGRAPH},
  272.     {"@subsubsection",  "\n",   "",             "\n",   "",     HEADING4},
  273.     {"@subtext",        "\n",   "\n:lines align=center.\n",
  274.                                 "\n:elines.\n", "",             PARAGRAPH},
  275.     {"@subtext{",       "}",    "\n:lines align=center.\n",
  276.                                 "\n:elines.\n", "",             PARAGRAPH},
  277.     {"@subtitle",       "\n",   "\n:lines align=center.\n",
  278.                                 "\n:elines.\n", "",             PARAGRAPH},
  279.     {"@subtitle{",      "}",   "\n:lines align=center.\n",
  280.                                 "\n:elines.\n", "",             PARAGRAPH},
  281.     {"@summarycontents","\n",   "",             "",     "",     INPARA},
  282.     {"@syncodeindex",   "\n",   "",             "\n",   "",     DISCARD},
  283.     {"@synindex",       "\n",   "",             "\n",   "",     DISCARD},
  284.     {"@t",              "\n",   "\t",           "\n",   "",     CHAR},
  285.     {"@table",          "@end", "\n:parml.\n",  "\n:eparml.\n","",
  286.                                                                 ITEMIZING},
  287.     {"@tex",            "@end", "",             "",     "",     DISCARD},
  288.     {"@tindex",         "\n",   "\n:i1.",       "\n",   "",     INDEX},
  289.     {"@title",          "\n",   "\n:lines align=center.\n",
  290.                                 "\n:elines.\n", "",             PARAGRAPH},
  291.     {"@title{",         "}",    "\n:lines align=center.\n",
  292.                                 "\n:elines.\n", "",             PARAGRAPH},
  293.     {"@titlefont{",     "}",    "",             "",     "",     INPARA},
  294.     {"@titlepage",      "@end", "Title page",   "",     "",     HEADING1},
  295.     {"@titlespec",      "@end", "",             "",     "",     PARAGRAPH},
  296.     {"@top",            "\n",   "Top node: \"", "\"\n", "",     HEADING1},
  297.     {"@t{",             "}",    FONT_MONO,      "",     FONT_MONO,INPARA},
  298.     {"@tt{",            "}",    FONT_MONO,      "",     FONT_MONO,INPARA},
  299.     {"@unnumbered",      "\n",  "",             "\n",   "",     HEADING1},
  300.     {"@unnumberedsec",   "\n",  "",             "\n",   "",     HEADING2},
  301.     {"@unnumberedsubsec","\n",  "",             "\n",   "",     HEADING3},
  302.     {"@unnumberedsubsubsec","\n","",            "\n",   "",     HEADING4},
  303.     {"@value{",         "}",    "",             "",     "",     VALUE},
  304.     {"@var{",           "}",    ":hp1.",        ":ehp1.","",    INPARA},
  305.     {"@vfil",           "\n",   "",             "\n",   "",     DISCARD},
  306.     {"@vindex",         "\n",   "\n:i1.",       "\n",   "",     INDEX},
  307.     {"@vskip",          "\n",   "",             "\n",   "",     DISCARD},
  308.     {"@vtable",         "@end", "\n:parml.\n",  "\n:eparml.\n","",
  309.                                                                ITEMIZING},
  310.     {"@w{",             "}",    "",             "",     "",     INPARA},
  311.     {"@xref{",          "}",    "See :link reftype=hd %s refid='%s'.",
  312.                                                ":elink.","",   XREF},
  313. /* the following macro is for internal communication between modules only */
  314.     {"@_tag{",          "}",    ":",            ".",    "",     CHAR},
  315.  
  316.     {"@{",              "",     "{",            "",     "",     ESCAPED},
  317.     {"@}",              "",     "}",            "",     "",     ESCAPED}
  318.      
  319. };
  320.  
  321.  
  322.