ammemstream.h

来自「JPEG解压软件,包含PC端的测试程序,程序结构比较清晰」· C头文件 代码 · 共 64 行

H
64
字号

/*
 * AMMemStream.h
 *
 */

#ifndef _AMMEMSTREAM_H
#define _AMMEMSTREAM_H

#include "AMComDef.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef		MVoid*	HMSTREAM;
#define		INVALID_HMSTREAM  MNull

#define		STREAM_BEGIN	0
#define		STREAM_END		1
#define		STREAM_CUR		2

typedef struct _tag_file
{
	MPChar file_path;
	MPChar file_name;
}FILE_TAG;

typedef struct _tag_mem
{
	MLong size;
	MLong off_set;		//currently memory pointer
}MEM_TAG;

typedef struct _tag_STREAM_HANDLE
{
	void* handle;
	MLong flag;
	union {
		FILE_TAG file_pty;
		MEM_TAG  mem_pty;
	}pty;							
} STREAMHANDLE,*LPSTREAMHANDLE;



MBool AMStreamMemClose(HMSTREAM StreamHandle);

MLong AMStreamMemGetSize(HMSTREAM StreamHandle);

MLong AMStreamMemRead(HMSTREAM StreamHandle,void *pBuf,MLong Size);

MLong AMStreamMemWrite(HMSTREAM StreamHandle,void *pBuf,MLong Size);

MLong AMStreamMemSeek(HMSTREAM StreamHandle,MShort Start,MLong Offset);

MLong AMStreamMemTell(HMSTREAM StreamHandle);

MBool AMStreamMemFlush(HMSTREAM StreamHandle);

#ifdef __cplusplus
}
#endif
#endif	/*_AMMEMSTREAM_H*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?