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


/**
 * Return the capabilities of an adjustment method
 * 
 * @param   this    The data structure to fill with the method's capabilities
 * @param   method  The adjustment method (display server and protocol)
 * @return          Zero on success, otherwise (negative) the value of an
 *                  error identifier provided by this library
 */
int
libgamma_method_capabilities(libgamma_method_capabilities_t *restrict this, int method)
{
	memset(this, 0, sizeof(*this));

	switch (method) {
#define X(CONST, CNAME, ...)\
	case CONST:\
		libgamma_##CNAME##_method_capabilities(this);\
		return 0;
	LIST_AVAILABLE_METHODS(X)
#undef X
	default:
		return LIBGAMMA_NO_SUCH_ADJUSTMENT_METHOD;
	}
}