MXS-2013 Move or remove STR-macros

- The ones that were not used were removed.
- The ones that were used were moved close to the actual type.
  In most cases some values were missing and if the definition is
  close to the type there is a remote chance that they will stay
  in sync. If detached, they surely will not.
This commit is contained in:
Johan Wikman
2018-08-14 15:58:44 +03:00
parent ae43e4f0f2
commit f975035e53
8 changed files with 66 additions and 147 deletions

View File

@ -161,6 +161,16 @@ typedef enum
MXS_AUTH_STATE_COMPLETE /**< Authentication is complete */
} mxs_auth_state_t;
#define STRPROTOCOLSTATE(s) ((s) == MXS_AUTH_STATE_INIT ? "MXS_AUTH_STATE_INIT" : \
((s) == MXS_AUTH_STATE_PENDING_CONNECT ? "MXS_AUTH_STATE_PENDING_CONNECT" : \
((s) == MXS_AUTH_STATE_CONNECTED ? "MXS_AUTH_STATE_CONNECTED" : \
((s) == MXS_AUTH_STATE_MESSAGE_READ ? "MXS_AUTH_STATE_MESSAGE_READ" : \
((s) == MXS_AUTH_STATE_RESPONSE_SENT ? "MXS_AUTH_STATE_RESPONSE_SENT" : \
((s) == MXS_AUTH_STATE_FAILED ? "MXS_AUTH_STATE_FAILED" : \
((s) == MXS_AUTH_STATE_HANDSHAKE_FAILED ? "MXS_AUTH_STATE_HANDSHAKE_FAILED" : \
((s) == MXS_AUTH_STATE_COMPLETE ? "MXS_AUTH_STATE_COMPLETE" : \
"UNKNOWN AUTH STATE"))))))))
/**
* The MXS_AUTHENTICATOR version data. The following should be updated whenever
* the MXS_AUTHENTICATOR structure is changed. See the rules defined in modinfo.h