1 /* Copyright (C) 2001-2019 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, 8 modified or distributed except as expressly authorized under the terms 9 of the license contained in the file LICENSE in this distribution. 10 11 Refer to licensing information at http://www.artifex.com or contact 12 Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato, 13 CA 94945, U.S.A., +1(415)492-9861, for further information. 14 */ 15 16 17 /* Backward-compatible interface to gsmain.c */ 18 19 #ifndef main_INCLUDED 20 # define main_INCLUDED 21 22 #include "iapi.h" 23 #include "imain.h" 24 #include "iminst.h" 25 26 /* 27 * This file adds to imain.h some backward-compatible procedures and 28 * data elements that assume there is only a single instance of 29 * the interpreter. 30 */ 31 32 /* conditional out the entire file */ 33 #if 0 34 35 /* ================ Data elements ================ */ 36 37 /* Clients should never access these directly. */ 38 39 #define gs_user_errors (gs_main_instance_default()->user_errors) 40 #define gs_lib_path (gs_main_instance_default()->lib_path) 41 /* gs_lib_paths removed in release 3.65 */ 42 /* gs_lib_env_path removed in release 3.65 */ 43 44 /* ================ Exported procedures from gsmain.c ================ */ 45 46 /* ---------------- Initialization ---------------- */ 47 48 #define gs_init0(in, out, err, mlp)\ 49 gs_main_init0(gs_main_instance_default(), in, out, err, mlp) 50 51 #define gs_init1()\ 52 gs_main_init1(gs_main_instance_default()) 53 54 #define gs_init2()\ 55 gs_main_init2(gs_main_instance_default()) 56 57 #define gs_add_lib_path(path)\ 58 gs_main_add_lib_path(gs_main_instance_default(), path) 59 60 #define gs_set_lib_paths()\ 61 gs_main_set_lib_paths(gs_main_instance_default()) 62 63 #define gs_lib_open(fname, pfile)\ 64 gs_main_lib_open(gs_main_instance_default(), fname, pfile) 65 66 /* ---------------- Execution ---------------- */ 67 68 #define gs_run_file(fn, ue, pec, peo)\ 69 gs_main_run_file(gs_main_instance_default(), fn, ue, pec, peo) 70 71 #define gs_run_string(str, ue, pec, peo)\ 72 gs_main_run_string(gs_main_instance_default(), str, ue, pec, peo) 73 74 #define gs_run_string_with_length(str, len, ue, pec, peo)\ 75 gs_main_run_string_with_length(gs_main_instance_default(),\ 76 str, len, ue, pec, peo) 77 78 #define gs_run_file_open(fn, pfref)\ 79 gs_main_run_file_open(gs_main_instance_default(), fn, pfref) 80 81 #define gs_run_string_begin(ue, pec, peo)\ 82 gs_main_run_string_begin(gs_main_instance_default(), ue, pec, peo) 83 84 #define gs_run_string_continue(str, len, ue, pec, peo)\ 85 gs_main_run_string_continue(gs_main_instance_default(),\ 86 str, len, ue, pec, peo) 87 88 #define gs_run_string_end(ue, pec, peo)\ 89 gs_main_run_string_end(gs_main_instance_default(), ue, pec, peo) 90 91 /* ---------------- Debugging ---------------- */ 92 93 /* 94 * We should have the following definition: 95 96 #define gs_debug_dump_stack(code, peo)\ 97 gs_main_dump_stack(gs_main_instance_default(), code, peo) 98 99 * but we make it a procedure instead so it can be called from debuggers. 100 */ 101 void gs_debug_dump_stack(int code, ref * perror_object); 102 103 /* ---------------- Termination ---------------- */ 104 105 #endif /* full file conditional */ 106 107 #endif /* main_INCLUDED */ 108