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