28 lines
380 B
C
28 lines
380 B
C
/* SPDX-License-Identifier: MIT */
|
|
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <stdio.h>
|
|
|
|
#define rb_size_t size_t
|
|
#include "ringbuf.h"
|
|
|
|
int
|
|
main(void)
|
|
{
|
|
struct RingBuf rb;
|
|
rb_init(&rb, 10, malloc, sizeof(int));
|
|
|
|
int data = 5;
|
|
|
|
rb_push_back(&rb, &data, memcpy);
|
|
|
|
int d;
|
|
rb_pop_front(&rb, &d);
|
|
|
|
printf("Data: %d\n", d);
|
|
|
|
rb_destroy(&rb, free);
|
|
|
|
return 0;
|
|
}
|