[Kazehakase-cvs] kazehakase-svn [3026] * src/net/uri.[ch], src/net/kz-http.c: GURI -> KzURI.

Back to archive index

svnno****@sourc***** svnno****@sourc*****
Mon Mar 26 16:44:20 JST 2007


Revision: 3026
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=kazehakase&view=rev&rev=3026
Author:   ikezoe
Date:     2007-03-26 16:44:19 +0900 (Mon, 26 Mar 2007)

Log Message:
-----------
* src/net/uri.[ch], src/net/kz-http.c: GURI -> KzURI. gnet_ -> kz_.

Modified Paths:
--------------
    kazehakase/trunk/ChangeLog
    kazehakase/trunk/src/net/kz-http.c
    kazehakase/trunk/src/net/uri.c
    kazehakase/trunk/src/net/uri.h

Modified: kazehakase/trunk/ChangeLog
===================================================================
--- kazehakase/trunk/ChangeLog	2007-03-26 07:22:14 UTC (rev 3025)
+++ kazehakase/trunk/ChangeLog	2007-03-26 07:44:19 UTC (rev 3026)
@@ -1,3 +1,7 @@
+2007-03-26  Hiroyuki Ikezoe  <poinc****@ikezo*****>
+
+	* src/net/uri.[ch], src/net/kz-http.c: GURI -> KzURI. gnet_ -> kz_.
+
 2007-03-26  Kouhei Sutou  <kou****@cozmi*****>
 
 	* src/kz-embed.[ch] (kz_embed_get_name): new interface.

Modified: kazehakase/trunk/src/net/kz-http.c
===================================================================
--- kazehakase/trunk/src/net/kz-http.c	2007-03-26 07:22:14 UTC (rev 3025)
+++ kazehakase/trunk/src/net/kz-http.c	2007-03-26 07:44:19 UTC (rev 3026)
@@ -421,11 +421,11 @@
 kz_http_new (const gchar *uri)
 {
 	KzHTTP *http;
-	GURI *guri;
+	KzURI *guri;
 	gchar *path = NULL, *hostname = NULL;
 	guint port = 80;
 
-	guri = gnet_uri_new(uri);
+	guri = kz_uri_new(uri);
 
 	if (guri)
 	{
@@ -459,7 +459,7 @@
 #endif
 
 	if (guri)
-		gnet_uri_delete(guri);
+		kz_uri_delete(guri);
 	g_free(path);
 
 	return http;

Modified: kazehakase/trunk/src/net/uri.c
===================================================================
--- kazehakase/trunk/src/net/uri.c	2007-03-26 07:22:14 UTC (rev 3025)
+++ kazehakase/trunk/src/net/uri.c	2007-03-26 07:44:19 UTC (rev 3026)
@@ -111,10 +111,10 @@
 
 
 /**
- *  gnet_uri_new
+ *  kz_uri_new
  *  @uri: URI string
  *
- *  Creates a #GURI from a string.  Empty fields are set to NULL.  The
+ *  Creates a #KzURI from a string.  Empty fields are set to NULL.  The
  *  parser does not validate the URI -- it will accept some malformed
  *  URI.  URIs are usually in the form
  *  scheme://userinfo@hostname:port/path?query#fragment
@@ -123,13 +123,13 @@
  *  created from machine input (e.g. received over the internet) are
  *  typically escaped.
  *  
- *  Returns: a new #GURI, or NULL if there was a failure.
+ *  Returns: a new #KzURI, or NULL if there was a failure.
  *
  **/
-GURI* 
-gnet_uri_new (const gchar* uri)
+KzURI* 
+kz_uri_new (const gchar* uri)
 {
-  GURI* guri = NULL;
+  KzURI* guri = NULL;
   const gchar* p;
   const gchar* temp;
 
@@ -142,7 +142,7 @@
   if (!*p)	/* Error if it's just a string of space */
     return NULL;
 
-  guri = g_new0 (GURI, 1);
+  guri = g_new0 (KzURI, 1);
 
   /* Scheme */
   temp = p;
@@ -231,32 +231,32 @@
   return guri;
 
  error:
-  gnet_uri_delete (guri);
+  kz_uri_delete (guri);
   return NULL;
 }
 
 
 /**
- *  gnet_uri_new_fields
+ *  kz_uri_new_fields
  *  @scheme: scheme
  *  @hostname: host name
  *  @port: port
  *  @path: path
  *
- *  Creates a #GURI from the fields.  This function uses the most
- *  common fields.  Use gnet_uri_new_fields_all() to specify all
+ *  Creates a #KzURI from the fields.  This function uses the most
+ *  common fields.  Use kz_uri_new_fields_all() to specify all
  *  fields.
  *
- *  Returns: a new #GURI.
+ *  Returns: a new #KzURI.
  *
  **/
-GURI*     
-gnet_uri_new_fields (const gchar* scheme, const gchar* hostname, 
+KzURI*     
+kz_uri_new_fields (const gchar* scheme, const gchar* hostname, 
 		     const gint port, const gchar* path)
 {
-  GURI* uri = NULL;
+  KzURI* uri = NULL;
 
-  uri = g_new0 (GURI, 1);
+  uri = g_new0 (KzURI, 1);
   if (scheme)		uri->scheme = g_strdup (scheme);
   if (hostname)		uri->hostname = g_strdup (hostname);
   uri->port = port;
@@ -267,7 +267,7 @@
 
 
 /**
- *  gnet_uri_new_fields_all
+ *  kz_uri_new_fields_all
  *  @scheme: scheme
  *  @userinfo: user info
  *  @hostname: host name
@@ -276,20 +276,20 @@
  *  @query: query
  *  @fragment: fragment
  *
- *  Creates a #GURI from all fields.
+ *  Creates a #KzURI from all fields.
  *
- *  Returns: a new #GURI.
+ *  Returns: a new #KzURI.
  *
  **/
-GURI*
-gnet_uri_new_fields_all (const gchar* scheme, const gchar* userinfo, 
+KzURI*
+kz_uri_new_fields_all (const gchar* scheme, const gchar* userinfo, 
 			 const gchar* hostname, const gint port, 
 			 const gchar* path, 
 			 const gchar* query, const gchar* fragment)
 {
-  GURI* uri = NULL;
+  KzURI* uri = NULL;
 
-  uri = g_new0 (GURI, 1);
+  uri = g_new0 (KzURI, 1);
   if (scheme)		uri->scheme   = g_strdup (scheme);
   if (userinfo)		uri->userinfo = g_strdup (userinfo);
   if (hostname)		uri->hostname = g_strdup (hostname);
@@ -303,22 +303,22 @@
 
 
 /**
- *  gnet_uri_clone:
- *  @uri: a #GURI
+ *  kz_uri_clone:
+ *  @uri: a #KzURI
  * 
- *  Copies a #GURI.
+ *  Copies a #KzURI.
  *
  *  Returns: a copy of @uri.
  *
  **/
-GURI*     
-gnet_uri_clone (const GURI* uri)
+KzURI*     
+kz_uri_clone (const KzURI* uri)
 {
-  GURI* uri2;
+  KzURI* uri2;
 
   g_return_val_if_fail (uri, NULL);
 
-  uri2 = g_new0 (GURI, 1);
+  uri2 = g_new0 (KzURI, 1);
   uri2->scheme   = g_strdup (uri->scheme);
   uri2->userinfo = g_strdup (uri->userinfo);
   uri2->hostname = g_strdup (uri->hostname);
@@ -332,14 +332,14 @@
 
 
 /** 
- *  gnet_uri_delete:
- *  @uri: a #GURI
+ *  kz_uri_delete:
+ *  @uri: a #KzURI
  *
- *  Deletes a #GURI.
+ *  Deletes a #KzURI.
  *
  **/
 void
-gnet_uri_delete (GURI* uri)
+kz_uri_delete (KzURI* uri)
 {
   if (uri)
     {
@@ -359,20 +359,20 @@
 #define SAFESTRCMP(A,B) (((A)&&(B))?(strcmp((A),(B))):((A)||(B)))
 
 /**
- *  gnet_uri_equal
- *  @p1: a #GURI
- *  @p2: another #GURI
+ *  kz_uri_equal
+ *  @p1: a #KzURI
+ *  @p2: another #KzURI
  *
- *  Compares two #GURI's for equality.
+ *  Compares two #KzURI's for equality.
  *
  *  Returns: TRUE if they are equal; FALSE otherwise.
  *
  **/
 gboolean
-gnet_uri_equal (gconstpointer p1, gconstpointer p2)
+kz_uri_equal (gconstpointer p1, gconstpointer p2)
 {
-  const GURI* uri1 = (const GURI*) p1;
-  const GURI* uri2 = (const GURI*) p2;
+  const KzURI* uri1 = (const KzURI*) p1;
+  const KzURI* uri2 = (const KzURI*) p2;
 
   g_return_val_if_fail (uri1, FALSE);
   g_return_val_if_fail (uri2, FALSE);
@@ -391,8 +391,8 @@
 
 
 /**
- *  gnet_uri_hash
- *  @p: a #GURI
+ *  kz_uri_hash
+ *  @p: a #KzURI
  *
  *  Creates a hash code for @p for use with GHashTable. 
  *
@@ -400,9 +400,9 @@
  *
  **/
 guint
-gnet_uri_hash (gconstpointer p)
+kz_uri_hash (gconstpointer p)
 {
-  const GURI* uri = (const GURI*) p;
+  const KzURI* uri = (const KzURI*) p;
   guint h = 0;
 
   g_return_val_if_fail (uri, 0);
@@ -420,15 +420,15 @@
 
 
 /**
- *  gnet_uri_escape
- *  @uri: a #GURI
+ *  kz_uri_escape
+ *  @uri: a #KzURI
  *
- *  Escapes the fields in a #GURI.  Network protocols use escaped
+ *  Escapes the fields in a #KzURI.  Network protocols use escaped
  *  URIs.  People use unescaped URIs.
  *
  **/
 void
-gnet_uri_escape (GURI* uri)
+kz_uri_escape (KzURI* uri)
 {
   g_return_if_fail (uri);
   
@@ -440,15 +440,15 @@
 
 
 /**
- *  gnet_uri_unescape
- *  @uri: a #GURI
+ *  kz_uri_unescape
+ *  @uri: a #KzURI
  *
  *  Unescapes the fields in the URI.  Network protocols use escaped
  *  URIs.  People use unescaped URIs.
  *
  **/
 void
-gnet_uri_unescape (GURI* uri)
+kz_uri_unescape (KzURI* uri)
 {
   g_return_if_fail (uri);
 
@@ -576,18 +576,18 @@
 
 
 /**
- *  gnet_uri_get_string
- *  @uri: a #GURI
+ *  kz_uri_get_string
+ *  @uri: a #KzURI
  *
- *  Gets a string representation of a #GURI.  This function does not
- *  escape or unescape the fields first.  Call gnet_uri_escape() or
- *  gnet_uri_unescape first if necessary.
+ *  Gets a string representation of a #KzURI.  This function does not
+ *  escape or unescape the fields first.  Call kz_uri_escape() or
+ *  kz_uri_unescape first if necessary.
  *
  *  Returns: a string.
  *
  **/
 gchar*
-gnet_uri_get_string (const GURI* uri)
+kz_uri_get_string (const KzURI* uri)
 {
   gchar* rv = NULL;
   GString* buffer = NULL;
@@ -643,15 +643,15 @@
 
 
 /**
- *  gnet_uri_set_scheme
- *  @uri: a #GURI
+ *  kz_uri_set_scheme
+ *  @uri: a #KzURI
  *  @scheme: scheme
  *
- *  Sets a #GURI's scheme.
+ *  Sets a #KzURI's scheme.
  *
  **/
 void
-gnet_uri_set_scheme (GURI* uri, const gchar* scheme)
+kz_uri_set_scheme (KzURI* uri, const gchar* scheme)
 {
   g_return_if_fail (uri);
 
@@ -667,15 +667,15 @@
 
 
 /**
- *  gnet_uri_set_userinfo
- *  @uri: a #GURI
+ *  kz_uri_set_userinfo
+ *  @uri: a #KzURI
  *  @userinfo: user info
  *
- *  Sets a #GURI's user info.
+ *  Sets a #KzURI's user info.
  *
  **/
 void
-gnet_uri_set_userinfo (GURI* uri, const gchar* userinfo)
+kz_uri_set_userinfo (KzURI* uri, const gchar* userinfo)
 {
   g_return_if_fail (uri);
 
@@ -691,15 +691,15 @@
 
 
 /**
- *  gnet_uri_set_hostname
- *  @uri: a #GURI
+ *  kz_uri_set_hostname
+ *  @uri: a #KzURI
  *  @hostname: host name
  *
- *  Sets a #GURI's host name.
+ *  Sets a #KzURI's host name.
  *
  **/
 void
-gnet_uri_set_hostname (GURI* uri, const gchar* hostname)
+kz_uri_set_hostname (KzURI* uri, const gchar* hostname)
 {
   g_return_if_fail (uri);
 
@@ -715,30 +715,30 @@
 
 
 /**
- *  gnet_uri_set_port
- *  @uri: a #GURI
+ *  kz_uri_set_port
+ *  @uri: a #KzURI
  *  @port: port
  *
- *  Set a #GURI's port.
+ *  Set a #KzURI's port.
  *
  **/
 void	
-gnet_uri_set_port (GURI* uri, gint port)
+kz_uri_set_port (KzURI* uri, gint port)
 {
   uri->port = port;
 }
 
 
 /**
- *  gnet_uri_set_path
- *  @uri: a #GURI
+ *  kz_uri_set_path
+ *  @uri: a #KzURI
  *  @path: path
  *
- *  Set a #GURI's path.
+ *  Set a #KzURI's path.
  *
  **/
 void
-gnet_uri_set_path (GURI* uri, const gchar* path)
+kz_uri_set_path (KzURI* uri, const gchar* path)
 {
   g_return_if_fail (uri);
 
@@ -755,15 +755,15 @@
 
 
 /**
- *  gnet_uri_set_query
- *  @uri: a #GURI
+ *  kz_uri_set_query
+ *  @uri: a #KzURI
  *  @query: query
  *
- *  Set a #GURI's query.
+ *  Set a #KzURI's query.
  *
  **/
 void
-gnet_uri_set_query (GURI* uri, const gchar* query)
+kz_uri_set_query (KzURI* uri, const gchar* query)
 {
   g_return_if_fail (uri);
 
@@ -779,15 +779,15 @@
 
 
 /**
- *  gnet_uri_set_fragment
- *  @uri: a #GURI
+ *  kz_uri_set_fragment
+ *  @uri: a #KzURI
  *  @fragment: fragment
  *
- *  Set a #GURI's fragment.
+ *  Set a #KzURI's fragment.
  *
  **/
 void
-gnet_uri_set_fragment (GURI* uri, const gchar* fragment)
+kz_uri_set_fragment (KzURI* uri, const gchar* fragment)
 {
   g_return_if_fail (uri);
 

Modified: kazehakase/trunk/src/net/uri.h
===================================================================
--- kazehakase/trunk/src/net/uri.h	2007-03-26 07:22:14 UTC (rev 3025)
+++ kazehakase/trunk/src/net/uri.h	2007-03-26 07:44:19 UTC (rev 3026)
@@ -29,7 +29,7 @@
 
 
 /**
- *  GURI:
+ *  KzURI:
  *  @scheme: Scheme (or protocol)
  *  @userinfo: User info
  *  @hostname: Host name
@@ -38,13 +38,13 @@
  *  @query: Query
  *  @fragment: Fragment
  *
- *  The #GURI structure represents a URI.  All fields in this
+ *  The #KzURI structure represents a URI.  All fields in this
  *  structure are publicly readable.
  *
  **/
-typedef struct _GURI GURI;
+typedef struct _KzURI KzURI;
 
-struct _GURI
+struct _KzURI
 {
   gchar* scheme;
   gchar* userinfo;
@@ -57,31 +57,31 @@
 
 
 
-GURI*     gnet_uri_new (const gchar* uri);
-GURI*     gnet_uri_new_fields (const gchar* scheme, const gchar* hostname, 
+KzURI*     kz_uri_new (const gchar* uri);
+KzURI*     kz_uri_new_fields (const gchar* scheme, const gchar* hostname, 
 			       const gint port, const gchar* path);
-GURI*	  gnet_uri_new_fields_all (const gchar* scheme, const gchar* userinfo, 
+KzURI*	  kz_uri_new_fields_all (const gchar* scheme, const gchar* userinfo, 
 				   const gchar* hostname, const gint port, 
 				   const gchar* path, 
 				   const gchar* query, const gchar* fragment);
-GURI*     gnet_uri_clone (const GURI* uri);
-void      gnet_uri_delete (GURI* uri);
+KzURI*     kz_uri_clone (const KzURI* uri);
+void      kz_uri_delete (KzURI* uri);
 	       
-gboolean  gnet_uri_equal (gconstpointer p1, gconstpointer p2);
-guint     gnet_uri_hash (gconstpointer p);
+gboolean  kz_uri_equal (gconstpointer p1, gconstpointer p2);
+guint     kz_uri_hash (gconstpointer p);
 
-void	  gnet_uri_escape (GURI* uri);
-void	  gnet_uri_unescape (GURI* uri);
+void	  kz_uri_escape (KzURI* uri);
+void	  kz_uri_unescape (KzURI* uri);
 
-gchar* 	  gnet_uri_get_string (const GURI* uri);
+gchar* 	  kz_uri_get_string (const KzURI* uri);
 
-void 	  gnet_uri_set_scheme   (GURI* uri, const gchar* scheme);
-void 	  gnet_uri_set_userinfo	(GURI* uri, const gchar* userinfo);
-void 	  gnet_uri_set_hostname (GURI* uri, const gchar* hostname);
-void 	  gnet_uri_set_port     (GURI* uri, gint port);
-void 	  gnet_uri_set_path	(GURI* uri, const gchar* path);
-void 	  gnet_uri_set_query 	(GURI* uri, const gchar* query);
-void 	  gnet_uri_set_fragment (GURI* uri, const gchar* fragment);
+void 	  kz_uri_set_scheme   (KzURI* uri, const gchar* scheme);
+void 	  kz_uri_set_userinfo	(KzURI* uri, const gchar* userinfo);
+void 	  kz_uri_set_hostname (KzURI* uri, const gchar* hostname);
+void 	  kz_uri_set_port     (KzURI* uri, gint port);
+void 	  kz_uri_set_path	(KzURI* uri, const gchar* path);
+void 	  kz_uri_set_query 	(KzURI* uri, const gchar* query);
+void 	  kz_uri_set_fragment (KzURI* uri, const gchar* fragment);
 
 #ifdef __cplusplus
 }




More information about the Kazehakase-cvs mailing list
Back to archive index