summaryrefslogtreecommitdiff
path: root/src/bin/utils.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2012-10-09 15:11:09 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-10-09 15:11:09 +0000
commit2a0e0fd2b429af5e8ec151ae3e4fe67c4e4f13ef (patch)
tree3114771beeea657f51bf298e3a88b53bab59c5ee /src/bin/utils.c
parent5bfed09e13d7c966ebd7ec1ba3ea60642f7f6522 (diff)
refactor url handling.
there are still some left to be done, will come to it later. SVN revision: 77653
Diffstat (limited to 'src/bin/utils.c')
-rw-r--r--src/bin/utils.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/bin/utils.c b/src/bin/utils.c
index 601931a..5a39d22 100644
--- a/src/bin/utils.c
+++ b/src/bin/utils.c
@@ -52,13 +52,31 @@ theme_auto_reload_enable(Evas_Object *edje)
52} 52}
53 53
54Eina_Bool 54Eina_Bool
55link_is_url(const char *str) 55link_is_protocol(const char *str)
56{ 56{
57 if ((!strncasecmp(str, "http://", 7))|| 57 if ((!strncasecmp(str, "http://", 7))||
58 (!strncasecmp(str, "https://", 8)) || 58 (!strncasecmp(str, "https://", 8)) ||
59 (!strncasecmp(str, "ftp://", 6)) || 59 (!strncasecmp(str, "ftp://", 6)) ||
60 (!strncasecmp(str, "file://", 7)))
61 return EINA_TRUE;
62 return EINA_FALSE;
63}
64
65Eina_Bool
66link_is_url(const char *str)
67{
68 if (link_is_protocol(str) ||
60 (!strncasecmp(str, "www.", 4)) || 69 (!strncasecmp(str, "www.", 4)) ||
61 (!strncasecmp(str, "ftp.", 4))) 70 (!strncasecmp(str, "ftp.", 4)))
62 return EINA_TRUE; 71 return EINA_TRUE;
63 return EINA_FALSE; 72 return EINA_FALSE;
64} 73}
74
75Eina_Bool
76link_is_email(const char *str)
77{
78 const char *at = strchr(str, '@');
79 if (at && strchr(at + 1, '.'))
80 return EINA_TRUE;
81 return EINA_FALSE;
82}