aboutsummaryrefslogtreecommitdiffstats
path: root/libgamma_const_of_connector_type.c
blob: 59589532fb8884b084615651eea4162c1bc3e6fb (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
/* See LICENSE file for copyright and license details. */
#include "common.h"


/**
 * Get the name of the constant for a connector
 * type, for example "LIBGAMMA_CONNECTOR_TYPE_VGA"
 * for `LIBGAMMA_CONNECTOR_TYPE_VGA`
 * 
 * @param   connector  The connector type
 * @return             The name of the constant for connector type,
 *                     `NULL` if not recognised (errno is not changed)
 */
const char *
libgamma_const_of_connector_type(int connector)
{
	switch (connector) {
#define X(CONST, ...)\
	case CONST:\
		return #CONST;
	LIST_CONNECTOR_TYPES(X)
#undef X
	default:
		return NULL;
	}
}