diff --git a/Tests.mk b/Tests.mk index 2f471c1d1c..15101f1270 100644 --- a/Tests.mk +++ b/Tests.mk @@ -56,6 +56,7 @@ TEST_C_SOURCES=$(wildcard \ src/metadata/*.c \ src/scriptable/*.c \ src/undo/*.c \ + src/filereader/*.c \ Tests/*.c) TEST_C_SOURCES:=$(filter-out src/main.c,$(TEST_C_SOURCES)) TEST_C_OBJS:=$(addprefix $(BUILD)/,\ diff --git a/include/deadbeef/deadbeef.h b/include/deadbeef/deadbeef.h index 92bd3c2586..825882f777 100644 --- a/include/deadbeef/deadbeef.h +++ b/include/deadbeef/deadbeef.h @@ -1750,12 +1750,24 @@ typedef struct { /// usually from the UI plugin's start method. void (*register_for_undo) (ddb_undo_hooks_t *undo_hooks); + /// Get all items from specified playlist as an array, increase reference counts. + /// The resulting array must be freed. + /// @return number of resulting items size_t (*plt_get_items) (ddb_playlist_t *plt, ddb_playItem_t ***out_items); + + /// Get all selected items from specified playlist as an array, increase reference counts + /// The resulting array must be freed. + /// @return number of resulting items size_t (*plt_get_selected_items) (ddb_playlist_t *plt, ddb_playItem_t ***out_items); + /// Load playlist from buffer + /// @return 0 on success, -1 on error int (*plt_load_from_buffer) (ddb_playlist_t *plt, const uint8_t *buffer, size_t size); - ssize_t (*plt_save_to_buffer) (ddb_playlist_t *plt, uint8_t **out_buffer); + /// Save playlist to the buffer. + /// The resulting buffer must be freed after use. + /// @return buffer size on success, -1 on error + ssize_t (*plt_save_to_buffer) (ddb_playlist_t *plt, uint8_t **out_buffer); #endif } DB_functions_t;