| 623 | } |
| 624 | |
| 625 | static const char *cs_bcl_alias(const char *base, size_t len) { |
| 626 | static const struct { |
| 627 | const char *bcl; |
| 628 | const char *kw; |
| 629 | } map[] = { |
| 630 | {"Int32", "int"}, {"Int64", "long"}, {"Int16", "short"}, {"Byte", "byte"}, |
| 631 | {"SByte", "sbyte"}, {"UInt32", "uint"}, {"UInt64", "ulong"}, {"UInt16", "ushort"}, |
| 632 | {"Single", "float"}, {"Double", "double"}, {"Decimal", "decimal"}, {"Boolean", "bool"}, |
| 633 | {"Char", "char"}, {"String", "string"}, {"Object", "object"}, {"IntPtr", "nint"}, |
| 634 | {"UIntPtr", "nuint"}, {"Void", "void"}, |
| 635 | }; |
| 636 | for (size_t i = 0; i < sizeof(map) / sizeof(map[0]); i++) { |
| 637 | if (strlen(map[i].bcl) == len && memcmp(map[i].bcl, base, len) == 0) { |
| 638 | return map[i].kw; |
| 639 | } |
| 640 | } |
| 641 | return NULL; |
| 642 | } |
| 643 | |
| 644 | size_t cbm_doclink_cs_norm_type(const char *in, size_t len, char *out, size_t cap) { |
| 645 | if (!out || cap == 0) { |
no outgoing calls
no test coverage detected