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
     1 /**
     2  * GMyth Library
     3  *
     4  * @file gmyth/gmyth_util.h
     5  * 
     6  * @brief <p> This component provides utility functions 
     7  * 	(dealing with dates, time, string formatting, etc.).
     8  * 
     9  * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
    10  * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
    11  * @author Rosfran Borges <rosfran.borges@indt.org.br>
    12  *
    13  * 
    14  * This program is free software; you can redistribute it and/or modify
    15  * it under the terms of the GNU Lesser General Public License as published by
    16  * the Free Software Foundation; either version 2 of the License, or
    17  * (at your option) any later version.
    18  *
    19  * This program is distributed in the hope that it will be useful,
    20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    22  * GNU General Public License for more details.
    23  *
    24  * You should have received a copy of the GNU Lesser General Public License
    25  * along with this program; if not, write to the Free Software
    26  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    27  */
    28 
    29 #ifndef GMYTH_UTIL_H_
    30 #define GMYTH_UTIL_H_
    31 
    32 #include <time.h>
    33 #include <glib.h>
    34 
    35 #include "gmyth_stringlist.h"
    36 #include "gmyth_backendinfo.h"
    37 #include "gmyth_programinfo.h"
    38 
    39 G_BEGIN_DECLS 
    40 
    41 typedef struct {
    42     guint64 total_space;
    43     guint64 used_space;
    44 } GMythBackendDetails;
    45 
    46 
    47 GString*        gmyth_util_time_to_isoformat                (time_t time_value);
    48 GString*        gmyth_util_time_to_string                   (time_t time_value);
    49 time_t          gmyth_util_string_to_time                   (GString *time_str);
    50 gchar*          gmyth_util_time_to_isoformat_from_time_val_fmt
    51                                                             (const gchar *fmt_string,
    52                                                              const GTimeVal *time_val);
    53 GTimeVal*       gmyth_util_string_to_time_val_fmt           (const gchar *fmt_string,
    54                                                              const gchar *time_str);
    55 GTimeVal*       gmyth_util_string_to_time_val               (const gchar *time_str);
    56 gchar*          gmyth_util_time_to_isoformat_from_time_val  (const GTimeVal *time);
    57 gchar*          gmyth_util_time_to_mythformat_from_time_val (const GTimeVal *time);
    58 gchar*          gmyth_util_time_to_string_only_date         (const GTimeVal *time);
    59 gchar*          gmyth_util_time_to_string_only_time         (const GTimeVal *time);
    60 gchar*          gmyth_util_time_to_string_from_time_val     (const GTimeVal *time_val);
    61 struct tm*      gmyth_util_time_val_to_date                 (const GTimeVal * time);
    62 
    63 gboolean        gmyth_util_get_backend_details (GMythSocket *sock, GMythBackendDetails **details);
    64 void            gmyth_util_backend_details_free (GMythBackendDetails *details);
    65 
    66 gboolean        gmyth_util_file_exists                      (GMythBackendInfo *backend_info,
    67                                                              const gchar * filename);
    68 gboolean        gmyth_util_file_exists_from_socket          (GMythSocket *sock, 
    69                                                              const gchar *filename);
    70 GString*        gmyth_util_check_file_from_socket           (GMythSocket *sock,
    71                                                              GMythProgramInfo *program);
    72 gboolean        gmyth_util_file_exists_and_get_remote_dir   (GMythBackendInfo *backend_info,
    73                                                              const gchar *filename,
    74                                                              gchar **current_dir);
    75 gchar*          gmyth_util_create_filename                  (const gint chan_id,
    76                                                              const GTimeVal * start_time);
    77 GList*          gmyth_util_get_channel_list                 (GMythBackendInfo *backend_info);
    78 GSList*         gmyth_util_get_all_recordings               (GMythBackendInfo *backend_info);
    79 GMythProgramInfo*
    80                 gmyth_util_get_recording_from_channel       (GMythBackendInfo *backend_info,
    81                                                              const gchar *channel);
    82 GSList*         gmyth_util_get_all_pending                  (GMythBackendInfo * backend_info,
    83                                                              gboolean * conflicts);
    84 
    85 G_END_DECLS
    86 #endif                          /* GMYTH_UTIL_H_ */