xref: /plan9/sys/src/cmd/gs/src/idosave.h (revision 593dc095aefb2a85c828727bbfa9da139a49bdf4)
1 /* Copyright (C) 1999 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: idosave.h,v 1.5 2002/06/16 04:47:10 lpd Exp $ */
18 /* Supporting procedures for 'save' recording. */
19 
20 #ifndef idosave_INCLUDED
21 #  define idosave_INCLUDED
22 
23 /*
24  * Save a change that must be undone by restore.  We have to pass the
25  * pointer to the containing object to alloc_save_change for two reasons:
26  *
27  *      - We need to know which VM the containing object is in, so we can
28  * know on which chain of saved changes to put the new change.
29  *
30  *      - We need to know whether the object is an array of refs (which
31  * includes dictionaries) or a struct, so we can properly trace and
32  * relocate the pointer to it from the change record during garbage
33  * collection.
34  */
35 int alloc_save_change(gs_dual_memory_t *dmem, const ref *pcont,
36 		      ref_packed *ptr, client_name_t cname);
37 int alloc_save_change_in(gs_ref_memory_t *mem, const ref *pcont,
38 			 ref_packed *ptr, client_name_t cname);
39 
40 #endif /* idosave_INCLUDED */
41