Tchatator413
TripEnArvor instant messaging protocol - JSON-based
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
slice.h File Reference

slice data strucutre - Interface More...

#include <stdlib.h>

Go to the source code of this file.

Data Structures

struct  slice_t
 A memory slice. More...
 

Macros

#define SLICE_CONST(STRLIT)    (slice_t) { .len = sizeof STRLIT - 1, .val = STRLIT }
 

Functions

int slice_leni (slice_t slice)
 Returns the length of a slice as a signed integer.
 

Detailed Description

slice data strucutre - Interface

Author
Raphaƫl
Date
1/02/2025

Definition in file slice.h.

Macro Definition Documentation

◆ SLICE_CONST

#define SLICE_CONST (   STRLIT)     (slice_t) { .len = sizeof STRLIT - 1, .val = STRLIT }

Definition at line 18 of file slice.h.

19 { .len = sizeof STRLIT - 1, .val = STRLIT }

Function Documentation

◆ slice_leni()

int slice_leni ( slice_t  slice)

Returns the length of a slice as a signed integer.

Parameters
sliceA slice.
Returns
The length of slice, capped to INT_MAX.