mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
add stream_setOnCloseProc
This commit is contained in:
parent
df5c274c31
commit
eb0e79041e
2 changed files with 15 additions and 0 deletions
|
@ -341,6 +341,12 @@ mem_stream_getVersion( XWStreamCtxt* p_sctx )
|
|||
return stream->version;
|
||||
} /* mem_stream_getVersion */
|
||||
|
||||
static void
|
||||
mem_stream_setOnCloseProc( XWStreamCtxt* p_sctx, MemStreamCloseCallback proc )
|
||||
{
|
||||
MemStreamCtxt* stream = (MemStreamCtxt*)p_sctx;
|
||||
stream->onClose = proc;
|
||||
}
|
||||
|
||||
static XWStreamPos
|
||||
mem_stream_getPos( XWStreamCtxt* p_sctx, PosWhich which )
|
||||
|
@ -427,6 +433,8 @@ make_vtable( MemStreamCtxt* stream )
|
|||
SET_VTABLE_ENTRY( vtable, stream_setVersion, mem );
|
||||
SET_VTABLE_ENTRY( vtable, stream_getVersion, mem );
|
||||
|
||||
SET_VTABLE_ENTRY( vtable, stream_setOnCloseProc, mem );
|
||||
|
||||
return vtable;
|
||||
} /* make_vtable */
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#define _XWSTREAM_H_
|
||||
|
||||
#include "comtypes.h"
|
||||
#include "memstream.h"
|
||||
/* #include "xptypes.h" */
|
||||
|
||||
#define START_OF_STREAM 0
|
||||
|
@ -67,6 +68,9 @@ typedef struct StreamCtxVTable {
|
|||
|
||||
void (*m_stream_setVersion)( XWStreamCtxt* dctx, XP_U16 vers );
|
||||
XP_U16 (*m_stream_getVersion)( XWStreamCtxt* dctx );
|
||||
|
||||
void (*m_stream_setOnCloseProc)( XWStreamCtxt* dctx,
|
||||
MemStreamCloseCallback proc );
|
||||
} StreamCtxVTable;
|
||||
|
||||
|
||||
|
@ -141,4 +145,7 @@ struct XWStreamCtxt {
|
|||
#define stream_getVersion(sc) \
|
||||
(sc)->vtable->m_stream_getVersion((sc))
|
||||
|
||||
#define stream_setOnCloseProc(sc, p) \
|
||||
(sc)->vtable->m_stream_setOnCloseProc((sc), (p))
|
||||
|
||||
#endif /* _XWSTREAM_H_ */
|
||||
|
|
Loading…
Reference in a new issue