diff options
author | Arnaud Fontaine <arnau@debian.org> | 2009-12-12 15:15:17 +0100 |
---|---|---|
committer | Arnaud Fontaine <arnau@debian.org> | 2010-11-14 20:22:28 +0900 |
commit | 7b3479b2cb925082ecbb4abdaee4c783deb4d818 (patch) | |
tree | 8ccef9445ea41cdd8c4bdc442f846162c8decc94 /ewmh | |
parent | be4222e977564fc3c06ae5d17dbb4ed4597604a3 (diff) |
Remove UTF8 reply macro in favor of inline functions
Diffstat (limited to 'ewmh')
-rw-r--r-- | ewmh/ewmh.c.m4 | 23 | ||||
-rw-r--r-- | ewmh/xcb_ewmh.h.m4 | 103 |
2 files changed, 72 insertions, 54 deletions
diff --git a/ewmh/ewmh.c.m4 b/ewmh/ewmh.c.m4 index 08233f8..7a47c3f 100644 --- a/ewmh/ewmh.c.m4 +++ b/ewmh/ewmh.c.m4 @@ -149,8 +149,7 @@ static ewmh_atom_t ewmh_atoms[] = {dnl xcb_get_property_reply(ewmh->connection, \ cookie, e); \ \ - const uint8_t ret = xcb_ewmh_get_##fname##_from_reply(atom_value, \ - r); \ + const uint8_t ret = xcb_ewmh_get_##fname##_from_reply(atom_value, r); \ \ free(r); \ return ret; \ @@ -408,27 +407,8 @@ xcb_ewmh_get_utf8_strings_reply_wipe(xcb_ewmh_get_utf8_strings_reply_t *data) free(data->_reply); } -#define DO_REPLY_UTF8_STRING(fname) \ - uint8_t \ - xcb_ewmh_get_##fname##_from_reply(xcb_ewmh_connection_t *ewmh, \ - xcb_ewmh_get_utf8_strings_reply_t *data, \ - xcb_get_property_reply_t *r) \ - { \ - return xcb_ewmh_get_utf8_strings_from_reply(ewmh, data, r); \ - } \ - \ - uint8_t \ - xcb_ewmh_get_##fname##_reply(xcb_ewmh_connection_t *ewmh, \ - xcb_get_property_cookie_t cookie, \ - xcb_ewmh_get_utf8_strings_reply_t *data, \ - xcb_generic_error_t **e) \ - { \ - return xcb_ewmh_get_utf8_strings_reply(ewmh, cookie, data, e); \ - } - #define DO_ROOT_UTF8_STRING(fname, property) \ DO_GET_ROOT_PROPERTY(fname, property, 0, UINT_MAX) \ - DO_REPLY_UTF8_STRING(fname) \ \ xcb_void_cookie_t \ xcb_ewmh_set_##fname(xcb_ewmh_connection_t *ewmh, \ @@ -455,7 +435,6 @@ xcb_ewmh_get_utf8_strings_reply_wipe(xcb_ewmh_get_utf8_strings_reply_t *data) #define DO_UTF8_STRING(fname, property) \ DO_GET_PROPERTY(fname, property, 0, UINT_MAX) \ - DO_REPLY_UTF8_STRING(fname) \ \ xcb_void_cookie_t \ xcb_ewmh_set_##fname(xcb_ewmh_connection_t *ewmh, \ diff --git a/ewmh/xcb_ewmh.h.m4 b/ewmh/xcb_ewmh.h.m4 index 8a7ee26..8949971 100644 --- a/ewmh/xcb_ewmh.h.m4 +++ b/ewmh/xcb_ewmh.h.m4 @@ -1127,9 +1127,13 @@ xcb_get_property_cookie_t xcb_ewmh_get_desktop_names(xcb_ewmh_connection_t *ewmh * @param r GetProperty _NET_DESKTOP_NAMES reply * @return Return 1 on success, 0 otherwise */ -uint8_t xcb_ewmh_get_desktop_names_from_reply(xcb_ewmh_connection_t *ewmh, - xcb_ewmh_get_utf8_strings_reply_t *names, - xcb_get_property_reply_t *r); +static inline uint8_t +xcb_ewmh_get_desktop_names_from_reply(xcb_ewmh_connection_t *ewmh, + xcb_ewmh_get_utf8_strings_reply_t *names, + xcb_get_property_reply_t *r) +{ + return xcb_ewmh_get_utf8_strings_from_reply(ewmh, data, r); +} /** * @brief Get reply from the GetProperty _NET_DESKTOP_NAMES cookie @@ -1144,10 +1148,14 @@ uint8_t xcb_ewmh_get_desktop_names_from_reply(xcb_ewmh_connection_t *ewmh, * @param The xcb_generic_error_t supplied * @return Return 1 on success, 0 otherwise */ -uint8_t xcb_ewmh_get_desktop_names_reply(xcb_ewmh_connection_t *ewmh, - xcb_get_property_cookie_t cookie, - xcb_ewmh_get_utf8_strings_reply_t *names, - xcb_generic_error_t **e); +static inline uint8_t +xcb_ewmh_get_desktop_names_reply(xcb_ewmh_connection_t *ewmh, + xcb_get_property_cookie_t cookie, + xcb_ewmh_get_utf8_strings_reply_t *names, + xcb_generic_error_t **e) +{ + return xcb_ewmh_get_utf8_strings_reply(ewmh, cookie, data, e); +} /** * @brief Send a ChangeProperty request for _NET_ACTIVE_WINDOW @@ -1589,14 +1597,21 @@ xcb_get_property_cookie_t xcb_ewmh_get_wm_name_unchecked(xcb_ewmh_connection_t * xcb_get_property_cookie_t xcb_ewmh_get_wm_name(xcb_ewmh_connection_t *ewmh, xcb_window_t window); -uint8_t xcb_ewmh_get_wm_name_from_reply(xcb_ewmh_connection_t *ewmh, - xcb_ewmh_get_utf8_strings_reply_t *data, - xcb_get_property_reply_t *r); +static inline uint8_t +xcb_ewmh_get_wm_name_from_reply(xcb_ewmh_connection_t *ewmh, + xcb_ewmh_get_utf8_strings_reply_t *data, + xcb_get_property_reply_t *r) +{ + return xcb_ewmh_get_utf8_strings_from_reply(ewmh, data, r); +} uint8_t xcb_ewmh_get_wm_name_reply(xcb_ewmh_connection_t *ewmh, xcb_get_property_cookie_t cookie, xcb_ewmh_get_utf8_strings_reply_t *data, - xcb_generic_error_t **e); + xcb_generic_error_t **e) +{ + return xcb_ewmh_get_utf8_strings_reply(ewmh, cookie, data, e); +} xcb_void_cookie_t xcb_ewmh_set_wm_visible_name(xcb_ewmh_connection_t *ewmh, xcb_window_t window, @@ -1614,14 +1629,22 @@ xcb_get_property_cookie_t xcb_ewmh_get_wm_visible_name_unchecked(xcb_ewmh_connec xcb_get_property_cookie_t xcb_ewmh_get_wm_visible_name(xcb_ewmh_connection_t *ewmh, xcb_window_t window); -uint8_t xcb_ewmh_get_wm_visible_name_from_reply(xcb_ewmh_connection_t *ewmh, - xcb_ewmh_get_utf8_strings_reply_t *data, - xcb_get_property_reply_t *r); +static inline uint8_t +xcb_ewmh_get_wm_visible_name_from_reply(xcb_ewmh_connection_t *ewmh, + xcb_ewmh_get_utf8_strings_reply_t *data, + xcb_get_property_reply_t *r) +{ + return xcb_ewmh_get_utf8_strings_from_reply(ewmh, data, r); +} -uint8_t xcb_ewmh_get_wm_visible_name_reply(xcb_ewmh_connection_t *ewmh, - xcb_get_property_cookie_t cookie, - xcb_ewmh_get_utf8_strings_reply_t *data, - xcb_generic_error_t **e); +static inline uint8_t +xcb_ewmh_get_wm_visible_name_reply(xcb_ewmh_connection_t *ewmh, + xcb_get_property_cookie_t cookie, + xcb_ewmh_get_utf8_strings_reply_t *data, + xcb_generic_error_t **e) +{ + return xcb_ewmh_get_utf8_strings_reply(ewmh, cookie, data, e); +} xcb_void_cookie_t xcb_ewmh_set_wm_icon_name(xcb_ewmh_connection_t *ewmh, xcb_window_t window, @@ -1639,14 +1662,22 @@ xcb_get_property_cookie_t xcb_ewmh_get_wm_icon_name_unchecked(xcb_ewmh_connectio xcb_get_property_cookie_t xcb_ewmh_get_wm_icon_name(xcb_ewmh_connection_t *ewmh, xcb_window_t window); -uint8_t xcb_ewmh_get_wm_icon_name_from_reply(xcb_ewmh_connection_t *ewmh, - xcb_ewmh_get_utf8_strings_reply_t *data, - xcb_get_property_reply_t *r); +static inline uint8_t +xcb_ewmh_get_wm_icon_name_from_reply(xcb_ewmh_connection_t *ewmh, + xcb_ewmh_get_utf8_strings_reply_t *data, + xcb_get_property_reply_t *r) +{ + return xcb_ewmh_get_utf8_strings_from_reply(ewmh, data, r); +} -uint8_t xcb_ewmh_get_wm_icon_name_reply(xcb_ewmh_connection_t *ewmh, - xcb_get_property_cookie_t cookie, - xcb_ewmh_get_utf8_strings_reply_t *data, - xcb_generic_error_t **e); +static inline uint8_t +xcb_ewmh_get_wm_icon_name_reply(xcb_ewmh_connection_t *ewmh, + xcb_get_property_cookie_t cookie, + xcb_ewmh_get_utf8_strings_reply_t *data, + xcb_generic_error_t **e) +{ + return xcb_ewmh_get_utf8_strings_reply(ewmh, cookie, data, e); +} xcb_void_cookie_t xcb_ewmh_set_wm_visible_icon_name(xcb_ewmh_connection_t *ewmh, xcb_window_t window, @@ -1664,14 +1695,22 @@ xcb_get_property_cookie_t xcb_ewmh_get_wm_visible_icon_name_unchecked(xcb_ewmh_c xcb_get_property_cookie_t xcb_ewmh_get_wm_visible_icon_name(xcb_ewmh_connection_t *ewmh, xcb_window_t window); -uint8_t xcb_ewmh_get_wm_visible_icon_name_from_reply(xcb_ewmh_connection_t *ewmh, - xcb_ewmh_get_utf8_strings_reply_t *data, - xcb_get_property_reply_t *r); +static inline uint8_t +xcb_ewmh_get_wm_visible_icon_name_from_reply(xcb_ewmh_connection_t *ewmh, + xcb_ewmh_get_utf8_strings_reply_t *data, + xcb_get_property_reply_t *r) +{ + return xcb_ewmh_get_utf8_strings_from_reply(ewmh, data, r); +} -uint8_t xcb_ewmh_get_wm_visible_icon_name_reply(xcb_ewmh_connection_t *ewmh, - xcb_get_property_cookie_t cookie, - xcb_ewmh_get_utf8_strings_reply_t *data, - xcb_generic_error_t **e); +static inline uint8_t +xcb_ewmh_get_wm_visible_icon_name_reply(xcb_ewmh_connection_t *ewmh, + xcb_get_property_cookie_t cookie, + xcb_ewmh_get_utf8_strings_reply_t *data, + xcb_generic_error_t **e) +{ + return xcb_ewmh_get_utf8_strings_reply(ewmh, cookie, data, e); +} xcb_void_cookie_t xcb_ewmh_set_wm_desktop(xcb_ewmh_connection_t *ewmh, xcb_window_t window, |