386BSD 0.1 development
[unix-history] / usr / othersrc / public / ghostscript-2.4.1 / ccfont.h
CommitLineData
feacc7c3
WJ
1/* Copyright (C) 1992 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/* ccfont.h */
21/* Header for fonts compiled into C. */
22
23/* Define type-specific refs for initializing arrays. */
24#define ref_(t) struct { struct tas_s tas; t value; }
25typedef struct { short len; char _ds *str; } charray;
26typedef struct { byte encx, charx; } charindex;
27#define array_v(n,p,ea)\
28 { {(t_array<<r_type_shift)+(ea), n}, (ref *)(p) }
29#define boolean_v(b) { {t_boolean<<r_type_shift}, (ushort)(b) }
30#define name_v(n,s)\
31 { {t_name<<r_type_shift, n}, s }
32#define null_v() { {t_null<<r_type_shift} }
33#define real_v(v) { {t_real<<r_type_shift}, (float)(v) }
34#define integer_v(i) { {t_integer<<r_type_shift}, (long)(i) }
35#define string_v(n,s)\
36 { {(t_string<<r_type_shift)+a_read+a_execute, n}, s }
37
38/* Define the combined access masks */
39#define a_readonly (a_read + a_execute)
40
41/* Support routines in iccfont.c */
42typedef struct {
43 const charindex _ds *enc_keys; /* keys from encoding vectors */
44 uint num_enc_keys;
45 const char _ds * _ds *str_keys; /* string keys */
46 uint num_str_keys;
47 uint extra_slots; /* (need 1 extra for fonts) */
48 uint dict_attrs; /* protection for dictionary */
49 uint value_attrs; /* protection for values */
50 /* (only used for string dicts) */
51} cfont_dict_keys;
52extern int cfont_ref_dict_create(P3(ref *, const cfont_dict_keys _ds *, const ref _ds * _ds *));
53extern int cfont_string_dict_create(P3(ref *, const cfont_dict_keys _ds *, const charray _ds *));
54extern int cfont_num_dict_create(P3(ref *, const cfont_dict_keys _ds *, const float _ds *));
55extern int cfont_name_array_create(P3(ref *, const char _ds * _ds *, int));