home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / g / gs252src.zip / GS252 / GCONFIG.C < prev    next >
C/C++ Source or Header  |  1992-08-20  |  3KB  |  99 lines

  1. /* Copyright (C) 1989, 1992 Aladdin Enterprises.  All rights reserved.
  2.    Distributed by Free Software Foundation, Inc.
  3.  
  4. This file is part of Ghostscript.
  5.  
  6. Ghostscript is distributed in the hope that it will be useful, but
  7. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. to anyone for the consequences of using it or for whether it serves any
  9. particular purpose or works at all, unless he says so in writing.  Refer
  10. to the Ghostscript General Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. Ghostscript, but only under the conditions described in the Ghostscript
  14. General Public License.  A copy of this license is supposed to have been
  15. given to you along with Ghostscript so you can know your rights and
  16. responsibilities.  It should be in a file named COPYING.  Among other
  17. things, the copyright notice and this notice must be preserved on all
  18. copies.  */
  19.  
  20. /* gconfig.c */
  21. /* Installed device table for Ghostscript */
  22. #include "ghost.h"
  23. /*
  24.  * Since we only declare variables of type gx_device *,
  25.  * it should be sufficient to define struct gx_device_s as
  26.  * an abstract (undefined) structure.  However, the VAX VMS compiler
  27.  * isn't happy with this, so we have to include the full definition.
  28.  */
  29. #include "gxdevice.h"
  30. /*
  31.  * We generate an array of strings as a static structure:
  32.  */
  33. #define ref_(t) struct { struct tas_s tas; t value; }
  34. #define string_v(n,s)\
  35.  { {(t_string<<r_type_shift)+a_readonly, n}, s }
  36.  
  37. /*
  38.  * The Ghostscript makefile generates the file gconfig.h, which consists of
  39.  * lines of the form
  40.  *    device_(gs_xxx_device)
  41.  * for each installed device,
  42.  *    oper_(xxx_op_defs)
  43.  * for each operator option, and
  44.  *    psfile_("gs_xxxx.ps")
  45.  * for each optional initialization file.
  46.  *
  47.  * We include this file multiple times to generate various different
  48.  * source structures.  (It's a hack, but we haven't come up with anything
  49.  * more satisfactory.)
  50.  */
  51.  
  52. /* Here is where the library search path and the name of the */
  53. /* initialization file are defined.  We supply defaults just in case */
  54. /* someone compiles the file without the proper command line flags. */
  55. #ifndef GS_LIB_DEFAULT
  56. #  define GS_LIB_DEFAULT ""
  57. #endif
  58. #ifndef GS_INIT
  59. #  define GS_INIT "gs_init.ps"
  60. #endif
  61. const char *gs_lib_default_path = GS_LIB_DEFAULT;
  62. const char *gs_init_file = GS_INIT;
  63.  
  64. /* Operators are handled in iinit.c. */
  65. #define oper_(defs)
  66. #define psfile_(fns)
  67.  
  68. /* Declare the devices as extern. */
  69. #define device_(dev) extern gx_device dev;
  70. #include "gconfig.h"
  71. #undef device_
  72.  
  73. /* Set up the device table. */
  74. #define device_(dev) &dev,
  75. gx_device *gx_device_list[] = {
  76. #include "gconfig.h"
  77.     0
  78. };
  79. #undef device_
  80. #define device_(dev)
  81.  
  82. /* Set up the .ps file name string array. */
  83. /* We fill in the lengths at initialization time. */
  84. #define ref_(t) struct { struct tas_s tas; t value; }
  85. #define string_(s)\
  86.  { {(t_string<<r_type_shift)+a_readonly, 0}, s },
  87. #undef psfile_
  88. #define psfile_(fns) string_(fns)
  89. ref_(const char *) gs_init_file_array[] = {
  90. #include "gconfig.h"
  91.     string_(0)
  92. };
  93.  
  94. /* Some C compilers insist on executable code here, so.... */
  95. void
  96. gconfig_dummy()
  97. {
  98. }
  99.