[svn r50] added debug printing funcs to gmyth trunk
authorleo_sobral
Tue Oct 24 20:05:07 2006 +0100 (2006-10-24)
branchtrunk
changeset 496deb6330eaca
parent 48 a30f59f76bda
child 50 c04c69f80f33
[svn r50] added debug printing funcs to gmyth
gmyth/src/gmyth_common.c
gmyth/src/gmyth_common.h
gmyth/src/gmyth_epg.c
gmyth/src/gmyth_query.c
gmyth/src/gmyth_scheduler.c
gmyth/src/gmyth_util.c
     1.1 --- a/gmyth/src/gmyth_common.c	Tue Oct 24 15:34:48 2006 +0100
     1.2 +++ b/gmyth/src/gmyth_common.c	Tue Oct 24 20:05:07 2006 +0100
     1.3 @@ -68,6 +68,24 @@
     1.4  	g_list_free (list);
     1.5  }
     1.6  
     1.7 +void 
     1.8 +gmyth_channel_info_print(GMythChannelInfo *channel_info)
     1.9 +{
    1.10 +    g_print("ChannelInfo (Name, ID) = (%s, %d)\n", 
    1.11 +             channel_info->channel_name->str, channel_info->channel_ID);
    1.12 +}
    1.13 +
    1.14 +void 
    1.15 +gmyth_program_info_print(GMythProgramInfo *program_info)
    1.16 +{
    1.17 +    g_print("ProgramInfo\n\tTitle = %s\n\t"
    1.18 +             "Description = %s\n\t"
    1.19 +             "Start time= %s\t"
    1.20 +             "End time = %s\n", program_info->title->str,
    1.21 +             program_info->description->str, 
    1.22 +             ctime(&program_info->startts),
    1.23 +             ctime(&program_info->endts));
    1.24 +}
    1.25  
    1.26  static void 
    1.27  free_channel_data(gpointer data, gpointer user_data)
     2.1 --- a/gmyth/src/gmyth_common.h	Tue Oct 24 15:34:48 2006 +0100
     2.2 +++ b/gmyth/src/gmyth_common.h	Tue Oct 24 20:05:07 2006 +0100
     2.3 @@ -154,6 +154,9 @@
     2.4  void gmyth_free_channel_list(GList *list);
     2.5  void gmyth_free_program_list(GList *list);
     2.6  
     2.7 +void gmyth_channel_info_print(GMythChannelInfo *channel_info);
     2.8 +void gmyth_program_info_print(GMythProgramInfo *program_info);
     2.9 +
    2.10  G_END_DECLS
    2.11  
    2.12  #endif /* GMYTH_COMMON_H_ */
     3.1 --- a/gmyth/src/gmyth_epg.c	Tue Oct 24 15:34:48 2006 +0100
     3.2 +++ b/gmyth/src/gmyth_epg.c	Tue Oct 24 20:05:07 2006 +0100
     3.3 @@ -160,7 +160,11 @@
     3.4          	channel_info = g_new0(GMythChannelInfo, 1);
     3.5              channel_info->channel_ID = atoi (row[0]);
     3.6              channel_info->channel_name = g_string_new (row[1]);
     3.7 -        
     3.8 +       
     3.9 +#if 0
    3.10 +            gmyth_channel_info_print(channel_info);
    3.11 +#endif
    3.12 +            
    3.13              (*glist_ptr) = g_list_append ((*glist_ptr), channel_info);
    3.14      	}
    3.15      }
    3.16 @@ -269,6 +273,10 @@
    3.17          p->catType = g_string_new (row[18]);
    3.18  
    3.19          *proglist = g_list_append((*proglist), p);
    3.20 +
    3.21 +#if 0        
    3.22 +        gmyth_program_info_print(p);
    3.23 +#endif        
    3.24      }
    3.25  
    3.26      /* deallocate */
     4.1 --- a/gmyth/src/gmyth_query.c	Tue Oct 24 15:34:48 2006 +0100
     4.2 +++ b/gmyth/src/gmyth_query.c	Tue Oct 24 20:05:07 2006 +0100
     4.3 @@ -211,10 +211,10 @@
     4.4      if (res_set) {
     4.5          return res_set;
     4.6      } else if (mysql_field_count (gmyth_query->conn) == 0) {
     4.7 -             g_debug ("%lu rows affected\n",
     4.8 -                     (unsigned long) mysql_affected_rows (gmyth_query->conn));
     4.9 +        g_debug ("%lu rows affected\n",
    4.10 +                (unsigned long) mysql_affected_rows (gmyth_query->conn));
    4.11      } else {
    4.12 -            gmyth_query_print_error (gmyth_query->conn, "Could not retrieve result set");
    4.13 +        gmyth_query_print_error (gmyth_query->conn, "Could not retrieve result set");
    4.14      }
    4.15      
    4.16      return NULL;
     5.1 --- a/gmyth/src/gmyth_scheduler.c	Tue Oct 24 15:34:48 2006 +0100
     5.2 +++ b/gmyth/src/gmyth_scheduler.c	Tue Oct 24 20:05:07 2006 +0100
     5.3 @@ -34,14 +34,14 @@
     5.4  #include "gmyth_util.h"
     5.5  #include "gmyth_query.h"
     5.6  
     5.7 -static void gmyth_scheduler_class_init          (GMythSchedulerClass *klass);
     5.8 -static void gmyth_scheduler_init                (GMythScheduler *object);
     5.9 +static void gmyth_scheduler_class_init  (GMythSchedulerClass *klass);
    5.10 +static void gmyth_scheduler_init        (GMythScheduler *object);
    5.11  
    5.12  static void gmyth_scheduler_dispose  (GObject *object);
    5.13  static void gmyth_scheduler_finalize (GObject *object);
    5.14  
    5.15  static gint get_record_id_from_database (GMythScheduler *scheduler);
    5.16 -static void update_backend (gint record_id);
    5.17 +static void update_backend  (gint record_id);
    5.18  
    5.19  G_DEFINE_TYPE(GMythScheduler, gmyth_scheduler, G_TYPE_OBJECT)
    5.20      
     6.1 --- a/gmyth/src/gmyth_util.c	Tue Oct 24 15:34:48 2006 +0100
     6.2 +++ b/gmyth/src/gmyth_util.c	Tue Oct 24 20:05:07 2006 +0100
     6.3 @@ -86,8 +86,10 @@
     6.4  gmyth_util_string_to_time (GString* time_str)
     6.5  {
     6.6  	int year, month, day, hour, min, sec;
     6.7 -
     6.8 +    
     6.9 +#if 0
    6.10  	g_debug( "[%s] time_str = %s.\n", __FUNCTION__, time_str != NULL ? time_str->str : "[time string is NULL!]" );
    6.11 +#endif
    6.12  
    6.13  	if (sscanf (time_str->str, "%04d-%02d-%02d %02d:%02d:%02d",
    6.14  			&year, &month, &day, &hour, &min, &sec) < 3) { /* At least date */