summaryrefslogtreecommitdiffstats
path: root/utils/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils/common.c')
-rw-r--r--utils/common.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/utils/common.c b/utils/common.c
index c6d1c34..8a8f303 100644
--- a/utils/common.c
+++ b/utils/common.c
@@ -121,3 +121,28 @@ glusterBlockFormatSize(const char *dom, size_t bytes)
return buf;
}
+
+
+/* Return value and meaning
+ * 1 - true/set
+ * 0 - false/unset
+ * -1 - unknown string
+ */
+int
+convertStringToTrillianParse(const char *opt)
+{
+ int i;
+
+
+ if (!opt) {
+ return -1;
+ }
+
+ for (i = 1; i < GB_BOOL_MAX; i++) {
+ if (!strcmp(opt, ConvertStringToTrillianLookup[i])) {
+ return i%2;
+ }
+ }
+
+ return -1;
+}