From 6421c8217b38d7b5605c652b89793b2de0192d91 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 20 Nov 2026 15:45:17 +0100 Subject: Add libgamma_get_fd and fix some minor issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libgamma.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'libgamma.h') diff --git a/libgamma.h b/libgamma.h index ab66afc..93af622 100644 --- a/libgamma.h +++ b/libgamma.h @@ -1849,7 +1849,7 @@ int libgamma_value_of_error(const char *); * @return The group that the user needs to be a member of * if `LIBGAMMA_DEVICE_REQUIRE_GROUP` is returned */ -LIBGAMMA_GCC_ONLY__(__attribute__((__warn_unused_result__))) +LIBGAMMA_GCC_ONLY__(__attribute__((__warn_unused_result__, __pure__))) #ifndef __WIN32__ gid_t libgamma_group_gid_get(void); #else @@ -1878,7 +1878,7 @@ void libgamma_group_gid_set(short); * if the name of the group `libgamma_group_gid` cannot * be determined */ -LIBGAMMA_GCC_ONLY__(__attribute__((__warn_unused_result__))) +LIBGAMMA_GCC_ONLY__(__attribute__((__warn_unused_result__, __pure__))) const char *libgamma_group_name_get(void); /** @@ -2319,6 +2319,18 @@ int libgamma_site_initialise(struct libgamma_site_state *restrict, int, char *re LIBGAMMA_GCC_ONLY__(__attribute__((__nonnull__))) void libgamma_site_destroy(struct libgamma_site_state *restrict); +/** + * 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; + * the file descriptor is owned by the site state and must not be + * closed by the caller + */ +LIBGAMMA_GCC_ONLY__(__attribute__((__nonnull__, __warn_unused_result__))) +int libgamma_get_fd(struct libgamma_site_state *restrict); + /** * Release all resources held by a site state * and free the site state pointer -- cgit v1.3.1