1 #ifndef INCLUDE_status_h__
2 #define INCLUDE_status_h__
9 typedef struct object_state object_state
;
11 /* macros used on the 'state' member of the object_state struct */
12 #define extract_state(state) (state & 0xffff)
13 #define extract_type(state) ((state >> 16) & 1)
14 #define concat_state(type, state) ((type << 16) | state)
16 extern int prime_object_states(size_t *hosts
, size_t *services
);
17 extern object_state
*get_host_state(const char *name
);
18 extern object_state
*get_service_state(const char *h_name
, const char *s_name
);
19 extern object_state
*get_object_state(const char *name
, size_t id
);
20 extern size_t foreach_state(int id
, int (*fn
)(object_state
*));
21 #endif /* INCLUDE_status_h__ */