00001 /*************************************************************************** 00002 *cr 00003 *cr (C) Copyright 1995-2019 The Board of Trustees of the 00004 *cr University of Illinois 00005 *cr All Rights Reserved 00006 *cr 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * RCS INFORMATION: 00011 * 00012 * $RCSfile: ptrstack.h,v $ 00013 * $Author: johns $ $Locker: $ $State: Exp $ 00014 * $Revision: 1.3 $ $Date: 2019/01/17 21:21:03 $ 00015 * 00016 *************************************************************************** 00017 * DESCRIPTION: 00018 * Trivial stack implementation for use in eliminating recursion 00019 * in molecule graph traversal algorithms. 00020 * 00021 ***************************************************************************/ 00022 00023 #ifdef __cplusplus 00024 extern "C" { 00025 #endif 00026 00027 typedef void * PtrStackHandle; 00028 00029 PtrStackHandle ptrstack_create(int size); 00030 void ptrstack_destroy(PtrStackHandle voidhandle); 00031 int ptrstack_compact(PtrStackHandle voidhandle); 00032 int ptrstack_push(PtrStackHandle voidhandle, void *p); 00033 int ptrstack_pop(PtrStackHandle voidhandle, void **p); 00034 int ptrstack_popall(PtrStackHandle voidhandle); 00035 int ptrstack_empty(PtrStackHandle voidhandle); 00036 00037 #ifdef __cplusplus 00038 } 00039 #endif 00040