libsrc/orglinks.cxx File Reference

permutation matrix enfilade calls, with link following routines More...

#include <memory.h>
#include "udanax.h"

Include dependency graph for orglinks.cxx:

Include dependency graph

Go to the source code of this file.

Functions

void findnextaddressinvspace (typecorecrum *crumptr, typewid *offsetptr, Tumbler *nextvspacestartptr, Tumbler *vsaptr)
 ???

void findvsatoappend (typecorecrum *ptr, Tumbler *vsaptr)
 ???

bool appendpm (Session *sess, IStreamAddr *doc_isa, typetextset textset)
 ???

bool insertpm (Session *sess, Tumbler *orglisa, typeorgl orgl, Tumbler *vsaptr, typesporglset sporglset)
 ???

bool rearrangepm (Session *sess, Tumbler *docisaptr, typeorgl docorgl, typecutseq *cutseqptr)
 ???

bool deletevspanpm (Session *sess, Tumbler *docisaptr, typeorgl docorgl, typevspan *vspanptr)
 ???

bool retrievedocumentpartofvspanpm (Session *sess, typeorgl orgl, typevspan *vspanptr)
 ???

bool retrievevspanpm (Session *sess, typeorgl orgl, typevspan *vspanptr)
 ???

bool istextcrum (typecorecrum *crumptr)
 ???

bool islinkcrum (typecorecrum *crumptr)
 ???

void maxtextwid (Session *sess, typecorecrum *crumptr, Tumbler *voffset, Tumbler *maxwid)
 ???

typevspanmakevspan (Session *sess, typevspan *spanptr, typevspan *nextspan)
 ???

void putvspaninlist (Session *sess, typevspan *spanptr, typevspanset *spansetptr)
 ???

bool retrievevspansetpm (Session *sess, typeorgl orgl, typevspanset *vspansetptr)
 ???

typespansetspan2spanset (Session *sess, typeorgl orgl, typespanset restrictionspanptr, int restrictionindex, typespanset *targspansetptr, int targindex)
 ???

typespansetpermute (Session *sess, typeorgl orgl, typespanset restrictionspanset, int restrictionindex, typespanset *targspansetptr, int targindex)
 ???

typevspansetispan2vspanset (Session *sess, typeorgl orgl, typeispan *ispanptr, typevspanset *vspansetptr)
 ???

typeispansetvspanset2ispanset (Session *sess, typeorgl orgl, typevspanset vspanptr, typeispanset *ispansetptr)
 ???

typeitemonitemlist (Session *sess, typeitem *itemptr, typeitemset *itemsetptr)
 ???

bool isemptyorgl (typeorgl fullcrumptr)
 ???


Detailed Description

permutation matrix enfilade calls, with link following routines

(to be defined)

Definition in file orglinks.cxx.


Function Documentation

bool appendpm Session sess,
IStreamAddr doc_isa,
typetextset  textset
 

???

(to be defined)

Parameters:
sess  Input: User's session context

Definition at line 188 of file orglinks.cxx.

References doinsert(), findorgl(), findvsatoappend(), granf, typecorecrum, typeorgl, typetextset, and WRITEBERT.

Referenced by doappend().

00189                                          : User's session context
00190     IStreamAddr *doc_isa,
00191     typetextset  textset)
00192 {
00193     /*
00194      * Walk the granfilade to find and lock the ORGL for the specified document.
00195      */
00196     typeorgl orglptr;
00197     if (!findorgl(sess, granf, doc_isa, &orglptr, WRITEBERT))
00198         return false;
00199 
00200     /*
00201      * Compute the highest stream address in use within the document, at which
00202      * to append the new content.
00203      */
00204     Tumbler vsa;
00205     findvsatoappend((typecorecrum *) orglptr, &vsa);
00206 
00207     return doinsert(sess, doc_isa, &vsa, textset);
00208 }

bool deletevspanpm Session sess,
Tumbler docisaptr,
typeorgl  docorgl,
typevspan vspanptr
 

???

(to be defined)

Parameters:
sess  Input: User's session context

Definition at line 324 of file orglinks.cxx.

References deletend(), iszerotumbler, logbertmodified(), typespan::stream, typevspan, V, and typespan::width.

Referenced by dodeletevspan().

00325                                        : User's session context
00326     Tumbler   *docisaptr,
00327     typeorgl   docorgl,
00328     typevspan *vspanptr)
00329 {
00330     if (iszerotumbler(&vspanptr->width))
00331         return false;
00332 
00333     deletend((typecuc *) docorgl, &vspanptr->stream, &vspanptr->width, V);
00334     logbertmodified(sess, docisaptr);
00335 
00336     return true;
00337 }

void findnextaddressinvspace typecorecrum crumptr,
typewid offsetptr,
Tumbler nextvspacestartptr,
Tumbler vsaptr
[static]
 

???

Definition at line 112 of file orglinks.cxx.

References typewid::dsas, findleftson(), findrightbro, GREATER, movetumbler, prologuend(), THRUME, tumblerclear, tumblercmp(), tumblermax(), typecorecrum, V, and whereoncrum().

Referenced by findvsatoappend().

00117 {
00118     typecorecrum *ptr;
00119     if (!(ptr = findleftson((typecuc *) crumptr)))
00120         return;
00121 
00122     Tumbler maxt;
00123     tumblerclear(&maxt);
00124 
00125     for (; ptr; ptr = findrightbro(ptr)) {
00126         typewid reach, grasp;
00127         prologuend(ptr, offsetptr, &grasp, &reach);
00128 
00129         if (whereoncrum(ptr, offsetptr, nextvspacestartptr, V) == THRUME) {
00130             findnextaddressinvspace(ptr, &grasp, nextvspacestartptr, vsaptr);
00131             return;
00132 
00133         } else if (tumblercmp(&grasp.dsas[V], nextvspacestartptr) != GREATER) {
00134             tumblermax(&reach.dsas[V], &maxt, &maxt);
00135 
00136         }
00137     }
00138     movetumbler(&maxt, vsaptr);
00139 }

void findvsatoappend typecorecrum ptr,
Tumbler vsaptr
[static]
 

???

Compute the V-stream address just beyond the last byte of text, but before any links; i.e. something in 1.xxx but before 2.

Definition at line 150 of file orglinks.cxx.

References clear, typecorecrumhedr::cwid, typewid::dsas, findnextaddressinvspace(), iszerolock(), LESS, movetumbler, POOM, prologuend(), tumblerclear, tumblercmp(), tumblerincrement(), typecorecrum, V, and widsize.

Referenced by appendpm().

00153 {
00154     typewid offset;
00155     clear(&offset, sizeof(offset));
00156 
00157     tumblerclear(vsaptr);
00158 
00159     Tumbler linkspacevstart;
00160     tumblerclear(&linkspacevstart);
00161     tumblerincrement(&linkspacevstart, 0, 2, &linkspacevstart);
00162 
00163     typewid grasp, reach;
00164     prologuend(ptr, &offset, &grasp, &reach);
00165 
00166     // If document contains no text but has links, just return a stream address of 1.1
00167     if (iszerolock((Tumbler *) &ptr->cwid, widsize(POOM)) || (tumblercmp(&grasp.dsas[V], &linkspacevstart) != LESS)) {
00168         tumblerincrement(vsaptr, 0, 1, vsaptr); /* no text in doc */
00169         tumblerincrement(vsaptr, 1, 1, vsaptr);
00170 
00171     // If document contains text but no links, return a stream address of the text's reach
00172     } else if (tumblercmp(&reach.dsas[V], &linkspacevstart) == LESS) {
00173         movetumbler(&reach.dsas[V], vsaptr);    /* no links in doc */
00174 
00175     // If document contains _both_ text and links
00176     } else
00177         findnextaddressinvspace(ptr, &grasp, &linkspacevstart, vsaptr);
00178 }

bool insertpm Session sess,
Tumbler orglisa,
typeorgl  orgl,
Tumbler vsaptr,
typesporglset  sporglset
 

???

(to be defined)

Parameters:
sess  Input: User's session context

Definition at line 218 of file orglinks.cxx.

References assert, debug, typewid::dsas, dumpitemset(), dumptumbler(), dumpwid(), footumbler(), I, insertnd(), iszerotumbler, L, LESS, logbertmodified(), movetumbler, typesporgl::next, POOM, tumbleradd, tumblerclear, tumblercmp(), tumblerincrement(), tumblerintdiff(), tumblerlength(), typesporglset, unpacksporgl(), V, and typesporglitem::xxxxsporgl.

Referenced by docopy(), docopyinternal(), and insertendsetsinorgl().

00219                                            : User's session context
00220     Tumbler       *orglisa,
00221     typeorgl       orgl,
00222     Tumbler       *vsaptr,
00223     typesporglset  sporglset)
00224 {
00225     Tumbler              lstream, lwidth;
00226     type2dbottomcruminfo linfo;
00227     typewid              crumorigin, crumwidth;
00228     Tumbler              zero;
00229     int                  shift, inc;
00230 
00231 #ifndef DISTRIBUTION
00232     if (debug) {
00233         L("\nINSERTpm  vsa ");
00234         dumptumbler(vsaptr);
00235         L("\n");
00236         dumpitemset((typeitem *) sporglset);
00237     }
00238 #endif
00239 
00240     if (iszerotumbler(vsaptr)) {
00241 #ifndef DISTRIBUTION
00242         L("insertpm inserting at 0 ---punt zzzz?");
00243 #endif
00244         return false;
00245     }
00246 
00247     tumblerclear(&zero);
00248 
00249     if (tumblercmp(vsaptr, &zero) == LESS)
00250         assert(0); // insertpm called with negative vsa
00251 
00252     logbertmodified(sess, orglisa);
00253     for (; sporglset; sporglset = (typesporglset) sporglset->xxxxsporgl.next) {
00254         unpacksporgl(sporglset, &lstream, &lwidth, &linfo);
00255 
00256 #ifndef DISTRIBUTION
00257         footumbler("lstream = ", &lstream);
00258 #endif
00259         movetumbler(&lstream, &crumorigin.dsas[I]);
00260 
00261 #ifndef DISTRIBUTION
00262         footumbler("lwidth = ", &lwidth);
00263 #endif
00264         movetumbler(&lwidth, &crumwidth.dsas[I]);
00265 
00266 #ifndef DISTRIBUTION
00267         footumbler("vsaptr = ", vsaptr);
00268 #endif
00269         movetumbler(vsaptr, &crumorigin.dsas[V]);
00270 /* I'm suspissious of this shift <reg> 3/1/85 zzzz */
00271         shift = tumblerlength(vsaptr) - 1;
00272         inc = tumblerintdiff(&lwidth, &zero);
00273         tumblerincrement(&zero, shift, inc, &crumwidth.dsas[V]);
00274 
00275 #ifndef DISTRIBUTION
00276         footumbler("crumwidth = ", &crumwidth.dsas[V]);
00277 #endif
00278 
00279         if (iszerotumbler(&crumwidth.dsas[V]))
00280             assert(0); // crum width 0 in insertpm
00281 
00282 #ifndef DISTRIBUTION
00283         if (debug) {
00284             L("    crumorigin: ");
00285             dumpwid(&crumorigin, POOM);
00286             L("    crumwidth: ");
00287             dumpwid(&crumwidth, POOM);
00288         }
00289 #endif
00290         insertnd(sess, (typecuc *) orgl, &crumorigin, &crumwidth, &linfo, V);
00291           tumbleradd(vsaptr, &crumwidth.dsas[V], vsaptr);
00292     }
00293     return true;
00294 }

bool isemptyorgl typeorgl  fullcrumptr  ) 
 

???

(to be defined)

Definition at line 860 of file orglinks.cxx.

References dspsize, iszerolock(), POOM, and widsize.

Referenced by doretrievedocvspanset().

00862 {
00863     return iszerolock((Tumbler *) & ((typecuc *) fullcrumptr)->cwid, widsize(POOM)) && iszerolock((Tumbler *) & ((typecuc *) fullcrumptr)->cdsp, dspsize(POOM));
00864 }

bool islinkcrum typecorecrum crumptr  )  [static]
 

???

(to be defined)

Definition at line 408 of file orglinks.cxx.

References typecorecrumhedr::cdsp, typewid::dsas, typecorecrum, and V.

Referenced by maxtextwid().

00410 {
00411     if (crumptr->cdsp.dsas[V].mantissa[0] == 1 && crumptr->cdsp.dsas[V].mantissa[1] != 0) {
00412 /* if the whold crum is displaced into link space it is a link crum; this is true if the tumbler is a 1.n tumbler where 
00413  * n!= 0 */
00414         return true;
00415     }
00416     return false;
00417 }

typevspanset* ispan2vspanset Session sess,
typeorgl  orgl,
typeispan ispanptr,
typevspanset vspansetptr
 

???

(to be defined)

Parameters:
sess  Input: User's session context

Definition at line 720 of file orglinks.cxx.

References I, permute(), typeispan, typevspanset, and V.

Referenced by restrictvspecsetovercommonispans(), and sporglset2vspanset().

00721                                           : User's session context
00722     typeorgl      orgl,
00723     typeispan    *ispanptr,
00724     typevspanset *vspansetptr)
00725 {
00726     return permute(sess, orgl, ispanptr, I, vspansetptr, V);
00727 }

bool istextcrum typecorecrum crumptr  )  [static]
 

???

(to be defined)

Definition at line 391 of file orglinks.cxx.

References typecorecrumhedr::cdsp, typecorecrumhedr::cwid, typewid::dsas, is1story(), typecorecrum, and V.

Referenced by maxtextwid().

00393 {
00394     if (crumptr->cdsp.dsas[V].mantissa[1] == 0 && is1story(&crumptr->cwid.dsas[V])) {
00395         return true;
00396     }
00397     return false;
00398 }

typevspan* makevspan Session sess,
typevspan spanptr,
typevspan nextspan
[static]
 

???

(to be defined)

Parameters:
sess  Input: User's session context

Definition at line 463 of file orglinks.cxx.

References typespan::itemid, movetumbler, typespan::next, typespan::stream, typevspan, VSPANID, and typespan::width.

Referenced by putvspaninlist().

00464                                        : User's session context
00465     typevspan *spanptr,
00466     typevspan *nextspan)
00467 {
00468     typevspan *ret = new(sess) typevspan;
00469 //    typevspan *ret = (typevspan *) sess->alloc(sizeof(typevspan));
00470 
00471     movetumbler(&spanptr->stream, &ret->stream);
00472     movetumbler(&spanptr->width, &ret->width);
00473 
00474     ret->itemid = VSPANID;
00475     ret->next   = nextspan;
00476 
00477     return ret;
00478 }

void maxtextwid Session sess,
typecorecrum crumptr,
Tumbler voffset,
Tumbler maxwid
[static]
 

???

(to be defined)

Parameters:
sess  Input: User's session context

Definition at line 427 of file orglinks.cxx.

References typecorecrumhedr::cwid, typewid::dsas, findleftson(), findrightbro, islinkcrum(), istextcrum(), tumbleradd, tumblercopy(), tumblermax(), typecorecrum, and V.

Referenced by retrievevspansetpm().

00428                                           : User's session context
00429     typecorecrum *crumptr,
00430     Tumbler      *voffset,
00431     Tumbler      *maxwid)
00432 {
00433     if (istextcrum(crumptr)) {
00434         Tumbler localvoffset;
00435         tumbleradd(voffset, &crumptr->cwid.dsas[V], &localvoffset);
00436 
00437         tumblermax(&localvoffset, maxwid, maxwid);
00438 
00439     } else { // Non-Text CRUM
00440         Tumbler localvoffset;
00441 //        tumbleradd(voffset, &crumptr->cwid.dsas[V], &localvoffset);
00442 //        tumbleradd(voffset, &crumptr->cdsp.dsas[V], &localvoffset);
00443         tumblercopy(voffset, &localvoffset);
00444 
00445         typecorecrum *ptr;
00446         for (ptr = findleftson((typecuc *) crumptr); ptr; ptr = findrightbro(ptr)) {
00447             if (ptr && !islinkcrum(ptr)) // only look for text or overlapping stuff
00448                 maxtextwid(sess, ptr, &localvoffset, maxwid);
00449 
00450 //            tumbleradd(&localvoffset, &ptr->cwid.dsas[V], &localvoffset);
00451         }
00452     }
00453 }

typeitem* onitemlist Session sess,
typeitem itemptr,
typeitemset itemsetptr
 

???

(to be defined)

Parameters:
sess  Input: User's session context

Definition at line 758 of file orglinks.cxx.

References ADDRESSID, assert, checkitem(), debug, ISPANID, movmem, NODEID, NULL, SPORGLID, TEXTID, typeispan, typeitemset, typevspan, VSPANID, and VSPECID.

Referenced by finddocscontainingsp(), and span2spanset().

00759                                          : User's session context
00760     typeitem    *itemptr,
00761     typeitemset *itemsetptr)
00762 {
00763     typeitem *temp, *newitem = NULL;
00764 
00765 /* foo("entering onitemlist\n"); */
00766 #ifndef DISTRIBUTION
00767     if (!itemsetptr)
00768         assert(0); // Null itemsetptr
00769 
00770     if (!itemptr)
00771         assert(0); // Null itemptr
00772 #else
00773     if (!itemsetptr || !itemptr)
00774         assert(0);
00775 #endif
00776 
00777     switch (((typeitemheader *) itemptr)->itemid) {     /* allocate and copy to proper sized item */
00778     case TEXTID:
00779         newitem = (typeitem *) new(sess) typetext;
00780 //        newitem = (typeitem *) sess->alloc(sizeof(typetext));
00781         movmem(itemptr, newitem, sizeof(typetext));
00782         break;
00783 
00784     case ISPANID:
00785         newitem = (typeitem *) new(sess) typeispan;
00786 //        newitem = (typeitem *) sess->alloc(sizeof(typeispan));
00787         movmem(itemptr, newitem, sizeof(typeispan));
00788         break;
00789 
00790     case VSPANID:
00791         newitem = (typeitem *) new(sess) typevspan;
00792 //        newitem = (typeitem *) sess->alloc(sizeof(typevspan));
00793         movmem(itemptr, newitem, sizeof(typevspan));
00794         break;
00795 
00796     case VSPECID:
00797         newitem = (typeitem *) new(sess) typevspec;
00798 //        newitem = (typeitem *) sess->alloc(sizeof(typevspec));
00799         movmem(itemptr, newitem, sizeof(typevspec));
00800         break;
00801 
00802     case NODEID:
00803         newitem = (typeitem *) new(sess) typeboolsetnode;
00804 //        newitem = (typeitem *) sess->alloc(sizeof(typeboolsetnode));
00805         movmem(itemptr, newitem, sizeof(typeboolsetnode));
00806         break;
00807 
00808     case ADDRESSID:                   /* also LINKID */
00809         newitem = (typeitem *) new(sess) typeaddress;
00810 //        newitem = (typeitem *) sess->alloc(sizeof(typeaddress));
00811         movmem(itemptr, newitem, sizeof(typeaddress));
00812         break;
00813 
00814     case SPORGLID:                    /* zzz kluge sporglitem is union * sporgl is struct which should i use * here
00815                                         * i.e. how is this used and set * in fact sporgl happens to be big * member in
00816                                         * union but this is * troubles me REG 1/5/86 */
00817         newitem = (typeitem *) new(sess) typesporglitem;
00818 //        newitem = (typeitem *) sess->alloc(sizeof(typesporglitem));
00819         movmem(itemptr, newitem, sizeof(typesporglitem));
00820         break;
00821 
00822     default:
00823         assert(0); // improper item
00824     }
00825 
00826     ((typeitemheader *) newitem)->next = NULL;
00827     if (*itemsetptr == NULL) {
00828         *itemsetptr = newitem;
00829     } else {
00830 
00831         /* this loop advances the ptr ot the end of the list */
00832         for (temp = *itemsetptr;
00833 #ifndef DISTRIBUTION
00834              checkitem("onitem2.5: ", temp), checkitem("onitem2.75: ", (typeitem *) ((typeitemheader *) temp)->next),
00835 #endif
00836              temp && ((typeitemheader *) temp)->next; temp = (typeitem *) ((typeitemheader *) temp)->next)
00837 
00838 #ifndef DISTRIBUTION
00839             if (debug) {
00840                 checkitem("onitem3: ", temp);
00841             }
00842 #else
00843             ;
00844 #endif
00845 
00846         ((typeitemheader *) temp)->next = (typeitemheader *) newitem;
00847     }
00848 
00849     return newitem;
00850 }

typespanset* permute Session sess,
typeorgl  orgl,
typespanset  restrictionspanset,
int  restrictionindex,
typespanset targspansetptr,
int  targindex
[static]
 

???

(to be defined)

Parameters:
sess  Input: User's session context

Definition at line 682 of file orglinks.cxx.

References foo(), foospanset(), typespan::next, span2spanset(), and typespanset.

Referenced by ispan2vspanset(), and vspanset2ispanset().

00683                                          : User's session context
00684     typeorgl     orgl,
00685     typespanset  restrictionspanset,
00686     int          restrictionindex,
00687     typespanset *targspansetptr,
00688     int          targindex)
00689 {
00690     typespanset *save = targspansetptr;
00691 
00692 #ifndef DISTRIBUTION
00693     foo("entering permute\n");
00694     foospanset("targspanset ", *targspansetptr);
00695     foospanset("restrictionset is ", restrictionspanset);
00696 #endif
00697 
00698 /* consolidatespans(restrictionspanset); foospanset("restrictionset after consolidation is ",restrictionspanset); */
00699 
00700     for (; restrictionspanset; restrictionspanset = restrictionspanset->next) {
00701         targspansetptr = span2spanset(sess, orgl, restrictionspanset, restrictionindex, targspansetptr, targindex);
00702     }
00703 
00704 #ifndef DISTRIBUTION
00705     foospanset("leaving permute\n", *save);
00706 /* checkpointer ("targspansetptr(permute): ", targspansetptr); */
00707 #endif
00708 
00709     return save;
00710 }

void putvspaninlist Session sess,
typevspan spanptr,
typevspanset spansetptr
[static]
 

???

(to be defined)

Parameters:
sess  Input: User's session context

Definition at line 488 of file orglinks.cxx.

References EQUAL, GREATER, LESS, makevspan(), movetumbler, typespan::next, NULL, typespan::stream, tumbleradd, tumblercmp(), tumblersub(), typevspan, typevspanset, and typespan::width.

Referenced by retrievevspansetpm().

00489                                           : User's session context
00490     typevspan    *spanptr,
00491     typevspanset *spansetptr)
00492 {
00493     Tumbler    newspanend, oldspanend;
00494     int        startcmp, endcmp, spancmp;
00495 
00496     typevspan *last = NULL;
00497 
00498     typevspan *ptr = *spansetptr;
00499     if (!ptr) {
00500         *spansetptr = makevspan(sess, spanptr, (typevspan *) NULL);
00501         return;
00502     }
00503 
00504     for (; ptr; last = ptr, ptr = ptr->next) {
00505         tumbleradd(&spanptr->stream, &spanptr->width, &newspanend);
00506         tumbleradd(&ptr->stream, &ptr->width, &oldspanend);
00507 
00508         spancmp = tumblercmp(&spanptr->stream, &oldspanend);
00509         if (!spancmp) {
00510             tumbleradd(&ptr->width, &spanptr->width, &ptr->width);
00511             return;
00512         } else if (spancmp == GREATER)
00513             continue;
00514 
00515         spancmp = tumblercmp(&ptr->stream, &newspanend);
00516         if (!spancmp) {
00517             movetumbler(&spanptr->stream, &ptr->stream);
00518             tumbleradd(&spanptr->width, &ptr->width, &ptr->width);
00519             return;
00520         } else if (spancmp == GREATER) {
00521             if (ptr != *spansetptr)
00522                 last->next = makevspan(sess, spanptr, ptr);
00523             else
00524                 *spansetptr = makevspan(sess, spanptr, ptr);
00525             return;
00526         }
00527 
00528         startcmp = tumblercmp(&spanptr->stream, &ptr->stream);
00529         endcmp = tumblercmp(&newspanend, &oldspanend);
00530         if (startcmp > LESS && endcmp < GREATER)
00531             return;
00532 
00533         switch (startcmp) {
00534         case EQUAL:
00535             if (endcmp == GREATER)
00536                 movetumbler(&spanptr->width, &ptr->width);
00537             return;
00538         case LESS:
00539             movetumbler(&spanptr->stream, &ptr->stream);
00540             if (endcmp == GREATER)
00541                 movetumbler(&spanptr->width, &ptr->width);
00542             else
00543                 tumblersub(&oldspanend, &spanptr->stream, &ptr->width);
00544             break;
00545         case GREATER:
00546             if (endcmp == GREATER) {
00547                 tumblersub(&newspanend, &ptr->stream, &ptr->width);
00548                 return;
00549             }
00550         }
00551     }
00552     last->next = makevspan(sess, spanptr, (typevspan *) NULL);
00553 }

bool rearrangepm Session sess,
Tumbler docisaptr,
typeorgl  docorgl,
typecutseq cutseqptr
 

???

(to be defined)

Parameters:
sess  Input: User's session context

Definition at line 304 of file orglinks.cxx.

References logbertmodified(), rearrangend(), and V.

Referenced by dorearrange().

00305                                         : User's session context
00306     Tumbler    *docisaptr,
00307     typeorgl    docorgl,
00308     typecutseq *cutseqptr)
00309 {
00310     rearrangend((typecuc *) docorgl, cutseqptr, V);
00311     logbertmodified(sess, docisaptr);
00312 
00313     return true;
00314 }

bool retrievedocumentpartofvspanpm Session sess,
typeorgl  orgl,
typevspan vspanptr
 

???

(to be defined)

Parameters:
sess  Input: User's session context

Definition at line 347 of file orglinks.cxx.

References typespan::itemid, movetumbler, typespan::next, NULL, typespan::stream, typevspan, V, VSPANID, and typespan::width.

Referenced by doretrievedocvspanfoo().

00348                                        : User's session context
00349     typeorgl   orgl,
00350     typevspan *vspanptr)
00351 {                                      /* this is a kluge */
00352     vspanptr->next   = NULL;
00353     vspanptr->itemid = VSPANID;
00354 
00355     movetumbler(&((typecuc *) orgl)->cdsp.dsas[V], &vspanptr->stream);
00356     movetumbler(&((typecuc *) orgl)->cwid.dsas[V], &vspanptr->width);
00357 
00358     return true;
00359 }

bool retrievevspanpm Session sess,
typeorgl  orgl,
typevspan vspanptr
 

???

(to be defined)

Parameters:
sess  Input: User's session context

Definition at line 369 of file orglinks.cxx.

References typespan::itemid, movetumbler, typespan::next, NULL, typespan::stream, typevspan, V, VSPANID, and typespan::width.

Referenced by doretrievedocvspan().

00370                                        : User's session context
00371     typeorgl   orgl,
00372     typevspan *vspanptr)
00373 {
00374     vspanptr->next   = NULL;
00375     vspanptr->itemid = VSPANID;
00376 
00377     movetumbler(&((typecuc *) orgl)->cdsp.dsas[V], &vspanptr->stream);
00378     movetumbler(&((typecuc *) orgl)->cwid.dsas[V], &vspanptr->width);
00379 
00380     return true;
00381 }

bool retrievevspansetpm Session sess,
typeorgl  orgl,
typevspanset vspansetptr
 

???

(to be defined)

Parameters:
sess  Input: User's session context

Definition at line 563 of file orglinks.cxx.

References typecorecrumhedr::cdsp, typecorecrumhedr::cwid, typewid::dsas, is1story(), typespan::itemid, Tumbler::mantissa, maxtextwid(), movetumbler, typespan::next, NULL, putvspaninlist(), typespan::stream, tumblerclear, tumblerjustify(), typecorecrum, typevspan, typevspanset, V, VSPANID, and typespan::width.

Referenced by doretrievedocvspanset().

00564                                           : User's session context
00565     typeorgl      orgl,
00566     typevspanset *vspansetptr)
00567 {                                      /* return spans for doc and link part */
00568     typecorecrum *ccptr = (typecorecrum *) orgl;
00569 
00570     *vspansetptr = NULL;
00571     if (is1story(&ccptr->cwid.dsas[V])) {       /* if it is just text return that */
00572         typevspan  vspan;
00573         vspan.next   = NULL;
00574         vspan.itemid = VSPANID;
00575 
00576         movetumbler(&ccptr->cdsp.dsas[V], &vspan.stream);
00577         movetumbler(&ccptr->cwid.dsas[V], &vspan.width);
00578 
00579         putvspaninlist(sess, &vspan, vspansetptr);
00580         return true;
00581 
00582     } else {
00583         /* The link part is simple, just grab the last digit off the wid.  The
00584          * text part we get from a max function that delves into the crums. In
00585          * both cases we have to remove the first digit of the tumbler, the 1
00586          * and hack it around a bit.
00587          */
00588 
00589         typevspan  bytevspan;
00590         bytevspan.next   = NULL;
00591         bytevspan.itemid = VSPANID;
00592 
00593         typevspan  linkvspan;
00594         linkvspan.next   = NULL;
00595         linkvspan.itemid = VSPANID;
00596 
00597         movetumbler(&ccptr->cdsp.dsas[V], &bytevspan.stream);
00598 
00599         Tumbler voffset;
00600         tumblerclear(&voffset);
00601 
00602         Tumbler  maxwid;
00603         tumblerclear(&maxwid);
00604         maxtextwid(sess, ccptr, &voffset, &maxwid);
00605 
00606         movetumbler(&maxwid, &bytevspan.width);
00607 
00608         movetumbler(&ccptr->cdsp.dsas[V], &linkvspan.stream);
00609         linkvspan.stream.mantissa[0] = 2;
00610 
00611         movetumbler(&ccptr->cwid.dsas[V], &linkvspan.width);
00612         linkvspan.width.mantissa[0] = 0;
00613         tumblerjustify(&linkvspan.width);
00614 
00615         putvspaninlist(sess, &bytevspan, vspansetptr);
00616         putvspaninlist(sess, &linkvspan, vspansetptr);
00617 
00618         return true;
00619     }
00620 }

typespanset* span2spanset Session sess,
typeorgl  orgl,
typespanset  restrictionspanptr,
int  restrictionindex,
typespanset targspansetptr,
int  targindex
[static]
 

???

(to be defined)

Parameters:
sess  Input: User's session context

Definition at line 630 of file orglinks.cxx.

References context2span(), contextfree(), foo(), foocontext(), foocontextlist(), typespan::next, ContextBase::nextcontext, NULL, onitemlist(), retrieverestricted(), typeitemset, and typespanset.

Referenced by permute().

00631                                          : User's session context
00632     typeorgl     orgl,
00633     typespanset  restrictionspanptr,
00634     int          restrictionindex,
00635     typespanset *targspansetptr,
00636     int          targindex)
00637 {
00638     typespan foundspan;
00639     typespan *nextptr = NULL;
00640 
00641 #ifndef DISTRIBUTION
00642     foo("entering span2spanset\n");
00643 #endif
00644 
00645     Context *context = retrieverestricted((typecuc *) orgl, restrictionspanptr, restrictionindex, (typespan *) NULL, targindex, (IStreamAddr *) NULL);
00646 
00647 #ifndef DISTRIBUTION
00648     foocontextlist("in sapan2spanset after retrieverestrictec context =", context);
00649 #endif
00650 
00651     Context *c;
00652     for (c = context; c; c = (Context *) c->nextcontext) {
00653 
00654 #ifndef DISTRIBUTION
00655         foocontext("in span2spanset loop  ", c);
00656 #endif
00657 
00658         context2span(c, restrictionspanptr, restrictionindex, &foundspan, targindex);
00659         nextptr = (typespan *) onitemlist(sess, (typeitem *) & foundspan, (typeitemset *) targspansetptr);
00660     }
00661 
00662     if (!context) {
00663         return (targspansetptr);
00664     }
00665 
00666 #ifndef DISTRIBUTION
00667     foocontext("leaving span2spanset returning context = \n", context);
00668 #endif
00669 
00670     contextfree(context);
00671     return &nextptr->next;
00672 }

typeispanset* vspanset2ispanset Session sess,
typeorgl  orgl,
typevspanset  vspanptr,
typeispanset ispansetptr
 

???

(to be defined)

Parameters:
sess  Input: User's session context

Definition at line 737 of file orglinks.cxx.

References I, permute(), typeispanset, typevspanset, and V.

Referenced by specset2ispanset(), and vspanset2sporglset().

00738                                           : User's session context
00739     typeorgl      orgl,
00740     typevspanset  vspanptr,
00741     typeispanset *ispansetptr)
00742 {
00743     return permute(sess, orgl, vspanptr, V, ispansetptr, I);
00744 }


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