Ruby: prism/util/pm_string_list.h Source File

Ruby 3.3.7p123 (2025-01-15 revision be31f993d7fa0219d85f7b3c694d454da4ecc10b)

pm_string_list.h
Go to the documentation of this file.
1
6#ifndef PRISM_STRING_LIST_H
7#define PRISM_STRING_LIST_H
8
9#include "prism/defines.h"
10#include "prism/util/pm_string.h"
11
12#include <stddef.h>
13#include <stdlib.h>
14
18 typedef struct {
20 size_t length;
21
23 size_t capacity;
24
26 pm_string_t *strings;
27} pm_string_list_t;
28
35void pm_string_list_append(pm_string_list_t *string_list, pm_string_t *string);
36
42 PRISM_EXPORTED_FUNCTION void pm_string_list_free(pm_string_list_t *string_list);
43
44#endif
pm_string.h
A generic string type that can have various ownership semantics.
pm_string_list_append
void pm_string_list_append(pm_string_list_t *string_list, pm_string_t *string)
Append a pm_string_t to the given string list.
Definition pm_string_list.c:7
pm_string_list_free
PRISM_EXPORTED_FUNCTION void pm_string_list_free(pm_string_list_t *string_list)
Free the memory associated with the string list.
Definition pm_string_list.c:26
defines.h
Macro definitions used throughout the prism library.
PRISM_EXPORTED_FUNCTION
#define PRISM_EXPORTED_FUNCTION
By default, we compile with -fvisibility=hidden.
Definition defines.h:32
pm_string_list_t
A list of strings.
Definition pm_string_list.h:18
pm_string_list_t::capacity
size_t capacity
The capacity of the string list that has been allocated.
Definition pm_string_list.h:23
pm_string_list_t::strings
pm_string_t * strings
A pointer to the start of the string list.
Definition pm_string_list.h:26
pm_string_list_t::length
size_t length
The length of the string list.
Definition pm_string_list.h:20
pm_string_t
A generic string type that can have various ownership semantics.
Definition pm_string.h:30