From: <ny...@us...> - 2006-06-25 05:41:25
|
Revision: 67 Author: nyaochi Date: 2006-06-24 22:40:52 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=67&view=rev Log Message: ----------- migration for libpmp_iriverplus2 and the CUI frontend Modified Paths: -------------- branches/branch_0.12/frontend/easypmp/common/database.c branches/branch_0.12/frontend/easypmp/common/easypmp.h branches/branch_0.12/frontend/easypmp/common/enumerate.c branches/branch_0.12/frontend/easypmp/common/playlist.c branches/branch_0.12/frontend/easypmp/cui/device.c branches/branch_0.12/frontend/easypmp/cui/easypmp_cui.vcproj branches/branch_0.12/frontend/easypmp/cui/main.c branches/branch_0.12/frontend/easypmp/cui/option.c branches/branch_0.12/frontend/easypmp/cui/util.c branches/branch_0.12/frontend/easypmp/cui/util.h branches/branch_0.12/include/filepath.h branches/branch_0.12/lib/filepath/filepath_win32.c branches/branch_0.12/lib/pmp_iriverplus2/ip2db.c branches/branch_0.12/lib/pmp_iriverplus2/pmp_iriverplus2.c branches/branch_0.12/pmp.sln Modified: branches/branch_0.12/frontend/easypmp/common/database.c =================================================================== --- branches/branch_0.12/frontend/easypmp/common/database.c 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/frontend/easypmp/common/database.c 2006-06-25 05:40:52 UTC (rev 67) @@ -30,7 +30,7 @@ #include <stdio.h> #include <stdlib.h> #include <time.h> -#include <ucs2char.h> +#include <wchar.h> #include <filepath.h> #include <pmp.h> #include <gmi.h> @@ -39,7 +39,7 @@ #ifdef _WIN32 #define COMP_STR(x, y) lstrcmpiW(x, y) /* FAT32 treats upper/lower letters as identical. */ #else -#define COMP_STR(x, y) ucs2cmp(x, y) +#define COMP_STR(x, y) wcscmp(x, y) #endif static uint32_t get_current_time() @@ -55,7 +55,7 @@ static int find_mediafile( pmp_record_t* records, int num_records, - const ucs2char_t* filename, + const wchar_t* filename, int *begin, int *end ) @@ -154,11 +154,11 @@ int is_skipping = 0; easypmp_filename_t* target = &fl->elements[i]; pmp_record_t* record = &records[i]; - ucs2char_t filename[MAX_PATH]; + wchar_t filename[MAX_PATH]; uint32_t timestamp = 0; filepath_combinepath(filename, MAX_PATH, target->pathname, target->filename); - timestamp = (uint32_t)ucs2stat_mtime(filename); + timestamp = (uint32_t)filepath_mtime(filename); // Report the progress. if (progress(instance, EASYPMPDBP_GMI | EASYPMPSP_PROGRESS, i, 0, filename) != 0) { @@ -381,10 +381,10 @@ -int easypmp_set_strip_words(option_t* opt, const ucs2char_t* str) +int easypmp_set_strip_words(option_t* opt, const wchar_t* str) { size_t i; - const ucs2char_t *p = 0, *q = 0; + const wchar_t *p = 0, *q = 0; /* * This function parses a list of strip words specified by comma separated @@ -394,9 +394,9 @@ /* Free buffers allocated already. */ for (i = 0;i < opt->num_strip_words;++i) { - ucs2free(opt->strip_words[i]); + free(opt->strip_words[i]); } - ucs2free(opt->strip_words); + free(opt->strip_words); if (str && *str) { /* Count the number of strip words in str. */ @@ -408,7 +408,7 @@ } /* Allocate an array to store strip words. */ - opt->strip_words = (ucs2char_t**)ucs2malloc(sizeof(ucs2char_t*) * opt->num_strip_words); + opt->strip_words = (wchar_t**)malloc(sizeof(wchar_t*) * opt->num_strip_words); if (!opt->strip_words) { return -1; } @@ -420,9 +420,9 @@ for (;;) { if (*q == ',' || !*q) { size_t length = (size_t)(q - p); - opt->strip_words[i] = (ucs2char_t*)ucs2malloc(sizeof(ucs2char_t) * (length+1)); - memset(opt->strip_words[i], 0, sizeof(ucs2char_t) * (length+1)); - ucs2ncpy(opt->strip_words[i], p, length); + opt->strip_words[i] = (wchar_t*)malloc(sizeof(wchar_t) * (length+1)); + memset(opt->strip_words[i], 0, sizeof(wchar_t) * (length+1)); + wcsncpy(opt->strip_words[i], p, length); opt->strip_words[i][length] = 0; if (!*q) { break; Modified: branches/branch_0.12/frontend/easypmp/common/easypmp.h =================================================================== --- branches/branch_0.12/frontend/easypmp/common/easypmp.h 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/frontend/easypmp/common/easypmp.h 2006-06-25 05:40:52 UTC (rev 67) @@ -84,18 +84,18 @@ uint32_t verb; uint32_t media_info_source; int repr_level; - ucs2char_t path_to_root[MAX_PATH]; - ucs2char_t path_to_include[MAX_PATH]; + wchar_t path_to_root[MAX_PATH]; + wchar_t path_to_include[MAX_PATH]; char model[128]; char *system_encoding; char *music_encoding; - ucs2char_t** strip_words; + wchar_t** strip_words; int num_strip_words; } option_t; typedef struct { - ucs2char_t pathname[MAX_PATH]; - ucs2char_t filename[MAX_PATH]; + wchar_t pathname[MAX_PATH]; + wchar_t filename[MAX_PATH]; } easypmp_filename_t; typedef struct { @@ -103,14 +103,14 @@ easypmp_filename_t* elements; } easypmp_filelist_t; -typedef int (*easypmp_enumerate_progress_t)(void *instance, const ucs2char_t* path, const ucs2char_t* file, size_t n); +typedef int (*easypmp_enumerate_progress_t)(void *instance, const wchar_t* path, const wchar_t* file, size_t n); typedef int (*easypmp_progress_t)( void *instance, int phase, int param_int, double param_float, - ucs2char_t* param_str + wchar_t* param_str ); int @@ -155,7 +155,7 @@ int easypmp_set_strip_words( option_t* opt, - const ucs2char_t* str + const wchar_t* str ); int Modified: branches/branch_0.12/frontend/easypmp/common/enumerate.c =================================================================== --- branches/branch_0.12/frontend/easypmp/common/enumerate.c 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/frontend/easypmp/common/enumerate.c 2006-06-25 05:40:52 UTC (rev 67) @@ -29,7 +29,7 @@ #include <os.h> #include <stdio.h> #include <stdlib.h> -#include <ucs2char.h> +#include <wchar.h> #include <filepath.h> #include <playlist.h> #include <pmp.h> @@ -44,7 +44,7 @@ void *instance; } enumerate_dat_t; -static int found_music_file(void *instance, const ucs2char_t* found_path, const ucs2char_t* found_file) +static int found_music_file(void *instance, const wchar_t* found_path, const wchar_t* found_file) { enumerate_dat_t* ed = (enumerate_dat_t*)instance; pmp_t* pmp = ed->pmp; @@ -65,8 +65,8 @@ // Set path and file. new_filename = &fl->elements[fl->num_elements++]; - ucs2cpy(new_filename->pathname, found_path); - ucs2cpy(new_filename->filename, found_file); + wcscpy(new_filename->pathname, found_path); + wcscpy(new_filename->filename, found_file); } else { // Exit if the filename does not have a supported extension. return 0; @@ -109,7 +109,7 @@ ); } -static int found_playlist_file(void *instance, const ucs2char_t* found_path, const ucs2char_t* found_file) +static int found_playlist_file(void *instance, const wchar_t* found_path, const wchar_t* found_file) { enumerate_dat_t* ed = (enumerate_dat_t*)instance; pmp_t* pmp = ed->pmp; @@ -131,8 +131,8 @@ // Set path and file. new_filename = &fl->elements[fl->num_elements++]; - ucs2cpy(new_filename->pathname, found_path); - ucs2cpy(new_filename->filename, found_file); + wcscpy(new_filename->pathname, found_path); + wcscpy(new_filename->filename, found_file); } else { // Exit if the filename does not have a supported extension. return 0; Modified: branches/branch_0.12/frontend/easypmp/common/playlist.c =================================================================== --- branches/branch_0.12/frontend/easypmp/common/playlist.c 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/frontend/easypmp/common/playlist.c 2006-06-25 05:40:52 UTC (rev 67) @@ -29,7 +29,7 @@ #include <os.h> #include <stdio.h> #include <stdlib.h> -#include <ucs2char.h> +#include <wchar.h> #include <filepath.h> #include <pmp.h> #include <playlist.h> @@ -41,7 +41,7 @@ easypmp_progress_t progress; } callback_data_t; -static void callback_from_playlist(void *instance, int level, ucs2char_t* message) +static void callback_from_playlist(void *instance, int level, wchar_t* message) { int phase = EASYPMPPLP_CONVERT; callback_data_t* cd = (callback_data_t*)instance; @@ -98,8 +98,8 @@ goto error_exit; } for (i = 0;i < musics->num_elements;++i) { - ucs2cpy(mediafiles[i].path, musics->elements[i].pathname); - ucs2cpy(mediafiles[i].file, musics->elements[i].filename); + wcscpy(mediafiles[i].path, musics->elements[i].pathname); + wcscpy(mediafiles[i].file, musics->elements[i].filename); } // Prepare playlist conversion for finding music files. @@ -114,7 +114,7 @@ // Loop over playlist files. for (i = 0;i < playlists->num_elements;++i) { playlists_t pls; - ucs2char_t src[MAX_PATH]; + wchar_t src[MAX_PATH]; const easypmp_filename_t* plf = &playlists->elements[i]; int k = 0; int n = 0; @@ -146,14 +146,14 @@ } for (k = 0;k < pls.num_playlists;++k) { - ucs2char_t** contents = NULL; + wchar_t** contents = NULL; playlist_t* pl = &pls.playlists[k]; - ucs2char_t dst[MAX_PATH]; + wchar_t dst[MAX_PATH]; // Generate a destination filename. filepath_combinepath(dst, MAX_PATH, pmp->env.path_to_playlist.path, filepath_skippath(pl->name)); filepath_remove_extension(dst); - ucs2cat(dst, pmp->env.playlist_ext); + wcscat(dst, pmp->env.playlist_ext); // Skipping the existing playlist if (!(opt->verb & MODE_PLAYLIST_RECONVERT)) { @@ -211,14 +211,14 @@ } // Allocate a memory block for the contents of the playlist. - contents = (ucs2char_t**)calloc(pl->num_entries, sizeof(ucs2char_t*)); + contents = (wchar_t**)calloc(pl->num_entries, sizeof(wchar_t*)); if (!contents) { result = EASYPMPE_INSUFFICIENT_MEMORY; goto error_exit; } for (j = 0, n = 0;j < pl->num_entries;++j) { if (pl->entries[j].valid && pl->entries[j].filename[0]) { - contents[n] = ucs2dup(pl->entries[j].filename); + contents[n] = wcsdup(pl->entries[j].filename); ++n; } } @@ -229,7 +229,7 @@ // Free the contents of the playlist. for (j = 0;j < n;++j) { - ucs2free(contents[j]); + free(contents[j]); } free(contents); } Modified: branches/branch_0.12/frontend/easypmp/cui/device.c =================================================================== --- branches/branch_0.12/frontend/easypmp/cui/device.c 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/frontend/easypmp/cui/device.c 2006-06-25 05:40:52 UTC (rev 67) @@ -29,7 +29,7 @@ #include <os.h> #include <stdio.h> #include <stdlib.h> -#include <ucs2char.h> +#include <wchar.h> #include <filepath.h> #include <pmp.h> #include <pmphelp.h> @@ -44,10 +44,10 @@ } // Display a path name using the given string format. -void device_show_path(FILE *fp, const char* const format, const ucs2char_t* const path) +void device_show_path(FILE *fp, const char* const format, const wchar_t* const path) { - ucs2char_t decoded_path[MAX_PATH]; - ucs2cpy(decoded_path, path); + wchar_t decoded_path[MAX_PATH]; + wcscpy(decoded_path, path); filepath_decode(decoded_path); fprints(fp, format, decoded_path); @@ -72,9 +72,9 @@ { pmphelp_t *pmphelp = (pmphelp_t*)instance; pmp_t* pmp = NULL; - ucs2char_t ucs2cs_empty[] = {0}; + wchar_t wcscs_empty[] = {0}; - pmphelp_create(pmphelp, &pmp, ucs2cs_empty, devid); + pmphelp_create(pmphelp, &pmp, wcscs_empty, devid); device_show_information(pmp, stderr); fprintf(stderr, "\n"); pmp->release(pmp); Modified: branches/branch_0.12/frontend/easypmp/cui/easypmp_cui.vcproj =================================================================== --- branches/branch_0.12/frontend/easypmp/cui/easypmp_cui.vcproj 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/frontend/easypmp/cui/easypmp_cui.vcproj 2006-06-25 05:40:52 UTC (rev 67) @@ -69,7 +69,7 @@ Name="VCCLCompilerTool" AdditionalIncludeDirectories="$(SolutionDir)include,..\common" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" - RuntimeLibrary="4" + RuntimeLibrary="2" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" Modified: branches/branch_0.12/frontend/easypmp/cui/main.c =================================================================== --- branches/branch_0.12/frontend/easypmp/cui/main.c 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/frontend/easypmp/cui/main.c 2006-06-25 05:40:52 UTC (rev 67) @@ -34,7 +34,7 @@ #include <direct.h> /* getcwd() */ #endif/*_MSC_VER*/ -#include <ucs2char.h> +#include <wchar.h> #include <filepath.h> #include <gmi.h> #include <pmp.h> @@ -59,8 +59,8 @@ static int easypmp_enumerate_progress( void *instance, - const ucs2char_t* path, - const ucs2char_t* file, + const wchar_t* path, + const wchar_t* file, size_t n ) { @@ -78,7 +78,7 @@ int phase, int param_int, double param_float, - ucs2char_t* param_str + wchar_t* param_str ) { FILE *fpe = stderr; @@ -166,9 +166,9 @@ int set_encoding(const char *encoding) { - ucs2conv_t conv; + wcsconv_t conv; - if (ucs2set_encoding(encoding, &conv) != 0) { + if (wcsset_encoding(encoding, &conv) != 0) { fprintf(stderr, "ERROR: iconv does not support the following conversion\n %s: from %s to %s\n", encoding, conv.from, conv.to); return 1; } @@ -176,9 +176,9 @@ int set_encoding_music(const char *encoding) { - ucs2conv_t conv; + wcsconv_t conv; - if (ucs2set_encoding_music(encoding, &conv) != 0) { + if (wcsset_encoding_music(encoding, &conv) != 0) { fprintf(stderr, "ERROR: iconv does not support the following conversion\n %s: from %s to %s\n", encoding, conv.from, conv.to); return 1; } @@ -225,7 +225,7 @@ if (used_args < argc) { size_t length = strlen(argv[used_args]); if (length > 0) { - mbstoucs2(opt.path_to_root, MAX_PATH, argv[used_args], strlen(argv[used_args])+1); + mbstowcs(opt.path_to_root, argv[used_args], strlen(argv[used_args])+1); } ++used_args; } @@ -258,14 +258,14 @@ // If path_to_root is not set, use the current directory. char pwd[MAX_PATH+1]; getcwd(pwd, MAX_PATH); - mbstoucs2(opt.path_to_root, MAX_PATH, pwd, strlen(pwd)+1); + mbstowcs(opt.path_to_root, pwd, strlen(pwd)+1); } else if (opt.path_to_root[0] == '-' && opt.path_to_root[1] == 0) { #ifdef _WIN32 // (Win32 only) // If path_to_root is "-", assume the root folder of the path where this executable is located. - ucs2char_t* p = NULL; + wchar_t* p = NULL; GetModuleFileNameW(GetModuleHandle(NULL), opt.path_to_root, MAX_PATH); - p = (ucs2char_t*)filepath_skip_one_directory(opt.path_to_root); + p = (wchar_t*)filepath_skip_one_directory(opt.path_to_root); if (p) { *p = 0; } @@ -277,16 +277,16 @@ if (!opt.path_to_include[0]) { #ifdef _WIN32 // "jspl" folder under the location where the executable is installed. - ucs2char_t ucs2cs_jspl[] = {'j','s','p','l',0}; + wchar_t wcscs_jspl[] = {'j','s','p','l',0}; GetModuleFileNameW(GetModuleHandle(NULL), opt.path_to_include, MAX_PATH); filepath_remove_filespec(opt.path_to_include); filepath_addslash(opt.path_to_include); - ucs2cat(opt.path_to_include, ucs2cs_jspl); + wcscat(opt.path_to_include, wcscs_jspl); filepath_addslash(opt.path_to_include); #else // Obtain JavaScript Playlist directory from PMP_JSPLINCL_DIR - mbstoucs2(opt.path_to_include, MAX_PATH, PMP_JSPL_DIR, strlen(PMP_JSPL_DIR)+1); + mbstowcs(opt.path_to_include, MAX_PATH, PMP_JSPL_DIR, strlen(PMP_JSPL_DIR)+1); #endif } Modified: branches/branch_0.12/frontend/easypmp/cui/option.c =================================================================== --- branches/branch_0.12/frontend/easypmp/cui/option.c 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/frontend/easypmp/cui/option.c 2006-06-25 05:40:52 UTC (rev 67) @@ -33,7 +33,8 @@ #include <direct.h> /* getcwd() */ #endif/*_MSC_VER*/ -#include <ucs2char.h> +#include <wchar.h> +#include <wstring.h> #include <filepath.h> #include <gmi.h> #include <pmp.h> @@ -94,8 +95,8 @@ static void set_strip_words(option_t* opt, const char *str) { - ucs2char_t* ucs2str = mbsdupucs2(str); - easypmp_set_strip_words(opt, ucs2str); + wchar_t* wcsstr = mbsdupwcs(str); + easypmp_set_strip_words(opt, wcsstr); } int option_parse(option_t* opt, int argc, char *argv[], FILE *fpe) Modified: branches/branch_0.12/frontend/easypmp/cui/util.c =================================================================== --- branches/branch_0.12/frontend/easypmp/cui/util.c 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/frontend/easypmp/cui/util.c 2006-06-25 05:40:52 UTC (rev 67) @@ -29,7 +29,8 @@ #include <os.h> #include <stdio.h> #include <stdlib.h> -#include <ucs2char.h> +#include <wchar.h> +#include <wstring.h> #include "util.h" @@ -38,20 +39,20 @@ fprintf(fp, "%-79.79s\r", ""); } -void fprints(FILE *fp, const char *format, const ucs2char_t* value) +void fprints(FILE *fp, const char *format, const wchar_t* value) { - fprints_fixed(fp, format, value, ucs2len(value)); + fprints_fixed(fp, format, value, wcslen(value)); } -void fprints_fixed(FILE *fp, const char *format, const ucs2char_t* value, size_t length) +void fprints_fixed(FILE *fp, const char *format, const wchar_t* value, size_t length) { char *mbs = NULL; - ucs2char_t* tmp = alloca(sizeof(ucs2char_t) * (length+1)); - memset(tmp, 0, sizeof(ucs2char_t) * (length+1)); - ucs2ncpy(tmp, value, length); - mbs = ucs2dupmbs(tmp); + wchar_t* tmp = alloca(sizeof(wchar_t) * (length+1)); + memset(tmp, 0, sizeof(wchar_t) * (length+1)); + wcsncpy(tmp, value, length); + mbs = wcsdupmbs(tmp); if (mbs) { fprintf(fp, format, mbs); - ucs2free(mbs); + free(mbs); } } Modified: branches/branch_0.12/frontend/easypmp/cui/util.h =================================================================== --- branches/branch_0.12/frontend/easypmp/cui/util.h 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/frontend/easypmp/cui/util.h 2006-06-25 05:40:52 UTC (rev 67) @@ -26,7 +26,7 @@ #define __UTIL_H__ void clear_line(FILE *fp); -void fprints(FILE *fp, const char *format, const ucs2char_t* value); -void fprints_fixed(FILE *fp, const char *format, const ucs2char_t* value, size_t length); +void fprints(FILE *fp, const char *format, const wchar_t* value); +void fprints_fixed(FILE *fp, const char *format, const wchar_t* value, size_t length); #endif/*__UTIL_H__*/ Modified: branches/branch_0.12/include/filepath.h =================================================================== --- branches/branch_0.12/include/filepath.h 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/include/filepath.h 2006-06-25 05:40:52 UTC (rev 67) @@ -84,6 +84,7 @@ FILEPATHAPI FILE* filepath_fopen(const wchar_t* name, const wchar_t* mode); FILEPATHAPI unsigned long filepath_filesize(const wchar_t *filename); +FILEPATHAPI time_t filepath_mtime(const wchar_t *filename); #ifdef __cplusplus } Modified: branches/branch_0.12/lib/filepath/filepath_win32.c =================================================================== --- branches/branch_0.12/lib/filepath/filepath_win32.c 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/lib/filepath/filepath_win32.c 2006-06-25 05:40:52 UTC (rev 67) @@ -249,3 +249,14 @@ } return 0; } + +time_t filepath_mtime(const wchar_t *filename) +{ + int ret = 0; + struct _stat st; + ret = _wstat(filename, &st); + if (ret == 0) { + return st.st_mtime; + } + return 0; +} Modified: branches/branch_0.12/lib/pmp_iriverplus2/ip2db.c =================================================================== --- branches/branch_0.12/lib/pmp_iriverplus2/ip2db.c 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/lib/pmp_iriverplus2/ip2db.c 2006-06-25 05:40:52 UTC (rev 67) @@ -160,7 +160,7 @@ result_t ret = 0; uint32_t i, j, n = 0; ip2db_record_t* ip2db_records = NULL; - static const ucs2char_t ucs2cs_unknown[] = {'u','n','k','n','o','w','n',0}; + static const wchar_t* wcscs_unknown = L"unknown"; // Count valid entries. for (i = 0;i < num_records;++i) { @@ -193,20 +193,20 @@ } dst->entry_number = j+1; - dst->pathname = ucs2dup(filepath_skipdrive(src->filename, path_to_root)); + dst->pathname = wcsdupucs2(filepath_skipdrive(src->filename, path_to_root)); filepath_remove_filespec(dst->pathname); filepath_encode(dst->pathname); - dst->filename = ucs2dup(filepath_skippath(src->filename)); - dst->title = ucs2dup(src->title ? src->title : dst->filename); - dst->artist = ucs2dup(src->artist ? src->artist : ucs2cs_unknown); - dst->album = ucs2dup(src->album ? src->album : ucs2cs_unknown); - dst->genre = ucs2dup(src->genre ? src->genre : ucs2cs_unknown); + dst->filename = wcsdupucs2(filepath_skippath(src->filename)); + dst->title = wcsdupucs2(src->title ? src->title : dst->filename); + dst->artist = wcsdupucs2(src->artist ? src->artist : wcscs_unknown); + dst->album = wcsdupucs2(src->album ? src->album : wcscs_unknown); + dst->genre = wcsdupucs2(src->genre ? src->genre : wcscs_unknown); dst->rating = src->rating; dst->play_count = src->play_count; dst->recent_play = src->ts_playback; dst->track_number = src->track_number; if (src->date) { - dst->year = ucs2toi(src->date); + dst->year = wtoi(src->date); } dst->filesize = src->filesize; dst->duration = src->duration; @@ -270,17 +270,17 @@ length += ucs2len(src.filename); length += 3; - dst->filename = (ucs2char_t*)ucs2malloc(sizeof(ucs2char_t) * length); + dst->filename = (ucs2char_t*)malloc(sizeof(ucs2char_t) * length); filepath_combinepath(dst->filename, length, path_to_root, src.pathname); filepath_addslash(dst->filename); ucs2cat(dst->filename, src.filename); - dst->title = ucs2dup(src.title); - dst->artist = ucs2dup(src.artist); - dst->album = ucs2dup(src.album); - dst->genre = ucs2dup(src.genre); + dst->title = ucs2dupwcs(src.title); + dst->artist = ucs2dupwcs(src.artist); + dst->album = ucs2dupwcs(src.album); + dst->genre = ucs2dupwcs(src.genre); itoucs2(src.year, tmp, 10); - dst->date = ucs2dup(tmp); + dst->date = ucs2dupwcs(tmp); switch (src.format) { case 0: dst->codec = PMPCODEC_MPEGLAYER3; break; Modified: branches/branch_0.12/lib/pmp_iriverplus2/pmp_iriverplus2.c =================================================================== --- branches/branch_0.12/lib/pmp_iriverplus2/pmp_iriverplus2.c 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/lib/pmp_iriverplus2/pmp_iriverplus2.c 2006-06-25 05:40:52 UTC (rev 67) @@ -118,7 +118,7 @@ static result_t pmp_create_instance_db(pmp_t* pmp, pmpdb_t** ptr_pmpdb); static result_t pmp_create_instance_pl(pmp_t* pmp, pmppl_t** ptr_pmppl); static result_t pmp_is_supported_codec(pmp_t* pmp, uint32_t codec); -static result_t pmp_is_supported_ext(pmp_t* pmp, const ucs2char_t* filename); +static result_t pmp_is_supported_ext(pmp_t* pmp, const wchar_t* filename); static uint32_t pmpdb_add_ref(pmpdb_t* pmpdb); static uint32_t pmpdb_release(pmpdb_t* pmpdb); @@ -130,7 +130,7 @@ static uint32_t pmppl_add_ref(pmppl_t* pmppl); static uint32_t pmppl_release(pmppl_t* pmppl); -static result_t pmppl_write(pmppl_t* pmppl, const ucs2char_t* filename, const ucs2char_t* files[], uint32_t num_files); +static result_t pmppl_write(pmppl_t* pmppl, const wchar_t* filename, const wchar_t* files[], uint32_t num_files); static void set_environment( @@ -290,7 +290,7 @@ return 0; } -PMPIRIVERPLUS2API result_t pmp_create(pmp_t** ptr_pmp, const ucs2char_t* path_to_device, const char *id) +PMPIRIVERPLUS2API result_t pmp_create(pmp_t** ptr_pmp, const wchar_t* path_to_device, const char *id) { result_t ret = 0; pmp_t* pmp = NULL; @@ -539,7 +539,7 @@ return count; } -static result_t pmppl_write(pmppl_t* pmppl, const ucs2char_t* filename, const ucs2char_t* files[], uint32_t num_files) +static result_t pmppl_write(pmppl_t* pmppl, const wchar_t* filename, const wchar_t* files[], uint32_t num_files) { pmppl_internal_t* pmppli = (pmppl_internal_t*)pmppl->instance; pmp_internal_t* pmpi = (pmp_internal_t*)pmppl->pmp->instance; Modified: branches/branch_0.12/pmp.sln =================================================================== --- branches/branch_0.12/pmp.sln 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/pmp.sln 2006-06-25 05:40:52 UTC (rev 67) @@ -46,6 +46,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "easypmp_cui", "frontend\easypmp\cui\easypmp_cui.vcproj", "{FA1F30D4-6100-4379-8506-6CFE023B0AE7}" ProjectSection(ProjectDependencies) = postProject {AA8DA82B-C209-4ABE-ABA1-22352962426D} = {AA8DA82B-C209-4ABE-ABA1-22352962426D} + {59650257-D8E9-4253-827D-8110C3DAAA3D} = {59650257-D8E9-4253-827D-8110C3DAAA3D} {E393575C-6B10-43BD-B2C0-63C5040A49F7} = {E393575C-6B10-43BD-B2C0-63C5040A49F7} {2548F270-FFCF-43B4-BB9D-D5AAD5B5FEF1} = {2548F270-FFCF-43B4-BB9D-D5AAD5B5FEF1} {FA6E7B73-7CF8-47DD-A016-77382A1FD904} = {FA6E7B73-7CF8-47DD-A016-77382A1FD904} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |