From: <ny...@us...> - 2006-06-24 17:30:40
|
Revision: 62 Author: nyaochi Date: 2006-06-24 10:30:18 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=62&view=rev Log Message: ----------- libgmi: migrated from ucs2char_t to wchar_t. Note that libgmi still depends on libucs2 in order to parse WMA and WAV files. Modified Paths: -------------- branches/branch_0.12/include/gmi.h branches/branch_0.12/include/os.h branches/branch_0.12/include/wstring.h branches/branch_0.12/lib/gmi/gmi.c branches/branch_0.12/lib/gmi/gmi_mp3.c branches/branch_0.12/lib/gmi/gmi_vorbis.c branches/branch_0.12/lib/gmi/gmi_wav.c branches/branch_0.12/lib/gmi/gmi_wma.c branches/branch_0.12/lib/wstring/wstring_win32.c branches/branch_0.12/pmp.sln Modified: branches/branch_0.12/include/gmi.h =================================================================== --- branches/branch_0.12/include/gmi.h 2006-06-24 16:49:51 UTC (rev 61) +++ branches/branch_0.12/include/gmi.h 2006-06-24 17:30:18 UTC (rev 62) @@ -54,10 +54,10 @@ GMIAPI int gmi_get( media_info_t* info, - const ucs2char_t *filename, - const ucs2char_t* path_to_music, + const wchar_t *filename, + const wchar_t* path_to_music, int flag, - const ucs2char_t** strip_words, + const wchar_t** strip_words, int num_strip_words ); Modified: branches/branch_0.12/include/os.h =================================================================== --- branches/branch_0.12/include/os.h 2006-06-24 16:49:51 UTC (rev 61) +++ branches/branch_0.12/include/os.h 2006-06-24 17:30:18 UTC (rev 62) @@ -49,6 +49,7 @@ #define getcwd _getcwd #define alloca _alloca #define strnicmp _strnicmp +#define wtoi _wtoi #define PATHCHAR '\\' #define PATHSTR "\\" Modified: branches/branch_0.12/include/wstring.h =================================================================== --- branches/branch_0.12/include/wstring.h 2006-06-24 16:49:51 UTC (rev 61) +++ branches/branch_0.12/include/wstring.h 2006-06-24 17:30:18 UTC (rev 62) @@ -35,6 +35,8 @@ wchar_t *wcsstrip(wchar_t* str); wchar_t *wcsfgets(wchar_t* str, size_t max_bytes, FILE *fp, int is_utf8); +wchar_t* wcsndup(const wchar_t* src, size_t length); +int wcsincmp(const wchar_t* x, const wchar_t* y, size_t n); int has_utf8bom(FILE *fp); Modified: branches/branch_0.12/lib/gmi/gmi.c =================================================================== --- branches/branch_0.12/lib/gmi/gmi.c 2006-06-24 16:49:51 UTC (rev 61) +++ branches/branch_0.12/lib/gmi/gmi.c 2006-06-24 17:30:18 UTC (rev 62) @@ -27,69 +27,70 @@ #endif/*HAVE_CONFIG_H*/ #include <os.h> -#include <ucs2char.h> +#include <wchar.h> +#include <wstring.h> #include <filepath.h> #include <gmi.h> -int gmi_mp3(media_info_t* info, const ucs2char_t *filename); -static const ucs2char_t ucs2cs_ext_mp3[] = {'.','m','p','3',0}; +int gmi_mp3(media_info_t* info, const wchar_t *filename); +static const wchar_t* wcscs_ext_mp3 = L".mp3"; -int gmi_wma(media_info_t* info, const ucs2char_t *filename); -static const ucs2char_t ucs2cs_ext_wma[] = {'.','w','m','a',0}; +int gmi_wma(media_info_t* info, const wchar_t *filename); +static const wchar_t* wcscs_ext_wma = L".wma"; -int gmi_vorbis(media_info_t* info, const ucs2char_t *filename); -static const ucs2char_t ucs2cs_ext_ogg[] = {'.','o','g','g',0}; +int gmi_vorbis(media_info_t* info, const wchar_t *filename); +static const wchar_t* wcscs_ext_ogg = L".ogg"; -int gmi_wav(media_info_t* info, const ucs2char_t *filename); -static const ucs2char_t ucs2cs_ext_wav[] = {'.','w','a','v',0}; +int gmi_wav(media_info_t* info, const wchar_t *filename); +static const wchar_t* wcscs_ext_wav = L".wav"; typedef struct { - int (*func)(media_info_t* info, const ucs2char_t *filename); - const ucs2char_t* ext; + int (*func)(media_info_t* info, const wchar_t *filename); + const wchar_t* ext; } gmi_exports_t; static gmi_exports_t gmi_exports[] = { - {gmi_mp3, ucs2cs_ext_mp3}, - {gmi_wma, ucs2cs_ext_wma}, - {gmi_vorbis, ucs2cs_ext_ogg}, - {gmi_wav, ucs2cs_ext_wav}, + {gmi_mp3, L".mp3"}, + {gmi_wma, L".wma"}, + {gmi_vorbis, L".ogg"}, + {gmi_wav, L".wav"}, {NULL, NULL}, }; static int gmi_get_from_pathname( media_info_t* info, - const ucs2char_t *filename, - const ucs2char_t* path_to_music, + const wchar_t *filename, + const wchar_t* path_to_music, int flag ) { - const ucs2char_t *p = NULL, *q = NULL; - ucs2char_t file[MAX_PATH], path[MAX_PATH]; + const wchar_t *p = NULL, *q = NULL; + wchar_t file[MAX_PATH], path[MAX_PATH]; - ucs2cpy(file, filepath_skippath(filename)); - ucs2cpy(path, filename); + wcscpy(file, filepath_skippath(filename)); + wcscpy(path, filename); filepath_remove_filespec(path); if (flag & GMIF_PARSEMASK) { /* Clear fields according to the type. */ if (flag & GMIF_TITLE) { - ucs2free(info->title); info->title = NULL; + free(info->title); info->title = NULL; } if (flag & GMIF_ALBUM) { - ucs2free(info->album); info->album = NULL; + free(info->album); info->album = NULL; } if (flag & GMIF_GENRE) { - ucs2free(info->genre); info->genre = NULL; + free(info->genre); info->genre = NULL; } if (flag & GMIF_ARTIST) { - ucs2free(info->artist); info->artist = NULL; + free(info->artist); info->artist = NULL; } /* Obtain path name to the music. */ - p = ucs2str(path, path_to_music); + p = wcsstr(path, path_to_music); if (p) { - p += ucs2len(path_to_music); + p += wcslen(path_to_music); } else { p = path; } @@ -98,26 +99,26 @@ if (flag & GMIF_GENRE) { q = filepath_skip_one_directory(p); if (q) { - info->genre = ucs2ndup(p, (q-p) - 1); + info->genre = wcsndup(p, (q-p) - 1); p = q; q = filepath_skip_one_directory(p); if (q) { - info->artist = ucs2ndup(p, (q-p) - 1); + info->artist = wcsndup(p, (q-p) - 1); if (flag & GMIF_ALBUM) { - info->album = ucs2dup(q); + info->album = wcsdup(q); filepath_removeslash(info->album); - filepath_replace_slash(info->album, (ucs2char_t)' '); + filepath_replace_slash(info->album, (wchar_t)' '); } } } } else { q = filepath_skip_one_directory(p); if (q) { - info->artist = ucs2ndup(p, (q-p) - 1); + info->artist = wcsndup(p, (q-p) - 1); if (flag & GMIF_ALBUM) { - info->album = ucs2dup(q); + info->album = wcsdup(q); filepath_removeslash(info->album); - filepath_replace_slash(info->album, (ucs2char_t)' '); + filepath_replace_slash(info->album, (wchar_t)' '); } } } @@ -133,7 +134,7 @@ p++; /* Obtain track number. */ - info->track_number = (uint32_t)ucs2toi(file); + info->track_number = (uint32_t)wtoi(file); if (flag & GMIF_TITLE) { /* Skip space and '_' letters. */ @@ -142,33 +143,33 @@ } /* Obtain track title. */ - info->title = ucs2dup(p); + info->title = wcsdup(p); filepath_remove_extension(info->title); if (!info->title[0]) { /* If track title becomes empty (e.g., 01.mp3), set the filename. */ - ucs2free(info->title); - info->title = ucs2dup(file); + free(info->title); + info->title = wcsdup(file); filepath_remove_extension(info->title); } } } else { /* The filename begins with one numerical letter. */ if (flag & GMIF_TITLE) { - info->title = ucs2dup(file); + info->title = wcsdup(file); filepath_remove_extension(info->title); } } } else { /* The filename does not begin with a numerical letter. */ if (flag & GMIF_TITLE) { - info->title = ucs2dup(file); + info->title = wcsdup(file); filepath_remove_extension(info->title); } } } else { if (flag & GMIF_TITLE) { /* Use filename as a title. */ - info->title = ucs2dup(file); + info->title = wcsdup(file); filepath_remove_extension(info->title); } } @@ -177,10 +178,10 @@ return 0; } -static void strip_head_letters(ucs2char_t* str, size_t offset) +static void strip_head_letters(wchar_t* str, size_t offset) { - if (offset <= ucs2len(str)) { - size_t i, n = ucs2len(str) + 1 - offset; + if (offset <= wcslen(str)) { + size_t i, n = wcslen(str) + 1 - offset; for (i = 0;i < n;++i) { str[i] = str[i+offset]; } @@ -189,10 +190,10 @@ int gmi_get( media_info_t* info, - const ucs2char_t *filename, - const ucs2char_t* path_to_music, + const wchar_t *filename, + const wchar_t* path_to_music, int flag, - const ucs2char_t* strip_words[], + const wchar_t* strip_words[], int num_strip_words ) { @@ -200,8 +201,8 @@ gmi_exports_t* exp = gmi_exports; /* Set the pathname and filename. */ - info->filename = ucs2dup(filename); - info->filesize = ucs2stat_size(filename); + info->filename = wcsdup(filename); + info->filesize = filepath_filesize(filename); if (flag & GMIF_TAG) { while (exp->func) { @@ -223,8 +224,8 @@ if ((flag & GMIF_STRIP_ARTIST) && strip_words) { int i; for (i = 0;i < num_strip_words;++i) { - if (ucs2incmp(info->artist, strip_words[i], ucs2len(strip_words[i])) == 0) { - strip_head_letters(info->artist, ucs2len(strip_words[i])); + if (wcsincmp(info->artist, strip_words[i], wcslen(strip_words[i])) == 0) { + strip_head_letters(info->artist, wcslen(strip_words[i])); break; } } Modified: branches/branch_0.12/lib/gmi/gmi_mp3.c =================================================================== --- branches/branch_0.12/lib/gmi/gmi_mp3.c 2006-06-24 16:49:51 UTC (rev 61) +++ branches/branch_0.12/lib/gmi/gmi_mp3.c 2006-06-24 17:30:18 UTC (rev 62) @@ -33,7 +33,9 @@ #include <string.h> #include <sys/types.h> #include <sys/stat.h> -#include <ucs2char.h> +#include <wchar.h> +#include <wstring.h> +#include <filepath.h> #include <gmi.h> #include <id3tag.h> @@ -201,11 +203,11 @@ return 0; } -static int get_mp3stream_info(mp3header_t* header, const ucs2char_t *filename, uint32_t filesize) +static int get_mp3stream_info(mp3header_t* header, const wchar_t *filename, uint32_t filesize) { int channels = 0; uint8_t buffer[4]; - FILE *fp = ucs2fopen(filename, "rb"); + FILE *fp = filepath_fopen(filename, L"rb"); if (!fp) { return -1; } @@ -268,9 +270,9 @@ } -static ucs2char_t* get_frame_value(struct id3_tag *id3tag, const char *name) +static wchar_t* get_frame_value(struct id3_tag *id3tag, const char *name) { - ucs2char_t* ret = NULL; + wchar_t* ret = NULL; const id3_ucs4_t *value = NULL; struct id3_frame *frame = NULL; union id3_field *field = NULL; @@ -308,30 +310,30 @@ if (encoding == ID3_FIELD_TEXTENCODING_ISO_8859_1) { char *mbs = id3_ucs4_latin1duplicate(value); - ret = mbsdupucs2_music(mbs); /* MBS for music files. */ + ret = mbsdupwcs(mbs); /* MBS for music files. */ free(mbs); return ret; } else { - ucs2char_t* ucs2 = id3_ucs4_utf16duplicate(value); - ret = ucs2dup(ucs2); - free(ucs2); + wchar_t* wcs = id3_ucs4_utf16duplicate(value); + ret = wcsdup(wcs); + free(wcs); return ret; } } -int gmi_mp3(media_info_t* info, const ucs2char_t *filename) +int gmi_mp3(media_info_t* info, const wchar_t *filename) { int i, num_tags = 0; FILE *fp = NULL; mp3header_t mp3header; uint32_t tn = 0; - static const ucs2char_t ucs2_empty[1] = {0}; - ucs2char_t* ucs2 = NULL; + static const wchar_t wcs_empty[1] = {0}; + wchar_t* wcs = NULL; struct id3_file *id3file = NULL; struct id3_tag *id3tag = NULL; /* Open the file with UNICODE filename. This is for better compatibility. */ - fp = ucs2fopen(filename, "rb"); + fp = filepath_fopen(filename, L"rb"); if (!fp) { return -1; } @@ -371,106 +373,106 @@ } /* Obtain track number first. */ - ucs2 = get_frame_value(id3tag, "TRCK"); - if (ucs2 && *ucs2) { - info->track_number = ucs2toi(ucs2); + wcs = get_frame_value(id3tag, "TRCK"); + if (wcs && *wcs) { + info->track_number = wtoi(wcs); } else { info->track_number = 0; } - ucs2free(ucs2); + free(wcs); /* Obtain track title. */ - ucs2 = get_frame_value(id3tag, "TIT2"); - if (ucs2 && *ucs2) { - ucs2free(info->title); - info->title = ucs2dup(ucs2); + wcs = get_frame_value(id3tag, "TIT2"); + if (wcs && *wcs) { + free(info->title); + info->title = wcsdup(wcs); } - ucs2free(ucs2); + free(wcs); /* Set artist field. */ - if (1) ucs2 = get_frame_value(id3tag, "TPE1"); - if (!ucs2) ucs2 = get_frame_value(id3tag, "TPE2"); - if (!ucs2) ucs2 = get_frame_value(id3tag, "TPE3"); - if (!ucs2) ucs2 = get_frame_value(id3tag, "TPE4"); - if (!ucs2) ucs2 = get_frame_value(id3tag, "TCOM"); - if (ucs2 && *ucs2) { - ucs2free(info->artist); - info->artist = ucs2dup(ucs2); + if (1) wcs = get_frame_value(id3tag, "TPE1"); + if (!wcs) wcs = get_frame_value(id3tag, "TPE2"); + if (!wcs) wcs = get_frame_value(id3tag, "TPE3"); + if (!wcs) wcs = get_frame_value(id3tag, "TPE4"); + if (!wcs) wcs = get_frame_value(id3tag, "TCOM"); + if (wcs && *wcs) { + free(info->artist); + info->artist = wcsdup(wcs); } - ucs2free(ucs2); + free(wcs); /* Set composer field. */ - ucs2 = get_frame_value(id3tag, "TCOM"); - if (ucs2 && *ucs2) { - ucs2free(info->composer); - info->composer = ucs2dup(ucs2); + wcs = get_frame_value(id3tag, "TCOM"); + if (wcs && *wcs) { + free(info->composer); + info->composer = wcsdup(wcs); } - ucs2free(ucs2); + free(wcs); /* Set album field. */ - ucs2 = get_frame_value(id3tag, "TALB"); - if (ucs2 && *ucs2) { - ucs2free(info->album); - info->album = ucs2dup(ucs2); + wcs = get_frame_value(id3tag, "TALB"); + if (wcs && *wcs) { + free(info->album); + info->album = wcsdup(wcs); } - ucs2free(ucs2); + free(wcs); /* * TCMP (compilation flag) handling for omnibus albums. * This patch was originally submitted by Espen Matheussen. */ - ucs2 = get_frame_value(id3tag, "TCMP"); - if (ucs2 && *ucs2) { + wcs = get_frame_value(id3tag, "TCMP"); + if (wcs && *wcs) { size_t length = 0; - ucs2char_t* title = NULL; - static ucs2char_t separator[] = {' ','-',' ',0}; + wchar_t* title = NULL; + static wchar_t separator[] = {' ','-',' ',0}; /* Calculate the length of the new title. */ if (info->artist) { - length += ucs2len(info->artist); + length += wcslen(info->artist); } - length += ucs2len(separator); + length += wcslen(separator); if (info->title) { - length += ucs2len(info->title); + length += wcslen(info->title); } /* Construct the new title. */ - title = ucs2malloc(sizeof(ucs2char_t) * (length+1)); + title = (wchar_t*)malloc(sizeof(wchar_t) * (length+1)); if (info->artist) { - ucs2cpy(title, info->artist); + wcscpy(title, info->artist); } - ucs2cat(title, separator); + wcscat(title, separator); if (info->title) { - ucs2cat(title, info->title); + wcscat(title, info->title); } /* Free the previous title and artist. */ - ucs2free(info->title); - ucs2free(info->artist); + free(info->title); + free(info->artist); /* Set the new title and artist. */ info->title = title; - info->artist = mbsdupucs2("Various artists"); + info->artist = mbsdupwcs("Various artists"); } /* Set genre field. */ - ucs2 = get_frame_value(id3tag, "TCON"); - if (ucs2 && *ucs2) { - ucs2free(info->genre); - info->genre = ucs2dup(ucs2); + wcs = get_frame_value(id3tag, "TCON"); + if (wcs && *wcs) { + free(info->genre); + info->genre = wcsdup(wcs); } - ucs2free(ucs2); + free(wcs); /* Set year field. */ - if (1) ucs2 = get_frame_value(id3tag, "TYER"); - if (!ucs2) ucs2 = get_frame_value(id3tag, "TDRC"); - if (ucs2 && *ucs2) { - ucs2free(info->date); - info->date = ucs2dup(ucs2); + if (1) wcs = get_frame_value(id3tag, "TYER"); + if (!wcs) wcs = get_frame_value(id3tag, "TDRC"); + if (wcs && *wcs) { + free(info->date); + info->date = wcsdup(wcs); } else { info->date = 0; } - ucs2free(ucs2); + free(wcs); } /* Parse MPEG audio header. */ Modified: branches/branch_0.12/lib/gmi/gmi_vorbis.c =================================================================== --- branches/branch_0.12/lib/gmi/gmi_vorbis.c 2006-06-24 16:49:51 UTC (rev 61) +++ branches/branch_0.12/lib/gmi/gmi_vorbis.c 2006-06-24 17:30:18 UTC (rev 62) @@ -31,7 +31,9 @@ #include <stdio.h> #include <stdlib.h> #include <memory.h> -#include <ucs2char.h> +#include <wchar.h> +#include <wstring.h> +#include <filepath.h> #include <gmi.h> #include <vorbis/codec.h> @@ -41,7 +43,7 @@ #define strncasecmp strnicmp #endif -int gmi_vorbis(media_info_t* info, const ucs2char_t *filename) +int gmi_vorbis(media_info_t* info, const wchar_t *filename) { int i, ret = 0; long lval = 0; @@ -53,12 +55,12 @@ /* Set the pathname and filename. */ /* - info->filename = ucs2dup(filename); - info->filesize = ucs2stat_size(filename); + info->filename = wcsdup(filename); + info->filesize = wcsstat_size(filename); */ /* Open the target file. */ - fp = ucs2fopen(filename, "rb"); + fp = filepath_fopen(filename, L"rb"); if (!fp) { return -1; } @@ -97,17 +99,17 @@ for (i = 0;i < vc->comments;++i) { const char *fieldvalue = vc->user_comments[i]; if (strncasecmp(fieldvalue, "TITLE=", 6) == 0) { - info->title = utf8dupucs2(fieldvalue+6); + info->title = utf8dupwcs(fieldvalue+6); } else if (strncasecmp(fieldvalue, "ARTIST=", 7) == 0) { - info->artist = utf8dupucs2(fieldvalue+7); + info->artist = utf8dupwcs(fieldvalue+7); } else if (strncasecmp(fieldvalue, "ALBUM=", 6) == 0) { - info->album = utf8dupucs2(fieldvalue+6); + info->album = utf8dupwcs(fieldvalue+6); } else if (strncasecmp(fieldvalue, "GENRE=", 6) == 0) { - info->genre = utf8dupucs2(fieldvalue+6); + info->genre = utf8dupwcs(fieldvalue+6); } else if (strncasecmp(fieldvalue, "TRACKNUMBER=", 12) == 0) { info->track_number = atoi(fieldvalue+12); } else if (strncasecmp(fieldvalue, "DATE=", 5) == 0) { - info->date = utf8dupucs2(fieldvalue+5); + info->date = utf8dupwcs(fieldvalue+5); } } Modified: branches/branch_0.12/lib/gmi/gmi_wav.c =================================================================== --- branches/branch_0.12/lib/gmi/gmi_wav.c 2006-06-24 16:49:51 UTC (rev 61) +++ branches/branch_0.12/lib/gmi/gmi_wav.c 2006-06-24 17:30:18 UTC (rev 62) @@ -102,24 +102,24 @@ switch (ch.id) { case 0x44525049: /* "IPRD" */ - ucs2free(info->album); - info->album = mbsdupucs2_music(buffer); + free(info->album); + info->album = mbsdupwcs(buffer); break; case 0x4D414E49: /* "INAM" */ - ucs2free(info->title); - info->title = mbsdupucs2_music(buffer); + free(info->title); + info->title = mbsdupwcs(buffer); break; case 0x54524149: /* "IART" */ - ucs2free(info->artist); - info->artist = mbsdupucs2_music(buffer); + free(info->artist); + info->artist = mbsdupwcs(buffer); break; case 0x524E4749: /* "IGNR" */ - ucs2free(info->genre); - info->genre = mbsdupucs2_music(buffer); + free(info->genre); + info->genre = mbsdupwcs(buffer); break; case 0x44524349: /* "ICRD" */ - ucs2free(info->date); - info->date = mbsdupucs2_music(buffer); + free(info->date); + info->date = mbsdupwcs(buffer); break; case 0x6974726B: /* "itrk" */ info->track_number = atoi(buffer); @@ -151,7 +151,7 @@ uint16_t channels, sample_bits; /* Open the audio file. */ - fp = ucs2fopen(filename, "rb"); + fp = filepath_fopen(filename, L"rb"); if (!fp) { return -1; } Modified: branches/branch_0.12/lib/gmi/gmi_wma.c =================================================================== --- branches/branch_0.12/lib/gmi/gmi_wma.c 2006-06-24 16:49:51 UTC (rev 61) +++ branches/branch_0.12/lib/gmi/gmi_wma.c 2006-06-24 17:30:18 UTC (rev 62) @@ -31,6 +31,9 @@ #include <stdio.h> #include <stdlib.h> #include <memory.h> +#include <wchar.h> +#include <wstring.h> +#include <filepath.h> #include <ucs2char.h> #include <gmi.h> @@ -157,7 +160,7 @@ FILE *fp = NULL; /* Open the audio file. */ - fp = ucs2fopen(filename, "rb"); + fp = filepath_fopen(filename, L"rb"); if (!fp) { return -1; } @@ -378,6 +381,7 @@ } else if (guid_equals(guid, g_guid_content_description)) { /* Content Description Object (title, artist) */ uint16_t title_bytes, author_bytes; + ucs2char_t* ucs2 = NULL; if (!read_uint16le(&title_bytes, fp)) { goto get_asf_audio_info_error; @@ -391,18 +395,23 @@ /* Release the buffer first to overwrite the information without memory leak. */ free(info->title); - info->title = (ucs2char_t*)malloc(title_bytes+sizeof(ucs2char_t)); - if (!info->title || !read_ucs2le_fixed(info->title, title_bytes/sizeof(ucs2char_t), fp)) { + ucs2 = (ucs2char_t*)malloc(title_bytes+sizeof(ucs2char_t)); + if (!ucs2 || !read_ucs2le_fixed(ucs2, title_bytes/sizeof(ucs2char_t), fp)) { goto get_asf_audio_info_error; } + info->title = ucs2dupwcs(ucs2); + free(ucs2); + ucs2 = NULL; free(info->artist); - info->artist = (ucs2char_t*)malloc(author_bytes+sizeof(ucs2char_t)); - if (!info->artist || !read_ucs2le_fixed(info->artist, author_bytes/sizeof(ucs2char_t), fp)) { + ucs2 = (ucs2char_t*)malloc(author_bytes+sizeof(ucs2char_t)); + if (!ucs2 || !read_ucs2le_fixed(ucs2, author_bytes/sizeof(ucs2char_t), fp)) { goto get_asf_audio_info_error; } + info->artist = ucs2dupwcs(ucs2); + free(ucs2); + ucs2 = NULL; - } else if (guid_equals(guid, g_guid_extended_content_description)) { /* Extended Content Description Object (album, genre, etc.) */ uint16_t j, num_descriptions; @@ -412,6 +421,7 @@ } for (j = 0;j < num_descriptions;j++) { + ucs2char_t* ucs2 = NULL; static const ucs2char_t ucs2cs_wm_albumartist[] = {'w','m','/','a','l','b','u','m','a','r','t','i','s','t',0}; static const ucs2char_t ucs2cs_artist[] = {'a','r','t','i','s','t',0}; static const ucs2char_t ucs2cs_wm_albumtitle[] = {'w','m','/','a','l','b','u','m','t','i','t','l','e',0}; @@ -448,38 +458,53 @@ /* If an artist name was extracted from Content Description, we don't parse wm/albumartist. */ if ((!info->artist || !info->artist[0]) && (ucs2icmp(name, ucs2cs_wm_albumartist) == 0 || ucs2icmp(name, ucs2cs_artist) == 0)) { free(info->artist); - info->artist = (ucs2char_t*)ucs2malloc(value_bytes+sizeof(ucs2char_t)); - if (!info->artist || !read_ucs2le_fixed(info->artist, value_bytes/sizeof(ucs2char_t), fp)) { + ucs2 = (ucs2char_t*)ucs2malloc(value_bytes+sizeof(ucs2char_t)); + if (!ucs2 || !read_ucs2le_fixed(ucs2, value_bytes/sizeof(ucs2char_t), fp)) { goto get_asf_audio_info_error; - } + } + info->artist = ucs2dupwcs(ucs2); + free(ucs2); + ucs2 = NULL; } else if (ucs2icmp(name, ucs2cs_wm_albumtitle) == 0 || ucs2icmp(name, ucs2cs_album) == 0) { free(info->album); - info->album = (ucs2char_t*)ucs2malloc(value_bytes+sizeof(ucs2char_t)); - if (!info->album || !read_ucs2le_fixed(info->album, value_bytes/sizeof(ucs2char_t), fp)) { + ucs2 = (ucs2char_t*)ucs2malloc(value_bytes+sizeof(ucs2char_t)); + if (!ucs2 || !read_ucs2le_fixed(ucs2, value_bytes/sizeof(ucs2char_t), fp)) { goto get_asf_audio_info_error; - } + } + info->album = ucs2dupwcs(ucs2); + free(ucs2); + ucs2 = NULL; } else if (ucs2icmp(name, ucs2cs_wm_genre) == 0 || ucs2icmp(name, ucs2cs_genre) == 0) { free(info->genre); - info->genre = (ucs2char_t*)ucs2malloc(value_bytes+sizeof(ucs2char_t)); - if (!info->genre || !read_ucs2le_fixed(info->genre, value_bytes/sizeof(ucs2char_t), fp)) { + ucs2 = (ucs2char_t*)ucs2malloc(value_bytes+sizeof(ucs2char_t)); + if (!ucs2 || !read_ucs2le_fixed(ucs2, value_bytes/sizeof(ucs2char_t), fp)) { goto get_asf_audio_info_error; } + info->genre = ucs2dupwcs(ucs2); + free(ucs2); + ucs2 = NULL; } else if (ucs2icmp(name, ucs2cs_wm_composer) == 0 || ucs2icmp(name, ucs2cs_composer) == 0) { free(info->composer); - info->composer = (ucs2char_t*)malloc(value_bytes+sizeof(ucs2char_t)); - if (!info->composer || !read_ucs2le_fixed(info->composer, value_bytes/sizeof(ucs2char_t), fp)) { + ucs2 = (ucs2char_t*)malloc(value_bytes+sizeof(ucs2char_t)); + if (!ucs2 || !read_ucs2le_fixed(ucs2, value_bytes/sizeof(ucs2char_t), fp)) { goto get_asf_audio_info_error; } + info->composer = ucs2dupwcs(ucs2); + free(ucs2); + ucs2 = NULL; } else if (ucs2icmp(name, ucs2cs_wm_tracknumber) == 0 || ucs2icmp(name, ucs2cs_tracknumber) == 0) { info->track_number = read_field_as_uint32(value_type, value_bytes, fp); } else if (ucs2icmp(name, ucs2cs_wm_track) == 0) { info->track_number = read_field_as_uint32(value_type, value_bytes, fp) + 1; } else if (ucs2icmp(name, ucs2cs_wm_year) == 0 || ucs2icmp(name, ucs2cs_year) == 0 || ucs2icmp(name, ucs2cs_date) == 0) { free(info->date); - info->date = (ucs2char_t*)ucs2malloc(value_bytes+sizeof(ucs2char_t)); - if (!info->date || !read_ucs2le_fixed(info->date, value_bytes/sizeof(ucs2char_t), fp)) { + ucs2 = (ucs2char_t*)ucs2malloc(value_bytes+sizeof(ucs2char_t)); + if (!ucs2 || !read_ucs2le_fixed(ucs2, value_bytes/sizeof(ucs2char_t), fp)) { goto get_asf_audio_info_error; } + info->date = ucs2dupwcs(ucs2); + free(ucs2); + ucs2 = NULL; } else { if (fseek(fp, value_bytes, SEEK_CUR) != 0) { goto get_asf_audio_info_error; Modified: branches/branch_0.12/lib/wstring/wstring_win32.c =================================================================== --- branches/branch_0.12/lib/wstring/wstring_win32.c 2006-06-24 16:49:51 UTC (rev 61) +++ branches/branch_0.12/lib/wstring/wstring_win32.c 2006-06-24 17:30:18 UTC (rev 62) @@ -31,6 +31,8 @@ #include <wchar.h> #include <string.h> +#define COMP(a, b) ((a)>(b))-((a)<(b)) + char *wcsdupmbs(const wchar_t* src) { size_t dst_size = wcstombs(NULL, src, 0); @@ -232,3 +234,41 @@ } } } + +wchar_t* wcsndup(const wchar_t* src, size_t length) +{ + wchar_t* dst = NULL; + size_t src_length = wcslen(src); + if (length < src_length) { + src_length = length; + } + dst = (wchar_t*)malloc((src_length+1) * sizeof(wchar_t)); + if (dst) { + size_t i; + for (i = 0;i < src_length;i++) { + dst[i] = src[i]; + } + dst[i] = 0; + } + return dst; +} + +int wcsincmp(const wchar_t* x, const wchar_t* y, size_t n) +{ + size_t i; + wchar_t a = 0, b = 0; + + for (i = 0;i < n-1;i++) { + a = towupper(*x); + b = towupper(*y); + if (!*x || !*y || a != b) { + break; + } + x++; + y++; + } + return COMP(a, b); +} + + + Modified: branches/branch_0.12/pmp.sln =================================================================== --- branches/branch_0.12/pmp.sln 2006-06-24 16:49:51 UTC (rev 61) +++ branches/branch_0.12/pmp.sln 2006-06-24 17:30:18 UTC (rev 62) @@ -11,6 +11,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmi", "lib\gmi\gmi.vcproj", "{3575EFC2-9051-467A-BEB4-E71E2F8664D7}" ProjectSection(ProjectDependencies) = postProject {AA8DA82B-C209-4ABE-ABA1-22352962426D} = {AA8DA82B-C209-4ABE-ABA1-22352962426D} + {59650257-D8E9-4253-827D-8110C3DAAA3D} = {59650257-D8E9-4253-827D-8110C3DAAA3D} {FA6E7B73-7CF8-47DD-A016-77382A1FD904} = {FA6E7B73-7CF8-47DD-A016-77382A1FD904} {8BFE7DD6-F825-42BA-A7D7-EFCDCC9D686A} = {8BFE7DD6-F825-42BA-A7D7-EFCDCC9D686A} EndProjectSection This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2006-06-24 17:48:28
|
Revision: 63 Author: nyaochi Date: 2006-06-24 10:48:10 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=63&view=rev Log Message: ----------- libpmp_irivnavi: migrated from ucs2char_t to wchar_t. libplaylist: a small fix. Modified Paths: -------------- branches/branch_0.12/lib/gmi/gmi_wav.c branches/branch_0.12/lib/pmp_irivnavi/irivnavi.c branches/branch_0.12/lib/pmp_irivnavi/irivnavi.h branches/branch_0.12/lib/pmp_irivnavi/playlist.c branches/branch_0.12/lib/pmp_irivnavi/pmp_irivnavi.c branches/branch_0.12/lib/pmp_irivnavi/serialize.c branches/branch_0.12/lib/pmp_irivnavi/serialize.h branches/branch_0.12/pmp.sln Modified: branches/branch_0.12/lib/gmi/gmi_wav.c =================================================================== --- branches/branch_0.12/lib/gmi/gmi_wav.c 2006-06-24 17:30:18 UTC (rev 62) +++ branches/branch_0.12/lib/gmi/gmi_wav.c 2006-06-24 17:48:10 UTC (rev 63) @@ -31,6 +31,8 @@ #include <stdio.h> #include <stdlib.h> #include <memory.h> +#include <wchar.h> +#include <wstring.h> #include <ucs2char.h> #include <gmi.h> Modified: branches/branch_0.12/lib/pmp_irivnavi/irivnavi.c =================================================================== --- branches/branch_0.12/lib/pmp_irivnavi/irivnavi.c 2006-06-24 17:30:18 UTC (rev 62) +++ branches/branch_0.12/lib/pmp_irivnavi/irivnavi.c 2006-06-24 17:48:10 UTC (rev 63) @@ -28,7 +28,7 @@ #include <os.h> #include <stdio.h> #include <stdlib.h> -#include <ucs2char.h> +#include <wchar.h> #include <pmp.h> #include "serialize.h" @@ -41,11 +41,11 @@ void record_finish(record_t* record) { - ucs2free(record->filename); - ucs2free(record->title); - ucs2free(record->artist); - ucs2free(record->album); - ucs2free(record->genre); + free(record->filename); + free(record->title); + free(record->artist); + free(record->album); + free(record->genre); record_init(record); } @@ -93,11 +93,11 @@ if (!is_storing) { record_finish(record); - record->filename = ucs2malloc(filename_size); - record->title = ucs2malloc(title_size); - record->artist = ucs2malloc(artist_size); - record->album = ucs2malloc(album_size); - record->genre = ucs2malloc(genre_size); + record->filename = (char*)malloc(filename_size); + record->title = (char*)malloc(title_size); + record->artist = (char*)malloc(artist_size); + record->album = (char*)malloc(album_size); + record->genre = (char*)malloc(genre_size); } p += serialize_uint8_array(p, (uint8_t*)record->filename, filename_size, is_storing); Modified: branches/branch_0.12/lib/pmp_irivnavi/irivnavi.h =================================================================== --- branches/branch_0.12/lib/pmp_irivnavi/irivnavi.h 2006-06-24 17:30:18 UTC (rev 62) +++ branches/branch_0.12/lib/pmp_irivnavi/irivnavi.h 2006-06-24 17:48:10 UTC (rev 63) @@ -69,10 +69,10 @@ void irivnavi_repr(irivnavi_t* db, FILE *fp, int level); int playlist_write( - const ucs2char_t *filename, - const ucs2char_t *mediafiles[], + const wchar_t *filename, + const wchar_t *mediafiles[], int num_mediafiles, - const ucs2char_t *path_to_root + const wchar_t *path_to_root ); #endif/*__IRIVNAVI_H__*/ Modified: branches/branch_0.12/lib/pmp_irivnavi/playlist.c =================================================================== --- branches/branch_0.12/lib/pmp_irivnavi/playlist.c 2006-06-24 17:30:18 UTC (rev 62) +++ branches/branch_0.12/lib/pmp_irivnavi/playlist.c 2006-06-24 17:48:10 UTC (rev 63) @@ -37,23 +37,23 @@ #include <os.h> #include <stdio.h> #include <stdlib.h> -#include <ucs2char.h> +#include <wchar.h> #include <filepath.h> #include "irivnavi.h" int playlist_write( - const ucs2char_t *filename, - const ucs2char_t *mediafiles[], + const wchar_t *filename, + const wchar_t *mediafiles[], int num_mediafiles, - const ucs2char_t *path_to_root + const wchar_t *path_to_root ) { int i; FILE *fp = NULL; // Open a playlist for writing. - fp = ucs2fopen(filename, "w"); + fp = filepath_fopen(filename, L"w"); if (!fp) { return -1; } @@ -62,12 +62,12 @@ // Skip empty entry just in case. if (mediafiles[i][0]) { char *mbs = NULL; - ucs2char_t filename[MAX_PATH]; - ucs2cpy(filename, filepath_skipdrive(mediafiles[i], path_to_root)); + wchar_t filename[MAX_PATH]; + wcscpy(filename, filepath_skipdrive(mediafiles[i], path_to_root)); filepath_encode(filename); - mbs = ucs2dupmbs(filename); + mbs = wcsdupmbs(filename); fputs(mbs, fp); fputc('\n', fp); } Modified: branches/branch_0.12/lib/pmp_irivnavi/pmp_irivnavi.c =================================================================== --- branches/branch_0.12/lib/pmp_irivnavi/pmp_irivnavi.c 2006-06-24 17:30:18 UTC (rev 62) +++ branches/branch_0.12/lib/pmp_irivnavi/pmp_irivnavi.c 2006-06-24 17:48:10 UTC (rev 63) @@ -27,7 +27,8 @@ #include <os.h> #include <stddef.h> -#include <ucs2char.h> +#include <wchar.h> +#include <wstring.h> #include <filepath.h> #include <pmp.h> #include <pmphelp.h> @@ -46,32 +47,32 @@ MODEL_IRIVER_H300, }; -static const ucs2char_t ucs2cs_music_path[] = +static const wchar_t wcscs_music_path[] = {'M','u','s','i','c',PATHCHAR,0}; -static const ucs2char_t ucs2cs_playlist_path[] = +static const wchar_t wcscs_playlist_path[] = {'P','l','a','y','l','i','s','t','s',PATHCHAR,0}; -static const ucs2char_t ucs2cs_playlist_ext[] = +static const wchar_t wcscs_playlist_ext[] = {'.','m','3','u',0}; -static const ucs2char_t ucs2cs_irivnavi_idb[] = +static const wchar_t wcscs_irivnavi_idb[] = {'i','R','i','v','N','a','v','i','.','i','D','B',0}; -static const ucs2char_t ucs2cs_h100_sys[] = +static const wchar_t wcscs_h100_sys[] = {'H','1','0','0','.','s','y','s',0}; -static const ucs2char_t ucs2cs_h300_sys[] = +static const wchar_t wcscs_h300_sys[] = {'H','3','0','0','.','s','y','s',0}; -static const ucs2char_t ucs2cs_system_h100_sys[] = +static const wchar_t wcscs_system_h100_sys[] = {'S','y','s','t','e','m',PATHCHAR,'H','1','0','0','.','s','y','s',0}; -static const ucs2char_t ucs2cs_system_h300_sys[] = +static const wchar_t wcscs_system_h300_sys[] = {'S','y','s','t','e','m',PATHCHAR,'H','3','0','0','.','s','y','s',0}; #define MODELID_H100 "iriver_h100" #define MODELID_H300 "iriver_h300" typedef struct { - ucs2char_t path_to_root[MAX_PATH]; - ucs2char_t path_to_music[MAX_PATH]; - ucs2char_t path_to_playlist[MAX_PATH]; - ucs2char_t db_filename[MAX_PATH]; - ucs2char_t playlist_ext[MAX_PATH]; + wchar_t path_to_root[MAX_PATH]; + wchar_t path_to_music[MAX_PATH]; + wchar_t path_to_playlist[MAX_PATH]; + wchar_t db_filename[MAX_PATH]; + wchar_t playlist_ext[MAX_PATH]; } irivnavi_environment_t; typedef struct { @@ -84,7 +85,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); @@ -96,15 +97,15 @@ 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); -int exists_sysfile(const ucs2char_t* path_to_device, const ucs2char_t* sysfilename) +int exists_sysfile(const wchar_t* path_to_device, const wchar_t* sysfilename) { - ucs2char_t filename[MAX_PATH]; + wchar_t filename[MAX_PATH]; - ucs2cpy(filename, path_to_device); + wcscpy(filename, path_to_device); filepath_addslash(filename); - ucs2cat(filename, sysfilename); + wcscat(filename, sysfilename); return filepath_file_exists(filename); } @@ -115,7 +116,7 @@ return 0; } -PMPIRIVNAVIAPI result_t pmp_create(pmp_t** ptr_pmp, const ucs2char_t* path_to_device, const char *id) +PMPIRIVNAVIAPI result_t pmp_create(pmp_t** ptr_pmp, const wchar_t* path_to_device, const char *id) { int model = MODEL_NONE; result_t ret = 0; @@ -134,16 +135,16 @@ model = MODEL_IRIVER_H300; } } else { - if (exists_sysfile(path_to_device, ucs2cs_h100_sys)) { + if (exists_sysfile(path_to_device, wcscs_h100_sys)) { model = MODEL_IRIVER_H100; } - if (exists_sysfile(path_to_device, ucs2cs_system_h100_sys)) { + if (exists_sysfile(path_to_device, wcscs_system_h100_sys)) { model = MODEL_IRIVER_H100; } - if (exists_sysfile(path_to_device, ucs2cs_h300_sys)) { + if (exists_sysfile(path_to_device, wcscs_h300_sys)) { model = MODEL_IRIVER_H300; } - if (exists_sysfile(path_to_device, ucs2cs_system_h300_sys)) { + if (exists_sysfile(path_to_device, wcscs_system_h300_sys)) { model = MODEL_IRIVER_H300; } } @@ -176,14 +177,14 @@ pmp->instance = pmpi; // Initialize the internal variables. - ucs2cpy(pmpi->env.path_to_root, path_to_device); - ucs2cpy(pmpi->env.path_to_music, path_to_device); // Force "\Music" directory for now. + wcscpy(pmpi->env.path_to_root, path_to_device); + wcscpy(pmpi->env.path_to_music, path_to_device); // Force "\Music" directory for now. filepath_addslash(pmpi->env.path_to_music); - ucs2cat(pmpi->env.path_to_music, ucs2cs_music_path); - ucs2cpy(pmpi->env.path_to_playlist, path_to_device); // Force "\Playlist" directory for now. + wcscat(pmpi->env.path_to_music, wcscs_music_path); + wcscpy(pmpi->env.path_to_playlist, path_to_device); // Force "\Playlist" directory for now. filepath_addslash(pmpi->env.path_to_playlist); - ucs2cat(pmpi->env.path_to_playlist, ucs2cs_playlist_path); - ucs2cpy(pmpi->env.playlist_ext, ucs2cs_playlist_ext); + wcscat(pmpi->env.path_to_playlist, wcscs_playlist_path); + wcscpy(pmpi->env.playlist_ext, wcscs_playlist_ext); // Set model information. switch (model) { @@ -203,12 +204,12 @@ // Set enviroments. pmpenv = &pmp->env; pmpenv->path_to_root.flag = PMPPEF_SUPPORT | PMPPEF_CONSTANT; - ucs2cpy(pmpenv->path_to_root.path, pmpi->env.path_to_root); + wcscpy(pmpenv->path_to_root.path, pmpi->env.path_to_root); pmpenv->path_to_music.flag = PMPPEF_SUPPORT | PMPPEF_RECURSIVE; - ucs2cpy(pmpenv->path_to_music.path, pmpi->env.path_to_music); + wcscpy(pmpenv->path_to_music.path, pmpi->env.path_to_music); pmpenv->path_to_playlist.flag = PMPPEF_SUPPORT | PMPPEF_RECURSIVE; - ucs2cpy(pmpenv->path_to_playlist.path, pmpi->env.path_to_playlist); - ucs2cpy(pmpenv->playlist_ext, pmpi->env.playlist_ext); + wcscpy(pmpenv->path_to_playlist.path, pmpi->env.path_to_playlist); + wcscpy(pmpenv->playlist_ext, pmpi->env.playlist_ext); pmp->add_ref(pmp); *ptr_pmp = pmp; @@ -239,18 +240,18 @@ ) ? 1 : 0; } -static int pmp_is_supported_ext(pmp_t* pmp, const ucs2char_t* filename) +static int pmp_is_supported_ext(pmp_t* pmp, const wchar_t* filename) { - static const ucs2char_t ucs2cs_mp3[] = {'.','m','p','3',0}; - static const ucs2char_t ucs2cs_ogg[] = {'.','o','g','g',0}; - static const ucs2char_t ucs2cs_wma[] = {'.','w','m','a',0}; - static const ucs2char_t ucs2cs_wav[] = {'.','w','a','v',0}; + static const wchar_t wcscs_mp3[] = {'.','m','p','3',0}; + static const wchar_t wcscs_ogg[] = {'.','o','g','g',0}; + static const wchar_t wcscs_wma[] = {'.','w','m','a',0}; + static const wchar_t wcscs_wav[] = {'.','w','a','v',0}; return ( - filepath_hasext(filename, ucs2cs_mp3) || - filepath_hasext(filename, ucs2cs_ogg) || - filepath_hasext(filename, ucs2cs_wma) || - filepath_hasext(filename, ucs2cs_wav) + filepath_hasext(filename, wcscs_mp3) || + filepath_hasext(filename, wcscs_ogg) || + filepath_hasext(filename, wcscs_wma) || + filepath_hasext(filename, wcscs_wav) ) ? 1 : 0; } @@ -340,15 +341,15 @@ irivnavi_t* db = (irivnavi_t*)pmpdb->instance; result_t ret = 0; FILE *fp = NULL; - ucs2char_t filename[MAX_PATH]; + wchar_t filename[MAX_PATH]; long size = 0; uint8_t *buffer = NULL; // Open a database file in the root directory. - ucs2cpy(filename, pmpdb->pmp->env.path_to_root.path); + wcscpy(filename, pmpdb->pmp->env.path_to_root.path); filepath_addslash(filename); - ucs2cat(filename, ucs2cs_irivnavi_idb); - fp = ucs2fopen(filename, "rb"); + wcscat(filename, wcscs_irivnavi_idb); + fp = filepath_fopen(filename, L"rb"); if (!fp) { return PMPDBE_OPENFORREAD; } @@ -395,15 +396,15 @@ irivnavi_t* db = (irivnavi_t*)pmpdb->instance; result_t ret = 0; FILE *fp = NULL; - ucs2char_t filename[MAX_PATH]; + wchar_t filename[MAX_PATH]; uint8_t *buffer = NULL; // Open a database file in the root directory. - ucs2cpy(filename, pmpdb->pmp->env.path_to_root.path); + wcscpy(filename, pmpdb->pmp->env.path_to_root.path); filepath_addslash(filename); - ucs2cat(filename, ucs2cs_irivnavi_idb); + wcscat(filename, wcscs_irivnavi_idb); filepath_removefile(filename); - fp = ucs2fopen(filename, "wb"); + fp = filepath_fopen(filename, L"wb"); if (!fp) { return PMPDBE_OPENFORREAD; } @@ -441,8 +442,8 @@ irivnavi_t* db = (irivnavi_t*)pmpdb->instance; result_t ret = 0; uint32_t i, j, n = 0; - static const ucs2char_t ucs2cs_unknown[] = {'u','n','k','n','o','w','n',0}; - const ucs2char_t* path_to_root = pmpdb->pmp->env.path_to_root.path; + static const wchar_t wcscs_unknown[] = {'u','n','k','n','o','w','n',0}; + const wchar_t* path_to_root = pmpdb->pmp->env.path_to_root.path; // Clear the database. irivnavi_finish(db); @@ -473,11 +474,11 @@ // Set record fields. record_init(dst); - dst->filename = ucs2dupmbs(filepath_skipdrive(src->filename, path_to_root)); - dst->title = src->title ? ucs2dupmbs(src->title) : ucs2dupmbs(filepath_skippath(src->filename));; - dst->artist = ucs2dupmbs(src->artist ? src->artist : ucs2cs_unknown); - dst->album = ucs2dupmbs(src->album ? src->album : ucs2cs_unknown); - dst->genre = ucs2dupmbs(src->genre ? src->genre : ucs2cs_unknown); + dst->filename = wcsdupmbs(filepath_skipdrive(src->filename, path_to_root)); + dst->title = src->title ? wcsdupmbs(src->title) : wcsdupmbs(filepath_skippath(src->filename));; + dst->artist = wcsdupmbs(src->artist ? src->artist : wcscs_unknown); + dst->album = wcsdupmbs(src->album ? src->album : wcscs_unknown); + dst->genre = wcsdupmbs(src->genre ? src->genre : wcscs_unknown); dst->timestamp = src->ts_update; ++j; @@ -493,11 +494,11 @@ irivnavi_t* db = (irivnavi_t*)pmpdb->instance; result_t ret = 0; uint32_t i, j, n = db->num_records; - const ucs2char_t* path_to_root = pmpdb->pmp->env.path_to_root.path; - static const ucs2char_t ucs2cs_mp3[] = {'.','m','p','3',0}; - static const ucs2char_t ucs2cs_ogg[] = {'.','o','g','g',0}; - static const ucs2char_t ucs2cs_wma[] = {'.','w','m','a',0}; - static const ucs2char_t ucs2cs_wav[] = {'.','w','a','v',0}; + const wchar_t* path_to_root = pmpdb->pmp->env.path_to_root.path; + static const wchar_t wcscs_mp3[] = {'.','m','p','3',0}; + static const wchar_t wcscs_ogg[] = {'.','o','g','g',0}; + static const wchar_t wcscs_wma[] = {'.','w','m','a',0}; + static const wchar_t wcscs_wav[] = {'.','w','a','v',0}; if (!records) { *num_records = n; @@ -511,38 +512,38 @@ for (i = 0, j = 0;i < n;++i) { size_t length = 0; - ucs2char_t* tmp = NULL; + wchar_t* tmp = NULL; const record_t* src = &db->records[i]; pmp_record_t* dst = &records[j]; pmp_record_init(dst); - tmp = mbsdupucs2(src->filename); - length = ucs2len(path_to_root); - length += ucs2len(tmp); + tmp = mbsdupwcs(src->filename); + length = wcslen(path_to_root); + length += wcslen(tmp); length += 3; - dst->filename = ucs2malloc(sizeof(ucs2char_t) * length); + dst->filename = malloc(sizeof(wchar_t) * length); filepath_combinepath(dst->filename, length, path_to_root, tmp); - dst->title = mbsdupucs2(src->title); - dst->artist = mbsdupucs2(src->artist); - dst->album = mbsdupucs2(src->album); - dst->genre = mbsdupucs2(src->genre); + dst->title = mbsdupwcs(src->title); + dst->artist = mbsdupwcs(src->artist); + dst->album = mbsdupwcs(src->album); + dst->genre = mbsdupwcs(src->genre); // Set codec information according to the file extensions. - if (filepath_hasext(dst->filename, ucs2cs_mp3)) { + if (filepath_hasext(dst->filename, wcscs_mp3)) { dst->codec = PMPCODEC_MPEGLAYER3; - } else if (filepath_hasext(dst->filename, ucs2cs_ogg)) { + } else if (filepath_hasext(dst->filename, wcscs_ogg)) { dst->codec = PMPCODEC_VORBIS; - } else if (filepath_hasext(dst->filename, ucs2cs_wma)) { + } else if (filepath_hasext(dst->filename, wcscs_wma)) { dst->codec = PMPCODEC_WMA; - } else if (filepath_hasext(dst->filename, ucs2cs_wav)) { + } else if (filepath_hasext(dst->filename, wcscs_wav)) { dst->codec = PMPCODEC_WAV; } dst->ts_update = src->timestamp; - ucs2free(tmp); + free(tmp); ++j; } @@ -576,7 +577,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) { pmp_internal_t* pmpi = (pmp_internal_t*)pmppl->pmp->instance; if (playlist_write(filename, files, num_files, pmpi->env.path_to_root) != 0) { Modified: branches/branch_0.12/lib/pmp_irivnavi/serialize.c =================================================================== --- branches/branch_0.12/lib/pmp_irivnavi/serialize.c 2006-06-24 17:30:18 UTC (rev 62) +++ branches/branch_0.12/lib/pmp_irivnavi/serialize.c 2006-06-24 17:48:10 UTC (rev 63) @@ -27,7 +27,7 @@ #include <os.h> #include <stddef.h> -#include <ucs2char.h> +#include <wchar.h> #include "serialize.h" @@ -101,54 +101,3 @@ } return sizeof(uint32_t); } - -size_t serialize_ucs2be(uint8_t* buffer, ucs2char_t* value, int is_storing) -{ - serialize_uint16be(buffer, (uint16_t*)value, is_storing); - return sizeof(ucs2char_t); -} - -size_t serialize_ucs2be_string_fixed(uint8_t* buffer, ucs2char_t* str, size_t length, int is_storing) -{ - size_t i; - for (i = 0;i < length;i++) { - serialize_ucs2be(buffer, str, is_storing); - buffer += sizeof(ucs2char_t); - ++str; - } - return length; -} - -size_t serialize_ucs2be_string_var(uint8_t* buffer, ucs2char_t* str, int is_storing) -{ - size_t length = 0; - while (serialize_ucs2be(buffer, str, is_storing), *str) { - ++length; - ++str; - buffer += sizeof(ucs2char_t); - } - return length; -} - -size_t serialize_ucs2be_string_var_alloc(uint8_t* buffer, ucs2char_t** str) -{ - ucs2char_t c; - size_t length = 0; - uint8_t* p = buffer; - - /* Measure the length of the string. */ - while (serialize_ucs2be(p, &c, 0), c) { - ++length; - p += sizeof(ucs2char_t); - } - - /* Allocate a string buffer. */ - ucs2free(*str); - *str = ucs2malloc(sizeof(ucs2char_t) * (length+1)); - memset(*str, 0, sizeof(ucs2char_t) * (length+1)); - - /* Read the string. */ - serialize_ucs2be_string_fixed(buffer, *str, length, 0); - - return length; -} Modified: branches/branch_0.12/lib/pmp_irivnavi/serialize.h =================================================================== --- branches/branch_0.12/lib/pmp_irivnavi/serialize.h 2006-06-24 17:30:18 UTC (rev 62) +++ branches/branch_0.12/lib/pmp_irivnavi/serialize.h 2006-06-24 17:48:10 UTC (rev 63) @@ -30,9 +30,5 @@ size_t serialize_uint32le(uint8_t* buffer, uint32_t* value, int is_storing); size_t serialize_uint16be(uint8_t* buffer, uint16_t* value, int is_storing); size_t serialize_uint32be(uint8_t* buffer, uint32_t* value, int is_storing); -size_t serialize_ucs2be(uint8_t* buffer, ucs2char_t* value, int is_storing); -size_t serialize_ucs2be_string_fixed(uint8_t* buffer, ucs2char_t* str, size_t length, int is_storing); -size_t serialize_ucs2be_string_var(uint8_t* buffer, ucs2char_t* str, int is_storing); -size_t serialize_ucs2be_string_var_alloc(uint8_t* buffer, ucs2char_t** str); #endif/*__IP2DB_SERIALIZE_H__*/ Modified: branches/branch_0.12/pmp.sln =================================================================== --- branches/branch_0.12/pmp.sln 2006-06-24 17:30:18 UTC (rev 62) +++ branches/branch_0.12/pmp.sln 2006-06-24 17:48:10 UTC (rev 63) @@ -25,6 +25,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmp_irivnavi", "lib\pmp_irivnavi\pmp_irivnavi.vcproj", "{2548F270-FFCF-43B4-BB9D-D5AAD5B5FEF1}" ProjectSection(ProjectDependencies) = postProject {AA8DA82B-C209-4ABE-ABA1-22352962426D} = {AA8DA82B-C209-4ABE-ABA1-22352962426D} + {59650257-D8E9-4253-827D-8110C3DAAA3D} = {59650257-D8E9-4253-827D-8110C3DAAA3D} {FA6E7B73-7CF8-47DD-A016-77382A1FD904} = {FA6E7B73-7CF8-47DD-A016-77382A1FD904} {8BFE7DD6-F825-42BA-A7D7-EFCDCC9D686A} = {8BFE7DD6-F825-42BA-A7D7-EFCDCC9D686A} EndProjectSection This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <ny...@us...> - 2006-06-25 06:11:04
|
Revision: 69 Author: nyaochi Date: 2006-06-24 23:10:55 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=69&view=rev Log Message: ----------- Added Makefile.am for libwstring Modified Paths: -------------- branches/branch_0.12/Makefile.am Added Paths: ----------- branches/branch_0.12/lib/wstring/Makefile.am Modified: branches/branch_0.12/Makefile.am =================================================================== --- branches/branch_0.12/Makefile.am 2006-06-25 06:06:43 UTC (rev 68) +++ branches/branch_0.12/Makefile.am 2006-06-25 06:10:55 UTC (rev 69) @@ -1,6 +1,6 @@ # $Id$ -SUBDIRS = m4 libltdl lib/ucs2 lib/filepath lib/gmi lib/playlist lib/pmp lib/pmp_irivnavi lib/pmp_portalplayer1 lib/pmp_iriverplus2 frontend/easypmp/cui +SUBDIRS = m4 libltdl lib/wstring lib/ucs2 lib/filepath lib/gmi lib/playlist lib/pmp lib/pmp_irivnavi lib/pmp_portalplayer1 lib/pmp_iriverplus2 frontend/easypmp/cui docdir = $(prefix)/share/doc/@PACKAGE@ doc_DATA = README INSTALL COPYING AUTHORS ChangeLog Added: branches/branch_0.12/lib/wstring/Makefile.am =================================================================== --- branches/branch_0.12/lib/wstring/Makefile.am (rev 0) +++ branches/branch_0.12/lib/wstring/Makefile.am 2006-06-25 06:10:55 UTC (rev 69) @@ -0,0 +1,13 @@ +# $Id$ + +noinst_LTLIBRARIES = libwstring.la + +libwstring_la_SOURCES = \ + ../../include/wstring.h \ + wstring.c \ + wstring_iconv.c + +libwstring_la_LDFLAGS = @ICONV_LIBS@ -no-undefined + +AM_CFLAGS = @CFLAGS@ +INCLUDES = @INCLUDES@ Property changes on: branches/branch_0.12/lib/wstring/Makefile.am ___________________________________________________________________ Name: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2006-06-28 03:56:18
|
Revision: 73 Author: nyaochi Date: 2006-06-27 20:56:06 -0700 (Tue, 27 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=73&view=rev Log Message: ----------- Supported YH-920. Modified Paths: -------------- branches/branch_0.12/lib/pmp_portalplayer1/hdr_template.h branches/branch_0.12/pmp.sln trunk/lib/pmp_portalplayer1/model_samsung.c trunk/lib/pmp_portalplayer1/pmp_portalplayer1.c Modified: branches/branch_0.12/lib/pmp_portalplayer1/hdr_template.h =================================================================== --- branches/branch_0.12/lib/pmp_portalplayer1/hdr_template.h 2006-06-25 19:52:44 UTC (rev 72) +++ branches/branch_0.12/lib/pmp_portalplayer1/hdr_template.h 2006-06-28 03:56:06 UTC (rev 73) @@ -67,6 +67,7 @@ int hdr_init_medion_mdjuke220(hdr_t* hdr); int hdr_init_medion_mdjuke440(hdr_t* hdr); int hdr_init_samsung_yh820(hdr_t* hdr); +int hdr_init_samsung_yh920(hdr_t* hdr); int hdr_init_samsung_yh925(hdr_t* hdr); int hdr_init_sirius_s50(hdr_t* hdr); Modified: branches/branch_0.12/pmp.sln =================================================================== --- branches/branch_0.12/pmp.sln 2006-06-25 19:52:44 UTC (rev 72) +++ branches/branch_0.12/pmp.sln 2006-06-28 03:56:06 UTC (rev 73) @@ -11,7 +11,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmi", "lib\gmi\gmi.vcproj", "{3575EFC2-9051-467A-BEB4-E71E2F8664D7}" ProjectSection(ProjectDependencies) = postProject {AA8DA82B-C209-4ABE-ABA1-22352962426D} = {AA8DA82B-C209-4ABE-ABA1-22352962426D} - {59650257-D8E9-4253-827D-8110C3DAAA3D} = {59650257-D8E9-4253-827D-8110C3DAAA3D} {FA6E7B73-7CF8-47DD-A016-77382A1FD904} = {FA6E7B73-7CF8-47DD-A016-77382A1FD904} {8BFE7DD6-F825-42BA-A7D7-EFCDCC9D686A} = {8BFE7DD6-F825-42BA-A7D7-EFCDCC9D686A} EndProjectSection @@ -25,7 +24,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmp_irivnavi", "lib\pmp_irivnavi\pmp_irivnavi.vcproj", "{2548F270-FFCF-43B4-BB9D-D5AAD5B5FEF1}" ProjectSection(ProjectDependencies) = postProject {AA8DA82B-C209-4ABE-ABA1-22352962426D} = {AA8DA82B-C209-4ABE-ABA1-22352962426D} - {59650257-D8E9-4253-827D-8110C3DAAA3D} = {59650257-D8E9-4253-827D-8110C3DAAA3D} {FA6E7B73-7CF8-47DD-A016-77382A1FD904} = {FA6E7B73-7CF8-47DD-A016-77382A1FD904} {8BFE7DD6-F825-42BA-A7D7-EFCDCC9D686A} = {8BFE7DD6-F825-42BA-A7D7-EFCDCC9D686A} EndProjectSection @@ -40,13 +38,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "playlist", "lib\playlist\playlist.vcproj", "{3419FA86-F518-4D3B-94C6-B05436439102}" ProjectSection(ProjectDependencies) = postProject {AA8DA82B-C209-4ABE-ABA1-22352962426D} = {AA8DA82B-C209-4ABE-ABA1-22352962426D} - {59650257-D8E9-4253-827D-8110C3DAAA3D} = {59650257-D8E9-4253-827D-8110C3DAAA3D} + {FA6E7B73-7CF8-47DD-A016-77382A1FD904} = {FA6E7B73-7CF8-47DD-A016-77382A1FD904} EndProjectSection EndProject 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} @@ -83,10 +80,6 @@ {8BFE7DD6-F825-42BA-A7D7-EFCDCC9D686A} = {8BFE7DD6-F825-42BA-A7D7-EFCDCC9D686A} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wstring", "lib\wstring\wstring.vcproj", "{59650257-D8E9-4253-827D-8110C3DAAA3D}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug @@ -137,10 +130,6 @@ {E173B48E-95A6-4B16-9A27-57F168C93355}.Debug.Build.0 = Debug|Win32 {E173B48E-95A6-4B16-9A27-57F168C93355}.Release.ActiveCfg = Release|Win32 {E173B48E-95A6-4B16-9A27-57F168C93355}.Release.Build.0 = Release|Win32 - {59650257-D8E9-4253-827D-8110C3DAAA3D}.Debug.ActiveCfg = Debug|Win32 - {59650257-D8E9-4253-827D-8110C3DAAA3D}.Debug.Build.0 = Debug|Win32 - {59650257-D8E9-4253-827D-8110C3DAAA3D}.Release.ActiveCfg = Release|Win32 - {59650257-D8E9-4253-827D-8110C3DAAA3D}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection Modified: trunk/lib/pmp_portalplayer1/model_samsung.c =================================================================== --- trunk/lib/pmp_portalplayer1/model_samsung.c 2006-06-25 19:52:44 UTC (rev 72) +++ trunk/lib/pmp_portalplayer1/model_samsung.c 2006-06-28 03:56:06 UTC (rev 73) @@ -251,6 +251,15 @@ {251956, 18, 6000, 1032, 0, samsung_dat_repr, samsung_dat_set, samsung_dat_get}, }; +/********** Samsung YH-920 firmware 1.61 **********/ +static hdr_template_t hdrtmpl_samsung_yh920 = { + 0, 0, "System\\DATA\\PP5000.DAT", 1, "System\\DATA\\PP5000.HDR", 0x00000428, 0, 0, 18, + hdrtmpl_fd_samsung, + hdrtmpl_max_dat_field_size_samsung, + 0, 0, + {251956, 18, 6000, 1032, 0, samsung_dat_repr, samsung_dat_set, samsung_dat_get}, +}; + /********** Samsung YH-925 firmware 1.61 **********/ static hdr_template_t hdrtmpl_samsung_yh925 = { 0, 0, "System\\DATA\\PP5000.DAT", 1, "System\\DATA\\PP5000.HDR", 0x00000428, 0, 0, 18, @@ -265,6 +274,11 @@ return apply_template(hdr, &hdrtmpl_samsung_yh820); } +int hdr_init_samsung_yh920(hdr_t* hdr) +{ + return apply_template(hdr, &hdrtmpl_samsung_yh920); +} + int hdr_init_samsung_yh925(hdr_t* hdr) { return apply_template(hdr, &hdrtmpl_samsung_yh925); Modified: trunk/lib/pmp_portalplayer1/pmp_portalplayer1.c =================================================================== --- trunk/lib/pmp_portalplayer1/pmp_portalplayer1.c 2006-06-25 19:52:44 UTC (rev 72) +++ trunk/lib/pmp_portalplayer1/pmp_portalplayer1.c 2006-06-28 03:56:06 UTC (rev 73) @@ -149,6 +149,14 @@ hdr_init_samsung_yh820, samsung_parse_model }, { + "samsung_yh920", "Samsung YH-920", + 20, "UM", + "5.15", "5.15", + "SYSTEM\\FW_YH920.mi4", "System\\DATA\\PP5000.HDR", "System\\MUSIC\\", "System\\PLAYLIST\\", + ".plp", + hdr_init_samsung_yh920, samsung_parse_model + }, + { "samsung_yh925", "Samsung YH-925", 5, "UM", "1.61", "1.61", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |