~ubuntu-branches/ubuntu/jaunty/ghostscript/jaunty-updates

« back to all changes in this revision

Viewing changes to base/gxiodev.h

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2009-01-20 16:40:45 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20090120164045-lnfhi0n30o5lwhwa
Tags: 8.64.dfsg.1~svn9377-0ubuntu1
* New upstream release (SVN rev 9377)
   o Fixes many bugs concerning PDF rendering, to make the PDF printing
     workflow correctly working.
   o Fixes long-standing bugs in many drivers, like input paper tray and
     duplex options not working for the built-in PCL 4, 5, 5c, 5e, and
     6/XL drivers, PDF input not working for bjc600, bjc800, and cups
     output devices, several options not working and uninitialized
     memory with cups output device.
   o Merged nearly all patches of the Ubuntu and Debian packages upstream.
   o Fixes LP: #317810, LP: #314439, LP: #314018.
* debian/patches/03_libpaper_support.dpatch,
  debian/patches/11_gs-cjk_font_glyph_handling_fix.dpatch,
  debian/patches/12_gs-cjk_vertical_writing_metrics_fix.dpatch,
  debian/patches/13_gs-cjk_cjkps_examples.dpatch,
  debian/patches/20_bbox_segv_fix.dpatch,
  debian/patches/21_brother_7x0_gdi_fix.dpatch,
  debian/patches/22_epsn_margin_workaround.dpatch,
  debian/patches/24_gs_man_fix.dpatch,
  debian/patches/25_toolbin_insecure_tmp_usage_fix.dpatch,
  debian/patches/26_assorted_script_fixes.dpatch,
  debian/patches/29_gs_css_fix.dpatch,
  debian/patches/30_ps2pdf_man_improvement.dpatch,
  debian/patches/31_fix-gc-sigbus.dpatch,
  debian/patches/34_ftbfs-on-hurd-fix.dpatch,
  debian/patches/35_disable_libcairo.dpatch,
  debian/patches/38_pxl-duplex.dpatch,
  debian/patches/39_pxl-resolution.dpatch,
  debian/patches/42_gs-init-ps-delaybind-fix.dpatch,
  debian/patches/45_bjc600-bjc800-pdf-input.dpatch,
  debian/patches/48_cups-output-device-pdf-duplex-uninitialized-memory-fix.dpatch,
  debian/patches/50_lips4-floating-point-exception.dpatch,
  debian/patches/52_cups-device-logging.dpatch,
  debian/patches/55_pcl-input-slot-fix.dpatch,
  debian/patches/57_pxl-input-slot-fix.dpatch,
  debian/patches/60_pxl-cups-driver-pdf.dpatch,
  debian/patches/62_onebitcmyk-pdf.dpatch,
  debian/patches/65_too-big-temp-files-1.dpatch,
  debian/patches/67_too-big-temp-files-2.dpatch,
  debian/patches/70_take-into-account-data-in-stream-buffer-before-refill.dpatch:
  Removed, applied upstream.
* debian/patches/01_docdir_fix_for_debian.dpatch,
  debian/patches/02_gs_man_fix_debian.dpatch,
  debian/patches/01_docdir-fix-for-debian.dpatch,
  debian/patches/02_docdir-fix-for-debian.dpatch: Renamed patches to
  make merging with Debian easier.
* debian/patches/32_improve-handling-of-media-size-changes-from-gv.dpatch, 
  debian/patches/33_bad-params-to-xinitimage-on-large-bitmaps.dpatch:
  regenerated for new source directory structure.
* debian/rules: Corrected paths to remove cidfmap (it is in Resource/Init/
  in GS 8.64) and to install headers (source paths are psi/ and base/ now).
* debian/rules: Remove all fontmaps, as DeFoMa replaces them.
* debian/local/pdftoraster/pdftoraster.c,
  debian/local/pdftoraster/pdftoraster.convs, debian/rules: Removed
  added pdftoraster filter and use the one which comes with Ghostscript.
* debian/ghostscript.links: s/8.63/8.64/

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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: gxiodev.h 8022 2007-06-05 22:23:38Z giles $ */
 
15
/* Structure and default implementation of IODvices */
 
16
/* Requires gsmemory.h */
 
17
 
 
18
#ifndef gxiodev_INCLUDED
 
19
#  define gxiodev_INCLUDED
 
20
 
 
21
#include "stat_.h"
 
22
 
 
23
/*
 
24
 * Note that IODevices are not the same as Ghostscript output devices.
 
25
 * See section 3.8.2 of the PostScript Language Reference Manual,
 
26
 * Second and Third Edition, for more information.
 
27
 */
 
28
 
 
29
#ifndef gx_io_device_DEFINED
 
30
#  define gx_io_device_DEFINED
 
31
typedef struct gx_io_device_s gx_io_device;
 
32
#endif
 
33
typedef struct gx_io_device_procs_s gx_io_device_procs;  /* defined here */
 
34
 
 
35
/* The IODevice table is defined in gconf.c; its extern is in gscdefs.h. */
 
36
 
 
37
#ifndef file_enum_DEFINED       /* also defined in gp.h */
 
38
#  define file_enum_DEFINED
 
39
struct file_enum_s;             /* opaque to client, defined by implementors */
 
40
typedef struct file_enum_s file_enum;
 
41
#endif
 
42
 
 
43
/* Define an opaque type for parameter lists. */
 
44
#ifndef gs_param_list_DEFINED
 
45
#  define gs_param_list_DEFINED
 
46
typedef struct gs_param_list_s gs_param_list;
 
47
#endif
 
48
 
 
49
/* Define an opaque type for streams. */
 
50
#ifndef stream_DEFINED
 
51
#  define stream_DEFINED
 
52
typedef struct stream_s stream;
 
53
#endif
 
54
 
 
55
/*
 
56
 * Define the IODevice procedures.  Note that file names for fopen, delete,
 
57
 * rename, and status are C strings, not pointer + length.
 
58
 *
 
59
 * open_device is called when opening a file whose name consists only of
 
60
 * the IODevice name, e.g., '%lineedit'.  open_file is called when opening
 
61
 * a file whose name includes both an (optional) IODevice and a further
 
62
 * name, e.g., '%os%xyz' or just 'xyz'.
 
63
 *
 
64
 * The open_device and open_file procedures return streams.  The default
 
65
 * implementation of open_device returns an error; the default
 
66
 * implementation of open_file in the PostScript interpreter,
 
67
 * iodev_os_open_file, uses the IODevice's fopen procedure to open a stream
 
68
 * based on an OS FILE *.  However, IODevices are free to implement
 
69
 * open_file (and, if desired, open_device) in any way they want, returning
 
70
 * a stream that need not have any relationship to the OS's file system.
 
71
 * In this case there is no need to implement fopen or fclose.
 
72
 */
 
73
/* Note also that "streams" are a higher-level concept; */
 
74
/* the open_device and open_file procedures are normally NULL. */
 
75
 
 
76
struct gx_io_device_procs_s {
 
77
 
 
78
#define iodev_proc_init(proc)\
 
79
  int proc(gx_io_device *iodev, gs_memory_t *mem)
 
80
    iodev_proc_init((*init));   /* one-time initialization */
 
81
 
 
82
#define iodev_proc_open_device(proc)\
 
83
  int proc(gx_io_device *iodev, const char *access, stream **ps,\
 
84
           gs_memory_t *mem)
 
85
    iodev_proc_open_device((*open_device));
 
86
 
 
87
#define iodev_proc_open_file(proc)\
 
88
  int proc(gx_io_device *iodev, const char *fname, uint namelen,\
 
89
           const char *access, stream **ps, gs_memory_t *mem)
 
90
    iodev_proc_open_file((*open_file));
 
91
 
 
92
    /* fopen was changed in release 2.9.6, */
 
93
    /* and again in 3.20 to return the real fname separately */
 
94
 
 
95
#define iodev_proc_fopen(proc)\
 
96
  int proc(gx_io_device *iodev, const char *fname, const char *access,\
 
97
           FILE **pfile, char *rfname, uint rnamelen)
 
98
    iodev_proc_fopen((*fopen));
 
99
 
 
100
#define iodev_proc_fclose(proc)\
 
101
  int proc(gx_io_device *iodev, FILE *file)
 
102
    iodev_proc_fclose((*fclose));
 
103
 
 
104
#define iodev_proc_delete_file(proc)\
 
105
  int proc(gx_io_device *iodev, const char *fname)
 
106
    iodev_proc_delete_file((*delete_file));
 
107
 
 
108
#define iodev_proc_rename_file(proc)\
 
109
  int proc(gx_io_device *iodev, const char *from, const char *to)
 
110
    iodev_proc_rename_file((*rename_file));
 
111
 
 
112
#define iodev_proc_file_status(proc)\
 
113
  int proc(gx_io_device *iodev, const char *fname, struct stat *pstat)
 
114
    iodev_proc_file_status((*file_status));
 
115
 
 
116
#define iodev_proc_enumerate_files(proc)\
 
117
  file_enum *proc(gx_io_device *iodev, const char *pat, uint patlen,\
 
118
                  gs_memory_t *mem)
 
119
    iodev_proc_enumerate_files((*enumerate_files));
 
120
 
 
121
#define iodev_proc_enumerate_next(proc)\
 
122
  uint proc(file_enum *pfen, char *ptr, uint maxlen)
 
123
    iodev_proc_enumerate_next((*enumerate_next));
 
124
 
 
125
#define iodev_proc_enumerate_close(proc)\
 
126
  void proc(file_enum *pfen)
 
127
    iodev_proc_enumerate_close((*enumerate_close));
 
128
 
 
129
    /* Added in release 2.9 */
 
130
 
 
131
#define iodev_proc_get_params(proc)\
 
132
  int proc(gx_io_device *iodev, gs_param_list *plist)
 
133
    iodev_proc_get_params((*get_params));
 
134
 
 
135
#define iodev_proc_put_params(proc)\
 
136
  int proc(gx_io_device *iodev, gs_param_list *plist)
 
137
    iodev_proc_put_params((*put_params));
 
138
 
 
139
};
 
140
 
 
141
/* The following typedef is needed because ansi2knr can't handle */
 
142
/* iodev_proc_fopen((*procname)) in a formal argument list. */
 
143
typedef iodev_proc_fopen((*iodev_proc_fopen_t));
 
144
 
 
145
/* Default implementations of procedures */
 
146
iodev_proc_init(iodev_no_init);
 
147
iodev_proc_open_device(iodev_no_open_device);
 
148
iodev_proc_open_file(iodev_no_open_file);
 
149
iodev_proc_fopen(iodev_no_fopen);
 
150
iodev_proc_fclose(iodev_no_fclose);
 
151
iodev_proc_delete_file(iodev_no_delete_file);
 
152
iodev_proc_rename_file(iodev_no_rename_file);
 
153
iodev_proc_file_status(iodev_no_file_status);
 
154
iodev_proc_enumerate_files(iodev_no_enumerate_files);
 
155
iodev_proc_get_params(iodev_no_get_params);
 
156
iodev_proc_put_params(iodev_no_put_params);
 
157
/* The %os% implemention of fopen and fclose. */
 
158
/* These are exported for pipes and for %null. */
 
159
iodev_proc_fopen(iodev_os_fopen);
 
160
iodev_proc_fclose(iodev_os_fclose);
 
161
 
 
162
/* Get the N'th IODevice. */
 
163
gx_io_device *gs_getiodevice(int);
 
164
 
 
165
#define iodev_default (gs_getiodevice(0))
 
166
 
 
167
/* Look up an IODevice name. */
 
168
gx_io_device *gs_findiodevice(const byte *, uint);
 
169
 
 
170
/* Get and put IODevice parameters. */
 
171
int gs_getdevparams(gx_io_device *, gs_param_list *);
 
172
int gs_putdevparams(gx_io_device *, gs_param_list *);
 
173
 
 
174
/* Convert an OS error number to a PostScript error */
 
175
/* if opening a file fails. */
 
176
int gs_fopen_errno_to_code(int);
 
177
 
 
178
/* Test whether a string is equal to a character. */
 
179
/* (This is used for access testing in file_open procedures.) */
 
180
#define streq1(str, chr)\
 
181
  ((str)[0] == (chr) && (str)[1] == 0)
 
182
 
 
183
/* Finally, the IODevice structure itself. */
 
184
struct gx_io_device_s {
 
185
    const char *dname;          /* the IODevice name */
 
186
    const char *dtype;          /* the type returned by currentdevparams */
 
187
    gx_io_device_procs procs;
 
188
    void *state;                /* (if the IODevice has state) */
 
189
};
 
190
 
 
191
#define private_st_io_device()  /* in gsiodev.c */\
 
192
  gs_private_st_ptrs1(st_io_device, gx_io_device, "gx_io_device",\
 
193
    io_device_enum_ptrs, io_device_reloc_ptrs, state)
 
194
 
 
195
#endif /* gxiodev_INCLUDED */