2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
49#include "../core/gimbal_result.h"
52#define GBL_QUARK_INVALID ((GblQuark)0
)
59
60
61
62
63
64
65
66
70
71
72
84
85
86
106
107
108
126#define GblQuark_fromString(...)
127 GblQuark_fromStringDefault_
(__VA_ARGS__)
128#define GblQuark_fromStringDefault_(...)
129 GblQuark_fromStringDefault__
(__VA_ARGS__, 0
)
130#define GblQuark_fromStringDefault__(str, len, ...)
131 (GblQuark_fromString
)(str, len)
133#define GblQuark_internString(...)
134 GblQuark_internStringDefault_
(__VA_ARGS__)
135#define GblQuark_internStringDefault_(...)
136 GblQuark_internStringDefault__
(__VA_ARGS__, 0
)
137#define GblQuark_internStringDefault__(str, len, ...)
138 (GblQuark_internString
)(str, len)
140#define GblQuark_tryString(...)
141 GblQuark_tryStringDefault_
(__VA_ARGS__)
142#define GblQuark_tryStringDefault_(...)
143 GblQuark_tryStringDefault__
(__VA_ARGS__, 0
)
144#define GblQuark_tryStringDefault__(str, len, ...)
145 (GblQuark_tryString
)(str, len)
149
150
151
152
153
154
155
156
157
158
159
160
161
162
165
166
167
168
169
170
171
172
173
176
177
178
179
182
183
184
187
188
189
192
193
194
197
198
199
202
203
204
207
208
209
210
212
213
214
217
218
219
222
223
224
225
226
227
228
229
232
233
234
235
236
237
238
241
242
243
244
245
246
247
248
249
250
#define GBL_FORWARD_DECLARE_STRUCT(S)
size_t GblQuark_bytesAvailable(void)
Returns the total number of bytes remaining available on the current allocation page.
size_t GblQuark_bytesUsed(void)
Returns the total number of bytes used for string allocations by the registry.
size_t GblQuark_totalCapacity(void)
Returns the total number of bytes allocated (used or unused) for string storage.
float GblQuark_utilization(void)
Returns the utilization factor of total capacity vs bytes used (ranging 0.0-1.0)
const char * GblQuark_internStatic(const char *pString)
Creates a GblQuark from the given STATIC string (if necessary, saving on allocating),...
size_t GblQuark_fragmentedBytes(void)
Returns the total number of unused, unavailable, but allocated bytes for string storage.
size_t GblQuark_count(void)
Returns the total number of quarks maintained within the registry.
GBL_RESULT GblQuark_init(GblContext *pCtx, size_t extraPageSize, size_t initialEntries)
Initializes the GblQuark registry with the given capacities (called automatically with defaults)
const char * GblQuark_internString(const char *pStr, size_t len)
Creates a GblQuark from the given string (if necessary), also returning its interned string.
GblQuark GblQuark_fromStatic(const char *pSstring)
Returns the GblQuark associated with the given STATIC string, which can save an allocation when initi...
size_t GblQuark_pageCount(void)
Returns the total number of allocation pages used by the registry.
size_t GblQuark_pageSize(void)
Returns the size of each dynamically allocated page used by the registry.
const char * GblQuark_toString(GblQuark quark)
Returns the NULL-terminated interned C string associated with a given GblQuark.
GblContext * GblQuark_context(void)
Returns a pointer to the GblContext object associated with the GblQuark registry.
GblQuark GblQuark_fromString(const char *pStr, size_t len)
Returns the GblQuark associated with the given string, adding a new entry to the registry if necessar...
GBL_RESULT GblQuark_final(void)
Finalizes the GblQuark registry, releasing all resources (called automatically upon shutdown)
GblQuark GblQuark_tryString(const char *pStr, size_t len)
Returns the GblQuark associated with the given string, returning GBL_QUARK_INVALID if it was not prev...
uintptr_t GblQuark
Uniquely identifiable interned string type.