include/enf.h

Go to the documentation of this file.
00001 /**********************************************************************
00002  * Copyright 2002 Jeff Rush <jrush@taupro.com>
00003  * Original Copyright 1979-2002 Udanax.com
00004  *
00005  * This file is part of the Udanax xanalogical storage system.
00006  *
00007  * Udanax is free software; you can redistribute it and/or modify it
00008  * under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * Udanax is distributed in the hope that it will be useful, but
00013  * WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with Udanax; if not, write to the Free Software Foundation,
00019  * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  **********************************************************************/
00021 
00030 /* Modification History:
00031  * $Log: enf.h,v $
00032  * Revision 1.11  2002/05/28 03:51:13  jrush
00033  * Updated sources to comply with a GPL licensing.
00034  *
00035  * Revision 1.10  2002/05/28 02:45:08  jrush
00036  * Convert #define constants into enumerations and macro into inline function.
00037  *
00038  * Revision 1.9  2002/04/13 14:08:35  jrush
00039  * Changed typedef of structs into just structs, for C++ style.
00040  *
00041  * Revision 1.8  2002/04/12 11:46:25  jrush
00042  * Major rearrangement of include contents, to reflect a hopefully more
00043  * logical layout as we refactor Udanax into classes.
00044  *
00045  * Revision 1.7  2002/04/06 15:00:34  jrush
00046  * Changed INT to just 'int'.
00047  *
00048  * Revision 1.6  2002/04/02 19:01:30  jrush
00049  * Reduced bushiness of enfilades for better graph output.
00050  *
00051  * Revision 1.5  2002/02/14 05:40:42  jrush
00052  * Cleaned up source:
00053  *
00054  * 1. ran thru the indent tool to achieve a standard look,
00055  * 2. added structured comments at top for use with DOxygen reporting
00056  *    as well as CVS keywords,
00057  * 3. added #ifndef/#defines to prevent duplicate inclusions,
00058  * 4. insured all struct/union defs have names,
00059  * 5. centralized prototypes in protos.h, removing incomplete ones,
00060  * 6. cleaned up use of bool/BOOLEAN type to suit C++ type,
00061  * 7. fixed initializer nesting in tumbler constants.
00062  *
00063  */
00064 
00065 #ifndef __UDANAX_ENF_H__
00066 #define __UDANAX_ENF_H__
00067 
00068 /* typecorecrumhedr */
00069 struct typecorecrumhedr {
00070     bool                        isapex BIT;    /* TRUE if this is the fullcrum */
00071     unsigned char               height;        /* 0 => this is bottom crum */
00072     unsigned char               cenftype;      /* GRAN, SPAN, or POOM */
00073     bool                        modified BIT;
00074     bool                        isleftmost BIT;        /* whether I'm leftmost sibling */
00075     typecorecrumhedr           *nextcrum;
00076     typecorecrumhedr           *prevcrum; /* doubly linked circular list of all corecrums for grim reaping */
00077     unsigned char               age;       /* for deciding to grimly reap */
00078     typecorecrumhedr           *leftbroorfather;  /* if it is NULL then this is fullcrum father if leftmost, else leftbro */
00079     typecorecrumhedr           *rightbro; /* if none, this == NULL */
00080     typewid                     cwid;
00081     typedsp                     cdsp;
00082 };
00083 typedef typecorecrumhedr        typecorecrum;
00084 
00085 struct typecuc { // core upper crum
00086     /* typecorecrumhedr         xcorecrumhedr; */
00087     bool                        isapex BIT;    /* TRUE if this is the fullcrum */
00088     unsigned char               height;        /* 0 => this is bottom crum */
00089     unsigned char               cenftype;      /* GRAN, SPAN, or POOM */
00090     bool                        modified BIT;
00091     bool                        isleftmost BIT;        /* whether I'm leftmost sibling */
00092     typecorecrum               *nextcrum;
00093     typecorecrum               *prevcrum; /* doubly linked circular list of all corecrums for grim reaping */
00094     unsigned char               age;       /* for deciding to grimly reap */
00095     typecorecrum               *leftbroorfather; /* if it is NULL then this is fullcrum father if leftmost, else leftbro */
00096     typecorecrum               *rightbro; /* if none, this == NULL */
00097     typewid                     cwid;
00098     typedsp                     cdsp;
00099                                 /* bottom of hedr */
00100     typediskloafptr             sonorigin; /* if son didn't come from disk, this should be DISKPTRNULL */
00101     typecorecrum               *leftson; /* if no sons in core this == NULL */
00102     int                         numberofsons;
00103 };
00104 
00105 class typecbc { // core bottom crum
00106 public:
00107     /* typecorecrumhedr         xcorecrumhedr; */
00108     bool                        isapex BIT;    /* TRUE if this is the fullcrum */
00109     unsigned char               height;        /* 0 => this is bottom crum */
00110     unsigned char               cenftype;      /* GRAN, SPAN, or POOM */
00111     bool                        modified BIT;
00112     bool                        isleftmost BIT;        /* whether I'm leftmost sibling */
00113     typecorecrum               *nextcrum;
00114     typecorecrum               *prevcrum; /* doubly linked circular list of all corecrums for grim reaping */
00115     unsigned char               age;       /* for deciding to grimly reap */
00116     typecorecrum               *leftbroorfather; /* if it is NULL then this is fullcrum father if leftmost, else leftbro */
00117     typecorecrum               *rightbro; /* if none, this == NULL */
00118     typewid                     cwid;
00119     typedsp                     cdsp; /* bottom of hedr */
00120     typegranbottomcruminfo      cinfo;
00121 };
00122 
00123 struct type2dcbc { // 2d core bottom crum
00124     /* typecorecrumhedr         xcorecrumhedr; */
00125     bool                        isapex BIT;    /* TRUE if this is the fullcrum */
00126     unsigned char               height;        /* 0 => this is bottom crum */
00127     unsigned char               cenftype;      /* GRAN, SPAN, or POOM */
00128     bool                        modified BIT;
00129     bool                        isleftmost BIT;        /* whether I'm leftmost sibling */
00130     typecorecrum               *nextcrum;
00131     typecorecrum               *prevcrum; /* doubly linked circular list of all corecrums for grim reaping */
00132     unsigned char               age;       /* for deciding to grimly reap */
00133     typecorecrum               *leftbroorfather; /* if it is NULL then this is fullcrum father if leftmost, else leftbro */
00134     typecorecrum               *rightbro; /* if none, this == NULL */
00135     typewid                     cwid;
00136     typedsp                     cdsp;
00137                                 /* bottom of hedr */
00138     type2dbottomcruminfo        c2dinfo;
00139 };
00140 
00141 /* relatives used as parameters to adopt */
00142 
00143 enum AdoptPlacement {
00144     LEFTMOSTSON=0,
00145     RIGHTMOSTSON=1,
00146     SON=LEFTMOSTSON,
00147     LEFTBRO=2,
00148     RIGHTBRO=3,
00149 };
00150 
00151 //#define isfullcrum(x) ((bool)((typecorecrum *)(x))->isapex)
00152 inline bool
00153 isfullcrum(typecorecrum *x)
00154 {
00155     return (bool) x->isapex;
00156 }
00157 
00158 #endif /* !__UDANAX_ENF_H__*/

Generated on Sun Aug 21 04:18:13 2005 for Udanax-Green by doxygen1.3.4