diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2019-03-07 18:03:00 +0000 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2019-05-29 09:39:36 +0100 |
commit | 9de16a6637b73e35f79d2d622de403b24e6502f2 (patch) | |
tree | bc6fba44e03e9caab75968fda94a0cea73caf5e3 /cups | |
parent | 808021913baf763e07cc9eabc3716bfa507380ff (diff) | |
download | ghostpdl-9de16a6637b73e35f79d2d622de403b24e6502f2.tar.gz |
Move FILE * operations behind new gp_file * API.
(squash of commits from filesec branch)
Most of this commit is donkeywork conversions of calls from
FILE * -> gp_file *, fwrite -> gp_fwrite etc. Pretty much every
device is touched, along with the clist and parsing code.
The more interesting changes are within gp.h (where the actual
new API is defined), gpmisc.c (where the basic implementations
live), and the platform specific levels (gp_mswin.c, gp_unifs.c
etc where the platform specific implementations have been
tweaked/renamed).
File opening path validation
All file opening routines now call a central routine for
path validation.
This then consults new entries in gs_lib_ctx to see if validation
is enabled or not. If so, it validates the paths by seeing if
they match.
Simple C level functions for adding/removing/clearing paths, exposed
through the gsapi level.
Add 2 postscript operators for path control.
<name> <string> .addcontrolpath -
Add the given <string> (path) to the list of paths for
controlset <name>, where <name> can be:
/PermitFileReading
/PermitFileWriting
/PermitFileControl
(Anything else -> rangecheck)
- .activatepathcontrol -
Enable path control. At this point PS cannot make any
more changes, and all file access is checked.
Diffstat (limited to 'cups')
-rw-r--r-- | cups/gdevcups.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cups/gdevcups.c b/cups/gdevcups.c index f08a21518..1c7b99f8d 100644 --- a/cups/gdevcups.c +++ b/cups/gdevcups.c @@ -248,7 +248,7 @@ private dev_proc_get_initial_matrix(cups_get_matrix); private int cups_get_params(gx_device *, gs_param_list *); private dev_proc_open_device(cups_open); private dev_proc_output_page(cups_output_page); -private int cups_print_pages(gx_device_printer *, FILE *, int); +private int cups_print_pages(gx_device_printer *, gp_file *, int); private int cups_put_params(gx_device *, gs_param_list *); private int cups_set_color_info(gx_device *); private dev_proc_sync_output(cups_sync_output); @@ -2891,7 +2891,7 @@ cups_output_page(gx_device *pdev, int num_copies, int flush) private int /* O - 0 if everything is OK */ cups_print_pages(gx_device_printer *pdev, /* I - Device info */ - FILE *fp, /* I - Output file */ + gp_file *fp, /* I - Output file */ int num_copies) /* I - Number of copies */ { @@ -2994,7 +2994,7 @@ cups_print_pages(gx_device_printer *pdev, contain the new code needed for PWG Raster output. This conditional is a temporary workaround for the time being until up-to-date CUPS libraries get included. */ - if ((cups->stream = cupsRasterOpen(fileno(cups->file), + if ((cups->stream = cupsRasterOpen(fileno(gp_get_file(cups->file)), #if defined(CUPS_RASTER_HAVE_PWGRASTER) (strcasecmp(cups->header.MediaClass, "PwgRaster") == 0 ? |