40 #include <sys/utsname.h> 43 #include <glib/gi18n.h> 44 #include <glib/gstdio.h> 54 const gchar *notification_title,
const gchar *notification_message)
58 GNotification *notification = g_notification_new(notification_title);
59 g_notification_set_body(notification, notification_message);
60 #if GLIB_CHECK_VERSION(2, 42, 0) 61 g_notification_set_priority(notification, G_NOTIFICATION_PRIORITY_NORMAL);
63 g_application_send_notification(g_application_get_default(), notification_id, notification);
64 g_object_unref(notification);
75 sub = strstr(haystack, needle);
79 return sub - haystack;
90 g_return_val_if_fail(haystack != NULL, -1);
91 if (haystack->len == 0)
94 g_return_val_if_fail(start >= 0, -1);
95 if (start >= (gint)haystack->len)
98 g_return_val_if_fail(!EMPTY(needle), -1);
119 TRACE_CALL(__func__);
120 g_string_erase(str, pos, len);
122 g_string_insert(str, pos, replace);
123 pos += strlen(replace);
139 TRACE_CALL(__func__);
142 gsize needle_length = strlen(needle);
gint www_utils_strpos(const gchar *haystack, const gchar *needle)
guint www_utils_string_replace_all(GString *haystack, const gchar *needle, const gchar *replace)
Replaces all occurrences of needle in haystack with replace.
gint www_utils_string_find(GString *haystack, gint start, gint end, const gchar *needle)
gint www_utils_string_replace(GString *str, gint pos, gint len, const gchar *replace)
void www_utils_send_notification(const gchar *notification_id, const gchar *notification_title, const gchar *notification_message)