queue_type_proto.h 2.66 KB
/**
 * \file scot/queue_type_proto.h
 * \author  Georg Steffers <georg@steffers.org>
 * \brief   Macro that creates the datatype for handling queues based on
 *          linked lists.
 *
 * The macros here create all datatype prototypes and typedefs declarations to 
 * the implementations created by the macros in 
 * \link scot/queue_impl.h scot/queue_impl.h\endlink.
 * These macros are normally not called directly within your code but
 * through \link scot/queue_proto.h::GEN_QUEUE_PROTO GEN_QUEUE_PROTO\endlink. 
 * This is because normally one did not only
 * want the datatypes but also the interface declaration to them.
 * 
 * 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  QUEUE_TYPE_PROTO_H
#define  QUEUE_TYPE_PROTO_H

/**
 * \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_TYPE_PROTO(type) should have been called
 *                   previous to this.
 * \return           Nothing
 * \post             The datatype prototypes for queues based on lists 
 *                   of the given datatype are created.
 *
 * \brief Datatype prototypes to queues.
 *
 * This creates the prototypes of the datatypes needed to use the
 * queue interface.
 *
 * Normally this is not called directly, but by 
 * \link scot/queue_proto.h::GEN_QUEUE_PROTO GEN_QUEUE_PROTO()\endlink 
 * because it is also neccesary to create the interface to this 
 * datatypes for working queues.
 */
#define  GEN_QUEUE_TYPE_PROTO(type)                                  \
   struct queue_ ## type ## _node_t;                                 \
   typedef struct queue_ ## type ## _node_t                          \
      queue_ ## type ## _node_t;

#endif   /* QUEUE_TYPE_PROTO_H */