From: <ny...@us...> - 2006-06-01 12:48:39
|
Revision: 16 Author: nyaochi Date: 2006-06-01 05:48:00 -0700 (Thu, 01 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=16&view=rev Log Message: ----------- A number of patches while I was away from the Internet connection. - EasyPMP 0.10 alpha release. - Rework on the interface for obtaining/setting player's environment. - Fundamental work for skipping "the" in the artist field. Modified Paths: -------------- trunk/README trunk/frontend/easypmp/common/database.c trunk/frontend/easypmp/common/easypmp.h trunk/frontend/easypmp/common/enumerate.c trunk/frontend/easypmp/common/playlist.c trunk/frontend/easypmp/cui/device.c trunk/frontend/easypmp/cui/main.c trunk/frontend/easypmp/cui/option.c trunk/frontend/easypmp/win32gui/easypmp_win32gui.rc trunk/include/gmi.h trunk/include/pmp.h trunk/include/ucs2char.h trunk/lib/gmi/gmi.c trunk/lib/pmp_iriverplus2/playlist.c trunk/lib/pmp_iriverplus2/pmp_iriverplus2.c trunk/lib/pmp_irivnavi/pmp_irivnavi.c trunk/lib/pmp_portalplayer1/pmp_portalplayer1.c trunk/lib/ucs2/ucs2char.c Modified: trunk/README =================================================================== --- trunk/README 2006-05-06 04:57:28 UTC (rev 15) +++ trunk/README 2006-06-01 12:48:00 UTC (rev 16) @@ -1,5 +1,5 @@ PMPLib - Version 0.9 + Version 0.10 http://pmplib.sourceforge.net/ Copyright (c) 2005-2006 by Nyaochi Modified: trunk/frontend/easypmp/common/database.c =================================================================== --- trunk/frontend/easypmp/common/database.c 2006-05-06 04:57:28 UTC (rev 15) +++ trunk/frontend/easypmp/common/database.c 2006-06-01 12:48:00 UTC (rev 16) @@ -186,7 +186,14 @@ // If we are not skipping this file, obtain the media information. if (!is_skipping) { - if (gmi_get(record, filename, pmp->env.path_to_music, opt->media_info_source) == 0) { + if (gmi_get( + record, + filename, + pmp->env.path_to_music.path, + opt->media_info_source, + opt->strip_words, + opt->num_strip_words + ) == 0) { ++num_obtained; } else { } Modified: trunk/frontend/easypmp/common/easypmp.h =================================================================== --- trunk/frontend/easypmp/common/easypmp.h 2006-05-06 04:57:28 UTC (rev 15) +++ trunk/frontend/easypmp/common/easypmp.h 2006-06-01 12:48:00 UTC (rev 16) @@ -89,6 +89,8 @@ char model[128]; char *system_encoding; char *music_encoding; + ucs2char_t** strip_words; + int num_strip_words; } option_t; typedef struct { Modified: trunk/frontend/easypmp/common/enumerate.c =================================================================== --- trunk/frontend/easypmp/common/enumerate.c 2006-05-06 04:57:28 UTC (rev 15) +++ trunk/frontend/easypmp/common/enumerate.c 2006-06-01 12:48:00 UTC (rev 16) @@ -101,7 +101,12 @@ ed.proc = proc; ed.instance = instance; - return find_file(pmp->env.path_to_music, 1, found_music_file, &ed); + return find_file( + pmp->env.path_to_music.path, + pmp->env.path_to_music.flag & PMPPEF_RECURSIVE ? 1 : 0, + found_music_file, + &ed + ); } static int found_playlist_file(void *instance, const ucs2char_t* found_path, const ucs2char_t* found_file) @@ -164,10 +169,20 @@ ed.instance = instance; if (opt->verb & MODE_PLAYLIST_PLAYLIST) { - ret = find_file(pmp->env.path_to_playlist, 0, found_playlist_file, &ed); + ret = find_file( + pmp->env.path_to_playlist.path, + pmp->env.path_to_playlist.flag & PMPPEF_RECURSIVE ? 1 : 0, + found_playlist_file, + &ed + ); } if (opt->verb & MODE_PLAYLIST_MUSIC) { - ret = find_file(pmp->env.path_to_music, 1, found_playlist_file, &ed); + ret = find_file( + pmp->env.path_to_music.path, + pmp->env.path_to_music.flag & PMPPEF_RECURSIVE ? 1 : 0, + found_playlist_file, + &ed + ); } return ret; } Modified: trunk/frontend/easypmp/common/playlist.c =================================================================== --- trunk/frontend/easypmp/common/playlist.c 2006-05-06 04:57:28 UTC (rev 15) +++ trunk/frontend/easypmp/common/playlist.c 2006-06-01 12:48:00 UTC (rev 16) @@ -151,7 +151,7 @@ ucs2char_t dst[MAX_PATH]; // Generate a destination filename. - filepath_combinepath(dst, MAX_PATH, pmp->env.path_to_playlist, filepath_skippath(pl->name)); + 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); @@ -175,7 +175,7 @@ n = playlist_normalize( pl, filepath_skippath(pl->name), - pmp->env.path_to_root, + pmp->env.path_to_root.path, mediafiles, musics->num_elements ); Modified: trunk/frontend/easypmp/cui/device.c =================================================================== --- trunk/frontend/easypmp/cui/device.c 2006-05-06 04:57:28 UTC (rev 15) +++ trunk/frontend/easypmp/cui/device.c 2006-06-01 12:48:00 UTC (rev 16) @@ -36,19 +36,26 @@ #include "util.h" -void device_show_information(pmp_t* pmp, FILE *fpe) +static void device_show_pathflag(int flag, FILE* fp) { - fprintf(fpe, "Device identifier: %s\n", pmp->env.id); - fprintf(fpe, " Product name: %s\n", pmp->env.name); - fprintf(fpe, " Firmware mode: %s\n", pmp->env.mode); - fprintf(fpe, " Firmware version: %s\n", pmp->env.version); - fprintf(fpe, " Default language: %s\n", pmp->env.language); - fprints(fpe, " Root directory: %s\n", pmp->env.path_to_root); - fprints(fpe, " Music directory: %s\n", pmp->env.path_to_music); - fprints(fpe, " Playlist directory: %s\n", pmp->env.path_to_playlist); - fprints(fpe, " Playlist extension: %s\n", pmp->env.playlist_ext); + if (flag & PMPPEF_RECURSIVE) { + fprintf(fp, " sub_directory=yes"); + } } +void device_show_information(pmp_t* pmp, FILE *fp) +{ + fprintf(fp, "Device identifier: %s\n", pmp->env.id); + fprintf(fp, " Product name: %s\n", pmp->env.name); + fprintf(fp, " Firmware mode: %s\n", pmp->env.mode); + fprintf(fp, " Firmware version: %s\n", pmp->env.version); + fprintf(fp, " Default language: %s\n", pmp->env.language); + fprints(fp, " Root directory: %s\n", pmp->env.path_to_root.path); + fprints(fp, " Music directory: %s\n", pmp->env.path_to_music.path); + fprints(fp, " Playlist directory: %s\n", pmp->env.path_to_playlist.path); + fprints(fp, " Playlist extension: %s\n", pmp->env.playlist_ext); +} + static void enumerate_devid_callback(void *instance, const char *devid) { pmphelp_t *pmphelp = (pmphelp_t*)instance; Modified: trunk/frontend/easypmp/cui/main.c =================================================================== --- trunk/frontend/easypmp/cui/main.c 2006-05-06 04:57:28 UTC (rev 15) +++ trunk/frontend/easypmp/cui/main.c 2006-06-01 12:48:00 UTC (rev 16) @@ -49,7 +49,7 @@ #endif #define APPLICATION_S "EasyPMP [CUI]" -#define VERSION_S "0.9 alpha" +#define VERSION_S "0.10 alpha" #define COPYRIGHT_S "Copyright (c) 2005-2006 Nyaochi" int database_dump(pmp_t* pmp, FILE *fpo, int level); Modified: trunk/frontend/easypmp/cui/option.c =================================================================== --- trunk/frontend/easypmp/cui/option.c 2006-05-06 04:57:28 UTC (rev 15) +++ trunk/frontend/easypmp/cui/option.c 2006-06-01 12:48:00 UTC (rev 16) @@ -91,13 +91,54 @@ fprintf(fp, " -h, --help Show this help message and exit\n"); } +static void set_strip_words(option_t* opt, const char *str) +{ + size_t i; + const char *p = 0, *q = 0; + + for (i = 0;i < opt->num_strip_words;++i) { + ucs2free(opt->strip_words[i]); + } + ucs2free(opt->strip_words); + + if (str && *str) { + opt->num_strip_words = 1; + for (p = str;*p;++p) { + if (*p == ',') { + opt->num_strip_words++; + } + } + + p = q = str; + opt->strip_words = (ucs2char_t**)ucs2malloc(sizeof(ucs2char_t*) * opt->num_strip_words); + for (i = 0;i < opt->num_strip_words;++i) { + opt->strip_words[i] = 0; + for (;;) { + if (*q == ',' || !*q) { + size_t length = mbstoucs2(0, 0, p, q-p); + opt->strip_words[i] = ucs2malloc(sizeof(ucs2char_t*) * length + 1); + mbstoucs2(opt->strip_words[i], length, p, q-p); + opt->strip_words[i][length] = 0; + if (!*q) { + break; + } else { + p = q+1; + } + } + q++; + } + } + } +} + int option_parse(option_t* opt, int argc, char *argv[], FILE *fpe) { int used_args = 0; memset(opt, 0, sizeof(*opt)); - opt->media_info_source |= GMIF_TAG; + opt->media_info_source |= (GMIF_TAG | GMIF_STRIP_ARTIST); + set_strip_words(opt, "the "); /* Parse the command-line arguments. */ for (;;) { Modified: trunk/frontend/easypmp/win32gui/easypmp_win32gui.rc =================================================================== --- trunk/frontend/easypmp/win32gui/easypmp_win32gui.rc 2006-05-06 04:57:28 UTC (rev 15) +++ trunk/frontend/easypmp/win32gui/easypmp_win32gui.rc 2006-06-01 12:48:00 UTC (rev 16) @@ -213,8 +213,8 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,0,2 - PRODUCTVERSION 0,9,0,2 + FILEVERSION 0,11,0,2 + PRODUCTVERSION 0,11,0,2 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -230,12 +230,12 @@ BLOCK "040904b0" BEGIN VALUE "FileDescription", "EasyPMP [Win32 GUI] application" - VALUE "FileVersion", "0, 9, 0, 2" + VALUE "FileVersion", "0, 11, 0, 2" VALUE "InternalName", "easypmp_win32gui" VALUE "LegalCopyright", "Copyright 2005-2006 Nyaochi" VALUE "OriginalFilename", "easypmp_win32gui.exe" VALUE "ProductName", "EasyPMP [Win32 GUI]" - VALUE "ProductVersion", "0, 9, 0, 2" + VALUE "ProductVersion", "0, 11, 0, 2" END END BLOCK "VarFileInfo" Modified: trunk/include/gmi.h =================================================================== --- trunk/include/gmi.h 2006-05-06 04:57:28 UTC (rev 15) +++ trunk/include/gmi.h 2006-06-01 12:48:00 UTC (rev 16) @@ -40,6 +40,7 @@ enum { GMIF_NONE = 0x00000000, GMIF_TAG = 0x00000001, + GMIF_STRIP_ARTIST = 0x00000010, GMIF_GENRE = 0x00010000, GMIF_ARTIST = 0x00020000, GMIF_ALBUM = 0x00040000, @@ -51,7 +52,14 @@ #define media_info_t pmp_record_t #define gmi_finish pmp_record_finish -GMIAPI int gmi_get(media_info_t* info, const ucs2char_t *filename, const ucs2char_t* path_to_music, int flag); +GMIAPI int gmi_get( + media_info_t* info, + const ucs2char_t *filename, + const ucs2char_t* path_to_music, + int flag, + const ucs2char_t* strip_words[], + int num_strip_words + ); #ifdef __cplusplus } Modified: trunk/include/pmp.h =================================================================== --- trunk/include/pmp.h 2006-05-06 04:57:28 UTC (rev 15) +++ trunk/include/pmp.h 2006-06-01 12:48:00 UTC (rev 16) @@ -41,6 +41,9 @@ struct tag_pmpdb_t; typedef struct tag_pmpdb_t pmpdb_t; struct tag_pmppl_t; typedef struct tag_pmppl_t pmppl_t; +/** + * Error codes. + */ enum { PMP_SUCCESS = 0, PMP_DEVICENOTFOUND, @@ -66,17 +69,30 @@ #define PMPCODEC_VORBIS PMPFOURCC('O','V','1',' ') #define PMPCODEC_WAV PMPFOURCC('W','A','V','E') +enum { + PMPPEF_NONE = 0x0000, + PMPPEF_SUPPORT = 0x0001, + PMPPEF_CONSTANT = 0x0002, + PMPPEF_RECURSIVE = 0x0004, +}; + typedef struct { + int flag; + ucs2char_t path[MAX_PATH]; +} pmp_pathenv_t; + +typedef struct { char id[128]; char name[128]; char mode[128]; char language[128]; char version[128]; - const ucs2char_t* path_to_root; - const ucs2char_t* path_to_music; - const ucs2char_t* path_to_playlist; - const ucs2char_t* playlist_ext; + pmp_pathenv_t path_to_root; /**< Path to the root directory */ + pmp_pathenv_t path_to_music; /**< Path to the music files */ + pmp_pathenv_t path_to_playlist; /**< Path to the playlist files */ + pmp_pathenv_t path_to_photo; /**< Path to the photo files */ + ucs2char_t playlist_ext[MAX_PATH]; } pmp_environment_t; /** Modified: trunk/include/ucs2char.h =================================================================== --- trunk/include/ucs2char.h 2006-05-06 04:57:28 UTC (rev 15) +++ trunk/include/ucs2char.h 2006-06-01 12:48:00 UTC (rev 16) @@ -88,6 +88,7 @@ UCS2API int ucs2cmp(const ucs2char_t* x, const ucs2char_t* y); UCS2API int ucs2ncmp(const ucs2char_t* x, const ucs2char_t* y, size_t n); UCS2API int ucs2icmp(const ucs2char_t* x, const ucs2char_t* y); +UCS2API int ucs2incmp(const ucs2char_t* x, const ucs2char_t* y, size_t n); UCS2API int ucs2memcmp(const ucs2char_t* buf1, const ucs2char_t* buf2, size_t count); UCS2API const ucs2char_t *ucs2memchr(const ucs2char_t* buf, ucs2char_t c, size_t count); Modified: trunk/lib/gmi/gmi.c =================================================================== --- trunk/lib/gmi/gmi.c 2006-05-06 04:57:28 UTC (rev 15) +++ trunk/lib/gmi/gmi.c 2006-06-01 12:48:00 UTC (rev 16) @@ -177,8 +177,25 @@ return 0; } -int gmi_get(media_info_t* info, const ucs2char_t *filename, const ucs2char_t* path_to_music, int flag) +static void strip_head_letters(ucs2char_t* str, size_t offset) { + if (offset <= ucs2len(str)) { + size_t i, n = ucs2len(str) + 1 - offset; + for (i = 0;i < n;++i) { + str[i] = str[i+offset]; + } + } +} + +int gmi_get( + media_info_t* info, + const ucs2char_t *filename, + const ucs2char_t* path_to_music, + int flag, + const ucs2char_t* strip_words[], + int num_strip_words + ) +{ int ret = 1; gmi_exports_t* exp = gmi_exports; @@ -201,6 +218,18 @@ if (flag & GMIF_PARSEMASK) { gmi_get_from_pathname(info, filename, path_to_music, flag); } + + /* Strip specific words in artist names. */ + 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])); + break; + } + } + } + return ret; } Modified: trunk/lib/pmp_iriverplus2/playlist.c =================================================================== --- trunk/lib/pmp_iriverplus2/playlist.c 2006-05-06 04:57:28 UTC (rev 15) +++ trunk/lib/pmp_iriverplus2/playlist.c 2006-06-01 12:48:00 UTC (rev 16) @@ -56,7 +56,7 @@ ip2db_init_record(&record); ip2db_get_record(db, leafid, &record); - if (ucs2cmp(record.pathname, pathname) == 0) { + if (ucs2icmp(record.pathname, pathname) == 0 && ucs2icmp(record.filename, filepart) == 0) { ip2db_free_record(&record); return leafid; } Modified: trunk/lib/pmp_iriverplus2/pmp_iriverplus2.c =================================================================== --- trunk/lib/pmp_iriverplus2/pmp_iriverplus2.c 2006-05-06 04:57:28 UTC (rev 15) +++ trunk/lib/pmp_iriverplus2/pmp_iriverplus2.c 2006-06-01 12:48:00 UTC (rev 16) @@ -65,8 +65,8 @@ ".plp", }, { - "iriver_u10_ums_1.00-1.63", "U10 UMS", "UM", - "1.00", "1.63", + "iriver_u10_ums_1.00-1.64", "U10 UMS", "UM", + "1.00", "1.64", "System\\U10.sys", "System\\U10.dat", "System\\U10.idx", "Music\\", "Playlists\\", ".plp", @@ -294,6 +294,7 @@ pmp_internal_t* pmpi = NULL; const ip2model_descriptor_t* md = NULL; ip2_environment_t env; + pmp_environment_t* pmpenv = NULL; *ptr_pmp = 0; @@ -341,15 +342,19 @@ memcpy(&pmpi->env, &env, sizeof(env)); // Initialize the (exportable) env. - strcpy(pmp->env.id, md->id); - strcpy(pmp->env.name, md->name); - strcpy(pmp->env.mode, md->mode); - strcpy(pmp->env.language, pmpi->env.language); - strcpy(pmp->env.version, pmpi->env.version); - pmp->env.path_to_root = pmpi->env.path_to_root; - pmp->env.path_to_music = pmpi->env.path_to_music; - pmp->env.path_to_playlist = pmpi->env.path_to_playlist; - pmp->env.playlist_ext = pmpi->env.playlist_ext; + pmpenv = &pmp->env; + strcpy(pmpenv->id, md->id); + strcpy(pmpenv->name, md->name); + strcpy(pmpenv->mode, md->mode); + strcpy(pmpenv->language, pmpi->env.language); + strcpy(pmpenv->version, pmpi->env.version); + pmpenv->path_to_root.flag = PMPPEF_SUPPORT | PMPPEF_CONSTANT; + ucs2cpy(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); + pmpenv->path_to_playlist.flag = PMPPEF_SUPPORT; + ucs2cpy(pmpenv->path_to_playlist.path, pmpi->env.path_to_playlist); + ucs2cpy(pmpenv->playlist_ext, pmpi->env.playlist_ext); // Prepare pmp->add_ref(pmp); Modified: trunk/lib/pmp_irivnavi/pmp_irivnavi.c =================================================================== --- trunk/lib/pmp_irivnavi/pmp_irivnavi.c 2006-05-06 04:57:28 UTC (rev 15) +++ trunk/lib/pmp_irivnavi/pmp_irivnavi.c 2006-06-01 12:48:00 UTC (rev 16) @@ -121,6 +121,7 @@ result_t ret = 0; pmp_t* pmp = NULL; pmp_internal_t* pmpi = NULL; + pmp_environment_t* pmpenv = NULL; *ptr_pmp = 0; @@ -200,10 +201,14 @@ pmp->env.version[0] = 0; // Unknown version // Set enviroments. - pmp->env.path_to_root = pmpi->env.path_to_root; - pmp->env.path_to_music = pmpi->env.path_to_music; - pmp->env.path_to_playlist = pmpi->env.path_to_playlist; - pmp->env.playlist_ext = pmpi->env.playlist_ext; + pmpenv = &pmp->env; + pmpenv->path_to_root.flag = PMPPEF_SUPPORT | PMPPEF_CONSTANT; + ucs2cpy(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); + 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); pmp->add_ref(pmp); *ptr_pmp = pmp; @@ -340,7 +345,7 @@ uint8_t *buffer = NULL; // Open a database file in the root directory. - ucs2cpy(filename, pmpdb->pmp->env.path_to_root); + ucs2cpy(filename, pmpdb->pmp->env.path_to_root.path); filepath_addslash(filename); ucs2cat(filename, ucs2cs_irivnavi_idb); fp = ucs2fopen(filename, "rb"); @@ -394,7 +399,7 @@ uint8_t *buffer = NULL; // Open a database file in the root directory. - ucs2cpy(filename, pmpdb->pmp->env.path_to_root); + ucs2cpy(filename, pmpdb->pmp->env.path_to_root.path); filepath_addslash(filename); ucs2cat(filename, ucs2cs_irivnavi_idb); filepath_removefile(filename); @@ -437,7 +442,7 @@ 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; + const ucs2char_t* path_to_root = pmpdb->pmp->env.path_to_root.path; // Clear the database. irivnavi_finish(db); @@ -488,7 +493,7 @@ 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; + 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}; Modified: trunk/lib/pmp_portalplayer1/pmp_portalplayer1.c =================================================================== --- trunk/lib/pmp_portalplayer1/pmp_portalplayer1.c 2006-05-06 04:57:28 UTC (rev 15) +++ trunk/lib/pmp_portalplayer1/pmp_portalplayer1.c 2006-06-01 12:48:00 UTC (rev 16) @@ -333,6 +333,7 @@ pmp_internal_t* pmpi = NULL; const pp1model_descriptor_t* md = NULL; pp1_environment_t env; + pmp_environment_t* pmpenv = NULL; // Initialize. *ptr_pmp = 0; @@ -382,15 +383,19 @@ memcpy(&pmpi->env, &env, sizeof(env)); // Initialize the (exportable) env. - strcpy(pmp->env.id, md->id); - strcpy(pmp->env.name, pmpi->env.model.name); - strcpy(pmp->env.mode, pmpi->env.model.mode); - strcpy(pmp->env.language, pmpi->env.model.language); - strcpy(pmp->env.version, pmpi->env.model.version); - pmp->env.path_to_root = pmpi->env.path_to_root; - pmp->env.path_to_music = pmpi->env.path_to_music; - pmp->env.path_to_playlist = pmpi->env.path_to_playlist; - pmp->env.playlist_ext = pmpi->env.playlist_ext; + pmpenv = &pmp->env; + strcpy(pmpenv->id, md->id); + strcpy(pmpenv->name, pmpi->env.model.name); + strcpy(pmpenv->mode, pmpi->env.model.mode); + strcpy(pmpenv->language, pmpi->env.model.language); + strcpy(pmpenv->version, pmpi->env.model.version); + pmpenv->path_to_root.flag = PMPPEF_SUPPORT | PMPPEF_CONSTANT; + ucs2cpy(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); + pmpenv->path_to_playlist.flag = PMPPEF_SUPPORT; + ucs2cpy(pmpenv->path_to_playlist.path, pmpi->env.path_to_playlist); + ucs2cpy(pmpenv->playlist_ext, pmpi->env.playlist_ext); // Prepare pmp->add_ref(pmp); Modified: trunk/lib/ucs2/ucs2char.c =================================================================== --- trunk/lib/ucs2/ucs2char.c 2006-05-06 04:57:28 UTC (rev 15) +++ trunk/lib/ucs2/ucs2char.c 2006-06-01 12:48:00 UTC (rev 16) @@ -189,6 +189,23 @@ return COMP(a, b); } +int ucs2incmp(const ucs2char_t* x, const ucs2char_t* y, size_t n) +{ + size_t i; + ucs2char_t a = 0, b = 0; + + for (i = 0;i < n-1;i++) { + a = ucs2upper(*x); + b = ucs2upper(*y); + if (!*x || !*y || a != b) { + break; + } + x++; + y++; + } + return COMP(a, b); +} + int ucs2memcmp(const ucs2char_t* buf1, const ucs2char_t* buf2, size_t count) { size_t i; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |