UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
syms_base.c
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#ifndef SYMS_BASE_C
4#define SYMS_BASE_C
5
7//~ rjf: Library Metadata
8
13
15//~ rjf: Basic Type Functions
16
19 SYMS_U64Range result = {min, max};
20 return(result);
21}
22
25 SYMS_ASSERT(range.min + offset + size <= range.max);
26 SYMS_U64Range result = syms_make_u64_range(range.min + offset, range.min + offset + size);
27 return result;
28}
29
32 SYMS_U64 result = range.max - range.min;
33 return(result);
34}
35
37//~ allen: Hash Functions
38
42 return(result);
43}
44
47 SYMS_U8 *ptr = string.str;
48 SYMS_U8 *opl = string.str + string.size;
50 for (; ptr < opl; ptr += 1){
51 result = ((result << 5) + result) + (*ptr);
52 }
53 return(result);
54}
55
58 SYMS_U64 a = (x >> 10) | (x << 54);
59 SYMS_U64 b = a*5381;
60 return(b);
61}
62
64//~ rjf: Serial Information Functions
65
68
71 SYMS_SerialField *result = 0;
72 if (type->kind == SYMS_SerialTypeKind_Struct){
73 result = (SYMS_SerialField*)type->children;
74 }
75 return(result);
76}
77
80 SYMS_SerialValue *result = 0;
81 if (type->kind == SYMS_SerialTypeKind_Enum){
82 result = (SYMS_SerialValue*)type->children;
83 }
84 return(result);
85}
86
89 SYMS_SerialFlag *result = 0;
90 if (type->kind == SYMS_SerialTypeKind_Flags){
91 result = (SYMS_SerialFlag*)type->children;
92 }
93 return(result);
94}
95
99 if (type->kind == SYMS_SerialTypeKind_Enum){
100 SYMS_U64 enum_idx = type->enum_index_from_value(value);
101 if(enum_idx < type->child_count)
102 {
103 SYMS_SerialValue *values = (SYMS_SerialValue*)type->children;
104 result = values + type->enum_index_from_value(value);
105 }
106 }
107 return(result);
108}
109
113 // NOTE(allen): following should hold: type->basic_size <= 32.
114 // then this condition gives: (bit_off < 32) => (1 << (SYMS_U32)bit_off) defined
115 if (type->kind == SYMS_SerialTypeKind_Enum && bit_off < type->basic_size){
116 SYMS_U64 child_count = type->child_count;
117 SYMS_SerialFlag *flag = (SYMS_SerialFlag*)type->children;
118 SYMS_U32 bit = (1 << (SYMS_U32)bit_off);
119 for (SYMS_U64 i = 0; i < child_count; i += 1, flag += 1){
120 if ((flag->mask & bit) == bit){
121 result = flag;
122 break;
123 }
124 }
125 }
126 return(result);
127}
128
131 // TODO(allen): ideas for also exporting multi-bit values?
132 // (1) nothing (2) value (3) field=value (4) abstract model for 3 somehow
133
134 SYMS_String8List result = {0};
135 if (type != 0){
136 SYMS_U32 flag_count = type->child_count;
138 for (SYMS_U32 i = 0; i < flag_count; i += 1, flag += 1){
139 if (flag->mask == 1 && ((flags >> flag->bitshift) & 1)){
140 syms_string_list_push(arena, &result, flag->name);
141 }
142 }
143 }
144 return(result);
145}
146
149
151//~ allen: String Functions
152
155 return (codepoint == ' ' || codepoint == '\n' || codepoint == '\r' ||
156 codepoint == '\t' || codepoint == '\f' || codepoint == '\v');
157}
158
161 if(codepoint >= 'A' && codepoint <= 'Z'){
162 codepoint += 'a' - 'A';
163 }
164 return codepoint;
165}
166
167
170 SYMS_String8 result = {str, size};
171 return(result);
172}
173
176 SYMS_U8 *first = (SYMS_U8*)str;
177 SYMS_U8 *ptr = first;
178 for (;*ptr != 0; ptr += 1);
179 SYMS_String8 result = syms_str8_range(first, ptr);
180 return(result);
181}
182
185 SYMS_String8 result = {first, (SYMS_U64)(opl - first)};
186 return(result);
187}
188
191 SYMS_U8 *opl = str.str + str.size;
192 SYMS_U8 *first = str.str;
193 for (;first < opl; first += 1){
194 if (!syms_codepoint_is_whitespace(*first)){
195 break;
196 }
197 }
198 SYMS_U8 *last = opl - 1;
199 for (;last >= first; last -= 1){
200 if (!syms_codepoint_is_whitespace(*last)){
201 break;
202 }
203 }
204 last += 1;
205 SYMS_String8 result = syms_str8_range(first, last);
206 return(result);
207}
208
211 SYMS_B32 result = syms_false;
212 if (a.size == b.size || (flags & SYMS_StringMatchFlag_RightSideSloppy)){
213 SYMS_U64 size = SYMS_MIN(a.size, b.size);
214 result = syms_true;
215 if (size > 0){
216 // extract "inner loop flags"
219
220 // comparison loop
221 SYMS_U8 *aptr = a.str;
222 SYMS_U8 *bptr = b.str;
223 SYMS_U8 *bopl = bptr + size;
224 for (;bptr < bopl; aptr += 1, bptr += 1){
225 SYMS_U8 at = *aptr;
226 SYMS_U8 bt = *bptr;
227 if (case_insensitive){
230 }
232 at = (at == '\\' ? '/' : at);
233 bt = (bt == '\\' ? '/' : bt);
234 }
235 if (at != bt){
236 result = syms_false;
237 break;
238 }
239 }
240 }
241 }
242 return(result);
243}
244
247{
248 SYMS_U32 res, n;
249 switch (*p & 0xf0) {
250 case 0xf0 : res = *p & 0x07; n = 3; break;
251 case 0xe0 : res = *p & 0x0f; n = 2; break;
252 case 0xd0 :
253 case 0xc0 : res = *p & 0x1f; n = 1; break;
254 default : res = *p; n = 0; break;
255 }
256 while (n--) {
257 res = (res << 6) | (*(++p) & 0x3f);
258 }
259 *dst = res;
260 return p + 1;
261}
262
263SYMS_API void
265 node->string = string;
266 SYMS_QueuePush(list->first, list->last, node);
267 list->node_count += 1;
268 list->total_size += string.size;
269}
270
271SYMS_API void
273 SYMS_String8 string)
274{
275 node->string = string;
276 SYMS_QueuePushFront(list->first, list->last, node);
277 list->node_count += 1;
278 list->total_size += string.size;
279}
280
281SYMS_API void
286
287SYMS_API void
292
295 SYMS_String8List result = {0};
296 result.node_count = left->node_count + right->node_count;
297 result.total_size = left->total_size + right->total_size;
298 if (left->last != 0){
299 left->last->next = right->first;
300 }
301 result.first = left->first;
302 if (result.first == 0){
303 result.first = right->first;
304 }
305 result.last = right->last;
306 if (result.last == 0){
307 result.last = left->last;
308 }
310 syms_memzero_struct(right);
311 return(result);
312}
313
316 // setup join default
317 SYMS_StringJoin join = {0};
318 if (join_ptr != 0){
319 syms_memmove(&join, join_ptr, sizeof(join));
320 }
321
322 // allocate
323 SYMS_String8 result = {0};
324 result.size = list->total_size + join.pre.size + join.post.size;
325 if (list->node_count >= 2){
326 result.size += (list->node_count - 1)*join.sep.size;
327 }
328 result.str = syms_push_array(arena, SYMS_U8, result.size + 1);
329
330 // fill
331 SYMS_U8 *ptr = result.str;
332 syms_memmove(ptr, join.pre.str, join.pre.size);
333 ptr += join.pre.size;
334 for (SYMS_String8Node *node = list->first, *next = 0;
335 node != 0;
336 node = next){
337 syms_memmove(ptr, node->string.str, node->string.size);
338 ptr += node->string.size;
339 next = node->next;
340 if (next != 0){
341 syms_memmove(ptr, join.sep.str, join.sep.size);
342 ptr += join.sep.size;
343 }
344 }
345 syms_memmove(ptr, join.post.str, join.post.size);
346 ptr += join.post.size;
347 *ptr = 0;
348
349 return(result);
350}
351
354 SYMS_String8 result = syms_str8(syms_push_array(arena, SYMS_U8, string.size+1), string.size);
355 syms_memmove(result.str, string.str, string.size);
356 result.str[string.size] = 0;
357 return result;
358}
359
362 SYMS_U8 *opl = string.str + string.size;
363
364 SYMS_U8 *b = string.str;
365 for (;b < opl; b += 1){
366 SYMS_U8 c = *b;
367 SYMS_B32 ident = (('A' <= c && c <= 'Z') ||
368 ('a' <= c && c <= 'z') ||
369 ('0' <= c && c <= '9') ||
370 c == '_' || c == '$' || c == ':' || c >= 128);
371 if (!ident){
372 break;
373 }
374 }
375
376 SYMS_U8 *a = b;
377 for (;a > string.str;){
378 a -= 1;
379 if (*a == ':'){
380 a += 1;
381 break;
382 }
383 }
384
385 SYMS_String8 result = syms_str8_range(a, b);
386 return(result);
387}
388
391{
392 SYMS_String8List result;
393 syms_memzero_struct(&result);
394
395 SYMS_U8 *ptr = input.str;
396 SYMS_U8 *end = input.str + input.size;
397 SYMS_U64 size = 0;
398 for (;;) {
399 SYMS_U32 cp = 0;
400 SYMS_U8 *pn = syms_decode_utf8(ptr, &cp);
401 if (cp == delimiter) {
402 SYMS_String8 split = syms_str8(ptr - size, size);
403 syms_string_list_push(arena, &result, split);
404 size = 0;
405 } else if (pn >= end || cp == 0) {
406 SYMS_ASSERT(pn == end);
407 SYMS_String8 last = syms_str8(pn - size, size);
408 syms_string_list_push(arena, &result, last);
409 break;
410 }
411 size += 1;
412 ptr = pn;
413 }
414
415 return result;
416}
417
419//~ allen: String -> Int
420
423 // First we'll shift the ascii range around with
424 // (x - 0x30)%0x20
425 // to map each ascii value to one of the slots in this table.
426 // The ascii values for hex digits happen to land on their
427 // correct values!
429 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
430 0x08,0x09,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
431 0xFF,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0xFF,
432 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
433 };
434
435 // Then we'll squeeze the ascii range down with
436 // (x >> 3)
437 // to map each ascii value to one of the masks slots in this table.
438 // Each slot covers an 8-value range. The slots with 1s indicate
439 // blocks of values that contain valid hex digit asciis.
440 // All the ascii values in slots marked 1 that aren't ascii happen
441 // to map to the value 0xFF in the v_from_c table!
443 0,0,0,0,0,0,1,1,
444 1,0,0,0,1,0,0,0,
445 0,0,0,0,0,0,0,0,
446 0,0,0,0,0,0,0,0,
447 };
448
449 // Putting it together we can determine for each ascii byte
450 // if it is legal in the integer we are parsing, and get it's value!
451
452
453
454 SYMS_U64 result = 0;
455 if (2 <= radix && radix <= 16){
456 SYMS_U8 *ptr = str.str;
457 SYMS_U8 *opl = str.str + str.size;
458 for (; ptr < opl; ptr += 1){
459 SYMS_U8 x = *ptr;
460 SYMS_B8 mask = m_from_c[x >> 3];
461 if (!mask){
462 result = 0;
463 break;
464 }
465 SYMS_U8 value = (v_from_c[(x - 0x30)%0x20]);
466 if (value >= radix){
467 result = 0;
468 break;
469 }
470 result *= radix;
471 result += value;
472 }
473 }
474 return(result);
475}
476
479 SYMS_U8 *ptr = str.str;
480 SYMS_U8 *opl = str.str + str.size;
481
482 // consume signs
483 SYMS_S64 sign = 1;
484 for (;ptr < opl; ptr += 1){
485 if (*ptr == '-'){
486 sign *= -1;
487 }
488 else if (*ptr == '+'){
489 // do nothing
490 }
491 else{
492 break;
493 }
494 }
495
496 // determine radix
497 SYMS_U32 radix = 10;
498 if (ptr < opl && *ptr == '0'){
499 ptr += 1;
500 radix = 010;
501 if (ptr < opl){
502 if (*ptr == 'x'){
503 radix = 0x10;
504 ptr += 1;
505 }
506 else if (*ptr == 'b'){
507 radix = 2;
508 ptr += 1;
509 }
510 }
511 }
512
513 // determine integer value
515
516 SYMS_S64 result = ((SYMS_S64)x)*sign;
517 return(result);
518}
519
522 SYMS_U8 buffer[64];
523 SYMS_U8 *ptr = buffer;
524 if (x == 0){
525 *ptr = '0';
526 ptr += 1;
527 }
528 else{
529 for (;;){
530 *ptr = (x%10) + '0';
531 ptr += 1;
532 x /= 10;
533 if (x == 0){
534 break;
535 }
536 }
537
538 SYMS_U8 *a = buffer;
539 SYMS_U8 *b = ptr - 1;
540 for (;a < b;){
541 SYMS_U8 t = *a;
542 *a = *b;
543 *b = t;
544 a += 1;
545 b -= 1;
546 }
547 }
548
549 SYMS_String8 result = syms_push_string_copy(arena, syms_str8_range(buffer, ptr));
550 return(result);
551}
552
554//~ rjf: U64 Range Functions
555
556SYMS_API void
558 SYMS_QueuePush(list->first, list->last, node);
559 list->node_count += 1;
560 node->range = range;
561}
562
563SYMS_API void
568
569SYMS_API void
571{
572 if(list->last == 0)
573 {
574 *list = *to_push;
575 }
576 else if(to_push->first != 0)
577 {
578 list->last->next = to_push->first;
579 list->last = to_push->last;
580 list->node_count += to_push->node_count;
581 }
582}
583
586 SYMS_U64RangeArray result = {0};
587 result.count = list->node_count;
588 result.ranges = syms_push_array(arena, SYMS_U64Range, result.count);
590 SYMS_U64Range *range_opl = result.ranges + result.count;
591 for (SYMS_U64RangeNode *node = list->first;
592 node != 0 && range_ptr < range_opl;
593 node = node->next, range_ptr += 1){
594 *range_ptr = node->range;
595 }
596 if (range_ptr < range_opl){
598 result.count = (range_ptr - result.ranges);
599 }
600 return(result);
601}
602
604//~ nick: U64 List Functions
605
606SYMS_API void
608 SYMS_QueuePush(list->first, list->last, node);
609 list->count += 1;
610 node->u64 = v;
611}
612
613SYMS_API void
618
619SYMS_API void
621 if (dst->last == 0){
622 *dst = *src;
623 }
624 else if (src->first != 0){
625 dst->last->next = src->first;
626 dst->last = src->last;
627 dst->count += src->count;
628 }
630}
631
634 SYMS_U64Array result = {0};
635 result.u64 = syms_push_array(arena, SYMS_U64, list->count);
636 result.count = list->count;
637 SYMS_U64 *ptr = result.u64;
638 for (SYMS_U64Node *node = list->first;
639 node != 0;
640 node = node->next, ptr += 1){
641 *ptr = node->u64;
642 }
643 return(result);
644}
645
646
648//~ allen: Array Functions
649
652 SYMS_U64 result = 0;
653 if (1 <= n && n <= count){
654 result = u64[n - 1];
655 }
656 return(result);
657}
658
659
661//~ allen: Arena Functions
662
663SYMS_API void
670
671SYMS_API void
673 SYMS_U64 pos = syms_arena_get_pos(arena);
674 SYMS_U64 new_pos = 0;
675 if (pos >= amount){
676 new_pos = pos - amount;
677 }
679}
680
683 SYMS_U64 pos = syms_arena_get_pos(arena);
684 SYMS_ArenaTemp result = {arena, pos};
685 return(result);
686}
687
688SYMS_API void
692
695 // get compatible arena
697
698 // construct a temp
699 SYMS_ArenaTemp result = {0};
700 if (compatible_arena != 0){
702 }
703 return(result);
704}
705
707//~ allen: Syms Sort Node
708
711 SYMS_U64 first, SYMS_U64 opl){
712 SYMS_SortNode *result = *free_stack;
713 if (result != 0){
715 }
716 else{
717 result = syms_push_array(arena, SYMS_SortNode, 1);
718 }
719 SYMS_StackPush(*stack, result);
720 result->first = first;
721 result->opl = opl;
722 return(result);
723}
724
726//~ allen: Thread Lanes
727
729
730SYMS_API void
734
737 return(syms_thread_lane);
738}
739
741//~ rjf: Based Ranges
742
743SYMS_API void*
744syms_based_range_ptr(void *base, SYMS_U64Range range, SYMS_U64 offset){
745 void *result = 0;
746 if (offset < syms_u64_range_size(range)){
747 result = ((char*)base + range.min + offset);
748 }
749 return(result);
750}
751
754 SYMS_U64 result = 0;
755 void *ptr = syms_based_range_ptr(base, range, offset);
756 if (ptr != 0){
757 SYMS_U64 max_size = syms_u64_range_size(range) - offset;
759 syms_memmove(out, ptr, result);
760 }
761 return(result);
762}
763
766{
767 SYMS_U64 value = 0;
769 SYMS_U64 shift = 0;
770 SYMS_U8 byte = 0;
771 for(SYMS_U64 read_offset = offset;
772 syms_based_range_read_struct(base, range, read_offset, &byte) == 1;
773 read_offset += 1)
774 {
775 bytes_read += 1;
776 SYMS_U8 val = byte & 0x7fu;
777 value |= ((SYMS_U64)val) << shift;
778 if((byte&0x80u) == 0)
779 {
780 break;
781 }
782 shift += 7u;
783 }
784 if(out_value != 0)
785 {
786 *out_value = value;
787 }
788 return bytes_read;
789}
790
793{
794 SYMS_U64 value = 0;
796 SYMS_U64 shift = 0;
797 SYMS_U8 byte = 0;
798 for(SYMS_U64 read_offset = offset;
799 syms_based_range_read_struct(base, range, read_offset, &byte) == 1;
800 read_offset += 1)
801 {
802 bytes_read += 1;
803 SYMS_U8 val = byte & 0x7fu;
804 value |= ((SYMS_U64)val) << shift;
805 shift += 7u;
806 if((byte&0x80u) == 0)
807 {
808 if(shift < sizeof(value) * 8 && (byte & 0x40u) != 0)
809 {
810 value |= -(SYMS_S64)(1ull << shift);
811 }
812 break;
813 }
814 }
815 if(out_value != 0)
816 {
817 *out_value = value;
818 }
819 return bytes_read;
820}
821
824 SYMS_String8 result = {0};
825 char *ptr = (char *)syms_based_range_ptr(base, range, offset);
826 if (ptr != 0){
827 char *first = ptr;
828 char *opl = (char*)base + range.max;
829 for (;ptr < opl && *ptr != 0; ptr += 1);
830 result.str = (SYMS_U8*)first;
831 result.size = (SYMS_U64)(ptr - first);
832 }
833 return(result);
834}
835
837//~ allen: Memory Views
838
841 SYMS_MemoryView result = {0};
842 result.data = data.str;
843 result.addr_first = base;
844 result.addr_opl = base + data.size;
845 return(result);
846}
847
850 SYMS_B32 result = syms_false;
851 if (memview->addr_first <= addr &&
852 addr <= addr + size &&
853 addr + size <= memview->addr_opl){
854 result = syms_true;
855 syms_memmove(ptr, (SYMS_U8*)memview->data + addr - memview->addr_first, size);
856 }
857 return(result);
858}
859
860SYMS_API void
862 unwind_result->dead = syms_true;
863 unwind_result->missed_read = syms_true;
864 unwind_result->missed_read_addr = addr;
865}
866
868//~ nick: Bit manipulations
869
872{
873 SYMS_U16 result = (((x & 0xFF00) >> 8) |
874 ((x & 0x00FF) << 8));
875 return result;
876}
877
880{
881 SYMS_U32 result = (((x & 0xFF000000) >> 24) |
882 ((x & 0x00FF0000) >> 8) |
883 ((x & 0x0000FF00) << 8) |
884 ((x & 0x000000FF) << 24));
885 return result;
886}
887
890{
891 // TODO(nick): naive bswap, replace with something that is faster like an intrinsic
892 SYMS_U64 result = (((x & 0xFF00000000000000ULL) >> 56) |
893 ((x & 0x00FF000000000000ULL) >> 40) |
894 ((x & 0x0000FF0000000000ULL) >> 24) |
895 ((x & 0x000000FF00000000ULL) >> 8) |
896 ((x & 0x00000000FF000000ULL) << 8) |
897 ((x & 0x0000000000FF0000ULL) << 24) |
898 ((x & 0x000000000000FF00ULL) << 40) |
899 ((x & 0x00000000000000FFULL) << 56));
900 return result;
901}
902
903SYMS_API void
905{
906 for(SYMS_U32 i = 0, k = size - 1; i < size / 2; ++i, --k)
907 {
908 SYMS_Swap(SYMS_U8, ((SYMS_U8*)p)[k], ((SYMS_U8*)p)[i]);
909 }
910}
911
913//~ rjf: Generated Code
914
917
919//~ allen: Dev Features
920
921#include "syms_dev.c"
922
923#endif // SYMS_BASE_C
EGLSurface EGLint const EGLint EGLnsecsANDROID * values
Definition AndroidOpenGLFunctions.h:11
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
int bit(int a, int b)
Definition DebugDraw.cpp:33
bool left(const int *a, const int *b, const int *c)
Definition RecastMesh.cpp:182
int next(int i, int n)
Definition RecastMesh.cpp:164
float shift(float inValue, float expShift)
Definition RenderCore.cpp:859
char * dst
Definition lz4.h:735
float v
Definition radaudio_mdct.cpp:62
Definition syms_base.h:402
Definition syms_base.h:410
SYMS_U64 addr_first
Definition syms_base.h:416
SYMS_U64 addr_opl
Definition syms_base.h:417
void * data
Definition syms_base.h:415
Definition syms_base.h:359
Definition syms_base.h:371
SYMS_U32 bitshift
Definition syms_base.h:375
SYMS_String8 name
Definition syms_base.h:372
SYMS_U32 mask
Definition syms_base.h:374
Definition syms_base.h:390
Definition syms_base.h:366
Definition syms_base.h:334
SYMS_U64 opl
Definition syms_base.h:337
SYMS_U64 first
Definition syms_base.h:336
Definition syms_base.h:306
SYMS_String8Node * first
Definition syms_base.h:307
SYMS_U64 total_size
Definition syms_base.h:310
SYMS_U64 node_count
Definition syms_base.h:309
SYMS_String8Node * last
Definition syms_base.h:308
Definition syms_base.h:301
SYMS_String8 string
Definition syms_base.h:303
Definition syms_base.h:296
SYMS_U8 * str
Definition syms_base.h:297
SYMS_U64 size
Definition syms_base.h:298
Definition syms_base.h:325
Definition syms_base.h:233
SYMS_U64 * u64
Definition syms_base.h:234
SYMS_U64 count
Definition syms_base.h:235
Definition syms_base.h:290
SYMS_U64 count
Definition syms_base.h:293
SYMS_U64Node * last
Definition syms_base.h:292
SYMS_U64Node * first
Definition syms_base.h:291
Definition syms_base.h:285
SYMS_U64 u64
Definition syms_base.h:287
struct SYMS_U64Node * next
Definition syms_base.h:286
Definition syms_base.h:280
SYMS_U64Range * ranges
Definition syms_base.h:281
SYMS_U64 count
Definition syms_base.h:282
Definition syms_base.h:274
Definition syms_base.h:269
SYMS_U64Range range
Definition syms_base.h:271
Definition syms_base.h:264
SYMS_U64 max
Definition syms_base.h:266
SYMS_U64 min
Definition syms_base.h:265
Definition syms_base.h:420
SYMS_API SYMS_U64 syms_hash_u64(SYMS_U64 x)
Definition syms_base.c:57
SYMS_API SYMS_U64 syms_u64_range_size(SYMS_U64Range range)
Definition syms_base.c:31
SYMS_API SYMS_SerialValue * syms_serial_value_from_enum_value(SYMS_SerialType *type, SYMS_U64 value)
Definition syms_base.c:97
SYMS_API SYMS_SortNode * syms_sort_node_push(SYMS_Arena *arena, SYMS_SortNode **stack, SYMS_SortNode **free_stack, SYMS_U64 first, SYMS_U64 opl)
Definition syms_base.c:710
SYMS_API SYMS_String8 syms_version_string(void)
Definition syms_base.c:10
SYMS_API SYMS_SerialFlag * syms_serial_first_flag(SYMS_SerialType *type)
Definition syms_base.c:88
SYMS_THREAD_LOCAL SYMS_U64 syms_thread_lane
Definition syms_base.c:728
SYMS_API SYMS_U64Array syms_u64_array_from_list(SYMS_Arena *arena, SYMS_U64List *list)
Definition syms_base.c:633
SYMS_API SYMS_U32 syms_lowercase_from_codepoint(SYMS_U32 codepoint)
Definition syms_base.c:160
SYMS_READ_ONLY SYMS_GLOBAL SYMS_SerialValue syms_null_serial_value
Definition syms_base.c:66
SYMS_API SYMS_U64 syms_1based_checked_lookup_u64(SYMS_U64 *u64, SYMS_U64 count, SYMS_U64 n)
Definition syms_base.c:651
SYMS_API SYMS_U64 syms_based_range_read(void *base, SYMS_U64Range range, SYMS_U64 offset, SYMS_U64 out_size, void *out)
Definition syms_base.c:753
SYMS_API SYMS_String8 syms_string_list_join(SYMS_Arena *arena, SYMS_String8List *list, SYMS_StringJoin *join_ptr)
Definition syms_base.c:315
SYMS_API SYMS_String8 syms_str8_range(SYMS_U8 *first, SYMS_U8 *opl)
Definition syms_base.c:184
SYMS_API void syms_string_list_push_node_front(SYMS_String8Node *node, SYMS_String8List *list, SYMS_String8 string)
Definition syms_base.c:272
SYMS_API SYMS_S64 syms_s64_from_string_c_rules(SYMS_String8 str)
Definition syms_base.c:478
SYMS_API void syms_u64_range_list_concat(SYMS_U64RangeList *list, SYMS_U64RangeList *to_push)
Definition syms_base.c:570
SYMS_API SYMS_B32 syms_memory_view_read(SYMS_MemoryView *memview, SYMS_U64 addr, SYMS_U64 size, void *ptr)
Definition syms_base.c:849
SYMS_API void syms_unwind_result_missed_read(SYMS_UnwindResult *unwind_result, SYMS_U64 addr)
Definition syms_base.c:861
SYMS_API void syms_arena_push_align(SYMS_Arena *arena, SYMS_U64 pow2_boundary)
Definition syms_base.c:664
SYMS_API SYMS_SerialValue * syms_serial_first_value(SYMS_SerialType *type)
Definition syms_base.c:79
SYMS_API SYMS_U64 syms_hash_djb2_continue(SYMS_String8 string, SYMS_U64 intermediate_hash)
Definition syms_base.c:46
SYMS_API SYMS_ArenaTemp syms_get_scratch(SYMS_Arena **conflicts, SYMS_U64 conflict_count)
Definition syms_base.c:694
SYMS_API SYMS_String8 syms_str8_cstring(char *str)
Definition syms_base.c:175
SYMS_API SYMS_String8List syms_string_list_concat(SYMS_String8List *left, SYMS_String8List *right)
Definition syms_base.c:294
SYMS_API SYMS_B32 syms_string_match(SYMS_String8 a, SYMS_String8 b, SYMS_StringMatchFlags flags)
Definition syms_base.c:210
SYMS_API void * syms_based_range_ptr(void *base, SYMS_U64Range range, SYMS_U64 offset)
Definition syms_base.c:744
SYMS_API SYMS_U64 syms_get_lane(void)
Definition syms_base.c:736
SYMS_API SYMS_String8 syms_string_trunc_symbol_heuristic(SYMS_String8 string)
Definition syms_base.c:361
SYMS_API void syms_u64_range_list_push(SYMS_Arena *arena, SYMS_U64RangeList *list, SYMS_U64Range range)
Definition syms_base.c:564
SYMS_API void syms_arena_put_back(SYMS_Arena *arena, SYMS_U64 amount)
Definition syms_base.c:672
SYMS_API SYMS_U64Range syms_make_u64_range(SYMS_U64 min, SYMS_U64 max)
Definition syms_base.c:18
SYMS_API SYMS_B32 syms_codepoint_is_whitespace(SYMS_U32 codepoint)
Definition syms_base.c:154
SYMS_API SYMS_U64RangeArray syms_u64_range_array_from_list(SYMS_Arena *arena, SYMS_U64RangeList *list)
Definition syms_base.c:585
SYMS_API void syms_u64_range_list_push_node(SYMS_U64RangeNode *node, SYMS_U64RangeList *list, SYMS_U64Range range)
Definition syms_base.c:557
SYMS_API void syms_string_list_push_node(SYMS_String8Node *node, SYMS_String8List *list, SYMS_String8 string)
Definition syms_base.c:264
SYMS_API void syms_u64_list_push(SYMS_Arena *arena, SYMS_U64List *list, SYMS_U64 v)
Definition syms_base.c:614
SYMS_API SYMS_SerialField * syms_serial_first_field(SYMS_SerialType *type)
Definition syms_base.c:70
SYMS_READ_ONLY SYMS_GLOBAL SYMS_SerialFlag syms_null_serial_flag
Definition syms_base.c:67
SYMS_API SYMS_U16 syms_bswap_u16(SYMS_U16 x)
Definition syms_base.c:871
SYMS_API SYMS_U64 syms_based_range_read_sleb128(void *base, SYMS_U64Range range, SYMS_U64 offset, SYMS_S64 *out_value)
Definition syms_base.c:792
SYMS_API SYMS_String8 syms_based_range_read_string(void *base, SYMS_U64Range range, SYMS_U64 offset)
Definition syms_base.c:823
SYMS_API SYMS_U64 syms_enum_index_from_value_identity(SYMS_U64 v)
Definition syms_base.c:148
SYMS_API SYMS_U64 syms_bswap_u64(SYMS_U64 x)
Definition syms_base.c:889
SYMS_API void syms_set_lane(SYMS_U64 lane)
Definition syms_base.c:731
SYMS_API void syms_u64_list_push_node(SYMS_U64Node *node, SYMS_U64List *list, SYMS_U64 v)
Definition syms_base.c:607
SYMS_API SYMS_U64 syms_hash_djb2(SYMS_String8 string)
Definition syms_base.c:40
SYMS_API SYMS_SerialFlag * syms_serial_flag_from_bit_offset(SYMS_SerialType *type, SYMS_U64 bit_off)
Definition syms_base.c:111
SYMS_API SYMS_U32 syms_bswap_u32(SYMS_U32 x)
Definition syms_base.c:879
SYMS_API void syms_arena_temp_end(SYMS_ArenaTemp temp)
Definition syms_base.c:689
SYMS_API SYMS_U64Range syms_make_u64_inrange(SYMS_U64Range range, SYMS_U64 offset, SYMS_U64 size)
Definition syms_base.c:24
SYMS_API SYMS_String8 syms_str8(SYMS_U8 *str, SYMS_U64 size)
Definition syms_base.c:169
SYMS_API SYMS_U8 * syms_decode_utf8(SYMS_U8 *p, SYMS_U32 *dst)
Definition syms_base.c:246
SYMS_API void syms_string_list_push_front(SYMS_Arena *arena, SYMS_String8List *list, SYMS_String8 string)
Definition syms_base.c:288
SYMS_API SYMS_U64 syms_based_range_read_uleb128(void *base, SYMS_U64Range range, SYMS_U64 offset, SYMS_U64 *out_value)
Definition syms_base.c:765
SYMS_API SYMS_String8 syms_push_string_copy(SYMS_Arena *arena, SYMS_String8 string)
Definition syms_base.c:353
SYMS_API void syms_string_list_push(SYMS_Arena *arena, SYMS_String8List *list, SYMS_String8 string)
Definition syms_base.c:282
SYMS_API void syms_u64_list_concat_in_place(SYMS_U64List *dst, SYMS_U64List *src)
Definition syms_base.c:620
SYMS_API SYMS_MemoryView syms_memory_view_make(SYMS_String8 data, SYMS_U64 base)
Definition syms_base.c:840
SYMS_API SYMS_String8 syms_string_from_u64(SYMS_Arena *arena, SYMS_U64 x)
Definition syms_base.c:521
SYMS_API SYMS_String8List syms_string_split(SYMS_Arena *arena, SYMS_String8 input, SYMS_U32 delimiter)
Definition syms_base.c:390
SYMS_API SYMS_U64 syms_u64_from_string(SYMS_String8 str, SYMS_U32 radix)
Definition syms_base.c:422
SYMS_API SYMS_String8List syms_string_list_from_flags(SYMS_Arena *arena, SYMS_SerialType *type, SYMS_U32 flags)
Definition syms_base.c:130
SYMS_API SYMS_String8 syms_str8_skip_chop_whitespace(SYMS_String8 str)
Definition syms_base.c:190
SYMS_API void syms_bswap_bytes(void *p, SYMS_U64 size)
Definition syms_base.c:904
SYMS_API SYMS_ArenaTemp syms_arena_temp_begin(SYMS_Arena *arena)
Definition syms_base.c:682
#define syms_true
Definition syms_base.h:105
SYMS_GLOBAL SYMS_U64 syms_hash_djb2_initial
Definition syms_base.h:451
#define SYMS_MIN(a, b)
Definition syms_base.h:179
#define SYMS_Swap(T, a, b)
Definition syms_base.h:190
#define SYMS_StackPush(f, n)
Definition syms_base.h:227
SYMS_U32 SYMS_StringMatchFlags
Definition syms_base.h:318
#define syms_based_range_read_struct(b, r, o, p)
Definition syms_base.h:593
#define SYMS_VERSION_STR
Definition syms_base.h:13
#define syms_push_array(a, T, c)
Definition syms_base.h:561
#define syms_memzero_struct(s)
Definition syms_base.h:161
#define syms_get_implicit_thread_arena
Definition syms_base.h:553
#define SYMS_AlignPow2(a, b)
Definition syms_base.h:187
#define SYMS_LOCAL
Definition syms_base.h:43
@ SYMS_StringMatchFlag_SlashInsensitive
Definition syms_base.h:322
@ SYMS_StringMatchFlag_RightSideSloppy
Definition syms_base.h:321
@ SYMS_StringMatchFlag_CaseInsensitive
Definition syms_base.h:320
#define syms_arena_get_pos
Definition syms_base.h:546
#define SYMS_READ_ONLY
Definition syms_base.h:57
#define SYMS_ClampTop(a, b)
Definition syms_base.h:182
#define syms_false
Definition syms_base.h:104
#define SYMS_API
Definition syms_base.h:29
#define SYMS_ASSERT(x)
Definition syms_base.h:125
#define syms_arena_push
Definition syms_base.h:547
@ SYMS_SerialTypeKind_Flags
Definition syms_base.h:385
@ SYMS_SerialTypeKind_Enum
Definition syms_base.h:384
@ SYMS_SerialTypeKind_Struct
Definition syms_base.h:386
SYMS_S32 SYMS_B32
Definition syms_base.h:99
#define SYMS_StackPop(f)
Definition syms_base.h:228
#define SYMS_QueuePushFront(f, l, n)
Definition syms_base.h:221
#define syms_arena_pop_to
Definition syms_base.h:548
SYMS_S8 SYMS_B8
Definition syms_base.h:97
#define syms_str8_lit(s)
Definition syms_base.h:483
#define SYMS_QueuePush(f, l, n)
Definition syms_base.h:220
#define SYMS_GLOBAL
Definition syms_base.h:42
uint32_t SYMS_U32
Definition syms_crt_overrides.h:38
uint64_t SYMS_U64
Definition syms_crt_overrides.h:39
#define syms_memmove
Definition syms_crt_overrides.h:65
#define SYMS_U64
Definition syms_crt_overrides.h:54
#define SYMS_U32
Definition syms_crt_overrides.h:53
uint16_t SYMS_U16
Definition syms_crt_overrides.h:37
int64_t SYMS_S64
Definition syms_crt_overrides.h:35
#define SYMS_S64
Definition syms_crt_overrides.h:50
uint8_t SYMS_U8
Definition syms_crt_overrides.h:36
#define SYMS_Arena
Definition syms_default_arena.h:61