1 /* Copyright (C) 2001-2006 Artifex Software, Inc. 2 All Rights Reserved. 3 4 This software is provided AS-IS with no warranty, either express or 5 implied. 6 7 This software is distributed under license and may not be copied, modified 8 or distributed except as expressly authorized under the terms of that 9 license. Refer to licensing information at http://www.artifex.com/ 10 or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, 11 San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information. 12 */ 13 14 /* $Id: iconf.c 9043 2008-08-28 22:48:19Z giles $ */ 15 /* Configuration-dependent tables and initialization for interpreter */ 16 #include "stdio_.h" /* stdio for stream.h */ 17 #include "gstypes.h" 18 #include "gsmemory.h" /* for iminst.h */ 19 #include "gconfigd.h" 20 #include "iref.h" 21 #include "ivmspace.h" 22 #include "opdef.h" 23 #include "ifunc.h" 24 #include "iapi.h" 25 #include "iminst.h" 26 #include "iplugin.h" 27 28 /* Define the default values for an interpreter instance. */ 29 const gs_main_instance gs_main_instance_init_values = 30 {gs_main_instance_default_init_values}; 31 32 /* Set up the .ps file name string array. */ 33 /* We fill in the lengths at initialization time. */ 34 #define ref_(t) struct { struct tas_s tas; t value; } 35 #define string_(s,len)\ 36 { { (t_string<<r_type_shift) + a_readonly + avm_foreign, len }, s }, 37 #define psfile_(fns,len) string_(fns,len) 38 const ref_(const char *) gs_init_file_array[] = { 39 #include "gconf.h" 40 string_(0, 0) 41 }; 42 #undef psfile_ 43 44 /* Set up the emulator name string array similarly. */ 45 #define emulator_(ems,len) string_(ems,len) 46 const ref_(const char *) gs_emulator_name_array[] = { 47 #include "gconf.h" 48 string_(0, 0) 49 }; 50 #undef emulator_ 51 52 /* Set up the function type table similarly. */ 53 #define function_type_(i,proc) extern build_function_proc(proc); 54 #include "gconf.h" 55 #undef function_type_ 56 #define function_type_(i,proc) {i,proc}, 57 const build_function_type_t build_function_type_table[] = { 58 #include "gconf.h" 59 {0} 60 }; 61 #undef function_type_ 62 const uint build_function_type_table_count = 63 countof(build_function_type_table) - 1; 64 65 /* Initialize the operators. */ 66 /* Declare the externs. */ 67 #define oper_(xx_op_defs) extern const op_def xx_op_defs[]; 68 oper_(interp1_op_defs) /* Interpreter operators */ 69 oper_(interp2_op_defs) /* ibid. */ 70 #include "gconf.h" 71 #undef oper_ 72 73 const op_def *const op_defs_all[] = { 74 #define oper_(defs) defs, 75 oper_(interp1_op_defs) /* Interpreter operators */ 76 oper_(interp2_op_defs) /* ibid. */ 77 #include "gconf.h" 78 #undef oper_ 79 0 80 }; 81 const uint op_def_count = (countof(op_defs_all) - 1) * OP_DEFS_MAX_SIZE; 82 83 /* Set up the plugin table. */ 84 85 #define plugin_(proc) extern plugin_instantiation_proc(proc); 86 #include "gconf.h" 87 #undef plugin_ 88 89 extern_i_plugin_table(); 90 #define plugin_(proc) proc, 91 const i_plugin_instantiation_proc i_plugin_table[] = { 92 #include "gconf.h" 93 0 94 }; 95 #undef plugin_ 96