1.1 --- a/gmyth/src/gmyth_util.c Mon Mar 19 17:11:23 2007 +0000
1.2 +++ b/gmyth/src/gmyth_util.c Tue Mar 20 21:23:58 2007 +0000
1.3 @@ -1,29 +1,31 @@
1.4 /**
1.5 -* GMyth Library
1.6 -*
1.7 -* @file gmyth/gmyth_util.c
1.8 -*
1.9 -* @brief <p> This component provides utility functions.
1.10 -*
1.11 -* Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
1.12 -* @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
1.13 -*
1.14 -*//*
1.15 -*
1.16 -* This program is free software; you can redistribute it and/or modify
1.17 -* it under the terms of the GNU Lesser General Public License as published by
1.18 -* the Free Software Foundation; either version 2 of the License, or
1.19 -* (at your option) any later version.
1.20 -*
1.21 -* This program is distributed in the hope that it will be useful,
1.22 -* but WITHOUT ANY WARRANTY; without even the implied warranty of
1.23 -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.24 -* GNU General Public License for more details.
1.25 -*
1.26 -* You should have received a copy of the GNU Lesser General Public License
1.27 -* along with this program; if not, write to the Free Software
1.28 -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1.29 -*/
1.30 + * GMyth Library
1.31 + *
1.32 + * @file gmyth/gmyth_util.c
1.33 + *
1.34 + * @brief <p> This component provides utility functions
1.35 + * (dealing with dates, time, string formatting, etc.).
1.36 + *
1.37 + * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
1.38 + * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
1.39 + * @author Rosfran Borges <rosfran.borges@indt.org.br>
1.40 + *
1.41 + *//*
1.42 + *
1.43 + * This program is free software; you can redistribute it and/or modify
1.44 + * it under the terms of the GNU Lesser General Public License as published by
1.45 + * the Free Software Foundation; either version 2 of the License, or
1.46 + * (at your option) any later version.
1.47 + *
1.48 + * This program is distributed in the hope that it will be useful,
1.49 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.50 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.51 + * GNU General Public License for more details.
1.52 + *
1.53 + * You should have received a copy of the GNU Lesser General Public License
1.54 + * along with this program; if not, write to the Free Software
1.55 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1.56 + */
1.57
1.58 #ifdef HAVE_CONFIG_H
1.59 #include "config.h"
1.60 @@ -394,11 +396,13 @@
1.61 return time;
1.62 }
1.63
1.64 -/** Decodes a long long variable from the string list
1.65 +/**
1.66 + * Decodes a long long variable from the string list
1.67 * format of the myhtprotocol.
1.68 *
1.69 * @param strlist the string list of mythprotocol values
1.70 * @param offset the list node offset of the long long variable
1.71 + *
1.72 * @return gint64 the long long converted value
1.73 */
1.74 gint64
1.75 @@ -424,6 +428,14 @@
1.76
1.77 }
1.78
1.79 +/**
1.80 + * Checks if the given remote file exists.
1.81 + *
1.82 + * @param backend_info The GMythBackendInfo instance.
1.83 + * @param filename The file name of the remote file.
1.84 + *
1.85 + * @return <code>true</code>, if the remote file exists.
1.86 + */
1.87 gboolean
1.88 gmyth_util_file_exists (GMythBackendInfo *backend_info, const gchar* filename)
1.89 {
1.90 @@ -464,6 +476,15 @@
1.91 return res;
1.92 }
1.93
1.94 +/**
1.95 + * Checks if the given remote file exists, and gets its remote directory.
1.96 + *
1.97 + * @param backend_info The GMythBackendInfo instance.
1.98 + * @param filename The file name of the remote file.
1.99 + * @param current_dir String pointer to the directory where the remote file is stored.
1.100 + *
1.101 + * @return <code>true</code>, if the remote file exists.
1.102 + */
1.103 gboolean
1.104 gmyth_util_file_exists_and_get_remote_dir (GMythBackendInfo *backend_info,
1.105 const gchar* filename, gchar** current_dir)
1.106 @@ -511,6 +532,15 @@
1.107 return res;
1.108 }
1.109
1.110 +/**
1.111 + * Creates a file name to a possible existing remote file,
1.112 + * based on some fields of the LiveTV/recorded program info.
1.113 + *
1.114 + * @param chan_id The channel ID number.
1.115 + * @param start_time The start time of the recording.
1.116 + *
1.117 + * @return The string representing the file name.
1.118 + */
1.119 gchar*
1.120 gmyth_util_create_filename( const gint chan_id, const GTimeVal* start_time )
1.121 {