]> git.stg.codes - stg.git/blobdiff - projects/rlm_stg/stgpair.h
Fixed check for empty pair in rlm_stg.
[stg.git] / projects / rlm_stg / stgpair.h
index 19b42bc182fe724ea1d83db6faf9639372b2e18f..e82c667234ef09194d6efa57087b22dc9db70e5f 100644 (file)
@@ -1,12 +1,33 @@
 #ifndef __STG_STGPAIR_H__
 #define __STG_STGPAIR_H__
 
+#include <stddef.h>
+
 #define STGPAIR_KEYLENGTH 64
 #define STGPAIR_VALUELENGTH 256
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct STG_PAIR {
     char key[STGPAIR_KEYLENGTH];
     char value[STGPAIR_VALUELENGTH];
 } STG_PAIR;
 
+typedef struct STG_RESULT {
+    STG_PAIR* modify;
+    STG_PAIR* reply;
+} STG_RESULT;
+
+inline
+int emptyPair(const STG_PAIR* pair)
+{
+    return pair == NULL || pair->key[0] == '\0' || pair->value[0] == '\0';
+}
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif