📄 iobuff.h
字号:
/* iobuff.h -- Prototypes and declarations for iobuff.c Copyright (C) 2001-2003 Shane Wegner This file is part of Intercom. Intercom is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. Intercom is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of version 2 of the GNU General Public License along with Intercom; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA To contact the author, please send email to shane@cm.nu. *//* $Id: iobuff.h,v 1.8 2003/02/13 20:22:49 shane Exp $ */#ifndef IOBUFF_H#define IOBUFF_H#include <sys/types.h>#ifdef _REENTRANT#include <pthread.h>#endif#define IOB_PAGESIZE (4096 - (SIZEOF_SIZE_T * 2) - (SIZEOF_VOID_P * 2))struct iob_page {size_t len; /* bytes of valid data */size_t pos;char data[IOB_PAGESIZE];struct iob_page *prev;struct iob_page *next;};struct iobuff {#ifdef _REENTRANTpthread_mutex_t mutex;#endifsize_t minpages; /* Don't free this many pages */struct iob_page *page;};void iob_init(struct iobuff *iob);void iob_setminbytes(struct iobuff *iob, size_t n);void iob_flush(struct iobuff *iob);void iob_queue(struct iobuff *iob, const char *buff, size_t n);size_t iob_buffsize(struct iobuff *iob);size_t iob_read(struct iobuff *iob, char *buff, size_t n);size_t iob_readkeep(struct iobuff *iob, char *buff, size_t n);void iob_delete(struct iobuff *iob, size_t n);#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -