[iso] update libcdio to v0.90

This commit is contained in:
Pete Batard 2012-11-04 01:33:54 +00:00
parent 2a3b95a11a
commit bf98a552da
47 changed files with 1024 additions and 928 deletions

View file

@ -23,8 +23,12 @@
# include "config.h"
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#include <string.h>
#endif
#ifdef HAVE_STDLIB_H
@ -38,10 +42,6 @@
#include <cdio/utf8.h>
#include <cdio/logging.h>
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
/* Windows requires some basic UTF-8 support outside of Joliet */
#if defined(_WIN32)
#include <windows.h>
@ -55,7 +55,7 @@
* Converts an UTF-16 string to UTF8 (allocate returned string)
* Returns NULL on error
*/
char* cdio_wchar_to_utf8(const wchar_t* wstr)
static inline char* cdio_wchar_to_utf8(const wchar_t* wstr)
{
int size = 0;
char* str = NULL;
@ -99,6 +99,18 @@ wchar_t* cdio_utf8_to_wchar(const char* str)
}
return wstr;
}
/* UTF-8 compliant version of fopen() */
FILE* fopen_utf8(const char* filename, const char* mode)
{
FILE* ret = NULL;
wchar_t* wfilename = cdio_utf8_to_wchar(filename);
wchar_t* wmode = cdio_utf8_to_wchar(mode);
ret = _wfopen(wfilename, wmode);
free(wfilename);
free(wmode);
return ret;
}
#endif
#ifdef HAVE_JOLIET
@ -155,7 +167,7 @@ void cdio_charset_converter_destroy(cdio_charset_coverter_t*cnv)
#define BYTES_INCREMENT 16
static bool
do_convert(iconv_t cd, char * src, int src_len,
do_convert(iconv_t cd, const char * src, int src_len,
char ** dst, int *dst_len)
{
char * ret;
@ -182,7 +194,7 @@ do_convert(iconv_t cd, char * src, int src_len,
ret = malloc(alloc_size);
inbuf = src;
inbuf = (char *)src;
outbuf = ret;
while(1)
@ -257,7 +269,7 @@ bool cdio_charset_from_utf8(cdio_utf8_t * src, char ** dst,
bool cdio_charset_to_utf8(char *src, size_t src_len, cdio_utf8_t **dst,
bool cdio_charset_to_utf8(const char *src, size_t src_len, cdio_utf8_t **dst,
const char * src_charset)
{
iconv_t ic;
@ -297,7 +309,7 @@ bool cdio_charset_from_utf8(cdio_utf8_t * src, char ** dst,
return true;
}
bool cdio_charset_to_utf8(char *src, size_t src_len, cdio_utf8_t **dst,
bool cdio_charset_to_utf8(const char *src, size_t src_len, cdio_utf8_t **dst,
const char * src_charset)
{
wchar_t* le_src;