00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105 #ifndef __UDANAX_PROTOS_H__
00106 #define __UDANAX_PROTOS_H__
00107
00108 #include <memory.h>
00109 #include "types.h"
00110
00111
00112
00113 void lookatalloc();
00114
00115
00116 int checkalloc(char *c);
00117
00118 int *falloc(unsigned nbytes);
00119 void ffree(char *ap);
00120
00121
00122
00123 void lookatalloc2(HEADER * abaseallocated);
00124
00125
00126
00127 class Session;
00128 struct typecuc;
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
00134
00135
00136
00137
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
00143
00144 class Context;
00145 class CrumContext;
00146
00147
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
00154 Context *makecontextfromcbc(typecbc *crumptr, typewid *offsetptr);
00155 void context2span(Context *context, typespan *restrictionspanptr, int idx1, typespan *foundspanptr, int idx2);
00156
00157
00158 bool context2vstuff(Session *sess, Context *context, typeispan *ispanptr, typevstuffset *vstuffsetptr);
00159
00160
00161
00162
00163 void initkluge(typecuc ** granfptr, typecuc ** spanfptr);
00164
00165 void inloaf(typecuc * father);
00166 void inorgl(typecbc * granorglptr);
00167 void inorglinternal(typecbc * granorglptr, typeuberrawdiskloaf * crumptr);
00168
00169
00170
00171
00172 void diskexit();
00173 void diskflush();
00174 void writeenfilades();
00175
00176 void orglwrite(typecbc * orglcbcptr);
00177
00178
00179 void subtreewrite(typecuc * father);
00180
00181
00182
00183
00184 void restrictspecsetsaccordingtoispans(Session *sess, typeispanset ispanset, typespecset * specset1, typespecset * specset2);
00185
00186
00187 bool intersectspansets(Session *sess, typespanset set1, typespanset set2, typespanset *set3, typeitemid spantype);
00188
00189
00190 void makespanpairset(Session *sess, typeispanset ispanset, typespecset specset1, typespecset specset2, typespanpairset * pairsetptr);
00191
00192
00193
00194
00195
00196
00197 int *eallocwithtag(unsigned nbytes, tagtype tag);
00198
00199 void efree(char *ptr);
00200 void initgrimreaper();
00201
00202
00203
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
00216 void initqueues();
00217
00218
00219
00220
00221
00222
00223
00224 int findnumberofdamnsons(typediskloafptr diskptr);
00225 int changerefcount(typediskloafptr diskptr, int delta);
00226
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
00234
00235
00236
00237
00238
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
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
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
00287
00288
00289 void deletend(typecuc * fullcrumptr, Tumbler * origin, Tumbler * width, int index);
00290 void rearrangend(typecuc * fullcrumptr, typecutseq * cutseqptr, int index);
00291
00292
00293 int insertcutsectionnd(typecorecrum * ptr, typewid * offset, typeknives * knives);
00294
00295
00296
00297
00298
00299 void initsession(const char *database);
00300
00301
00302
00303 bool is2dcrum(typecorecrum * ptr);
00304 typecorecrum *getleftson(typecuc * ptr);
00305 typecorecrum *routinegetrightbro(typecorecrum * ptr);
00306 typecorecrum *getrightmostbro(typecorecrum * ptr);
00307
00308
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
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
00334
00335
00336
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
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
00349
00350
00351
00352 typevstuffset *ispan2vstuffset(Session * sess, typegranf fullcrumptr, typeispan * ispanptr, typevstuffset * vstuffsetptr);
00353
00354
00355
00356 void init(bool safe);
00357
00358
00359
00360 void insertseq(typecuc * fullcrumptr, Tumbler * address, typegranbottomcruminfo * info);
00361
00362
00363
00364
00365 void insertnd(Session * sess, typecuc * fullcrumptr, typewid * origin, typewid * width, type2dbottomcruminfo * infoptr, int index);
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377 void makeroomonleftnd(typecuc * father, typedsp * offset, typewid * origin, typedsp * grasp);
00378
00379
00380
00381
00382
00383
00384
00385
00386 void initincorealloctables();
00387 void savepartialdiskalloctabletodisk();
00388 void readpartialdiskalloctablefromdisk();
00389
00390 void addallocatedloaftopartialallocedtables(typediskloafptr dp, int size);
00391
00392
00393
00394 typediskloafptr partialdiskalloc(int size, int * newloafp);
00395
00396 void newpartialdiskfree(typediskloafptr diskloaf);
00397 int deallocateinloaf(typeuberdiskloaf * loafp, int insidediskblocknumber);
00398
00399 int numberofliveunterloafs(typeuberdiskloaf * loafp);
00400 char *findinsideloaf(typeuberdiskloaf * loafp, int ninsideloaf);
00401
00402
00403
00404 void makecutsnd(typecuc * fullcrumptr, typeknives * knives);
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
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
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
00434
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
00439
00440 typevspanset *ispan2vspanset(Session * sess, typeorgl orgl, typeispan * ispanptr, typevspanset * vspansetptr);
00441 typeispanset *vspanset2ispanset(Session * sess, typeorgl orgl, typevspanset vspanptr, typeispanset * ispansetptr);
00442
00443
00444 typeitem *onitemlist(Session * sess, typeitem * itemptr, typeitemset * itemsetptr);
00445 bool isemptyorgl(typeorgl fullcrumptr);
00446
00447
00448
00449
00450
00451 void puttumbler(FILE * outfile, Tumbler * tumblerptr);
00452
00453
00454 void putitemset(Session * sess, typeitemset itemset);
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
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
00533
00534 void recombine(typecuc * father);
00535
00536
00537
00538
00539
00540 bool ishouldbother(typecuc * dest, typecuc * src);
00541
00542
00543
00544
00545
00546
00547 int comparecrumsdiagonally(typecorecrum * a, typecorecrum * b);
00548 void fixincoresubtreewids(typecuc * ptr);
00549
00550
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
00556 Context *retrieveinspan(typecuc * fullcrumptr, Tumbler * spanstart, Tumbler * spanend, int index);
00557
00558
00559
00560
00561
00562
00563
00564 void prologuend(typecorecrum * ptr, typedsp * offset, typedsp * grasp, typedsp * reach);
00565 int whereoncrum(typecorecrum * ptr, typewid * offset, Tumbler * address, int index);
00566
00567
00568
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
00577
00578
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
00584
00585
00586
00587 bool splitcrumupwards(typecuc * father);
00588 void splitcrum(typecuc * father);
00589
00590
00591
00592
00593 void peelcrumoffnd(typecorecrum * ptr);
00594
00595
00596
00597 bool specset2sporglset(Session * sess, typespecset specset, typesporglset * sporglsetptr, int type);
00598
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
00602
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
00607
00608
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
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 *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
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
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
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
00722
00723
00724 unsigned int functionlengthof(humber ptr);
00725 humber mantissaof(humber ptr);
00726
00727
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
00735
00736
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
00743
00744 bool lockis1story(Tumbler * lock, unsigned loxize);
00745
00746
00747 extern void etag();
00748 extern int *eallocwithtag(unsigned nbytes, tagtype tag);
00749
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
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
00766 inline void
00767 move2dinfo(type2dbottomcruminfo *A, type2dbottomcruminfo *B)
00768 {
00769 movmem(A, B, sizeof(type2dbottomcruminfo));
00770 }
00771
00772
00773 inline void
00774 moveinfo(typebottomcruminfo *A, typebottomcruminfo *B)
00775 {
00776 movmem(A, B, sizeof(typebottomcruminfo));
00777 }
00778
00779
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
00785
00786
00787
00788
00789
00790 #define getrightbro(x) routinegetrightbro(x)
00791
00792 #define macrogetrightbro(x) ((rejuvinateifnotRESERVED (x), (x) = (x)->rightbro, ((x)? (rejuvinateifnotRESERVED (x)): 0),(x)))
00793
00794
00795
00796
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
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
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