📨 chic 0.0.0
Realtime-safe channels in C
Loading...
Searching...
No Matches
claim.h File Reference

Exclusive claims for directly reading/writing into channels. More...

#include <stddef.h>
#include <stdbool.h>

Go to the source code of this file.

Data Structures

struct  claim
 Claimed space for reading or writing directly into the internal ringbuffer of a channel. More...

Macros

#define claim_cast(C, T, I)
 Convenience macro for reinterpreting a claim's slice as a pointer to a different type.

Functions

static bool claim_is_empty (const struct claim *it)
 Checks if a claim is empty.
static bool claim_is_split (const struct claim *it)
 Checks if a claim is split between two contiguous regions.
static size_t claim_len (const struct claim *it)
 Gets the total length of the claimed space in a claim.
static void claim_consume (struct claim *it)
 Consumes a claim, such that committing it has no effect.

Detailed Description

Exclusive claims for directly reading/writing into channels.

Author
Fawn rubie.nosp@m.fawn.nosp@m.@gmai.nosp@m.l.co.nosp@m.m
Date
2026

Macro Definition Documentation

◆ claim_cast

#define claim_cast ( C,
T,
I )
Value:
((T)*)((C)->ptr[I])

Convenience macro for reinterpreting a claim's slice as a pointer to a different type.

Parameters
CThe address of the claim
TThe type to reinterpret the claim's slice as
IThe index (either 0 or 1) of the slice to reinterpret