* libnotify/notify.c,h: add notify_has_server_cap convenience function to quickly check whether server has a certain capability * configure{.ac}: bump LT_AGE and LT_CURRENT and reset LT_REVISION * AUTHORS: add me to patch writers -- Alexander Sack Fri, 05 Jun 2009 11:24:19 +0200 -- --- libnotify-0.4.5.orig/AUTHORS +++ libnotify-0.4.5/AUTHORS @@ -15,3 +15,4 @@ mderezynski Ed Catmur Lucas Rocha + Alexander Sack only in patch2: unchanged: --- libnotify-0.4.5.orig/configure.ac +++ libnotify-0.4.5/configure.ac @@ -42,9 +42,9 @@ dnl # dnl # CURRENT : REVISION : AGE dnl # -LT_CURRENT=2 -LT_REVISION=3 -LT_AGE=1 +LT_CURRENT=3 +LT_REVISION=0 +LT_AGE=2 LT_RELEASE=$LIBGALAGO_MAJOR_VERSION.$LIBGALAGO_MINOR_VERSION.$LIBGALAGO_MICRO_VERSION --- libnotify-0.4.5.orig/libnotify/notify.c +++ libnotify-0.4.5/libnotify/notify.c @@ -207,6 +207,27 @@ } /** + * convenience function that checks if server has a certain capability + * + * @param capability The capability to test for + + * @return TRUE if the current notification server has the capability + * otherwise FALSE. + */ +gboolean +notify_has_server_cap(const char* capability) +{ + GList *caps = notify_get_server_caps(); + gboolean has_cap = g_list_find_custom (caps, capability, g_strcmp0); + + g_list_foreach (caps, (GFunc)g_free, NULL); + g_list_free (caps); + + return has_cap; +} + + +/** * notify_get_server_info: * @ret_name: The resulting server name. * @ret_vendor: The resulting server vendor. --- libnotify-0.4.5.orig/libnotify/notify.h +++ libnotify-0.4.5/libnotify/notify.h @@ -68,6 +68,16 @@ GList *notify_get_server_caps(void); /** + * convenience function that checks if server has a certain capability + * + * @param capability The capability to test for + + * @return TRUE if the current notification server has the capability + * otherwise FALSE. + */ +gboolean notify_has_server_cap(const char* capability); + +/** * Returns the server notification information. * * The strings returned must be freed.