[svn r425] Added internal DOxygen documentation. trunk
authorrosfran
Tue Mar 20 21:23:58 2007 +0000 (2007-03-20)
branchtrunk
changeset 420c1601c03cc78
parent 419 18916d01fd45
child 421 d04e08f9893a
[svn r425] Added internal DOxygen documentation.
gmyth/src/gmyth_backendinfo.c
gmyth/src/gmyth_backendinfo.h
gmyth/src/gmyth_common.c
gmyth/src/gmyth_common.h
gmyth/src/gmyth_file_transfer.c
gmyth/src/gmyth_programinfo.c
gmyth/src/gmyth_programinfo.h
gmyth/src/gmyth_recorder.c
gmyth/src/gmyth_recorder.h
gmyth/src/gmyth_remote_util.c
gmyth/src/gmyth_uri.c
gmyth/src/gmyth_util.c
gmyth/src/gmyth_util.h
     1.1 --- a/gmyth/src/gmyth_backendinfo.c	Tue Mar 20 15:08:35 2007 +0000
     1.2 +++ b/gmyth/src/gmyth_backendinfo.c	Tue Mar 20 21:23:58 2007 +0000
     1.3 @@ -1,11 +1,14 @@
     1.4 -
     1.5  /**
     1.6   * GMyth Library
     1.7   *
     1.8   * @file gmyth/gmyth_backend_info.c
     1.9   * 
    1.10 + * @brief <p> This component represents all the MythTV backend server
    1.11 + * 						configuration information.
    1.12 + *
    1.13   * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
    1.14   * @author Hallyson Melo <hallyson.melo@indt.org.br>
    1.15 + * @author Rosfran Borges <rosfran.borges@indt.org.br>
    1.16   *
    1.17   *//*
    1.18   * 
     2.1 --- a/gmyth/src/gmyth_backendinfo.h	Tue Mar 20 15:08:35 2007 +0000
     2.2 +++ b/gmyth/src/gmyth_backendinfo.h	Tue Mar 20 21:23:58 2007 +0000
     2.3 @@ -3,9 +3,12 @@
     2.4   *
     2.5   * @file gmyth/gmyth_backend_info.h
     2.6   * 
     2.7 + * @brief <p> This component represents all the MythTV backend server
     2.8 + * 						configuration information.
     2.9   *
    2.10   * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
    2.11   * @author Hallyson Melo <hallyson.melo@indt.org.br>
    2.12 + * @author Rosfran Borges <rosfran.borges@indt.org.br>
    2.13   *
    2.14   *//*
    2.15   * 
     3.1 --- a/gmyth/src/gmyth_common.c	Tue Mar 20 15:08:35 2007 +0000
     3.2 +++ b/gmyth/src/gmyth_common.c	Tue Mar 20 21:23:58 2007 +0000
     3.3 @@ -7,6 +7,7 @@
     3.4   *
     3.5   * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
     3.6   * @author Leonardo Sobral Cunha <leonardo.cunha@indt.org.br>
     3.7 + * @author Rosfran Borges <rosfran.borges@indt.org.br>
     3.8   *
     3.9   *//*
    3.10   * 
    3.11 @@ -110,7 +111,7 @@
    3.12  static void 
    3.13  free_channel_data (gpointer data, gpointer user_data)
    3.14  {
    3.15 -    // Frees the GMythChannelInfo structure
    3.16 +    /* Frees the GMythChannelInfo structure */
    3.17      g_free(data);
    3.18  }
    3.19  
     4.1 --- a/gmyth/src/gmyth_common.h	Tue Mar 20 15:08:35 2007 +0000
     4.2 +++ b/gmyth/src/gmyth_common.h	Tue Mar 20 21:23:58 2007 +0000
     4.3 @@ -7,6 +7,7 @@
     4.4   *
     4.5   * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
     4.6   * @author Leonardo Sobral Cunha <leonardo.cunha@indt.org.br>
     4.7 + * @author Rosfran Borges <rosfran.borges@indt.org.br>
     4.8   *
     4.9   *//*
    4.10   * 
     5.1 --- a/gmyth/src/gmyth_file_transfer.c	Tue Mar 20 15:08:35 2007 +0000
     5.2 +++ b/gmyth/src/gmyth_file_transfer.c	Tue Mar 20 21:23:58 2007 +0000
     5.3 @@ -225,7 +225,10 @@
     5.4  }
     5.5  
     5.6  /** 
     5.7 - * Creates a new instance of GMyth File Transfer.
     5.8 + * Creates a new instance of GMythFileTransfer.
     5.9 + * 
    5.10 + * @param backend_info The BackendInfo instance, with all the MythTV network 
    5.11 + * 										 configuration data.
    5.12   * 
    5.13   * @return a new instance of the File Transfer. 
    5.14   */
    5.15 @@ -240,6 +243,13 @@
    5.16    return transfer;
    5.17  }
    5.18  
    5.19 +/** 
    5.20 + * Creates a new instance of GMythFileTransfer.
    5.21 + * 
    5.22 + * @param uri_str The URI poiting to the MythTV backend server.
    5.23 + * 
    5.24 + * @return a new instance of the File Transfer. 
    5.25 + */
    5.26  GMythFileTransfer* 
    5.27  gmyth_file_transfer_new_with_uri (const gchar* uri_str)
    5.28  {
    5.29 @@ -250,6 +260,14 @@
    5.30    return transfer;
    5.31  }
    5.32  
    5.33 +/** 
    5.34 + * Open a File Transfer connection in order to get a remote file.
    5.35 + * 
    5.36 + * @param transfer The actual File Transfer instance. 
    5.37 + * @param filename The file name of the remote file to be transfered to the client.
    5.38 + * 
    5.39 + * @return <code>true</code>, if the connection opening had been done successfully. 
    5.40 + */
    5.41  gboolean
    5.42  gmyth_file_transfer_open (GMythFileTransfer *transfer, const gchar* filename)
    5.43  {
    5.44 @@ -285,6 +303,13 @@
    5.45  
    5.46  }
    5.47  
    5.48 +/** 
    5.49 + * Connect a File Transfer binary client socket to a remote file.
    5.50 + * 
    5.51 + * @param transfer The actual File Transfer instance. 
    5.52 + * 
    5.53 + * @return <code>true</code>, if the connection had been configured successfully. 
    5.54 + */
    5.55  static gboolean
    5.56  gmyth_connect_to_backend (GMythFileTransfer *transfer)
    5.57  {
    5.58 @@ -385,6 +410,14 @@
    5.59    return ret;
    5.60  }    
    5.61  
    5.62 +/** 
    5.63 + * Receives a GObject signal coming from a LiveTV instance, all the time a 
    5.64 + * program info changes.
    5.65 + * 
    5.66 + * @param transfer The actual File Transfer instance. 
    5.67 + * @param msg_code The MythTV backend message status code.
    5.68 + * @param live_tv A pointer to the LiveTV instance. * 
    5.69 + */
    5.70  void
    5.71  gmyth_file_transfer_emit_program_info_changed_signal ( GMythFileTransfer *transfer, gint msg_code,
    5.72  			gpointer live_tv ) 
    5.73 @@ -404,6 +437,13 @@
    5.74  
    5.75  }
    5.76  
    5.77 +/** 
    5.78 + * Checks if the actual File Transfer connection is open.
    5.79 + * 
    5.80 + * @param transfer The actual File Transfer instance. 
    5.81 + * 
    5.82 + * @return <code>true</code>, if the File Transfer connection is opened. 
    5.83 + */
    5.84  gboolean
    5.85  gmyth_file_transfer_is_open (GMythFileTransfer *transfer)
    5.86  {
    5.87 @@ -433,6 +473,11 @@
    5.88      return ( strlist != NULL && gmyth_string_list_get_int( strlist, 0 ) == 1 );
    5.89  }
    5.90  
    5.91 +/** 
    5.92 + * Closes a remote File Transfer connection.
    5.93 + * 
    5.94 + * @param transfer The actual File Transfer instance. 
    5.95 + */
    5.96  void
    5.97  gmyth_file_transfer_close( GMythFileTransfer *transfer )
    5.98  {
    5.99 @@ -472,6 +517,15 @@
   5.100  
   5.101  }
   5.102  
   5.103 +/** 
   5.104 + * Do a seek operation (moves the read/write file pointer) on a remote file.
   5.105 + * 
   5.106 + * @param transfer The actual File Transfer instance. 
   5.107 + * @param pos The position to be moved in the remote file.
   5.108 + * @param whence Tells to what direction seek movement should be done.
   5.109 + * 
   5.110 + * @return The actual position on the remote file (after seek has been done). 
   5.111 + */
   5.112  gint64
   5.113  gmyth_file_transfer_seek(GMythFileTransfer *transfer, guint64 pos, gint whence)
   5.114  {
   5.115 @@ -510,6 +564,14 @@
   5.116    return retval;
   5.117  }
   5.118  
   5.119 +/** 
   5.120 + * Acquire access to a remote file socket read/write pointer.
   5.121 + * 
   5.122 + * @param transfer The actual File Transfer instance.
   5.123 + * @param do_wait Waits or not on a GCond, when trying to read from the remote socket.
   5.124 + * 
   5.125 + * @return <code>true</code>, if the acquire had been got. 
   5.126 + */
   5.127  static gboolean 
   5.128  myth_control_acquire_context( GMythFileTransfer *transfer, gboolean do_wait )
   5.129  {
   5.130 @@ -538,6 +600,13 @@
   5.131    return ret;
   5.132  }
   5.133  
   5.134 +/** 
   5.135 + * Release access to a remote file socket read/write pointer.
   5.136 + * 
   5.137 + * @param transfer The actual File Transfer instance.
   5.138 + * 
   5.139 + * @return <code>true</code>, if the socket read/write permissions had been releaseds. 
   5.140 + */
   5.141  static gboolean 
   5.142  myth_control_release_context( GMythFileTransfer *transfer ) 
   5.143  {
   5.144 @@ -558,6 +627,19 @@
   5.145    return ret;
   5.146  }
   5.147  
   5.148 +/** 
   5.149 + * Reads a block from a remote file.
   5.150 + * 
   5.151 + * @param transfer The actual File Transfer instance.
   5.152 + * @param data A GByteArray instance, where all the binary data representing 
   5.153 + * 						 the remote file will be stored.
   5.154 + * @param size The block size, in bytes, to be requested from a remote file.
   5.155 + * @param read_unlimited Tells the backend to read indefinitely (LiveTV), or only 
   5.156 + * 											 gets the actual size
   5.157 + * 
   5.158 + * @return The actual block size (in bytes) returned by REQUEST_BLOCK message,
   5.159 + * 				or the error code. 
   5.160 + */
   5.161  gint 
   5.162  gmyth_file_transfer_read(GMythFileTransfer *transfer, GByteArray *data, gint size, gboolean read_unlimited)
   5.163  {
   5.164 @@ -574,7 +656,7 @@
   5.165    GIOCondition io_cond_control;
   5.166    GIOStatus io_status = G_IO_STATUS_NORMAL, io_status_control = G_IO_STATUS_NORMAL;
   5.167    
   5.168 -  gboolean ret = TRUE;   
   5.169 +  gboolean ret = TRUE;
   5.170  
   5.171    GString *query;
   5.172    
   5.173 @@ -712,6 +794,7 @@
   5.174    return total_read;
   5.175  }
   5.176  
   5.177 +
   5.178  static void 
   5.179  gmyth_file_transfer_program_info_changed( GMythFileTransfer *transfer, 
   5.180  										gint msg_code, gpointer livetv_transfer )
   5.181 @@ -733,6 +816,15 @@
   5.182  	
   5.183  }
   5.184  
   5.185 +/** 
   5.186 + * Sets the timeout flag of a file being transfered.
   5.187 + * 
   5.188 + * @param transfer The actual File Transfer instance.
   5.189 + * @param fast If this is <code>true</code>, sets the remote timeout to be as fast
   5.190 + * 						as possible.
   5.191 + * 
   5.192 + * @return <code>true</code>, if the acquire had been got. 
   5.193 + */
   5.194  gboolean 
   5.195  gmyth_file_transfer_settimeout( GMythFileTransfer *transfer, gboolean fast )
   5.196  {
   5.197 @@ -765,6 +857,13 @@
   5.198    return TRUE;
   5.199  }
   5.200  
   5.201 +/** 
   5.202 + * Gets the actual file size of the binary content.
   5.203 + * 
   5.204 + * @param transfer The actual File Transfer instance.
   5.205 + * 
   5.206 + * @return The actual file size in bytes. 
   5.207 + */
   5.208  guint64
   5.209  gmyth_file_transfer_get_filesize (GMythFileTransfer *transfer)
   5.210  {
     6.1 --- a/gmyth/src/gmyth_programinfo.c	Tue Mar 20 15:08:35 2007 +0000
     6.2 +++ b/gmyth/src/gmyth_programinfo.c	Tue Mar 20 21:23:58 2007 +0000
     6.3 @@ -3,10 +3,11 @@
     6.4   *
     6.5   * @file gmyth/gmyth_programinfo.c
     6.6   * 
     6.7 - * @brief <p> GMythFileTransfer deals with the file streaming media remote/local
     6.8 - * transfering to the MythTV frontend.
     6.9 + * @brief <p> GMythProgramInfo representing the program info, with the
    6.10 + * configuration data to the actual remote file in the TV chain.
    6.11   *
    6.12   * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
    6.13 + * @author Rosfran Borges <rosfran.borges@indt.org.br>
    6.14   * @author Leonardo Sobral Cunha <leonardo.cunha@indt.org.br>
    6.15   *
    6.16   *//*
    6.17 @@ -251,6 +252,16 @@
    6.18      return program_info;
    6.19  }
    6.20  
    6.21 +/**
    6.22 + * Converts an instance of a GMythProgramInfo, to a GMythStringList.
    6.23 + * 
    6.24 + * @param prog A GMythProgramInfo instance.
    6.25 + * @param slist The GMythStringList to be passed to this function, in order to
    6.26 + * 							give the responsibility of the string list creation to the
    6.27 + * 						  API user.
    6.28 + * 
    6.29 + * @return a GMythStringList with the program info fields.
    6.30 + */
    6.31  GMythStringList*
    6.32  gmyth_program_info_to_string_list (GMythProgramInfo *prog, GMythStringList *slist)
    6.33  {
    6.34 @@ -319,6 +330,13 @@
    6.35      return slist;
    6.36  }
    6.37  
    6.38 +/**
    6.39 + * Converts an instance of a GMythStringList, to a GMythProgramInfo.
    6.40 + * 
    6.41 + * @param slist The GMythStringList got from the MythTV backend server.
    6.42 + * 
    6.43 + * @return a GMythProgramInfo representing the string list got from network.
    6.44 + */
    6.45  GMythProgramInfo*
    6.46  gmyth_program_info_from_string_list ( GMythStringList *slist )
    6.47  {
    6.48 @@ -397,6 +415,13 @@
    6.49  	return ( str != NULL && str->str != NULL && strlen( str->str ) > 0 ? str->str : " " );
    6.50  }
    6.51  
    6.52 +/**
    6.53 + * Prints out an instance of a GMythProgramInfo.
    6.54 + * 
    6.55 + * @param prog A GMythProgramInfo instance.
    6.56 + * 
    6.57 + * @return a string representing the program info.
    6.58 + */
    6.59  const gchar*
    6.60  gmyth_program_info_to_string( const GMythProgramInfo* prog )
    6.61  {
     7.1 --- a/gmyth/src/gmyth_programinfo.h	Tue Mar 20 15:08:35 2007 +0000
     7.2 +++ b/gmyth/src/gmyth_programinfo.h	Tue Mar 20 21:23:58 2007 +0000
     7.3 @@ -1,11 +1,13 @@
     7.4  /**
     7.5   * GMyth Library
     7.6 + *
     7.7 + * @file gmyth/gmyth_programinfo.h
     7.8   * 
     7.9 - * @file gmyth/gmyth_common.h
    7.10 - * 
    7.11 - * @brief <p> This file contains basic common functions for the gmyth library.
    7.12 + * @brief <p> GMythProgramInfo representing the program info, with the
    7.13 + * configuration data to the actual remote file in the TV chain.
    7.14   *
    7.15   * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
    7.16 + * @author Rosfran Borges <rosfran.borges@indt.org.br>
    7.17   * @author Leonardo Sobral Cunha <leonardo.cunha@indt.org.br>
    7.18   *
    7.19   *//*
    7.20 @@ -23,6 +25,7 @@
    7.21   * You should have received a copy of the GNU Lesser General Public License
    7.22   * along with this program; if not, write to the Free Software
    7.23   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    7.24 + *
    7.25   */
    7.26  
    7.27  #ifndef _GMYTH_PROGRAMINFO_H
     8.1 --- a/gmyth/src/gmyth_recorder.c	Tue Mar 20 15:08:35 2007 +0000
     8.2 +++ b/gmyth/src/gmyth_recorder.c	Tue Mar 20 21:23:58 2007 +0000
     8.3 @@ -1,14 +1,15 @@
     8.4  /**
     8.5   * GMyth Library
     8.6   *
     8.7 - * @file gmyth/gmyth_remote_encoder.c
     8.8 + * @file gmyth/gmyth_recorder.c
     8.9   * 
    8.10 - * @brief <p> GMythRecorder class defines functions for playing live tv.
    8.11 + * @brief <p> GMythRecorder defines functions for playing live tv.
    8.12   *
    8.13   * The remote encoder is used by gmyth_tvplayer to setup livetv. 
    8.14   *
    8.15   * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
    8.16   * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
    8.17 + * @author Rosfran Borges <rosfran.borges@indt.org.br>
    8.18   *
    8.19   *//*
    8.20   * 
    8.21 @@ -115,6 +116,7 @@
    8.22  /** Configures the remote encoder instance connecting it to Mythtv backend.
    8.23   * 
    8.24   * @param recorder the GMythRecorder instance.
    8.25 + * 
    8.26   * @return TRUE if successfull, FALSE if any error happens.
    8.27   */
    8.28  gboolean
    8.29 @@ -754,6 +756,13 @@
    8.30  
    8.31  }
    8.32  
    8.33 +/**
    8.34 + * Requests the actual remote file position on a LiveTV instance.
    8.35 + * 
    8.36 + * @param recorder The GMythRecorder instance.
    8.37 + * 
    8.38 + * @return The position, in bytes, of the offset to the read header.
    8.39 + */
    8.40  gint64
    8.41  gmyth_recorder_get_file_position ( GMythRecorder *recorder )
    8.42  {
    8.43 @@ -786,6 +795,13 @@
    8.44  
    8.45  }
    8.46  
    8.47 +/**
    8.48 + * Asks MythTV backend server about if it started to record the remote file.
    8.49 + * 
    8.50 + * @param recorder The GMythRecorder instance.
    8.51 + * 
    8.52 + * @return <code>true</code>, if the actual remote file is bein recorded.
    8.53 + */
    8.54  gboolean
    8.55  gmyth_recorder_is_recording ( GMythRecorder *recorder )
    8.56  {
    8.57 @@ -824,6 +840,13 @@
    8.58  
    8.59  }
    8.60  
    8.61 +/**
    8.62 + * Finish remote file recording process.
    8.63 + * 
    8.64 + * @param recorder The GMythRecorder instance.
    8.65 + * 
    8.66 + * @return <code>true</code>, if the recording had been actually closed.
    8.67 + */
    8.68  gboolean
    8.69  gmyth_recorder_finish_recording ( GMythRecorder *recorder )
    8.70  {
     9.1 --- a/gmyth/src/gmyth_recorder.h	Tue Mar 20 15:08:35 2007 +0000
     9.2 +++ b/gmyth/src/gmyth_recorder.h	Tue Mar 20 21:23:58 2007 +0000
     9.3 @@ -3,10 +3,13 @@
     9.4   *
     9.5   * @file gmyth/gmyth_recorder.h
     9.6   * 
     9.7 - * @brief <p> GMythRecorder class defines functions for playing live tv.
     9.8 + * @brief <p> GMythRecorder defines functions for playing live tv.
     9.9 + *
    9.10 + * The remote encoder is used by gmyth_tvplayer to setup livetv. 
    9.11   *
    9.12   * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
    9.13   * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
    9.14 + * @author Rosfran Borges <rosfran.borges@indt.org.br>
    9.15   *
    9.16   *//*
    9.17   * 
    10.1 --- a/gmyth/src/gmyth_remote_util.c	Tue Mar 20 15:08:35 2007 +0000
    10.2 +++ b/gmyth/src/gmyth_remote_util.c	Tue Mar 20 21:23:58 2007 +0000
    10.3 @@ -7,6 +7,7 @@
    10.4   *
    10.5   * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
    10.6   * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
    10.7 + * @author Rosfran Borges <rosfran.borges@indt.org.br>
    10.8   *
    10.9   *//*
   10.10   * 
   10.11 @@ -35,10 +36,12 @@
   10.12  #include "gmyth_stringlist.h"
   10.13  #include "gmyth_debug.h"
   10.14  
   10.15 -/** Requests the Mythtv backend for a free remote recorder.
   10.16 +/** 
   10.17 + * Requests the Mythtv backend for a free remote recorder.
   10.18   * 
   10.19   * @param socket The socket instance where to send the command.
   10.20   * @param curr The recorder index, or -1 to consider the first one.
   10.21 + * 
   10.22   * @return the remote encoder instance available, or NULL if any error happens.
   10.23   */
   10.24  GMythRecorder*
   10.25 @@ -83,6 +86,7 @@
   10.26   * Requests the Mythtv backend for the number of free remote recorders.
   10.27   * 
   10.28   * @param socket The socket instance where to send the command.
   10.29 + * 
   10.30   * @return the number of remote encoders instance available, or 0 if no one is actually free..
   10.31   */
   10.32  gint
    11.1 --- a/gmyth/src/gmyth_uri.c	Tue Mar 20 15:08:35 2007 +0000
    11.2 +++ b/gmyth/src/gmyth_uri.c	Tue Mar 20 21:23:58 2007 +0000
    11.3 @@ -125,7 +125,8 @@
    11.4  	G_OBJECT_CLASS (gmyth_uri_parent_class)->finalize (object);
    11.5  }
    11.6  
    11.7 -/** Creates a new instance of GMythURI.
    11.8 +/** 
    11.9 + * Creates a new instance of GMythURI.
   11.10   * 
   11.11   * @return a new instance of GMythURI.
   11.12   */
   11.13 @@ -137,7 +138,10 @@
   11.14      return gmyth_uri;
   11.15  }
   11.16  
   11.17 -/** Creates a new instance of GMythURI.
   11.18 +/** 
   11.19 + * Creates a new instance of GMythURI.
   11.20 + * 
   11.21 + * @param uri_str The URI string representing this URI instance.
   11.22   * 
   11.23   * @return a new instance of GMythURI.
   11.24   */
   11.25 @@ -151,6 +155,15 @@
   11.26      return gmyth_uri;
   11.27  }
   11.28  
   11.29 +/** 
   11.30 + * Gets the starting offset of a substring inside a given string.
   11.31 + * 
   11.32 + * @param haystack The given string to be searched for patterns.
   11.33 + * @param needle The substring that should be matched over the haystack.
   11.34 + * 
   11.35 + * @return The starting offset to the given substring, or <code>-1</code> if the
   11.36 + * 				 haystack function parameter doesn't contains the needle string argument.
   11.37 + */
   11.38  static gint 
   11.39  gmyth_strstr (const gchar *haystack, const gchar *needle)
   11.40  {
   11.41 @@ -167,6 +180,13 @@
   11.42  
   11.43  }
   11.44  
   11.45 +/** 
   11.46 + * Checks if a URI is absolute.
   11.47 + * 
   11.48 + * @param uri The GMythURI instance.
   11.49 + * 
   11.50 + * @return <code>true</code>, if the URI is absolute.
   11.51 + */
   11.52  static gboolean
   11.53  gmyth_uri_isabsolute (const GMythURI *uri)
   11.54  {
   11.55 @@ -180,6 +200,19 @@
   11.56  	return ret;	
   11.57  }
   11.58  
   11.59 +/** 
   11.60 + * Searches for the first reverse character occurrence, from a given 
   11.61 + * list of characters, inside a given string.
   11.62 + * 
   11.63 + * @param str The given string to be searched for characters occurrence.
   11.64 + * @param chars The characters list. If this string returns 4 on strlen, there are
   11.65 + * 						  four possible characters to be matched.
   11.66 + * @param nchars The number of characters to be matched, which has at most 
   11.67 + * 							 strlen(chars).
   11.68 + * 
   11.69 + * @return The starting offset to the first character occurrence, 
   11.70 + *         or <code>-1</code> if the no character of the list could be found.
   11.71 + */
   11.72  static gint
   11.73  gmyth_strrchr( const gchar *str, const gchar *chars, const gint nchars )
   11.74  {
   11.75 @@ -211,6 +244,13 @@
   11.76  		return "";		
   11.77  }
   11.78  
   11.79 +/** 
   11.80 + * Parses a URI string into a GMythURI instance.
   11.81 + * 
   11.82 + * @param uri The GMythURI instance.
   11.83 + * @param value The URI string to be parsed.
   11.84 + *
   11.85 + */
   11.86  static void
   11.87  gmyth_uri_parser_setup_and_new( GMythURI *uri, const gchar *value )
   11.88  {
   11.89 @@ -364,6 +404,13 @@
   11.90  	
   11.91  }
   11.92  
   11.93 +/** 
   11.94 + * Gets the channel name fro a URI instance.
   11.95 + * 
   11.96 + * @param uri The GMythURI instance.
   11.97 + * 
   11.98 + * @return The channel name, got from the substring "?channel=[channel_name]".
   11.99 + */
  11.100  gchar*
  11.101  gmyth_uri_get_channel_name( GMythURI* uri )
  11.102  {
    12.1 --- a/gmyth/src/gmyth_util.c	Tue Mar 20 15:08:35 2007 +0000
    12.2 +++ b/gmyth/src/gmyth_util.c	Tue Mar 20 21:23:58 2007 +0000
    12.3 @@ -1,29 +1,31 @@
    12.4  /**
    12.5 -* GMyth Library
    12.6 -*
    12.7 -* @file gmyth/gmyth_util.c
    12.8 -* 
    12.9 -* @brief <p> This component provides utility functions.
   12.10 -* 
   12.11 -* Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
   12.12 -* @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
   12.13 -*
   12.14 -*//*
   12.15 -* 
   12.16 -* This program is free software; you can redistribute it and/or modify
   12.17 -* it under the terms of the GNU Lesser General Public License as published by
   12.18 -* the Free Software Foundation; either version 2 of the License, or
   12.19 -* (at your option) any later version.
   12.20 -*
   12.21 -* This program is distributed in the hope that it will be useful,
   12.22 -* but WITHOUT ANY WARRANTY; without even the implied warranty of
   12.23 -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12.24 -* GNU General Public License for more details.
   12.25 -*
   12.26 -* You should have received a copy of the GNU Lesser General Public License
   12.27 -* along with this program; if not, write to the Free Software
   12.28 -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   12.29 -*/
   12.30 + * GMyth Library
   12.31 + *
   12.32 + * @file gmyth/gmyth_util.c
   12.33 + * 
   12.34 + * @brief <p> This component provides utility functions 
   12.35 + * 	(dealing with dates, time, string formatting, etc.).
   12.36 + * 
   12.37 + * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
   12.38 + * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
   12.39 + * @author Rosfran Borges <rosfran.borges@indt.org.br>
   12.40 + *
   12.41 + *//*
   12.42 + * 
   12.43 + * This program is free software; you can redistribute it and/or modify
   12.44 + * it under the terms of the GNU Lesser General Public License as published by
   12.45 + * the Free Software Foundation; either version 2 of the License, or
   12.46 + * (at your option) any later version.
   12.47 + *
   12.48 + * This program is distributed in the hope that it will be useful,
   12.49 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   12.50 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12.51 + * GNU General Public License for more details.
   12.52 + *
   12.53 + * You should have received a copy of the GNU Lesser General Public License
   12.54 + * along with this program; if not, write to the Free Software
   12.55 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   12.56 + */
   12.57   
   12.58  #ifdef HAVE_CONFIG_H
   12.59  #include "config.h"
   12.60 @@ -394,11 +396,13 @@
   12.61  	return time;
   12.62  }
   12.63  
   12.64 -/** Decodes a long long variable from the string list
   12.65 +/** 
   12.66 + * Decodes a long long variable from the string list
   12.67   * format of the myhtprotocol.
   12.68   * 
   12.69   * @param strlist the string list of mythprotocol values
   12.70   * @param offset  the list node offset of the long long variable
   12.71 + * 
   12.72   * @return gint64  the long long converted value
   12.73   */
   12.74  gint64
   12.75 @@ -424,6 +428,14 @@
   12.76  
   12.77  }
   12.78  
   12.79 +/** 
   12.80 + * Checks if the given remote file exists.
   12.81 + * 
   12.82 + * @param backend_info The GMythBackendInfo instance.
   12.83 + * @param filename The file name of the remote file.
   12.84 + * 
   12.85 + * @return <code>true</code>, if the remote file exists.
   12.86 + */
   12.87  gboolean
   12.88  gmyth_util_file_exists (GMythBackendInfo *backend_info, const gchar* filename)
   12.89  {
   12.90 @@ -464,6 +476,15 @@
   12.91      return res;    
   12.92  }
   12.93  
   12.94 +/** 
   12.95 + * Checks if the given remote file exists, and gets its remote directory.
   12.96 + * 
   12.97 + * @param backend_info The GMythBackendInfo instance.
   12.98 + * @param filename The file name of the remote file.
   12.99 + * @param current_dir String pointer to the directory where the remote file is stored.
  12.100 + * 
  12.101 + * @return <code>true</code>, if the remote file exists.
  12.102 + */
  12.103  gboolean
  12.104  gmyth_util_file_exists_and_get_remote_dir (GMythBackendInfo *backend_info, 
  12.105  						const gchar* filename, gchar** current_dir)
  12.106 @@ -511,6 +532,15 @@
  12.107      return res;    
  12.108  }
  12.109  
  12.110 +/** 
  12.111 + * Creates a file name to a possible existing remote file,
  12.112 + * based on some fields of the LiveTV/recorded program info.
  12.113 + * 
  12.114 + * @param chan_id The channel ID number.
  12.115 + * @param start_time The start time of the recording.
  12.116 + * 
  12.117 + * @return The string representing the file name.
  12.118 + */
  12.119  gchar*
  12.120  gmyth_util_create_filename( const gint chan_id, const GTimeVal* start_time )
  12.121  { 
    13.1 --- a/gmyth/src/gmyth_util.h	Tue Mar 20 15:08:35 2007 +0000
    13.2 +++ b/gmyth/src/gmyth_util.h	Tue Mar 20 21:23:58 2007 +0000
    13.3 @@ -1,29 +1,31 @@
    13.4  /**
    13.5 -* GMyth Library
    13.6 -*
    13.7 -* @file gmyth/gmyth_util.h
    13.8 -* 
    13.9 -* @brief <p> This component provides utility functions.
   13.10 -* 
   13.11 -* Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
   13.12 -* @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
   13.13 -*
   13.14 -*//*
   13.15 -* 
   13.16 -* This program is free software; you can redistribute it and/or modify
   13.17 -* it under the terms of the GNU Lesser General Public License as published by
   13.18 -* the Free Software Foundation; either version 2 of the License, or
   13.19 -* (at your option) any later version.
   13.20 -*
   13.21 -* This program is distributed in the hope that it will be useful,
   13.22 -* but WITHOUT ANY WARRANTY; without even the implied warranty of
   13.23 -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13.24 -* GNU General Public License for more details.
   13.25 -*
   13.26 -* You should have received a copy of the GNU Lesser General Public License
   13.27 -* along with this program; if not, write to the Free Software
   13.28 -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   13.29 -*/
   13.30 + * GMyth Library
   13.31 + *
   13.32 + * @file gmyth/gmyth_util.h
   13.33 + * 
   13.34 + * @brief <p> This component provides utility functions 
   13.35 + * 	(dealing with dates, time, string formatting, etc.).
   13.36 + * 
   13.37 + * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
   13.38 + * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
   13.39 + * @author Rosfran Borges <rosfran.borges@indt.org.br>
   13.40 + *
   13.41 + *//*
   13.42 + * 
   13.43 + * This program is free software; you can redistribute it and/or modify
   13.44 + * it under the terms of the GNU Lesser General Public License as published by
   13.45 + * the Free Software Foundation; either version 2 of the License, or
   13.46 + * (at your option) any later version.
   13.47 + *
   13.48 + * This program is distributed in the hope that it will be useful,
   13.49 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   13.50 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13.51 + * GNU General Public License for more details.
   13.52 + *
   13.53 + * You should have received a copy of the GNU Lesser General Public License
   13.54 + * along with this program; if not, write to the Free Software
   13.55 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   13.56 + */
   13.57  
   13.58  #ifndef GMYTH_UTIL_H_
   13.59  #define GMYTH_UTIL_H_