gmyth/src/gmyth_util.h
author renatofilho
Tue Jul 03 21:20:15 2007 +0100 (2007-07-03)
branchtrunk
changeset 769 1603bc7804da
parent 754 cb885ee44618
child 798 19626dc62c16
permissions -rw-r--r--
[svn r775] create function in backend info for otimize socket usage
leo_sobral@1
     1
/**
rosfran@420
     2
 * GMyth Library
rosfran@420
     3
 *
rosfran@420
     4
 * @file gmyth/gmyth_util.h
rosfran@420
     5
 * 
rosfran@420
     6
 * @brief <p> This component provides utility functions 
rosfran@420
     7
 * 	(dealing with dates, time, string formatting, etc.).
rosfran@420
     8
 * 
rosfran@420
     9
 * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
rosfran@420
    10
 * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
rosfran@420
    11
 * @author Rosfran Borges <rosfran.borges@indt.org.br>
rosfran@420
    12
 *
rosfran@701
    13
 * 
rosfran@701
    14
 * This program is free software; you can redistribute it and/or modify
rosfran@701
    15
 * it under the terms of the GNU Lesser General Public License as published by
rosfran@701
    16
 * the Free Software Foundation; either version 2 of the License, or
rosfran@701
    17
 * (at your option) any later version.
rosfran@701
    18
 *
rosfran@701
    19
 * This program is distributed in the hope that it will be useful,
rosfran@701
    20
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
rosfran@701
    21
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
rosfran@701
    22
 * GNU General Public License for more details.
rosfran@701
    23
 *
rosfran@701
    24
 * You should have received a copy of the GNU Lesser General Public License
rosfran@701
    25
 * along with this program; if not, write to the Free Software
rosfran@701
    26
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
rosfran@701
    27
 */
leo_sobral@1
    28
leo_sobral@1
    29
#ifndef GMYTH_UTIL_H_
leo_sobral@1
    30
#define GMYTH_UTIL_H_
leo_sobral@1
    31
leo_sobral@1
    32
#include <time.h>
leo_sobral@1
    33
#include <glib.h>
leo_sobral@1
    34
leo_sobral@1
    35
#include "gmyth_stringlist.h"
melunko@125
    36
#include "gmyth_backendinfo.h"
rosfran@568
    37
#include "gmyth_programinfo.h"
leo_sobral@1
    38
renatofilho@769
    39
G_BEGIN_DECLS 
leo_sobral@6
    40
rosfran@223
    41
renatofilho@769
    42
GString*        gmyth_util_time_to_isoformat                (time_t time_value);
renatofilho@769
    43
GString*        gmyth_util_time_to_string                   (time_t time_value);
renatofilho@769
    44
time_t          gmyth_util_string_to_time                   (GString *time_str);
renatofilho@769
    45
gchar*          gmyth_util_time_to_isoformat_from_time_val_fmt
renatofilho@769
    46
                                                            (const gchar *fmt_string,
renatofilho@769
    47
                                                             const GTimeVal *time_val);
renatofilho@769
    48
GTimeVal*       gmyth_util_string_to_time_val_fmt           (const gchar *fmt_string,
renatofilho@769
    49
                                                             const gchar *time_str);
renatofilho@769
    50
GTimeVal*       gmyth_util_string_to_time_val               (const gchar *time_str);
renatofilho@769
    51
gchar*          gmyth_util_time_to_isoformat_from_time_val  (const GTimeVal *time);
renatofilho@769
    52
gchar*          gmyth_util_time_to_mythformat_from_time_val (const GTimeVal *time);
renatofilho@769
    53
gchar*          gmyth_util_time_to_string_only_date         (const GTimeVal *time);
renatofilho@769
    54
gchar*          gmyth_util_time_to_string_only_time         (const GTimeVal *time);
renatofilho@769
    55
gchar*          gmyth_util_time_to_string_from_time_val     (const GTimeVal *time_val);
renatofilho@769
    56
struct tm*      gmyth_util_time_val_to_date                 (const GTimeVal * time);
renatofilho@769
    57
gboolean        gmyth_util_file_exists_from_socket          (GMythSocket *sock, 
renatofilho@769
    58
                                                             const gchar *filename);
renatofilho@769
    59
gboolean        gmyth_util_file_exists                      (GMythBackendInfo *backend_info,
renatofilho@769
    60
                                                             const gchar * filename);
renatofilho@769
    61
gboolean        gmyth_util_file_exists_and_get_remote_dir   (GMythBackendInfo *backend_info,
renatofilho@769
    62
                                                             const gchar *filename,
renatofilho@769
    63
                                                             gchar **current_dir);
renatofilho@769
    64
gchar*          gmyth_util_create_filename                  (const gint chan_id,
renatofilho@769
    65
                                                             const GTimeVal * start_time);
renatofilho@769
    66
GList*          gmyth_util_get_channel_list                 (GMythBackendInfo *backend_info);
renatofilho@769
    67
GSList*         gmyth_util_get_all_recordings               (GMythBackendInfo *backend_info);
renatofilho@769
    68
GMythProgramInfo*
renatofilho@769
    69
                gmyth_util_get_recording_from_channel       (GMythBackendInfo *backend_info,
renatofilho@769
    70
                                                             const gchar *channel);
rosfran@568
    71
leo_sobral@6
    72
G_END_DECLS
renatofilho@754
    73
#endif                          /* GMYTH_UTIL_H_ */