From: <ny...@us...> - 2007-01-07 15:17:10
|
Revision: 244 http://svn.sourceforge.net/pmplib/?rev=244&view=rev Author: nyaochi Date: 2007-01-07 07:17:10 -0800 (Sun, 07 Jan 2007) Log Message: ----------- Beginning of API restructuring. - pmpdb_t -> pmp_music_t - pmppl_t -> pmp_playlist_t (this will be merged to pmp_music_t later though) Modified Paths: -------------- trunk/pmplib/frontend/easypmp/common/database.c trunk/pmplib/frontend/easypmp/common/playlist.c trunk/pmplib/include/pmp.h 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 Modified: trunk/pmplib/frontend/easypmp/common/database.c =================================================================== --- trunk/pmplib/frontend/easypmp/common/database.c 2007-01-07 14:40:25 UTC (rev 243) +++ trunk/pmplib/frontend/easypmp/common/database.c 2007-01-07 15:17:10 UTC (rev 244) @@ -111,7 +111,7 @@ int result = 0; uint32_t i; result_t res = 0; - pmpdb_t* pmpdb = NULL; + pmp_music_t* pmpdb = NULL; pmp_record_t* records = NULL; pmp_record_t* old_records = NULL; uint32_t num_old_records = 0, num_obtained = 0; @@ -298,7 +298,7 @@ { int result = 0; result_t res = 0; - pmpdb_t* pmpdb = NULL; + pmp_music_t* pmpdb = NULL; /* * Read the existing database for update processing mode. @@ -378,7 +378,7 @@ int database_dump(pmp_t* pmp, FILE *fp, int level) { - pmpdb_t* pmpdb = NULL; + pmp_music_t* pmpdb = NULL; pmp->create_instance_db(pmp, &pmpdb); if (!pmpdb) { return 1; Modified: trunk/pmplib/frontend/easypmp/common/playlist.c =================================================================== --- trunk/pmplib/frontend/easypmp/common/playlist.c 2007-01-07 14:40:25 UTC (rev 243) +++ trunk/pmplib/frontend/easypmp/common/playlist.c 2007-01-07 15:17:10 UTC (rev 244) @@ -77,7 +77,7 @@ int result = 0; int i, j, num_succeeded = 0; char *mbs = NULL; - pmppl_t* pmppl = NULL; + pmp_playlist_t* pmppl = NULL; playlist_mediafile_t* mediafiles = NULL; result_t res = 0; callback_data_t cd; Modified: trunk/pmplib/include/pmp.h =================================================================== --- trunk/pmplib/include/pmp.h 2007-01-07 14:40:25 UTC (rev 243) +++ trunk/pmplib/include/pmp.h 2007-01-07 15:17:10 UTC (rev 244) @@ -37,9 +37,9 @@ /* * Forward structure declarations. */ -struct tag_pmp_t; typedef struct tag_pmp_t pmp_t; -struct tag_pmpdb_t; typedef struct tag_pmpdb_t pmpdb_t; -struct tag_pmppl_t; typedef struct tag_pmppl_t pmppl_t; +struct tag_pmp_t; typedef struct tag_pmp_t pmp_t; +struct tag_pmp_music_t; typedef struct tag_pmp_music_t pmp_music_t; +struct tag_pmp_playlist_t; typedef struct tag_pmp_playlist_t pmp_playlist_t; /** * Error codes. @@ -129,8 +129,8 @@ uint32_t (*add_ref)(pmp_t* pmp); uint32_t (*release)(pmp_t* pmp); - result_t (*create_instance_db)(pmp_t* pmp, pmpdb_t** pmpdb); - result_t (*create_instance_pl)(pmp_t* pmp, pmppl_t** pmppl); + result_t (*create_instance_db)(pmp_t* pmp, pmp_music_t** pmpdb); + result_t (*create_instance_pl)(pmp_t* pmp, pmp_playlist_t** pmppl); int (*is_supported_codec)(pmp_t* pmp, uint32_t codec); int (*is_supported_ext)(pmp_t* pmp, const ucs2char_t* filename); @@ -138,32 +138,32 @@ typedef void pmpdb_readwrite_progress_t(void *instance, uint32_t size, uint32_t total); -struct tag_pmpdb_t { +struct tag_pmp_music_t { void* instance; uint32_t ref_count; pmp_t* pmp; - uint32_t (*add_ref)(pmpdb_t* pmpdb); - uint32_t (*release)(pmpdb_t* pmpdb); + uint32_t (*add_ref)(pmp_music_t* pmpdb); + uint32_t (*release)(pmp_music_t* pmpdb); - result_t (*read)(pmpdb_t* pmpdb); - result_t (*write)(pmpdb_t* pmpdb); + result_t (*read)(pmp_music_t* pmpdb); + result_t (*write)(pmp_music_t* pmpdb); - result_t (*set)(pmpdb_t* pmpdb, const pmp_record_t* records, uint32_t num_records); - result_t (*get)(pmpdb_t* pmpdb, pmp_record_t* records, uint32_t* num_records); + result_t (*set)(pmp_music_t* pmpdb, const pmp_record_t* records, uint32_t num_records); + result_t (*get)(pmp_music_t* pmpdb, pmp_record_t* records, uint32_t* num_records); - result_t (*dump)(pmpdb_t* pmpdb, FILE *fp, int level); + result_t (*dump)(pmp_music_t* pmpdb, FILE *fp, int level); }; -struct tag_pmppl_t { +struct tag_pmp_playlist_t { void* instance; uint32_t ref_count; pmp_t* pmp; - uint32_t (*add_ref)(pmppl_t* pmppl); - uint32_t (*release)(pmppl_t* pmppl); + uint32_t (*add_ref)(pmp_playlist_t* pmppl); + uint32_t (*release)(pmp_playlist_t* pmppl); - result_t (*write)(pmppl_t* pmppl, const ucs2char_t* filename, ucs2char_t * const files[], uint32_t num_files); + result_t (*write)(pmp_playlist_t* pmppl, const ucs2char_t* filename, ucs2char_t * const files[], uint32_t num_files); }; typedef result_t (*pmp_create_t)(pmp_t** pmp, const ucs2char_t* path_to_device, const char *devid); Modified: trunk/pmplib/lib/pmp_iriverplus2/pmp_iriverplus2.c =================================================================== --- trunk/pmplib/lib/pmp_iriverplus2/pmp_iriverplus2.c 2007-01-07 14:40:25 UTC (rev 243) +++ trunk/pmplib/lib/pmp_iriverplus2/pmp_iriverplus2.c 2007-01-07 15:17:10 UTC (rev 244) @@ -115,22 +115,22 @@ static uint32_t pmp_add_ref(pmp_t* pmp); static uint32_t pmp_release(pmp_t* pmp); -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_create_instance_db(pmp_t* pmp, pmp_music_t** ptr_pmpdb); +static result_t pmp_create_instance_pl(pmp_t* pmp, pmp_playlist_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 uint32_t pmpdb_add_ref(pmpdb_t* pmpdb); -static uint32_t pmpdb_release(pmpdb_t* pmpdb); -static result_t pmpdb_read(pmpdb_t* pmpdb); -static result_t pmpdb_write(pmpdb_t* pmpdb); -static result_t pmpdb_set(pmpdb_t* pmpdb, const pmp_record_t* records, uint32_t num_records); -static result_t pmpdb_get(pmpdb_t* pmpdb, pmp_record_t* records, uint32_t* num_records); -static result_t pmpdb_dump(pmpdb_t* pmpdb, FILE *fp, int level); +static uint32_t pmpdb_add_ref(pmp_music_t* pmpdb); +static uint32_t pmpdb_release(pmp_music_t* pmpdb); +static result_t pmpdb_read(pmp_music_t* pmpdb); +static result_t pmpdb_write(pmp_music_t* pmpdb); +static result_t pmpdb_set(pmp_music_t* pmpdb, const pmp_record_t* records, uint32_t num_records); +static result_t pmpdb_get(pmp_music_t* pmpdb, pmp_record_t* records, uint32_t* num_records); +static result_t pmpdb_dump(pmp_music_t* pmpdb, FILE *fp, int level); -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, ucs2char_t* const files[], uint32_t num_files); +static uint32_t pmppl_add_ref(pmp_playlist_t* pmppl); +static uint32_t pmppl_release(pmp_playlist_t* pmppl); +static result_t pmppl_write(pmp_playlist_t* pmppl, const ucs2char_t* filename, ucs2char_t* const files[], uint32_t num_files); static void set_environment( @@ -380,15 +380,15 @@ return count; } -static result_t pmp_create_instance_db(pmp_t* pmp, pmpdb_t** ptr_pmpdb) +static result_t pmp_create_instance_db(pmp_t* pmp, pmp_music_t** ptr_pmpdb) { - pmpdb_t* pmpdb = NULL; + pmp_music_t* pmpdb = NULL; pmp_internal_t* pmpi = (pmp_internal_t*)pmp->instance; pmpdb_internal_t* pmpdbi = NULL; *ptr_pmpdb = 0; - pmpdb = calloc(1, sizeof(pmpdb_t)); + pmpdb = calloc(1, sizeof(pmp_music_t)); if (!pmpdb) { return PMPDBE_OUTOFMEMORY; } @@ -416,15 +416,15 @@ return 0; } -static result_t pmp_create_instance_pl(pmp_t* pmp, pmppl_t** ptr_pmppl) +static result_t pmp_create_instance_pl(pmp_t* pmp, pmp_playlist_t** ptr_pmppl) { pmp_internal_t* pmpi = (pmp_internal_t*)pmp->instance; - pmppl_t* pmppl = NULL; + pmp_playlist_t* pmppl = NULL; pmppl_internal_t* pmppli = NULL; *ptr_pmppl = 0; - pmppl = calloc(1, sizeof(pmppl_t)); + pmppl = calloc(1, sizeof(pmp_playlist_t)); if (!pmppl) { return PMPDBE_OUTOFMEMORY; } @@ -465,12 +465,12 @@ -static uint32_t pmpdb_add_ref(pmpdb_t* pmpdb) +static uint32_t pmpdb_add_ref(pmp_music_t* pmpdb) { return interlocked_increment(&pmpdb->ref_count); } -static uint32_t pmpdb_release(pmpdb_t* pmpdb) +static uint32_t pmpdb_release(pmp_music_t* pmpdb) { uint32_t count = interlocked_decrement(&pmpdb->ref_count); if (count == 0) { @@ -482,35 +482,35 @@ return count; } -static result_t pmpdb_read(pmpdb_t* pmpdb) +static result_t pmpdb_read(pmp_music_t* pmpdb) { pmpdb_internal_t* pmpdbi = (pmpdb_internal_t*)pmpdb->instance; pmp_internal_t* pmpi = (pmp_internal_t*)pmpdb->pmp->instance; return ip2db_read(&pmpdbi->ip2db, pmpi->env.dat_filename, pmpi->env.idx_filename); } -static result_t pmpdb_write(pmpdb_t* pmpdb) +static result_t pmpdb_write(pmp_music_t* pmpdb) { pmpdb_internal_t* pmpdbi = (pmpdb_internal_t*)pmpdb->instance; pmp_internal_t* pmpi = (pmp_internal_t*)pmpdb->pmp->instance; return ip2db_write(&pmpdbi->ip2db, pmpi->env.dat_filename, pmpi->env.idx_filename); } -static result_t pmpdb_set(pmpdb_t* pmpdb, const pmp_record_t* records, uint32_t num_records) +static result_t pmpdb_set(pmp_music_t* pmpdb, const pmp_record_t* records, uint32_t num_records) { pmpdb_internal_t* pmpdbi = (pmpdb_internal_t*)pmpdb->instance; pmp_internal_t* pmpi = (pmp_internal_t*)pmpdb->pmp->instance; return ip2db_set(&pmpdbi->ip2db, records, num_records, pmpi->env.path_to_root); } -static result_t pmpdb_get(pmpdb_t* pmpdb, pmp_record_t* records, uint32_t* num_records) +static result_t pmpdb_get(pmp_music_t* pmpdb, pmp_record_t* records, uint32_t* num_records) { pmpdb_internal_t* pmpdbi = (pmpdb_internal_t*)pmpdb->instance; pmp_internal_t* pmpi = (pmp_internal_t*)pmpdb->pmp->instance; return ip2db_get(&pmpdbi->ip2db, records, num_records, pmpi->env.path_to_root); } -static result_t pmpdb_dump(pmpdb_t* pmpdb, FILE *fp, int level) +static result_t pmpdb_dump(pmp_music_t* pmpdb, FILE *fp, int level) { pmpdb_internal_t* pmpdbi = (pmpdb_internal_t*)pmpdb->instance; if (level > 0) { @@ -523,12 +523,12 @@ -static uint32_t pmppl_add_ref(pmppl_t* pmppl) +static uint32_t pmppl_add_ref(pmp_playlist_t* pmppl) { return interlocked_increment(&pmppl->ref_count); } -static uint32_t pmppl_release(pmppl_t* pmppl) +static uint32_t pmppl_release(pmp_playlist_t* pmppl) { uint32_t count = interlocked_decrement(&pmppl->ref_count); if (count == 0) { @@ -539,7 +539,7 @@ return count; } -static result_t pmppl_write(pmppl_t* pmppl, const ucs2char_t* filename, ucs2char_t* const files[], uint32_t num_files) +static result_t pmppl_write(pmp_playlist_t* pmppl, const ucs2char_t* filename, ucs2char_t* const 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: trunk/pmplib/lib/pmp_iriverplus3/pmp_iriverplus3.c =================================================================== --- trunk/pmplib/lib/pmp_iriverplus3/pmp_iriverplus3.c 2007-01-07 14:40:25 UTC (rev 243) +++ trunk/pmplib/lib/pmp_iriverplus3/pmp_iriverplus3.c 2007-01-07 15:17:10 UTC (rev 244) @@ -111,22 +111,22 @@ static uint32_t pmp_add_ref(pmp_t* pmp); static uint32_t pmp_release(pmp_t* pmp); -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_create_instance_db(pmp_t* pmp, pmp_music_t** ptr_pmpdb); +static result_t pmp_create_instance_pl(pmp_t* pmp, pmp_playlist_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 uint32_t pmpdb_add_ref(pmpdb_t* pmpdb); -static uint32_t pmpdb_release(pmpdb_t* pmpdb); -static result_t pmpdb_read(pmpdb_t* pmpdb); -static result_t pmpdb_write(pmpdb_t* pmpdb); -static result_t pmpdb_set(pmpdb_t* pmpdb, const pmp_record_t* records, uint32_t num_records); -static result_t pmpdb_get(pmpdb_t* pmpdb, pmp_record_t* records, uint32_t* num_records); -static result_t pmpdb_dump(pmpdb_t* pmpdb, FILE *fp, int level); +static uint32_t pmpdb_add_ref(pmp_music_t* pmpdb); +static uint32_t pmpdb_release(pmp_music_t* pmpdb); +static result_t pmpdb_read(pmp_music_t* pmpdb); +static result_t pmpdb_write(pmp_music_t* pmpdb); +static result_t pmpdb_set(pmp_music_t* pmpdb, const pmp_record_t* records, uint32_t num_records); +static result_t pmpdb_get(pmp_music_t* pmpdb, pmp_record_t* records, uint32_t* num_records); +static result_t pmpdb_dump(pmp_music_t* pmpdb, FILE *fp, int level); -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, ucs2char_t* const files[], uint32_t num_files); +static uint32_t pmppl_add_ref(pmp_playlist_t* pmppl); +static uint32_t pmppl_release(pmp_playlist_t* pmppl); +static result_t pmppl_write(pmp_playlist_t* pmppl, const ucs2char_t* filename, ucs2char_t* const files[], uint32_t num_files); static void set_environment( @@ -391,15 +391,15 @@ return count; } -static result_t pmp_create_instance_db(pmp_t* pmp, pmpdb_t** ptr_pmpdb) +static result_t pmp_create_instance_db(pmp_t* pmp, pmp_music_t** ptr_pmpdb) { - pmpdb_t* pmpdb = NULL; + pmp_music_t* pmpdb = NULL; pmp_internal_t* pmpi = (pmp_internal_t*)pmp->instance; pmpdb_internal_t* pmpdbi = NULL; *ptr_pmpdb = 0; - pmpdb = calloc(1, sizeof(pmpdb_t)); + pmpdb = calloc(1, sizeof(pmp_music_t)); if (!pmpdb) { return PMPDBE_OUTOFMEMORY; } @@ -427,15 +427,15 @@ return 0; } -static result_t pmp_create_instance_pl(pmp_t* pmp, pmppl_t** ptr_pmppl) +static result_t pmp_create_instance_pl(pmp_t* pmp, pmp_playlist_t** ptr_pmppl) { pmp_internal_t* pmpi = (pmp_internal_t*)pmp->instance; - pmppl_t* pmppl = NULL; + pmp_playlist_t* pmppl = NULL; pmppl_internal_t* pmppli = NULL; *ptr_pmppl = 0; - pmppl = calloc(1, sizeof(pmppl_t)); + pmppl = calloc(1, sizeof(pmp_playlist_t)); if (!pmppl) { return PMPDBE_OUTOFMEMORY; } @@ -488,12 +488,12 @@ -static uint32_t pmpdb_add_ref(pmpdb_t* pmpdb) +static uint32_t pmpdb_add_ref(pmp_music_t* pmpdb) { return interlocked_increment(&pmpdb->ref_count); } -static uint32_t pmpdb_release(pmpdb_t* pmpdb) +static uint32_t pmpdb_release(pmp_music_t* pmpdb) { uint32_t count = interlocked_decrement(&pmpdb->ref_count); if (count == 0) { @@ -505,7 +505,7 @@ return count; } -static result_t pmpdb_read(pmpdb_t* pmpdb) +static result_t pmpdb_read(pmp_music_t* pmpdb) { pmpdb_internal_t* pmpdbi = (pmpdb_internal_t*)pmpdb->instance; pmp_internal_t* pmpi = (pmp_internal_t*)pmpdb->pmp->instance; @@ -517,7 +517,7 @@ ); } -static result_t pmpdb_write(pmpdb_t* pmpdb) +static result_t pmpdb_write(pmp_music_t* pmpdb) { pmpdb_internal_t* pmpdbi = (pmpdb_internal_t*)pmpdb->instance; pmp_internal_t* pmpi = (pmp_internal_t*)pmpdb->pmp->instance; @@ -539,7 +539,7 @@ return (path + length); } -static result_t pmpdb_set(pmpdb_t* pmpdb, const pmp_record_t* records, uint32_t num_records) +static result_t pmpdb_set(pmp_music_t* pmpdb, const pmp_record_t* records, uint32_t num_records) { int i; pmpdb_internal_t* pmpdbi = (pmpdb_internal_t*)pmpdb->instance; @@ -584,7 +584,7 @@ return 0; } -static result_t pmpdb_get(pmpdb_t* pmpdb, pmp_record_t* records, uint32_t* num_records) +static result_t pmpdb_get(pmp_music_t* pmpdb, pmp_record_t* records, uint32_t* num_records) { pmpdb_internal_t* pmpdbi = (pmpdb_internal_t*)pmpdb->instance; pmp_internal_t* pmpi = (pmp_internal_t*)pmpdb->pmp->instance; @@ -638,7 +638,7 @@ return 0; } -static result_t pmpdb_dump(pmpdb_t* pmpdb, FILE *fp, int level) +static result_t pmpdb_dump(pmp_music_t* pmpdb, FILE *fp, int level) { pmpdb_internal_t* pmpdbi = (pmpdb_internal_t*)pmpdb->instance; if (level > 0) { @@ -652,12 +652,12 @@ -static uint32_t pmppl_add_ref(pmppl_t* pmppl) +static uint32_t pmppl_add_ref(pmp_playlist_t* pmppl) { return interlocked_increment(&pmppl->ref_count); } -static uint32_t pmppl_release(pmppl_t* pmppl) +static uint32_t pmppl_release(pmp_playlist_t* pmppl) { uint32_t count = interlocked_decrement(&pmppl->ref_count); if (count == 0) { @@ -668,7 +668,7 @@ return count; } -static result_t pmppl_write(pmppl_t* pmppl, const ucs2char_t* filename, ucs2char_t* const files[], uint32_t num_files) +static result_t pmppl_write(pmp_playlist_t* pmppl, const ucs2char_t* filename, ucs2char_t* const 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: trunk/pmplib/lib/pmp_irivnavi/pmp_irivnavi.c =================================================================== --- trunk/pmplib/lib/pmp_irivnavi/pmp_irivnavi.c 2007-01-07 14:40:25 UTC (rev 243) +++ trunk/pmplib/lib/pmp_irivnavi/pmp_irivnavi.c 2007-01-07 15:17:10 UTC (rev 244) @@ -87,22 +87,22 @@ static uint32_t pmp_add_ref(pmp_t* pmp); static uint32_t pmp_release(pmp_t* pmp); -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_create_instance_db(pmp_t* pmp, pmp_music_t** ptr_pmpdb); +static result_t pmp_create_instance_pl(pmp_t* pmp, pmp_playlist_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 uint32_t pmpdb_add_ref(pmpdb_t* pmpdb); -static uint32_t pmpdb_release(pmpdb_t* pmpdb); -static result_t pmpdb_read(pmpdb_t* pmpdb); -static result_t pmpdb_write(pmpdb_t* pmpdb); -static result_t pmpdb_set(pmpdb_t* pmpdb, const pmp_record_t* records, uint32_t num_records); -static result_t pmpdb_get(pmpdb_t* pmpdb, pmp_record_t* records, uint32_t* num_records); -static result_t pmpdb_dump(pmpdb_t* pmpdb, FILE *fp, int level); +static uint32_t pmpdb_add_ref(pmp_music_t* pmpdb); +static uint32_t pmpdb_release(pmp_music_t* pmpdb); +static result_t pmpdb_read(pmp_music_t* pmpdb); +static result_t pmpdb_write(pmp_music_t* pmpdb); +static result_t pmpdb_set(pmp_music_t* pmpdb, const pmp_record_t* records, uint32_t num_records); +static result_t pmpdb_get(pmp_music_t* pmpdb, pmp_record_t* records, uint32_t* num_records); +static result_t pmpdb_dump(pmp_music_t* pmpdb, FILE *fp, int level); -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, ucs2char_t* const files[], uint32_t num_files); +static uint32_t pmppl_add_ref(pmp_playlist_t* pmppl); +static uint32_t pmppl_release(pmp_playlist_t* pmppl); +static result_t pmppl_write(pmp_playlist_t* pmppl, const ucs2char_t* filename, ucs2char_t* const files[], uint32_t num_files); int exists_sysfile(const ucs2char_t* path_to_device, const ucs2char_t* sysfilename) { @@ -260,15 +260,15 @@ ) ? 1 : 0; } -static result_t pmp_create_instance_db(pmp_t* pmp, pmpdb_t** ptr_pmpdb) +static result_t pmp_create_instance_db(pmp_t* pmp, pmp_music_t** ptr_pmpdb) { - pmpdb_t* pmpdb = NULL; + pmp_music_t* pmpdb = NULL; irivnavi_t* irivnavi = NULL; *ptr_pmpdb = 0; // Allocate a PMPDB instance. - pmpdb = (pmpdb_t*)calloc(1, sizeof(pmpdb_t)); + pmpdb = (pmp_music_t*)calloc(1, sizeof(pmp_music_t)); if (!pmpdb) { return PMPDBE_OUTOFMEMORY; } @@ -299,14 +299,14 @@ return 0; } -result_t pmp_create_instance_pl(pmp_t* pmp, pmppl_t** ptr_pmppl) +result_t pmp_create_instance_pl(pmp_t* pmp, pmp_playlist_t** ptr_pmppl) { pmp_internal_t* pmpi = (pmp_internal_t*)pmp->instance; - pmppl_t* pmppl = NULL; + pmp_playlist_t* pmppl = NULL; *ptr_pmppl = 0; - pmppl = (pmppl_t*)calloc(1, sizeof(pmppl_t)); + pmppl = (pmp_playlist_t*)calloc(1, sizeof(pmp_playlist_t)); if (!pmppl) { return PMPDBE_OUTOFMEMORY; } @@ -322,12 +322,12 @@ return 0; } -static uint32_t pmpdb_add_ref(pmpdb_t* pmpdb) +static uint32_t pmpdb_add_ref(pmp_music_t* pmpdb) { return interlocked_increment(&pmpdb->ref_count); } -static uint32_t pmpdb_release(pmpdb_t* pmpdb) +static uint32_t pmpdb_release(pmp_music_t* pmpdb) { uint32_t count = interlocked_decrement(&pmpdb->ref_count); if (count == 0) { @@ -341,7 +341,7 @@ return count; } -result_t pmpdb_read(pmpdb_t* pmpdb) +result_t pmpdb_read(pmp_music_t* pmpdb) { irivnavi_t* db = (irivnavi_t*)pmpdb->instance; result_t ret = 0; @@ -396,7 +396,7 @@ return ret; } -result_t pmpdb_write(pmpdb_t* pmpdb) +result_t pmpdb_write(pmp_music_t* pmpdb) { irivnavi_t* db = (irivnavi_t*)pmpdb->instance; result_t ret = 0; @@ -442,7 +442,7 @@ return ret; } -result_t pmpdb_set(pmpdb_t* pmpdb, const pmp_record_t* records, uint32_t num_records) +result_t pmpdb_set(pmp_music_t* pmpdb, const pmp_record_t* records, uint32_t num_records) { irivnavi_t* db = (irivnavi_t*)pmpdb->instance; result_t ret = 0; @@ -494,7 +494,7 @@ return 0; } -static result_t pmpdb_get(pmpdb_t* pmpdb, pmp_record_t* records, uint32_t* num_records) +static result_t pmpdb_get(pmp_music_t* pmpdb, pmp_record_t* records, uint32_t* num_records) { irivnavi_t* db = (irivnavi_t*)pmpdb->instance; result_t ret = 0; @@ -557,7 +557,7 @@ -result_t pmpdb_dump(pmpdb_t* pmpdb, FILE *fp, int level) +result_t pmpdb_dump(pmp_music_t* pmpdb, FILE *fp, int level) { irivnavi_t* db = (irivnavi_t*)pmpdb->instance; irivnavi_repr(db, fp, level); @@ -568,12 +568,12 @@ -static uint32_t pmppl_add_ref(pmppl_t* pmppl) +static uint32_t pmppl_add_ref(pmp_playlist_t* pmppl) { return interlocked_increment(&pmppl->ref_count); } -static uint32_t pmppl_release(pmppl_t* pmppl) +static uint32_t pmppl_release(pmp_playlist_t* pmppl) { uint32_t count = interlocked_decrement(&pmppl->ref_count); if (count == 0) { @@ -582,7 +582,7 @@ return count; } -static result_t pmppl_write(pmppl_t* pmppl, const ucs2char_t* filename, ucs2char_t* const files[], uint32_t num_files) +static result_t pmppl_write(pmp_playlist_t* pmppl, const ucs2char_t* filename, ucs2char_t* const 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: trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c 2007-01-07 14:40:25 UTC (rev 243) +++ trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c 2007-01-07 15:17:10 UTC (rev 244) @@ -218,22 +218,22 @@ static uint32_t pmp_add_ref(pmp_t* pmp); static uint32_t pmp_release(pmp_t* pmp); -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_create_instance_db(pmp_t* pmp, pmp_music_t** ptr_pmpdb); +static result_t pmp_create_instance_pl(pmp_t* pmp, pmp_playlist_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 uint32_t pmpdb_add_ref(pmpdb_t* pmpdb); -static uint32_t pmpdb_release(pmpdb_t* pmpdb); -static result_t pmpdb_read(pmpdb_t* pmpdb); -static result_t pmpdb_write(pmpdb_t* pmpdb); -static result_t pmpdb_set(pmpdb_t* pmpdb, const pmp_record_t* records, uint32_t num_records); -static result_t pmpdb_get(pmpdb_t* pmpdb, pmp_record_t* records, uint32_t* num_records); -static result_t pmpdb_dump(pmpdb_t* pmpdb, FILE *fp, int level); +static uint32_t pmpdb_add_ref(pmp_music_t* pmpdb); +static uint32_t pmpdb_release(pmp_music_t* pmpdb); +static result_t pmpdb_read(pmp_music_t* pmpdb); +static result_t pmpdb_write(pmp_music_t* pmpdb); +static result_t pmpdb_set(pmp_music_t* pmpdb, const pmp_record_t* records, uint32_t num_records); +static result_t pmpdb_get(pmp_music_t* pmpdb, pmp_record_t* records, uint32_t* num_records); +static result_t pmpdb_dump(pmp_music_t* pmpdb, FILE *fp, int level); -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, ucs2char_t* const files[], uint32_t num_files); +static uint32_t pmppl_add_ref(pmp_playlist_t* pmppl); +static uint32_t pmppl_release(pmp_playlist_t* pmppl); +static result_t pmppl_write(pmp_playlist_t* pmppl, const ucs2char_t* filename, ucs2char_t* const files[], uint32_t num_files); @@ -437,15 +437,15 @@ return count; } -static result_t pmp_create_instance_db(pmp_t* pmp, pmpdb_t** ptr_pmpdb) +static result_t pmp_create_instance_db(pmp_t* pmp, pmp_music_t** ptr_pmpdb) { - pmpdb_t* pmpdb = NULL; + pmp_music_t* pmpdb = NULL; pmp_internal_t* pmpi = (pmp_internal_t*)pmp->instance; pmpdb_internal_t* pmpdbi = NULL; *ptr_pmpdb = 0; - pmpdb = calloc(1, sizeof(pmpdb_t)); + pmpdb = calloc(1, sizeof(pmp_music_t)); if (!pmpdb) { return PMPDBE_OUTOFMEMORY; } @@ -472,14 +472,14 @@ return 0; } -static result_t pmp_create_instance_pl(pmp_t* pmp, pmppl_t** ptr_pmppl) +static result_t pmp_create_instance_pl(pmp_t* pmp, pmp_playlist_t** ptr_pmppl) { pmp_internal_t* pmpi = (pmp_internal_t*)pmp->instance; - pmppl_t* pmppl = NULL; + pmp_playlist_t* pmppl = NULL; *ptr_pmppl = 0; - pmppl = calloc(1, sizeof(pmppl_t)); + pmppl = calloc(1, sizeof(pmp_playlist_t)); if (!pmppl) { return PMPDBE_OUTOFMEMORY; } @@ -510,12 +510,12 @@ -static uint32_t pmpdb_add_ref(pmpdb_t* pmpdb) +static uint32_t pmpdb_add_ref(pmp_music_t* pmpdb) { return interlocked_increment(&pmpdb->ref_count); } -static uint32_t pmpdb_release(pmpdb_t* pmpdb) +static uint32_t pmpdb_release(pmp_music_t* pmpdb) { uint32_t count = interlocked_decrement(&pmpdb->ref_count); if (count == 0) { @@ -527,35 +527,35 @@ return count; } -static result_t pmpdb_read(pmpdb_t* pmpdb) +static result_t pmpdb_read(pmp_music_t* pmpdb) { pmpdb_internal_t* pmpdbi = (pmpdb_internal_t*)pmpdb->instance; pmp_internal_t* pmpi = (pmp_internal_t*)pmpdb->pmp->instance; return pp1db_read(&pmpdbi->pp1db, pmpi->env.hdr_filename); } -static result_t pmpdb_write(pmpdb_t* pmpdb) +static result_t pmpdb_write(pmp_music_t* pmpdb) { pmpdb_internal_t* pmpdbi = (pmpdb_internal_t*)pmpdb->instance; pmp_internal_t* pmpi = (pmp_internal_t*)pmpdb->pmp->instance; return pp1db_write(&pmpdbi->pp1db, pmpi->env.hdr_filename); } -static result_t pmpdb_set(pmpdb_t* pmpdb, const pmp_record_t* records, uint32_t num_records) +static result_t pmpdb_set(pmp_music_t* pmpdb, const pmp_record_t* records, uint32_t num_records) { pmpdb_internal_t* pmpdbi = (pmpdb_internal_t*)pmpdb->instance; pmp_internal_t* pmpi = (pmp_internal_t*)pmpdb->pmp->instance; return pp1db_set(&pmpdbi->pp1db, records, num_records, pmpi->env.path_to_root); } -static result_t pmpdb_get(pmpdb_t* pmpdb, pmp_record_t* records, uint32_t* num_records) +static result_t pmpdb_get(pmp_music_t* pmpdb, pmp_record_t* records, uint32_t* num_records) { pmpdb_internal_t* pmpdbi = (pmpdb_internal_t*)pmpdb->instance; pmp_internal_t* pmpi = (pmp_internal_t*)pmpdb->pmp->instance; return pp1db_get(&pmpdbi->pp1db, records, num_records, pmpi->env.path_to_root); } -static result_t pmpdb_dump(pmpdb_t* pmpdb, FILE *fp, int level) +static result_t pmpdb_dump(pmp_music_t* pmpdb, FILE *fp, int level) { pmpdb_internal_t* pmpdbi = (pmpdb_internal_t*)pmpdb->instance; return pp1db_repr(&pmpdbi->pp1db, fp, level); @@ -564,12 +564,12 @@ -static uint32_t pmppl_add_ref(pmppl_t* pmppl) +static uint32_t pmppl_add_ref(pmp_playlist_t* pmppl) { return interlocked_increment(&pmppl->ref_count); } -static uint32_t pmppl_release(pmppl_t* pmppl) +static uint32_t pmppl_release(pmp_playlist_t* pmppl) { uint32_t count = interlocked_decrement(&pmppl->ref_count); if (count == 0) { @@ -578,7 +578,7 @@ return count; } -static result_t pmppl_write(pmppl_t* pmppl, const ucs2char_t* filename, ucs2char_t* const files[], uint32_t num_files) +static result_t pmppl_write(pmp_playlist_t* pmppl, const ucs2char_t* filename, ucs2char_t* const 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) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |