iconfig.c 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001 Aladdin Enterprises. All rights reserved.
  2. This file is part of AFPL Ghostscript.
  3. AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author or
  4. distributor accepts any responsibility for the consequences of using it, or
  5. for whether it serves any particular purpose or works at all, unless he or
  6. she says so in writing. Refer to the Aladdin Free Public License (the
  7. "License") for full details.
  8. Every copy of AFPL Ghostscript must include a copy of the License, normally
  9. in a plain ASCII text file named PUBLIC. The License grants you the right
  10. to copy, modify and redistribute AFPL Ghostscript, but only under certain
  11. conditions described in the License. Among other things, the License
  12. requires that the copyright notice and this notice be preserved on all
  13. copies.
  14. */
  15. /*$Id: iconf.c,v 1.3 2001/03/13 07:09:29 ghostgum Exp $ */
  16. /* Configuration-dependent tables and initialization for interpreter */
  17. #include "stdio_.h" /* stdio for stream.h */
  18. #include "gstypes.h"
  19. #include "gsmemory.h" /* for iminst.h */
  20. #include "gconf.h"
  21. #include "iref.h"
  22. #include "ivmspace.h"
  23. #include "opdef.h"
  24. #include "ifunc.h"
  25. #include "iapi.h"
  26. #include "iminst.h"
  27. /* Define the default values for an interpreter instance. */
  28. const gs_main_instance gs_main_instance_init_values =
  29. {gs_main_instance_default_init_values};
  30. /* Set up the .ps file name string array. */
  31. /* We fill in the lengths at initialization time. */
  32. #define ref_(t) struct { struct tas_s tas; t value; }
  33. #define string_(s,len)\
  34. { { (t_string<<r_type_shift) + a_readonly + avm_foreign, len }, s },
  35. #define psfile_(fns,len) string_(fns,len)
  36. const ref_(const char *) gs_init_file_array[] = {
  37. #include "gconf.h"
  38. string_(0, 0)
  39. };
  40. #undef psfile_
  41. /* Set up the emulator name string array similarly. */
  42. #define emulator_(ems,len) string_(ems,len)
  43. const ref_(const char *) gs_emulator_name_array[] = {
  44. #include "gconf.h"
  45. string_(0, 0)
  46. };
  47. #undef emulator_
  48. /* Set up the function type table similarly. */
  49. #define function_type_(i,proc) extern build_function_proc(proc);
  50. #include "gconf.h"
  51. #undef function_type_
  52. #define function_type_(i,proc) {i,proc},
  53. const build_function_type_t build_function_type_table[] = {
  54. #include "gconf.h"
  55. {0}
  56. };
  57. #undef function_type_
  58. const uint build_function_type_table_count =
  59. countof(build_function_type_table) - 1;
  60. /* Initialize the operators. */
  61. /* Declare the externs. */
  62. #define oper_(xx_op_defs) extern const op_def xx_op_defs[];
  63. oper_(interp_op_defs) /* Interpreter operators */
  64. #include "gconf.h"
  65. #undef oper_
  66. const op_def *const op_defs_all[] = {
  67. #define oper_(defs) defs,
  68. oper_(interp_op_defs) /* Interpreter operators */
  69. #include "gconf.h"
  70. #undef oper_
  71. 0
  72. };
  73. const uint op_def_count = (countof(op_defs_all) - 1) * OP_DEFS_MAX_SIZE;