# HG changeset patch # User melunko # Date 1187788003 -3600 # Node ID 6001f33507b45b21925f968296978a65a87d669e # Parent 888b9724f6011472f07385f102ae7db8df2a984c [svn r824] Added db_port field in the GMythBackendInfo diff -r 888b9724f601 -r 6001f33507b4 gmyth/src/gmyth_backendinfo.c --- a/gmyth/src/gmyth_backendinfo.c Tue Aug 21 20:04:23 2007 +0100 +++ b/gmyth/src/gmyth_backendinfo.c Wed Aug 22 14:06:43 2007 +0100 @@ -57,10 +57,11 @@ gmyth_backend_info_init(GMythBackendInfo * backend_info) { backend_info->hostname = NULL; + backend_info->port = -1; backend_info->username = NULL; backend_info->password = NULL; backend_info->db_name = NULL; - backend_info->port = -1; + backend_info->db_port = 0; backend_info->status_port = -1; } @@ -78,10 +79,11 @@ g_object_unref (backend_info->sock); backend_info->hostname = NULL; + backend_info->port = -1; backend_info->username = NULL; backend_info->password = NULL; backend_info->db_name = NULL; - backend_info->port = -1; + backend_info->db_port = 0; backend_info->status_port = -1; backend_info->sock = NULL; @@ -223,6 +225,18 @@ } void +gmyth_backend_info_set_db_port(GMythBackendInfo * backend_info, gint db_port) +{ + g_return_if_fail(backend_info != NULL); + + if (db_port <= 0) { + gmyth_debug("Error trying to set a port less than 0."); + } else { + backend_info->db_port = db_port; + } +} + +void gmyth_backend_info_set_port(GMythBackendInfo * backend_info, gint port) { g_return_if_fail(backend_info != NULL); @@ -281,6 +295,15 @@ } gint +gmyth_backend_info_get_idb_port(GMythBackendInfo * backend_info) +{ + g_return_val_if_fail(backend_info != NULL, -1); + + return backend_info->db_port; +} + + +gint gmyth_backend_info_get_port(GMythBackendInfo * backend_info) { g_return_val_if_fail(backend_info != NULL, -1); diff -r 888b9724f601 -r 6001f33507b4 gmyth/src/gmyth_backendinfo.h --- a/gmyth/src/gmyth_backendinfo.h Tue Aug 21 20:04:23 2007 +0100 +++ b/gmyth/src/gmyth_backendinfo.h Wed Aug 22 14:06:43 2007 +0100 @@ -63,19 +63,21 @@ }; struct _GMythBackendInfo { - GObject parent; + GObject parent; /** The backend hostname or ip address. */ - gchar *hostname; + gchar *hostname; + /** The backend port. */ + gint port; /** The username to connect to the mysql server. */ - gchar *username; + gchar *username; /** The password to connect to the mysql server. */ - gchar *password; + gchar *password; /** The mythtv's mysql database name. */ - gchar *db_name; - /** The backend port. */ - gint port; + gchar *db_name; + /** The mysql database port */ + gint db_port; /** The backend status port for http connection */ - gint status_port; + gint status_port; /* Private */ GMythSocket *sock; @@ -98,6 +100,8 @@ const gchar *password); void gmyth_backend_info_set_db_name (GMythBackendInfo *backend_info, const gchar *db_name); +void gmyth_backend_info_set_db_port (GMythBackendInfo *backend_info, + gint db_port); void gmyth_backend_info_set_port (GMythBackendInfo *backend_info, gint port); void gmyth_backend_info_set_status_port (GMythBackendInfo *backend_info, @@ -106,6 +110,7 @@ const gchar* gmyth_backend_info_get_username (GMythBackendInfo *backend_info); const gchar* gmyth_backend_info_get_password (GMythBackendInfo *backend_info); const gchar* gmyth_backend_info_get_db_name (GMythBackendInfo *backend_info); +gint gmyth_backend_info_get_db_port (GMythBackendInfo *backend_info); gint gmyth_backend_info_get_port (GMythBackendInfo *backend_info); GMythURI* gmyth_backend_info_get_uri (GMythBackendInfo *backend_info); gboolean gmyth_backend_info_is_local_file (GMythBackendInfo *backend_info);