From: <ny...@us...> - 2006-06-23 15:17:55
|
Revision: 59 Author: nyaochi Date: 2006-06-23 08:17:37 -0700 (Fri, 23 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=59&view=rev Log Message: ----------- Changed ucs2char_t to wchar_t in libpmp. (This branch will be broken for the time being) Modified Paths: -------------- branches/branch_0.12/include/pmp.h branches/branch_0.12/include/pmphelp.h branches/branch_0.12/lib/pmp/pmp.c branches/branch_0.12/lib/pmp/pmp_posix.c branches/branch_0.12/lib/pmp/pmp_win32.c Modified: branches/branch_0.12/include/pmp.h =================================================================== --- branches/branch_0.12/include/pmp.h 2006-06-23 15:06:49 UTC (rev 58) +++ branches/branch_0.12/include/pmp.h 2006-06-23 15:17:37 UTC (rev 59) @@ -78,7 +78,7 @@ typedef struct { int flag; - ucs2char_t path[MAX_PATH]; + wchar_t path[MAX_PATH]; } pmp_pathenv_t; typedef struct { @@ -92,31 +92,31 @@ pmp_pathenv_t path_to_music; /**< Path to the music files */ pmp_pathenv_t path_to_playlist; /**< Path to the playlist files */ pmp_pathenv_t path_to_photo; /**< Path to the photo files */ - ucs2char_t playlist_ext[MAX_PATH]; + wchar_t playlist_ext[MAX_PATH]; } pmp_environment_t; /** * Structure of media record. */ struct tag_pmp_record_t { - ucs2char_t *filename; /**< Filename. */ - ucs2char_t *title; /**< Track title. */ - ucs2char_t *artist; /**< Artist name. */ - ucs2char_t *composer; /**< Composer name. */ - ucs2char_t *album; /**< Album name. */ - ucs2char_t *genre; /**< Genre name. */ - ucs2char_t *date; /**< Date. */ - uint32_t codec; /**< Codec FourCC. */ - uint32_t track_number; /**< Track number. */ - uint32_t sample_rate; /**< Sample rate in kHz. */ - uint32_t bitrate; /**< Bitrate in bps. */ - uint32_t duration; /**< Duration in seconds. */ - uint32_t filesize; /**< File size in bytes. */ - uint32_t ts_update; /**< Last update. */ - uint32_t rating; /**< Rating of the track. */ - uint32_t play_count; /**< The number of playback of the track. */ - uint32_t ts_playback; /**< Date/time of recent playback of the track. */ - uint32_t ts_import; /**< Date/time when the track was imported. */ + wchar_t* filename; /**< Filename. */ + wchar_t* title; /**< Track title. */ + wchar_t* artist; /**< Artist name. */ + wchar_t* composer; /**< Composer name. */ + wchar_t* album; /**< Album name. */ + wchar_t* genre; /**< Genre name. */ + wchar_t* date; /**< Date. */ + uint32_t codec; /**< Codec FourCC. */ + uint32_t track_number; /**< Track number. */ + uint32_t sample_rate; /**< Sample rate in kHz. */ + uint32_t bitrate; /**< Bitrate in bps. */ + uint32_t duration; /**< Duration in seconds. */ + uint32_t filesize; /**< File size in bytes. */ + uint32_t ts_update; /**< Last update. */ + uint32_t rating; /**< Rating of the track. */ + uint32_t play_count; /**< The number of playback of the track. */ + uint32_t ts_playback; /**< Date/time of recent playback of the track. */ + uint32_t ts_import; /**< Date/time when the track was imported. */ }; typedef struct tag_pmp_record_t pmp_record_t; @@ -132,7 +132,7 @@ result_t (*create_instance_pl)(pmp_t* pmp, pmppl_t** pmppl); int (*is_supported_codec)(pmp_t* pmp, uint32_t codec); - int (*is_supported_ext)(pmp_t* pmp, const ucs2char_t* filename); + int (*is_supported_ext)(pmp_t* pmp, const wchar_t* filename); }; typedef void pmpdb_readwrite_progress_t(void *instance, uint32_t size, uint32_t total); @@ -162,10 +162,10 @@ uint32_t (*add_ref)(pmppl_t* pmppl); uint32_t (*release)(pmppl_t* pmppl); - result_t (*write)(pmppl_t* pmppl, const ucs2char_t* filename, const ucs2char_t** files, uint32_t num_files); + result_t (*write)(pmppl_t* pmppl, const wchar_t* filename, const wchar_t** files, uint32_t num_files); }; -typedef result_t (*pmp_create_t)(pmp_t** pmp, const ucs2char_t* path_to_device, const char *devid); +typedef result_t (*pmp_create_t)(pmp_t** pmp, const wchar_t* path_to_device, const char *devid); typedef void (*pmp_enumerate_devid_callback_t)(void *instance, const char *devid); typedef result_t (*pmp_enumerate_devid_t)(pmp_enumerate_devid_callback_t callback, void *instance); Modified: branches/branch_0.12/include/pmphelp.h =================================================================== --- branches/branch_0.12/include/pmphelp.h 2006-06-23 15:06:49 UTC (rev 58) +++ branches/branch_0.12/include/pmphelp.h 2006-06-23 15:17:37 UTC (rev 59) @@ -34,7 +34,7 @@ pmphelp_create( pmphelp_t* pmphelp, pmp_t** pmp, - const ucs2char_t* path_to_device, + const wchar_t* path_to_device, const char *id ); Modified: branches/branch_0.12/lib/pmp/pmp.c =================================================================== --- branches/branch_0.12/lib/pmp/pmp.c 2006-06-23 15:06:49 UTC (rev 58) +++ branches/branch_0.12/lib/pmp/pmp.c 2006-06-23 15:17:37 UTC (rev 59) @@ -31,7 +31,7 @@ #include <string.h> #endif/*HAVE_STRING_H*/ -#include <ucs2char.h> +#include <wchar.h> #include <pmp.h> void pmp_record_init(pmp_record_t* record) @@ -42,24 +42,24 @@ void pmp_record_finish(pmp_record_t* record) { - ucs2free(record->filename); - ucs2free(record->title); - ucs2free(record->artist); - ucs2free(record->album); - ucs2free(record->genre); - ucs2free(record->date); + free(record->filename); + free(record->title); + free(record->artist); + free(record->album); + free(record->genre); + free(record->date); pmp_record_init(record); } result_t pmp_record_copy(pmp_record_t* dst, const pmp_record_t* src) { memcpy(dst, src, sizeof(*src)); - dst->filename = src->filename ? ucs2dup(src->filename) : NULL; - dst->title = src->title ? ucs2dup(src->title) : NULL; - dst->artist = src->artist ? ucs2dup(src->artist) : NULL; - dst->album = src->album ? ucs2dup(src->album) : NULL; - dst->genre = src->genre ? ucs2dup(src->genre) : NULL; - dst->date = src->date ? ucs2dup(src->date) : NULL; + dst->filename = src->filename ? wcsdup(src->filename) : NULL; + dst->title = src->title ? wcsdup(src->title) : NULL; + dst->artist = src->artist ? wcsdup(src->artist) : NULL; + dst->album = src->album ? wcsdup(src->album) : NULL; + dst->genre = src->genre ? wcsdup(src->genre) : NULL; + dst->date = src->date ? wcsdup(src->date) : NULL; return 0; } Modified: branches/branch_0.12/lib/pmp/pmp_posix.c =================================================================== --- branches/branch_0.12/lib/pmp/pmp_posix.c 2006-06-23 15:06:49 UTC (rev 58) +++ branches/branch_0.12/lib/pmp/pmp_posix.c 2006-06-23 15:17:37 UTC (rev 59) @@ -29,7 +29,7 @@ #include <ltdl.h> #include <os.h> -#include <ucs2char.h> +#include <wchar.h> #include <filepath.h> #include <pmp.h> @@ -119,7 +119,7 @@ return 0; } -result_t pmphelp_create(pmphelp_t* pmphelp, pmp_t** pmp, const ucs2char_t* path_to_device, const char *id) +result_t pmphelp_create(pmphelp_t* pmphelp, pmp_t** pmp, const wchar_t* path_to_device, const char *id) { pmphelp_posix_t* pmphelpposix = (pmphelp_posix_t*)pmphelp; result_t ret = PMP_DEVICENOTFOUND; Modified: branches/branch_0.12/lib/pmp/pmp_win32.c =================================================================== --- branches/branch_0.12/lib/pmp/pmp_win32.c 2006-06-23 15:06:49 UTC (rev 58) +++ branches/branch_0.12/lib/pmp/pmp_win32.c 2006-06-23 15:17:37 UTC (rev 59) @@ -27,7 +27,7 @@ #endif/*HAVE_CONFIG_H*/ #include <os.h> -#include <ucs2char.h> +#include <wchar.h> #include <windows.h> @@ -56,9 +56,9 @@ pmphelp_win32_t* pmphelp = NULL; HANDLE hFile = INVALID_HANDLE_VALUE; WIN32_FIND_DATAW data; - ucs2char_t szPath[MAX_PATH]; - ucs2char_t szPattern[MAX_PATH]; - static const ucs2char_t ucs2cs_pattern[] = {'p','m','p','_','*','.','d','l','l',0}; + wchar_t szPath[MAX_PATH]; + wchar_t szPattern[MAX_PATH]; + static const wchar_t wcscs_pattern[] = {'p','m','p','_','*','.','d','l','l',0}; pmphelp = calloc(1, sizeof(pmphelp_win32_t)); pmphelp->num_plugins = 0; @@ -68,16 +68,16 @@ filepath_remove_filespec(szPath); filepath_addslash(szPath); - ucs2cpy(szPattern, szPath); - ucs2cat(szPattern, ucs2cs_pattern); + wcscpy(szPattern, szPath); + wcscat(szPattern, wcscs_pattern); hFile = FindFirstFileW(szPattern, &data); if (hFile != INVALID_HANDLE_VALUE) { do { if (!(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { - ucs2char_t szFilename[MAX_PATH]; - ucs2cpy(szFilename, szPath); - ucs2cat(szFilename, data.cFileName); + wchar_t szFilename[MAX_PATH]; + wcscpy(szFilename, szPath); + wcscat(szFilename, data.cFileName); pmphelp->plugins = realloc(pmphelp->plugins, sizeof(HMODULE) * (pmphelp->num_plugins+1)); pmphelp->plugins[pmphelp->num_plugins] = LoadLibraryW(szFilename); @@ -116,7 +116,7 @@ return 0; } -result_t pmphelp_create(pmphelp_t* pmphelp, pmp_t** pmp, const ucs2char_t* path_to_device, const char *id) +result_t pmphelp_create(pmphelp_t* pmphelp, pmp_t** pmp, const wchar_t* path_to_device, const char *id) { pmphelp_win32_t* pmphelpw32 = (pmphelp_win32_t*)pmphelp; uint32_t i; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |