aboutsummaryrefslogtreecommitdiffstats
path: root/src/tvtimeconf.c
diff options
context:
space:
mode:
authorvektor <devnull@localhost>2004-08-14 20:37:20 +0000
committervektor <devnull@localhost>2004-08-14 20:37:20 +0000
commit75feecb1b09fb839fce172b7ddf1b8402c8d396c (patch)
treeee5cdf882a4ac6c09962b2422786c0995de99814 /src/tvtimeconf.c
parentecd4d68477bd257c5c87594d63f7fb40259d5adb (diff)
14 Aug 2004 Billy Biggs <vektor@dumbterm.net>
* tvtime/src/xmltv.c: Added code to look up localized descriptions from the XMLTV file using a language set in the config file. Patch by Ingo van Lil. * tvtime/src/xmltv.h: New API: ask for the locale on initialization. * tvtime/src/commands.c: Use the new API. * tvtime/src/tvtimeconf.c: New config file parameter, XMLTVLanguage. * tvtime/src/tvtimeconf.h: New API for the language. * tvtime/docs/tvtime.xml.5: Document the new config file parameter. * tvtime/docs/html/default.tvtime.xml: Add a description for the new parameter to the default config file. * tvtime/AUTHORS: Add Ingo van Lil to the AUTHORS file. * tvtime/ChangeLog: Note this change in the ChangeLog.
Diffstat (limited to 'src/tvtimeconf.c')
-rw-r--r--src/tvtimeconf.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tvtimeconf.c b/src/tvtimeconf.c
index ab6e5b4..2031b39 100644
--- a/src/tvtimeconf.c
+++ b/src/tvtimeconf.c
@@ -97,6 +97,7 @@ struct config_s
char *timeformat;
char *audiomode;
char *xmltvfile;
+ char *xmltvlanguage;
unsigned int channel_text_rgb;
unsigned int other_text_rgb;
@@ -151,6 +152,7 @@ static void copy_config( config_t *dest, config_t *src )
dest->doc = 0;
dest->audiomode = 0;
dest->xmltvfile = 0;
+ dest->xmltvlanguage = 0;
dest->dkmode = 0;
/* Useful strings must be copied. */
@@ -302,6 +304,11 @@ static void parse_option( config_t *ct, xmlNodePtr node )
ct->xmltvfile = expand_user_path( curval );
}
+ if( !xmlStrcasecmp( name, BAD_CAST "XMLTVLanguage" ) ) {
+ if( ct->xmltvlanguage ) free( ct->xmltvlanguage );
+ ct->xmltvlanguage = strdup( curval );
+ }
+
if( !xmlStrcasecmp( name, BAD_CAST "FullscreenPosition" ) ) {
if( tolower( curval[ 0 ] ) == 't' ) {
ct->fspos = 1;
@@ -815,6 +822,7 @@ config_t *config_new( void )
}
ct->audiomode = strdup( "stereo" );
ct->xmltvfile = strdup( "none" );
+ ct->xmltvlanguage = strdup( "none" );
ct->timeformat = strdup( "%X" );
ct->channel_text_rgb = 0xffffff00; /* opaque yellow */
ct->other_text_rgb = 0xfff5deb3; /* opaque wheat */
@@ -1088,6 +1096,7 @@ int config_parse_tvtime_command_line( config_t *ct, int argc, char **argv )
config_save( ct, "MixerDevice", ct->mixerdev );
config_save( ct, "XMLTVFile", ct->xmltvfile );
+ config_save( ct, "XMLTVLanguage", ct->xmltvlanguage );
}
return 1;
@@ -1263,6 +1272,7 @@ int config_parse_tvtime_config_command_line( config_t *ct, int argc, char **argv
config_save( ct, "MixerDevice", ct->mixerdev );
config_save( ct, "XMLTVFile", ct->xmltvfile );
+ config_save( ct, "XMLTVLanguage", ct->xmltvlanguage );
snprintf( tempstring, sizeof( tempstring ), "%d", ct->priority );
config_save( ct, "ProcessPriority", tempstring );
@@ -1321,6 +1331,7 @@ void config_free_data( config_t *ct )
if( ct->ssdir ) free( ct->ssdir );
if( ct->audiomode ) free( ct->audiomode );
if( ct->xmltvfile ) free( ct->xmltvfile );
+ if( ct->xmltvlanguage ) free( ct->xmltvlanguage );
if( ct->timeformat ) free( ct->timeformat );
if( ct->rvr_filename ) free( ct->rvr_filename );
if( ct->mpeg_filename ) free( ct->mpeg_filename );
@@ -1733,6 +1744,11 @@ const char *config_get_xmltv_file( config_t *ct )
return ct->xmltvfile;
}
+const char *config_get_xmltv_language( config_t *ct )
+{
+ return ct->xmltvlanguage;
+}
+
int config_get_invert( config_t *ct )
{
return ct->invert;

Privacy Policy