include/tumbler.h File Reference

??? More...

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Classes

class  Tumbler

Defines

#define SIZEOFZEROHUMBER   3
#define NPLACES   11
#define TUMBLERMINUS   129
#define ZEROTUMBLER   {0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0}
#define tumblerclear(tumblerptr)   ((*(tumblerptr)) = ZEROTUMBLERvar)
#define iszerotumbler(tumblerptr)   (!((tumblerptr) -> mantissa[0]))
#define movetumbler(A, B)   (*((Tumbler *)(B)) = *((Tumbler *)(A)))
#define GREATER   1
#define EQUAL   0
#define LESS   -1
#define TOMYLEFT   -2
#define ONMYLEFTBORDER   -1
#define THRUME   0
#define ONMYRIGHTBORDER   1
#define TOMYRIGHT   2
#define macrotumblermax(a, b, c)   ((*(Tumbler*)(c))=(tumblercmp((a),(b))==GREATER)?( (*(Tumbler *)(a))) :((*(Tumbler *)(b))) )
#define macrotumblermin(a, b, c)   ((*(Tumbler*)(c))=(tumblercmp((a),(b))==LESS)?( (*(Tumbler *)(a))) :((*(Tumbler *)(b))) )
#define lengthoftumbler(x)   intof((x))
#define intof(x)   ((unsigned int)((unsigned)((humber)(x))[0]<=127)?((humber)(x))[0]:functionintof(x))
#define lengthof(x)   ((unsigned int)((unsigned)((humber)(x))[0]<=127)?(unsigned int)1:functionlengthof(x))
#define tumbleradd(x, y, z)   functiontumbleradd(x,y,z)

Typedefs

typedef unsigned char * humber
typedef unsigned int tdigit

Functions

bool tumblereq (Tumbler *a, Tumbler *b)
 ???

bool tumbleraccounteq (Tumbler *aptr, Tumbler *bptr)
 ???

int tumblercmp (Tumbler *aptr, Tumbler *bptr)
 ???

int intervalcmp (Tumbler *left, Tumbler *right, Tumbler *address)
 ???

bool is1story (Tumbler *tumblerptr)
 ???

bool tumblercheckptr (Tumbler *ptr, int *crumptr)
 ???


Variables

Tumbler ZEROTUMBLERvar


Detailed Description

???

(to be defined)

Definition in file tumbler.h.


Define Documentation

#define EQUAL   0
 

Definition at line 116 of file tumbler.h.

Referenced by abscmp(), intervalcmp(), makespanpairsforispan(), putvspaninlist(), spanintersection(), tumblercmp(), and whereoncrum().

#define GREATER   1
 

Definition at line 115 of file tumbler.h.

Referenced by abscmp(), context2span(), context2vtext(), findnextaddressinvspace(), findsontoinsertundernd(), functiontumbleradd(), makespanpairsforispan(), putvspaninlist(), retrieveinspan(), shellsort(), sortknives(), spanintersection(), splitcrumpm(), splitcrumsp(), tumblercmp(), and tumblermax().

#define intof  )     ((unsigned int)((unsigned)((humber)(x))[0]<=127)?((humber)(x))[0]:functionintof(x))
 

Definition at line 146 of file tumbler.h.

Referenced by findandallocateinsidediskblocknumber(), findinsideloaf(), hgetfromloaf(), hgetinfo(), numberofliveunterloafs(), readloaf(), varunpackloaf(), and writeloaf().

#define iszerotumbler tumblerptr   )     (!((tumblerptr) -> mantissa[0]))
 

Definition at line 106 of file tumbler.h.

Referenced by comparespans(), contextintosporgl(), crumintersectsspanseq(), crumqualifies2d(), deletevspanpm(), doinsertnd(), findnextnlinksfromtothreesp(), findsontoinsertundernd(), functiontumbleradd(), insertmorend(), insertnd(), insertpm(), insertseq(), iszerolock(), linksporglset2specset(), makegappm(), prefixtumbler(), specset2ispanset(), sporglset2vspanset(), tumblercmp(), tumblerincrement(), tumblersub(), and unpacksporgl().

#define lengthof  )     ((unsigned int)((unsigned)((humber)(x))[0]<=127)?(unsigned int)1:functionlengthof(x))
 

Definition at line 148 of file tumbler.h.

Referenced by findinsideloaf(), functionlengthof(), hgetfromloaf(), hgetinfo(), and numberofliveunterloafs().

#define lengthoftumbler  )     intof((x))
 

Definition at line 135 of file tumbler.h.

Referenced by tumblerptrtofixed().

#define LESS   -1
 

Definition at line 117 of file tumbler.h.

Referenced by abscmp(), context2span(), context2vtext(), fetchorglgr(), findisatoinsertmolecule(), findnextlinkvsa(), findsontoinsertundernd(), findvsatoappend(), insertpm(), intervalcmp(), makegappm(), makeroomonleftnd(), makespanpairsforispan(), putvspaninlist(), spanintersection(), tumblercmp(), and whereoncrum().

#define macrotumblermax a,
b,
 )     ((*(Tumbler*)(c))=(tumblercmp((a),(b))==GREATER)?( (*(Tumbler *)(a))) :((*(Tumbler *)(b))) )
 

Definition at line 130 of file tumbler.h.

Referenced by lockmax().

#define macrotumblermin a,
b,
 )     ((*(Tumbler*)(c))=(tumblercmp((a),(b))==LESS)?( (*(Tumbler *)(a))) :((*(Tumbler *)(b))) )
 

Definition at line 131 of file tumbler.h.

Referenced by lockmin().

#define movetumbler A,
 )     (*((Tumbler *)(B)) = *((Tumbler *)(A)))
 

Definition at line 107 of file tumbler.h.

Referenced by absadd(), beheadtumbler(), context2span(), context2vstuff(), context2vtext(), contextintosporgl(), deletend(), docidandvstream2tumbler(), docreatenewversion(), dumpisagr(), expandcrumleftward(), finddocscontainingsp(), findnextaddressinvspace(), findnextlinkvsa(), findvsatoappend(), functiontumbleradd(), insertpm(), insertseq(), insertspanf(), inserttextgr(), ispan2vstuffset(), linksporglset2specset(), linksporglset2vspec(), main(), makegappm(), makehint(), makelinkitem(), makeoffsetsfor3or4cuts(), makespanpair(), makespanpairset(), makevspan(), prefixtumbler(), putvspaninlist(), rearrangend(), removespansnotinoriginal(), restrictvspecsetovercommonispans(), retrievedocumentpartofvspanpm(), retrieverestricted(), retrievevspanpm(), retrievevspansetpm(), showgranwids(), sortknives(), spanintersection(), sporglset2linksetinrange(), sporglset2vspanset(), strongsub(), tumbler2spanset(), tumblercopy(), tumblerincrement(), tumblermax(), tumblersub(), tumblertruncate(), unpacksporgl(), vspanset2sporglset(), weaksub(), and whereoncontext().

#define NPLACES   11
 

Definition at line 82 of file tumbler.h.

Referenced by absadd(), abscmp(), docidandvstream2tumbler(), dumpisagr(), dumptumbler(), gettumbler(), hashoftumbler(), is1story(), nstories(), partialtumblerjustify(), puttumbler(), strongsub(), tumbleraccounteq(), tumblercheckptr(), tumblerincrement(), tumblerjustify(), tumblerptrtofixed(), tumblertruncate(), and weaksub().

#define ONMYLEFTBORDER   -1
 

Definition at line 125 of file tumbler.h.

Referenced by crumintersectsspanseq(), crumqualifies2d(), deletecutsectionnd(), findcbcnd(), findsontoinsertundernd(), incontextlistnd(), insertcutsectionnd(), intervalcmp(), rearrangecutsectionnd(), and whereoncrum().

#define ONMYRIGHTBORDER   1
 

Definition at line 127 of file tumbler.h.

Referenced by crumintersectsspanseq(), findpreviousisagr(), findsontoinsertundernd(), intervalcmp(), and whereoncrum().

#define SIZEOFZEROHUMBER   3
 

Definition at line 76 of file tumbler.h.

#define THRUME   0
 

Definition at line 126 of file tumbler.h.

Referenced by crumiscut(), crumiscutbyithknife(), crumleftofithcut(), crumqualifies2d(), deletecutsectionnd(), findcbcnd(), findcbcseq(), findcbcseqcrum(), findnextaddressinvspace(), findpreviousisagr(), incontextlistnd(), insertcutsectionnd(), intervalcmp(), makecutsbackuptohere(), makeithcutonson(), rearrangecutsectionnd(), slicecbcpm(), and whereoncrum().

#define TOMYLEFT   -2
 

Definition at line 124 of file tumbler.h.

Referenced by intervalcmp(), and whereoncrum().

#define TOMYRIGHT   2
 

Definition at line 128 of file tumbler.h.

Referenced by crumqualifies2d(), intervalcmp(), and whereoncrum().

#define tumbleradd x,
y,
 )     functiontumbleradd(x,y,z)
 

Definition at line 150 of file tumbler.h.

Referenced by comparecrumsdiagonally(), context2span(), context2vtext(), deletend(), dodumpistreamgr(), expandcrumleftward(), findlastcbcseq(), findnextlinkvsa(), findpreviousisagr(), findsontoinsertundernd(), insertpm(), ispan2vstuffset(), lockadd(), makegappm(), makespanpairsforispan(), maxtextwid(), prefixtumbler(), putvspaninlist(), rearrangend(), retrieverestricted(), shellsort(), showgranwids(), spanintersection(), tumblersub(), whereoncontext(), and whereoncrum().

#define tumblerclear tumblerptr   )     ((*(tumblerptr)) = ZEROTUMBLERvar)
 

Definition at line 105 of file tumbler.h.

Referenced by dumpistreamgr(), findaddressofsecondcutforinsert(), findlastcbcseq(), findnextaddressinvspace(), findnextlinkvsa(), findvsatoappend(), Session::getaccount(), gettumbler(), insertpm(), insertseq(), insertspanf(), link2sporglset(), makeoffsetsfor3or4cuts(), makespanpairsforispan(), prefixtumbler(), retrieverestricted(), retrievevspansetpm(), setlinkvsas(), spanintersection(), sporglset2linkset(), strongsub(), tumbler2spanset(), tumblerincrement(), tumblerptrtofixed(), tumblersub(), tumblertruncate(), unpacksporgl(), and weaksub().

#define TUMBLERMINUS   129
 

Definition at line 84 of file tumbler.h.

#define ZEROTUMBLER   {0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0}
 

Definition at line 101 of file tumbler.h.


Typedef Documentation

typedef unsigned char* humber
 

Definition at line 75 of file tumbler.h.

Referenced by changeunterrefcount(), findandallocateinsidediskblocknumber(), findinsideloaf(), functionintof(), functionlengthof(), hgetfromloaf(), hgetinfo(), hgetwiddsp(), hputinfo(), hputwiddsp(), humber3put(), humberput(), lengthoflength(), numberofliveunterloafs(), orglwritepart2(), readloaf(), tumblerfixedtoptr(), tumblerptrtofixed(), uniqueoutloaf(), varpackloaf(), varunpackloaf(), and writeloaf().

typedef unsigned int tdigit
 

Definition at line 85 of file tumbler.h.

Referenced by absadd(), partialtumblerjustify(), and tumblerjustify().


Function Documentation

int intervalcmp Tumbler left,
Tumbler right,
Tumbler address
 

???

(to be defined)

Definition at line 261 of file tumble.cxx.

References EQUAL, LESS, ONMYLEFTBORDER, ONMYRIGHTBORDER, THRUME, TOMYLEFT, TOMYRIGHT, and tumblercmp().

Referenced by whereoncontext(), and whereoncrum().

00265 {
00266     int cmp;
00267 
00268     cmp = tumblercmp(address, left);
00269     if (cmp == LESS)
00270         return TOMYLEFT;
00271 
00272     else if (cmp == EQUAL)
00273         return ONMYLEFTBORDER;
00274 
00275     cmp = tumblercmp(address, right);
00276     if (cmp == LESS)
00277         return THRUME;
00278     else if (cmp == EQUAL)
00279         return ONMYRIGHTBORDER;
00280     else
00281         return TOMYRIGHT;
00282 }

bool is1story Tumbler tumblerptr  ) 
 

???

(to be defined)

Definition at line 386 of file tumble.cxx.

References Tumbler::mantissa, and NPLACES.

Referenced by istextcrum(), lockis1story(), retrievevspansetpm(), and slicecbcpm().

00388 {
00389     int i;
00390 
00391     //assert( tumblercheck(tumblerptr) );
00392     
00393     for (i = 1; i < NPLACES; i++)
00394         if (tumblerptr->mantissa[i] != 0)
00395             return false;
00396     return true;
00397 }

bool tumbleraccounteq Tumbler aptr,
Tumbler bptr
 

???

(to be defined)

Definition at line 127 of file tumble.cxx.

References Tumbler::exp, Tumbler::mantissa, NPLACES, and Tumbler::sign.

Referenced by docreatenewversion(), and isthisusersdocument().

00130 {
00131     int i, j;
00132 
00133     if (aptr->exp != bptr->exp || aptr->sign != bptr->sign)
00134         return false;
00135 
00136     for (j = 0, i = 0; i < NPLACES; i++) {
00137         if (aptr->mantissa[i] != bptr->mantissa[i])
00138             return false;
00139 
00140         if (aptr->mantissa[i] == 0 && ++j == 2)
00141             return true;
00142     }
00143     return true;
00144 }

bool tumblercheckptr Tumbler ptr,
int *  crumptr
 

???

(to be defined)

Definition at line 294 of file tumble.cxx.

References assert, dump(), dumptumbler(), dumpwholetree(), Tumbler::exp, L, Tumbler::mantissa, NPLACES, Tumbler::sign, and typecorecrum.

Referenced by assertwidsarepositive(), newpeelcrumoffnd(), and tumblercheck().

00297 {
00298     bool wrong;
00299     int i;
00300 
00301     wrong = false;
00302     if (ptr->exp > 0) {
00303 #ifndef DISTRIBUTION
00304         L("bad exp ");
00305 #endif
00306         wrong = true;
00307     }
00308 
00309     if (ptr->sign && ptr->mantissa[0] == 0) {
00310 #ifndef DISTRIBUTION
00311         L(" negative zero ");
00312 #endif
00313         wrong = true;
00314     }
00315 
00316     if (ptr->exp && ptr->mantissa[0] == 0) {
00317 #ifndef DISTRIBUTION
00318         L("fucked up non-normalized");
00319 #endif
00320         wrong = true;
00321     }
00322 
00323     if (ptr->mantissa[0] == 0) {
00324         for (i = 1; i < NPLACES; ++i) {
00325             if (ptr->mantissa[i] != 0) {
00326 #ifndef DISTRIBUTION
00327                 L("nonzerozerotumbler");
00328 #endif
00329                 wrong = true;
00330             }
00331         }
00332     }
00333 
00334     for (i = 0; i < NPLACES; ++i) {
00335         if ((int) (ptr->mantissa[i]) < 0) {
00336 #ifndef DISTRIBUTION
00337             L("negative digit");
00338 #endif
00339             wrong = true;
00340         }
00341     }
00342 
00343     if (wrong) {
00344 #ifndef DISTRIBUTION
00345         dumptumbler(ptr);
00346         if (crumptr) {
00347             dump((typecorecrum *) crumptr);
00348         }
00349         L("\n\n invalid tumbler \n\n");
00350         if (crumptr) {
00351             dumpwholetree((typecorecrum *) crumptr);
00352         }
00353         assert(0); // invalid tumbler
00354 #else
00355         assert(0);
00356 #endif
00357         return false;
00358     }
00359 
00360     return true;
00361 }

int tumblercmp Tumbler aptr,
Tumbler bptr
 

???

(to be defined)

Definition at line 154 of file tumble.cxx.

References abscmp(), EQUAL, GREATER, iszerotumbler, LESS, and Tumbler::sign.

Referenced by comparecrumsdiagonally(), context2span(), context2vtext(), fetchorglgr(), findisatoinsertmolecule(), findnextaddressinvspace(), findnextlinkvsa(), findsontoinsertundernd(), findvsatoappend(), insertpm(), intervalcmp(), makegappm(), makeroomonleftnd(), makespanpairsforispan(), putvspaninlist(), removespansnotinoriginal(), retrieveinspan(), shellsort(), sortknives(), spanintersection(), splitcrumpm(), tumblermax(), and whereoncrum().

00157 {
00158     if (iszerotumbler(aptr)) {
00159         if (iszerotumbler(bptr))
00160             return EQUAL;
00161         else
00162             return (bptr->sign ? GREATER : LESS);
00163     }
00164 
00165     if (iszerotumbler(bptr))
00166         return (aptr->sign ? LESS : GREATER);
00167 
00168     if (aptr->sign == bptr->sign)
00169         return (aptr->sign ? abscmp(bptr, aptr) : abscmp(aptr, bptr));
00170 
00171     return (aptr->sign ? LESS : GREATER);
00172 }

bool tumblereq Tumbler a,
Tumbler b
 

???

(to be defined)

Definition at line 101 of file tumble.cxx.

Referenced by checkforopen(), crumqualifies2d(), dumpgranfwids(), fetchorglgr(), findnextnlinksfromtothreesp(), incrementopen(), intersectlinksets(), isaexistsgr(), isanextensionnd(), isinlinklist(), lockeq(), logbertmodified(), main(), onlinklist(), removefromopen(), showgranwids(), sporglset2vspanset(), strongsub(), tumblersub(), and weaksub().

00104 {
00105     char *aptr = (char *)a;    /* char * for cheating in compare loop */
00106     char *bptr = (char *)b;
00107     int i;
00108 
00109 /* return (tumblercmp (aptr, bptr) == EQUAL);// old safe & slow// */
00110 /* could speed up by doing comparison directly or stealing from abscmp */
00111     i = (int)aptr + sizeof(Tumbler);
00112     for (; ((int)aptr) < i;) {
00113         if (*aptr++ != *bptr++)
00114             return false;
00115     }
00116     return true;
00117 }


Variable Documentation

Tumbler ZEROTUMBLERvar
 

Definition at line 103 of file tumbler.h.

Referenced by initsession().


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