include/protos.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: protos.h,v $
00032  * Revision 1.20  2004/09/11 12:18:45  jrush
00033  * Changed return type in inline from int to the, correct, void.
00034  *
00035  * Revision 1.19  2004/08/28 13:35:26  jrush
00036  * Catching up CVS to various incomplete versions on local disk.
00037  *
00038  * Revision 1.18  2002/07/14 08:28:05  jrush
00039  * Removed definition of qerror proto and gerror macro.
00040  *
00041  * Revision 1.17  2002/05/28 03:51:13  jrush
00042  * Updated sources to comply with a GPL licensing.
00043  *
00044  * Revision 1.16  2002/05/28 02:45:48  jrush
00045  * Commented out functions made static, used within a single source file.
00046  * Added some macro functions moved from coredisk.h and crum.h
00047  *
00048  * Revision 1.15  2002/04/16 22:46:14  jrush
00049  * Rollback bad attempt to eliminate typebottomcrum union; try again later.
00050  *
00051  * Revision 1.14  2002/04/16 22:39:50  jrush
00052  * Converted many #defines into enumeration types instead, and adjusted
00053  * function prototypes accordingly.
00054  *
00055  * Revision 1.13  2002/04/13 14:07:46  jrush
00056  * Removed no longer necessary duplicate typedefs at top of file.
00057  *
00058  * Revision 1.12  2002/04/12 22:53:20  jrush
00059  * Changed from using my setmem() to the clib's memset() and removed no
00060  * longer-needed usefull.cxx
00061  *
00062  * Revision 1.11  2002/04/12 11:46:25  jrush
00063  * Major rearrangement of include contents, to reflect a hopefully more
00064  * logical layout as we refactor Udanax into classes.
00065  *
00066  * Revision 1.10  2002/04/10 18:01:54  jrush
00067  * Renamed class typeisa to IStreamAddr.
00068  *
00069  * Revision 1.9  2002/04/09 21:45:46  jrush
00070  * Renamed class 'tumbler' to 'Tumbler', for consistency with Python sources,
00071  * and changed typeisa from typedef to a subclass, in preparation for cleaning
00072  * up the type/class tree.
00073  *
00074  * Revision 1.8  2002/04/08 18:55:56  jrush
00075  * Switched from using global variable 'user' to object 'Session' as a
00076  * connection for tracking open document descriptors in the bert table.
00077  *
00078  * Revision 1.7  2002/04/07 14:04:37  jrush
00079  * Add ptr to Session to checkforopen() and isthisusersdocument() so that we
00080  * have session information available to make the decision.
00081  *
00082  * Revision 1.6  2002/04/06 17:05:57  jrush
00083  * Switched from referring to 'task' for a client connection to 'session',
00084  * and converted the typetask typedef/struct into a Session C++ class.
00085  *
00086  * Revision 1.5  2002/04/06 15:22:53  jrush
00087  * Broke out tumbler struct/typedef as a C++ class.
00088  *
00089  * Revision 1.4  2002/04/06 15:00:34  jrush
00090  * Changed INT to just 'int'.
00091  *
00092  * Revision 1.3  2002/04/06 13:31:04  jrush
00093  * Removed entries for some functions that turned out to be static/private.
00094  *
00095  * Revision 1.2  2002/04/02 19:01:45  jrush
00096  * Removed private hashoftumbler().
00097  *
00098  * Revision 1.1  2002/02/14 05:14:17  jrush
00099  * Temporarily added a new file just to hold function prototypes, so the build
00100  * will pass lint and other warnings.  Eventually the prototypes will be relocated
00101  * to better places, probably C++ methods and such.
00102  *
00103  */
00104 
00105 #ifndef __UDANAX_PROTOS_H__
00106 #define __UDANAX_PROTOS_H__
00107 
00108 #include <memory.h>
00109 #include "types.h"
00110 
00111 /* alloc.cxx */
00112 
00113 void  lookatalloc();
00114 //STATIC int   statusofalloc(char *c);
00115 //STATIC int   validallocthinge(char *ptr);
00116 int   checkalloc(char *c);
00117 //STATIC void  checkallocedptr(char *ptr, char *string);
00118 int  *falloc(unsigned nbytes);
00119 void  ffree(char *ap);
00120 
00121 /* allocdebug.cxx */
00122 
00123 void  lookatalloc2(HEADER * abaseallocated);
00124 
00125 /* bert.cxx */
00126 
00127 class Session; // Forward Declaration
00128 struct typecuc; // Forward Declaration
00129 
00130 int   checkforopen(Session *sess, Tumbler *tp, int type);
00131 void  logbertmodifiedforcrum(Session *sess, typecuc *crumptr);
00132 void  logbertmodified(Session *sess, Tumbler *tp);
00133 //STATIC void  incrementopen(Session *sess, Tumbler *tp);
00134 //STATIC void  addtoopen(Session *sess, Tumbler *tp, int created, int type);
00135 //STATIC void  deleteversion(Tumbler *tp);
00136 //STATIC bool  removefromopen(Session *sess, Tumbler *tp);
00137 //STATIC void  exitbert(Session *sess);
00138 bool  doopen(Session *sess, IStreamAddr *tp, IStreamAddr *newtp, int type, int mode);
00139 bool  doclose(Session *sess, IStreamAddr *tp);
00140 void  closeberts(Session *sess);
00141 
00142 /* context.cxx */
00143 
00144 class Context; // Forward Declaration
00145 class CrumContext; // Forward Declaration
00146 
00147 //STATIC Context *createcontext(unsigned char type);
00148 void  contextfree(Context *context);
00149 CrumContext *createcrumcontext(typecorecrum *crumptr, typedsp *offsetptr);
00150 void  crumcontextfree(CrumContext *context);
00151 void  incontextlistnd(Context **clistptr, Context *c, int index);
00152 void  oncontextlistseq(Context **clistptr, Context *c);
00153 //STATIC int   whereoncontext(Context *ptr, Tumbler *address, int index);
00154 Context *makecontextfromcbc(typecbc *crumptr, typewid *offsetptr);
00155 void  context2span(Context *context, typespan *restrictionspanptr, int idx1, typespan *foundspanptr, int idx2);
00156 //STATIC void  prologuecontextnd(Context *ptr, typedsp *grasp, typedsp *reach);
00157 //STATIC typeitemid index2itemid(int index, Context *context);
00158 bool  context2vstuff(Session *sess, Context *context, typeispan *ispanptr, typevstuffset *vstuffsetptr);
00159 //STATIC void  context2vtext(Context *context, typeispan *ispanptr, typevstuffset vstuffset);
00160 
00161 /* corediskin.cxx */
00162 
00163 void  initkluge(typecuc ** granfptr, typecuc ** spanfptr);
00164 //STATIC typediskloaf *lookinsideloaffor(int insidenumber, typediskloaf * uloafptr);
00165 void  inloaf(typecuc * father);
00166 void  inorgl(typecbc * granorglptr);
00167 void  inorglinternal(typecbc * granorglptr, typeuberrawdiskloaf * crumptr);
00168 //STATIC void  hgetinfo(typecbc * ptr, char **loafptrptr);
00169 
00170 /* corediskout.cxx */
00171 
00172 void  diskexit();
00173 void  diskflush();
00174 void  writeenfilades();
00175 //STATIC void  hputinfo(typecbc * ptr, char **loafptrptr);
00176 void  orglwrite(typecbc * orglcbcptr);
00177 //STATIC void  deletefullcrumandgarbageddescendents(typediskloafptr diskptr, bool deletefullcrumflag, typediskloaf * loafp, typediskloafptr newdiskptr);
00178 //STATIC void  deletewithgarbageddescendents(typediskloafptr diskptr, typecuc * father, bool deletefullcrumflag);
00179 void  subtreewrite(typecuc * father);
00180 //STATIC void  checkmodifiednotthere(typecuc * father, char *string);
00181 
00182 /* correspond.cxx */
00183 
00184 void  restrictspecsetsaccordingtoispans(Session *sess, typeispanset ispanset, typespecset * specset1, typespecset * specset2);
00185 //STATIC void  restrictvspecsetovercommonispans(Session *sess, typeispanset ispanset, typespecset specset, typespecset * newspecsetptr);
00186 //STATIC void  removespansnotinoriginal(Session *sess, typespecset original, typespecset * newptr);
00187 bool  intersectspansets(Session *sess, typespanset set1, typespanset set2, typespanset *set3, typeitemid spantype);
00188 //STATIC bool  comparespans(Session *sess, typespan *span1, typespan *span2, typespan **span3, typeitemid spantype);
00189 //STATIC bool  spanintersection(typespan * aptr, typespan * bptr, typespan * cptr);
00190 void  makespanpairset(Session *sess, typeispanset ispanset, typespecset specset1, typespecset specset2, typespanpairset * pairsetptr);
00191 //STATIC void  makespanpairsforispan(Session *sess, Tumbler * iwidth, typespecset * specset1ptr, typespecset * specset2ptr, typespanpairset * pairsetptr);
00192 //STATIC typespanpair *makespanpair(Session *sess, Tumbler * doc1, Tumbler * start1, Tumbler * doc2, Tumbler * start2, Tumbler * width);
00193 //STATIC int   spansubtract(typespan * aptr, typespan * bptr, typespan * cptr);
00194 
00195 /* credel.cxx */
00196 
00197 int  *eallocwithtag(unsigned nbytes, tagtype tag);
00198 //STATIC int  *ealloc(unsigned nbytes);
00199 void  efree(char *ptr);
00200 void  initgrimreaper();
00201 //STATIC void  grimlyreap();
00202 //STATIC bool  isreapable(int *fuckinap, typecorecrum * localreaper);
00203 //STATIC void  reap(typecorecrum * localreaper);
00204 int   testforrejuvinate(typecorecrum * ptr);
00205 void  funcrejuvinate(typecorecrum * ptr);
00206 void  reserve(typecorecrum * ptr);
00207 void  testforreservedness(char *msg);
00208 void  subtreefree(typecorecrum * ptr);
00209 void  freecrum(typecorecrum * ptr);
00210 void  loaffree(typecuc * father);
00211 void  orglfree(typecuc * ptr);
00212 typecuc *createenf(int enftype);
00213 typecorecrum *createcrum(int crumheight, int enftype);
00214 void  initcrum(int crumheight, int enftype, typecorecrum * ptr);
00215 //STATIC typecorecrum *createcruminternal(int crumheight, int enftype, typecorecrum * allocated);
00216 void  initqueues();
00217 //STATIC void  dumptable();
00218 //STATIC char *allocfromqueue(int n);
00219 //STATIC void  freetoqueue(char *ptr);
00220 //STATIC void  xgrabmorecore();
00221 
00222 /* disk.cxx */
00223 
00224 int   findnumberofdamnsons(typediskloafptr diskptr);
00225 int   changerefcount(typediskloafptr diskptr, int delta);
00226 //STATIC int   changeunterrefcount(typediskloaf * wholeloafp, char *originalloafp, int delta);
00227 void  readloaf(typediskloaf * loafptr, typediskloafptr diskptr);
00228 void  actuallyreadrawloaf(typeuberrawdiskloaf * loafptr, int blocknumber);
00229 void  writeloaf(typediskloaf * loafptr, typediskloafptr diskptr, int newloaf);
00230 void  actuallywriteloaf(typeuberrawdiskloaf * loafptr, int diskblocknumber);
00231 bool  initenffile(const char *filename);
00232 void  closediskfile();
00233 //STATIC void  dieandclosefiles();
00234 //STATIC void  warning(char *message);
00235 
00236 /* diskalloc.cxx */
00237 
00238 //static int   isalloced(int n);
00239 typediskloafptr diskalloc();
00240 void  diskfree(typediskloafptrdigit loafptr);
00241 void  diskset(typediskloafptrdigit loafptr);
00242 bool  readallocinfo(int fd);
00243 void  initheader();
00244 void  diskallocexit(int fd);
00245 void  writeallocinfo(int fd);
00246 bool  goodblock(typediskloafptrdigit diskptr);
00247 
00248 /* do1.cxx */
00249 
00250 bool  dofinddocscontaining(Session *sess, typespecset specset, typelinkset * addresssetptr);
00251 bool  doappend(Session *sess, IStreamAddr * docptr, typetextset textset);
00252 bool  dorearrange(Session *sess, IStreamAddr * docisaptr, typecutseq * cutseqptr);
00253 bool  docopy(Session *sess, IStreamAddr * docisaptr, Tumbler * vsaptr, typespecset specset);
00254 bool  docopyinternal(Session *sess, IStreamAddr * docisaptr, Tumbler * vsaptr, typespecset specset);
00255 bool  doinsert(Session *sess, IStreamAddr * docisaptr, Tumbler * vsaptr, typetextset textset);
00256 void  checkspecandstringbefore();
00257 bool  dodeletevspan(Session *sess, IStreamAddr * docisaptr, typevspan * vspanptr);
00258 bool  domakelink(Session *sess, IStreamAddr * docisaptr, typespecset fromspecset, typespecset tospecset, IStreamAddr * linkisaptr);
00259 bool  docreatelink(Session *sess, IStreamAddr * docisaptr, typespecset fromspecset, typespecset tospecset, typespecset threespecset, IStreamAddr * linkisaptr);
00260 bool  dofollowlink(Session *sess, IStreamAddr * linkisaptr, typespecset * specsetptr, int whichend);
00261 bool  docreatenewdocument(Session *sess, IStreamAddr * isaptr);
00262 bool  docreatenode_or_account(Session *sess, IStreamAddr * isaptr);
00263 bool  docreatenewversion(Session *sess, IStreamAddr *isaptr, IStreamAddr *wheretoputit, IStreamAddr *newisaptr);
00264 bool  doretrievedocvspan(Session *sess, IStreamAddr * docisaptr, typevspan * vspanptr);
00265 bool  doretrievedocvspanset(Session *sess, IStreamAddr * docisaptr, typevspanset * vspansetptr);
00266 bool  doretrievev(Session *sess, typespecset specset, typevstuffset * vstuffsetptr);
00267 bool  dofindlinksfromtothree(Session *sess, typespecset fromvspecset, typespecset tovspecset, typespecset threevspecset, typeispan * orglrangeptr, typelinkset * linksetptr);
00268 bool  dofindnumoflinksfromtothree(Session *sess, typespecset * fromvspecset, typespecset * tovspecset, typespecset * threevspecset, typeispan * orglrangeptr, int * numptr);
00269 bool  dofindnextnlinksfromtothree(Session *sess, typevspec * fromvspecptr, typevspec * tovspecptr, typevspec * threevspecptr, typeispan * orglrangeptr, IStreamAddr * lastlinkisaptr, typelinkset * nextlinksetptr, int * nptr);
00270 bool  doretrieveendsets(Session *sess, typespecset specset, typespecset * fromsetptr, typespecset * tosetptr, typespecset * threesetptr);
00271 bool  doshowrelationof2versions(Session *sess, typespecset version1, typespecset version2, typespanpairset * relation);
00272 
00273 /* do2.cxx */
00274 
00275 bool  specset2ispanset(Session *sess, typespec * specset, typeispanset * ispansetptr, int type);
00276 bool  tumbler2spanset(Session *sess, IStreamAddr * tumblerptr, typespanset * spansetptr);
00277 void  makehint(int typeabove, int typebelow, int typeofatom, IStreamAddr * isaptr, typehint * hintptr);
00278 void  validhint(typehint * hintptr);
00279 bool  acceptablevsa(Tumbler * vsaptr, typeorgl orglptr);
00280 bool  insertendsetsinspanf(Session *sess, typespanf spanfptr, IStreamAddr * linkisaptr, typesporglset fromsporglset, typesporglset tosporglset, typesporglset threesporglset);
00281 bool  insertendsetsinorgl(Session *sess, Tumbler * linkisaptr, typeorgl link, Tumbler * fromvsa, typesporglset fromsporglset, Tumbler * tovsa, typesporglset tosporglset, Tumbler * threevsa, typesporglset threesporglset);
00282 bool  findnextlinkvsa(Session *sess, IStreamAddr * docisaptr, Tumbler * vsaptr);
00283 bool  setlinkvsas(Tumbler * fromvsaptr, Tumbler * tovsaptr, Tumbler * threevsaptr);
00284 bool  ispansetandspecsets2spanpairset(Session *sess, typeispanset ispanset, typespecset specset1, typespecset specset2, typespanpairset * pairsetptr);
00285 
00286 /* edit.cxx */
00287 
00288 //STATIC void  deleteseq(typecuc * fullcrumptr, Tumbler * address, int index);
00289 void  deletend(typecuc * fullcrumptr, Tumbler * origin, Tumbler * width, int index);
00290 void  rearrangend(typecuc * fullcrumptr, typecutseq * cutseqptr, int index);
00291 //STATIC void  makeoffsetsfor3or4cuts(typeknives * knives, Tumbler diff[]);
00292 //STATIC int   rearrangecutsectionnd(typecorecrum * ptr, typewid * offset, typeknives * knives);
00293 int   insertcutsectionnd(typecorecrum * ptr, typewid * offset, typeknives * knives);
00294 //STATIC int   deletecutsectionnd(typecorecrum * ptr, typewid * offset, typeknives * knives);
00295 //STATIC void  sortknives(typeknives * knifeptr);
00296 
00297 /* entexit.cxx */
00298 
00299 void  initsession(const char *database);
00300 
00301 /* genf.cxx */
00302 
00303 bool  is2dcrum(typecorecrum * ptr);
00304 typecorecrum *getleftson(typecuc * ptr);
00305 typecorecrum *routinegetrightbro(typecorecrum * ptr);
00306 typecorecrum *getrightmostbro(typecorecrum * ptr);
00307 //STATIC typecorecrum *getleftbro(typecorecrum * ptr);
00308 //STATIC typecorecrum *getleftmostbro(typecorecrum * ptr);
00309 typecuc *getfather(typecorecrum * ptr);
00310 typecuc *findfullcrum(typecorecrum * descendant);
00311 bool  isemptyenfilade(typecuc * ptr);
00312 typecuc *functionweakfindfather(typecorecrum * ptr);
00313 typecuc *findfather(typecorecrum * son);
00314 typecorecrum *findleftbro(typecorecrum * ptr);
00315 typecorecrum *findleftmostbro(typecorecrum * ptr);
00316 typecorecrum *weakfindleftmostbro(typecorecrum * ptr);
00317 typecorecrum *funcfindrightbro(typecorecrum * ptr);
00318 typecorecrum *weakfindrightbro(typecorecrum * ptr);
00319 typecorecrum *weakfindrightbro(typecorecrum * ptr);
00320 typecorecrum *findrightmostbro(typecorecrum * leftbro);
00321 typecorecrum *findleftson(typecuc * ptr);
00322 typecorecrum *findrightmostson(typecuc * ptr);
00323 bool  toomanysons(typecuc * ptr);
00324 bool  toofewsons(typecuc * ptr);
00325 bool  roomformoresons(typecuc * ptr);
00326 void  levelpush(typecuc * fullcrumptr);
00327 //STATIC void  transferloaf(typecuc * from, typecuc * to);
00328 void  levelpull(typecuc * fullcrumptr);
00329 void  disown(typecorecrum * crumptr);
00330 void  disownnomodify(typecorecrum * crumptr);
00331 void  adopt(typecorecrum * newcrum, int relative, typecorecrum * old);
00332 void  ivemodified(typecorecrum * ptr);
00333 //OBSOLETE int   qerror(char *message);
00334 //STATIC int   nferror(char *message);
00335 
00336 /* granf1.cxx */
00337 
00338 bool  findorgl(Session * sess, typegranf granfptr, IStreamAddr * isaptr, typeorgl * orglptr, int type);
00339 bool  inserttextingranf(Session * sess, typegranf granfptr, typehint * hintptr, typetextset textset, typeispanset * ispansetptr);
00340 bool  createorglingranf(Session * sess, typegranf granfptr, typehint * hintptr, IStreamAddr * isaptr);
00341 bool  ispanset2vstuffset(Session * sess, typegranf granfptr, typeispanset ispanset, typevstuffset * vstuffsetptr);
00342 
00343 /* granf2.cxx */
00344 
00345 typeorgl fetchorglgr(Session * sess, typegranf fullcrumptr, IStreamAddr * address);
00346 bool  inserttextgr(Session * sess, typegranf fullcrumptr, typehint * hintptr, typetextset textset, typeispanset * ispansetptr);
00347 bool  createorglgr(Session * sess, typegranf fullcrumptr, typehint * hintptr, IStreamAddr * isaptr);
00348 //STATIC bool  findisatoinsertgr(typecuc * fullcrumptr, typehint * hintptr, IStreamAddr * isaptr);
00349 //STATIC bool  isaexistsgr(typecuc * crumptr, IStreamAddr * isaptr);
00350 //STATIC void  findpreviousisagr(typecorecrum * crumptr, IStreamAddr * upperbound, IStreamAddr * offset);
00351 //STATIC void  findlastisaincbcgr(typecbc * ptr, IStreamAddr * offset);
00352 typevstuffset *ispan2vstuffset(Session * sess, typegranf fullcrumptr, typeispan * ispanptr, typevstuffset * vstuffsetptr);
00353 
00354 /* init.cxx */
00355 
00356 void  init(bool safe);
00357 
00358 /* insert.cxx */
00359 
00360 void  insertseq(typecuc * fullcrumptr, Tumbler * address, typegranbottomcruminfo * info);
00361 //STATIC bool  fillupcbcseq(typecbc * ptr, Tumbler * crumboundary, typegranbottomcruminfo * info);
00362 
00363 /* insertnd.cxx */
00364 
00365 void  insertnd(Session * sess, typecuc * fullcrumptr, typewid * origin, typewid * width, type2dbottomcruminfo * infoptr, int index);
00366 //STATIC void  makegappm(Session * sess, typecuc * fullcrumptr, typewid * origin, typewid * width);
00367 //STATIC void  findaddressofsecondcutforinsert(Tumbler * position, Tumbler * secondcut);
00368 //STATIC int   doinsertnd(typecuc * father, typewid * origin, typewid * width, type2dbottomcruminfo * infoptr, int index);
00369 //STATIC void  firstinsertionnd(typecuc * father, typewid * origin, typewid * width, type2dbottomcruminfo * infoptr);
00370 //STATIC int   insertmorend(typecuc * father, typedsp * offset, typewid * origin, typewid * width, type2dbottomcruminfo * infoptr, int index);
00371 //STATIC int   insertcbcnd(typecuc * father, typedsp * grasp, typewid * origin, typewid * width, type2dbottomcruminfo * infoptr);
00372 //STATIC typecorecrum *findsontoinsertundernd(typecuc * father, typedsp * grasp, typewid * origin, typewid * width, int index);
00373 //STATIC bool  isanextensionnd(typecbc * ptr, typedsp * offsetptr, typedsp * originptr, type2dbottomcruminfo * infoptr);
00374 
00375 /* makeroom.cxx */
00376 
00377 void  makeroomonleftnd(typecuc * father, typedsp * offset, typewid * origin, typedsp * grasp);
00378 //STATIC void  expandcrumleftward(typecorecrum * crumptr, Tumbler * newdsp, Tumbler * base, int index);
00379 
00380 /* multiloaf.cxx */
00381 
00382 //STATIC void  dumpincoretables();
00383 //STATIC void  dumpfdhashtable();
00384 //STATIC void  dumpfdorderedtable();
00385 //STATIC void  dumpfreediskentry(freediskentry * ptr);
00386 void  initincorealloctables();
00387 void  savepartialdiskalloctabletodisk();
00388 void  readpartialdiskalloctablefromdisk();
00389 //STATIC void  addtofreediskstructures(freediskentry * diskentry);
00390 void  addallocatedloaftopartialallocedtables(typediskloafptr dp, int size);
00391 //STATIC void  changefreediskstructures(freediskentry * diskentry, int newsize);
00392 //STATIC int   fdhash(int diskblocknumber);
00393 //STATIC freediskentry *findfreeenoughloafinbucket(int size);
00394 typediskloafptr partialdiskalloc(int size, int * newloafp);
00395 //STATIC void  deletefromfreediskstructures(freediskentry * diskentry);
00396 void  newpartialdiskfree(typediskloafptr diskloaf);
00397 int   deallocateinloaf(typeuberdiskloaf * loafp, int insidediskblocknumber);
00398 //STATIC int   findandallocateinsidediskblocknumber(int diskblocknumber, int size, typeuberdiskloaf * loafp);
00399 int   numberofliveunterloafs(typeuberdiskloaf * loafp);
00400 char *findinsideloaf(typeuberdiskloaf * loafp, int ninsideloaf);
00401 
00402 /* ndcuts.cxx */
00403 
00404 void  makecutsnd(typecuc * fullcrumptr, typeknives * knives);
00405 //STATIC void  makecutsdownnd(typecuc * fullcrumptr, typewid * offset, typeknives * knives);
00406 //STATIC void  makecutsbackuptohere(typecuc * ptr, typewid * offset, typeknives * knives);
00407 //STATIC void  cutsons(typecuc * ptr, typewid * offset, typeknives * knives);
00408 //STATIC void  makeithcutonson(typecorecrum * ptr, typewid * offset, typecorecrum * son, typewid * grasp, typeknives * knives, int i);
00409 //STATIC void  peelsoncorrectly(typecorecrum * ptr, typewid * offset, typecorecrum * son, typewid * grasp, typeknives * knives, int i);
00410 //STATIC bool  crumleftofithcut(typecorecrum * ptr, typewid * offset, typeknives * knives, int i);
00411 //STATIC bool  peeloffcorrectson(typecorecrum * ptr, typeknives * knives);
00412 //STATIC void  newpeelcrumoffnd(typecorecrum * ptr, typecorecrum * newuncle);
00413 //STATIC bool  crumiscut(typecuc * ptr, typewid * offset, typeknives * knives);
00414 //STATIC bool  crumiscutbyithknife(typecuc * ptr, typewid * offset, typeknives * knives, int i);
00415 //STATIC bool  sonsarecut(typecuc * ptr, typewid * offset, typeknives * knives);
00416 //STATIC void  slicecbcpm(typecorecrum * ptr, typewid * offset, typecorecrum * newcrum, Tumbler * cut, int index);
00417 
00418 /* ndinters.cxx */
00419 
00420 void  newfindintersectionnd(typecuc * fullcrumptr, typeknives * knives, typecuc ** ptrptr, typewid * offset);
00421 bool  cutinthiscrumnd(typecorecrum * ptr, typewid * offset, typeknives * knives);
00422 bool  allcutswiththiscrumnd(typecorecrum * ptr, typewid * offset, typeknives * knives);
00423 
00424 /* orglinks.cxx */
00425 
00426 bool  appendpm(Session * sess, IStreamAddr * docisaptr, typetextset textset);
00427 bool  insertpm(Session * sess, Tumbler * orglisa, typeorgl orgl, Tumbler * vsaptr, typesporglset sporglset);
00428 bool  rearrangepm(Session * sess, Tumbler * docisaptr, typeorgl docorgl, typecutseq * cutseqptr);
00429 bool  deletevspanpm(Session * sess, Tumbler * docisaptr, typeorgl docorgl, typevspan * vspanptr);
00430 bool  retrievedocumentpartofvspanpm(Session * sess, typeorgl orgl, typevspan * vspanptr);
00431 bool  retrievevspanpm(Session * sess, typeorgl orgl, typevspan * vspanptr);
00432 bool  retrievevspansetpm(Session * sess, typeorgl orgl, typevspanset * vspansetptr);
00433 //STATIC bool  istextcrum(typecorecrum * crumptr);
00434 //STATIC bool  islinkcrum(typecorecrum * crumptr);
00435 bool  retrievevspansetpm(Session * sess, typeorgl orgl, typevspanset * vspansetptr);
00436 void  walkorglonvpm(Session * sess, typecorecrum * crumptr, Tumbler * voffset, typevspanset * vspansetptr);
00437 void  cleanupvspanlist(Session * sess, typevspanset * vspansetptr);
00438 //STATIC typevspan *makevspan(Session * sess, typevspan * spanptr, typevspan * nextspan);
00439 //STATIC void  putvspaninlist(Session * sess, typevspan * spanptr, typevspanset * spansetptr);
00440 typevspanset *ispan2vspanset(Session * sess, typeorgl orgl, typeispan * ispanptr, typevspanset * vspansetptr);
00441 typeispanset *vspanset2ispanset(Session * sess, typeorgl orgl, typevspanset vspanptr, typeispanset * ispansetptr);
00442 //STATIC typespanset *permute(Session * sess, typeorgl orgl, typespanset restrictionspanset, int restrictionindex, typespanset * targspansetptr, int targindex);
00443 //STATIC typespanset *span2spanset(Session * sess, typeorgl orgl, typespanset restrictionspanptr, int restrictionindex, typespanset * targspansetptr, int targindex);
00444 typeitem *onitemlist(Session * sess, typeitem * itemptr, typeitemset * itemsetptr);
00445 bool  isemptyorgl(typeorgl fullcrumptr);
00446 
00447 /* put.cxx */
00448 
00449 //void  prompt(Session * sess, char *string);
00450 //void  error(Session * sess, char *string);
00451 void  puttumbler(FILE * outfile, Tumbler * tumblerptr);
00452 //void  putnum(FILE * outfile, int num);
00453 //void  putisa(Session * sess, IStreamAddr * isaptr);
00454 void  putitemset(Session * sess, typeitemset itemset);
00455 //void  putitem(Session * sess, typeitem * itemptr);
00456 //void  putspan(Session * sess, typespan * spanptr);
00457 //void  puttext(Session * sess, typetext * textptr);
00458 //void  putspanpairset(Session * sess, typespanpairset spanpairset);
00459 //void  putspanpair(Session * sess, typespanpair * spanpair);
00460 //void  putcreatelink(Session * sess, IStreamAddr * istreamptr);
00461 //void  putfollowlink(Session * sess, typespecset specset);
00462 //void  putretrievedocvspanset(Session * sess, typespanset * spansetptr);
00463 //void  putretrievedocvspan(Session * sess, typespan * vspanptr);
00464 //void  putretrievev(Session * sess, typevstuffset * vstuffsetptr);
00465 //void  putfindlinksfromtothree(Session * sess, typelinkset linkset);
00466 //void  putfindnumoflinksfromtothree(Session * sess, int num);
00467 //void  putfindnextnlinksfromtothree(Session * sess, int n, typelinkset nextlinkset);
00468 //void  putshowrelationof2versions(Session * sess, typespanpairset relation);
00469 //void  putcreatenewdocument(Session * sess, IStreamAddr * newdocisaptr);
00470 //void  putcreatenewversion(Session * sess, IStreamAddr * newdocisaptr);
00471 //void  putfinddocscontaining(Session * sess, typeitemset addressset);
00472 //void  putretrieveendsets(Session * sess, typespecset fromset, typespecset toset, typespecset threeset);
00473 //void  putinsert(Session * sess);
00474 //void  putcopy(Session * sess);
00475 //void  putdeletevspan(Session * sess);
00476 //void  putrearrange(Session * sess);
00477 //void  putrequestfailed(Session * sess);
00478 
00479 /* putfe.cxx */
00480 
00481 //void  xuputc(char c, FILE * fd);
00482 //void  xuputstring(char *string, FILE * fd);
00483 //void  putnum(FILE * outfile, int num);
00484 //void  sendresultoutput(Session * sess);
00485 //void  error(Session * sess, char *string);
00486 //void  prompt(Session * sess, char *string);
00487 //void  putnumber(FILE * outfile, int num);
00488 //void  puttumbler(FILE * outfile, Tumbler * tumblerptr);
00489 //void  putisa(Session * sess, IStreamAddr * isaptr);
00490 //void  putitemset(Session * sess, typeitemset itemset);
00491 //void  putitem(Session * sess, typeitem * itemptr);
00492 //void  putspan(Session * sess, typespan * spanptr);
00493 //void  puttextset(Session * sess, typetext ** textptrptr);
00494 //void  puttext(Session * sess, typetext * textptr);
00495 //void  putspanpairset(Session * sess, typespanpairset spanpairset);
00496 //void  putspanpair(Session * sess, typespanpair * spanpair);
00497 //void  putinsert(Session * sess);
00498 //void  putretrievedocvspanset(Session * sess, typespanset * spansetptr);
00499 //void  putcopy(Session * sess);
00500 //void  putrearrange(Session * sess);
00501 //void  putcreatelink(Session * sess, IStreamAddr * istreamptr);
00502 //void  putretrievev(Session * sess, typevstuffset * vstuffsetptr);
00503 //void  putfindnumoflinksfromtothree(Session * sess, int num);
00504 //void  putfindlinksfromtothree(Session * sess, typelinkset linkset);
00505 //void  putfindnextnlinksfromtothree(Session * sess, int n, typelinkset nextlinkset);
00506 //void  putshowrelationof2versions(Session * sess, typespanpairset relation);
00507 //void  putcreatenewdocument(Session * sess, IStreamAddr * newdocisaptr);
00508 //void  putdeletevspan(Session * sess);
00509 //void  putcreatenewversion(Session * sess, IStreamAddr * newdocisaptr);
00510 //void  putretrievedocvspan(Session * sess, typespan * vspanptr);
00511 //void  putfollowlink(Session * sess, typespecset specset);
00512 //void  putfinddocscontaining(Session * sess, typeitemset addressset);
00513 //void  putretrieveendsets(Session * sess, typespecset fromset, typespecset toset, typespecset threeset);
00514 //void  putrequestfailed(Session * sess);
00515 //void  putxaccount(Session * sess);
00516 //void  putcreatenode_or_account(Session * sess, Tumbler * tp);
00517 //void  putopen(Session * sess, Tumbler * tp);
00518 //void  putclose(Session * sess);
00519 //void  putquitxanadu(Session * sess);
00520 
00521 /* queues.cxx */
00522 
00523 void  qinit(struct queue *qhead);
00524 void  qinsert(struct queue *qhead, struct queue *object);
00525 void  qpush(struct queue *qhead, struct queue *object);
00526 struct queue *qremove(struct queue *qhead);
00527 struct queue *qnext(struct queue *qthis, struct queue *qhead);
00528 struct queue *qdchain(struct queue *qitem);
00529 int   qlength(struct queue *qhead);
00530 bool  qvalid(struct queue * qhead);
00531 
00532 /* recombine.cxx */
00533 
00534 void  recombine(typecuc * father);
00535 //STATIC void  recombineseq(typecuc * father);
00536 //STAIIC void  takeovernephewsseq(typecorecrum * me);
00537 //STATIC void  eatbrossubtreeseq(typecuc * me);
00538 //STATIC void  recombinend(typecuc * father);
00539 //STATIC bool  randomness(float probability);
00540 bool  ishouldbother(typecuc * dest, typecuc * src);
00541 //STATIC bool  takeovernephewsnd(typecuc ** meptr, typecuc ** broptr);
00542 //STATIC void  eatbrossubtreend(typecuc * me, typecuc * bro);
00543 //STATIC void  takenephewnd(typecuc * me, typecuc * nephew);
00544 //STATIC void  fixdspsofbroschildren(typecuc * me, typecuc * bro);
00545 //STATIC void  getorderedsons(typecuc * father, typecorecrum * sons[]);
00546 //STATIC void  shellsort(typecorecrum * v[], int n);
00547 int   comparecrumsdiagonally(typecorecrum * a, typecorecrum * b);
00548 void  fixincoresubtreewids(typecuc * ptr);
00549 
00550 /* retrie.cxx */
00551 
00552 CrumContext *retrievecrums(typecuc * fullcrumptr, Tumbler * address, int index);
00553 Context *retrieve(typecuc * fullcrumptr, Tumbler * address, int index);
00554 Context *retrieverestricted(typecuc * fullcrumptr, typespan * span1ptr, int index1, typespan * span2ptr, int index2, IStreamAddr * docisaptr);
00555 //STATIC Context *retrieveinarea(typecuc * fullcrumptr, Tumbler * span1start, Tumbler * span1end, int index1, Tumbler * span2start, Tumbler * span2end, int index2, typebottomcruminfo * infoptr);
00556 Context *retrieveinspan(typecuc * fullcrumptr, Tumbler * spanstart, Tumbler * spanend, int index);
00557 //STATIC Context *findlastcbcseq(typecorecrum * fullcrumptr);
00558 //STATIC CrumContext *findcbcseqcrum(typecorecrum * ptr, typedsp * offsetptr, Tumbler * address);
00559 //STATIC Context *findcbcseq(typecorecrum * ptr, typedsp * offsetptr, Tumbler * address);
00560 //STATIC Context *findcbcnd(typecorecrum * father, typewid * offsetptr, Tumbler * address, int index);
00561 //STATIC void  findcbcinarea2d(typecorecrum * crumptr, typedsp * offsetptr, Tumbler * span1start, Tumbler * span1end, int index1, Tumbler * span2start, Tumbler * span2end, int index2, Context **headptr, typebottomcruminfo * infoptr);
00562 //STATIC bool  crumqualifies2d(typecorecrum * crumptr, typedsp * offset, Tumbler * span1start, Tumbler * span1end, int index1, Tumbler * span2start, Tumbler * span2end, int index2, type2dbottomcruminfo * infoptr);
00563 //STATIC void  findcbcinspanseq(typecorecrum * crumptr, typewid * offsetptr, Tumbler * spanstart, Tumbler * spanend, Context ** headptr) ;
00564 void  prologuend(typecorecrum * ptr, typedsp * offset, typedsp * grasp, typedsp * reach);
00565 int   whereoncrum(typecorecrum * ptr, typewid * offset, Tumbler * address, int index);
00566 //STATIC bool  crumintersectsspanseq(typecorecrum * crumptr, Tumbler * offsetptr, Tumbler * spanstart, Tumbler * spanend);
00567 
00568 /* spanf1.cxx */
00569 
00570 bool insertspanf(Session * sess, typespanf spanfptr, IStreamAddr * isaptr, typesporglset sporglset, int spantype);
00571 bool findlinksfromtothreesp(Session * sess, typespanf spanfptr, typespecset fromvspecset, typespecset tovspecset, typespecset threevspecset, typeispan * orglrange, typelinkset * linksetptr);
00572 bool findnumoflinksfromtothreesp(Session * sess, typespanf spanfptr, typespecset fromvspecset, typespecset tovspecset, typespecset threevspecset, typeispan * orglrange, int * numptr);
00573 bool findnextnlinksfromtothreesp(Session * sess, typespecset fromvspecset, typespecset tovspecset, typespecset threevspecset, typeispan * orglrangeptr, IStreamAddr * lastlinkisaptr, typelinkset * nextlinksetptr, int * nptr);
00574 bool finddocscontainingsp(Session * sess, typespanset ispanset, typelinkset * addresssetptr);
00575 bool retrieveendsetsfromspanf(Session * sess, typespecset specset, typespecset * fromsetptr, typespecset * tosetptr, typespecset * threesetptr);
00576 //STATIC bool retrievesporglsetinrange(Session * sess, typesporglset sporglptr, typespan * whichspace, typesporglset * sporglsetptr);
00577 
00578 /* spanf2.cxx */
00579 
00580 bool  isinlinklist(typelinkset linkset, IStreamAddr * linkisaptr);
00581 void  onlinklist(Session *sess, typelinkset *linksetptr, IStreamAddr *linkisaptr);
00582 void  intersectlinksets(Session * sess, typelinkset linkset1, typelinkset linkset2, typelinkset linkset3, typelinkset * linkset4ptr);
00583 //STATIC typelink *makelinkitem(Session * sess, IStreamAddr * linkisa);
00584 
00585 /* split.cxx */
00586 
00587 bool  splitcrumupwards(typecuc * father);
00588 void  splitcrum(typecuc * father);
00589 //STATIC void  splitcrumseq(typecuc * father);
00590 //STATIC void  splitcrumsp(typecuc * father);
00591 //STATIC void  splitcrumpminthiscrum(typecuc * father);
00592 //STATIC void  splitcrumpm(typecuc * father);
00593 void  peelcrumoffnd(typecorecrum * ptr);
00594 
00595 /* sporgl.cxx */
00596 
00597 bool  specset2sporglset(Session * sess, typespecset specset, typesporglset * sporglsetptr, int type);
00598 //STATIC typesporglset *vspanset2sporglset(Session * sess, IStreamAddr * docisa, typevspanset vspanset, typesporglset * sporglsetptr, int type);
00599 bool  link2sporglset(Session * sess, IStreamAddr * linkisa, typesporglset * sporglsetptr, int whichend, int type);
00600 bool  linksporglset2specset(Session * sess, IStreamAddr * homedoc, typesporglset sporglset, typespecset * specsetptr, int type);
00601 //STATIC void  linksporglset2vspec(Session * sess, IStreamAddr * homedoc, typesporglset * sporglsetptr, typevspec * specptr, int type);
00602 //STATIC void  sporglset2vspanset(Session * sess, IStreamAddr * homedoc, typesporglset * sporglsetptr, typevspanset * vspansetptr, int type);
00603 void  unpacksporgl(typesporglset sporglptr, Tumbler * streamptr, Tumbler * widthptr, type2dbottomcruminfo * infoptr);
00604 void  contextintosporgl(type2dcontext * context, Tumbler * linkid, typesporgl * sporglptr, int index);
00605 void  sporglset2linkset(Session * sess, typecuc * spanfptr, typesporglset sporglset, typelinkset * linksetptr, typeispan * homeset, int spantype);
00606 //STATIC void  sporglset2linksetinrange(Session * sess, typecuc * spanfptr, typesporglset sporglset, typelinkset * linksetptr, typeispan * orglrange, int spantype);
00607 
00608 /* test.cxx */
00609 
00610 void  foo(char *msg);
00611 void  foospan(char *msg, typespan * span);
00612 void  foospanset(char *msg, typespan * spanset);
00613 void  dumpspanset(typespan * spanset);
00614 void  foocrum(char *msg, typecorecrum * crumptr);
00615 void  foohex(char *msg, int num);
00616 void  foodec(char *msg, int num);
00617 void  foocontext(char *msg, Context * context);
00618 void  foocontextlist(char *msg, Context * context);
00619 void  fooitemset(char *msg, typeitemset iptr);
00620 void  fooitem(char *msg, typeitem * iptr);
00621 void  footumbler(char *msg, Tumbler * tptr);
00622 void  foodsp(char *msg, typedsp * dptr, int enftype);
00623 void  foowid(char *msg, typewid * wptr, int enftype);
00624 void  dumpsubtree(typecuc * father);
00625 void  dumpwholesubtree(typecuc * father);
00626 void  assertspecisstring(typespecset specptr, char *string);
00627 bool  asserttreeisok(typecorecrum * ptr);
00628 void  assertsubtreeisok(typecorecrum * ptr);
00629 void  assertsonswispmatchesfather(typecuc * father);
00630 void  assertwidsarepositive(typecorecrum * ptr);
00631 void  dumpwholetree(typecorecrum * ptr);
00632 int   checkwholesubtree(typecuc * father);
00633 int   check(typecuc * ptr);
00634 void  dump(typecorecrum * ptr);
00635 void  yesdump(typecorecrum * ptr);
00636 void  dumphedr(typecorecrumhedr * ptr);
00637 void  dumpwid(typewid * widptr, int enftype);
00638 void  dumpdsp(typewid * dspptr, int enftype);
00639 void  dumpinfo(typegranbottomcruminfo * infoptr, int enftype);
00640 void  dumptumbler(Tumbler * tumblerptr);
00641 void  displaycutspm(typeknives * knivesptr);
00642 void  dumphint(typehint * hintptr);
00643 void  examine(Session * sess);
00644 void  showorgl(Session * sess);
00645 void  showsubtree(typecorecrum * father);
00646 void  showistream(typecuc * granfptr);
00647 void  showspanf(typecuc * spanfptr);
00648 void  doshowspanf(typecorecrum * crumptr, typedsp * offsetptr, int enfheight);
00649 void  showspanfcrum(typecorecrum * crumptr, typedsp * offsetptr, int enfheight);
00650 void  dumpmem(char *loc, unsigned count);
00651 bool  dumpgranfwids(Session * sess);
00652 void  showgranwids(typecorecrum * crum, int down, Tumbler * retptr);
00653 void  dumppoomwisps(typecorecrum * orgl);
00654 void  showpoomwisps(typecuc * crum, int down);
00655 void  dumpistreamgr(typecuc * crumptr);
00656 void  dodumpistreamgr(typecuc * crumptr, Tumbler * offsetptr);
00657 void  dumpmoleculegr(Tumbler * offsetptr, typecbc * cbcptr);
00658 void  dumpisagr(Tumbler * offsetptr);
00659 typecorecrum *checkenftypes(typecuc * father, char *message);
00660 typecorecrum *checkthebleedingcrum(typecorecrum * crumptr);
00661 void  teststack();
00662 char *enftypestring(int type);
00663 typecorecrum *sonoriginok(typecorecrum * father);
00664 void  dumpcontextlist(Context * context);
00665 void  dumpcontext(Context * context);
00666 void  dumpitemset(typeitemset itemset);
00667 void  dumpitem(typeitem * itemptr);
00668 void  dumpspan(typespan * spanptr);
00669 void  dumptext(typetext * textptr);
00670 bool  ioinfo(Session * sess);
00671 void  showenfilades(Session * sess);
00672 char *itemidstring(typeitem * item);
00673 void  checkitem(char *msg, typeitem * ptr);
00674 void  checkpointer(char *msg, char *ptr);
00675 void  dumpspanpairset(typespanpairset spanpairset);
00676 void  dumpspanpair(typespanpair * spanpair);
00677 void  dumphexstuff(char *ptr);
00678 void  checknumofsons(typecuc * ptr);
00679 void  nchecknumofsons(typecuc * ptr);
00680 
00681 /* tumble.cxx */
00682 
00683 bool  tumblereq(Tumbler *a, Tumbler *b);
00684 bool  tumbleraccounteq(Tumbler *aptr, Tumbler *bptr);
00685 int   tumblercmp(Tumbler *aptr, Tumbler *bptr);
00686 int   intervalcmp(Tumbler *left, Tumbler *right, Tumbler *address);
00687 bool  tumblercheckptr(Tumbler *ptr, int /* typecrum */  *crumptr);
00688 bool  tumblercheck(Tumbler * ptr);
00689 bool  is1story(Tumbler *tumblerptr);
00690 int   nstories(Tumbler * tumblerptr);
00691 int   tumblerlength(Tumbler * tumblerptr);
00692 int   lastdigitintumbler(Tumbler * tumblerptr);
00693 void  tumblerjustify(Tumbler * tumblerptr);
00694 //STATIC void  partialtumblerjustify(Tumbler * tumblerptr);
00695 void  tumblercopy(Tumbler *fromptr, Tumbler *toptr);
00696 void  tumblermax(Tumbler * aptr, Tumbler * bptr, Tumbler * cptr);
00697 void  functiontumbleradd(Tumbler * aptr, Tumbler * bptr, Tumbler * cptr);
00698 void  tumblersub(Tumbler * aptr, Tumbler * bptr, Tumbler * cptr);
00699 void  absadd(Tumbler * aptr, Tumbler * bptr, Tumbler * cptr);
00700 void  absadd(Tumbler * aptr, Tumbler * bptr, Tumbler * cptr);
00701 void  strongsub(Tumbler * aptr, Tumbler * bptr, Tumbler * cptr);
00702 void  weaksub(Tumbler * aptr, Tumbler * bptr, Tumbler * cptr);
00703 int   tumblerintdiff(Tumbler * aptr, Tumbler * bptr);
00704 void  tumblerincrement(Tumbler * aptr, int rightshift, int bint, Tumbler * cptr);
00705 void  tumblertruncate(Tumbler * aptr, int bint, Tumbler * cptr);
00706 void  prefixtumbler(Tumbler * aptr, int bint, Tumbler * cptr);
00707 void  beheadtumbler(Tumbler * aptr, Tumbler * bptr);
00708 void  docidandvstream2tumbler(Tumbler * docid, Tumbler * vstream, Tumbler * tumbleptr);
00709 
00710 /* tumbleari.cxx */
00711 
00712 int tumblerptrtofixed(humber p, Tumbler * tptr);
00713 int tumblerfixedtoptr(Tumbler * ptr, humber p);
00714 humber fooalloc(unsigned int size);
00715 void foofree(humber ptr);
00716 //STATIC unsigned int calculatetotallength(unsigned int lengthofbody);
00717 humber humberput(int i, humber humberfoo, unsigned int * lengthofhumberptr);
00718 humber humber3put(int i, humber humberfoo, unsigned int * lengthofhumberptr);
00719 unsigned int functionintof(humber h);
00720 unsigned int intlengthoflength(unsigned int i);
00721 //STATIC unsigned int lengthoflength(humber ptr);
00722 //STATIC humber exponentof(humber ptr);
00723 //STATIC unsigned int lengthofexp(Tumbler * ptr);
00724 unsigned int functionlengthof(humber ptr);
00725 humber mantissaof(humber ptr);
00726 
00727 /* wisp.cxx */
00728 
00729 void  dspadd(typedsp * a, typewisp * b, typedsp * c, int enftype);
00730 void  dspsub(typedsp * a, typewisp * b, typedsp * c, int enftype);
00731 bool  setwispupwards(typecuc * ptr, int testflag);
00732 void  setwispsofsons(typecuc * ptr);
00733 bool  setwisp(typecorecrum * ptr);
00734 //STATIC bool  setwidseq(typecuc * father);
00735 //STATIC bool  setwispnd(typecuc * father);
00736 //STATIC void  didntchangewisps();
00737 void  setwidnd(typecuc * father);
00738 bool  iszerolock(Tumbler * lock, unsigned loxize);
00739 bool  lockeq(Tumbler * lock1, Tumbler * lock2, unsigned loxize);
00740 void  lockadd(Tumbler * lock1, Tumbler * lock2, Tumbler * lock3, unsigned loxize);
00741 void  locksubtract(Tumbler * lock1, Tumbler * lock2, Tumbler * lock3, unsigned loxize);
00742 //STATIC void  lockmin(Tumbler * lock1, Tumbler * lock2, Tumbler * lock3, unsigned loxize);
00743 //STATIC void  lockmax(Tumbler * lock1, Tumbler * lock2, Tumbler * lock3, unsigned loxize);
00744 bool  lockis1story(Tumbler * lock, unsigned loxize);
00745 
00746 /* credel.cxx */
00747 extern void etag();
00748 extern int *eallocwithtag(unsigned nbytes, tagtype tag);
00749 //STATIC extern int *ealloc(unsigned nbytes);
00750 extern void efree(char *ptr);
00751 extern void efreewithtag();
00752 
00753 void *operator new(size_t nbytes, Session *sess);
00754 
00755 extern humber humberput();
00756 extern humber humber3put();
00757 
00758 /* 
00759  * #define lengthof(x) functionlengthof(x) */
00760 #define weakfindfather(x) ((typecuc *)(((!(((typecuc*)(x))->isapex))&&(((typecuc*)(x))->isleftmost))?((typecuc*)((typecuc*)(x))->leftbroorfather):(typecuc*)functionweakfindfather((typecorecrum *)(typecuc*)(x))))
00761 
00762 #define clear(ptr,count) memset(ptr,0,count)
00763 #define movmem(src,dest,count) memmove(dest,src,count)
00764 
00765 //#define move2dinfo(A,B) movmem((A), (B), sizeof(type2dbottomcruminfo))
00766 inline void
00767 move2dinfo(type2dbottomcruminfo *A, type2dbottomcruminfo *B)
00768 {
00769     movmem(A, B, sizeof(type2dbottomcruminfo));
00770 }
00771 
00772 //#define moveinfo(A,B) movmem((A),(B),sizeof(typebottomcruminfo))
00773 inline void
00774 moveinfo(typebottomcruminfo *A, typebottomcruminfo *B)
00775 {
00776     movmem(A, B, sizeof(typebottomcruminfo));
00777 }
00778 
00779 //OBSOLETE #define gerror(s) assert(false); //qerror(s)
00780 
00781 #define rejuvinateifnotRESERVED(x) (((x)->age==RESERVED)?(int)(x):((x)->age = NEW))
00782 
00783 #define rejuvinate(x) ((x)->age==RESERVED)?(reservnumber?--reservnumber:testforrejuvinate(x)):0,(x)->age = NEW
00784 //inline void rejuvinate(typecorecrum *x)
00785 //{
00786 //  (x->age==RESERVED) ? (reservnumber ? --reservnumber : testforrejuvinate(x)) : 0, x->age = NEW;
00787 //}
00788 /* not needed #define rejuvinate(x) funcrejuvinate(x) */
00789 
00790 #define getrightbro(x) routinegetrightbro(x)
00791 
00792 #define macrogetrightbro(x)    ((rejuvinateifnotRESERVED (x), (x) = (x)->rightbro,  ((x)? (rejuvinateifnotRESERVED (x)): 0),(x)))
00793 
00794 /* not needed#define macrogetrightbro(x) getrightbro() */
00795 
00796 /* #define findrightbro(A) macrogetrightbro(A) */
00797 #define findrightbro(A) funcfindrightbro(A)
00798 
00799 #ifndef max
00800 #define max(a,b)        (((a) > (b)) ? (a) : (b))
00801 #endif
00802 #ifndef min
00803 #define min(a,b)        (((a) < (b)) ? (a) : (b))
00804 #endif
00805 
00806 /*
00807  * wisp
00808  */
00809 
00810 #define movewisp(A,B)  movmem((A),(B),sizeof(typewisp))
00811 #define widsize(A)     ((A)==GRAN?WIDSIZEGR:((A)==SPAN?WIDSIZESP:WIDSIZEPM))
00812 #define dspsize(A)     ((A)==GRAN?DSPSIZEGR:((A)==SPAN?DSPSIZESP:DSPSIZEPM))
00813 
00814 
00815 extern bool isthisusersdocument(Session *sess, Tumbler * tp);
00816 
00817 //#define hgetfromloaf(ip,lp)   (*(ip)=intof((humber)lp),(lp)=((char*)lp)+lengthof((humber)lp))
00818 inline void
00819 hgetfromloaf(int *ip, char *lp)
00820 {
00821     *ip = intof((humber) lp);
00822     lp  = lp + lengthof((humber) lp);
00823 }
00824 
00825 #endif /* !__UDANAX_PROTOS_H__*/

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