Ruby 4.1.0dev (2026-03-28 revision 6035121c933c965cebf93f624066c95dabbc6d1d)
buffer.h
Go to the documentation of this file.
1
6#ifndef PRISM_BUFFER_H
7#define PRISM_BUFFER_H
8
12
13#include <stddef.h>
14
18typedef struct pm_buffer_t pm_buffer_t;
19
28
35
43
51
52#endif
#define PRISM_EXPORTED_FUNCTION
By default, we compile with -fvisibility=hidden.
Definition exported.h:20
PRISM_EXPORTED_FUNCTION size_t pm_buffer_length(const pm_buffer_t *buffer) PRISM_NONNULL(1)
Return the length of the buffer.
Definition buffer.c:50
PRISM_EXPORTED_FUNCTION PRISM_NODISCARD pm_buffer_t * pm_buffer_new(void)
Allocate and initialize a new buffer.
Definition buffer.c:30
PRISM_EXPORTED_FUNCTION char * pm_buffer_value(const pm_buffer_t *buffer) PRISM_NONNULL(1)
Return the value of the buffer.
Definition buffer.c:42
PRISM_EXPORTED_FUNCTION void pm_buffer_free(pm_buffer_t *buffer) PRISM_NONNULL(1)
Free both the memory held by the buffer and the buffer itself.
Definition buffer.c:371
#define PRISM_NODISCARD
Mark the return value of a function as important so that the compiler warns if a caller ignores it.
Definition nodiscard.h:15
#define PRISM_NONNULL(...)
Mark the parameters of a function as non-null.
Definition nonnull.h:13