Graphviz 2.29.20120208.0545
lib/circogen/stack.h
Go to the documentation of this file.
00001 /* $Id$ $Revision$ */
00002 /* vim:set shiftwidth=4 ts=8: */
00003 
00004 /*************************************************************************
00005  * Copyright (c) 2011 AT&T Intellectual Property 
00006  * All rights reserved. This program and the accompanying materials
00007  * are made available under the terms of the Eclipse Public License v1.0
00008  * which accompanies this distribution, and is available at
00009  * http://www.eclipse.org/legal/epl-v10.html
00010  *
00011  * Contributors: See CVS logs. Details at http://www.graphviz.org/
00012  *************************************************************************/
00013 
00014 #ifdef __cplusplus
00015 extern "C" {
00016 #endif
00017 
00018 #ifndef STACK_H
00019 #define STACK_H
00020 
00021 #include  <render.h>
00022 
00023     typedef struct {
00024         Agnode_t *top;
00025         int sz;
00026     } nstack_t;
00027 
00028     extern nstack_t *mkStack(void);
00029     extern void stackPush(nstack_t * s, Agnode_t * n);
00030     extern Agnode_t *stackPop(nstack_t * s);
00031     extern int stackSize(nstack_t * s);
00032     extern int stackCheck(nstack_t * s, Agnode_t * n);
00033     extern void freeStack(nstack_t * s);
00034 
00035 #define top(sp)  ((sp)->top)
00036 
00037 #ifdef DEBUG
00038     extern void printStack(nstack_t *);
00039 #endif
00040 
00041 #endif
00042 
00043 #ifdef __cplusplus
00044 }
00045 #endif