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: main.h 9043 2008-08-28 22:48:19Z giles $ */ 15 /* Backward-compatible interface to gsmain.c */ 16 17 #ifndef main_INCLUDED 18 # define main_INCLUDED 19 20 #include "iapi.h" 21 #include "imain.h" 22 #include "iminst.h" 23 24 /* 25 * This file adds to imain.h some backward-compatible procedures and 26 * data elements that assume there is only a single instance of 27 * the interpreter. 28 */ 29 30 /* conditional out the entire file */ 31 #if 0 32 33 34 /* ================ Data elements ================ */ 35 36 /* Clients should never access these directly. */ 37 38 #define gs_user_errors (gs_main_instance_default()->user_errors) 39 #define gs_lib_path (gs_main_instance_default()->lib_path) 40 /* gs_lib_paths removed in release 3.65 */ 41 /* gs_lib_env_path removed in release 3.65 */ 42 43 /* ================ Exported procedures from gsmain.c ================ */ 44 45 /* ---------------- Initialization ---------------- */ 46 47 #define gs_init0(in, out, err, mlp)\ 48 gs_main_init0(gs_main_instance_default(), in, out, err, mlp) 49 50 #define gs_init1()\ 51 gs_main_init1(gs_main_instance_default()) 52 53 #define gs_init2()\ 54 gs_main_init2(gs_main_instance_default()) 55 56 #define gs_add_lib_path(path)\ 57 gs_main_add_lib_path(gs_main_instance_default(), path) 58 59 #define gs_set_lib_paths()\ 60 gs_main_set_lib_paths(gs_main_instance_default()) 61 62 #define gs_lib_open(fname, pfile)\ 63 gs_main_lib_open(gs_main_instance_default(), fname, pfile) 64 65 /* ---------------- Execution ---------------- */ 66 67 #define gs_run_file(fn, ue, pec, peo)\ 68 gs_main_run_file(gs_main_instance_default(), fn, ue, pec, peo) 69 70 #define gs_run_string(str, ue, pec, peo)\ 71 gs_main_run_string(gs_main_instance_default(), str, ue, pec, peo) 72 73 #define gs_run_string_with_length(str, len, ue, pec, peo)\ 74 gs_main_run_string_with_length(gs_main_instance_default(),\ 75 str, len, ue, pec, peo) 76 77 #define gs_run_file_open(fn, pfref)\ 78 gs_main_run_file_open(gs_main_instance_default(), fn, pfref) 79 80 #define gs_run_string_begin(ue, pec, peo)\ 81 gs_main_run_string_begin(gs_main_instance_default(), ue, pec, peo) 82 83 #define gs_run_string_continue(str, len, ue, pec, peo)\ 84 gs_main_run_string_continue(gs_main_instance_default(),\ 85 str, len, ue, pec, peo) 86 87 #define gs_run_string_end(ue, pec, peo)\ 88 gs_main_run_string_end(gs_main_instance_default(), ue, pec, peo) 89 90 /* ---------------- Debugging ---------------- */ 91 92 /* 93 * We should have the following definition: 94 95 #define gs_debug_dump_stack(code, peo)\ 96 gs_main_dump_stack(gs_main_instance_default(), code, peo) 97 98 * but we make it a procedure instead so it can be called from debuggers. 99 */ 100 void gs_debug_dump_stack(int code, ref * perror_object); 101 102 /* ---------------- Termination ---------------- */ 103 104 105 #endif /* full file conditional */ 106 107 #endif /* main_INCLUDED */ 108