[svn r424] Added documention. trunk
authorrosfran
Tue Mar 20 15:08:35 2007 +0000 (2007-03-20)
branchtrunk
changeset 41918916d01fd45
parent 418 fb1b1b2f16cc
child 420 c1601c03cc78
[svn r424] Added documention.
gmyth/src/gmyth_file_transfer.c
gmyth/src/gmyth_monitor_handler.c
     1.1 --- a/gmyth/src/gmyth_file_transfer.c	Tue Mar 20 14:46:32 2007 +0000
     1.2 +++ b/gmyth/src/gmyth_file_transfer.c	Tue Mar 20 15:08:35 2007 +0000
     1.3 @@ -224,7 +224,11 @@
     1.4    G_OBJECT_CLASS (gmyth_file_transfer_parent_class)->finalize (object);
     1.5  }
     1.6  
     1.7 -// fixme: do we need the card_id????
     1.8 +/** 
     1.9 + * Creates a new instance of GMyth File Transfer.
    1.10 + * 
    1.11 + * @return a new instance of the File Transfer. 
    1.12 + */
    1.13  GMythFileTransfer*
    1.14  gmyth_file_transfer_new ( const GMythBackendInfo *backend_info)
    1.15  {
     2.1 --- a/gmyth/src/gmyth_monitor_handler.c	Tue Mar 20 14:46:32 2007 +0000
     2.2 +++ b/gmyth/src/gmyth_monitor_handler.c	Tue Mar 20 15:08:35 2007 +0000
     2.3 @@ -153,7 +153,7 @@
     2.4  	{
     2.5  		g_main_context_acquire( context );
     2.6  		
     2.7 -		source = g_main_context_find_source_by_id( g_main_context_default(), 
     2.8 +		source = g_main_context_find_source_by_id( context, 
     2.9  						monitor->sid_io_watch );
    2.10  		
    2.11  		if ( source != NULL )
    2.12 @@ -165,6 +165,7 @@
    2.13  		
    2.14  	}
    2.15  
    2.16 +  /* mutex to control access to the event socket consumer thread */
    2.17    if ( monitor->mutex != NULL )
    2.18    {
    2.19    	g_mutex_free( monitor->mutex );
    2.20 @@ -209,19 +210,28 @@
    2.21    G_OBJECT_CLASS (gmyth_monitor_handler_parent_class)->finalize (object);
    2.22  }
    2.23  
    2.24 -// fixme: do we need the card_id????
    2.25 +/** 
    2.26 + * Creates a new instance of GMyth Monitor Handler.
    2.27 + * 
    2.28 + * @return a new instance of the Monitor Handler. 
    2.29 + */
    2.30  GMythMonitorHandler*
    2.31  gmyth_monitor_handler_new ( void )
    2.32  {
    2.33    GMythMonitorHandler *monitor = GMYTH_MONITOR_HANDLER ( 
    2.34    					g_object_new ( GMYTH_MONITOR_HANDLER_TYPE, FALSE ) );
    2.35  
    2.36 -  /* mutex to control access to the event socket consumer thread */
    2.37 -  //monitor->mutex = g_mutex_new();
    2.38 -
    2.39    return monitor;
    2.40  }
    2.41  
    2.42 +/** 
    2.43 + * Acquire the mutex to have access to the IO Watcher listener.
    2.44 + * 
    2.45 + * @param monitor The GMythMonitorHandler instance.
    2.46 + * @param do_wait Tells the IO Watcher to wait on the GCond. (obsolete)
    2.47 + * 
    2.48 + * @return <code>true</code>, if the access to IO Watcher was acquired. 
    2.49 + */
    2.50  static gboolean 
    2.51  myth_control_acquire_context( GMythMonitorHandler *monitor, gboolean do_wait ) 
    2.52  {
    2.53 @@ -234,6 +244,13 @@
    2.54    
    2.55  }
    2.56  
    2.57 +/** 
    2.58 + * Release the mutex to have access to the IO Watcher listener.
    2.59 + * 
    2.60 + * @param monitor The GMythMonitorHandler instance.
    2.61 + * 
    2.62 + * @return <code>true</code>, if the access to IO Watcher was released. 
    2.63 + */
    2.64  static gboolean 
    2.65  myth_control_release_context( GMythMonitorHandler *monitor ) 
    2.66  {
    2.67 @@ -269,6 +286,16 @@
    2.68  
    2.69  }
    2.70  
    2.71 +/** 
    2.72 + * Opens connection the the Monitor socket on MythTV backend server,
    2.73 + * where all status messages are notified to the client.
    2.74 + * 
    2.75 + * @param monitor The GMythMonitorHandler instance.
    2.76 + * @param hostname The remote host name of the MythTV backend server.
    2.77 + * @param port The remote port number of the MythTV backend server.
    2.78 + * 
    2.79 + * @return <code>true</code>, if the connection was successfully opened.
    2.80 + */
    2.81  gboolean
    2.82  gmyth_monitor_handler_open (GMythMonitorHandler *monitor, const gchar *hostname, gint port)
    2.83  {
    2.84 @@ -300,6 +327,16 @@
    2.85  
    2.86  }
    2.87  
    2.88 +/** 
    2.89 + * Reads the data got from the connection to the Monitor socket,
    2.90 + * and looks for some important status messages.
    2.91 + * 
    2.92 + * @param monitor The GMythMonitorHandler instance.
    2.93 + * @param strlist The GMythStringList instance got from the Monitor remote socket.
    2.94 + * @param back_msg_action A string pointer to the status message detailed description.
    2.95 + * 
    2.96 + * @return The backend status message code ID.
    2.97 + */
    2.98  static gint
    2.99  gmyth_monitor_handler_is_backend_message( GMythMonitorHandler *monitor,
   2.100                          GMythStringList* strlist, gchar **back_msg_action )
   2.101 @@ -371,6 +408,16 @@
   2.102  	gmyth_debug( "Backend message event: %s --- ", str->str );
   2.103  }
   2.104  
   2.105 +/** 
   2.106 + * Opens connection the the Monitor socket on MythTV backend server,
   2.107 + * where all status messages are notified to the client.
   2.108 + * 
   2.109 + * @param io_channel The GIOChannel instance to the Monitor connection.
   2.110 + * @param io_cond The GIOCondition describing the actual status of the IO Channel.
   2.111 + * @param data Pointer to the GMythMonitorHandler.
   2.112 + * 
   2.113 + * @return <code>true</code>, if the data was successfully read.
   2.114 + */
   2.115  gboolean
   2.116  gmyth_monitor_handler_listener( GIOChannel *io_channel, GIOCondition io_cond, gpointer data )
   2.117  {
   2.118 @@ -399,7 +446,7 @@
   2.119    GMythStringList *strlist = NULL;
   2.120    
   2.121    if ( NULL == io_channel ) {
   2.122 -  	g_debug ("Monitor socket is NULL!\n");
   2.123 +  	gmyth_debug ("Monitor socket is NULL! (GIOChannel)");
   2.124    	*ret = FALSE;
   2.125    	goto clean_up;
   2.126    }
   2.127 @@ -477,6 +524,14 @@
   2.128  
   2.129  }
   2.130  
   2.131 +/** 
   2.132 + * Opens connection events' socket the the Monitor socket on 
   2.133 + * MythTV backend server.
   2.134 + * 
   2.135 + * @param monitor The GMythMonitorHandler instance.
   2.136 + * 
   2.137 + * @return <code>true</code>, if the socket was successfully opened.
   2.138 + */
   2.139  static gboolean
   2.140  gmyth_connect_to_backend_monitor (GMythMonitorHandler *monitor)
   2.141  {
   2.142 @@ -496,6 +551,16 @@
   2.143    return ret;
   2.144  }    
   2.145  
   2.146 +/** 
   2.147 + * Opens connection the the Monitor socket on MythTV backend server,
   2.148 + * where all status messages are notified to the client.
   2.149 + * 
   2.150 + * @param monitor The GMythMonitorHandler instance.
   2.151 + * @param channel The GIOChannel instance to the Monitor socket.
   2.152 + * 
   2.153 + * @return Pointer to the boolean value, and it is <code>true</code> only if the 
   2.154 + * 				 GMythMonitorHandler could be configured.
   2.155 + */
   2.156  static gboolean*
   2.157  gmyth_monitor_handler_setup( GMythMonitorHandler *monitor, GIOChannel *channel )
   2.158  {
   2.159 @@ -526,6 +591,13 @@
   2.160    
   2.161  }
   2.162  
   2.163 +/** 
   2.164 + * Starts the MonitorHandler thread to the GIOWatcher.
   2.165 + * 
   2.166 + * @param monitor The GMythMonitorHandler instance.
   2.167 + * 
   2.168 + * @return <code>true</code>, if the MonitorHandler was started.
   2.169 + */
   2.170  gboolean 
   2.171  gmyth_monitor_handler_start (GMythMonitorHandler *monitor)
   2.172  {