stack_proto.h 2.76 KB
/**
 * \file scot/stack_proto.h
 * \author  Georg Steffers <georg@steffers.org>
 * \brief   This generates all prototypes needed for stacks based on
 *          typesafe lists.
 *
 * This combines the macro definitions in \link scot/stack_type_proto.h 
 * scot/stack_type_proto.h \endlink and \link scot/stack_func_proto.h 
 * scot/stack_func_proto.h \endlink.
 * Additionally defines for all errornumbers that stack will create can be
 * found here.
 * GEN_STACK_PROTO is normally called in a header file that describes a 
 * new Datatype and also wants lists of it.
 * By doing this the complete interface to lists of that datatype is
 * produced.
 *
 * Copyright (C)2006    Georg Steffers <georg@steffers.org>
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
#ifndef  STACK_PROTO_H
#define  STACK_PROTO_H

#include <scot/stack_type_proto.h>
#include <scot/stack_func_proto.h>

/** 
 * \brief errnum if stack is empty 
 * \attention This is actually not use and will probably never be used
 * in this form.
 */
#define  STACK_EMPTY         0


/**
 * \param   type     the datatype that this list code should handle.
 * \pre              Type must be a single word typename. If one wants
 *                   to use e.g. lists of structs one has to use typedef
 *                   to create a single word type name like this:
 *                   typedef struct mystruct_t mystruct_t;
 *                   GEN_LIST_PROTO(type) should have been called previous
 *                   to this call.
 * \return           Nothing
 * \post             The typedefs, struct declaration and function prototypes
 *                   for functions to stacks based on lists for the given 
 *                   datatype are generated within the calling build file.
 *
 * \brief this creates all typdefs, declarations and prototypes needed for a
 *        stack based on typesafe list of a given \a type. 
 *        This is normally calles within a header file.
 */
#define  GEN_STACK_PROTO(type)                                       \
   GEN_STACK_TYPE_PROTO (type)                                       \
   GEN_STACK_FUNC_PROTO (type)

#endif   /* STACK_PROTO_H */