]> git.sesse.net Git - vlc/blob - include/charset.h
* modules/demux/mpeg/m4v.c: wait until we get p_extra from the packetizer before...
[vlc] / include / charset.h
1 /*****************************************************************************
2  * charset.h: Determine a canonical name for the current locale's character encoding.
3  *****************************************************************************
4  * Copyright (C) 2003-2005 the VideoLAN team
5  * $Id$
6  *
7  * Author: Derk-Jan Hartman <thedj at users.sourceforge.net>
8  *
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.
13  *
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.
18  *
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  *****************************************************************************/
23
24 #ifndef __VLC_CHARSET_H
25 #define __VLC_CHARSET_H 1
26
27 # ifdef __cplusplus
28 extern "C" {
29 # endif
30
31 VLC_EXPORT( vlc_bool_t, vlc_current_charset, ( char ** ) );
32 VLC_EXPORT( void, LocaleFree, ( const char * ) );
33 VLC_EXPORT( char *, FromLocale, ( const char * ) );
34 VLC_EXPORT( char *, FromLocaleDup, ( const char * ) );
35 VLC_EXPORT( char *, ToLocale, ( const char * ) );
36
37 VLC_EXPORT( FILE *, utf8_fopen, ( const char *filename, const char *mode ) );
38 VLC_EXPORT( void *, utf8_opendir, ( const char *dirname ) );
39 VLC_EXPORT( const char *, utf8_readdir, ( void *dir ) );
40 VLC_EXPORT( int, utf8_scandir, ( const char *dirname, char ***namelist, int (*select)( const char * ), int (*compar)( const char **, const char ** ) ) );
41 VLC_EXPORT( int, utf8_stat, ( const char *filename, void *buf ) );
42 VLC_EXPORT( int, utf8_lstat, ( const char *filename, void *buf ) );
43 VLC_EXPORT( int, utf8_mkdir, ( const char *filename ) );
44
45 #ifndef __PLUGIN__
46 int utf8_fprintf( FILE *, const char *, ... );
47 #endif
48
49 VLC_EXPORT( char *, EnsureUTF8, ( char * ) );
50 VLC_EXPORT( const char *, IsUTF8, ( const char * ) );
51
52 VLC_EXPORT( char *, FromUTF32, ( const uint32_t * ) );
53 VLC_EXPORT( char *, FromUTF16, ( const uint16_t * ) );
54
55 static inline char *FromWide( const wchar_t *in )
56 {
57         return (sizeof( wchar_t ) == 2)
58                 ? FromUTF16( (const uint16_t *)in )
59                 : FromUTF32( (const uint32_t *)in );
60 }
61
62
63 VLC_EXPORT( char *, __vlc_fix_readdir_charset, ( vlc_object_t *, const char * ) );
64 #define vlc_fix_readdir_charset(a,b) __vlc_fix_readdir_charset(VLC_OBJECT(a),b)
65
66 VLC_EXPORT( const char *, GetFallbackEncoding, ( void ) );
67
68 extern double i18n_strtod( const char *, char ** );
69 extern double i18n_atof( const char * );
70 VLC_EXPORT( double, us_strtod, ( const char *, char ** ) );
71 VLC_EXPORT( double, us_atof, ( const char * ) );
72
73 # ifdef __cplusplus
74 }
75 # endif
76
77 #endif