This is dlststack.h in view mode; [Download] [Up]
/* dstring v1.0.0 Dynamic string library * Copyright (c) 1994 Bill Bereza * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * * To reach the author * * email: * berezaw@river.it.gvsu.edu ac368@leo.nmc.edu * * $Log: dlststack.h,v $ * Revision 1.2 94/12/18 01:30:15 berezaw * fixed a sizeof in a malloc call * * Revision 1.1 94/12/17 21:54:56 berezaw * Initial revision * * * $Header: /Users/berezaw/src/dlist/RCS/dlststack.h,v 1.2 94/12/18 01:30:15 berezaw Exp $ */ #ifndef _DLSTSTACK_H #define _DLSTSTACK_H #include "dlist.h" #define DLSTSTACK DLIST #define initdstack(s) initdlist((s)) /* dinitstack initializes a stack * * returns a pointer to the stack */ #define dstackbytes(dstring) dlistbytes((dstring)) #define dstacksize(s) dlistels((s)) #define dstackelsize(s) delsize((s)) /* returns the size of the stack as a size_t type */ #define freedstack(dstring) freedlist((dstring)) /* frees all space used by the stack structure */ extern void *dpushel(DLSTSTACK *oldstack, void *addel); /* dpushchar puts the character on the front of the dstring * * dstring must be previously initialized, char is a character * * returns 0 on failure, else returns the character added */ extern void *dpushelv(DLSTSTACK *oldstack, void *addel, size_t els); /* dpushchar puts the character on the front of the dstring * * dstring must be previously initialized, char is a character * * returns 0 on failure, else returns the character added */ extern void *dpopel(DLSTSTACK *oldstack); /* dpopchar removes a character from the head of the dstring * * dstring must be initialized previously * * returns 0 on failure else returns character popped */ extern void *dpopelv(DLSTSTACK *oldstack, size_t *bs); /* dpopchar removes a character from the head of the dstring * * dstring must be initialized previously * * returns 0 on failure else returns character popped */ #define dtopel(s) (((struct _del *)(s)->_first)->_element) /* extern void *dtopel(DLSTSTACK *oldstack); */ /* dtopchar returns the character on top of the stack * * DSTRSTACK must be previously initialize * * returns 0 if the stack is empty, else returns the character */ #define dbotel(s) (((struct _del *)(s)->_last)->_element) /* extern void *dbotel(DLSTSTACK *oldstack); */ /* dbotchar returns the character on the bottom of the stack * * DSTRSTACK must be previously initialize * * returns 0 if the stack is empty, else returns the character */ #endif /* DSTRSTACK_H */
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.