Mercurial > pidgin.yaz
comparison src/util.c @ 11780:8cb75ba77f9d
[gaim-migrate @ 14071]
I've been time travelling, I bumped into Gtk 2.0 on my way. Gaim now works
with Gtk 2.0 again.
Next stop: gtk 1.2 ... erm. what? ... NO!
PS. resiak: I won!
committer: Tailor Script <tailor@pidgin.im>
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Mon, 24 Oct 2005 00:31:41 +0000 |
parents | 2350fe2bef87 |
children | f672349cfc1c |
comparison
equal
deleted
inserted
replaced
11779:80af53b5b3c5 | 11780:8cb75ba77f9d |
---|---|
2386 } | 2386 } |
2387 | 2387 |
2388 gboolean | 2388 gboolean |
2389 gaim_str_has_prefix(const char *s, const char *p) | 2389 gaim_str_has_prefix(const char *s, const char *p) |
2390 { | 2390 { |
2391 #if GLIB_CHECK_VERSION(2,2,0) | |
2392 return g_str_has_prefix(s, p); | |
2393 #else | |
2391 if (!strncmp(s, p, strlen(p))) | 2394 if (!strncmp(s, p, strlen(p))) |
2392 return TRUE; | 2395 return TRUE; |
2393 | 2396 |
2394 return FALSE; | 2397 return FALSE; |
2398 #endif | |
2395 } | 2399 } |
2396 | 2400 |
2397 gboolean | 2401 gboolean |
2398 gaim_str_has_suffix(const char *s, const char *x) | 2402 gaim_str_has_suffix(const char *s, const char *x) |
2399 { | 2403 { |
2404 #if GLIB_CHECK_VERSION(2,2,0) | |
2405 return g_str_has_suffix(s, x); | |
2406 #else | |
2400 int off = strlen(s) - strlen(x); | 2407 int off = strlen(s) - strlen(x); |
2401 | 2408 |
2402 if (off >= 0 && !strcmp(s + off, x)) | 2409 if (off >= 0 && !strcmp(s + off, x)) |
2403 return TRUE; | 2410 return TRUE; |
2404 | 2411 |
2405 return FALSE; | 2412 return FALSE; |
2413 #endif | |
2406 } | 2414 } |
2407 | 2415 |
2408 char * | 2416 char * |
2409 gaim_str_add_cr(const char *text) | 2417 gaim_str_add_cr(const char *text) |
2410 { | 2418 { |