home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / g / gs252src.zip / GS252 / DSTACK.H < prev    next >
C/C++ Source or Header  |  1992-06-13  |  2KB  |  47 lines

  1. /* Copyright (C) 1992 Aladdin Enterprises.  All rights reserved.
  2.    Distributed by Free Software Foundation, Inc.
  3.  
  4. This file is part of Ghostscript.
  5.  
  6. Ghostscript is distributed in the hope that it will be useful, but
  7. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. to anyone for the consequences of using it or for whether it serves any
  9. particular purpose or works at all, unless he says so in writing.  Refer
  10. to the Ghostscript General Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. Ghostscript, but only under the conditions described in the Ghostscript
  14. General Public License.  A copy of this license is supposed to have been
  15. given to you along with Ghostscript so you can know your rights and
  16. responsibilities.  It should be in a file named COPYING.  Among other
  17. things, the copyright notice and this notice must be preserved on all
  18. copies.  */
  19.  
  20. /* dstack.h */
  21. /* Direct access to the Ghostscript dictionary stack */
  22.  
  23. /********************************
  24.  * NOTE: on MS-DOS systems, the dict stack is stored in the data segment.
  25.  * This leads to large performance gains, at the expense of having to swap
  26.  * the stack explicitly when switching contexts or handling segment under-
  27.  * or overflow (none of which are implemented yet!).
  28.  ********************************/
  29.  
  30. /* Define the dictionary stack and the standard dictionaries. */
  31. extern ref dstack[];
  32. extern uint min_dstack_size;        /* # of permanent entries */
  33. #define systemdict (dstack[0])
  34. #define userdict (dstack[min_dstack_size - 1])
  35.  
  36. /* Define the dictionary stack pointers. */
  37. typedef ref _ds *ds_ptr;
  38. typedef const ref _ds *const_ds_ptr;
  39. extern ds_ptr dsp, dstop;
  40.  
  41. /* Define a special fast entry for name lookup in the interpreter. */
  42. /* The key is known to be a name; search the entire dict stack. */
  43. /* Return the pointer to the value slot. */
  44. /* If the name isn't found, just return 0. */
  45. extern ref *dict_find_name_by_index(P1(uint nidx));
  46. #define dict_find_name(pnref) dict_find_name_by_index(name_index(pnref))
  47.