home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / fontutils-0.6-base.tgz / fontutils-0.6-base.tar / fsf / fontutils / bzrto / input-ccc.h < prev    next >
C/C++ Source or Header  |  1992-10-18  |  3KB  |  109 lines

  1. /* input-ccc.h: call Bison-generated code to parse a CCC file.  This
  2.    file must be included before the Bison-generated `ccc.h'.
  3.  
  4. Copyright (C) 1992 Free Software Foundation, Inc.
  5.  
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. #ifndef INPUT_CCC_H
  21. #define INPUT_CCC_H
  22.  
  23. #include "list.h"
  24. #include "tfm.h"
  25.  
  26.  
  27. /* The representation of a CCC dimension.  */
  28. typedef struct
  29. {
  30.   real amount;
  31.   boolean absolute;
  32.   boolean valid;
  33. } dimen_type;
  34.  
  35. /* The distance, in points.  */
  36. #define DIMEN_AMOUNT(d) ((d).amount)
  37.  
  38. /* Says whether the dimension is font- or character-dependent.  */
  39. #define DIMEN_ABSOLUTE(d) ((d).absolute)
  40.  
  41. /* If this is not set, the other members are garbage.  */
  42. #define DIMEN_VALID(d) ((d).valid)
  43.  
  44. /* The representation of a CCC operation.  */
  45. typedef struct
  46. {
  47.   int opcode;
  48.   boolean valid;
  49.   union
  50.   {
  51.     charcode_type charcode;
  52.     dimen_type dimen;
  53.   } u;
  54. } ccc_cmd_type;
  55.  
  56. #define CCC_OPCODE(ccc) ((ccc).opcode)
  57. #define CCC_VALID(ccc) ((ccc).valid)
  58. #define CCC_CHARCODE(ccc) ((ccc).u.charcode)
  59. #define CCC_DIMEN(ccc) ((ccc).u.dimen)
  60. #define CCC_DIMEN_AMOUNT(ccc) DIMEN_AMOUNT ((ccc).u.dimen)
  61. #define CCC_DIMEN_ABSOLUTE(ccc) DIMEN_ABSOLUTE ((ccc).u.dimen)
  62.  
  63. /* Use the generic operations in `list.h' to manipulate CCC command lists.  */
  64. typedef list_type ccc_cmd_list_type;
  65.  
  66. /* A CCC file is a list of commands.  */
  67. typedef ccc_cmd_list_type ccc_type;
  68.  
  69. /* This type is returned for character names.  It is only needed within
  70.    the parser, but we have to define it here since it is part of the
  71.    %union, and hence winds up in the Bison-generated include file.  */
  72.  
  73. typedef struct
  74. {
  75.   charcode_type code;
  76.   string name;
  77. } charname_type;
  78.  
  79. /* The font information the user gets to access in the CCC source.  All
  80.    values are in points.  */
  81.  
  82. typedef struct
  83. {
  84.   int cap_height;
  85.   int design_size;
  86.   int em;
  87.   int font_depth;
  88.   int xheight;
  89. } ccc_fontinfo_type;
  90.  
  91.  
  92. /* For communication with the parser.  */
  93. extern FILE *ccc_file;
  94. extern string ccc_filename;
  95. extern bzr_char_type **chars;
  96. extern ccc_fontinfo_type ccc_fontinfo;
  97. extern ccc_type *ccc_chars[];
  98.  
  99.  
  100. /* Read the CCC file NAME, extended with `.ccc' if necessary.  Warn
  101.    about the file not existing only if WARN_P is true.  Update CHARS,
  102.    taking defaults from T.  */
  103.  
  104. extern ccc_type **parse_ccc_file
  105.   (string name, bzr_char_type **chars, tfm_global_info_type *t,
  106.    real design_size, boolean warn_p);
  107.  
  108. #endif /* not CCC_H */
  109.