aboutsummaryrefslogtreecommitdiffstats
path: root/libfonts_deallocate_encoding.c
diff options
context:
space:
mode:
Diffstat (limited to 'libfonts_deallocate_encoding.c')
-rw-r--r--libfonts_deallocate_encoding.c38
1 files changed, 38 insertions, 0 deletions
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