Diffstat (limited to 'noncore/apps/opie-reader/Aportis.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/Aportis.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/Aportis.h b/noncore/apps/opie-reader/Aportis.h index 08016f4..1ca5e73 100644 --- a/noncore/apps/opie-reader/Aportis.h +++ b/noncore/apps/opie-reader/Aportis.h @@ -19,68 +19,82 @@ struct tDocHeader { char sName[32]; DWORD dwUnknown1; DWORD dwTime1; DWORD dwTime2; DWORD dwTime3; DWORD dwLastSync; DWORD ofsSort; DWORD ofsCatagories; DWORD dwCreator; DWORD dwType; DWORD dwUnknown2; DWORD dwUnknown3; WORD wNumRecs; }; */ struct tDocRecord0 { WORD wVersion; // 1=plain text, 2=compressed WORD wSpare; DWORD dwStoryLen; // in chars, when decompressed WORD wNumRecs; // text records only; equals tDocHeader.wNumRecs-1 WORD wRecSize; // usually 0x1000 DWORD dwSpare2; }; +struct PeanutHeader +{ + UInt16 Version; + UInt8 Junk1[6]; + UInt16 Records; + UInt8 Junk2[106]; +}; + ////////////// utilities ////////////////////////////////////// inline WORD SwapWord(WORD r) { return (r>>8) + (r<<8); } inline DWORD SwapLong(DWORD r) { return ((r>>24) & 0xFF) + (r<<24) + ((r>>8) & 0xFF00) + ((r<<8) & 0xFF0000); } class Aportis : public CExpander, Cpdb { + bool peanutfile; + void dePeanut(int&); DWORD dwLen; WORD nRecs2; DWORD dwTLen; WORD nRecs; WORD BlockSize; DWORD dwRecLen; int currentrec, currentpos; unsigned int cbptr; unsigned int outptr; unsigned char circbuf[2048]; char bCompressed; public: virtual void sizes(unsigned long& _file, unsigned long& _text) { _file = dwLen; _text = dwTLen; } virtual bool hasrandomaccess() { return true; } virtual ~Aportis() {} Aportis(); virtual int openfile(const char *src); virtual int getch(); virtual unsigned int locate(); virtual void locate(unsigned int n); virtual CList<Bkmk>* getbkmklist(); + virtual MarkupType PreferredMarkup() + { + return (peanutfile) ? cPML : cTEXT; + } private: bool refreshbuffer(); unsigned int GetBS(unsigned int bn); }; #endif |