diff options
author | L Peter Deutsch <lpd@ghostscript.com> | 2000-04-04 22:13:23 +0000 |
---|---|---|
committer | L Peter Deutsch <lpd@ghostscript.com> | 2000-04-04 22:13:23 +0000 |
commit | 5dbebef729842941f079c0f6c63c64757f518a31 (patch) | |
tree | 6375d7a3f65d34769736a5cf3f1f17ed9257523c /gs/src/zdict.c | |
parent | 247ffb74e536d1092d0968b467f4c4e97530c25e (diff) |
Extends .forceput to handle arrays as well as dictionaries, required to fix
a bug with internaldict.
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@241 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/src/zdict.c')
-rw-r--r-- | gs/src/zdict.c | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/gs/src/zdict.c b/gs/src/zdict.c index e8af58a37..7e2ff3168 100644 --- a/gs/src/zdict.c +++ b/gs/src/zdict.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1989, 1996, 1997, 1998, 1999 Aladdin Enterprises. All rights reserved. +/* Copyright (C) 1989, 2000 Aladdin Enterprises. All rights reserved. This file is part of Aladdin Ghostscript. @@ -391,39 +391,6 @@ zdicttomark(i_ctx_t *i_ctx_p) return code; } -/* <dict> <key> <value> .forceput - */ -/* - * This forces a "put" even if the dictionary is not writable, and (if the - * dictionary is systemdict or the save level is 0) even if the value is in - * local VM. It is meant to be used only for replacing the value of - * FontDirectory in systemdict when switching between local and global VM, - * and a few similar applications. After initialization, this operator - * should no longer be accessible by name. - */ -private int -zforceput(i_ctx_t *i_ctx_p) -{ - os_ptr op = osp; - os_ptr odp = op - 2; - int code; - - check_type(*odp, t_dictionary); - if (odp->value.pdict == systemdict->value.pdict || - !imemory_save_level(iimemory) - ) { - uint space = r_space(odp); - - r_set_space(odp, avm_local); - code = idict_put(odp, op - 1, op); - r_set_space(odp, space); - } else - code = idict_put(odp, op - 1, op); - if (code < 0) - return code; - pop(3); - return 0; -} - /* <dict> <key> .forceundef - */ /* * This forces an "undef" even if the dictionary is not writable. @@ -529,7 +496,6 @@ const op_def zdict2_op_defs[] = { /* Extensions */ {"2.dictcopynew", zdictcopynew}, {"1.dicttomark", zdicttomark}, - {"3.forceput", zforceput}, {"2.forceundef", zforceundef}, {"2.knownget", zknownget}, {"1.knownundef", zknownundef}, |