[svn r179] New functions, when setting the 'path' field in the URI.
1.1 --- a/gmyth/src/gmyth_backendinfo.c Sat Dec 02 03:46:17 2006 +0000
1.2 +++ b/gmyth/src/gmyth_backendinfo.c Sat Dec 02 03:54:40 2006 +0000
1.3 @@ -52,9 +52,10 @@
1.4 {
1.5 backend_info->hostname = NULL;
1.6 backend_info->username = NULL;
1.7 - backend_info->password = NULL;
1.8 + backend_info->password = NULL;
1.9 backend_info->db_name = NULL;
1.10 backend_info->port = -1;
1.11 + backend_info->path = NULL;
1.12 }
1.13
1.14 static void
1.15 @@ -66,12 +67,14 @@
1.16 g_free (backend_info->username);
1.17 g_free (backend_info->password);
1.18 g_free (backend_info->db_name);
1.19 + g_free (backend_info->path);
1.20
1.21 backend_info->hostname = NULL;
1.22 backend_info->username = NULL;
1.23 backend_info->password = NULL;
1.24 backend_info->db_name = NULL;
1.25 backend_info->port = -1;
1.26 + backend_info->path = NULL;
1.27
1.28 G_OBJECT_CLASS (gmyth_backend_info_parent_class)->dispose (object);
1.29 }
1.30 @@ -98,8 +101,8 @@
1.31 }
1.32
1.33 GMythBackendInfo*
1.34 -gmyth_backend_info_new_full (const char *hostname, const char *username,
1.35 - const char *password, const char *db_name, gint port)
1.36 +gmyth_backend_info_new_full (const gchar *hostname, const gchar *username,
1.37 + const gchar *password, const gchar *db_name, gint port)
1.38 {
1.39 GMythBackendInfo *backend_info =
1.40 GMYTH_BACKEND_INFO (g_object_new(GMYTH_BACKEND_INFO_TYPE, NULL));
1.41 @@ -119,26 +122,29 @@
1.42 GMythBackendInfo *backend_info =
1.43 GMYTH_BACKEND_INFO (g_object_new(GMYTH_BACKEND_INFO_TYPE, NULL));
1.44
1.45 -printf ("XXX %s %d\n", __FUNCTION__, __LINE__);
1.46 + gmyth_debug ("XXX %s %d\n", __FUNCTION__, __LINE__);
1.47 GMythURI* uri = gmyth_uri_new_with_value( uri_str );
1.48 -printf ("XXX %s %d\n", __FUNCTION__, __LINE__);
1.49 + gmyth_debug ("XXX %s %d\n", __FUNCTION__, __LINE__);
1.50
1.51 gmyth_backend_info_set_hostname (backend_info, gmyth_uri_get_host (uri ) );
1.52 -printf ("XXX %s %d \n", __FUNCTION__, __LINE__);
1.53 + gmyth_debug ("%s\n", gmyth_uri_get_host (uri ));
1.54 gmyth_backend_info_set_username (backend_info, gmyth_uri_get_user( uri ) );
1.55 -printf ("XXX %s %d\n", __FUNCTION__, __LINE__);
1.56 + gmyth_debug ("%s\n", gmyth_uri_get_user( uri ));
1.57 gmyth_backend_info_set_password (backend_info, gmyth_uri_get_password( uri ) );
1.58 -printf ("XXX %s %d\n", __FUNCTION__, __LINE__);
1.59 + gmyth_debug ("%s\n", gmyth_uri_get_password( uri ));
1.60 gmyth_backend_info_set_db_name (backend_info, strlen( gmyth_uri_get_fragment( uri ) ) > 0
1.61 ? gmyth_uri_get_fragment( uri ) : gmyth_uri_get_query( uri ) );
1.62 gmyth_backend_info_set_port (backend_info, gmyth_uri_get_port( uri ) );
1.63 -printf ("XXX %s %d\n", __FUNCTION__, __LINE__);
1.64 + gmyth_debug ("%s\n", gmyth_backend_info_get_db_name(backend_info) );
1.65 +
1.66 + gmyth_backend_info_set_path (backend_info, gmyth_uri_get_path( uri ) );
1.67 + gmyth_debug ("%s\n", gmyth_backend_info_get_path(backend_info) );
1.68
1.69 return backend_info;
1.70 }
1.71
1.72 void
1.73 -gmyth_backend_info_set_hostname (GMythBackendInfo *backend_info, const char *hostname)
1.74 +gmyth_backend_info_set_hostname (GMythBackendInfo *backend_info, const gchar *hostname)
1.75 {
1.76 g_return_if_fail (backend_info != NULL);
1.77
1.78 @@ -146,7 +152,7 @@
1.79 }
1.80
1.81 void
1.82 -gmyth_backend_info_set_username (GMythBackendInfo *backend_info, const char *username)
1.83 +gmyth_backend_info_set_username (GMythBackendInfo *backend_info, const gchar *username)
1.84 {
1.85 g_return_if_fail (backend_info != NULL);
1.86
1.87 @@ -154,7 +160,7 @@
1.88 }
1.89
1.90 void
1.91 -gmyth_backend_info_set_password (GMythBackendInfo *backend_info, const char *password)
1.92 +gmyth_backend_info_set_password (GMythBackendInfo *backend_info, const gchar *password)
1.93 {
1.94 g_return_if_fail (backend_info != NULL);
1.95
1.96 @@ -162,7 +168,7 @@
1.97 }
1.98
1.99 void
1.100 -gmyth_backend_info_set_db_name (GMythBackendInfo *backend_info, const char *db_name)
1.101 +gmyth_backend_info_set_db_name (GMythBackendInfo *backend_info, const gchar *db_name)
1.102 {
1.103 g_return_if_fail (backend_info != NULL);
1.104
1.105 @@ -177,7 +183,15 @@
1.106 backend_info->port = port;
1.107 }
1.108
1.109 -char*
1.110 +void
1.111 +gmyth_backend_info_set_path (GMythBackendInfo *backend_info, const gchar *path)
1.112 +{
1.113 + g_return_if_fail (backend_info != NULL);
1.114 +
1.115 + backend_info->path = g_strdup (path);
1.116 +}
1.117 +
1.118 +gchar*
1.119 gmyth_backend_info_get_hostname (GMythBackendInfo *backend_info)
1.120 {
1.121 g_return_val_if_fail (backend_info != NULL, NULL);
1.122 @@ -185,7 +199,7 @@
1.123 return backend_info->hostname;
1.124 }
1.125
1.126 -char*
1.127 +gchar*
1.128 gmyth_backend_info_get_username (GMythBackendInfo *backend_info)
1.129 {
1.130 g_return_val_if_fail (backend_info != NULL, NULL);
1.131 @@ -193,7 +207,7 @@
1.132 return backend_info->username;
1.133 }
1.134
1.135 -char*
1.136 +gchar*
1.137 gmyth_backend_info_get_password (GMythBackendInfo *backend_info)
1.138 {
1.139 g_return_val_if_fail (backend_info != NULL, NULL);
1.140 @@ -201,7 +215,7 @@
1.141 return backend_info->password;
1.142 }
1.143
1.144 -char*
1.145 +gchar*
1.146 gmyth_backend_info_get_db_name (GMythBackendInfo *backend_info)
1.147 {
1.148 g_return_val_if_fail (backend_info != NULL, NULL);
1.149 @@ -216,3 +230,11 @@
1.150
1.151 return backend_info->port;
1.152 }
1.153 +
1.154 +gchar*
1.155 +gmyth_backend_info_get_path (GMythBackendInfo *backend_info)
1.156 +{
1.157 + g_return_val_if_fail (backend_info != NULL, NULL);
1.158 +
1.159 + return backend_info->path;
1.160 +}
2.1 --- a/gmyth/src/gmyth_backendinfo.h Sat Dec 02 03:46:17 2006 +0000
2.2 +++ b/gmyth/src/gmyth_backendinfo.h Sat Dec 02 03:54:40 2006 +0000
2.3 @@ -59,6 +59,7 @@
2.4 gchar *password;
2.5 gchar *db_name;
2.6 gint port;
2.7 + gchar *path;
2.8 };
2.9
2.10
2.11 @@ -66,22 +67,23 @@
2.12
2.13 GMythBackendInfo* gmyth_backend_info_new ();
2.14 GMythBackendInfo* gmyth_backend_info_new_full (
2.15 - const char *hostname, const char *username, const char *password,
2.16 - const char *db_name, gint port);
2.17 + const gchar *hostname, const gchar *username, const gchar *password,
2.18 + const gchar *db_name, gint port);
2.19 GMythBackendInfo* gmyth_backend_info_new_with_uri (const gchar *uri_str );
2.20
2.21 -void gmyth_backend_info_set_hostname (GMythBackendInfo *backend_info, const char *hostname);
2.22 -void gmyth_backend_info_set_username (GMythBackendInfo *backend_info, const char *username);
2.23 -void gmyth_backend_info_set_password (GMythBackendInfo *backend_info, const char *password);
2.24 -void gmyth_backend_info_set_db_name (GMythBackendInfo *backend_info, const char *db_name);
2.25 +void gmyth_backend_info_set_hostname (GMythBackendInfo *backend_info, const gchar *hostname);
2.26 +void gmyth_backend_info_set_username (GMythBackendInfo *backend_info, const gchar *username);
2.27 +void gmyth_backend_info_set_password (GMythBackendInfo *backend_info, const gchar *password);
2.28 +void gmyth_backend_info_set_db_name (GMythBackendInfo *backend_info, const gchar *db_name);
2.29 void gmyth_backend_info_set_port (GMythBackendInfo *backend_info, gint port);
2.30 +void gmyth_backend_info_set_path (GMythBackendInfo *backend_info, const gchar *path);
2.31
2.32 -char* gmyth_backend_info_get_hostname (GMythBackendInfo *backend_info);
2.33 -char* gmyth_backend_info_get_username (GMythBackendInfo *backend_info);
2.34 -char* gmyth_backend_info_get_password (GMythBackendInfo *backend_info);
2.35 -char* gmyth_backend_info_get_db_name (GMythBackendInfo *backend_info);
2.36 +gchar* gmyth_backend_info_get_hostname (GMythBackendInfo *backend_info);
2.37 +gchar* gmyth_backend_info_get_username (GMythBackendInfo *backend_info);
2.38 +gchar* gmyth_backend_info_get_password (GMythBackendInfo *backend_info);
2.39 +gchar* gmyth_backend_info_get_db_name (GMythBackendInfo *backend_info);
2.40 gint gmyth_backend_info_get_port (GMythBackendInfo *backend_info);
2.41 -
2.42 +gchar* gmyth_backend_info_get_path (GMythBackendInfo *backend_info);
2.43
2.44 G_END_DECLS
2.45