Jabber WindowGram Client (JWGC)

Introduction Screenshots Installation Downloads
Documentation Browse Source Resources Project Site

Stable Version
-none-

Latest Version
beta5



Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

stack.h

Go to the documentation of this file.
00001 /****************************************************************************/
00002 /*                                                                          */
00003 /*               A generic stack type based on linked lists:                */
00004 /*                                                                          */
00005 /****************************************************************************/
00006 
00007 #ifndef TYPE_T_stack_TYPE
00008 #define TYPE_T_stack_TYPE
00009 
00010 /*
00011  *      Copyright (c) 1989 by the Massachusetts Institute of Technology.
00012  *      For copying and distribution information, see the file
00013  *      "mit-copyright.h".
00014  *
00015  *      Modified for jwgc by Daniel Henninger.
00016  */
00017 
00018 #include "mit-copyright.h"
00019 
00020 #ifndef  NULL
00021 #define  NULL 0
00022 #endif
00023 
00024 typedef struct _TYPE_T_stack {
00025     struct _TYPE_T_stack *next;
00026     TYPE_T data;
00027 } *TYPE_T_stack;
00028 
00029 #define  TYPE_T_stack_create()           ((struct _TYPE_T_stack *) NULL)
00030 
00031 #define  TYPE_T_stack_empty(stack)       (!(stack))
00032 
00033 #define  TYPE_T_stack_top(stack)         ((stack)->data)
00034 
00035 #define  TYPE_T_stack_pop(stack)  { TYPE_T_stack old = (stack);\
00036                                     (stack) = old->next;\
00037                                     free(old); }
00038 
00039 #define  TYPE_T_stack_push(stack,object) \
00040            { TYPE_T_stack new = (struct _TYPE_T_stack *)\
00041                malloc(sizeof (struct _TYPE_T_stack));\
00042              new->next = (stack);\
00043              new->data = object;\
00044              (stack) = new; }
00045 
00046 #endif


Last updated at Tue Dec 18 21:07:42 PST 2007. This site and project hosted by...SourceForge.net Logo
Source Perspective by Fisheye