stak.h
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· C头文件 代码 · 共 115 行
H
115 行
/* @(#)stak.h 4.1 7/17/90 *//************************************************************************ * * * Copyright (c) 1986 by * * Digital Equipment Corporation, Maynard, MA * * All rights reserved. * * * * This software is furnished under a license and may be used and * * copied only in accordance with the terms of such license and * * with the inclusion of the above copyright notice. This * * software or any other copies thereof may not be provided or * * otherwise made available to any other person. No title to and * * ownership of the software is hereby transferred. * * * * This software is derived from software received from the * * University of California, Berkeley, and from Bell * * Laboratories. Use, duplication, or disclosure is subject to * * restrictions under license agreements with University of * * California and with AT&T. * * * * The information in this software is subject to change without * * notice and should not be construed as a commitment by Digital * * Equipment Corporation. * * * * Digital assumes no responsibility for the use or reliability * * of its software on equipment which is not supplied by Digital. * * * ************************************************************************//* * * Modification History: * * 001 - Gary Gaudet for Andy Gadsby 09-mar-88 * i18n version of csh * * * *//* * UNIX shell * * Bell Telephone Laboratories * *//* To use stack as temporary workspace across * possible storage allocation (eg name lookup) * a) get ptr from `relstak' * b) can now use `pushstak' * c) then reset with `setstak' * d) `absstak' gives real address if needed */#define relstak() (staktop-stakbot)#define absstak(x) (stakbot+Rcheat(x))#define setstak(x) (staktop=absstak(x))#define pushstak(c) (*staktop++=(c))#define zerostak() (*staktop=0)/* Used to address an item left on the top of * the stack (very temporary) */#define curstak() (staktop)/* `usestak' before `pushstak' then `fixstak' * These routines are safe against heap * being allocated. */#define usestak() {locstak();}/* for local use only since it hands * out a real address for the stack top */extern CHTYPE *locstak();/* Will allocate the item being used and return its * address (safe now). */#define fixstak() endstak(staktop)/* For use after `locstak' to hand back * new stack top and then allocate item */extern CHTYPE *endstak();/* Copy a string onto the stack and * allocate the space. */extern CHTYPE *cpystak();/* Allocate given ammount of stack space */extern CHTYPE *getstak();/* A chain of ptrs of stack blocks that * have become covered by heap allocation. * `tdystak' will return them to the heap. */extern struct blk *stakbsy;/* Base of the entire stack */extern CHTYPE *stakbas;/* Top of entire stack */extern CHTYPE *brkend;/* Base of current item */extern CHTYPE *stakbot;/* Top of current item */extern CHTYPE *staktop;/* Used with tdystak */extern CHTYPE *savstak();
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?