uri.h 700 B

123456789101112131415161718
  1. #ifndef URI_H_INCLUDED
  2. #define URI_H_INCLUDED
  3. #include <glib.h>
  4. /* badwolf_ensure_uri_scheme: tries to add a scheme on a pseudo-URL missing a scheme
  5. * - gchar text: pseudo-URL missing a scheme
  6. * - gboolean try_file: when TRUE check try first if it can be a file:// path
  7. *
  8. * When `text` isn't exploitable (ie. NULL), returns "about:blank",
  9. * when the URL seems to be valid, return it,
  10. * if try_file is TRUE, check if it can be file:// path,
  11. * some other checks might be added.
  12. * In the end use the fallback (`http://` for now, might get configuration),
  13. * might get some safeguard.
  14. */
  15. const gchar *badwolf_ensure_uri_scheme(const gchar *text, gboolean try_file);
  16. #endif /* URI_H_INCLUDED */