character-properties.c (1898B)
1 /* See LICENSE file for copyright and license details. */ 2 #include <errno.h> 3 #include <inttypes.h> 4 #include <stddef.h> 5 #include <stdint.h> 6 #include <stdio.h> 7 #include <stdlib.h> 8 #include <string.h> 9 10 #include "util.h" 11 12 #define FILE_EMOJI "data/emoji-data.txt" 13 #define FILE_GRAPHEME "data/GraphemeBreakProperty.txt" 14 15 static const struct property_spec char_break_property[] = { 16 { 17 .enumname = "OTHER", 18 .file = NULL, 19 .ucdname = NULL, 20 }, 21 { 22 .enumname = "CONTROL", 23 .file = FILE_GRAPHEME, 24 .ucdname = "Control", 25 }, 26 { 27 .enumname = "CR", 28 .file = FILE_GRAPHEME, 29 .ucdname = "CR", 30 }, 31 { 32 .enumname = "EXTEND", 33 .file = FILE_GRAPHEME, 34 .ucdname = "Extend", 35 }, 36 { 37 .enumname = "EXTENDED_PICTOGRAPHIC", 38 .file = FILE_EMOJI, 39 .ucdname = "Extended_Pictographic", 40 }, 41 { 42 .enumname = "HANGUL_L", 43 .file = FILE_GRAPHEME, 44 .ucdname = "L", 45 }, 46 { 47 .enumname = "HANGUL_V", 48 .file = FILE_GRAPHEME, 49 .ucdname = "V", 50 }, 51 { 52 .enumname = "HANGUL_T", 53 .file = FILE_GRAPHEME, 54 .ucdname = "T", 55 }, 56 { 57 .enumname = "HANGUL_LV", 58 .file = FILE_GRAPHEME, 59 .ucdname = "LV", 60 }, 61 { 62 .enumname = "HANGUL_LVT", 63 .file = FILE_GRAPHEME, 64 .ucdname = "LVT", 65 }, 66 { 67 .enumname = "LF", 68 .file = FILE_GRAPHEME, 69 .ucdname = "LF", 70 }, 71 { 72 .enumname = "PREPEND", 73 .file = FILE_GRAPHEME, 74 .ucdname = "Prepend", 75 }, 76 { 77 .enumname = "REGIONAL_INDICATOR", 78 .file = FILE_GRAPHEME, 79 .ucdname = "Regional_Indicator", 80 }, 81 { 82 .enumname = "SPACINGMARK", 83 .file = FILE_GRAPHEME, 84 .ucdname = "SpacingMark", 85 }, 86 { 87 .enumname = "ZWJ", 88 .file = FILE_GRAPHEME, 89 .ucdname = "ZWJ", 90 }, 91 }; 92 93 int 94 main(int argc, char *argv[]) 95 { 96 (void)argc; 97 98 properties_generate_break_property(char_break_property, 99 LEN(char_break_property), 100 "char", argv[0]); 101 102 return 0; 103 }