Commit 996bdaa2 authored by Carsten Schlote's avatar Carsten Schlote
Browse files

mediaInfoDLL: Added code to support UTF (wchar_t) on Windows and Linux

- Wrapped code into version() blocks
- Changed code to use dchar interface by default
parent 1014e22b
......@@ -16,7 +16,15 @@ extern (C):
import core.stdc.config;
/*Char types */
alias MediaInfo_Char = char;
/* D is always unicode! Note: wchar_t is diffeent on Poxix vs. Windows! */
version(Windows) {
alias MediaInfo_Char = char;
alias MediaInfo_WChar = wchar;
}
else {
alias MediaInfo_Char = char;
alias MediaInfo_WChar = dchar;
}
/*8-bit int */
alias MediaInfo_int8u = ubyte;
......@@ -75,13 +83,15 @@ enum MediaInfo_fileoptions_t
MediaInfo_FileOption_Max = 0x04
}
version(MediaInfo_utf16) {
/* Functions using wide string (UTF16 (windows) or UTF32 (posix)) */
version(MediaInfo_UTF)
{
extern __gshared void* MediaInfo_New();
extern __gshared void* MediaInfoList_New();
extern __gshared void MediaInfo_Delete (void*);
extern __gshared void MediaInfoList_Delete (void*);
extern __gshared c_ulong MediaInfo_Open (void*, const(MediaInfo_Char)*);
extern __gshared c_ulong MediaInfoList_Open (void*, const(MediaInfo_Char)*, const MediaInfo_fileoptions_t);
extern __gshared c_ulong MediaInfoList_Open (void*, const(MediaInfo_WChar)*, const MediaInfo_fileoptions_t);
extern __gshared c_ulong MediaInfo_Open (void*, const(MediaInfo_WChar)*);
extern __gshared c_ulong MediaInfo_Open_Buffer_Init (void*, MediaInfo_int64u File_Size, MediaInfo_int64u File_Offset);
extern __gshared c_ulong MediaInfo_Open_Buffer_Continue (void*, MediaInfo_int8u* Buffer, size_t Buffer_Size);
extern __gshared ulong MediaInfo_Open_Buffer_Continue_GoTo_Get (void*);
......@@ -89,16 +99,16 @@ version(MediaInfo_utf16) {
extern __gshared c_ulong MediaInfo_Open_NextPacket (void*);
extern __gshared void MediaInfo_Close (void*);
extern __gshared void MediaInfoList_Close (void*, size_t);
extern __gshared const(char)* MediaInfo_Inform (void*, size_t Reserved);
extern __gshared const(char)* MediaInfoList_Inform (void*, size_t, size_t Reserved);
extern __gshared const(char)* MediaInfo_GetI (void*, MediaInfo_stream_t StreamKind, size_t StreamNumber, size_t Parameter, MediaInfo_info_C KindOfInfo);
extern __gshared const(char)* MediaInfoList_GetI (void*, size_t, MediaInfo_stream_t StreamKind, size_t StreamNumber, size_t Parameter, MediaInfo_info_C KindOfInfo);
extern __gshared const(char)* MediaInfo_Get (void*, MediaInfo_stream_t StreamKind, size_t StreamNumber, const(MediaInfo_Char)* Parameter, MediaInfo_info_C KindOfInfo, MediaInfo_info_C KindOfSearch);
extern __gshared const(char)* MediaInfoList_Get (void*, size_t, MediaInfo_stream_t StreamKind, size_t StreamNumber, const(MediaInfo_Char)* Parameter, MediaInfo_info_C KindOfInfo, MediaInfo_info_C KindOfSearch);
extern __gshared c_ulong MediaInfo_Output_Buffer_Get (void*, const(MediaInfo_Char)* Parameter);
extern __gshared const(MediaInfo_WChar)* MediaInfo_Inform (void*, size_t Reserved);
extern __gshared const(MediaInfo_WChar)* MediaInfoList_Inform (void*, size_t, size_t Reserved);
extern __gshared const(MediaInfo_WChar)* MediaInfo_GetI (void*, MediaInfo_stream_t StreamKind, size_t StreamNumber, size_t Parameter, MediaInfo_info_C KindOfInfo);
extern __gshared const(MediaInfo_WChar)* MediaInfoList_GetI (void*, size_t, MediaInfo_stream_t StreamKind, size_t StreamNumber, size_t Parameter, MediaInfo_info_C KindOfInfo);
extern __gshared const(MediaInfo_WChar)* MediaInfo_Get (void*, MediaInfo_stream_t StreamKind, size_t StreamNumber, const(MediaInfo_WChar)* Parameter, MediaInfo_info_C KindOfInfo, MediaInfo_info_C KindOfSearch);
extern __gshared const(MediaInfo_WChar)* MediaInfoList_Get (void*, size_t, MediaInfo_stream_t StreamKind, size_t StreamNumber, const(MediaInfo_WChar)* Parameter, MediaInfo_info_C KindOfInfo, MediaInfo_info_C KindOfSearch);
extern __gshared c_ulong MediaInfo_Output_Buffer_Get (void*, const(MediaInfo_WChar)* Parameter);
extern __gshared c_ulong MediaInfo_Output_Buffer_GetI (void*, size_t Pos);
extern __gshared const(char)* MediaInfo_Option (void*, const(MediaInfo_Char)* Parameter, const(MediaInfo_Char)* Value);
extern __gshared const(char)* MediaInfoList_Option (void*, const(MediaInfo_Char)* Parameter, const(MediaInfo_Char)* Value);
extern __gshared const(MediaInfo_WChar)* MediaInfo_Option (void*, const(MediaInfo_WChar)* Parameter, const(MediaInfo_WChar)* Value);
extern __gshared const(MediaInfo_WChar)* MediaInfoList_Option (void*, const(MediaInfo_WChar)* Parameter, const(MediaInfo_WChar)* Value);
extern __gshared c_ulong MediaInfo_State_Get (void*);
extern __gshared c_ulong MediaInfoList_State_Get (void*);
extern __gshared c_ulong MediaInfo_Count_Get (void*, MediaInfo_stream_t StreamKind, size_t StreamNumber);
......@@ -107,34 +117,36 @@ version(MediaInfo_utf16) {
extern __gshared c_ulong MediaInfoList_Count_Get_Files (void*);
}
/* ASCII und UTF-8 Functions */
extern __gshared void* MediaInfoA_New();
extern __gshared void* MediaInfoListA_New();
extern __gshared void MediaInfoA_Delete (void*);
extern __gshared void MediaInfoListA_Delete (void*);
extern __gshared c_ulong MediaInfoA_Open (void*, const(MediaInfo_Char)*);
extern __gshared c_ulong MediaInfoListA_Open (void*, const(MediaInfo_Char)*, const MediaInfo_fileoptions_t);
extern __gshared c_ulong MediaInfoA_Open_Buffer_Init (void*, MediaInfo_int64u File_Size, MediaInfo_int64u File_Offset);
extern __gshared c_ulong MediaInfoA_Open_Buffer_Continue (void*, MediaInfo_int8u* Buffer, size_t Buffer_Size);
extern __gshared ulong MediaInfoA_Open_Buffer_Continue_GoTo_Get (void*);
extern __gshared c_ulong MediaInfoA_Open_Buffer_Finalize (void*);
extern __gshared c_ulong MediaInfoA_Open_NextPacket (void*);
extern __gshared void MediaInfoA_Close (void*);
extern __gshared void MediaInfoListA_Close (void*, size_t);
extern __gshared const(char)* MediaInfoA_Inform (void*, size_t Reserved);
extern __gshared const(char)* MediaInfoListA_Inform (void*, size_t, size_t Reserved);
extern __gshared const(char)* MediaInfoA_GetI (void*, MediaInfo_stream_t StreamKind, size_t StreamNumber, size_t Parameter, MediaInfo_info_C KindOfInfo);
extern __gshared const(char)* MediaInfoListA_GetI (void*, size_t, MediaInfo_stream_t StreamKind, size_t StreamNumber, size_t Parameter, MediaInfo_info_C KindOfInfo);
extern __gshared const(char)* MediaInfoA_Get (void*, MediaInfo_stream_t StreamKind, size_t StreamNumber, const(MediaInfo_Char)* Parameter, MediaInfo_info_C KindOfInfo, MediaInfo_info_C KindOfSearch);
extern __gshared const(char)* MediaInfoListA_Get (void*, size_t, MediaInfo_stream_t StreamKind, size_t StreamNumber, const(MediaInfo_Char)* Parameter, MediaInfo_info_C KindOfInfo, MediaInfo_info_C KindOfSearch);
extern __gshared c_ulong MediaInfoA_Output_Buffer_Get (void*, const(MediaInfo_Char)* Parameter);
extern __gshared c_ulong MediaInfoA_Output_Buffer_GetI (void*, size_t Pos);
extern __gshared const(char)* MediaInfoA_Option (void*, const(MediaInfo_Char)* Parameter, const(MediaInfo_Char)* Value);
extern __gshared const(char)* MediaInfoListA_Option (void*, const(MediaInfo_Char)* Parameter, const(MediaInfo_Char)* Value);
extern __gshared c_ulong MediaInfoA_State_Get (void*);
extern __gshared c_ulong MediaInfoListA_State_Get (void*);
extern __gshared c_ulong MediaInfoA_Count_Get (void*, MediaInfo_stream_t StreamKind, size_t StreamNumber);
extern __gshared c_ulong MediaInfoListA_Count_Get (void*, size_t, MediaInfo_stream_t StreamKind, size_t StreamNumber);
extern __gshared c_ulong MediaInfoA_Count_Get_Files (void*);
extern __gshared c_ulong MediaInfoListA_Count_Get_Files (void*);
version(MediaInfo_Ansi)
{
/* Functions using Ansi C-Strings (7Bit chars!) - no locale support, codepage on windows */
extern __gshared void* MediaInfoA_New();
extern __gshared void* MediaInfoListA_New();
extern __gshared void MediaInfoA_Delete (void*);
extern __gshared void MediaInfoListA_Delete (void*);
extern __gshared c_ulong MediaInfoA_Open (void*, const(MediaInfo_Char)*);
extern __gshared c_ulong MediaInfoListA_Open (void*, const(MediaInfo_Char)*, const MediaInfo_fileoptions_t);
extern __gshared c_ulong MediaInfoA_Open_Buffer_Init (void*, MediaInfo_int64u File_Size, MediaInfo_int64u File_Offset);
extern __gshared c_ulong MediaInfoA_Open_Buffer_Continue (void*, MediaInfo_int8u* Buffer, size_t Buffer_Size);
extern __gshared ulong MediaInfoA_Open_Buffer_Continue_GoTo_Get (void*);
extern __gshared c_ulong MediaInfoA_Open_Buffer_Finalize (void*);
extern __gshared c_ulong MediaInfoA_Open_NextPacket (void*);
extern __gshared void MediaInfoA_Close (void*);
extern __gshared void MediaInfoListA_Close (void*, size_t);
extern __gshared const(char)* MediaInfoA_Inform (void*, size_t Reserved);
extern __gshared const(char)* MediaInfoListA_Inform (void*, size_t, size_t Reserved);
extern __gshared const(char)* MediaInfoA_GetI (void*, MediaInfo_stream_t StreamKind, size_t StreamNumber, size_t Parameter, MediaInfo_info_C KindOfInfo);
extern __gshared const(char)* MediaInfoListA_GetI (void*, size_t, MediaInfo_stream_t StreamKind, size_t StreamNumber, size_t Parameter, MediaInfo_info_C KindOfInfo);
extern __gshared const(char)* MediaInfoA_Get (void*, MediaInfo_stream_t StreamKind, size_t StreamNumber, const(MediaInfo_Char)* Parameter, MediaInfo_info_C KindOfInfo, MediaInfo_info_C KindOfSearch);
extern __gshared const(char)* MediaInfoListA_Get (void*, size_t, MediaInfo_stream_t StreamKind, size_t StreamNumber, const(MediaInfo_Char)* Parameter, MediaInfo_info_C KindOfInfo, MediaInfo_info_C KindOfSearch);
extern __gshared c_ulong MediaInfoA_Output_Buffer_Get (void*, const(MediaInfo_Char)* Parameter);
extern __gshared c_ulong MediaInfoA_Output_Buffer_GetI (void*, size_t Pos);
extern __gshared const(char)* MediaInfoA_Option (void*, const(MediaInfo_Char)* Parameter, const(MediaInfo_Char)* Value);
extern __gshared const(char)* MediaInfoListA_Option (void*, const(MediaInfo_Char)* Parameter, const(MediaInfo_Char)* Value);
extern __gshared c_ulong MediaInfoA_State_Get (void*);
extern __gshared c_ulong MediaInfoListA_State_Get (void*);
extern __gshared c_ulong MediaInfoA_Count_Get (void*, MediaInfo_stream_t StreamKind, size_t StreamNumber);
extern __gshared c_ulong MediaInfoListA_Count_Get (void*, size_t, MediaInfo_stream_t StreamKind, size_t StreamNumber);
extern __gshared c_ulong MediaInfoA_Count_Get_Files (void*);
extern __gshared c_ulong MediaInfoListA_Count_Get_Files (void*);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment