gmyth/gmyth/gmyth_util.h
author ali@juiblex.co.uk
Wed Dec 16 10:06:21 2009 +0000 (2009-12-16)
branchtrunk
changeset 951 7b0d87ef5e63
parent 950 6308269b026e
permissions -rw-r--r--
Add rules and upcoming lists to gmyth_ls
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
melunko@798
    41
typedef struct {
melunko@798
    42
    guint64 total_space;
melunko@798
    43
    guint64 used_space;
melunko@798
    44
} GMythBackendDetails;
melunko@798
    45
rosfran@223
    46
renatofilho@769
    47
GString*        gmyth_util_time_to_isoformat                (time_t time_value);
renatofilho@769
    48
GString*        gmyth_util_time_to_string                   (time_t time_value);
renatofilho@769
    49
time_t          gmyth_util_string_to_time                   (GString *time_str);
renatofilho@769
    50
gchar*          gmyth_util_time_to_isoformat_from_time_val_fmt
renatofilho@769
    51
                                                            (const gchar *fmt_string,
renatofilho@769
    52
                                                             const GTimeVal *time_val);
renatofilho@769
    53
GTimeVal*       gmyth_util_string_to_time_val_fmt           (const gchar *fmt_string,
renatofilho@769
    54
                                                             const gchar *time_str);
renatofilho@769
    55
GTimeVal*       gmyth_util_string_to_time_val               (const gchar *time_str);
renatofilho@769
    56
gchar*          gmyth_util_time_to_isoformat_from_time_val  (const GTimeVal *time);
renatofilho@769
    57
gchar*          gmyth_util_time_to_mythformat_from_time_val (const GTimeVal *time);
renatofilho@769
    58
gchar*          gmyth_util_time_to_string_only_date         (const GTimeVal *time);
renatofilho@769
    59
gchar*          gmyth_util_time_to_string_only_time         (const GTimeVal *time);
renatofilho@769
    60
gchar*          gmyth_util_time_to_string_from_time_val     (const GTimeVal *time_val);
renatofilho@769
    61
struct tm*      gmyth_util_time_val_to_date                 (const GTimeVal * time);
melunko@798
    62
melunko@798
    63
gboolean        gmyth_util_get_backend_details (GMythSocket *sock, GMythBackendDetails **details);
melunko@798
    64
void            gmyth_util_backend_details_free (GMythBackendDetails *details);
melunko@798
    65
melunko@798
    66
gboolean        gmyth_util_file_exists                      (GMythBackendInfo *backend_info,
melunko@798
    67
                                                             const gchar * filename);
renatofilho@769
    68
gboolean        gmyth_util_file_exists_from_socket          (GMythSocket *sock, 
renatofilho@769
    69
                                                             const gchar *filename);
ali@950
    70
GString*        gmyth_util_check_file_from_socket           (GMythSocket *sock,
ali@950
    71
                                                             GMythProgramInfo *program);
renatofilho@769
    72
gboolean        gmyth_util_file_exists_and_get_remote_dir   (GMythBackendInfo *backend_info,
renatofilho@769
    73
                                                             const gchar *filename,
renatofilho@769
    74
                                                             gchar **current_dir);
renatofilho@769
    75
gchar*          gmyth_util_create_filename                  (const gint chan_id,
renatofilho@769
    76
                                                             const GTimeVal * start_time);
renatofilho@769
    77
GList*          gmyth_util_get_channel_list                 (GMythBackendInfo *backend_info);
renatofilho@769
    78
GSList*         gmyth_util_get_all_recordings               (GMythBackendInfo *backend_info);
renatofilho@769
    79
GMythProgramInfo*
renatofilho@769
    80
                gmyth_util_get_recording_from_channel       (GMythBackendInfo *backend_info,
renatofilho@769
    81
                                                             const gchar *channel);
ali@951
    82
GSList*         gmyth_util_get_all_pending                  (GMythBackendInfo * backend_info,
ali@951
    83
                                                             gboolean * conflicts);
rosfran@568
    84
leo_sobral@6
    85
G_END_DECLS
renatofilho@754
    86
#endif                          /* GMYTH_UTIL_H_ */