other-licenses/7zstub/src/7zip/IStream.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 // IStream.h
     3 #ifndef __ISTREAM_H
     4 #define __ISTREAM_H
     6 #include "../Common/MyUnknown.h"
     7 #include "../Common/Types.h"
     9 // "23170F69-40C1-278A-0000-000300xx0000"
    11 #define STREAM_INTERFACE_SUB(i, b, x) \
    12 DEFINE_GUID(IID_ ## i, \
    13 0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x03, 0x00, x, 0x00, 0x00); \
    14 struct i: public b
    16 #define STREAM_INTERFACE(i, x) STREAM_INTERFACE_SUB(i, IUnknown, x)
    18 STREAM_INTERFACE(ISequentialInStream, 0x01)
    19 {
    20   STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize) PURE;
    21   /*
    22   Out: if size != 0, return_value = S_OK and (*processedSize == 0),
    23     then there are no more bytes in stream.
    24   if (size > 0) && there are bytes in stream, 
    25   this function must read at least 1 byte.
    26   This function is allowed to read less than number of remaining bytes in stream.
    27   You must call Read function in loop, if you need exact amount of data
    28   */
    29 };
    31 STREAM_INTERFACE(ISequentialOutStream, 0x02)
    32 {
    33   STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize) PURE;
    34   /*
    35   if (size > 0) this function must write at least 1 byte.
    36   This function is allowed to write less than "size".
    37   You must call Write function in loop, if you need to write exact amount of data
    38   */
    39 };
    41 STREAM_INTERFACE_SUB(IInStream, ISequentialInStream, 0x03)
    42 {
    43   STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition) PURE;
    44 };
    46 STREAM_INTERFACE_SUB(IOutStream, ISequentialOutStream, 0x04)
    47 {
    48   STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition) PURE;
    49   STDMETHOD(SetSize)(Int64 newSize) PURE;
    50 };
    52 STREAM_INTERFACE(IStreamGetSize, 0x06)
    53 {
    54   STDMETHOD(GetSize)(UInt64 *size) PURE;
    55 };
    57 STREAM_INTERFACE(IOutStreamFlush, 0x07)
    58 {
    59   STDMETHOD(Flush)() PURE;
    60 };
    62 #endif

mercurial