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