idnode: add function to check if node is instance of a class
This commit is contained in:
parent
7eb0f700ef
commit
7844445fb6
3 changed files with 15 additions and 4 deletions
10
src/idnode.c
10
src/idnode.c
|
@ -217,6 +217,16 @@ idnode_is_leaf(idnode_t *in)
|
|||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
idnode_is_instance(idnode_t *in, const idclass_t *idc)
|
||||
{
|
||||
const idclass_t *ic = in->in_class;
|
||||
for(; ic != NULL; ic = ic->ic_super) {
|
||||
if (ic == idc) return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* **************************************************************************
|
||||
* Properties
|
||||
* *************************************************************************/
|
||||
|
|
|
@ -105,15 +105,16 @@ typedef LIST_HEAD(,idnode_filter_ele) idnode_filter_t;
|
|||
|
||||
void idnode_init(void);
|
||||
|
||||
int idnode_insert(idnode_t *in, const char *uuid, const idclass_t *class);
|
||||
int idnode_insert(idnode_t *in, const char *uuid, const idclass_t *idc);
|
||||
void idnode_unlink(idnode_t *in);
|
||||
|
||||
const char *idnode_uuid_as_str (const idnode_t *in);
|
||||
idnode_set_t *idnode_get_childs (idnode_t *in);
|
||||
int idnode_is_leaf (idnode_t *in);
|
||||
int idnode_is_instance (idnode_t *in, const idclass_t *idc);
|
||||
|
||||
void *idnode_find (const char *uuid, const idclass_t *class);
|
||||
idnode_set_t *idnode_find_all(const idclass_t *class);
|
||||
void *idnode_find (const char *uuid, const idclass_t *idc);
|
||||
idnode_set_t *idnode_find_all(const idclass_t *idc);
|
||||
|
||||
void idnode_notify_title_changed(void *obj);
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ prop_write_values(void *obj, const property_t *pl, htsmsg_t *m, int optmask)
|
|||
//tvhwarn("prop", "invalid property %s", f->hmf_name);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/* Ignore */
|
||||
if(p->opts & optmask) continue;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue