From: <ny...@us...> - 2007-01-07 19:36:24
|
Revision: 250 http://svn.sourceforge.net/pmplib/?rev=250&view=rev Author: nyaochi Date: 2007-01-07 11:36:24 -0800 (Sun, 07 Jan 2007) Log Message: ----------- - Removed pmphelp.h. The definitions of pmphelp_* are moved to pmp.h as pmplib_* - Added some comments in pmp.h Modified Paths: -------------- trunk/pmplib/frontend/easypmp/cui/device.c trunk/pmplib/frontend/easypmp/cui/main.c trunk/pmplib/frontend/easypmp/cui/option.c trunk/pmplib/frontend/easypmp/win32gui/maindlg.h trunk/pmplib/frontend/easypmp/win32gui/preference.h trunk/pmplib/frontend/easypmp/win32gui/processingdlg.h trunk/pmplib/frontend/easypmp/win32gui/winmain.cpp trunk/pmplib/include/pmp.h trunk/pmplib/lib/pmp/Makefile.am trunk/pmplib/lib/pmp/pmp.c trunk/pmplib/lib/pmp/pmp.vcproj trunk/pmplib/lib/pmp/pmp_win32.c trunk/pmplib/lib/pmp_iriverplus2/pmp_iriverplus2.c trunk/pmplib/lib/pmp_iriverplus3/pmp_iriverplus3.c trunk/pmplib/lib/pmp_irivnavi/pmp_irivnavi.c trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c Removed Paths: ------------- trunk/pmplib/include/pmphelp.h Modified: trunk/pmplib/frontend/easypmp/cui/device.c =================================================================== --- trunk/pmplib/frontend/easypmp/cui/device.c 2007-01-07 18:19:50 UTC (rev 249) +++ trunk/pmplib/frontend/easypmp/cui/device.c 2007-01-07 19:36:24 UTC (rev 250) @@ -32,7 +32,6 @@ #include <ucs2char.h> #include <filepath.h> #include <pmp.h> -#include <pmphelp.h> #include "util.h" @@ -75,18 +74,18 @@ static void enumerate_devid_callback(void *instance, const char *devid) { - pmphelp_t *pmphelp = (pmphelp_t*)instance; + pmplib_t *pmphelp = (pmplib_t*)instance; pmp_t* pmp = NULL; ucs2char_t ucs2cs_empty[] = {0}; - pmphelp_create(pmphelp, &pmp, ucs2cs_empty, devid); + pmplib_create(pmphelp, &pmp, ucs2cs_empty, devid); device_show_information(pmp, stdout); fprintf(stderr, "\n"); pmp->release(pmp); } -void device_enumerate(pmphelp_t* pmphelp) +void device_enumerate(pmplib_t* pmphelp) { - pmphelp_enumerate_devid(pmphelp, enumerate_devid_callback, pmphelp); + pmplib_enumerate_devid(pmphelp, enumerate_devid_callback, pmphelp); } /** @} */ Modified: trunk/pmplib/frontend/easypmp/cui/main.c =================================================================== --- trunk/pmplib/frontend/easypmp/cui/main.c 2007-01-07 18:19:50 UTC (rev 249) +++ trunk/pmplib/frontend/easypmp/cui/main.c 2007-01-07 19:36:24 UTC (rev 250) @@ -41,7 +41,6 @@ #include <filepath.h> #include <gmi.h> #include <pmp.h> -#include <pmphelp.h> #include <easypmp.h> #include "option.h" @@ -63,7 +62,7 @@ int database_dump(pmp_t* pmp, FILE *fpo, int level); void device_show_information(pmp_t* pmp, FILE *fpe); -void device_enumerate(pmphelp_t* pmphelp); +void device_enumerate(pmplib_t* pmphelp); int easypmp_progress_num_str( @@ -207,7 +206,7 @@ int ret = 0; int used_args = 0; char *mbs = NULL; - pmphelp_t* pmphelp = NULL; + pmplib_t* pmphelp = NULL; pmp_t* pmp = NULL; easypmp_filelist_t musics, playlists; pmp_music_record_t* records = NULL; @@ -272,7 +271,7 @@ } // Initialize PMP helper library. - pmphelp_init(&pmphelp); + pmplib_init(&pmphelp); // Show the list of supported devices and exit. if (opt.verb & MODE_LIST_DEVICES) { @@ -319,7 +318,7 @@ } // Create a PMP instance. - ret = pmphelp_create(pmphelp, &pmp, opt.path_to_root, opt.model); + ret = pmplib_create(pmphelp, &pmp, opt.path_to_root, opt.model); if (!pmp) { fprintf(fpe, "Failed to find a player (%d)\n", ret); ret = 1; @@ -397,7 +396,7 @@ pmp->close(pmp, 0); pmp->release(pmp); - pmphelp_finish(pmphelp); + pmplib_finish(pmphelp); option_finish(&opt); return ret; @@ -408,7 +407,7 @@ pmp = NULL; } if (pmphelp) { - pmphelp_finish(pmphelp); + pmplib_finish(pmphelp); pmphelp = NULL; } option_finish(&opt); Modified: trunk/pmplib/frontend/easypmp/cui/option.c =================================================================== --- trunk/pmplib/frontend/easypmp/cui/option.c 2007-01-07 18:19:50 UTC (rev 249) +++ trunk/pmplib/frontend/easypmp/cui/option.c 2007-01-07 19:36:24 UTC (rev 250) @@ -44,7 +44,6 @@ #include <filepath.h> #include <gmi.h> #include <pmp.h> -#include <pmphelp.h> #ifdef HAVE_GETOPT_H #include <getopt.h> Modified: trunk/pmplib/frontend/easypmp/win32gui/maindlg.h =================================================================== --- trunk/pmplib/frontend/easypmp/win32gui/maindlg.h 2007-01-07 18:19:50 UTC (rev 249) +++ trunk/pmplib/frontend/easypmp/win32gui/maindlg.h 2007-01-07 19:36:24 UTC (rev 250) @@ -45,7 +45,7 @@ int m_autorun; int m_configure_only; CString m_strIniFile; - pmphelp_t* m_pmphelp; + pmplib_t* m_pmphelp; CMainDlg() : m_autorun(0), m_configure_only(0), m_pmphelp(NULL) { @@ -148,7 +148,7 @@ } // Initialize PMP helper library. - pmphelp_init(&m_pmphelp); + pmplib_init(&m_pmphelp); // Delayed call of OnInitialize(). PostMessage(WM_APP, 0, 0); Modified: trunk/pmplib/frontend/easypmp/win32gui/preference.h =================================================================== --- trunk/pmplib/frontend/easypmp/win32gui/preference.h 2007-01-07 18:19:50 UTC (rev 249) +++ trunk/pmplib/frontend/easypmp/win32gui/preference.h 2007-01-07 19:36:24 UTC (rev 250) @@ -97,7 +97,7 @@ } } - UINT Persist(LPCTSTR szSettingFile, BOOL storing, pmphelp_t* pmphelp) + UINT Persist(LPCTSTR szSettingFile, BOOL storing, pmplib_t* pmphelp) { UINT ret = 0; @@ -218,7 +218,7 @@ } public: - BOOL SetPlayerLocation(pmphelp_t* pmphelp, LPCTSTR szLocation) + BOOL SetPlayerLocation(pmplib_t* pmphelp, LPCTSTR szLocation) { result_t res = 0; pmp_t* pmp = NULL; @@ -228,7 +228,7 @@ strPlayerIdentifier = _T(""); strPlayerDescription = _T(""); - res = pmphelp_create(pmphelp, &pmp, T2CUCS(szLocation), NULL); + res = pmplib_create(pmphelp, &pmp, T2CUCS(szLocation), NULL); if (res == 0 && pmp) { setPlayerInformation(pmp); pmp->release(pmp); @@ -239,7 +239,7 @@ } } - int findPlayerLocation(pmphelp_t* pmphelp) + int findPlayerLocation(pmplib_t* pmphelp) { result_t res = 0; pmp_t* pmp = NULL; @@ -320,10 +320,10 @@ } public: - int EnumerateDeviceIDs(pmphelp_t* pmphelp, CSimpleArray<CString>& strPlayerIDs) + int EnumerateDeviceIDs(pmplib_t* pmphelp, CSimpleArray<CString>& strPlayerIDs) { strPlayerIDs.RemoveAll(); - pmphelp_enumerate_devid(pmphelp, enumerate_devid_callback, &strPlayerIDs); + pmplib_enumerate_devid(pmphelp, enumerate_devid_callback, &strPlayerIDs); return 0; } Modified: trunk/pmplib/frontend/easypmp/win32gui/processingdlg.h =================================================================== --- trunk/pmplib/frontend/easypmp/win32gui/processingdlg.h 2007-01-07 18:19:50 UTC (rev 249) +++ trunk/pmplib/frontend/easypmp/win32gui/processingdlg.h 2007-01-07 19:36:24 UTC (rev 250) @@ -36,12 +36,12 @@ CImageList m_images; CEdit m_ctrlEditLog; int m_autorun; - pmphelp_t* m_pmphelp; + pmplib_t* m_pmphelp; CString m_strLogFile; CProgressBarCtrlWithCaption m_ctrlProgress; - CProcessingDlg(pmphelp_t* pmphelp, CEasyPMPSetting& preference, int autorun) + CProcessingDlg(pmplib_t* pmphelp, CEasyPMPSetting& preference, int autorun) : m_bCancel(FALSE), m_pmphelp(pmphelp), m_preference(preference), m_autorun(autorun) { } @@ -325,7 +325,7 @@ // Create a PMP instance. pmp_t* pmp = NULL; - pmphelp_create(m_pmphelp, &pmp, opt.path_to_root, opt.model); + pmplib_create(m_pmphelp, &pmp, opt.path_to_root, opt.model); if (!pmp) { //fprintf(fpe, "Failed to find a player\n"); return 1; Modified: trunk/pmplib/frontend/easypmp/win32gui/winmain.cpp =================================================================== --- trunk/pmplib/frontend/easypmp/win32gui/winmain.cpp 2007-01-07 18:19:50 UTC (rev 249) +++ trunk/pmplib/frontend/easypmp/win32gui/winmain.cpp 2007-01-07 19:36:24 UTC (rev 250) @@ -31,7 +31,6 @@ #include <filepath.h> #include <gmi.h> #include <pmp.h> -#include <pmphelp.h> #include <easypmp.h> #include "ejectdevice.h" Modified: trunk/pmplib/include/pmp.h =================================================================== --- trunk/pmplib/include/pmp.h 2007-01-07 18:19:50 UTC (rev 249) +++ trunk/pmplib/include/pmp.h 2007-01-07 19:36:24 UTC (rev 250) @@ -42,16 +42,6 @@ struct tag_pmp_playlist_t; typedef struct tag_pmp_playlist_t pmp_playlist_t; /** - * Open flags. - */ -enum { - PMPOF_MUSIC_DB_READ = 0x0001, - PMPOF_MUSIC_DB_WRITE = 0x0002, - PMPOF_MUSIC_PL_READ = 0x0004, - PMPOF_MUSIC_PL_WRITE = 0x0008, -}; - -/** * Error codes. */ enum { @@ -72,13 +62,43 @@ PMPPLE_WRITE, }; +/** + * Open flags for portable media device. + * Specify one or more flags to pmp_t::open() member function. + */ +enum { + /** + * Read access to the music database. + * The member function pmp_t::open() will read the music database. + */ + PMPOF_MUSIC_DB_READ = 0x0001, + /** + * Write access to the music database. + * The member function pmp_t::close() will write the music database. + */ + PMPOF_MUSIC_DB_WRITE = 0x0002, + /** + * Read access to the music playlists. + * The member function pmp_t::open() will read the music playlists. + */ + PMPOF_MUSIC_PL_READ = 0x0004, + /** + * Write access to the music playlists. + * The member function pmp_t::close() will write the music playlists. + */ + PMPOF_MUSIC_PL_WRITE = 0x0008, +}; + +/** + * Fourcc representation of codecs. + */ #define PMPFOURCC(a, b, c, d) \ ((uint32_t)(a) << 24 | (uint32_t)(b) << 16 | (uint32_t)(c) << 8 | (uint32_t)(d)) -#define PMPCODEC_MPEGLAYER3 PMPFOURCC('M','P','1','3') -#define PMPCODEC_WMA PMPFOURCC('W','M','A',' ') -#define PMPCODEC_VORBIS PMPFOURCC('O','V','1',' ') -#define PMPCODEC_WAV PMPFOURCC('W','A','V','E') +#define PMPCODEC_MPEGLAYER3 PMPFOURCC('M','P','1','3') /**< MPEG Audio Layer III */ +#define PMPCODEC_WMA PMPFOURCC('W','M','A',' ') /**< Windows Media Audio */ +#define PMPCODEC_VORBIS PMPFOURCC('O','V','1',' ') /**< Ogg Vorbis */ +#define PMPCODEC_WAV PMPFOURCC('W','A','V','E') /**< Microsoft Riff WAVE */ enum { PMPPEF_NONE = 0x0000, @@ -106,14 +126,57 @@ ucs2char_t playlist_ext[MAX_PATH]; } pmp_environment_t; + + +/** + * The root interface for a portable media device. + */ struct tag_pmp_t { + /** + * Pointer for the internal use. + * This member variable is reserved for the internal use of the + * library. Do not modify the value. + */ + void* instance; + + /** + * Reference counter. + * This member variable is reserved for the library to manage the + * reference counter. Do not modify the value directly. Call + * member functions add_ref() and release() to increase and + * decrease the reference counter. + */ uint32_t ref_count; - void* instance; + + /** + * Open flags. + * This member variable is reserved for the library to store the + * flags specified in open() function. Do not modify the value. + */ + uint32_t flag; + + /** + * Portable media device environment. + */ pmp_environment_t env; + + /** + * The pointer to pmp_music_t interface. + */ pmp_music_t* music; - uint32_t flag; + /** + * Increment the reference counter. + * @param pmp Ths pointer to the pmp_t instance. + */ uint32_t (*add_ref)(pmp_t* pmp); + + /** + * Decrement the reference counter. + * If the reference counter becomes zero after this decrement, + * this function will destroy the pmp_t instance. + * @param pmp Ths pointer to the pmp_t instance. + */ uint32_t (*release)(pmp_t* pmp); result_t (*open)(pmp_t* pmp, uint32_t flag); @@ -180,8 +243,22 @@ PMPAPI void pmp_record_init(pmp_music_record_t* record); PMPAPI void pmp_record_finish(pmp_music_record_t* record); PMPAPI result_t pmp_record_copy(pmp_music_record_t* dst, const pmp_music_record_t* src); +PMPAPI uint32_t pmp_interlocked_increment(uint32_t* count); +PMPAPI uint32_t pmp_interlocked_decrement(uint32_t* count); +struct tag_pmplib_t; typedef struct tag_pmplib_t pmplib_t; +PMPAPI result_t pmplib_init(pmplib_t** ptr_pmplib); + +PMPAPI result_t pmplib_finish(pmplib_t* pmplib); + +PMPAPI result_t pmplib_create(pmplib_t* pmplib, pmp_t** pmp, const ucs2char_t* path_to_device, const char *id); + +PMPAPI result_t pmplib_enumerate_devid(pmplib_t* pmplib, pmp_enumerate_devid_callback_t callback, void *instance); + +PMPAPI void pmplib_copy_environment(pmp_environment_t* dst, const pmp_environment_t* src); + + #ifdef __cplusplus } #endif/*__cplusplus*/ Deleted: trunk/pmplib/include/pmphelp.h =================================================================== --- trunk/pmplib/include/pmphelp.h 2007-01-07 18:19:50 UTC (rev 249) +++ trunk/pmplib/include/pmphelp.h 2007-01-07 19:36:24 UTC (rev 250) @@ -1,62 +0,0 @@ -#ifndef __PMPHELPER_H__ -#define __PMPHELPER_H__ - -#ifdef PMP_EXPORTS -#define PMPHELPERAPI __declspec(dllexport) -#else -#define PMPHELPERAPI -#endif - -#ifdef __cplusplus -extern "C" { -#endif/*__cplusplus*/ - -typedef void pmphelp_t; - -PMPHELPERAPI uint32_t interlocked_increment(uint32_t* count); -PMPHELPERAPI uint32_t interlocked_decrement(uint32_t* count); - - -PMPHELPERAPI -result_t -pmphelp_init( - pmphelp_t** ptr_pmphelp - ); - -PMPHELPERAPI -result_t -pmphelp_finish( - pmphelp_t* pmphelp - ); - -PMPHELPERAPI -result_t -pmphelp_create( - pmphelp_t* pmphelp, - pmp_t** pmp, - const ucs2char_t* path_to_device, - const char *id - ); - -PMPHELPERAPI -result_t -pmphelp_enumerate_devid( - pmphelp_t* pmphelp, - pmp_enumerate_devid_callback_t callback, - void *instance - ); - -PMPHELPERAPI -void -pmphelp_copy_environment( - pmp_environment_t* dst, - const pmp_environment_t* src - ); - - - -#ifdef __cplusplus -} -#endif/*__cplusplus*/ - -#endif/*__PMPHELPER_H__*/ Modified: trunk/pmplib/lib/pmp/Makefile.am =================================================================== --- trunk/pmplib/lib/pmp/Makefile.am 2007-01-07 18:19:50 UTC (rev 249) +++ trunk/pmplib/lib/pmp/Makefile.am 2007-01-07 19:36:24 UTC (rev 250) @@ -4,7 +4,6 @@ libpmp_la_SOURCES = \ ../../include/pmp.h \ - ../../include/pmphelp.h \ pmp.c \ pmp_posix.c Modified: trunk/pmplib/lib/pmp/pmp.c =================================================================== --- trunk/pmplib/lib/pmp/pmp.c 2007-01-07 18:19:50 UTC (rev 249) +++ trunk/pmplib/lib/pmp/pmp.c 2007-01-07 19:36:24 UTC (rev 250) @@ -63,7 +63,7 @@ return 0; } -void pmphelp_copy_environment(pmp_environment_t* dst, const pmp_environment_t* src) +void pmplib_copy_environment(pmp_environment_t* dst, const pmp_environment_t* src) { memcpy(dst, src, sizeof(*src)); } Modified: trunk/pmplib/lib/pmp/pmp.vcproj =================================================================== --- trunk/pmplib/lib/pmp/pmp.vcproj 2007-01-07 18:19:50 UTC (rev 249) +++ trunk/pmplib/lib/pmp/pmp.vcproj 2007-01-07 19:36:24 UTC (rev 250) @@ -199,10 +199,6 @@ RelativePath="..\..\include\pmp.h" > </File> - <File - RelativePath="..\..\include\pmphelp.h" - > - </File> </Filter> <Filter Name="\x83\x8A\x83\\x81[\x83X \x83t\x83@\x83C\x83\x8B" Modified: trunk/pmplib/lib/pmp/pmp_win32.c =================================================================== --- trunk/pmplib/lib/pmp/pmp_win32.c 2007-01-07 18:19:50 UTC (rev 249) +++ trunk/pmplib/lib/pmp/pmp_win32.c 2007-01-07 19:36:24 UTC (rev 250) @@ -33,36 +33,35 @@ #include <filepath.h> #include <pmp.h> -#include <pmphelp.h> -typedef struct { +struct tag_pmplib_t { uint32_t num_plugins; HMODULE* plugins; -} pmphelp_win32_t; +}; -uint32_t interlocked_increment(uint32_t* count) +uint32_t pmp_interlocked_increment(uint32_t* count) { return (uint32_t)InterlockedIncrement((LONG*)count); } -uint32_t interlocked_decrement(uint32_t* count) +uint32_t pmp_interlocked_decrement(uint32_t* count) { return (uint32_t)InterlockedDecrement((LONG*)count); } -result_t pmphelp_init(pmphelp_t** ptr_pmphelp) +result_t pmplib_init(pmplib_t** ptr_pmplib) { - pmphelp_win32_t* pmphelp = NULL; + pmplib_t* pmplib = NULL; HANDLE hFile = INVALID_HANDLE_VALUE; WIN32_FIND_DATAW data; ucs2char_t szPath[MAX_PATH]; ucs2char_t szPattern[MAX_PATH]; static const ucs2char_t ucs2cs_pattern[] = {'p','m','p','_','*','.','d','l','l',0}; - pmphelp = calloc(1, sizeof(pmphelp_win32_t)); - pmphelp->num_plugins = 0; - pmphelp->plugins = NULL; + pmplib = calloc(1, sizeof(pmplib_t)); + pmplib->num_plugins = 0; + pmplib->plugins = NULL; GetModuleFileNameW(NULL, szPath, MAX_PATH); filepath_remove_filespec(szPath); @@ -79,36 +78,34 @@ ucs2cpy(szFilename, szPath); ucs2cat(szFilename, data.cFileName); - pmphelp->plugins = realloc(pmphelp->plugins, sizeof(HMODULE) * (pmphelp->num_plugins+1)); - pmphelp->plugins[pmphelp->num_plugins] = LoadLibraryW(szFilename); - ++pmphelp->num_plugins; + pmplib->plugins = realloc(pmplib->plugins, sizeof(HMODULE) * (pmplib->num_plugins+1)); + pmplib->plugins[pmplib->num_plugins] = LoadLibraryW(szFilename); + ++pmplib->num_plugins; } } while (FindNextFileW(hFile, &data)); FindClose(hFile); } - *ptr_pmphelp = pmphelp; + *ptr_pmplib = pmplib; return 0; } -result_t pmphelp_finish(pmphelp_t* pmphelp) +result_t pmplib_finish(pmplib_t* pmplib) { - pmphelp_win32_t* pmphelpw32 = (pmphelp_win32_t*)pmphelp; uint32_t i; - for (i = 0;i < pmphelpw32->num_plugins;++i) { - FreeLibrary(pmphelpw32->plugins[i]); + for (i = 0;i < pmplib->num_plugins;++i) { + FreeLibrary(pmplib->plugins[i]); } - free(pmphelpw32->plugins); - free(pmphelpw32); + free(pmplib->plugins); + free(pmplib); return 0; } -result_t pmphelp_enumerate_devid(pmphelp_t* pmphelp, pmp_enumerate_devid_callback_t callback, void *instance) +result_t pmplib_enumerate_devid(pmplib_t* pmplib, pmp_enumerate_devid_callback_t callback, void *instance) { - pmphelp_win32_t* pmphelpw32 = (pmphelp_win32_t*)pmphelp; uint32_t i; - for (i = 0;i < pmphelpw32->num_plugins;++i) { - pmp_enumerate_devid_t func = (pmp_enumerate_devid_t)GetProcAddress(pmphelpw32->plugins[i], "pmp_enumerate_devid"); + for (i = 0;i < pmplib->num_plugins;++i) { + pmp_enumerate_devid_t func = (pmp_enumerate_devid_t)GetProcAddress(pmplib->plugins[i], "pmp_enumerate_devid"); if (func) { func(callback, instance); } @@ -116,14 +113,13 @@ return 0; } -result_t pmphelp_create(pmphelp_t* pmphelp, pmp_t** pmp, const ucs2char_t* path_to_device, const char *id) +result_t pmplib_create(pmplib_t* pmplib, pmp_t** pmp, const ucs2char_t* path_to_device, const char *id) { - pmphelp_win32_t* pmphelpw32 = (pmphelp_win32_t*)pmphelp; uint32_t i; result_t ret = PMP_DEVICENOTFOUND; - for (i = 0;i < pmphelpw32->num_plugins;++i) { - pmp_create_t func = (pmp_create_t)GetProcAddress(pmphelpw32->plugins[i], "pmp_create"); + for (i = 0;i < pmplib->num_plugins;++i) { + pmp_create_t func = (pmp_create_t)GetProcAddress(pmplib->plugins[i], "pmp_create"); if (func) { ret = func(pmp, path_to_device, id); if (ret != PMP_DEVICENOTFOUND) { Modified: trunk/pmplib/lib/pmp_iriverplus2/pmp_iriverplus2.c =================================================================== --- trunk/pmplib/lib/pmp_iriverplus2/pmp_iriverplus2.c 2007-01-07 18:19:50 UTC (rev 249) +++ trunk/pmplib/lib/pmp_iriverplus2/pmp_iriverplus2.c 2007-01-07 19:36:24 UTC (rev 250) @@ -34,7 +34,6 @@ #include <ucs2char.h> #include <filepath.h> #include <pmp.h> -#include <pmphelp.h> #include "ip2db.h" @@ -374,12 +373,12 @@ static uint32_t pmp_add_ref(pmp_t* pmp) { - return interlocked_increment(&pmp->ref_count); + return pmp_interlocked_increment(&pmp->ref_count); } static uint32_t pmp_release(pmp_t* pmp) { - uint32_t count = interlocked_decrement(&pmp->ref_count); + uint32_t count = pmp_interlocked_decrement(&pmp->ref_count); if (count == 0) { pmpdb_release(pmp->music); free(pmp->instance); @@ -548,12 +547,12 @@ static uint32_t pmppl_add_ref(pmp_playlist_t* pmppl) { - return interlocked_increment(&pmppl->ref_count); + return pmp_interlocked_increment(&pmppl->ref_count); } static uint32_t pmppl_release(pmp_playlist_t* pmppl) { - uint32_t count = interlocked_decrement(&pmppl->ref_count); + uint32_t count = pmp_interlocked_decrement(&pmppl->ref_count); if (count == 0) { pmppl_internal_t* pmppli = (pmppl_internal_t*)pmppl->instance; free(pmppl->instance); Modified: trunk/pmplib/lib/pmp_iriverplus3/pmp_iriverplus3.c =================================================================== --- trunk/pmplib/lib/pmp_iriverplus3/pmp_iriverplus3.c 2007-01-07 18:19:50 UTC (rev 249) +++ trunk/pmplib/lib/pmp_iriverplus3/pmp_iriverplus3.c 2007-01-07 19:36:24 UTC (rev 250) @@ -34,7 +34,6 @@ #include <ucs2char.h> #include <filepath.h> #include <pmp.h> -#include <pmphelp.h> #include "ip3db.h" #include "util.h" @@ -385,12 +384,12 @@ static uint32_t pmp_add_ref(pmp_t* pmp) { - return interlocked_increment(&pmp->ref_count); + return pmp_interlocked_increment(&pmp->ref_count); } static uint32_t pmp_release(pmp_t* pmp) { - uint32_t count = interlocked_decrement(&pmp->ref_count); + uint32_t count = pmp_interlocked_decrement(&pmp->ref_count); if (count == 0) { pmpdb_release(pmp->music); free(pmp->instance); @@ -675,12 +674,12 @@ static uint32_t pmppl_add_ref(pmp_playlist_t* pmppl) { - return interlocked_increment(&pmppl->ref_count); + return pmp_interlocked_increment(&pmppl->ref_count); } static uint32_t pmppl_release(pmp_playlist_t* pmppl) { - uint32_t count = interlocked_decrement(&pmppl->ref_count); + uint32_t count = pmp_interlocked_decrement(&pmppl->ref_count); if (count == 0) { pmppl_internal_t* pmppli = (pmppl_internal_t*)pmppl->instance; free(pmppl->instance); Modified: trunk/pmplib/lib/pmp_irivnavi/pmp_irivnavi.c =================================================================== --- trunk/pmplib/lib/pmp_irivnavi/pmp_irivnavi.c 2007-01-07 18:19:50 UTC (rev 249) +++ trunk/pmplib/lib/pmp_irivnavi/pmp_irivnavi.c 2007-01-07 19:36:24 UTC (rev 250) @@ -36,7 +36,6 @@ #include <ucs2char.h> #include <filepath.h> #include <pmp.h> -#include <pmphelp.h> #include "irivnavi.h" @@ -234,12 +233,12 @@ static uint32_t pmp_add_ref(pmp_t* pmp) { - return interlocked_increment(&pmp->ref_count); + return pmp_interlocked_increment(&pmp->ref_count); } static uint32_t pmp_release(pmp_t* pmp) { - uint32_t count = interlocked_decrement(&pmp->ref_count); + uint32_t count = pmp_interlocked_decrement(&pmp->ref_count); if (count == 0) { pmpdb_release(pmp->music); free(pmp); @@ -597,12 +596,12 @@ static uint32_t pmppl_add_ref(pmp_playlist_t* pmppl) { - return interlocked_increment(&pmppl->ref_count); + return pmp_interlocked_increment(&pmppl->ref_count); } static uint32_t pmppl_release(pmp_playlist_t* pmppl) { - uint32_t count = interlocked_decrement(&pmppl->ref_count); + uint32_t count = pmp_interlocked_decrement(&pmppl->ref_count); if (count == 0) { free(pmppl); } Modified: trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c 2007-01-07 18:19:50 UTC (rev 249) +++ trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c 2007-01-07 19:36:24 UTC (rev 250) @@ -34,7 +34,6 @@ #include <ucs2char.h> #include <filepath.h> #include <pmp.h> -#include <pmphelp.h> #include "pp1db.h" #include "hdr_template.h" @@ -431,12 +430,12 @@ static uint32_t pmp_add_ref(pmp_t* pmp) { - return interlocked_increment(&pmp->ref_count); + return pmp_interlocked_increment(&pmp->ref_count); } static uint32_t pmp_release(pmp_t* pmp) { - uint32_t count = interlocked_decrement(&pmp->ref_count); + uint32_t count = pmp_interlocked_decrement(&pmp->ref_count); if (count == 0) { pmpdb_release(pmp->music); free(pmp->instance); @@ -587,12 +586,12 @@ static uint32_t pmppl_add_ref(pmp_playlist_t* pmppl) { - return interlocked_increment(&pmppl->ref_count); + return pmp_interlocked_increment(&pmppl->ref_count); } static uint32_t pmppl_release(pmp_playlist_t* pmppl) { - uint32_t count = interlocked_decrement(&pmppl->ref_count); + uint32_t count = pmp_interlocked_decrement(&pmppl->ref_count); if (count == 0) { free(pmppl); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |