386BSD 0.1 development
[unix-history] / usr / othersrc / public / ghostscript-2.4.1 / iutil.h
CommitLineData
a14dfc57
WJ
1/* Copyright (C) 1991 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/* iutil.h */
21/* Prototypes for procedures in iutil.c */
22
23/* ------ Object utilities ------ */
24
25/* Copy refs from one place to another. */
26/* (If we are copying to the stack, we can just use memcpy.) */
27extern void refcpy_to_new(P3(ref *to, const ref *from, uint size));
28extern void refcpy_to_old(P4(ref *to, const ref *from, uint size, const char *client_name));
29/* Fill an array with nulls. */
30extern void refset_null(P2(ref *to, uint size));
31
32/* Compare two objects for equality. Return 1 if equal, 0 if not. */
33extern int obj_eq(P2(const ref *, const ref *));
34
35/* Create a printable representation of an object, a la cvs. */
36/* Return 0 if OK, <0 if the destination wasn't large enough. */
37extern int obj_cvs(P4(const ref *, byte *, uint, uint *));
38
39/* ------ String utilities ------ */
40
41/* Convert a C string to a Ghostscript string */
42extern int string_to_ref(P3(const char *, ref *, const char *));
43
44/* Convert a Ghostscript string to a C string. */
45/* Return 0 iff the buffer can't be allocated. */
46extern char *ref_to_string(P2(const ref *, const char *));
47
48/* ------ Operand utilities ------ */
49
50/* Get N numeric operands from the stack. */
51/* Note that the first argument must be ref * rather than os_ptr, */
52/* because num_params is sometimes used elsewhere than */
53/* on the operand stack. */
54extern int num_params(P3(const ref *, int, float *));
55
56/* Get a real parameter. */
57extern int real_param(P2(const ref *, float *));
58
59/* Check for a matrix operand with read access. */
60struct gs_matrix_s;
61extern int read_matrix(P2(const ref *, struct gs_matrix_s *));
62
63/* Check for a matrix operand with write access. */
64extern int write_matrix(P1(ref *));