⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fifo.h

📁 这是我以前写的一个Fifo的一个类
💻 H
字号:
//fifo.h
#if ! defined (LINUX_WINDOWS_FIFO_H)
#define LINUX_WINDOWS_FIFO_H 

//
//datadispatch module 
//
typedef void* DISP_HANDLE; 

#define MAX_OUTPUT_MODULE	4//modified from 3 to 4 by Eric 

typedef struct _DISP_OUPUT_CORE_
{		int bufsize;//beffer size	char * buf;//buffer for store data	char * pout;//output data point	char * pin;//input data point	DWORD discardBytes;
	DWORD inputBytes;
	DWORD outputBytes;	pthread_mutex_t	mut;	//add by Eric
}DISP_OUPUT_CORE;typedef struct _DISP_OUTPUT_//output modules' dispatcher{	DISP_OUPUT_CORE dispcore[MAX_OUTPUT_MODULE];	int dispindex;//index for the free dispcore[]}DISP_OUTPUT;



DISP_HANDLE dispInit();
int regOutputModule(DISP_HANDLE handle,DWORD fifoSize);
int disregAllOutputModules(DISP_HANDLE handle);
int datadispInput(DISP_HANDLE handle,const void *data, int datalen);
int getdatadisp(DISP_HANDLE handle,int id,void *buf, int* pOutputlen,bool bForce);
int getdatadispsize(DISP_HANDLE handle,int id);

//
//fifo module
//
//1. the fifo support mutiple threads to push in and one thread to pop up
//2. the size of push in and pop up are equal
//3. the size of packet pushed in can be different
//4. pop up function will wait if fifo is null

#endif//LINUX_WINDOWS_FIFO_H

⌨️ 快捷键说明

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