Main Page   Data Structures   File List   Data Fields   Globals   Examples  

shbuf.h

Go to the documentation of this file.
00001 #ifndef fooshbufhfoo
00002 #define fooshbufhfoo
00003 
00004 /* $Id: shbuf.h,v 1.6 2003/09/09 22:14:58 poettering Exp $
00005  *
00006  * This file is part of libshbuf. 
00007  *
00008  * libshbuf is free software; you can redistribute it and/or modify it under
00009  * the terms of the GNU General Public License as published by the Free
00010  * Software Foundation; either version 2 of the License, or (at your
00011  * option) any later version.
00012  *
00013  * libshbuf is distributed in the hope that it will be useful, but WITHOUT
00014  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00015  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
00016  * for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with libshbuf; if not, write to the Free Software Foundation,
00020  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
00021  */
00022 
00023 #include <sys/types.h>
00024 
00207 struct _shbuf;
00208 
00210 typedef struct _shbuf shbuf;
00211 
00235 typedef struct {
00236     unsigned long read_idx;      
00237     unsigned long length;        
00238     unsigned long backlog;       
00239     unsigned long backlog_target; 
00241     unsigned long write_count;   
00242     unsigned long read_count;    
00243     int ignore_read_inc;         
00247     int ignore_write_inc;        
00248 } shbuf_status;
00249 
00259 shbuf* shbuf_create(key_t key, unsigned long size);
00260 
00271 shbuf* shbuf_open(key_t key);
00272 
00279 void shbuf_free(shbuf* sb);
00280 
00289 int shbuf_access(shbuf* sb, int mode);
00290 
00297 key_t shbuf_get_key(shbuf* sb);
00298 
00305 unsigned long shbuf_get_size(shbuf* sb);
00306 
00314 unsigned char* shbuf_get_pointer(shbuf* sb);
00315 
00323 shbuf_status* shbuf_get_status(shbuf* sb);
00324 
00335 int shbuf_notify_enable(shbuf* sb, int b);
00336 
00345 int shbuf_notify(shbuf* sb);
00346 
00355 int shbuf_wait(shbuf* sb);
00356 
00364 int shbuf_get_select_fd(shbuf* sb);
00365 
00375 int shbuf_post_select(shbuf *sb);
00376 
00386 int shbuf_status_lock(shbuf* sb);
00387 
00396 int shbuf_status_unlock(shbuf* sb);
00397 
00405 int shbuf_reset(shbuf* sb);
00406 
00414 int shbuf_zero(shbuf* sb);
00415 
00423 int shbuf_set_backlog_target(shbuf *sb, unsigned long bl);
00424 
00433 unsigned long shbuf_get_backlog_target(shbuf *sb);
00434 
00446 const unsigned char* shbuf_get_read_pointer(shbuf *sb, unsigned long *l);
00447 
00456 int shbuf_inc_read_pointer(shbuf *sb, unsigned long r);
00457 
00469 unsigned char* shbuf_get_write_pointer(shbuf *sb, unsigned long *l);
00470 
00479 int shbuf_inc_write_pointer(shbuf *sb, unsigned long r);
00480 
00488 int shbuf_connected(shbuf *sb);
00489 
00496 int shbuf_is_full(shbuf *sb);
00497 
00504 int shbuf_is_empty(shbuf *sb);
00505 
00521 unsigned long shbuf_rewind(shbuf *sb, unsigned long v);
00522 
00540 signed long shbuf_read(shbuf *sb, unsigned char*c, signed long l);
00541 
00559 signed long shbuf_write(shbuf *sb, const unsigned char*c, signed long l);
00560 
00563 #endif

Generated on Thu Sep 11 18:52:21 2003 for libshbuf by doxygen1.2.18