mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-02-02 15:07:36 -05:00
Update: Renamed "parent" to "associated" to make it more generally useful
This commit is contained in:
parent
4e1dc94c50
commit
a3f29ae42a
@ -19,7 +19,7 @@
|
||||
|
||||
#define TO_BASE(x) REFOBJECT_TO_TYPE((x), refobject_base_t *)
|
||||
|
||||
refobject_t refobject_new(size_t len, refobject_free_t freecb, void *userdata, const char *name, refobject_t parent)
|
||||
refobject_t refobject_new(size_t len, refobject_free_t freecb, void *userdata, const char *name, refobject_t associated)
|
||||
{
|
||||
refobject_base_t *ret = NULL;
|
||||
|
||||
@ -44,13 +44,13 @@ refobject_t refobject_new(size_t len, refobject_free_t freecb, void *userdat
|
||||
}
|
||||
}
|
||||
|
||||
if (!REFOBJECT_IS_NULL(parent)) {
|
||||
if (refobject_ref(parent) != 0) {
|
||||
if (!REFOBJECT_IS_NULL(associated)) {
|
||||
if (refobject_ref(associated) != 0) {
|
||||
refobject_unref(ret);
|
||||
return REFOBJECT_NULL;
|
||||
}
|
||||
|
||||
ret->parent = parent;
|
||||
ret->associated = associated;
|
||||
}
|
||||
|
||||
return (refobject_t)ret;
|
||||
@ -139,7 +139,7 @@ const char * refobject_get_name(refobject_t self)
|
||||
return ret;
|
||||
}
|
||||
|
||||
refobject_t refobject_get_parent(refobject_t self)
|
||||
refobject_t refobject_get_associated(refobject_t self)
|
||||
{
|
||||
refobject_t ret;
|
||||
|
||||
@ -147,7 +147,7 @@ refobject_t refobject_get_parent(refobject_t self)
|
||||
return REFOBJECT_NULL;
|
||||
|
||||
thread_mutex_lock(&(TO_BASE(self)->lock));
|
||||
ret = TO_BASE(self)->parent;
|
||||
ret = TO_BASE(self)->associated;
|
||||
thread_mutex_unlock(&(TO_BASE(self)->lock));
|
||||
|
||||
return ret;
|
||||
|
@ -36,15 +36,15 @@ struct refobject_base_tag {
|
||||
void *userdata;
|
||||
refobject_free_t freecb;
|
||||
char *name;
|
||||
refobject_t parent;
|
||||
refobject_t associated;
|
||||
};
|
||||
|
||||
refobject_t refobject_new(size_t len, refobject_free_t freecb, void *userdata, const char *name, refobject_t parent);
|
||||
refobject_t refobject_new(size_t len, refobject_free_t freecb, void *userdata, const char *name, refobject_t associated);
|
||||
int refobject_ref(refobject_t self);
|
||||
int refobject_unref(refobject_t self);
|
||||
void * refobject_get_userdata(refobject_t self);
|
||||
int refobject_set_userdata(refobject_t self, void *userdata);
|
||||
const char * refobject_get_name(refobject_t self);
|
||||
refobject_t refobject_get_parent(refobject_t self);
|
||||
refobject_t refobject_get_associated(refobject_t self);
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user