aboutsummaryrefslogtreecommitdiffstats
path: root/libfonts_deallocate_encoding.c
blob: 6adbb5e54f579e1edb831a462ae7ca60b2e2d55d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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