Skip to content

Simple C ringbuffer implementation with API allowing use without intermediate buffer

License

Notifications You must be signed in to change notification settings

underhood/c-rbuf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

c-rbuf run-tests

Simple C ringbuffer implementation with API allowing usage without intermediate buffer. Meant to be as simple as possible to use and integrate. You can copy the files into your project, use it as a static lib, or shared lib depending on what is most convenient for you.

Usage without intermediate buffer means when reading from file descriptor/socket you can insert data directly into the ringbuffer:

char *ptr;
size_t bytes;
rbuf_t buff = rbuf_create(12345);
ptr = rbuf_get_linear_insert_range(buff, &ret);
read(fd, ptr, bytes);

Multiple tail support: Only single tail is supported but multiple tail support might be implemented in the future.

Thread Safety: Currently you will have to ensure only a single thread accesses the buffer at a time yourself.

License

The Project is released under LGPL v3 license. See License

About

Simple C ringbuffer implementation with API allowing use without intermediate buffer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published