Ejemplo n.º 1
0
Archivo: fkp.c Proyecto: AbiWord/wv
int
wvGetIndexFCInFKP_PAPX (PAPX_FKP * fkp, U32 currentfc)
{
    U32 i = 1;			/*was 0, there is something slightly out of sync in the system */
    U8 until = fkp->crun + 1;

    while (i < until)
      {
	  wvTrace (
		   ("current fc is %x, %x, %x\n", currentfc,
		    wvNormFC (fkp->rgfc[i], NULL), fkp->rgfc[i]));
	  if (wvNormFC (fkp->rgfc[i], NULL) == currentfc)
	      return (i);
	  i++;
      }
    /*
       basically read 
       Algorithm to determine paragraph properties for a paragraph &
       Formatted Disk Page for PAPXs, somehow the currentfc sent in was wrong
       or my understanding is !
     */
    wvTrace (("S***e, fix me %x %x\n", currentfc, fkp->rgfc[0]));
    /*return 1 to make things continue on their merry way */
    return (1);
}
Ejemplo n.º 2
0
Archivo: fkp.c Proyecto: AbiWord/wv
U32
wvSearchNextLargestFCCHPX_FKP (CHPX_FKP * fkp, U32 currentfc)
{
    U32 i = 0;
    U8 until = fkp->crun + 1;
    U32 fcTest = 0;


    while (i < until)
      {
	  wvTrace (("searching fkp %x %x\n", currentfc, fkp->rgfc[i]));
	  if ((wvNormFC (fkp->rgfc[i], NULL) <= currentfc)
	      && (wvNormFC (fkp->rgfc[i], NULL) > fcTest))
	      fcTest = wvNormFC (fkp->rgfc[i], NULL);
	  i++;
      }

    /*for the first paragraph return the current pos as the beginning */
    /*
       if (fcTest == 0)
       fcTest = currentfc+1;
     */

    return (fcTest);
}
Ejemplo n.º 3
0
Archivo: fkp.c Proyecto: AbiWord/wv
/*
Using the FC of the character, first search the FKP that describes the
character to find the smallest FC in the rgfc that is larger than the character
FC.
*/
U32
wvSearchNextSmallestFCPAPX_FKP (PAPX_FKP * fkp, U32 currentfc)
{
    U32 i = 0;
    U32 fcTest = 0xffffffffL;
    U8 until = fkp->crun + 1;

    while (i < until)
      {
	  wvTrace (
		   ("Smallest %x, %x %x\n", currentfc,
		    wvNormFC (fkp->rgfc[i], NULL), wvNormFC (fkp->rgfc[i],
							     NULL)));
	  if ((wvNormFC (fkp->rgfc[i], NULL) > currentfc)
	      && (wvNormFC (fkp->rgfc[i], NULL) < fcTest))
	      fcTest = wvNormFC (fkp->rgfc[i], NULL);
	  i++;
      }
    return (fcTest);
}
Ejemplo n.º 4
0
int
wvGetBTE_FromFC(BTE *bte, U32 currentfc, BTE *list, U32 *fcs, int nobte) {
    int i = 0;

    while (i < nobte) {
        if ((currentfc >= wvNormFC(fcs[i], NULL)) &&
            (currentfc < wvNormFC(fcs[i + 1], NULL))) {
            wvTrace(("valid\n"));
            wvCopyBTE(bte, &list[i]);
            return 0;
        }
        i++;
    }
    wvCopyBTE(bte, &list[i - 1]);
    return 0;

    /*
       return(1);
     */
}