home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume6 / yahp2ps / part02 / defs.h next >
C/C++ Source or Header  |  1989-02-03  |  4KB  |  150 lines

  1. /*
  2.         HPGL to PostScript converter
  3.    Copyright (C) 1988 (and following) Federico Heinz
  4.  
  5. yahp2ps is distributed in the hope that it will be useful, but WITHOUT ANY
  6. WARRANTY.  No author or distributor accepts responsibility to anyone
  7. for the consequences of using it or for whether it serves any
  8. particular purpose or works at all, unless he says so in writing.
  9. Refer to the Free Software Foundation's General Public License for full details.
  10.  
  11. Everyone is granted permission to copy, modify and redistribute yahp2ps,
  12. but only under the conditions described in the GNU General Public
  13. License.  A copy of this license is supposed to have been given to you
  14. along with yahp2ps so you can know your rights and responsibilities.  It
  15. should be in a file named COPYING.  Among other things, the copyright
  16. notice and this notice must be preserved on all copies.
  17.  
  18. In other words, go ahead and share yahp2ps, but don't try to stop
  19. anyone else from sharing it farther.  Help stamp out software hoarding!
  20.  
  21. yahp2ps is TOTALLY unrelated to GNU or the Free Software Foundation,
  22. it is only released under the same conditions.
  23.  
  24.     For bug reports, wishes, etc. send e-mail to
  25.  
  26.     ...!mcvax!unido!tub!actisb!federico  (from Europe)
  27.     ...!uunet!pyramid!actisb!federico    (from anywhere else)
  28.  
  29.     For Physical mail:
  30.  
  31.     Federico Heinz
  32.     Beusselstr. 21
  33.     1000 Berlin 21
  34.  
  35.     Tel. (+49 30) 396 77 92
  36.  
  37. */
  38. /***************************************************************************
  39.  
  40.         Yet Another HPGL to PostScript Converter.
  41.  
  42.  
  43. ***************************************************************************/
  44.  
  45.  
  46. /**************************************************************************
  47.  
  48.     System-dependent constants.
  49.  
  50. **************************************************************************/
  51.  
  52. #define    DEFAULT_PRELUDE "/usr/lib/yahp2ps.pre" /* default prelude file */
  53.  
  54.  
  55. /**************************************************************************
  56.  
  57.    Define the Number data type. It represents the Scaled Decimal
  58.    format of HPGL. In order to get a Number out of a normal integer,
  59.    multiply it by the constant One.
  60.  
  61. **************************************************************************/
  62.  
  63.  
  64.  
  65. #define Number  long int
  66.  
  67. #define IntPlaces 5
  68. #define DecPlaces 4
  69.  
  70.  
  71. /* A CoordinatePair contains an X and a Y component */
  72.  
  73. #define X       0
  74. #define Y       1
  75.  
  76. typedef Number  CoordinatePair[2];
  77.  
  78.  
  79. extern Number RelativeCharWidth;   /* Width of each char          */
  80. extern Number RelativeCharHeigth;  /* Heigth of each char         */
  81. extern Number CharacterDirection;  /* Text writing angle          */
  82. extern Number CharacterSlant;      /* Textual slant angle         */
  83.  
  84. extern Number TN; /* Temporary storage for avoiding side effects
  85.                         in Number-handling macros */
  86.  
  87.  
  88. /* Some constants in our numbering system */
  89.  
  90. #define One             10000L
  91. #define Zero            0L
  92.  
  93. /* Divide a Number by another (a Number may be divided by an integer the
  94.    usual way) */
  95.  
  96.  
  97. extern Number divNum();
  98.  
  99.  
  100. /* Multiply a Number by another (again, multiplication by an integer is
  101.    as usual) */
  102.  
  103.  
  104. extern Number mulNum();
  105.  
  106.  
  107. /* Truncate a number according to the HPGL rules */
  108.  
  109. #define trunc(x)        (((TN = (x)) % One) ? \
  110.                             ((TN = (TN/One) * One) < 0 ? \
  111.                                 (TN - One) : TN) : TN)
  112.  
  113.  
  114. /***************************************************************************
  115.  
  116.    Define the Boolean data type.
  117.  
  118. ***************************************************************************/
  119.  
  120.  
  121. #define Boolean int
  122.  
  123. #define True  1
  124. #define False 0
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131. /* Special character predicates */
  132.  
  133. #define isSeparator(x)  (((x) == ',') || ((x) == ' '))
  134. #define isTerminator(x) (((x) == ';') || ((x) == '\n'))
  135.  
  136.  
  137.  
  138. /***************************************************************************
  139.  
  140.   Error handling functions.
  141.  
  142. ***************************************************************************/
  143.  
  144. extern void warning();
  145. extern void error();
  146.  
  147.  
  148.  
  149.  
  150.