diff options
| author | Mattias Andrée <m@maandree.se> | 2026-11-20 15:45:17 +0100 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2026-11-20 15:45:17 +0100 |
| commit | 6421c8217b38d7b5605c652b89793b2de0192d91 (patch) | |
| tree | 5234e86fc5d223be29e0751b0e6165d26ba12f55 /libgamma_get_fd.c | |
| parent | fix typo (diff) | |
| download | libgamma-6421c8217b38d7b5605c652b89793b2de0192d91.tar.gz libgamma-6421c8217b38d7b5605c652b89793b2de0192d91.tar.bz2 libgamma-6421c8217b38d7b5605c652b89793b2de0192d91.tar.xz | |
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libgamma_get_fd.c')
| -rw-r--r-- | libgamma_get_fd.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libgamma_get_fd.c b/libgamma_get_fd.c new file mode 100644 index 0000000..70c1522 --- /dev/null +++ b/libgamma_get_fd.c @@ -0,0 +1,24 @@ +/* See LICENSE file for copyright and license details. */ +#include "common.h" + + +/** + * Get the file descriptor used to communicate with the display server + * + * @param this The site state + * @return The file descriptor, or -1 if the adjustment method does not + * use a file descriptor to communicate with the display server + */ +int +libgamma_get_fd(struct libgamma_site_state *restrict this) +{ + switch (this->method) { +#define X(CONST, CNAME, ...)\ + case CONST:\ + return libgamma_##CNAME##_get_fd(this); + LIST_AVAILABLE_METHODS(X) +#undef X + default: + return -1; + } +} |
