Example #1
0
void
wvPutSTSH (STSH * item, U16 cbStshi, wvStream * fd)
{
    U16 i;

    write_16ubit (fd, cbStshi);
    wvPutSTSHI (&(item->Stshi), cbStshi, fd);

    if (item->Stshi.cstd == 0)
	return;

    if (item->std == NULL)
      {
	  wvError (("What the @#*@#*: item->std is null"));
	  return;
      }

    for (i = 0; i < item->Stshi.cstd; i++)
      {
	  write_16ubit (fd, i);	/* TODO: is this right?? i+1?? */
/* TODO *//* wvPutSTD(&(item->std[i]), fd); */
      }

    /* TODO: there must be a setting of styles */
    /* TODO: this probably is not finished */
}
Example #2
0
File: ffn.c Project: AbiWord/wv
void
wvPutFFN (FFN * item, wvStream * fd)
{
    int len, i;
    U8 temp8 = 0;

    write_8ubit (fd, (U8) item->cbFfnM1);

    temp8 |= item->prq;
    temp8 |= item->fTrueType << 2;
    temp8 |= item->reserved1 << 3;
    temp8 |= item->ff << 4;
    temp8 |= item->reserved2 << 7;
    write_8ubit (fd, temp8);

    write_16ubit (fd, (U16) item->wWeight);
    write_8ubit (fd, item->chs);
    write_8ubit (fd, item->ixchSzAlt);

    len = item->cbFfnM1 - 39;
    len = len / 2;
    if (len > 65)
	len = 65;

    for (i = 0; i < len; i++)
	write_16ubit (fd, item->xszFfn[i]);
}
Example #3
0
File: sed.c Project: AbiWord/wv
void
wvPutSED (SED * item, wvStream * fd)
{
    write_16ubit (fd, (U16) item->fn);
    write_32ubit (fd, item->fcSepx);
    write_16ubit (fd, (U16) item->fnMpr);
    write_32ubit (fd, item->fcMpr);
}
Example #4
0
File: picf.c Project: gxf/heigong
U32 wvPutMSOFBH(MSOFBH * amsofbh, wvStream * fd)
{
	if(fd){
		write_16ubit (fd,(U16)((amsofbh->ver & 0x000F)|(amsofbh->inst<<4)));
		write_16ubit (fd,(U16)amsofbh->fbt);
		write_32ubit (fd,(U32)amsofbh->cbLength);
	}
    return (8);
}
Example #5
0
File: atrd.c Project: AbiWord/wv
void
wvPutATRD (ATRD * item, wvStream * fd)
{
    int i;
    for (i = 0; i < 10; i++)
	write_16ubit (fd, item->xstUsrInitl[i]);

    write_16ubit (fd, (U16) item->ibst);
    write_16ubit (fd, item->ak);
    write_16ubit (fd, item->grfbmc);
    write_32ubit (fd, (U32) item->lTagBkmk);
}
Example #6
0
File: bkf.c Project: AbiWord/wv
void
wvPutBKF (BKF * item, wvStream * fd)
{
    U16 temp16 = (U16) 0;

    write_16ubit (fd, (U16) item->ibkl);

    temp16 |= item->itcFirst;
    temp16 |= item->fPub << 7;
    temp16 |= item->itcLim << 8;
    temp16 |= item->fCol << 15;

    write_16ubit (fd, temp16);
}
Example #7
0
File: dttm.c Project: AbiWord/wv
void
wvPutDTTM (DTTM * item, wvStream * fd)
{

    U16 temp16 = (U16) 0;

    temp16 |= item->mint;
    temp16 |= item->hr << 6;
    temp16 |= item->dom << 11;
    write_16ubit (fd, temp16);

    temp16 = (U16) 0;
    temp16 |= item->mon;
    temp16 |= item->yr << 4;
    temp16 |= item->wdy << 13;
    write_16ubit (fd, temp16);
}
Example #8
0
File: generic.c Project: AbiWord/wv
void
wvPutChar (wvStream * fd, U8 chartype, U16 ch)
{
    if (chartype == 1)
	write_8ubit (fd, (U8) ch);
    else
	write_16ubit (fd, ch);
}
Example #9
0
void
wvPutSTSHI (STSHI * item, U16 cbSTSHI, wvStream * fd)
{
    U16 temp16 = 0, count = 0;
    int i;

    write_16ubit (fd, item->cstd);
    write_16ubit (fd, item->cbSTDBaseInFile);

    temp16 |= item->fStdStylenamesWritten;
    temp16 |= item->reserved << 1;
    write_16ubit (fd, temp16);

    write_16ubit (fd, (U16) item->stiMaxWhenSaved);
    write_16ubit (fd, item->istdMaxFixedWhenSaved);
    write_16ubit (fd, item->nVerBuiltInNamesWhenSaved);

    count = 12;			/* add */

    for (i = 0; i < 3; i++)
      {
	  write_16ubit (fd, item->rgftcStandardChpStsh[i]);
	  count += 2;
	  if (count >= cbSTSHI)
	      break;
      }

    while (count < cbSTSHI)
      {
	  count++;
	  write_8ubit (fd, 0);	/* write garbage */
      }
}
Example #10
0
File: brc.c Project: AbiWord/wv
void
wvPutBRC6 (BRC * item, wvStream * fd)
{
    /* non-word8 support */
    U16 temp16 = 0;

    temp16 |= item->dptLineWidth;
    temp16 |= item->brcType << 3;
    temp16 |= item->fShadow << 5;
    temp16 |= item->ico << 6;
    temp16 |= item->dptSpace << 11;

    write_16ubit (fd, temp16);
}
Example #11
0
void
wvPutFBSE(FBSE *item, wvStream *fd) {
    int i;

    write_8ubit(fd, item->btWin32);
    write_8ubit(fd, item->btMacOS);

    for (i = 0; i < 16; i++)
        write_8ubit(fd, item->rgbUid[i]);

    write_16ubit(fd, item->tag);
    write_32ubit(fd, item->size);
    write_32ubit(fd, item->cRef);
    write_32ubit(fd, item->foDelay);
    write_8ubit(fd, item->usage);
    write_8ubit(fd, item->cbName);
    write_8ubit(fd, item->unused2);
    write_8ubit(fd, item->unused3);
}
Example #12
0
File: fspa.c Project: AbiWord/wv
void
wvPutFSPA (FSPA * item, wvStream * fd)
{
    U16 temp16 = (U16) 0;

    write_32ubit (fd, item->spid);
    write_32ubit (fd, (U32) item->xaLeft);
    write_32ubit (fd, (U32) item->yaTop);
    write_32ubit (fd, (U32) item->xaRight);
    write_32ubit (fd, (U32) item->yaBottom);

    temp16 |= item->fHdr;
    temp16 |= item->bx << 1;
    temp16 |= item->by << 3;
    temp16 |= item->wr << 5;
    temp16 |= item->wrk << 9;
    temp16 |= item->fRcaSimple << 13;
    temp16 |= item->fBelowText << 14;
    temp16 |= item->fAnchorLock << 14;
    write_16ubit (fd, temp16);

    write_32ubit (fd, item->cTxbx);
}
Example #13
0
File: fib.c Project: AbiWord/wv
void
wvPutFIB (FIB * item, wvStream * fd)
{
    U16 temp16 = (U16) 0;
    U8 temp8 = (U8) 0;

    write_16ubit (fd, item->nProduct);
    write_16ubit (fd, item->lid);
    write_16ubit (fd, item->pnNext);

    temp16 |= item->fDot;
    temp16 |= item->fGlsy << 1;
    temp16 |= item->fComplex << 2;
    temp16 |= item->fHasPic << 3;
    temp16 |= item->cQuickSaves << 4;
    temp16 |= item->fEncrypted << 8;
    temp16 |= item->fWhichTblStm << 9;
    temp16 |= item->fReadOnlyRecommended << 10;
    temp16 |= item->fWriteReservation << 11;
    temp16 |= item->fExtChar << 12;
    temp16 |= item->fLoadOverride << 13;
    temp16 |= item->fFarEast << 14;
    temp16 |= item->fCrypto << 15;

    /*
       item->fDot = (temp16 & 0x0001);
       item->fGlsy = (temp16 & 0x0002) >> 1;
       item->fComplex = (temp16 & 0x0004) >> 2;
       item->fHasPic = (temp16 & 0x0008) >> 3;
       item->cQuickSaves = (temp16 & 0x00F0) >> 4;
       item->fEncrypted = (temp16 & 0x0100) >> 8;
       item->fWhichTblStm = (temp16 & 0x0200) >> 9;
       item->fReadOnlyRecommended = (temp16 & 0x0400) >> 10;
       item->fWriteReservation = (temp16 & 0x0800) >> 11;
       item->fExtChar = (temp16 & 0x1000) >> 12;
       item->fLoadOverride = (temp16 & 0x2000) >> 13;
       item->fFarEast = (temp16 & 0x4000) >> 14;
       item->fCrypto = (temp16 & 0x8000) >> 15;
     */

    write_16ubit (fd, temp16);

    write_16ubit (fd, (U16) item->nFibBack);
    write_32ubit (fd, item->lKey);
    write_8ubit (fd, (U8) item->envr);

    temp8 |= item->fMac;
    temp8 |= item->fEmptySpecial << 1;
    temp8 |= item->fLoadOverridePage << 2;
    temp8 |= item->fFutureSavedUndo << 3;
    temp8 |= item->fWord97Saved << 4;
    temp8 |= item->fSpare0 << 5;

    /*
       item->fMac = (temp8 & 0x01);
       item->fEmptySpecial = (temp8 & 0x02) >> 1;
       item->fLoadOverridePage = (temp8 & 0x04) >> 2;
       item->fFutureSavedUndo = (temp8 & 0x08) >> 3;
       item->fWord97Saved = (temp8 & 0x10) >> 4;
       item->fSpare0 = (temp8 & 0xFE) >> 5;
     */

    write_8ubit (fd, temp8);

    write_16ubit (fd, (U16) item->chse);
    write_16ubit (fd, item->chsTables);
    write_32ubit (fd, item->fcMin);
    write_32ubit (fd, item->fcMac);
    write_16ubit (fd, item->csw);
    write_16ubit (fd, item->wMagicCreated);
    write_16ubit (fd, item->wMagicRevised);
    write_16ubit (fd, item->wMagicCreatedPrivate);
    write_16ubit (fd, item->wMagicRevisedPrivate);
    write_16ubit (fd, (U16) item->pnFbpChpFirst_W6);
    write_16ubit (fd, (U16) item->pnChpFirst_W6);
    write_16ubit (fd, (U16) item->cpnBteChp_W6);
    write_16ubit (fd, (U16) item->pnFbpPapFirst_W6);
    write_16ubit (fd, (U16) item->pnPapFirst_W6);
    write_16ubit (fd, (U16) item->cpnBtePap_W6);
    write_16ubit (fd, (U16) item->pnFbpLvcFirst_W6);
    write_16ubit (fd, (U16) item->pnLvcFirst);
    write_16ubit (fd, (U16) item->cpnBteLvc);
    write_16ubit (fd, (U16) item->lidFE);
    write_16ubit (fd, (U16) item->clw);

    write_32ubit (fd, (U32) item->cbMac);
    write_32ubit (fd, item->lProductCreated);
    write_32ubit (fd, item->lProductRevised);
    write_32ubit (fd, item->ccpText);
    write_32ubit (fd, (U32) item->ccpFtn);
    write_32ubit (fd, (U32) item->ccpHdr);
    write_32ubit (fd, (U32) item->ccpMcr);
    write_32ubit (fd, (U32) item->ccpAtn);
    write_32ubit (fd, (U32) item->ccpEdn);
    write_32ubit (fd, (U32) item->ccpTxbx);
    write_32ubit (fd, (U32) item->ccpHdrTxbx);
    write_32ubit (fd, (U32) item->pnFbpChpFirst);
    write_32ubit (fd, (U32) item->pnChpFirst);
    write_32ubit (fd, (U32) item->cpnBteChp);
    write_32ubit (fd, (U32) item->pnFbpPapFirst);
    write_32ubit (fd, (U32) item->pnPapFirst);
    write_32ubit (fd, (U32) item->cpnBtePap);
    write_32ubit (fd, (U32) item->pnFbpLvcFirst);
    write_32ubit (fd, (U32) item->pnLvcFirst);
    write_32ubit (fd, (U32) item->cpnBteLvc);
    write_32ubit (fd, (U32) item->fcIslandFirst);
    write_32ubit (fd, (U32) item->fcIslandLim);
    write_16ubit (fd, item->cfclcb);
    write_32ubit (fd, (U32) item->fcStshfOrig);
    write_32ubit (fd, (U32) item->fcStshf);
    write_32ubit (fd, (U32) item->lcbStshf);

    write_32ubit (fd, (U32) item->fcPlcffndRef);
    write_32ubit (fd, item->lcbPlcffndRef);
    write_32ubit (fd, (U32) item->fcPlcffndTxt);
    write_32ubit (fd, item->lcbPlcffndTxt);
    write_32ubit (fd, (U32) item->fcPlcfandRef);
    write_32ubit (fd, item->lcbPlcfandRef);
    write_32ubit (fd, (U32) item->fcPlcfandTxt);
    write_32ubit (fd, item->lcbPlcfandTxt);
    write_32ubit (fd, (U32) item->fcPlcfsed);
    write_32ubit (fd, item->lcbPlcfsed);
    write_32ubit (fd, (U32) item->fcPlcpad);
    write_32ubit (fd, item->lcbPlcpad);
    write_32ubit (fd, (U32) item->fcPlcfphe);
    write_32ubit (fd, item->lcbPlcfphe);
    write_32ubit (fd, (U32) item->fcSttbfglsy);
    write_32ubit (fd, item->lcbSttbfglsy);
    write_32ubit (fd, (U32) item->fcPlcfglsy);
    write_32ubit (fd, item->lcbPlcfglsy);
    write_32ubit (fd, (U32) item->fcPlcfhdd);
    write_32ubit (fd, item->lcbPlcfhdd);
    write_32ubit (fd, (U32) item->fcPlcfbteChpx);
    write_32ubit (fd, item->lcbPlcfbteChpx);
    write_32ubit (fd, (U32) item->fcPlcfbtePapx);
    write_32ubit (fd, item->lcbPlcfbtePapx);
    write_32ubit (fd, (U32) item->fcPlcfsea);
    write_32ubit (fd, item->lcbPlcfsea);
    write_32ubit (fd, (U32) item->fcSttbfffn);
    write_32ubit (fd, item->lcbSttbfffn);
    write_32ubit (fd, (U32) item->fcPlcffldMom);
    write_32ubit (fd, item->lcbPlcffldMom);
    write_32ubit (fd, (U32) item->fcPlcffldHdr);
    write_32ubit (fd, item->lcbPlcffldHdr);
    write_32ubit (fd, (U32) item->fcPlcffldFtn);
    write_32ubit (fd, item->lcbPlcffldFtn);
    write_32ubit (fd, (U32) item->fcPlcffldAtn);
    write_32ubit (fd, item->lcbPlcffldAtn);
    write_32ubit (fd, (U32) item->fcPlcffldMcr);
    write_32ubit (fd, item->lcbPlcffldMcr);
    write_32ubit (fd, (U32) item->fcSttbfbkmk);
    write_32ubit (fd, item->lcbSttbfbkmk);
    write_32ubit (fd, (U32) item->fcPlcfbkf);
    write_32ubit (fd, item->lcbPlcfbkf);
    write_32ubit (fd, (U32) item->fcPlcfbkl);
    write_32ubit (fd, item->lcbPlcfbkl);
    write_32ubit (fd, (U32) item->fcCmds);
    write_32ubit (fd, item->lcbCmds);
    write_32ubit (fd, (U32) item->fcPlcmcr);
    write_32ubit (fd, item->lcbPlcmcr);
    write_32ubit (fd, (U32) item->fcSttbfmcr);
    write_32ubit (fd, item->lcbSttbfmcr);
    write_32ubit (fd, (U32) item->fcPrDrvr);
    write_32ubit (fd, item->lcbPrDrvr);
    write_32ubit (fd, (U32) item->fcPrEnvPort);
    write_32ubit (fd, item->lcbPrEnvPort);
    write_32ubit (fd, (U32) item->fcPrEnvLand);
    write_32ubit (fd, item->lcbPrEnvLand);
    write_32ubit (fd, (U32) item->fcWss);
    write_32ubit (fd, item->lcbWss);
    write_32ubit (fd, (U32) item->fcDop);
    write_32ubit (fd, item->lcbDop);
    write_32ubit (fd, (U32) item->fcSttbfAssoc);
    write_32ubit (fd, item->lcbSttbfAssoc);
    write_32ubit (fd, (U32) item->fcClx);
    write_32ubit (fd, item->lcbClx);
    write_32ubit (fd, (U32) item->fcPlcfpgdFtn);
    write_32ubit (fd, item->lcbPlcfpgdFtn);
    write_32ubit (fd, (U32) item->fcAutosaveSource);
    write_32ubit (fd, item->lcbAutosaveSource);
    write_32ubit (fd, (U32) item->fcGrpXstAtnOwners);
    write_32ubit (fd, item->lcbGrpXstAtnOwners);
    write_32ubit (fd, (U32) item->fcSttbfAtnbkmk);
    write_32ubit (fd, item->lcbSttbfAtnbkmk);
    write_32ubit (fd, (U32) item->fcPlcdoaMom);
    write_32ubit (fd, item->lcbPlcdoaMom);
    write_32ubit (fd, (U32) item->fcPlcdoaHdr);
    write_32ubit (fd, item->lcbPlcdoaHdr);
    write_32ubit (fd, (U32) item->fcPlcspaMom);
    write_32ubit (fd, item->lcbPlcspaMom);
    write_32ubit (fd, (U32) item->fcPlcspaHdr);
    write_32ubit (fd, item->lcbPlcspaHdr);
    write_32ubit (fd, (U32) item->fcPlcfAtnbkf);
    write_32ubit (fd, item->lcbPlcfAtnbkf);
    write_32ubit (fd, (U32) item->fcPlcfAtnbkl);
    write_32ubit (fd, item->lcbPlcfAtnbkl);
    write_32ubit (fd, (U32) item->fcPms);
    write_32ubit (fd, item->lcbPms);
    write_32ubit (fd, (U32) item->fcFormFldSttbs);
    write_32ubit (fd, item->lcbFormFldSttbs);
    write_32ubit (fd, (U32) item->fcPlcfendRef);
    write_32ubit (fd, item->lcbPlcfendRef);
    write_32ubit (fd, (U32) item->fcPlcfendTxt);
    write_32ubit (fd, item->lcbPlcfendTxt);
    write_32ubit (fd, (U32) item->fcPlcffldEdn);
    write_32ubit (fd, item->lcbPlcffldEdn);
    write_32ubit (fd, (U32) item->fcPlcfpgdEdn);
    write_32ubit (fd, item->lcbPlcfpgdEdn);
    write_32ubit (fd, (U32) item->fcDggInfo);
    write_32ubit (fd, item->lcbDggInfo);
    write_32ubit (fd, (U32) item->fcSttbfRMark);
    write_32ubit (fd, item->lcbSttbfRMark);
    write_32ubit (fd, (U32) item->fcSttbCaption);
    write_32ubit (fd, item->lcbSttbCaption);
    write_32ubit (fd, (U32) item->fcSttbAutoCaption);
    write_32ubit (fd, item->lcbSttbAutoCaption);
    write_32ubit (fd, (U32) item->fcPlcfwkb);
    write_32ubit (fd, item->lcbPlcfwkb);
    write_32ubit (fd, (U32) item->fcPlcfspl);
    write_32ubit (fd, item->lcbPlcfspl);
    write_32ubit (fd, (U32) item->fcPlcftxbxTxt);
    write_32ubit (fd, item->lcbPlcftxbxTxt);
    write_32ubit (fd, (U32) item->fcPlcffldTxbx);
    write_32ubit (fd, item->lcbPlcffldTxbx);
    write_32ubit (fd, (U32) item->fcPlcfhdrtxbxTxt);
    write_32ubit (fd, item->lcbPlcfhdrtxbxTxt);
    write_32ubit (fd, (U32) item->fcPlcffldHdrTxbx);
    write_32ubit (fd, item->lcbPlcffldHdrTxbx);
    write_32ubit (fd, (U32) item->fcStwUser);
    write_32ubit (fd, item->lcbStwUser);
    write_32ubit (fd, (U32) item->fcSttbttmbd);
    write_32ubit (fd, item->cbSttbttmbd);
    write_32ubit (fd, (U32) item->fcUnused);
    write_32ubit (fd, item->lcbUnused);
    write_32ubit (fd, (U32) item->fcPgdMother);
    write_32ubit (fd, item->lcbPgdMother);
    write_32ubit (fd, (U32) item->fcBkdMother);
    write_32ubit (fd, item->lcbBkdMother);
    write_32ubit (fd, (U32) item->fcPgdFtn);
    write_32ubit (fd, item->lcbPgdFtn);
    write_32ubit (fd, (U32) item->fcBkdFtn);
    write_32ubit (fd, item->lcbBkdFtn);
    write_32ubit (fd, (U32) item->fcPgdEdn);
    write_32ubit (fd, item->lcbPgdEdn);
    write_32ubit (fd, (U32) item->fcBkdEdn);
    write_32ubit (fd, item->lcbBkdEdn);
    write_32ubit (fd, (U32) item->fcSttbfIntlFld);
    write_32ubit (fd, item->lcbSttbfIntlFld);
    write_32ubit (fd, (U32) item->fcRouteSlip);
    write_32ubit (fd, item->lcbRouteSlip);
    write_32ubit (fd, (U32) item->fcSttbSavedBy);
    write_32ubit (fd, item->lcbSttbSavedBy);
    write_32ubit (fd, (U32) item->fcSttbFnm);
    write_32ubit (fd, item->lcbSttbFnm);
    write_32ubit (fd, (U32) item->fcPlcfLst);
    write_32ubit (fd, item->lcbPlcfLst);
    write_32ubit (fd, (U32) item->fcPlfLfo);
    write_32ubit (fd, item->lcbPlfLfo);
    write_32ubit (fd, (U32) item->fcPlcftxbxBkd);
    write_32ubit (fd, item->lcbPlcftxbxBkd);
    write_32ubit (fd, (U32) item->fcPlcftxbxHdrBkd);
    write_32ubit (fd, item->lcbPlcftxbxHdrBkd);
    write_32ubit (fd, (U32) item->fcDocUndo);
    write_32ubit (fd, item->lcbDocUndo);
    write_32ubit (fd, (U32) item->fcRgbuse);
    write_32ubit (fd, item->lcbRgbuse);
    write_32ubit (fd, (U32) item->fcUsp);
    write_32ubit (fd, item->lcbUsp);
    write_32ubit (fd, (U32) item->fcUskf);
    write_32ubit (fd, item->lcbUskf);
    write_32ubit (fd, (U32) item->fcPlcupcRgbuse);
    write_32ubit (fd, item->lcbPlcupcRgbuse);
    write_32ubit (fd, (U32) item->fcPlcupcUsp);
    write_32ubit (fd, item->lcbPlcupcUsp);
    write_32ubit (fd, (U32) item->fcSttbGlsyStyle);
    write_32ubit (fd, item->lcbSttbGlsyStyle);
    write_32ubit (fd, (U32) item->fcPlgosl);
    write_32ubit (fd, item->lcbPlgosl);
    write_32ubit (fd, (U32) item->fcPlcocx);
    write_32ubit (fd, item->lcbPlcocx);
    write_32ubit (fd, (U32) item->fcPlcfbteLvc);
    write_32ubit (fd, item->lcbPlcfbteLvc);

    write_32ubit (fd, item->ftModified.dwLowDateTime);
    write_32ubit (fd, item->ftModified.dwHighDateTime);

    /* wvGetFILETIME(&(item->ftModified),fd); */

    /* wvPutFILETIME(&(item->ftModified), fd) */

    write_32ubit (fd, (U32) item->fcPlcflvc);
    write_32ubit (fd, item->lcbPlcflvc);
    write_32ubit (fd, (U32) item->fcPlcasumy);
    write_32ubit (fd, item->lcbPlcasumy);
    write_32ubit (fd, (U32) item->fcPlcfgram);
    write_32ubit (fd, item->lcbPlcfgram);
    write_32ubit (fd, (U32) item->fcSttbListNames);
    write_32ubit (fd, item->lcbSttbListNames);
    write_32ubit (fd, (U32) item->fcSttbfUssr);
    write_32ubit (fd, item->lcbSttbfUssr);
}
Example #14
0
void
wvPutSTD (STD * item, U16 len, wvStream * fd)
{
    U16 temp16 = 0;
    U16 i, j;
    int pos;
    int ret = 0;
    U16 count = 0;

    temp16 |= item->sti;
    temp16 |= item->fScratch << 12;
    temp16 |= item->fInvalHeight << 13;
    temp16 |= item->fHasUpe << 14;
    temp16 |= item->fMassCopy << 15;
    write_16ubit (fd, temp16);

    temp16 = 0;
    temp16 |= item->sgc;
    temp16 |= item->istdBase << 4;
    write_16ubit (fd, temp16);

    temp16 = 0;
    temp16 |= item->cupx;
    temp16 |= item->istdNext << 4;
    write_16ubit (fd, temp16);

    write_16ubit (fd, (U16) item->bchUpe);

    count = 8;			/* add */
    pos = 11;
    ret = 1;

    write_8ubit (fd, (U8) len);

    for (i = 0; i < len; i++)
      {
	  /* if (count > 10) */
	  /* write_16ubit(fd, (U16)item->xstzName[i]) */
	  /* else */
	  write_8ubit (fd, (U8) item->xstzName[i]);
	  pos++;
      }

    for (i = 0; i < item->cupx; i++)
      {
	  if ((pos + 1) / 2 != pos / 2)
	    {
		/* eat odd bytes */
		wvStream_offset (fd, -1);	/* TODO: check me */
		pos++;
	    }

	  write_16ubit (fd, item->grupxf[i].cbUPX);
	  pos += 2;

	  if (item->grupxf[i].cbUPX == 0)
	      continue;

	  if ((item->cupx == 1) || ((item->cupx == 2) && (i == 1)))
	    {
		for (j = 0; j < item->grupxf[i].cbUPX; j++)
		  {
		      write_8ubit (fd, item->grupxf[i].upx.chpx.grpprl[j]);
		      pos++;
		  }
	    }
	  else if ((item->cupx == 2) && (i == 0))
	    {
		write_16ubit (fd, item->grupxf[i].upx.papx.istd);
		pos += 2;

		for (j = 0; j < item->grupxf[i].cbUPX - 2; j++)
		  {
		      write_8ubit (fd, item->grupxf[i].upx.papx.grpprl[j]);
		      pos++;
		  }
	    }
	  else
	    {
		/* something is FUBAR -- maybe try to handle it here someday */
		wvError (("Something FUBAR in wbPutSTD"));
	    }
      }

    /* eat odd bytes */
    if ((pos + 1) / 2 != pos / 2)	/* check me */
	wvStream_offset (fd, -1);
}