( epg_object_t *eo, epg_object_tree_t *tree )
{
assert(eo->refcount == 0);
+#ifdef EPG_TRACE
+ tvhlog(LOG_DEBUG, "epg", "eo [%p, %d, %lu, %s] destroy",
+ eo, eo->id, eo->type, eo->uri);
+#endif
if (eo->uri) free(eo->uri);
if (tree) RB_REMOVE(tree, eo, uri_link);
if (eo->_updated) LIST_REMOVE(eo, up_link);
static void _epg_object_getref ( void *o )
{
epg_object_t *eo = o;
+#ifdef EPG_TRACE
+ tvhlog(LOG_DEBUG, "epg", "eo [%p, %d, %lu, %s] getref %d",
+ eo, eo->id, eo->type, eo->uri, eo->refcount+1);
+#endif
if (eo->refcount == 0) LIST_REMOVE(eo, un_link);
eo->refcount++;
}
static void _epg_object_putref ( void *o )
{
epg_object_t *eo = o;
+#ifdef EPG_TRACE
+ tvhlog(LOG_DEBUG, "epg", "eo [%p, %d, %lu, %s] putref %d",
+ eo, eo->id, eo->type, eo->uri, eo->refcount-1);
+#endif
assert(eo->refcount>0);
eo->refcount--;
if (!eo->refcount) eo->destroy(eo);
static void _epg_object_set_updated ( void *o )
{
- epg_object_t *eo = (epg_object_t*)o;
+ epg_object_t *eo = o;
if (!eo->_updated) {
+#ifdef EPG_TRACE
+ tvhlog(LOG_DEBUG, "epg", "eo [%p, %d, %lu, %s] updated",
+ eo, eo->id, eo->type, eo->uri, eo->refcount-1);
+#endif
eo->_updated = 1;
LIST_INSERT_HEAD(&epg_object_updated, eo, up_link);
}
_epg_object_set_updated(eo);
LIST_INSERT_HEAD(&epg_object_unref, eo, un_link);
LIST_INSERT_HEAD(&epg_objects[eo->id & EPG_HASH_MASK], eo, id_link);
+#ifdef EPG_TRACE
+ tvhlog(LOG_DEBUG, "epg", "eo [%p, %d, %lu, %s] created",
+ eo, eo->id, eo->type, eo->uri, eo->refcount-1);
+#endif
}
static epg_object_t *_epg_object_find_by_uri
static htsmsg_t * _epg_object_serialize ( void *o )
{
epg_object_t *eo = o;
+#ifdef EPG_TRACE
+ tvhlog(LOG_DEBUG, "epg", "eo [%p, %d, %lu, %s] serialize",
+ eo, eo->id, eo->type, eo->uri, eo->refcount);
+#endif
htsmsg_t *m;
if ( !eo->id || !eo->type ) return NULL;
m = htsmsg_create_map();
eo->uri = (char*)htsmsg_get_str(m, "uri");
if ((s = htsmsg_get_str(m, "grabber")))
eo->grabber = epggrab_module_find_by_id(s);
+#ifdef EPG_TRACE
+ tvhlog(LOG_DEBUG, "epg", "eo [%p, %d, %lu, %s] deserialize",
+ eo, eo->id, eo->type, eo->uri, 0);
+#endif
return eo;
}