summaryrefslogtreecommitdiffstats
path: root/ui/common
diff options
context:
space:
mode:
Diffstat (limited to 'ui/common')
-rw-r--r--ui/common/url.c11
-rw-r--r--ui/common/url.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/ui/common/url.c b/ui/common/url.c
index 3e7b384..3e6c8da 100644
--- a/ui/common/url.c
+++ b/ui/common/url.c
@@ -197,3 +197,14 @@ fail:
talloc_free(url);
return NULL;
}
+
+const char *pb_url_scheme_name(enum pb_url_scheme scheme)
+{
+ unsigned int i;
+
+ for (i = 0; i < sizeof(schemes) / sizeof(schemes[0]); i++)
+ if (schemes[i].scheme == scheme)
+ return schemes[i].str;
+
+ return NULL;
+}
diff --git a/ui/common/url.h b/ui/common/url.h
index a966dc7..3cb7cd8 100644
--- a/ui/common/url.h
+++ b/ui/common/url.h
@@ -60,4 +60,6 @@ struct pb_url {
struct pb_url *pb_url_parse(void *ctx, const char *url_str);
+const char *pb_url_scheme_name(enum pb_url_scheme scheme);
+
#endif
OpenPOWER on IntegriCloud