Ruby
4.1.0dev (2026-10-26 revision 29264f878a52d2c36c75bfca6d04adaefeacbb30)
prism
internal
stringy.h
1
#ifndef PRISM_INTERNAL_STRINGY_H
2
#define PRISM_INTERNAL_STRINGY_H
3
4
#include "
prism/stringy.h
"
5
6
/*
7
* Backing storage for an empty string.
8
*/
9
static
const
uint8_t empty_source[] =
""
;
10
11
/*
12
* Defines an empty string. This is useful for initializing a string that will
13
* be filled in later.
14
*/
15
#define PM_STRING_EMPTY ((pm_string_t) { .source = empty_source, .length = 0 })
16
17
/*
18
* Initialize a shared string that is based on initial input.
19
*/
20
void
pm_string_shared_init(
pm_string_t
*
string
,
const
uint8_t *start,
const
uint8_t *end);
21
22
/*
23
* Compare the underlying lengths and bytes of two strings. Returns 0 if the
24
* strings are equal, a negative number if the left string is less than the
25
* right string, and a positive number if the left string is greater than the
26
* right string.
27
*/
28
int
pm_string_compare(
const
pm_string_t
*left,
const
pm_string_t
*right);
29
30
#endif
stringy.h
A view of a sequence of bytes owned by someone else.
pm_string_t
A view of a sequence of bytes.
Definition
stringy.h:23
Generated by
1.9.8