ELinks 0.16.1.1
object.h File Reference
#include "util/lists.h"
#include "util/error.h"
Include dependency graph for object.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  object
struct  object_head

Macros

#define OBJECT_HEAD(type)
#define object_lock_debug(obj, info)
#define object_sanity_check(obj)
#define object_set_name(obj, objname)
#define INIT_OBJECT(name)
#define get_object_refcount(obj)
#define is_object_used(obj)
#define object_lock(obj)
#define object_unlock(obj)
#define object_nolock(obj, name)

Macro Definition Documentation

◆ get_object_refcount

#define get_object_refcount ( obj)
Value:
((obj)->object.refcount)

◆ INIT_OBJECT

#define INIT_OBJECT ( name)
Value:
{ 0, name }

◆ is_object_used

#define is_object_used ( obj)
Value:
(!!(obj)->object.refcount)

◆ OBJECT_HEAD

#define OBJECT_HEAD ( type)
Value:
struct object object
#define LIST_HEAD(x)
Definition lists.h:117
const char * type
Definition download.c:1812
Definition object.h:14

◆ object_lock

#define object_lock ( obj)
Value:
do { \
object_sanity_check(obj); \
(obj)->object.refcount++; \
object_lock_debug(obj, "incremented"); \
} while (0)

◆ object_lock_debug

#define object_lock_debug ( obj,
info )

◆ object_nolock

#define object_nolock ( obj,
name )
Value:
do { \
object_set_name(obj, name); \
object_sanity_check(obj); \
object_lock_debug(obj, "initialized"); \
} while (0)

◆ object_sanity_check

#define object_sanity_check ( obj)
Value:
do { \
assert(obj); \
assertm((obj)->object.refcount >= 0, \
"Object %s[%p] refcount underflow.", \
(obj)->object.name, obj); \
if_assert_failed (obj)->object.refcount = 0; \
} while (0)

◆ object_set_name

#define object_set_name ( obj,
objname )
Value:
do { (obj)->object.name = (objname); } while (0)

◆ object_unlock

#define object_unlock ( obj)
Value:
do { \
(obj)->object.refcount--; \
object_lock_debug(obj, "decremented"); \
object_sanity_check(obj); \
} while (0)