51#define BU_OBSERVER_NULL ((struct bu_observer *)0)
61#define BU_CK_OBSERVER(_op) BU_CKMAG(_op, BU_OBSERVER_MAGIC, "bu_observer magic")
66#define BU_OBSERVER_INIT(_op) { \
67 (_op)->magic = BU_OBSERVER_MAGIC; \
68 BU_VLS_INIT(&(_op)->observer); \
69 BU_VLS_INIT(&(_op)->cmd); \
76#define BU_OBSERVER_INIT_ZERO { BU_OBSERVER_MAGIC, BU_VLS_INIT_ZERO, BU_VLS_INIT_ZERO }
78#define BU_OBSERVER_LIST_INIT_ZERO { 0, 0, NULL }
83#define BU_OBSERVER_IS_INITIALIZED(_op) (((struct bu_observer *)(_op) != BU_OBSERVER_NULL) && LIKELY((_op)->magic == BU_OBSERVER_MAGIC))
91BU_EXPORT
extern int bu_observer_cmd(
void *clientData,
int argc,
const char *argv[]);
Header file for the BRL-CAD common definitions.
void() bu_observer_eval_t(void *, const char *)
void bu_observer_free(struct bu_observer_list *)
void bu_observer_notify(void *context, struct bu_observer_list *observers, char *self, bu_observer_eval_t *ofunc)
int bu_observer_cmd(void *clientData, int argc, const char *argv[])
Routines for implementing the observer pattern.
Global registry of recognized magic numbers.
struct bu_observer * observers