MCPcopy Create free account
hub / github.com/NetHack/NetHack / set_map_u

Function set_map_u

src/utf8map.c:36–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36int
37set_map_u(glyph_map *gmap, uint32 utf32ch, const uint8 *utf8str)
38{
39 glyph_map *tmpgm = gmap;
40
41 if (!tmpgm || !utf32ch)
42 return 0;
43
44 if (gmap->u == 0) {
45 gmap->u =
46 (struct unicode_representation *) alloc(sizeof *gmap->u);
47 gmap->u->utf8str = 0;
48 }
49 if (gmap->u->utf8str != 0) {
50 free(gmap->u->utf8str);
51 gmap->u->utf8str = 0;
52 }
53 gmap->u->utf8str = (uint8 *) dupstr((const char *) utf8str);
54 gmap->u->utf32ch = utf32ch;
55 return 1;
56}
57
58void
59free_all_glyphmap_u(void)

Callers 2

apply_customizationsFunction · 0.85
to_unicode_callbackFunction · 0.85

Calls 2

dupstrFunction · 0.85
allocFunction · 0.70

Tested by

no test coverage detected