From 1bc3cedf6d2df394ceca7b68d19cb17980045e97 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 19 Jan 2023 23:05:23 +0100 Subject: Add encoding parsing and m fix libfonts_parse_alias_line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libfonts_deallocate_encoding.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 libfonts_deallocate_encoding.c (limited to 'libfonts_deallocate_encoding.c') diff --git a/libfonts_deallocate_encoding.c b/libfonts_deallocate_encoding.c new file mode 100644 index 0000000..6adbb5e --- /dev/null +++ b/libfonts_deallocate_encoding.c @@ -0,0 +1,38 @@ +/* See LICENSE file for copyright and license details. */ +#include "common.h" +#ifndef TEST + + +void +libfonts_deallocate_encoding(struct libfonts_encoding *this) +{ + if (this) { + if (this->mappings) { + while (this->nmappings) + libfonts_deallocate_encoding_mapping(&this->mappings[--this->nmappings]); + free(this->mappings); + this->mappings = NULL; + } + if (this->aliases) { + while (this->naliases) + free(this->aliases[--this->naliases]); + free(this->aliases); + this->aliases = NULL; + } + free(this->name); + this->name = NULL; + } +} + + +#else + + +int +main(void) +{ + return 0; /* XXX add test */ +} + + +#endif -- cgit v1.2.3-70-g09d2