1 /* Copyright (C) 1998, 2000 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: icstate.h,v 1.13 2004/08/04 19:36:12 stefan Exp $ */ 18 /* Externally visible context state */ 19 20 #ifndef icstate_INCLUDED 21 # define icstate_INCLUDED 22 23 #include "imemory.h" 24 #include "iref.h" 25 #include "idsdata.h" 26 #include "iesdata.h" 27 #include "iosdata.h" 28 29 /* 30 * Define the externally visible state of an interpreter context. 31 * If we aren't supporting Display PostScript features, there is only 32 * a single context. 33 */ 34 #ifndef gs_context_state_t_DEFINED 35 # define gs_context_state_t_DEFINED 36 typedef struct gs_context_state_s gs_context_state_t; 37 #endif 38 39 #ifndef gs_file_path_ptr_DEFINED 40 # define gs_file_path_ptr_DEFINED 41 typedef struct gs_file_path_s *gs_file_path_ptr; 42 #endif 43 44 45 struct gs_context_state_s { 46 gs_state *pgs; 47 gs_dual_memory_t memory; 48 int language_level; 49 ref array_packing; /* t_boolean */ 50 ref binary_object_format; /* t_integer */ 51 long rand_state; /* (not in Red Book) */ 52 long usertime_total; /* total accumulated usertime, */ 53 /* not counting current time if running */ 54 bool keep_usertime; /* true if context ever executed usertime */ 55 int in_superexec; /* # of levels of superexec */ 56 /* View clipping is handled in the graphics state. */ 57 ref userparams; /* t_dictionary */ 58 int scanner_options; /* derived from userparams */ 59 bool LockFilePermissions; /* accessed from userparams */ 60 bool starting_arg_file; /* starting a file specified in command line. */ 61 gs_file_path_ptr lib_path; /* library search list (GS_LIB) */ 62 ref stdio[3]; /* t_file */ 63 /* Put the stacks at the end to minimize other offsets. */ 64 dict_stack_t dict_stack; 65 exec_stack_t exec_stack; 66 op_stack_t op_stack; 67 struct i_plugin_holder_s *plugin_list; 68 }; 69 extern const long rand_state_initial; /* in zmath.c */ 70 71 /* 72 * We make st_context_state public because zcontext.c must subclass it. 73 */ 74 /*extern_st(st_context_state); *//* in icontext.h */ 75 #define public_st_context_state() /* in icontext.c */\ 76 gs_public_st_complex_only(st_context_state, gs_context_state_t,\ 77 "gs_context_state_t", context_state_clear_marks,\ 78 context_state_enum_ptrs, context_state_reloc_ptrs, 0) 79 80 #endif /* icstate_INCLUDED */ 81