1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

Feature: Added mount_identifier_get_mount() and mount_identifier_compare()

This commit is contained in:
Philipp Schafft 2020-10-24 07:59:05 +00:00
parent 6c1233402d
commit 673dfb734c
2 changed files with 11 additions and 4 deletions

View File

@ -26,12 +26,12 @@ struct mount_identifier_tag {
REFOBJECT_DEFINE_TYPE(mount_identifier_t);
static int mount_identifier_compare(void *compare_arg, void *a, void *b)
static int mount_identifier_compare__for_tree(void *compare_arg, void *a, void *b)
{
const char *id_a, *id_b;
id_a = refobject_get_name(a);
id_b = refobject_get_name(b);
id_a = mount_identifier_get_mount(a);
id_b = mount_identifier_get_mount(b);
if (!id_a || !id_b || id_a == id_b) {
return 0;
@ -62,3 +62,8 @@ mount_identifier_t * mount_identifier_new(const char *mount)
return n;
}
int mount_identifier_compare(mount_identifier_t *a, mount_identifier_t *b)
{
return mount_identifier_compare__for_tree(NULL, a, b);
}

View File

@ -17,5 +17,7 @@ void navigation_initialize(void);
void navigation_shutdown(void);
mount_identifier_t * mount_identifier_new(const char *mount);
#define mount_identifier_get_mount(identifier) refobject_get_name((identifier))
int mount_identifier_compare(mount_identifier_t *a, mount_identifier_t *b);
#endif