From 0c8f21f4584dba758bb1e59b1946f5fbde4a2968 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 18 May 2019 17:15:59 +0200 Subject: badwolf.c: Document ensure_uri_scheme function behavior --- badwolf.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/badwolf.c b/badwolf.c index 4d10719..52c2ab2 100644 --- a/badwolf.c +++ b/badwolf.c @@ -95,6 +95,17 @@ static void notebookCb_switch__page(GtkNotebook *notebook, GtkWidget *page, guint page_num, gpointer user_data); gint get_tab_position(GtkContainer *notebook, GtkWidget *child); +/* ensure_uri_scheme: tries to add a scheme on a pseudo-URL missing a scheme + * - gchar text: pseudo-URL missing a scheme + * - gboolean try_file: when TRUE check try first if it can be a file:// path + * + * When `text` isn't exploitable (ie. NULL), returns "about:blank", + * when the URL seems to be valid, return it, + * if try_file is TRUE, check if it can be file:// path, + * some other checks might be added. + * In the end use the fallback (`http://` for now, might get configuration), + * might get some safeguard. + */ gchar * ensure_uri_scheme(gchar *text, gboolean try_file) { -- cgit v1.3.1-23-gd82d