[glib: 4/13] uri: rename absolute & relative uri_string to uri_ref




commit 44d4640c47ee04a0dc333cef48a2781f1739aee1
Author: Marc-André Lureau <marcandre lureau redhat com>
Date:   Tue Jul 28 15:07:03 2020 +0400

    uri: rename absolute & relative uri_string to uri_ref
    
    Let's reserve the term URI for absolute URIs, following rfc3986
    terminology.
    
    See:
    https://gitlab.gnome.org/GNOME/glib/-/issues/2169
    
    Signed-off-by: Marc-André Lureau <marcandre lureau redhat com>

 glib/guri.c | 76 ++++++++++++++++++++++++++++++-------------------------------
 glib/guri.h | 10 ++++----
 2 files changed, 43 insertions(+), 43 deletions(-)
---
diff --git a/glib/guri.c b/glib/guri.c
index 8dfc1cf4c..a4481204e 100644
--- a/glib/guri.c
+++ b/glib/guri.c
@@ -837,8 +837,8 @@ g_uri_split_internal (const gchar  *uri_string,
 
 /**
  * g_uri_split:
- * @uri_string: a string containing a relative or absolute URI
- * @flags: flags for parsing @uri_string
+ * @uri_ref: a string containing a relative or absolute URI
+ * @flags: flags for parsing @uri_ref
  * @scheme: (out) (nullable) (optional) (transfer full): on return, contains
  *    the scheme (converted to lowercase), or %NULL
  * @userinfo: (out) (nullable) (optional) (transfer full): on return, contains
@@ -855,14 +855,14 @@ g_uri_split_internal (const gchar  *uri_string,
  *    the fragment, or %NULL
  * @error: #GError for error reporting, or %NULL to ignore.
  *
- * Parses @uri_string (which can be an absolute or relative URI)
+ * Parses @uri_ref (which can be an absolute or relative URI)
  * according to @flags, and returns the pieces. Any component that
- * doesn't appear in @uri_string will be returned as %NULL (but note
+ * doesn't appear in @uri_ref will be returned as %NULL (but note
  * that all URIs always have a path component, though it may be the
  * empty string).
  *
  * If @flags contains %G_URI_FLAGS_ENCODED, then `%`-encoded characters in
- * @uri_string will remain encoded in the output strings. (If not,
+ * @uri_ref will remain encoded in the output strings. (If not,
  * then all such characters will be decoded.) Note that decoding will
  * only work if the URI components are ASCII or UTF-8, so you will
  * need to use %G_URI_FLAGS_ENCODED if they are not.
@@ -872,13 +872,13 @@ g_uri_split_internal (const gchar  *uri_string,
  * since it always returns only the full userinfo; use
  * g_uri_split_with_user() if you want it split up.
  *
- * Returns: (skip): %TRUE if @uri_string parsed successfully, %FALSE
+ * Returns: (skip): %TRUE if @uri_ref parsed successfully, %FALSE
  *   on error.
  *
  * Since: 2.66
  */
 gboolean
-g_uri_split (const gchar  *uri_string,
+g_uri_split (const gchar  *uri_ref,
              GUriFlags     flags,
              gchar       **scheme,
              gchar       **userinfo,
@@ -889,10 +889,10 @@ g_uri_split (const gchar  *uri_string,
              gchar       **fragment,
              GError      **error)
 {
-  g_return_val_if_fail (uri_string != NULL, FALSE);
+  g_return_val_if_fail (uri_ref != NULL, FALSE);
   g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
-  return g_uri_split_internal (uri_string, flags,
+  return g_uri_split_internal (uri_ref, flags,
                                scheme, userinfo, NULL, NULL, NULL,
                                host, port, path, query, fragment,
                                error);
@@ -900,8 +900,8 @@ g_uri_split (const gchar  *uri_string,
 
 /**
  * g_uri_split_with_user:
- * @uri_string: a string containing a relative or absolute URI
- * @flags: flags for parsing @uri_string
+ * @uri_ref: a string containing a relative or absolute URI
+ * @flags: flags for parsing @uri_ref
  * @scheme: (out) (nullable) (optional) (transfer full): on return, contains
  *    the scheme (converted to lowercase), or %NULL
  * @user: (out) (nullable) (optional) (transfer full): on return, contains
@@ -922,9 +922,9 @@ g_uri_split (const gchar  *uri_string,
  *    the fragment, or %NULL
  * @error: #GError for error reporting, or %NULL to ignore.
  *
- * Parses @uri_string (which can be an absolute or relative URI)
+ * Parses @uri_ref (which can be an absolute or relative URI)
  * according to @flags, and returns the pieces. Any component that
- * doesn't appear in @uri_string will be returned as %NULL (but note
+ * doesn't appear in @uri_ref will be returned as %NULL (but note
  * that all URIs always have a path component, though it may be the
  * empty string).
  *
@@ -934,13 +934,13 @@ g_uri_split (const gchar  *uri_string,
  * @auth_params will only be parsed out if @flags contains
  * %G_URI_FLAGS_HAS_AUTH_PARAMS.
  *
- * Returns: (skip): %TRUE if @uri_string parsed successfully, %FALSE
+ * Returns: (skip): %TRUE if @uri_ref parsed successfully, %FALSE
  *   on error.
  *
  * Since: 2.66
  */
 gboolean
-g_uri_split_with_user (const gchar  *uri_string,
+g_uri_split_with_user (const gchar  *uri_ref,
                        GUriFlags     flags,
                        gchar       **scheme,
                        gchar       **user,
@@ -953,10 +953,10 @@ g_uri_split_with_user (const gchar  *uri_string,
                        gchar       **fragment,
                        GError      **error)
 {
-  g_return_val_if_fail (uri_string != NULL, FALSE);
+  g_return_val_if_fail (uri_ref != NULL, FALSE);
   g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
-  return g_uri_split_internal (uri_string, flags,
+  return g_uri_split_internal (uri_ref, flags,
                                scheme, NULL, user, password, auth_params,
                                host, port, path, query, fragment,
                                error);
@@ -1039,29 +1039,29 @@ g_uri_split_network (const gchar  *uri_string,
 
 /**
  * g_uri_is_valid:
- * @uri_string: a string containing a relative or absolute URI
- * @flags: flags for parsing @uri_string
+ * @uri_ref: a string containing a relative or absolute URI
+ * @flags: flags for parsing @uri_ref
  * @error: #GError for error reporting, or %NULL to ignore.
  *
- * Parses @uri_string (which can be an absolute or relative URI)
+ * Parses @uri_ref (which can be an absolute or relative URI)
  * according to @flags, to determine whether it is valid.
  *
  * See g_uri_split(), and the definition of #GUriFlags, for more
  * information on the effect of @flags.
  *
- * Returns: %TRUE if @uri_string parsed successfully, %FALSE on error.
+ * Returns: %TRUE if @uri_ref parsed successfully, %FALSE on error.
  *
  * Since: 2.66
  */
 gboolean
-g_uri_is_valid (const gchar  *uri_string,
+g_uri_is_valid (const gchar  *uri_ref,
                 GUriFlags     flags,
                 GError      **error)
 {
-  g_return_val_if_fail (uri_string != NULL, FALSE);
+  g_return_val_if_fail (uri_ref != NULL, FALSE);
   g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
-  return g_uri_split_internal (uri_string, flags,
+  return g_uri_split_internal (uri_ref, flags,
                                NULL, NULL, NULL, NULL, NULL,
                                NULL, NULL, NULL, NULL, NULL,
                                error);
@@ -1157,11 +1157,11 @@ g_uri_parse (const gchar  *uri_string,
 /**
  * g_uri_parse_relative:
  * @base_uri: (nullable): a base absolute URI
- * @uri_string: a string representing a relative or absolute URI
- * @flags: flags describing how to parse @uri_string
+ * @uri_ref: a string representing a relative or absolute URI
+ * @flags: flags describing how to parse @uri_ref
  * @error: #GError for error reporting, or %NULL to ignore.
  *
- * Parses @uri_string according to @flags and, if it is a relative
+ * Parses @uri_ref according to @flags and, if it is a relative
  * URI, resolves it relative to @base_uri. If the result is not a
  * valid absolute URI, it will be discarded, and an error returned.
  *
@@ -1171,13 +1171,13 @@ g_uri_parse (const gchar  *uri_string,
  */
 GUri *
 g_uri_parse_relative (GUri         *base_uri,
-                      const gchar  *uri_string,
+                      const gchar  *uri_ref,
                       GUriFlags     flags,
                       GError      **error)
 {
   GUri *uri = NULL;
 
-  g_return_val_if_fail (uri_string != NULL, NULL);
+  g_return_val_if_fail (uri_ref != NULL, NULL);
   g_return_val_if_fail (error == NULL || *error == NULL, NULL);
   g_return_val_if_fail (base_uri == NULL || base_uri->scheme != NULL, NULL);
 
@@ -1186,7 +1186,7 @@ g_uri_parse_relative (GUri         *base_uri,
   uri = g_atomic_rc_box_new0 (GUri);
   uri->flags = flags;
 
-  if (!g_uri_split_internal (uri_string, flags,
+  if (!g_uri_split_internal (uri_ref, flags,
                              &uri->scheme, &uri->userinfo,
                              &uri->user, &uri->password, &uri->auth_params,
                              &uri->host, &uri->port,
@@ -1269,16 +1269,16 @@ g_uri_parse_relative (GUri         *base_uri,
 /**
  * g_uri_resolve_relative:
  * @base_uri_string: (nullable): a string representing a base URI
- * @uri_string: a string representing a relative or absolute URI
- * @flags: flags describing how to parse @uri_string
+ * @uri_ref: a string representing a relative or absolute URI
+ * @flags: flags describing how to parse @uri_ref
  * @error: #GError for error reporting, or %NULL to ignore.
  *
- * Parses @uri_string according to @flags and, if it is a relative
+ * Parses @uri_ref according to @flags and, if it is a relative
  * URI, resolves it relative to @base_uri_string. If the result is not
  * a valid absolute URI, it will be discarded, and an error returned.
  *
- * (If @base_uri_string is %NULL, this just returns @uri_string, or
- * %NULL if @uri_string is invalid or not absolute.)
+ * (If @base_uri_string is %NULL, this just returns @uri_ref, or
+ * %NULL if @uri_ref is invalid or not absolute.)
  *
  * Return value: the resolved URI string.
  *
@@ -1286,14 +1286,14 @@ g_uri_parse_relative (GUri         *base_uri,
  */
 gchar *
 g_uri_resolve_relative (const gchar  *base_uri_string,
-                        const gchar  *uri_string,
+                        const gchar  *uri_ref,
                         GUriFlags     flags,
                         GError      **error)
 {
   GUri *base_uri, *resolved_uri;
   gchar *resolved_uri_string;
 
-  g_return_val_if_fail (uri_string != NULL, NULL);
+  g_return_val_if_fail (uri_ref != NULL, NULL);
   g_return_val_if_fail (error == NULL || *error == NULL, NULL);
 
   flags |= G_URI_FLAGS_ENCODED;
@@ -1307,7 +1307,7 @@ g_uri_resolve_relative (const gchar  *base_uri_string,
   else
     base_uri = NULL;
 
-  resolved_uri = g_uri_parse_relative (base_uri, uri_string, flags, error);
+  resolved_uri = g_uri_parse_relative (base_uri, uri_ref, flags, error);
   if (base_uri)
     g_uri_unref (base_uri);
   if (!resolved_uri)
diff --git a/glib/guri.h b/glib/guri.h
index a9a4cd57e..a8396f4e6 100644
--- a/glib/guri.h
+++ b/glib/guri.h
@@ -78,7 +78,7 @@ typedef enum {
 } GUriFlags;
 
 GLIB_AVAILABLE_IN_2_66
-gboolean     g_uri_split            (const gchar  *uri_string,
+gboolean     g_uri_split            (const gchar  *uri_ref,
                                      GUriFlags     flags,
                                      gchar       **scheme,
                                      gchar       **userinfo,
@@ -89,7 +89,7 @@ gboolean     g_uri_split            (const gchar  *uri_string,
                                      gchar       **fragment,
                                      GError      **error);
 GLIB_AVAILABLE_IN_2_66
-gboolean     g_uri_split_with_user  (const gchar  *uri_string,
+gboolean     g_uri_split_with_user  (const gchar  *uri_ref,
                                      GUriFlags     flags,
                                      gchar       **scheme,
                                      gchar       **user,
@@ -110,7 +110,7 @@ gboolean     g_uri_split_network    (const gchar  *uri_string,
                                      GError      **error);
 
 GLIB_AVAILABLE_IN_2_66
-gboolean     g_uri_is_valid         (const gchar  *uri_string,
+gboolean     g_uri_is_valid         (const gchar  *uri_ref,
                                      GUriFlags     flags,
                                      GError      **error);
 
@@ -141,13 +141,13 @@ GUri *       g_uri_parse            (const gchar  *uri_string,
                                      GError      **error);
 GLIB_AVAILABLE_IN_2_66
 GUri *       g_uri_parse_relative   (GUri         *base_uri,
-                                     const gchar  *uri_string,
+                                     const gchar  *uri_ref,
                                      GUriFlags     flags,
                                      GError      **error);
 
 GLIB_AVAILABLE_IN_2_66
 gchar *      g_uri_resolve_relative (const gchar  *base_uri_string,
-                                     const gchar  *uri_string,
+                                     const gchar  *uri_ref,
                                      GUriFlags     flags,
                                      GError      **error);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]