Skip to content
Snippets Groups Projects
Commit ec0e6a5c authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

add STATE_FLAGS_TOPARSE flag

parent f761cca8
No related branches found
No related tags found
No related merge requests found
......@@ -29,16 +29,17 @@
#define STATE_FLAGS_TORELOAD (1 << 5) // ...
#define STATE_FLAGS_TORESTART (1 << 6)
#define STATE_FLAGS_TOUNSUPERVISE (1 << 7)
#define STATE_FLAGS_ISDOWNFILE (1 << 8)
#define STATE_FLAGS_ISEARLIER (1 << 9)
#define STATE_FLAGS_ISENABLED (1 << 10)
#define STATE_FLAGS_ISPARSED (1 << 11)
#define STATE_FLAGS_ISSUPERVISED (1 << 12)
#define STATE_FLAGS_ISUP (1 << 13)
#define STATE_FLAGS_TOPARSE (1 << 8)
#define STATE_FLAGS_ISDOWNFILE (1 << 9)
#define STATE_FLAGS_ISEARLIER (1 << 10)
#define STATE_FLAGS_ISENABLED (1 << 11)
#define STATE_FLAGS_ISPARSED (1 << 12)
#define STATE_FLAGS_ISSUPERVISED (1 << 13)
#define STATE_FLAGS_ISUP (1 << 14)
#define STATE_FLAGS_TOPROPAGATE (1 << 14)
#define STATE_FLAGS_WANTUP (1 << 15)
#define STATE_FLAGS_WANTDOWN (1 << 16)
#define STATE_FLAGS_TOPROPAGATE (1 << 15)
#define STATE_FLAGS_WANTUP (1 << 16)
#define STATE_FLAGS_WANTDOWN (1 << 17)
typedef struct ss_state_s ss_state_t, *ss_state_t_ref ;
struct ss_state_s
......@@ -50,6 +51,7 @@ struct ss_state_s
uint32_t toreload ;
uint32_t torestart ;
uint32_t tounsupervise ;
uint32_t toparse ;
uint32_t isdownfile ;
uint32_t isearlier ;
uint32_t isenabled ;
......@@ -58,7 +60,7 @@ struct ss_state_s
uint32_t isup ;
} ;
#define STATE_ZERO { 2,2,2,2,2,2,2,2,2,2 }
#define STATE_ZERO { 2,2,2,2,2,2,2,2,2,2,2 }
extern ss_state_t const ss_state_zero ;
extern int state_check(char const *base, char const *name) ;
......
......@@ -43,6 +43,8 @@ int service_is(ss_state_t *ste, uint32_t flag)
case STATE_FLAGS_TOUNSUPERVISE : return FLAGS_ISSET(ste->tounsupervise, STATE_FLAGS_TRUE) ? 1 : 0 ;
case STATE_FLAGS_TOPARSE : return FLAGS_ISSET(ste->toparse, STATE_FLAGS_TRUE) ? 1 : 0 ;
case STATE_FLAGS_ISDOWNFILE : return FLAGS_ISSET(ste->isdownfile, STATE_FLAGS_TRUE) ? 1 : 0 ;
case STATE_FLAGS_ISEARLIER : return FLAGS_ISSET(ste->isearlier, STATE_FLAGS_TRUE) ? 1 : 0 ;
......
......@@ -38,6 +38,7 @@ int state_get_flags(char const *base, char const *name, int flags)
case STATE_FLAGS_TORELOAD: return sta.toreload ;
case STATE_FLAGS_TORESTART: return sta.torestart ;
case STATE_FLAGS_TOUNSUPERVISE: return sta.tounsupervise ;
case STATE_FLAGS_TOPARSE: return sta.toparse ;
case STATE_FLAGS_ISDOWNFILE: return sta.isdownfile ;
case STATE_FLAGS_ISEARLIER: return sta.isearlier ;
case STATE_FLAGS_ISENABLED: return sta.isenabled ;
......
......@@ -26,10 +26,11 @@ void state_pack(char *pack, ss_state_t *sta)
uint32_pack_big(pack + 4, sta->toreload) ;
uint32_pack_big(pack + 8, sta->torestart) ;
uint32_pack_big(pack + 12, sta->tounsupervise) ;
uint32_pack_big(pack + 16, sta->isdownfile) ;
uint32_pack_big(pack + 20, sta->isearlier) ;
uint32_pack_big(pack + 24, sta->isenabled) ;
uint32_pack_big(pack + 28, sta->isparsed) ;
uint32_pack_big(pack + 32, sta->issupervised) ;
uint32_pack_big(pack + 36, sta->isup) ;
uint32_pack_big(pack + 16, sta->toparse) ;
uint32_pack_big(pack + 20, sta->isdownfile) ;
uint32_pack_big(pack + 24, sta->isearlier) ;
uint32_pack_big(pack + 28, sta->isenabled) ;
uint32_pack_big(pack + 32, sta->isparsed) ;
uint32_pack_big(pack + 36, sta->issupervised) ;
uint32_pack_big(pack + 40, sta->isup) ;
}
......@@ -28,6 +28,7 @@ void state_set_flag(ss_state_t *sta, int flags, int flags_val)
case STATE_FLAGS_TORELOAD: sta->toreload = flags_val ; break ;
case STATE_FLAGS_TORESTART: sta->torestart = flags_val ; break ;
case STATE_FLAGS_TOUNSUPERVISE: sta->tounsupervise = flags_val ; break ;
case STATE_FLAGS_TOPARSE: sta->toparse = flags_val ; break ;
case STATE_FLAGS_ISDOWNFILE: sta->isdownfile = flags_val ; break ;
case STATE_FLAGS_ISEARLIER: sta->isearlier = flags_val ; break ;
case STATE_FLAGS_ISENABLED: sta->isenabled = flags_val ; break ;
......
......@@ -28,6 +28,7 @@ void state_unpack(char *pack,ss_state_t *sta)
uint32_t toreload ;
uint32_t torestart ;
uint32_t tounsupervise ;
uint32_t toparse ;
uint32_t isdownfile ;
uint32_t isearlier ;
uint32_t isenabled ;
......@@ -47,21 +48,24 @@ void state_unpack(char *pack,ss_state_t *sta)
uint32_unpack_big(pack + 12, &tounsupervise) ;
sta->tounsupervise = tounsupervise ;
uint32_unpack_big(pack + 16, &isdownfile) ;
uint32_unpack_big(pack + 16, &toparse) ;
sta->toparse = toparse ;
uint32_unpack_big(pack + 20, &isdownfile) ;
sta->isdownfile = isdownfile ;
uint32_unpack_big(pack + 20, &isearlier) ;
uint32_unpack_big(pack + 24, &isearlier) ;
sta->isearlier = isearlier ;
uint32_unpack_big(pack + 24, &isenabled) ;
uint32_unpack_big(pack + 28, &isenabled) ;
sta->isenabled = isenabled ;
uint32_unpack_big(pack + 28, &isparsed) ;
uint32_unpack_big(pack + 32, &isparsed) ;
sta->isparsed = isparsed ;
uint32_unpack_big(pack + 32, &issupervised) ;
uint32_unpack_big(pack + 36, &issupervised) ;
sta->issupervised = issupervised ;
uint32_unpack_big(pack + 36, &isup) ;
uint32_unpack_big(pack + 40, &isup) ;
sta->isup = isup ;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment