void wvAddCHPXFromBucket6(CHP *achp, UPXF *upxf, STSH *stsh) { U8 *pointer; U16 i = 0; U8 sprm8; U16 sprm; wvTrace(("cbUPX word 6 is %d\n", upxf->cbUPX)); #ifdef SPRMTEST GET_fprintf_HANDLER() (stderr, "\n"); while (i < upxf->cbUPX) { GET_fprintf_HANDLER() (stderr, "%x (%d) ", *(upxf->upx.chpx.grpprl + i), *(upxf->upx.chpx.grpprl + i)); i++; } GET_fprintf_HANDLER() (stderr, "\n"); i = 0; #endif while (i < upxf->cbUPX) { sprm8 = bread_8ubit(upxf->upx.chpx.grpprl + i, &i); #ifdef SPRMTEST wvError(("chp word 6 sprm is %x (%d)\n", sprm8, sprm8)); #endif sprm = (U16)wvGetrgsprmWord6(sprm8); #ifdef SPRMTEST wvError(("chp word 6 sprm is converted to %x\n", sprm)); #endif pointer = upxf->upx.chpx.grpprl + i; wvApplySprmFromBucket(WORD6, sprm, NULL, achp, NULL, stsh, pointer, &i, NULL); } }
void wvApplyCHPXFromBucket(CHP *achp, CHPX *chpx, STSH *stsh) { U8 *pointer; U16 i = 0; U16 sprm; #ifdef SPRMTEST GET_fprintf_HANDLER() (stderr, "\n"); while (i < chpx->cbGrpprl) { GET_fprintf_HANDLER() (stderr, "%x (%d) ", *(chpx->grpprl + i), *(chpx->grpprl + i)); i++; } GET_fprintf_HANDLER() (stderr, "\n"); i = 0; #endif while (i < chpx->cbGrpprl) { sprm = bread_16ubit(chpx->grpprl + i, &i); wvTrace(("the sprm is %d\n", sprm)); pointer = chpx->grpprl + i; wvApplySprmFromBucket(WORD8, sprm, NULL, achp, NULL, stsh, pointer, &i, NULL); } achp->istd = chpx->istd; }
/* * To apply a UPX.chpx to a UPE.chp, apply the UPX.chpx.grpprl to * UPE.chp. Note that a UPE.chp for a paragraph style should always have * UPE.chp.istd == istdNormalChar. */ void wvAddCHPXFromBucket(CHP *achp, UPXF *upxf, STSH *stsh) { U8 *pointer; U16 i = 0; U16 sprm; #ifdef SPRMTEST GET_fprintf_HANDLER() (stderr, "\n"); while (i < upxf->cbUPX) { GET_fprintf_HANDLER() (stderr, "%x (%d) ", *(upxf->upx.chpx.grpprl + i), *(upxf->upx.chpx.grpprl + i)); i++; } GET_fprintf_HANDLER() (stderr, "\n"); i = 0; #endif while (i + 2 < upxf->cbUPX) { /* is this check sufficient ?? */ sprm = bread_16ubit(upxf->upx.chpx.grpprl + i, &i); #ifdef SPRMTEST wvError(("sprm is %x, i is %d\n", sprm, i)); #endif pointer = upxf->upx.chpx.grpprl + i; wvApplySprmFromBucket(WORD8, sprm, NULL, achp, NULL, stsh, pointer, &i, NULL); } }
int wvAddSEPXFromBucket (SEP * asep, SEPX * item, STSH * stsh) { U8 *pointer; U16 i = 0; U16 sprm; int ret = 0; Sprm RetSprm; #ifdef SPRMTEST fprintf (stderr, "\n"); while (i < item->cb) { fprintf (stderr, "%x (%d) ", *(item->grpprl + i), *(item->grpprl + i)); i++; } fprintf (stderr, "\n"); i = 0; #endif while (i < item->cb - 2) { sprm = bread_16ubit (item->grpprl + i, &i); pointer = item->grpprl + i; RetSprm = wvApplySprmFromBucket (WORD8, sprm, NULL, NULL, asep, stsh, pointer, &i, NULL); if (RetSprm.sgc == sgcSep) ret = 1; } return (ret); }
int wvAddSEPXFromBucket6 (SEP * asep, SEPX * item, STSH * stsh) { U8 *pointer; U16 i = 0; int ret = 0; U8 sprm8; U16 sprm; Sprm RetSprm; #ifdef SPRMTEST fprintf (stderr, "\n"); while (i < item->cb) { fprintf (stderr, "%x (%d) ", *(item->grpprl + i), *(item->grpprl + i)); i++; } fprintf (stderr, "\n"); i = 0; #endif while (i < item->cb) { sprm8 = bread_8ubit (item->grpprl + i, &i); #ifdef SPRMTEST wvError (("sep word 6 sprm is %x (%d)\n", sprm8, sprm8)); #endif sprm = (U16) wvGetrgsprmWord6 (sprm8); #ifdef SPRMTEST wvTrace (("sep word 6 sprm is converted to %x\n", sprm)); #endif pointer = item->grpprl + i; RetSprm = wvApplySprmFromBucket (WORD6, sprm, NULL, NULL, asep, stsh, pointer, &i, NULL); if (RetSprm.sgc == sgcSep) ret = 1; } return (ret); }