aboutsummaryrefslogtreecommitdiffstats
path: root/libfonts_parse_aa__.c
blob: 5946b1c337654cb14d0104046f5662e1d974f901 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
/* See LICENSE file for copyright and license details. */
#include "common.h"
#ifndef TEST


#define LIST_ANTIALIASINGS(X)\
	X(LIBFONTS_ANTIALIASING_UNSPECIFIED, "unspecified")\
	X(LIBFONTS_ANTIALIASING_NONE, "none")\
	X(LIBFONTS_ANTIALIASING_NONE, "aliased")\
	X(LIBFONTS_ANTIALIASING_GREYSCALE, "greyscale")\
	X(LIBFONTS_ANTIALIASING_GREYSCALE, "grayscale")\
	X(LIBFONTS_ANTIALIASING_GREYSCALE, "grey")\
	X(LIBFONTS_ANTIALIASING_GREYSCALE, "gray")\
	X(LIBFONTS_ANTIALIASING_GREYSCALE, "antialiased")\
	X(LIBFONTS_ANTIALIASING_GREYSCALE_FORCED, "greyscale!")\
	X(LIBFONTS_ANTIALIASING_GREYSCALE_FORCED, "grayscale!")\
	X(LIBFONTS_ANTIALIASING_GREYSCALE_FORCED, "grey!")\
	X(LIBFONTS_ANTIALIASING_GREYSCALE_FORCED, "gray!")\
	X(LIBFONTS_ANTIALIASING_GREYSCALE_FORCED, "antialiased!")\
	X(LIBFONTS_ANTIALIASING_SUBPIXEL, "subpixel")\
	X(LIBFONTS_ANTIALIASING_SUBPIXEL, "glitter")\
	X(LIBFONTS_ANTIALIASING_SUBPIXEL_FORCED, "subpixel!")\
	X(LIBFONTS_ANTIALIASING_SUBPIXEL_FORCED, "glitter!")

int
libfonts_parse_aa__(enum libfonts_antialiasing *outp, const char *value)
{
#define X(C, S)\
	if (!strcasecmp(value, S)) {\
		*outp = C;\
	} else
	LIST_ANTIALIASINGS(X) {
		return 0;
	}
#undef X
	return 1;

}


#else


int
main(void)
{
	return 0; /* TODO add test */
}


#endif