home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / sharewar / dos / program / gs300sr1 / gs300sr1.exe / GCONFIG.C < prev    next >
C/C++ Source or Header  |  1994-07-27  |  3KB  |  99 lines

  1. /* Copyright (C) 1989, 1992, 1993 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of Aladdin Ghostscript.
  4.   
  5.   Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  9.   License (the "License") for full details.
  10.   
  11.   Every copy of Aladdin Ghostscript must include a copy of the License,
  12.   normally in a plain ASCII text file named PUBLIC.  The License grants you
  13.   the right to copy, modify and redistribute Aladdin Ghostscript, but only
  14.   under certain conditions described in the License.  Among other things, the
  15.   License requires that the copyright notice and this notice be preserved on
  16.   all copies.
  17. */
  18.  
  19. /* gconfig.c */
  20. /* Configuration tables */
  21. #include "ghost.h"
  22. /*
  23.  * Since we only declare variables of type gx_device *,
  24.  * it should be sufficient to define struct gx_device_s as
  25.  * an abstract (undefined) structure.  However, the VAX VMS compiler
  26.  * isn't happy with this, so we have to include the full definition.
  27.  */
  28. #include "gxdevice.h"
  29. #include "gxiodev.h"
  30.  
  31. /*
  32.  * The makefile generates the file gconfig.h, which consists of
  33.  * lines of the form
  34.  *    device__(gs_xxx_device)
  35.  * for each installed device;
  36.  *    io_device__(gs_iodev_xxx)
  37.  * for each known IODevice;
  38.  *    oper__(xxx_op_defs)
  39.  * for each operator option;
  40.  *    psfile__("gs_xxxx.ps")
  41.  * for each optional initialization file.
  42.  *
  43.  * We include this file multiple times to generate various different
  44.  * source structures.  (It's a hack, but we haven't come up with anything
  45.  * more satisfactory.)
  46.  */
  47.  
  48. /* Declare the devices as extern. */
  49. #define device_(dev) extern far_data gx_device dev;
  50. #define io_device_(iodev) extern gx_io_device iodev;
  51. #include "gconfig.h"
  52. #undef io_device_
  53. #undef device_
  54.  
  55. /* Set up the device table. */
  56. #define device_(dev) &dev,
  57. gx_device *gx_device_list[] = {
  58. #include "gconfig.h"
  59.     0
  60. };
  61. #undef device_
  62. uint gx_device_list_count = countof(gx_device_list) - 1;
  63.  
  64. /* Set up the IODevice table.  The first entry must be %os%, */
  65. /* since it is the default for files with no explicit device specified. */
  66. extern gx_io_device gs_iodev_os;
  67. #define io_device_(iodev) &iodev,
  68. gx_io_device *gx_io_device_table[] = {
  69.     &gs_iodev_os,
  70. #include "gconfig.h"
  71.     0
  72. };
  73. #undef io_device_
  74. uint gx_io_device_table_count = countof(gx_io_device_table) - 1;
  75.  
  76. /* Set up the .ps file name string array. */
  77. /* We fill in the lengths at initialization time. */
  78. #define ref_(t) struct { struct tas_s tas; t value; }
  79. #define string_(s)\
  80.  { { (t_string<<r_type_shift) + a_readonly + a_foreign, 0 }, s },
  81. #define psfile_(fns) string_(fns)
  82. ref_(const char *) gs_init_file_array[] = {
  83. #include "gconfig.h"
  84.     string_(0)
  85. };
  86. #undef psfile_
  87.  
  88. /* Here is where the library search path, the name of the */
  89. /* initialization file, and the doc directory are defined. */
  90. const char *gs_doc_directory = GS_DOCDIR;
  91. const char *gs_lib_default_path = GS_LIB_DEFAULT;
  92. const char *gs_init_file = GS_INIT;
  93.  
  94. /* Some C compilers insist on executable code here, so.... */
  95. void
  96. gconfig_dummy(void)
  97. {
  98. }
  99.