/work/workdir/UnpackedTarball/fontconfig/src/fcgenericalias.c
Line | Count | Source |
1 | | /* Copyright (C) 2026 fontconfig Authors */ |
2 | | /* SPDX-License-Identifier: HPND */ |
3 | | |
4 | | #include "fcint.h" |
5 | | |
6 | | #include <stdint.h> |
7 | | |
8 | | static unsigned int |
9 | | fc_generic_family_hash (register const char *str, register FC_GPERF_SIZE_T len); |
10 | | |
11 | | static const struct FcGenericFamilyEntry * |
12 | | fc_generic_family_lookup (register const char *str, register FC_GPERF_SIZE_T len); |
13 | | |
14 | | #define GPERF_DOWNCASE 1 |
15 | | #define GPERF_CASE_STRCMP 1 |
16 | | static int |
17 | | gperf_case_strcmp (register const char *s1, register const char *s2) |
18 | 12 | { |
19 | 12 | return FcStrCmpIgnoreBlanksAndCase ((const FcChar8 *)s1, (const FcChar8 *)s2); |
20 | 12 | } |
21 | | |
22 | | #include "fcgenericfamily.h" |
23 | | |
24 | | uint32_t |
25 | | FcGenericAliasGetClassification (const char *family) |
26 | 14 | { |
27 | 14 | const struct FcGenericFamilyEntry *entry; |
28 | 14 | size_t len; |
29 | 14 | uint32_t result = FC_FAMILY_UNKNOWN; |
30 | | |
31 | 14 | if (!family) |
32 | 0 | return FC_FAMILY_UNKNOWN; |
33 | | |
34 | 14 | len = strlen (family); |
35 | 14 | entry = fc_generic_family_lookup (family, len); |
36 | 14 | if (entry) |
37 | 12 | result = entry->classification; |
38 | | |
39 | 14 | return result; |
40 | 14 | } |