Commit | Line | Data |
---|---|---|
6fa83d73 WJ |
1 | /* Copyright (C) 1989, 1990 Aladdin Enterprises. All rights reserved. |
2 | Distributed by Free Software Foundation, Inc. | |
3 | ||
4 | This file is part of Ghostscript. | |
5 | ||
6 | Ghostscript is distributed in the hope that it will be useful, but | |
7 | WITHOUT ANY WARRANTY. No author or distributor accepts responsibility | |
8 | to anyone for the consequences of using it or for whether it serves any | |
9 | particular purpose or works at all, unless he says so in writing. Refer | |
10 | to the Ghostscript General Public License for full details. | |
11 | ||
12 | Everyone is granted permission to copy, modify and redistribute | |
13 | Ghostscript, but only under the conditions described in the Ghostscript | |
14 | General Public License. A copy of this license is supposed to have been | |
15 | given to you along with Ghostscript so you can know your rights and | |
16 | responsibilities. It should be in a file named COPYING. Among other | |
17 | things, the copyright notice and this notice must be preserved on all | |
18 | copies. */ | |
19 | ||
20 | /* gs.h */ | |
21 | /* Common definitions for Ghostscript library */ | |
22 | #include <stdio.h> | |
23 | #include "std.h" | |
24 | ||
25 | /* Ghostscript never writes directly to stdout. */ | |
26 | extern FILE *gs_out; | |
27 | #ifdef DEBUG | |
28 | extern FILE *gs_debug_out; | |
29 | #undef dstderr | |
30 | #define dstderr gs_debug_out | |
31 | #endif | |
32 | ||
33 | /* Representation of a point. */ | |
34 | typedef struct gs_point_s { | |
35 | double x, y; | |
36 | } gs_point; | |
37 | typedef struct gs_int_point_s { | |
38 | int x, y; | |
39 | } gs_int_point; | |
40 | /* Representation of a rectangle. */ | |
41 | /* Note that rectangles are half-open, i.e.: their width is */ | |
42 | /* q.x-p.x and their height is q.y-p.y; they include the points */ | |
43 | /* (x,y) such that p.x<=x<q.x and p.y<=y<q.y. */ | |
44 | typedef struct gs_rect_s { | |
45 | gs_point p, q; /* origin point, corner point */ | |
46 | } gs_rect; | |
47 | typedef struct gs_int_rect_s { | |
48 | gs_int_point p, q; | |
49 | } gs_int_rect; | |
50 | ||
51 | /* So many routines use the graphics state */ | |
52 | /* that we may as well declare the abstract type here. */ | |
53 | typedef struct gs_state_s gs_state; | |
54 | ||
55 | /* A number of interfaces involve user-specified allocation */ | |
56 | /* and deallocation procedures, so we define the structure here. */ | |
57 | typedef struct { | |
58 | proc_alloc_t alloc; | |
59 | proc_free_t free; | |
60 | } gs_memory_procs; | |
61 | /* We define our own versions of malloc and free that conform */ | |
62 | /* to the types proc_alloc_t and proc_free_t: */ | |
63 | char *gs_malloc(P3(uint, uint, const char *)); | |
64 | void gs_free(P4(char *, uint, uint, const char *)); |