1 /* Copyright (C) 2001-2019 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,
8    modified or distributed except as expressly authorized under the terms
9    of the license contained in the file LICENSE in this distribution.
10 
11    Refer to licensing information at http://www.artifex.com or contact
12    Artifex Software, Inc.,  1305 Grant Avenue - Suite 200, Novato,
13    CA 94945, U.S.A., +1(415)492-9861, for further information.
14 */
15 
16 
17 /* Interface to procedures in iutil2.c */
18 
19 #ifndef iutil2_INCLUDED
20 #  define iutil2_INCLUDED
21 
22 #include "stdpre.h"
23 #include "gsfunc.h"
24 #include "iref.h"
25 
26 /* ------ Password utilities ------ */
27 
28 /* Define the password structure. */
29 /* NOTE: MAX_PASSWORD must match the initial password lengths in gs_lev2.ps. */
30 #define MAX_PASSWORD 64		/* must be at least 11 */
31 typedef struct password_s {
32     uint size;
33     byte data[MAX_PASSWORD];
34 } password;
35 
36 # define NULL_PASSWORD {0, {0}}
37 
38 /* Transmit a password to or from a parameter list. */
39 int param_read_password(gs_param_list *, const char *, password *);
40 int param_write_password(gs_param_list *, const char *, const password *);
41 
42 /* Check a password from a parameter list. */
43 /* Return 0 if OK, 1 if not OK, or an error code. */
44 int param_check_password(gs_param_list *, const password *);
45 
46 /* Read a password from, or write a password into, a dictionary */
47 /* (presumably systemdict). */
48 int dict_read_password(password *, const ref *, const char *);
49 int dict_write_password(const password *, ref *, const char *, bool);
50 
51 #endif /* iutil2_INCLUDED */
52