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

  1. /*
  2.  * texi2ipf.h - texi2ipf general header
  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: texi2ipf.h,v $
  24.  * Revision 1.5  1997/02/06 12:45:17  herbert
  25.  * - Added documentation in Texinfo format.
  26.  * - Minor bug fixes.
  27.  *
  28.  * Revision 1.4  1997/01/15 13:34:18  herbert
  29.  * - Fixed the index entry generating for some @def* commands.
  30.  *
  31.  * Revision 1.3  1996/12/17 15:14:23  herbert
  32.  * Only some cosmetic changes. The code looks still rather ugly to me :-)
  33.  *
  34.  * Revision 1.2  1996/12/17 14:10:01  herbert
  35.  * Added support for pseudo-Texinfo-commands: @ifhtml (ignored) and @ipfline{}
  36.  * (my invention) for putting IPF code into the Texinfo source.
  37.  * Added @macro command to table.h, will be ignored.
  38.  *
  39.  * Revision 1.1.1.1  1996/12/02 12:10:01  herbert
  40.  * Texi2IPF 1.0
  41.  *
  42.  */
  43.  
  44. /* troff macro packages supported */
  45. #define NONE   0       /* dummy value for error detection */
  46.  
  47. /* useful confusion-reducing things */
  48. #define STREQ(s,t) (*(s)==*(t) && strcmp(s, t)==0)
  49. #define NO     0
  50. #define YES    1
  51. #define ERROR  (-1)
  52.  
  53. #define MAXLINELEN 1024
  54. #define MAXILEVEL 10
  55. #define MAXARG 5        /* Maximum number of arguments in xref etc */
  56.  
  57. /* tag table size */
  58. #define MAXTAG 256
  59. #define MAXTAGSIZE 16
  60.  
  61.  
  62. /* miscellaneous troff command strings in macro header files. */
  63. struct misccmds {
  64.     char * init;       /* emit before the first input. this is the place to
  65.                         * put troff commands controlling default point size,
  66.                         * margin size, line length, etc.
  67.                         */
  68.     char * exit;       /* the opposite of init... */
  69.     char * dfltpara;   /* emit when 2 consecutive newlines are detected */
  70.                        /* in the input and the indentation level is <= 1. */
  71.     char * dfltipara;  /* same but for indentation level > 1.  */
  72.     char * dflttpara;  /* same but for two-column-table */
  73.     char * indentstart; /* emit to increase indent level for itemized list */
  74.     char * indentend;  /* emit to decrease indent level for itemized list */
  75.     char * heading;    /* heading string, requires printf with arguments  
  76.                         * for heading level (1..4) and modfiers (string)
  77.                         */
  78. };
  79.  
  80. extern struct misccmds * cmds;
  81.  
  82. struct tablerecd {
  83.     char *  texstart;  /* starting token for a Texinfo command */
  84.     char *  texend;    /* ending token for a Texinfo command */
  85.     char *  ipfstart;  /* ipf commands to emit when texstart is found */
  86.     char *  ipfend;    /* ipf commands to emit when texend is found */
  87.     char *  font;      /* font in effect between ipfstart & ipfend */
  88.     int  type;         /* kind of Texinfo command, as #defined below */
  89. };
  90.  
  91. /* Texinfo command types */
  92.  
  93. #define ESCAPED    0  /* special character (special to Texinfo) */
  94. #define INPARA     1  /* in-paragraph command */
  95. #define PARAM      2  /* Parameter to structuring command follows */
  96. #define DISCARD    3  /* not supported - discard following text */
  97. #define PARAGRAPH  4  /* applies to following paragraph */
  98. #define ITEMIZING  5  /* starts itemized list */
  99. #define ITEM       6  /* item in list */
  100. #define END        7  /* end construct */
  101. #define CHAR       8  /* really special char: dagger, bullet - scary, eh? */
  102. #define FOOTNOTE   9  /* footnote */
  103. #define DISPLAY   10  /* text block of the kind called a 'display' */
  104. #define INDEX     11  /* index entry */
  105. #define INCLUDE   12  /* include file command */
  106. #define SETCLEAR  13  /* SET or CLEAR command */
  107. #define CONDITION 14  /* IFSET or IFCLEAR command */
  108. #define NODE      15  /* NODE command */
  109. #define XREF      16  /* cross reference */
  110. #define COMMENT   17  /* comment: ignore rest of line */
  111. #define HEADING1  18  /* chapter structuring commands */
  112. #define HEADING2  19
  113. #define HEADING3  20
  114. #define HEADING4  21
  115. #define TEMPLATE  22  /* template command, "category" and "type" before name */
  116. #define TEMPLATE2 23  /* template command with given category */
  117. #define TEMPLATE3 24  /* like TEMPLATE, but with only "category" before name */
  118. #define TEMPLATE4 25  /* like TEMPLATE2, but nothing before name */
  119. #define VALUE     26  /* VALUE command */
  120. #define MENU      27  /* Create menues instead of discarding them! */
  121. #define VERBATIM  28  /* For new pseudo-Texinfo-tag "@ifipf": just 
  122.                        * put everything to stdout! */
  123. #define BYE       29  /* End of document reached */
  124.  
  125. /* itemizing types */
  126. #define ITEMIZE    0
  127. #define ENUMERATE  1
  128. #define TABLE      2
  129. #define APPLY      3
  130.  
  131.