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

📄 loopbuf.h

📁 modem数据通信源码
💻 H
字号:
#ifndef __LOOPBUF_H__
#define __LOOPBUF_H__

/* here include files */
#include "MacroDef.H"
#include "Nucleus.H"
#include "Common_exp.H"

#ifdef __cplusplus
extern "C"{
#endif


typedef int (*pfunc) (int argc, void *argv);

typedef struct
{
    unsigned char    *buf;
    unsigned int     len;
    unsigned int     read;
    unsigned int     write;
    unsigned int     max;
    pfunc   PV_init;
    pfunc   P;
    pfunc   V;
    NU_SEMAPHORE	*sem;
    char    name[64];
    INT     int_level;
}_loopbuf;

#define     EM_LOOPBUF_NONE_LOCK        0
#define     EM_LOOPBUF_THREAD_INT       1
#define     EM_LOOPBUF_THREAD_THREAD    2

int loop_init(_loopbuf *loopbuf,char *name,unsigned int max,char mode);
int loop_write(_loopbuf *loopbuf,const char *buf,unsigned int len);
int loop_read(_loopbuf *loopbuf,char *buf,unsigned int len);
unsigned int loop_size(_loopbuf *loopbuf);
int loop_clr_end(_loopbuf *loopbuf,char *buf);
int loop_reset(_loopbuf *loopbuf);

#ifdef __cplusplus
}
#endif

#endif

⌨️ 快捷键说明

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