db_updater: Put parentheses back
[merlin.git] / status.h
blob9cb024cfe77caef35a5755dd55c6708fd7794f90
1 #ifndef INCLUDE_status_h__
2 #define INCLUDE_status_h__
3 #include "state.h"
5 struct object_state {
6 char *name;
7 int state;
8 };
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__ */