summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'base/gslibctx.h')
-rw-r--r--base/gslibctx.h66
1 files changed, 54 insertions, 12 deletions
diff --git a/base/gslibctx.h b/base/gslibctx.h
index 79bc9da8..9f814b5c 100644
--- a/base/gslibctx.h
+++ b/base/gslibctx.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2019 Artifex Software, Inc.
+/* Copyright (C) 2001-2020 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -38,9 +38,14 @@ typedef struct gs_font_dir_s gs_font_dir;
typedef int (*client_check_file_permission_t) (gs_memory_t *mem, const char *fname, const int len, const char *permission);
typedef struct {
- unsigned int max;
- unsigned int num;
- char **paths;
+ char *path;
+ int flags;
+} gs_path_control_entry_t;
+
+typedef struct {
+ unsigned int max;
+ unsigned int num;
+ gs_path_control_entry_t *entry;
} gs_path_control_set_t;
typedef struct {
@@ -81,6 +86,14 @@ typedef struct gs_fs_list_s {
struct gs_fs_list_s *next;
} gs_fs_list_t;
+typedef int (*gs_callout_fn)(void *, void *, const char *, int, int, void *);
+
+typedef struct gs_callout_list_s {
+ struct gs_callout_list_s *next;
+ gs_callout_fn callout;
+ void *handle;
+} gs_callout_list_t;
+
typedef struct {
void *monitor;
int refs;
@@ -89,10 +102,12 @@ typedef struct {
FILE *fstdout;
FILE *fstderr;
gp_file *fstdout2; /* for redirecting %stdout and diagnostics */
- bool stdout_is_redirected; /* to stderr or fstdout2 */
- bool stdout_to_stderr;
- bool stdin_is_interactive;
- void *caller_handle; /* identifies caller of GS DLL/shared object */
+ int stdout_is_redirected; /* to stderr or fstdout2 */
+ int stdout_to_stderr;
+ int stdin_is_interactive;
+ void *default_caller_handle; /* identifies caller of GS DLL/shared object */
+ void *std_caller_handle;
+ void *poll_caller_handle;
void *custom_color_callback; /* pointer to color callback structure */
int (GSDLLCALL *stdin_fn)(void *caller_handle, char *buf, int len);
int (GSDLLCALL *stdout_fn)(void *caller_handle, const char *str, int len);
@@ -102,7 +117,7 @@ typedef struct {
/* True if we are emulating CPSI. Ideally this would be in the imager
* state, but this can't be done due to problems detecting changes in it
* for the clist based devices. */
- bool CPSI_mode;
+ int CPSI_mode;
int scanconverter;
int act_on_uel;
@@ -116,6 +131,8 @@ typedef struct {
* all builds. */
void *cal_ctx;
+ gs_callout_list_t *callouts;
+
/* Stashed args */
int arg_max;
int argc;
@@ -134,7 +151,7 @@ typedef struct gs_lib_ctx_s
*/
gs_gc_root_ptr name_table_root;
/* Define whether dictionaries expand automatically when full. */
- bool dict_auto_expand; /* ps dictionary: false level 1 true level 2 or 3 */
+ int dict_auto_expand; /* ps dictionary: false level 1 true level 2 or 3 */
/* A table of local copies of the IODevices */
struct gx_io_device_s **io_device_table;
int io_device_table_count;
@@ -143,7 +160,7 @@ typedef struct gs_lib_ctx_s
client_check_file_permission_t client_check_file_permission;
/* Define the default value of AccurateScreens that affects setscreen
and setcolorscreen. */
- bool screen_accurate_screens;
+ int screen_accurate_screens;
uint screen_min_screen_levels;
/* Accuracy vs. performance for ICC color */
uint icc_color_accuracy;
@@ -192,6 +209,12 @@ void *gs_lib_ctx_get_cms_context( const gs_memory_t *mem );
void gs_lib_ctx_set_cms_context( const gs_memory_t *mem, void *cms_context );
int gs_lib_ctx_get_act_on_uel( const gs_memory_t *mem );
+int gs_lib_ctx_register_callout(gs_memory_t *mem, gs_callout_fn, void *arg);
+void gs_lib_ctx_deregister_callout(gs_memory_t *mem, gs_callout_fn, void *arg);
+int gs_lib_ctx_callout(gs_memory_t *mem, const char *dev_name,
+ int id, int size, void *data);
+
+
#ifndef GS_THREADSAFE
/* HACK to get at non garbage collection memory pointer
*
@@ -230,9 +253,13 @@ void sjpxd_destroy(gs_memory_t *mem);
typedef enum {
gs_permit_file_reading = 0,
gs_permit_file_writing = 1,
- gs_permit_file_control = 2,
+ gs_permit_file_control = 2
} gs_path_control_t;
+enum {
+ gs_path_control_flag_is_scratch_file = 1
+};
+
int
gs_add_control_path(const gs_memory_t *mem, gs_path_control_t type, const char *path);
@@ -240,6 +267,12 @@ int
gs_add_control_path_len(const gs_memory_t *mem, gs_path_control_t type, const char *path, size_t path_len);
int
+gs_add_control_path_flags(const gs_memory_t *mem, gs_path_control_t type, const char *path, int flags);
+
+int
+gs_add_control_path_len_flags(const gs_memory_t *mem, gs_path_control_t type, const char *path, size_t path_len, int flags);
+
+int
gs_add_outputfile_control_path(gs_memory_t *mem, const char *fname);
int
@@ -254,10 +287,19 @@ gs_remove_control_path(const gs_memory_t *mem, gs_path_control_t type, const cha
int
gs_remove_control_path_len(const gs_memory_t *mem, gs_path_control_t type, const char *path, size_t path_len);
+int
+gs_remove_control_path_flags(const gs_memory_t *mem, gs_path_control_t type, const char *path, int flags);
+
+int
+gs_remove_control_path_len_flags(const gs_memory_t *mem, gs_path_control_t type, const char *path, size_t path_len, int flags);
+
void
gs_purge_control_paths(const gs_memory_t *mem, gs_path_control_t type);
void
+gs_purge_scratch_files(const gs_memory_t *mem);
+
+void
gs_activate_path_control(gs_memory_t *mem, int enable);
int