Abstract server active checks

The checks for the server active status are now hidden behind a
macro. This allows for the conditions of the activity to change without
having to alter the code that uses it.
This commit is contained in:
Markus Makela
2016-11-11 11:05:13 +02:00
parent ae7981f147
commit 2fcfc102be
4 changed files with 55 additions and 58 deletions

View File

@ -140,6 +140,11 @@ typedef struct server
#define SERVER_STALE_SLAVE 0x2000 /**<< Slave status is possible even without a master */
#define SERVER_RELAY_MASTER 0x4000 /**<< Server is a relay master */
/**
* Is the server valid and active
*/
#define SERVER_IS_ACTIVE(server) (server->is_active)
/**
* Is the server running - the macro returns true if the server is marked as running
* regardless of it's state as a master or slave