Main Page | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

# dkcMemoryStream.h

Go to the documentation of this file.

    00001
    00013 #ifndef dkutil_c_MemoryStream__h
    00014 #define dkutil_c_MemoryStream__h
    00015
    00016 #include <stdio.h>
    00017 #include "dkcOSIndependent.h"
    00018
    00019 #include "dkcDefined.h"
    00020 #include "dkcBuffer.h"
    00021 #include "dkcSerialize.h"
    00026 typedef struct dkc_MemoryStream{
    00028         BYTE *mBuffer;
    00030         size_t mSize;
    00032         size_t mNowOffset;
    00033
    00034 }DKC_MEMORYSTREAM;
    00035
    00036
    00037
    00038
    00039
    00040 enum edkcMemoryStream{
    00042         edkcMemoryStreamSeekCurrent = SEEK_CUR,
    00044         edkcMemoryStreamSeekEnd = SEEK_END,
    00046         edkcMemoryStreamSeekSet = SEEK_SET,
    00047 };
    00048
    00049
    00050
    00060
    00061 DKC_EXTERN DKC_MEMORYSTREAM * WINAPI dkcAllocMemoryStream(size_t size);
    00062
    00063
    00067
    00068 DKC_EXTERN int WINAPI dkcFreeMemoryStream(DKC_MEMORYSTREAM **ptr);
    00069
    00070
    00072 DKC_EXTERN int WINAPI dkcMemoryStreamSeek(DKC_MEMORYSTREAM *ptr,int offset,int origin);
    00073
    00075 DKC_EXTERN size_t WINAPI dkcMemoryStreamGetSeekPoint(DKC_MEMORYSTREAM *ptr);
    00076
    00077
    00084
    00085 DKC_EXTERN int WINAPI dkcMemoryStreamRead(DKC_MEMORYSTREAM *ptr,void *buffer,size_t size,size_t *readsize);
    00092
    00093 DKC_EXTERN int WINAPI dkcMemoryStreamWrite(DKC_MEMORYSTREAM *ptr,const void *buffer,size_t size);
    00094
    00096 DKC_EXTERN int WINAPI dkcMemoryStreamDynamicWrite(DKC_MEMORYSTREAM *ptr,const void *buffer,size_t size);
    00097
    00099 DKC_EXTERN int WINAPI dkcMemoryStreamResize(DKC_MEMORYSTREAM *ptr,size_t want_size);
    00100
    00101
    00103 DKC_EXTERN DKC_MEMORYSTREAM * WINAPI dkcAllocMemoryStreamDeserialize(DKC_DESERIALIZE *se);
    00104
    00105
    00107 DKC_EXTERN void dkcMemoryStreamSerialize(const DKC_MEMORYSTREAM *ptr,DKC_SERIALIZE *se);
    00108
    00109
    00111 DKC_EXTERN int WINAPI dkcMemoryStreamClear(DKC_MEMORYSTREAM *ptr);
    00112
    00113
    00120 DKC_EXTERN DKC_MEMORYSTREAM * WINAPI dkcAllocMemoryStreamCopy(const DKC_MEMORYSTREAM *ptr);
    00121
    00122 #endif