386BSD 0.1 development
[unix-history] / usr / othersrc / public / ghostscript-2.4.1 / gs.h
CommitLineData
6fa83d73
WJ
1/* Copyright (C) 1989, 1990 Aladdin Enterprises. All rights reserved.
2 Distributed by Free Software Foundation, Inc.
3
4This file is part of Ghostscript.
5
6Ghostscript is distributed in the hope that it will be useful, but
7WITHOUT ANY WARRANTY. No author or distributor accepts responsibility
8to anyone for the consequences of using it or for whether it serves any
9particular purpose or works at all, unless he says so in writing. Refer
10to the Ghostscript General Public License for full details.
11
12Everyone is granted permission to copy, modify and redistribute
13Ghostscript, but only under the conditions described in the Ghostscript
14General Public License. A copy of this license is supposed to have been
15given to you along with Ghostscript so you can know your rights and
16responsibilities. It should be in a file named COPYING. Among other
17things, the copyright notice and this notice must be preserved on all
18copies. */
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. */
26extern FILE *gs_out;
27#ifdef DEBUG
28extern FILE *gs_debug_out;
29#undef dstderr
30#define dstderr gs_debug_out
31#endif
32
33/* Representation of a point. */
34typedef struct gs_point_s {
35 double x, y;
36} gs_point;
37typedef 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. */
44typedef struct gs_rect_s {
45 gs_point p, q; /* origin point, corner point */
46} gs_rect;
47typedef 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. */
53typedef 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. */
57typedef 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: */
63char *gs_malloc(P3(uint, uint, const char *));
64void gs_free(P4(char *, uint, uint, const char *));