logo

badwolf

minimalist and privacy-oriented web browser based on WebKitGTK git clone https://hacktivis.me/git/badwolf.git

uri.h (835B)


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