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: iutil2.h 9043 2008-08-28 22:48:19Z giles $ */
15 /* Interface to procedures in iutil2.c */
16 
17 #ifndef iutil2_INCLUDED
18 #  define iutil2_INCLUDED
19 
20 /* ------ Password utilities ------ */
21 
22 /* Define the password structure. */
23 /* NOTE: MAX_PASSWORD must match the initial password lengths in gs_lev2.ps. */
24 #define MAX_PASSWORD 64		/* must be at least 11 */
25 typedef struct password_s {
26     uint size;
27     byte data[MAX_PASSWORD];
28 } password;
29 
30 # define NULL_PASSWORD {0, {0}}
31 
32 /* Transmit a password to or from a parameter list. */
33 int param_read_password(gs_param_list *, const char *, password *);
34 int param_write_password(gs_param_list *, const char *, const password *);
35 
36 /* Check a password from a parameter list. */
37 /* Return 0 if OK, 1 if not OK, or an error code. */
38 int param_check_password(gs_param_list *, const password *);
39 
40 /* Read a password from, or write a password into, a dictionary */
41 /* (presumably systemdict). */
42 int dict_read_password(password *, const ref *, const char *);
43 int dict_write_password(const password *, ref *, const char *, bool);
44 
45 #endif /* iutil2_INCLUDED */
46