First commit, Vystem v0.1
This commit is contained in:
18
shelter/lib/include/memory/ring.h
Normal file
18
shelter/lib/include/memory/ring.h
Normal file
@@ -0,0 +1,18 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
#ifndef SH_LIB_RING_H
|
||||
#define SH_LIB_RING_H
|
||||
#include "std/type.h"
|
||||
#include "std/status.h"
|
||||
// Ring buffer header structure
|
||||
typedef struct {
|
||||
sh_uint32 head;
|
||||
sh_uint32 tail;
|
||||
sh_uint32 buffer_bytes_size;
|
||||
sh_uint8* data_start;
|
||||
sh_uint64 total_bytes_written;
|
||||
} sh_ring_RING_BUFFER_HEADER;
|
||||
// Write a byte into the provided ring buffer
|
||||
SH_STATUS sh_ring_write_byte(sh_ring_RING_BUFFER_HEADER *ring_buffer,sh_uint8 byte);
|
||||
// Write a null terminated string into the provided ring buffer
|
||||
SH_STATUS sh_ring_write_string(sh_ring_RING_BUFFER_HEADER *ring_buffer,char *string);
|
||||
#endif
|
||||
Reference in New Issue
Block a user