diff -Naur --exclude CVS ../abi-current/wv/Makefile.abi wv/Makefile.abi --- ../abi-current/wv/Makefile.abi Fri Jul 28 00:30:46 2000 +++ wv/Makefile.abi Mon Jul 31 18:10:16 2000 @@ -133,8 +133,57 @@ iconv/tis-620.c \ iconv/utf-8.c \ iconv/iconv.c \ + exporter/anld.c \ + exporter/anlv.c \ + exporter/asumy.c \ + exporter/asumyi.c \ + exporter/atrd.c \ + exporter/bkd.c \ + exporter/bkf.c \ + exporter/bkl.c \ + exporter/brc.c \ + exporter/bte.c \ + exporter/bx.c \ + exporter/chp.c \ + exporter/dcs.c \ + exporter/dogrid.c \ + exporter/dop.c \ + exporter/doptypography.c \ + exporter/dttm.c \ + exporter/fbse.c \ + exporter/fdoa.c \ + exporter/ffn.c \ + exporter/fib.c \ + exporter/filetime.c \ + exporter/fld.c \ + exporter/font.c \ + exporter/fopt.c \ + exporter/frd.c \ + exporter/fspa.c \ + exporter/ftxbxs.c \ + exporter/generic.c \ + exporter/lfo.c \ + exporter/lspd.c \ + exporter/lst.c \ + exporter/lvl.c \ + exporter/numrm.c \ + exporter/olst.c \ + exporter/pcd.c \ + exporter/pgd.c \ + exporter/phe.c \ + exporter/prm.c \ + exporter/rr.c \ + exporter/rs.c \ + exporter/sed.c \ + exporter/sep.c \ + exporter/shd.c \ + exporter/stylesheet.c \ + exporter/summary.c \ exporter/support.c \ - exporter/fib.c + exporter/tbd.c \ + exporter/tc.c \ + exporter/tlp.c \ + exporter/wkb.c CFLAGS+= -I. -I./iconv -DCONFIGFILE=\".mswordview\" -DTTFDIR=\"\" -DSYMBOLFONTDIR=\"\" -DPATTERNDIR=\"\" -DWINGDINGFONTDIR=\"\" diff -Naur --exclude CVS ../abi-current/wv/exporter/.#TODO.txt.1.1 wv/exporter/.#TODO.txt.1.1 --- ../abi-current/wv/exporter/.#TODO.txt.1.1 Wed Dec 31 19:00:00 1969 +++ wv/exporter/.#TODO.txt.1.1 Sun Jul 30 20:12:26 2000 @@ -0,0 +1,60 @@ +File Status/Issues/Concerns +--------------------------------------------------------------------------- +anld.c Done +anlv.c Done +asumy.c Done +asumyi.c Done +atrd.c Done +bkd.c Done +bkf.c Done +bkl.c Done +blip.c **TODO** +brc.c Done +bte.c Done +bx.c **TODO** +chp.c **TODO** +clx.c **TODO** +dcs.c Done +dogrid.c Done +dop.c **TODO: putCOPTS() is done, putDOP() is not** +doptypography.c Done +dttm.c Done +escher.c **TODO** +fbse.c **TODO: needs more work** +fdoa.c Done +ffn.c Done +fib.c **TODO: code wvPutFib6()** +filetime.c Done +fkp.c **TODO** +fld.c Done +font.c Done +fopt.c **TODO: CHECK ME** +frd.c Done +fspa.c Done +ftxbxs.c Done +generic.c Done +lfo.c Done +lspd.c Done +lst.c **TODO: Done??** +lvl.c Done +numrm.c Done +olst.c Done +pcd.c Done +pgd.c Done +phe.c **TODO: Done??** +picf.c **TODO: need for embedded graphics** +prm.c Done +rr.c Done +rs.c Done +sed.c Done +sep.c Done +shd.c Done +sprm.c **TODO: do we need to code this?** +sttbf.c **TODO** +stylesheet.c **TODO** +table.c **TODO: BIG!!** +tbd.c Done +tc.c Done +tlp.c Done +wkb.c Done +xst.c **TODO** \ No newline at end of file diff -Naur --exclude CVS ../abi-current/wv/exporter/.#anld.c.1.1 wv/exporter/.#anld.c.1.1 --- ../abi-current/wv/exporter/.#anld.c.1.1 Wed Dec 31 19:00:00 1969 +++ wv/exporter/.#anld.c.1.1 Sun Jul 30 17:27:15 2000 @@ -0,0 +1,52 @@ +void wvPutANLD(version ver,ANLD *item,wvStream *fd) +{ + U8 temp8 = (U8)0; + int i = 0; + + write_8ubit(fd, item->nfc); + write_8ubit(fd, item->cxchTextBefore); + write_8ubit(fd, item->cxchTextAfter); + + temp8 |= item->jc; + temp8 |= item->fPrev << 2; + temp8 |= item->fHang << 3; + temp8 |= item->fSetBold << 4; + temp8 |= item->fSetItalic << 5; + temp8 |= item->fSetSmallCaps << 6; + temp8 |= item->fSetCaps << 7; + write_8ubit(fd, temp8); + + temp8 = (U8)0; /* reset */ + temp8 |= item->fSetStrike; + temp8 |= item->fSetKul << 1; + temp8 |= item->fPrevSpace << 2; + temp8 |= item->fBold << 3; + temp8 |= item->fItalic << 4; + temp8 |= item->fSmallCaps << 5; + temp8 |= item->fCaps << 6; + temp8 |= item->fStrike << 7; + write_8ubit(fd, temp8); + + temp8 = (U8)0; /* reset */ + temp8 |= item->kul; + temp8 |= item->ico << 3; + write_8ubit(fd, temp8); + + write_16ubit(fd, (U16)item->ftc); + write_16ubit(fd, item->iStartAt); + write_16ubit(fd, (U16)item->dxaIndent); + write_16ubit(fd, item->dxaSpace); + write_8ubit(fd, item->fNumber1); + write_8ubit(fd, item->fNumberAcross); + write_8ubit(fd, item->fRestartHdn); + write_8ubit(fd, item->fSpareX); + + for (i=0;i<32;i++) + { + if (ver == WORD8) + write_16ubit(fd, item->rgxch[i]); + else + write_8ubit(fd, item->rgxch[i]); + } + +} diff -Naur --exclude CVS ../abi-current/wv/exporter/.#anlv.c.1.1 wv/exporter/.#anlv.c.1.1 --- ../abi-current/wv/exporter/.#anlv.c.1.1 Wed Dec 31 19:00:00 1969 +++ wv/exporter/.#anlv.c.1.1 Sun Jul 30 17:28:14 2000 @@ -0,0 +1,39 @@ +void wvPutANLV(ANLV *item,wvStream *fd) +{ + U8 temp8 = (U8)0; + + write_8ubit(fd, item->nfc); + write_8ubit(fd, item->cxchTextBefore); + write_8ubit(fd, item->cxchTextAfter); + + temp8 |= item->jc; + temp8 |= item->fPrev << 2; + temp8 |= item->fHang << 3; + temp8 |= item->fSetBold << 4; + temp8 |= item->fSetItalic << 5; + temp8 |= item->fSetSmallCaps << 6; + temp8 |= item->fSetCaps << 7; + write_8ubit(fd, temp8); + + temp8 = (U8)0; + temp8 |= item->fSetStrike; + temp8 |= item->fSetKul << 1; + temp8 |= item->fPrevSpace << 2; + temp8 |= item->fBold << 3; + temp8 |= item->fItalic << 4; + temp8 |= item->fSmallCaps << 5; + temp8 |= item->fCaps << 6; + temp8 |= item->fStrike << 7; + write_8ubit(fd, temp8); + + temp* = (U8)0; + temp8 |= item->kul; + temp8 |= item->ico << 3; + write_8ubit(fd, temp8); + + write_16ubit((U16)item->ftc); + write_16ubit(item->hps); + write_16ubit(item->iStartAt); + write_16ubit(item->dxaIndent); + write_16ubit((U16)item->dxaSpace); +} diff -Naur --exclude CVS ../abi-current/wv/exporter/.#fspa.c.1.1 wv/exporter/.#fspa.c.1.1 --- ../abi-current/wv/exporter/.#fspa.c.1.1 Wed Dec 31 19:00:00 1969 +++ wv/exporter/.#fspa.c.1.1 Sun Jul 30 18:57:40 2000 @@ -0,0 +1,24 @@ +/* no PCLF version */ + +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); + } diff -Naur --exclude CVS ../abi-current/wv/exporter/.#sep.c.1.1 wv/exporter/.#sep.c.1.1 --- ../abi-current/wv/exporter/.#sep.c.1.1 Wed Dec 31 19:00:00 1969 +++ wv/exporter/.#sep.c.1.1 Sun Jul 30 18:12:24 2000 @@ -0,0 +1,14 @@ +void wvPutSEPX(version ver,SEPX *item,wvStream *fd) + { + U16 i = (U16)0; + + write_16ubit(fd, item->cb); + + if (!item->cb) + return; + + for (i=0;icb;i++) + { + write_8ubit(fd, item->grpprl[i]); + } + } diff -Naur --exclude CVS ../abi-current/wv/exporter/.#support.c.1.1 wv/exporter/.#support.c.1.1 --- ../abi-current/wv/exporter/.#support.c.1.1 Wed Dec 31 19:00:00 1969 +++ wv/exporter/.#support.c.1.1 Sun Jul 30 18:26:40 2000 @@ -0,0 +1,131 @@ +#include +#include +#include +#include +#include +#include +#include +#include "config.h" +#include "wv.h" +#include "oledecod.h" + +#include "wvexporter.h" + +#if defined(WORDS_BIGENDIAN) || !defined(MATCHED_TYPE) + + /* TODO: convert from big to little endian */ + + #define TO_LE_32(i) (i) + #define TO_LE_16(i) (i) + #define TO_LE_8(i) (i) + +#else + + /* noop macros for little-endian machines */ + + #define TO_LE_32(i) (i) + #define TO_LE_16(i) (i) + #define TO_LE_8(i) (i) + +#endif + +extern MsOle *ole_file; + +wvDocument* wvDocument_create(const char* filename) + { + wvDocument* ret; + + if(ms_ole_create((MsOle**)(&ret), filename) != MS_OLE_ERR_OK) + { + free(ret); + return(NULL); + } + else + { + ole_file=(MsOle*)ret; + return(ret); + } + } + +wvStream* wvStream_new(wvDocument* ole_file, const char* name) + { + MsOleStream* temp_stream; + wvStream* ret; + ms_ole_stream_open(&temp_stream, ole_file, "/", name, 'w'); + wvStream_libole2_create(&ret, temp_stream); + return(ret); + } + +int write_32ubit(wvStream *in, U32 out) +{ + + guint32 cpy = (guint32)TO_LE_32(out); + int nwr = 0; + + if (in->kind == LIBOLE_STREAM) + { + nwr = (int)in->stream.libole_stream->write(in->stream.libole_stream, (guint8 *)&cpy, 32); + } + else + { + assert(in->kind == FILE_STREAM); + nwr = (int) fwrite(&cpy, sizeof(guint32), 1, in->stream.file_stream); + } + + return nwr; +} + +int write_16ubit(wvStream *in, U16 out) +{ + + guint16 cpy = (guint16)TO_LE_16(out); + int nwr = 0; + + if (in->kind == LIBOLE_STREAM) + { + nwr = (int)in->stream.libole_stream->write(in->stream.libole_stream, (guint8 *)&cpy, 16); + } + else + { + assert(in->kind == FILE_STREAM); + nwr = (int) fwrite(&cpy, sizeof(guint16), 1, in->stream.file_stream); + } + + return nwr; +} + +int write_8ubit(wvStream *in, U8 out) +{ + guint8 cpy = (guint8)TO_LE_8(out); + int nwr = 0; + wvTrace(("About to write 16-bit value")); + + if (in->kind == LIBOLE_STREAM) + { + nwr = (int) in->stream.libole_stream->write(in->stream.libole_stream, (guint8 *)&cpy, 8); + } + else + { + assert(in->kind == FILE_STREAM); + nwr = (int) fwrite(&cpy, sizeof(guint8), 1, in->stream.file_stream); + } + + return nwr; +} + +int wvStream_write(void *ptr, size_t size, size_t nmemb, wvStream *in) +{ + int nwr = 0; + + if (in->kind == LIBOLE_STREAM) + { + nwr = (int) in->stream.libole_stream->write(in->stream.libole_stream, ptr, size * nmemb); + } + else + { + assert(in->kind == FILE_STREAM); + nwr = (int) fwrite(ptr, size, nmemb, in->stream.file_stream); + } + + return nwr; +} diff -Naur --exclude CVS ../abi-current/wv/exporter/TODO.txt wv/exporter/TODO.txt --- ../abi-current/wv/exporter/TODO.txt Mon Jul 31 17:51:05 2000 +++ wv/exporter/TODO.txt Mon Jul 31 18:34:44 2000 @@ -16,7 +16,7 @@ clx.c **TODO** dcs.c Done dogrid.c Done -dop.c **TODO: putCOPTS() is done, putDOP() is not** +dop.c Done doptypography.c Done dttm.c Done escher.c **TODO** @@ -51,7 +51,7 @@ shd.c Done sprm.c **TODO: do we need to code this?** sttbf.c **TODO** -stylesheet.c **TODO** +stylesheet.c **TODO: almost done- fix wvPutSTSH()** table.c **TODO: BIG!!** tbd.c Done tc.c Done diff -Naur --exclude CVS ../abi-current/wv/exporter/anld.c wv/exporter/anld.c --- ../abi-current/wv/exporter/anld.c Mon Jul 31 17:51:05 2000 +++ wv/exporter/anld.c Mon Jul 31 17:59:14 2000 @@ -1,52 +1,55 @@ +#include +#include +#include "wvexporter.h" + void wvPutANLD(version ver,ANLD *item,wvStream *fd) { U8 temp8 = (U8)0; int i = 0; - write_8ubit(fd, item->nfc); - write_8ubit(fd, item->cxchTextBefore); - write_8ubit(fd, item->cxchTextAfter); - - temp8 |= item->jc; - temp8 |= item->fPrev << 2; - temp8 |= item->fHang << 3; - temp8 |= item->fSetBold << 4; - temp8 |= item->fSetItalic << 5; - temp8 |= item->fSetSmallCaps << 6; - temp8 |= item->fSetCaps << 7; - write_8ubit(fd, temp8); - - temp8 = (U8)0; /* reset */ - temp8 |= item->fSetStrike; - temp8 |= item->fSetKul << 1; - temp8 |= item->fPrevSpace << 2; - temp8 |= item->fBold << 3; - temp8 |= item->fItalic << 4; - temp8 |= item->fSmallCaps << 5; - temp8 |= item->fCaps << 6; - temp8 |= item->fStrike << 7; - write_8ubit(fd, temp8); - - temp8 = (U8)0; /* reset */ + write_8ubit(fd, item->nfc); + write_8ubit(fd, item->cxchTextBefore); + write_8ubit(fd, item->cxchTextAfter); + + temp8 |= item->jc; + temp8 |= item->fPrev << 2; + temp8 |= item->fHang << 3; + temp8 |= item->fSetBold << 4; + temp8 |= item->fSetItalic << 5; + temp8 |= item->fSetSmallCaps << 6; + temp8 |= item->fSetCaps << 7; + write_8ubit(fd, temp8); + + temp8 = (U8)0; /* reset */ + temp8 |= item->fSetStrike; + temp8 |= item->fSetKul << 1; + temp8 |= item->fPrevSpace << 2; + temp8 |= item->fBold << 3; + temp8 |= item->fItalic << 4; + temp8 |= item->fSmallCaps << 5; + temp8 |= item->fCaps << 6; + temp8 |= item->fStrike << 7; + write_8ubit(fd, temp8); + + temp8 = (U8)0; /* reset */ temp8 |= item->kul; temp8 |= item->ico << 3; - write_8ubit(fd, temp8); - - write_16ubit(fd, (U16)item->ftc); - write_16ubit(fd, item->iStartAt); - write_16ubit(fd, (U16)item->dxaIndent); - write_16ubit(fd, item->dxaSpace); - write_8ubit(fd, item->fNumber1); - write_8ubit(fd, item->fNumberAcross); - write_8ubit(fd, item->fRestartHdn); - write_8ubit(fd, item->fSpareX); - + write_8ubit(fd, temp8); + + write_16ubit(fd, (U16)item->ftc); + write_16ubit(fd, item->iStartAt); + write_16ubit(fd, (U16)item->dxaIndent); + write_16ubit(fd, item->dxaSpace); + write_8ubit(fd, item->fNumber1); + write_8ubit(fd, item->fNumberAcross); + write_8ubit(fd, item->fRestartHdn); + write_8ubit(fd, item->fSpareX); + for (i=0;i<32;i++) - { + { if (ver == WORD8) - write_16ubit(fd, item->rgxch[i]); + write_16ubit(fd, item->rgxch[i]); else - write_8ubit(fd, item->rgxch[i]); - } - + write_8ubit(fd, item->rgxch[i]); + } } diff -Naur --exclude CVS ../abi-current/wv/exporter/anlv.c wv/exporter/anlv.c --- ../abi-current/wv/exporter/anlv.c Mon Jul 31 17:51:05 2000 +++ wv/exporter/anlv.c Mon Jul 31 18:13:16 2000 @@ -1,3 +1,7 @@ +#include +#include +#include "wvexporter.h" + void wvPutANLV(ANLV *item,wvStream *fd) { U8 temp8 = (U8)0; @@ -26,14 +30,14 @@ temp8 |= item->fStrike << 7; write_8ubit(fd, temp8); - temp* = (U8)0; + temp8 = (U8)0; temp8 |= item->kul; temp8 |= item->ico << 3; write_8ubit(fd, temp8); - write_16ubit((U16)item->ftc); - write_16ubit(item->hps); - write_16ubit(item->iStartAt); - write_16ubit(item->dxaIndent); - write_16ubit((U16)item->dxaSpace); + write_16ubit(fd, (U16)item->ftc); + write_16ubit(fd, item->hps); + write_16ubit(fd, item->iStartAt); + write_16ubit(fd, item->dxaIndent); + write_16ubit(fd, (U16)item->dxaSpace); } diff -Naur --exclude CVS ../abi-current/wv/exporter/asumy.c wv/exporter/asumy.c --- ../abi-current/wv/exporter/asumy.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/asumy.c Mon Jul 31 18:00:57 2000 @@ -1,3 +1,7 @@ +#include +#include +#include "wvexporter.h" + void wvPutASUMY(ASUMY *item,wvStream *fd) { write_32ubit(fd, (U32)item->lLevel); diff -Naur --exclude CVS ../abi-current/wv/exporter/asumyi.c wv/exporter/asumyi.c --- ../abi-current/wv/exporter/asumyi.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/asumyi.c Mon Jul 31 18:13:42 2000 @@ -1,3 +1,7 @@ +#include +#include +#include "wvexporter.h" + void wvPutASUMYI(ASUMYI *asu,wvStream *fd) { U16 temp16 = (U16)0; @@ -9,7 +13,7 @@ temp16 |= asu->reserved << 5; write_16ubit(fd, temp16); - write_16bit(fd, asu->wDlgLevel); - write_16bit(fd, asu->lHighestLevel); - write_16bit(fd, asu->lCurrentLevel); -} \ No newline at end of file + write_16ubit(fd, asu->wDlgLevel); + write_16ubit(fd, asu->lHighestLevel); + write_16ubit(fd, asu->lCurrentLevel); +} diff -Naur --exclude CVS ../abi-current/wv/exporter/atrd.c wv/exporter/atrd.c --- ../abi-current/wv/exporter/atrd.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/atrd.c Mon Jul 31 18:13:59 2000 @@ -1,13 +1,15 @@ -/* do I need to code a wvPutATRD_PLCF?? that would be hard ;-( */ +#include +#include +#include "wvexporter.h" void wvPutATRD(ATRD *item, wvStream *fd) { int i; for(i=0;i<10;i++) - write_16ubit(item->xstUsrInitl[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); -} \ No newline at end of file +} diff -Naur --exclude CVS ../abi-current/wv/exporter/bkd.c wv/exporter/bkd.c --- ../abi-current/wv/exporter/bkd.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/bkd.c Mon Jul 31 18:15:11 2000 @@ -1,20 +1,21 @@ -/* foo */ - +#include +#include +#include "wvexporter.h" void wvPutBKD(BKD *item,wvStream *fd) { U16 temp16 = (U16)0; - write_16ubit(fd, (U16)item->ipgd_itxbs); + write_16ubit(fd, (U16)item->ipgd_itxbxs); write_16ubit(fd, (U16)item->dcpDepend); temp16 |= item->icol; temp16 |= item->fTableBreak << 8; - temp16 |= item->ColumnBreak << 9; + temp16 |= item->fColumnBreak << 9; temp16 |= item->fMarked << 10; - temp16 |= item->Unk << 11; - temp16 |= item->TextOverflow << 12; + temp16 |= item->fUnk << 11; + temp16 |= item->fTextOverflow << 12; temp16 |= item->reserved1 << 13; - write_16ubit(fp, temp16); -} \ No newline at end of file + write_16ubit(fd, temp16); +} diff -Naur --exclude CVS ../abi-current/wv/exporter/bkf.c wv/exporter/bkf.c --- ../abi-current/wv/exporter/bkf.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/bkf.c Mon Jul 31 18:01:43 2000 @@ -1,4 +1,6 @@ -/* I hope that I don't have to write a wvPutBKF_PLCF */ +#include +#include +#include "wvexporter.h" void wvPutBKF(BKF *item,wvStream *fd) { @@ -12,4 +14,4 @@ temp16 |= item->fCol << 15; write_16ubit(fd, temp16); -} \ No newline at end of file +} diff -Naur --exclude CVS ../abi-current/wv/exporter/bkl.c wv/exporter/bkl.c --- ../abi-current/wv/exporter/bkl.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/bkl.c Mon Jul 31 18:01:52 2000 @@ -1,7 +1,8 @@ -/* I hope I don't have to write a wvPutBKL_PCLF!!*/ - +#include +#include +#include "wvexporter.h" void wvPutBKL(BKL *item,wvStream *fd) { write_16ubit(fd, (U16)item->ibkf); -} \ No newline at end of file +} diff -Naur --exclude CVS ../abi-current/wv/exporter/bte.c wv/exporter/bte.c --- ../abi-current/wv/exporter/bte.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/bte.c Mon Jul 31 18:15:55 2000 @@ -1,5 +1,6 @@ -/* again, no PC_LF versions. sorry. */ - +#include +#include +#include "wvexporter.h" void wvPutBTE(BTE *bte,wvStream *fd) { @@ -10,7 +11,7 @@ */ temp32 |= bte->pn; - temp32 |= unused << 22; + temp32 |= bte->unused << 22; write_32ubit(fd, temp32); -} \ No newline at end of file +} diff -Naur --exclude CVS ../abi-current/wv/exporter/bx.c wv/exporter/bx.c --- ../abi-current/wv/exporter/bx.c Sun Jul 30 22:24:06 2000 +++ wv/exporter/bx.c Mon Jul 31 18:02:28 2000 @@ -1,3 +1,5 @@ +#include +#include #include "wvexporter.h" void wvPutBX(BX *item, U8 *page, U16 *pos) diff -Naur --exclude CVS ../abi-current/wv/exporter/chp.c wv/exporter/chp.c --- ../abi-current/wv/exporter/chp.c Sun Jul 30 22:24:06 2000 +++ wv/exporter/chp.c Mon Jul 31 18:02:41 2000 @@ -1,3 +1,5 @@ +#include +#include #include "wvexporter.h" void wvPutCHPX() diff -Naur --exclude CVS ../abi-current/wv/exporter/dcs.c wv/exporter/dcs.c --- ../abi-current/wv/exporter/dcs.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/dcs.c Mon Jul 31 18:03:05 2000 @@ -1,5 +1,6 @@ -/* */ - +#include +#include +#include "wvexporter.h" void wvPutDCS(DCS *item,wvStream *fd) { @@ -10,4 +11,4 @@ temp16 |= item->reserved << 8; write_16ubit(fd, temp16); -} \ No newline at end of file +} diff -Naur --exclude CVS ../abi-current/wv/exporter/dogrid.c wv/exporter/dogrid.c --- ../abi-current/wv/exporter/dogrid.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/dogrid.c Mon Jul 31 18:03:13 2000 @@ -1,4 +1,6 @@ -/* */ +#include +#include +#include "wvexporter.h" void wvPutDOGRID(DOGRID *dog,wvStream *fd) { @@ -15,4 +17,4 @@ temp16 |= dog->fFollowMargins << 15; write_16ubit(fd, temp16); -} \ No newline at end of file +} diff -Naur --exclude CVS ../abi-current/wv/exporter/dop.c wv/exporter/dop.c --- ../abi-current/wv/exporter/dop.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/dop.c Mon Jul 31 18:18:34 2000 @@ -1,7 +1,8 @@ -/* TODO: code wvPutDOP */ +#include +#include +#include "wvexporter.h" - -void wvGetCOPTS(COPTS *item,wvStream *fd) +void wvPutCOPTS(COPTS *item,wvStream *fd) { U16 temp16 = (U16)0; @@ -10,7 +11,7 @@ temp16 |= item->fSuppressSpbfAfterPageBreak << 2; temp16 |= item->fWrapTrailSpaces << 3; temp16 |= item->fMapPrintTextColor << 4; - temp16 |= item->fNoColumnBlalance << 5; + temp16 |= item->fNoColumnBalance << 5; temp16 |= item->fConvMailMergeEsc << 6; temp16 |= item->fSuppressTopSpacing << 7; temp16 |= item->fOrigWordTableRules << 8; @@ -20,4 +21,197 @@ temp16 |= item->reserved << 12; write_16ubit(fd, temp16); -} \ No newline at end of file +} + +void wvPutDOP(version ver, DOP *item, wvStream *fd) +{ + U16 temp16 = 0; + U32 temp32 = 0; + int i; + + temp16 |= item->fFacingPages; + temp16 |= item->fWidowControl<<1; + temp16 |= item->fPMHMainDoc<<2; + temp16 |= item->grfSuppression<<3; + temp16 |= item->fpc<<5; + temp16 |= item->reserved1<<7; + temp16 |= item->grpfIhdt<<8; + write_16ubit(fd, temp16); + + temp16 = 0; + temp16 |= item->rncFtn; + temp16 |= item->nFtn; + write_16ubit(fd, temp16); + + temp16 = 0; + temp16 |= item->fOutlineDirtySave; + temp16 |= item->reserved2<<1; + temp16 |= item->fOnlyMacPics<<8; + temp16 |= item->fOnlyWinPics<<9; + temp16 |= item->fLabelDoc<<10; + temp16 |= item->fHyphCapitals<<11; + temp16 |= item->fAutoHyphen<<12; + temp16 |= item->fFormNoFields<<13; + temp16 |= item->fLinkStyles<<14; + temp16 |= item->fRevMarking<<15; + write_16ubit(fd, temp16); + + temp16 = 0; + temp16 |= item->fBackup; + temp16 |= item->fExactCWords<<1; + temp16 |= item->fPagHidden<<2; + temp16 |= item->fPagResults<<3; + temp16 |= item->fLockAtn<<4; + temp16 |= item->fMirrorMargins<<5; + temp16 |= item->reserved3<<6; + temp16 |= item->fDfltTrueType<<7; + temp16 |= item->fPagSuppressTopSpacing<<8; + temp16 |= item->fProtEnabled<<9; + temp16 |= item->fDispFormFldSel<<10; + temp16 |= item->fRMView<<11; + temp16 |= item->fRMPrint<<12; + temp16 |= item->reserved4<<13; + temp16 |= item->fLockRev<<14; + temp16 |= item->fEmbedFonts<<15; + write_16ubit(fd, temp16); + + wvPutCOPTS(&item->copts, fd); + + write_16ubit(fd, item->dxaTab); + write_16ubit(fd, item->wSpare); + write_16ubit(fd, item->dxaHotZ); + write_16ubit(fd, item->cConsecHypLim); + write_16ubit(fd, item->wSpare2); + + wvPutDTTM(&item->dttmCreated, fd); + wvPutDTTM(&item->dttmRevised, fd); + wvPutDTTM(&item->dttmLastPrint, fd); + + write_16ubit(fd, item->nRevision); + write_32ubit(fd, item->tmEdited); + write_32ubit(fd, item->cWords); + write_32ubit(fd, item->cCh); + write_16ubit(fd, item->cPg); + write_32ubit(fd, item->cParas); + + temp16 = 0; + temp16 |= item->rncEdn; + temp16 |= item->nEdn << 2; + write_16ubit(fd, temp16); + + temp16 = 0; + temp16 |= item->epc; + temp16 |= item->nfcFtnRef << 2; + temp16 |= item->nfcEdnRef<<6; + temp16 |= item->fPrintFormData<<10; + temp16 |= item->fSaveFormData<<11; + temp16 |= item->fShadeFormData<<12; + temp16 |= item->reserved6 << 13; + temp16 |= item->fWCFtnEdn<<15; + write_16ubit(fd, temp16); + + write_32ubit(fd, item->cLines); + write_32ubit(fd, item->cWordsFtnEnd); + write_32ubit(fd, item->cChFtnEdn); + write_16ubit(fd, item->cPgFtnEdn); + write_32ubit(fd, item->cParasFtnEdn); + write_32ubit(fd, item->cLinesFtnEdn); + write_32ubit(fd, item->lKeyProtDoc); + + temp16 = 0; + temp16 |= item->wvkSaved; + temp16 |= item->wScaleSaved << 3; + temp16 |= item->zkSaved << 12; + temp16 |= item->fRotateFontW6 << 14; + temp16 |= item->iGutterPos << 15; + write_16ubit(fd, temp16); + + if(ver == WORD6) + { + /* phew... WORD6 support done */ + return; + } + + temp32 = 0; + temp32 |= item->fNoTabForInd; + temp32 |= item->fNoSpaceRaiseLower<<1; + temp32 |= item->fSuppressSpbfAfterPageBreak<<2; + temp32 |= item->fWrapTrailSpaces<<3; + temp32 |= item->fMapPrintTextColor<<4; + temp32 |= item->fNoColumnBalance<<5; + temp32 |= item->fConvMailMergeEsc<<6; + temp32 |= item->fSuppressTopSpacing<<7; + temp32 |= item->fOrigWordTableRules<<8; + temp32 |= item->fTransparentMetafiles<<9; + temp32 |= item->fShowBreaksInFrames<<10; + temp32 |= item->fSwapBordersFacingPgs<<11; + temp32 |= item->reserved7<<12; + temp32 |= item->fSuppressTopSpacingMac5<<16; + temp32 |= item->fTruncDxaExpand<<17; + temp32 |= item->fPrintBodyBeforeHdr<<18; + temp32 |= item->fNoLeading<<19; + temp32 |= item->reserved8<<20; + temp32 |= item->fMWSmallCaps<<21; + temp32 |= item->reserved9<<22; + write_32ubit(fd, temp32); + + if(ver == WORD7) + { + /* Hehe: WORD7 support is done */ + return; + } + + /* onto WORD8 */ + write_16ubit(fd, item->adt); + wvPutDOPTYPOGRAPHY(&item->doptypography, fd); + wvPutDOGRID(&item->dogrid, fd); + + temp16 = 0; + temp16 |= item->reserved10; + temp16 |= item->lvl<<1; + temp16 |= item->fGramAllDone<<5; + temp16 |= item->fGramAllClean<<6; + temp16 |= item->fSubsetFonts<<7; + temp16 |= item->fHideLastVersion<<8; + temp16 |= item->fHtmlDoc<<9; + temp16 |= item->reserved11<<10; + temp16 |= item->fSnapBorder<<11; + temp16 |= item->fIncludeHeader<<12; + temp16 |= item->fIncludeFooter<<13; + temp16 |= item->fForcePageSizePag<<14; + temp16 |= item->fMinFontSizePag<<15; + write_16ubit(fd, temp16); + + temp16 = 0; + temp16 |= item->fHaveVersions; + temp16 |= item->fAutoVersion << 1; + temp16 |= item->reserved11; + write_16ubit(fd, temp16); + + wvPutASUMYI(&item->asumyi, fd); + + write_32ubit(fd, item->cChWS); + write_32ubit(fd, item->cChWSFtnEdn); + write_32ubit(fd, item->grfDocEvents); + + temp32 = 0; + temp32 |= item->fVirusPrompted; + temp32 |= item->fVirusLoadSafe << 1; + temp32 |= item->KeyVirusSession30 << 2; + write_32ubit(fd, temp32); + + for(i=0;i<30;i++) + write_8ubit(fd, item->Spare[i]); + + write_32ubit(fd, item->reserved12); + write_32ubit(fd, item->reserved13); + write_32ubit(fd, item->cDBC); + write_32ubit(fd, item->cDBCFtnEdn); + write_32ubit(fd, item->reserved14); + write_16ubit(fd, item->new_nfcFtnRef); + write_16ubit(fd, item->new_nfcEdnRef); + write_16ubit(fd, item->hpsZoonFontPag); + write_16ubit(fd, item->dywDispPag); + + /* eat my shorts Word8 */ +} diff -Naur --exclude CVS ../abi-current/wv/exporter/doptypography.c wv/exporter/doptypography.c --- ../abi-current/wv/exporter/doptypography.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/doptypography.c Mon Jul 31 18:19:11 2000 @@ -1,20 +1,25 @@ -void wvPuttDOPTYPOGRAPHY(DOPTYPOGRAPHY *dopt,wvStream *fd) - { - int i = 0; - U16 temp16 = (U16)0; +#include +#include +#include "wvexporter.h" - temp16 |= dopt->fKerningPunct; - temp16 |= dopt->iJustification << 1; - temp16 |= dopt->iLevelOfKinsoku << 3; - temp16 |= dopt->f2on1 << 5; - temp16 |= dopt->reserved << 6; - - write_16ubit(fd, temp16); - write_16ubit(fd, dopt->cchFollowingPunct); - write_16ubit(fd, dopt->cchLeadingPunct); - - for (i=0;i<101;i++) - write_16ubit(fd, dopt->rgxchFPunct); - - for (i=0;i<51;i++) - write_16ubit(fd, \ No newline at end of file +void wvPutDOPTYPOGRAPHY(DOPTYPOGRAPHY *dopt,wvStream *fd) +{ + int i = 0; + U16 temp16 = (U16)0; + + temp16 |= dopt->fKerningPunct; + temp16 |= dopt->iJustification << 1; + temp16 |= dopt->iLevelOfKinsoku << 3; + temp16 |= dopt->f2on1 << 5; + temp16 |= dopt->reserved << 6; + + write_16ubit(fd, temp16); + write_16ubit(fd, dopt->cchFollowingPunct); + write_16ubit(fd, dopt->cchLeadingPunct); + + for (i=0;i<101;i++) + write_16ubit(fd, dopt->rgxchFPunct[i]); + + for (i=0;i<51;i++) + write_16ubit(fd, dopt->rgxchLPunct[i]); +} diff -Naur --exclude CVS ../abi-current/wv/exporter/dttm.c wv/exporter/dttm.c --- ../abi-current/wv/exporter/dttm.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/dttm.c Mon Jul 31 18:00:17 2000 @@ -1,5 +1,8 @@ +#include +#include +#include "wvexporter.h" -void wvGetDTTM(DTTM *item,wvStream *fd) +void wvPutDTTM(DTTM *item,wvStream *fd) { U16 temp16 = (U16)0; @@ -24,4 +27,4 @@ dest->mon = src->tm_mon + 1; dest->yr = src->tm_year; dest->wdy = src->tm_wday; -} \ No newline at end of file +} diff -Naur --exclude CVS ../abi-current/wv/exporter/fdoa.c wv/exporter/fdoa.c --- ../abi-current/wv/exporter/fdoa.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/fdoa.c Mon Jul 31 18:03:46 2000 @@ -1,4 +1,6 @@ -/* no PCLF */ +#include +#include +#include "wvexporter.h" void wvPutFDOA(FDOA *item,wvStream *fd) { diff -Naur --exclude CVS ../abi-current/wv/exporter/ffn.c wv/exporter/ffn.c --- ../abi-current/wv/exporter/ffn.c Sun Jul 30 22:24:06 2000 +++ wv/exporter/ffn.c Mon Jul 31 18:19:54 2000 @@ -2,7 +2,7 @@ #include #include "wvexporter.h" -void wvGetFFN6(FFN *item, wvStream *fd) +void wvPutFFN6(FFN *item, wvStream *fd) { int len, i; U8 temp8 = 0; @@ -26,12 +26,12 @@ write_8ubit(fd, item->xszFfn[i]); } -void wvGetFFN(FFN *item, wvStream *fd) +void wvPutFFN(FFN *item, wvStream *fd) { int len, i; U8 temp8 = 0; - write_8ubit(fd, item->cvFfnM1); + write_8ubit(fd, item->cbFfnM1); temp8 |= item->prq; temp8 |= item->fTrueType << 2; diff -Naur --exclude CVS ../abi-current/wv/exporter/fib.c wv/exporter/fib.c --- ../abi-current/wv/exporter/fib.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/fib.c Mon Jul 31 18:48:44 2000 @@ -269,7 +269,7 @@ item->lcbSttbfUssr = 0; } -int wvPutFIB(FIB *item, wvStream *fd) +void wvPutFIB(FIB *item, wvStream *fd) { U16 temp16 = (U16)0; U8 temp8 = (U8)0; @@ -568,4 +568,4 @@ write_32ubit(fd,item->lcbSttbListNames); write_32ubit(fd,(U32)item->fcSttbfUssr); write_32ubit(fd,item->lcbSttbfUssr); - } \ No newline at end of file + } diff -Naur --exclude CVS ../abi-current/wv/exporter/filetime.c wv/exporter/filetime.c --- ../abi-current/wv/exporter/filetime.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/filetime.c Mon Jul 31 18:04:18 2000 @@ -1,7 +1,9 @@ -/* filetime.c */ +#include +#include +#include "wvexporter.h" void wvPutFILETIME(FILETIME *ft,wvStream *fd) { write_32ubit(fd, ft->dwLowDateTime); write_32ubit(fd, ft->dwHighDateTime); - } \ No newline at end of file + } diff -Naur --exclude CVS ../abi-current/wv/exporter/fld.c wv/exporter/fld.c --- ../abi-current/wv/exporter/fld.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/fld.c Mon Jul 31 18:04:34 2000 @@ -1,3 +1,7 @@ +#include +#include +#include "wvexporter.h" + void wvPutFLD(FLD *item,wvStream *fd) { U8 temp8 = (U8)0; @@ -32,4 +36,4 @@ temp8 |= item->var2.fHasSep << 7; write_8ubit(fd, temp8); } - } \ No newline at end of file + } diff -Naur --exclude CVS ../abi-current/wv/exporter/font.c wv/exporter/font.c --- ../abi-current/wv/exporter/font.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/font.c Mon Jul 31 18:04:43 2000 @@ -1,5 +1,6 @@ -/* font.c */ - +#include +#include +#include "wvexporter.h" void wvPutFONTSIGNATURE(FONTSIGNATURE *fs,wvStream *fd) { @@ -22,4 +23,4 @@ write_8ubit(fd, item->bLetterform); write_8ubit(fd, item->bMidline); write_8ubit(fd, item->bXHeight); - } \ No newline at end of file + } diff -Naur --exclude CVS ../abi-current/wv/exporter/fopt.c wv/exporter/fopt.c --- ../abi-current/wv/exporter/fopt.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/fopt.c Mon Jul 31 18:20:46 2000 @@ -1,3 +1,7 @@ +#include +#include +#include "wvexporter.h" + void wvPutFAnchor(FAnchor *item,wvStream *fd) { /* It is supposed to be a RECT, but its only 4 long so... */ @@ -24,7 +28,7 @@ void wvPutFOPTEArray(FOPTE **fopte,MSOFBH *msofbh,wvStream *fd) { U32 i,j,count=0; - no=0; + U32 no=0; while (count < msofbh->cbLength) { @@ -39,4 +43,4 @@ for(j=0;j<(*fopte)[i].op;j++) write_8ubit(fd, (*fopte)[i].entry[j]); } - } \ No newline at end of file + } diff -Naur --exclude CVS ../abi-current/wv/exporter/frd.c wv/exporter/frd.c --- ../abi-current/wv/exporter/frd.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/frd.c Mon Jul 31 18:04:58 2000 @@ -1,7 +1,8 @@ -/* no PCLF version */ - +#include +#include +#include "wvexporter.h" void wvPutFRD(FRD *item,wvStream *fd) { write_16ubit(fd,(U16)item->frd); - } \ No newline at end of file + } diff -Naur --exclude CVS ../abi-current/wv/exporter/fspa.c wv/exporter/fspa.c --- ../abi-current/wv/exporter/fspa.c Mon Jul 31 17:51:05 2000 +++ wv/exporter/fspa.c Mon Jul 31 18:05:06 2000 @@ -1,4 +1,6 @@ -/* no PCLF version */ +#include +#include +#include "wvexporter.h" void wvPutFSPA(FSPA *item,wvStream *fd) { diff -Naur --exclude CVS ../abi-current/wv/exporter/ftxbxs.c wv/exporter/ftxbxs.c --- ../abi-current/wv/exporter/ftxbxs.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/ftxbxs.c Mon Jul 31 18:21:43 2000 @@ -1,12 +1,13 @@ -/* no PCLF version */ - +#include +#include +#include "wvexporter.h" void wvPutFTXBXS(FTXBXS *item,wvStream *fd) { write_32ubit(fd, (U32)item->cTxbx_iNextReuse); - write_32ubit(fd, (U32)item->cReuseable); + write_32ubit(fd, (U32)item->cReusable); write_16ubit(fd, (U16)item->fReusable); write_32ubit(fd, (U32)item->reserved); write_32ubit(fd, (U32)item->lid); write_32ubit(fd, (U32)item->txidUndo); - } \ No newline at end of file + } diff -Naur --exclude CVS ../abi-current/wv/exporter/generic.c wv/exporter/generic.c --- ../abi-current/wv/exporter/generic.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/generic.c Mon Jul 31 18:05:20 2000 @@ -1,3 +1,7 @@ +#include +#include +#include "wvexporter.h" + void wvPutChar(wvStream *fd,U8 chartype, U16 ch) { if (chartype == 1) diff -Naur --exclude CVS ../abi-current/wv/exporter/lfo.c wv/exporter/lfo.c --- ../abi-current/wv/exporter/lfo.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/lfo.c Mon Jul 31 18:22:09 2000 @@ -1,5 +1,6 @@ - -/* no PCLF */ +#include +#include +#include "wvexporter.h" void wvPutLFO(LFO *item,wvStream *fd) { @@ -7,9 +8,9 @@ write_32ubit(fd, item->lsid); write_32ubit(fd, item->reserved1); - write_32ubit(fd, item->rederved2); + write_32ubit(fd, item->reserved2); write_8ubit(fd, item->clfolvl); for(i=0;i<3;i++) write_8ubit(fd, item->reserved3[i]); - } \ No newline at end of file + } diff -Naur --exclude CVS ../abi-current/wv/exporter/lst.c wv/exporter/lst.c --- ../abi-current/wv/exporter/lst.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/lst.c Mon Jul 31 18:22:38 2000 @@ -1,21 +1,22 @@ - -/* TODO: no PCLF or plain LST support */ +#include +#include +#include "wvexporter.h" void wvPutLSTF(LSTF *item,wvStream *fd) - { - int i; - U8 temp8 = (U8)0; - - write_32ubit(fd, item->lsid); - write_32ubit(fd, item->tplc); - - for (i=0;i<9;i++) - write_16ubit(fd, item->rgistd[i]); - - temp8 |= item->fSimpleList; - temp8 |= item->fRestartHdn << 1; - temp8 |= item->reserved1 << 2; - //temp8 |= item->reserved2; - write_8ubit(fd, temp8); - write_8ubit(fd, item->reserved2); - } \ No newline at end of file +{ + int i; + U8 temp8 = (U8)0; + + write_32ubit(fd, item->lsid); + write_32ubit(fd, item->tplc); + + for (i=0;i<9;i++) + write_16ubit(fd, item->rgistd[i]); + + temp8 |= item->fSimpleList; + temp8 |= item->fRestartHdn << 1; + temp8 |= item->reserved1 << 2; + /* temp8 |= item->reserved2; */ + write_8ubit(fd, temp8); + write_8ubit(fd, item->reserved2); +} diff -Naur --exclude CVS ../abi-current/wv/exporter/lvl.c wv/exporter/lvl.c --- ../abi-current/wv/exporter/lvl.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/lvl.c Mon Jul 31 18:06:00 2000 @@ -1,3 +1,6 @@ +#include +#include +#include "wvexporter.h" void wvPutVLF(LVLF *item,wvStream *fd) { @@ -26,4 +29,4 @@ write_8ubit(fd, item->cbGrpprlChpx); write_8ubit(fd, item->cbGrpprlPapx); write_16ubit(fd, item->reserved2); - } \ No newline at end of file + } diff -Naur --exclude CVS ../abi-current/wv/exporter/numrm.c wv/exporter/numrm.c --- ../abi-current/wv/exporter/numrm.c Sun Jul 30 22:24:06 2000 +++ wv/exporter/numrm.c Mon Jul 31 18:23:08 2000 @@ -10,7 +10,7 @@ write_8ubit(fd, item->Spare1); write_16ubit(fd, (U16)item->ibstNumRM); - wvPutDTTM(item->dttmNumRM, fd); + wvPutDTTM(&item->dttmNumRM, fd); for(i=0;i<9;i++) write_8ubit(fd, item->rgbxchNums[i]); diff -Naur --exclude CVS ../abi-current/wv/exporter/olst.c wv/exporter/olst.c --- ../abi-current/wv/exporter/olst.c Sun Jul 30 22:24:06 2000 +++ wv/exporter/olst.c Mon Jul 31 18:23:44 2000 @@ -1,12 +1,12 @@ #include #include -#include "wvexport.h" +#include "wvexporter.h" void wvPutOLST(OLST *item, wvStream *fd) { U8 i; for(i=0;i<9;i++) - wvPutANLV(fd, item->rganlv[i]); + wvPutANLV(&item->rganlv[i], fd); write_8ubit(fd, item->fRestartHdr); write_8ubit(fd, item->fSpareOlst2); diff -Naur --exclude CVS ../abi-current/wv/exporter/pcd.c wv/exporter/pcd.c --- ../abi-current/wv/exporter/pcd.c Sun Jul 30 22:24:06 2000 +++ wv/exporter/pcd.c Mon Jul 31 18:24:00 2000 @@ -15,5 +15,5 @@ write_8ubit(fd, item->fn); write_32ubit(fd, item->fc); - wvPutPRM(item->prm, fd); + wvPutPRM(&item->prm, fd); } diff -Naur --exclude CVS ../abi-current/wv/exporter/pgd.c wv/exporter/pgd.c --- ../abi-current/wv/exporter/pgd.c Sun Jul 30 22:24:06 2000 +++ wv/exporter/pgd.c Mon Jul 31 18:24:32 2000 @@ -8,7 +8,7 @@ temp16 |= item->fContinue; temp16 |= item->fUnk << 1; - temp16 |= item->fRight MM 2; + temp16 |= item->fRight << 2; temp16 |= item->fPgnRestart << 3; temp16 |= item->fEmptyPage << 4; temp16 |= item->fAllFtn << 5; @@ -20,7 +20,7 @@ temp16 |= item->fNewPage << 11; temp16 |= item->bkc << 12; - write_16ubit(temp16); + write_16ubit(fd, temp16); write_16ubit(fd, item->lnn); write_16ubit(fd, item->pgn); diff -Naur --exclude CVS ../abi-current/wv/exporter/rr.c wv/exporter/rr.c --- ../abi-current/wv/exporter/rr.c Sun Jul 30 22:24:06 2000 +++ wv/exporter/rr.c Mon Jul 31 18:24:55 2000 @@ -1,7 +1,9 @@ +#include +#include #include "wvexporter.h" void wvPutRR(RR *item, wvStream *fd) { - write_16ubit(fd, (U16)item->cv); - write_16ubit(fd, (U16)item->cvSzRecip); + write_16ubit(fd, (U16)item->cb); + write_16ubit(fd, (U16)item->cbSzRecip); } diff -Naur --exclude CVS ../abi-current/wv/exporter/rs.c wv/exporter/rs.c --- ../abi-current/wv/exporter/rs.c Sun Jul 30 22:24:06 2000 +++ wv/exporter/rs.c Mon Jul 31 18:06:41 2000 @@ -1,3 +1,5 @@ +#include +#include #include "wvexporter.h" void wvPutRS(RS *item, wvStream *fd) diff -Naur --exclude CVS ../abi-current/wv/exporter/sep.c wv/exporter/sep.c --- ../abi-current/wv/exporter/sep.c Mon Jul 31 17:51:06 2000 +++ wv/exporter/sep.c Mon Jul 31 18:06:49 2000 @@ -1,3 +1,7 @@ +#include +#include +#include "wvexporter.h" + void wvPutSEPX(version ver,SEPX *item,wvStream *fd) { U16 i = (U16)0; diff -Naur --exclude CVS ../abi-current/wv/exporter/stylesheet.c wv/exporter/stylesheet.c --- ../abi-current/wv/exporter/stylesheet.c Wed Dec 31 19:00:00 1969 +++ wv/exporter/stylesheet.c Mon Jul 31 18:36:12 2000 @@ -0,0 +1,147 @@ +#include +#include +#include "wvexporter.h" + +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, 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(countsti; + 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, item->bchUpe); + + count = 8; /* add */ + pos = 11; + ret = 1; + + write_8ubit(fd, (U8)len); + + for(i=0;ixstzName[i]); + pos++; + } + + for(i=0;icupx;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; jgrupxf[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;jgrupxf[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); +} + +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;iStshi.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 */ +} + diff -Naur --exclude CVS ../abi-current/wv/exporter/summary.c wv/exporter/summary.c --- ../abi-current/wv/exporter/summary.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/summary.c Mon Jul 31 18:07:05 2000 @@ -1,5 +1,6 @@ -/* summary.c */ - +#include +#include +#include "wvexporter.h" void wvPutPropHeader(PropHeader *header,wvStream *file) { @@ -52,4 +53,4 @@ for (i=0;icBytes - 8*si->cProps;i++) write_8ubit(file, si->data[i]); } - } \ No newline at end of file + } diff -Naur --exclude CVS ../abi-current/wv/exporter/support.c wv/exporter/support.c --- ../abi-current/wv/exporter/support.c Mon Jul 31 17:51:06 2000 +++ wv/exporter/support.c Mon Jul 31 20:59:21 2000 @@ -15,9 +15,20 @@ /* TODO: convert from big to little endian */ - #define TO_LE_32(i) (i) - #define TO_LE_16(i) (i) - #define TO_LE_8(i) (i) +/* Basic bit swapping functions from Glib + */ + +#define TO_LE_16(val) ((U16) ( \ + (((U16) (val) & (U16) 0x00ffU) << 8) | \ + (((U16) (val) & (U16) 0xff00U) >> 8))) + +#define TO_LE_32(val) ((U32) ( \ + (((U32) (val) & (U32) 0x000000ffU) << 24) | \ + (((U32) (val) & (U32) 0x0000ff00U) << 8) | \ + (((U32) (val) & (U32) 0x00ff0000U) >> 8) | \ + (((U32) (val) & (U32) 0xff000000U) >> 24))) + +#define TO_LE_8(val) (val) #else diff -Naur --exclude CVS ../abi-current/wv/exporter/tc.c wv/exporter/tc.c --- ../abi-current/wv/exporter/tc.c Sun Jul 30 22:24:06 2000 +++ wv/exporter/tc.c Mon Jul 31 18:35:32 2000 @@ -2,10 +2,9 @@ #include #include "wvexporter.h" -void wvPutTC(TC *tc, wvStream *fd) +void wvPutTC(TC *item, wvStream *fd) { - U16 temp16; - BRC10 brc10; + U16 temp16 = 0; /* assumes word8 */ temp16 |= item->fFirstMerged; @@ -21,8 +20,8 @@ write_16ubit(fd, item->wUnused); - wvPutBRC(item->brcTop, fd); - wvPutBRC(item->brcLeft, fd); - wvPutBRC(item->brcBottom, fd); - wvPutBRC(item->brcRight, fd); + wvPutBRC(&item->brcTop, fd); + wvPutBRC(&item->brcLeft, fd); + wvPutBRC(&item->brcBottom, fd); + wvPutBRC(&item->brcRight, fd); } diff -Naur --exclude CVS ../abi-current/wv/exporter/wkb.c wv/exporter/wkb.c --- ../abi-current/wv/exporter/wkb.c Fri Jul 28 00:30:46 2000 +++ wv/exporter/wkb.c Mon Jul 31 18:07:23 2000 @@ -1,3 +1,7 @@ +#include +#include +#include "wvexporter.h" + void wvPutWKB(WKB *item,wvStream *fd) { U16 temp16 = (U16)0; @@ -11,4 +15,4 @@ write_16ubit(fd, temp16); write_16ubit(fd, item->doc); - } \ No newline at end of file + } diff -Naur --exclude CVS ../abi-current/wv/exporter/wvexporter.h wv/exporter/wvexporter.h --- ../abi-current/wv/exporter/wvexporter.h Fri Jul 28 00:30:46 2000 +++ wv/exporter/wvexporter.h Mon Jul 31 18:49:02 2000 @@ -22,9 +22,69 @@ void wvInitFIBForExport(FIB *item); -int wvPutFIB(FIB *item, wvStream *fd); - - +void wvPutFIB(FIB *item, wvStream *fd); +void wvPutDOP(version ver, DOP *item, wvStream *fd); +void wvPutANLD(version ver,ANLD *item,wvStream *fd); +void wvPutANLV(ANLV *item,wvStream *fd); +void wvPutANLV(ANLV *item,wvStream *fd); +void wvPutASUMYI(ASUMYI *asu,wvStream *fd); +void wvPutATRD(ATRD *item, wvStream *fd); +void wvPutBKD(BKD *item,wvStream *fd); +void wvPutBKF(BKF *item,wvStream *fd); +void wvPutBKL(BKL *item,wvStream *fd); +void wvPutBRC10(BRC *item, wvStream *fd); +void wvPutBRC6(BRC *item, wvStream *fd); +void wvPutBRC(BRC *item, wvStream *fd); +void wvPutBTE(BTE *bte,wvStream *fd); +void wvPutBX(BX *item, U8 *page, U16 *pos); +void wvPutBX6(BX *item, U8 *page, U16 *pos); +void wvPutDCS(DCS *item,wvStream *fd); +void wvPutDOGRID(DOGRID *dog,wvStream *fd); +void wvPutCOPTS(COPTS *item,wvStream *fd); +void wvPutDOPTYPOGRAPHY(DOPTYPOGRAPHY *dopt,wvStream *fd); +void wvPutDTTM(DTTM *item,wvStream *fd); +void wvUnixToDTTM(struct tm * src, DTTM * dest); +void wvPutFBSE(FBSE *item, wvStream *fd); +void wvPutFDOA(FDOA *item,wvStream *fd); +void wvPutFFN6(FFN *item, wvStream *fd); +void wvPutFFN(FFN *item, wvStream *fd); +void wvPutFILETIME(FILETIME *ft,wvStream *fd); +void wvPutFLD(FLD *item,wvStream *fd); +void wvPutFONTSIGNATURE(FONTSIGNATURE *fs,wvStream *fd); +void wvPutPANOSE(PANOSE *item,wvStream *fd); +void wvPutFAnchor(FAnchor *item,wvStream *fd); +void wvPutFOPTE(FOPTE *afopte,wvStream *fd); +void wvPutFOPTEArray(FOPTE **fopte,MSOFBH *msofbh,wvStream *fd); +void wvPutFRD(FRD *item,wvStream *fd); +void wvPutFSPA(FSPA *item,wvStream *fd); +void wvPutFTXBXS(FTXBXS *item,wvStream *fd); +void wvPutChar(wvStream *fd,U8 chartype, U16 ch); +void wvPutLFO(LFO *item,wvStream *fd); +void wvPutLSPD(LSPD *item, wvStream *fd); +void wvPutLSTF(LSTF *item,wvStream *fd); +void wvPutVLF(LVLF *item,wvStream *fd); +void wvPutNUMRM(NUMRM *item, wvStream *fd); +void wvPutOLST(OLST *item, wvStream *fd); +void wvPutPCD(PCD *item, wvStream *fd); +void wvPutPGD(PGD *item, wvStream *fd); +void wvPutPHE6(PHE *item, wvStream *fd); +void wvPutPHE(PHE *item, wvStream *fd); +void wvPutPRM(PRM *item, wvStream *fd); +void wvPutRR(RR *item, wvStream *fd); +void wvPutRS(RS *item, wvStream *fd); +void wvPutSED(SED *item, wvStream *fd); +void wvPutSEPX(version ver,SEPX *item,wvStream *fd); +void wvPutSHD(SHD *item, wvStream *fd); +void wvPutPropHeader(PropHeader *header,wvStream *file); +void wvPutFIDAndOffset(FIDAndOffset *fid,wvStream *file); +void wvPutSummaryInfo(SummaryInfo *si,wvStream *file,U32 offset); +void wvPutTBD(TBD *item, wvStream *fd); +void wvPutTC(TC *tc, wvStream *fd); +void wvPutTLP(TLP *item, wvStream *fd); +void wvPutWKB(WKB *item,wvStream *fd); +void wvPutSTSHI(STSHI *item, U16 cbSTSHI, wvStream *fd); +void wvPutSTD(STD *item, U16 len, wvStream *fd); +void wvPutSTSH(STSH *item, U16 cbStshi, wvStream *fd); #ifdef __cplusplus }