Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
x_list.h
Go to the documentation of this file.
00001 /*
00002 
00003   Copyright (C) 2000, 2001 Silicon Graphics, Inc.  All Rights Reserved.
00004 
00005   This program is free software; you can redistribute it and/or modify it
00006   under the terms of version 2 of the GNU General Public License as
00007   published by the Free Software Foundation.
00008 
00009   This program is distributed in the hope that it would be useful, but
00010   WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
00012 
00013   Further, this software is distributed without any warranty that it is
00014   free of the rightful claim of any third person regarding infringement 
00015   or the like.  Any license provided herein, whether implied or 
00016   otherwise, applies only to this software file.  Patent licenses, if 
00017   any, provided herein do not apply to combinations of this program with 
00018   other software, or any other product whatsoever.  
00019 
00020   You should have received a copy of the GNU General Public License along
00021   with this program; if not, write the Free Software Foundation, Inc., 59
00022   Temple Place - Suite 330, Boston MA 02111-1307, USA.
00023 
00024   Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pky,
00025   Mountain View, CA 94043, or:
00026 
00027   http://www.sgi.com
00028 
00029   For further information regarding this notice, see:
00030 
00031   http://oss.sgi.com/projects/GenInfo/NoticeExplan
00032 
00033 */
00034 
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039 
00040 
00041 /* =======================================================================
00042  * =======================================================================
00043  *
00044  *
00045  *  Revision comments:
00046  *
00047  *  -2-Mar-1992 - Initial version
00048  *
00049  *  Description:
00050  *  ============
00051  *
00052  *      Template for generating externally linked list modules.  I've tried
00053  *      to use Common Lisp like names for the various functions so I didn't
00054  *      have to invent any names.  The list of supported functions is very
00055  *      incomplete currently, but it can grow as required.  (It will have
00056  *      to grow a good bit to take on the BB lists.)
00057  *  
00058  *  Instructions for use:
00059  *
00060  *      This file is only a template.  See MTP_ROOT/bin/gen_x_list for
00061  *      instructions on how to create instantiations based on specific
00062  *      types.
00063  *  
00064  *  Prefixes:     X_LIST  -- for type specific lists of Xs
00065  *      
00066  *  Interface Description:
00067  *
00068  *      Exported types:
00069  *
00070  *          typedef struct x_list X_LIST
00071  *
00072  *              The "con" cell of an X_LIST.
00073  *
00074  *              A structure with the following fields:
00075  *
00076  *                  XT  first
00077  *
00078  *                      First XT in the list.
00079  *
00080  *                  X_LIST *rest
00081  *
00082  *                      Rest of the list.
00083  *
00084  *      Exported functions:
00085  *
00086  *          X_LIST *X_LIST_Push(
00087  *              XT        first,
00088  *              X_LIST   *rest,
00089  *              MEM_POOL *pool
00090  *              
00091  *          )
00092  *
00093  *              Return a list consisting of 'first' . 'rest'.  Memory
00094  *              allocated in the given 'pool'.
00095  *
00096  *          X_LIST *X_LIST_Delete(
00097  *              XT      x,
00098  *              X_LIST  *list
00099  *          )
00100  *
00101  *              Destructively remove element <x> from the list. The result
00102  *              of this function must be used, since the argument 'list'
00103  *              is no longer valid after this function is called.
00104  *
00105  *
00106  * =======================================================================
00107  * =======================================================================
00108  */
00109 
00110 typedef struct _X_LIST_TAG_ _X_LIST_TYPE_;
00111 
00112 typedef _X_BASE_TYPE_ _X_LIST_LOCAL_BASE_TYPE_;
00113 
00114 struct _X_LIST_TAG_ {
00115   _X_LIST_LOCAL_BASE_TYPE_      first;
00116   _X_LIST_TYPE_                *rest;
00117 };
00118 
00119 extern _X_LIST_TYPE_ *
00120 _X_PUSH_(
00121   _X_LIST_LOCAL_BASE_TYPE_  x,
00122   _X_LIST_TYPE_            *xl,
00123   MEM_POOL                 *pool
00124 );
00125 
00126 extern _X_LIST_TYPE_ *
00127 _X_DELETE_(
00128   _X_LIST_LOCAL_BASE_TYPE_ x,
00129   _X_LIST_TYPE_           *xl
00130 );
00131 
00132 #ifdef __cplusplus
00133 }
00134 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines