]> git.sesse.net Git - vlc/blob - include/charset.h
Add a method to set playlist in loop mode.
[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 #include <stdarg.h>
28
29 # ifdef __cplusplus
30 extern "C" {
31 # endif
32
33 VLC_EXPORT( vlc_bool_t, vlc_current_charset, ( char ** ) );
34 VLC_EXPORT( void, LocaleFree, ( const char * ) );
35 VLC_EXPORT( char *, FromLocale, ( const char * ) );
36 VLC_EXPORT( char *, FromLocaleDup, ( const char * ) );
37 VLC_EXPORT( char *, ToLocale, ( const char * ) );
38
39 VLC_EXPORT( FILE *, utf8_fopen, ( const char *filename, const char *mode ) );
40 VLC_EXPORT( void *, utf8_opendir, ( const char *dirname ) );
41 VLC_EXPORT( const char *, utf8_readdir, ( void *dir ) );
42 VLC_EXPORT( int, utf8_scandir, ( const char *dirname, char ***namelist, int (*select)( const char * ), int (*compar)( const char **, const char ** ) ) );
43 VLC_EXPORT( int, utf8_stat, ( const char *filename, void *buf ) );
44 VLC_EXPORT( int, utf8_lstat, ( const char *filename, void *buf ) );
45 VLC_EXPORT( int, utf8_mkdir, ( const char *filename ) );
46
47 VLC_EXPORT( int, utf8_vfprintf, ( FILE *stream, const char *fmt, va_list ap ) );
48 VLC_EXPORT( int, utf8_fprintf, ( FILE *, const char *, ... ) );
49
50 VLC_EXPORT( char *, EnsureUTF8, ( char * ) );
51 VLC_EXPORT( const char *, IsUTF8, ( const char * ) );
52
53 VLC_EXPORT( char *, FromUTF32, ( const uint32_t * ) );
54 VLC_EXPORT( char *, FromUTF16, ( const uint16_t * ) );
55
56 static inline char *FromWide( const wchar_t *in )
57 {
58     return (sizeof( wchar_t ) == 2)
59         ? FromUTF16( (const uint16_t *)in )
60         : FromUTF32( (const uint32_t *)in );
61 }
62
63
64 VLC_EXPORT( char *, __vlc_fix_readdir_charset, ( vlc_object_t *, const char * ) );
65 #define vlc_fix_readdir_charset(a,b) __vlc_fix_readdir_charset(VLC_OBJECT(a),b)
66
67 VLC_EXPORT( const char *, GetFallbackEncoding, ( void ) );
68
69 extern double i18n_strtod( const char *, char ** );
70 extern double i18n_atof( const char * );
71 VLC_EXPORT( double, us_strtod, ( const char *, char ** ) );
72 VLC_EXPORT( double, us_atof, ( const char * ) );
73
74 # ifdef __cplusplus
75 }
76 # endif
77
78 #endif