00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef VLC_CHARSET_H
00026 #define VLC_CHARSET_H 1
00027
00028 #include <stdarg.h>
00029 #include <sys/types.h>
00030 #include <dirent.h>
00031
00032 VLC_EXPORT( void, LocaleFree, ( const char * ) );
00033 VLC_EXPORT( char *, FromLocale, ( const char * ) );
00034 VLC_EXPORT( char *, FromLocaleDup, ( const char * ) );
00035 VLC_EXPORT( char *, ToLocale, ( const char * ) );
00036 VLC_EXPORT( char *, ToLocaleDup, ( const char * ) );
00037
00038
00039 VLC_EXPORT( int, utf8_open, ( const char *filename, int flags, mode_t mode ) );
00040 VLC_EXPORT( FILE *, utf8_fopen, ( const char *filename, const char *mode ) );
00041 VLC_EXPORT( DIR *, utf8_opendir, ( const char *dirname ) );
00042 VLC_EXPORT( char *, utf8_readdir, ( DIR *dir ) );
00043 VLC_EXPORT( int, utf8_loaddir, ( DIR *dir, char ***namelist, int (*select)( const char * ), int (*compar)( const char **, const char ** ) ) );
00044 VLC_EXPORT( int, utf8_scandir, ( const char *dirname, char ***namelist, int (*select)( const char * ), int (*compar)( const char **, const char ** ) ) );
00045 VLC_EXPORT( int, utf8_mkdir, ( const char *filename, mode_t mode ) );
00046 VLC_EXPORT( int, utf8_unlink, ( const char *filename ) );
00047
00048 #ifdef WIN32
00049 # define stat _stati64
00050 #endif
00051
00052 VLC_EXPORT( int, utf8_stat, ( const char *filename, struct stat *buf ) );
00053 VLC_EXPORT( int, utf8_lstat, ( const char *filename, struct stat *buf ) );
00054
00055 VLC_EXPORT( int, utf8_vfprintf, ( FILE *stream, const char *fmt, va_list ap ) );
00056 VLC_EXPORT( int, utf8_fprintf, ( FILE *, const char *, ... ) LIBVLC_FORMAT( 2, 3 ) );
00057
00058 VLC_EXPORT( char *, EnsureUTF8, ( char * ) );
00059 VLC_EXPORT( const char *, IsUTF8, ( const char * ) );
00060
00061 #ifdef WIN32
00062 static inline char *FromWide (const wchar_t *wide)
00063 {
00064 size_t len = WideCharToMultiByte (CP_UTF8, 0, wide, -1, NULL, 0, NULL, NULL);
00065 if (len == 0)
00066 return NULL;
00067
00068 char *out = (char *)malloc (len);
00069
00070 WideCharToMultiByte (CP_UTF8, 0, wide, -1, out, len, NULL, NULL);
00071 return out;
00072 }
00073 #endif
00074
00075 VLC_EXPORT( const char *, GetFallbackEncoding, ( void ) );
00076
00077 VLC_EXPORT( double, us_strtod, ( const char *, char ** ) );
00078 VLC_EXPORT( double, us_atof, ( const char * ) );
00079
00080 #endif