1 /* Copyright (C) 1993, 1994, 1998 Aladdin Enterprises. All rights reserved. 2 3 This software is provided AS-IS with no warranty, either express or 4 implied. 5 6 This software is distributed under license and may not be copied, 7 modified or distributed except as expressly authorized under the terms 8 of the license contained in the file LICENSE in this distribution. 9 10 For more information about licensing, please refer to 11 http://www.ghostscript.com/licensing/. For information on 12 commercial licensing, go to http://www.artifex.com/licensing/ or 13 contact Artifex Software, Inc., 101 Lucas Valley Road #110, 14 San Rafael, CA 94903, U.S.A., +1(415)492-9861. 15 */ 16 17 /* $Id: iutil2.h,v 1.6 2002/06/16 04:47:10 lpd Exp $ */ 18 /* Interface to procedures in iutil2.c */ 19 20 #ifndef iutil2_INCLUDED 21 # define iutil2_INCLUDED 22 23 /* ------ Password utilities ------ */ 24 25 /* Define the password structure. */ 26 /* NOTE: MAX_PASSWORD must match the initial password lengths in gs_lev2.ps. */ 27 #define MAX_PASSWORD 64 /* must be at least 11 */ 28 typedef struct password_s { 29 uint size; 30 byte data[MAX_PASSWORD]; 31 } password; 32 33 # define NULL_PASSWORD {0, {0}} 34 35 /* Transmit a password to or from a parameter list. */ 36 int param_read_password(gs_param_list *, const char *, password *); 37 int param_write_password(gs_param_list *, const char *, const password *); 38 39 /* Check a password from a parameter list. */ 40 /* Return 0 if OK, 1 if not OK, or an error code. */ 41 int param_check_password(gs_param_list *, const password *); 42 43 /* Read a password from, or write a password into, a dictionary */ 44 /* (presumably systemdict). */ 45 int dict_read_password(password *, const ref *, const char *); 46 int dict_write_password(const password *, ref *, const char *, bool); 47 48 #endif /* iutil2_INCLUDED */ 49