1 /*****************************************************************************
2 * vlc_strings.h: String functions
3 *****************************************************************************
4 * Copyright (C) 2006 the VideoLAN team
7 * Authors: Antoine Cellerier <dionoea at videolan dot org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef _VLC_STRINGS_H
25 #define _VLC_STRINGS_H 1
30 * \defgroup strings Strings
34 VLC_EXPORT( void, resolve_xml_special_chars, ( char *psz_value ) );
35 VLC_EXPORT( char *, convert_xml_special_chars, ( const char *psz_content ) );
37 struct localized_string_t
46 localized_string_t **pp_langs;
49 static inline void i18n_AddLang( i18n_string_t *p_src,
50 char *psz_lang, char *psz_text )
52 DECMALLOC_VOID( pl10n, localized_string_t );
53 pl10n->psz_lang = strdup( psz_lang );
54 pl10n->psz_text = strdup( psz_text );
55 INSERT_ELEM( p_src->pp_langs, p_src->i_langs, p_src->i_langs, pl10n );
58 static inline char *i18n_Get( i18n_string_t *p_src, char *psz_lang )
61 for( i = 0 ; i < p_src->i_langs; i++ )
63 if( !strcmp( p_src->pp_langs[i]->psz_lang, psz_lang ) )
64 return p_src->pp_langs[i]->psz_text;