diff src/util.c @ 7628:e293d0c42ccb

[gaim-migrate @ 8252] "Hi, my name is Gaim ... and I'm addicted to glib 2.0." committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Tue, 25 Nov 2003 03:30:59 +0000
parents 072feee65244
children ea2d07ad05a9
line wrap: on
line diff
--- a/src/util.c	Tue Nov 25 02:23:25 2003 +0000
+++ b/src/util.c	Tue Nov 25 03:30:59 2003 +0000
@@ -1532,6 +1532,26 @@
 	return dest;
 }
 
+gboolean
+gaim_str_has_prefix(const char *s, const char *p)
+{
+	if (!strncmp(s, p, strlen(p)))
+		return TRUE;
+
+	return FALSE;
+}
+
+gboolean
+gaim_str_has_suffix(const char *s, const char *x)
+{
+	int off = strlen(s) - strlen(x);
+
+	if (off >= 0 && !strcmp(s + off, x))
+		return TRUE;
+
+	return FALSE;
+}
+
 char *
 gaim_str_add_cr(const char *text)
 {