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