Skip to content

ravi688/BufferLib

Repository files navigation

BufferLib

  • BufferLib is a small library for managing memory buffers

Buy Me A Coffee

Documentation

Types

  • BUFFER --> The Buffer Object which contains all the information such as its size, strides, count, and capacity
  • pBUFFER --> Just a typedef of BUFFER*

Two ways

  • Bind -> Perform Operations -> UnBind
  • Perform Operations passing the object (buffer)

Example:

#include <bufferlib/buffer.h>
#include <stdint.h>

int main(int argc, const char* argv[])
{
  buffer_t values = buf_new(int32_t);
  buf_push_auto(&values, 4);
  buf_push_auto(&values, 100);
  buf_push_auto(&values, 101);
  buf_traverse_elements(&values, 0, buf_get_element_count(&values) - 1, buf_s32_print, NULL); 
  buf_free(&values);
  return 0;
}

About Me

Youtube
Github
LinkedIn

Releases

No releases published

Sponsor this project

 

Packages

No packages published