summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7624ec9)
raw | patch | inline | side by side (parent: 7624ec9)
author | Sebastian Harl <sh@tokkee.org> | |
Tue, 23 Dec 2014 17:25:57 +0000 (18:25 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Tue, 23 Dec 2014 17:25:57 +0000 (18:25 +0100) |
That is, marshal the regex's raw string to be recompiled by the receiver.
src/utils/proto.c | patch | blob | history | |
t/unit/utils/proto_test.c | patch | blob | history |
diff --git a/src/utils/proto.c b/src/utils/proto.c
index af4215b8f987a32c5c0c264f9b5f43bbec56ed5f..56ef745ff0d5f6b06336174f55538b40fd042013 100644 (file)
--- a/src/utils/proto.c
+++ b/src/utils/proto.c
else if (datum->type == SDB_TYPE_BINARY)
n = marshal_binary(buf, buf_len,
datum->data.binary.length, datum->data.binary.datum);
+ else if (datum->type == SDB_TYPE_REGEX)
+ n = marshal_string(buf, buf_len, datum->data.re.raw);
if (n < 0)
return n;
index 1ec0615fa33fd7a7f29c2796a9c2c369e92afebe..52ae936bc4bf6a69bf3ab77f81e67093524e26d3 100644 (file)
#define STRING_TYPE "\0\0\0\3"
#define DATETIME_TYPE "\0\0\0\4"
#define BINARY_TYPE "\0\0\0\5"
+#define REGEX_TYPE "\0\0\0\6"
#define NULL_ARRAY "\0\0\1\0"
#define INT_ARRAY "\0\0\1\1"
#define STRING_ARRAY "\0\0\1\3"
#define DATETIME_ARRAY "\0\0\1\4"
#define BINARY_ARRAY "\0\0\1\5"
+#define REGEX_ARRAY "\0\0\1\6"
regex_t dummy_re;
int64_t int_values[] = { 47, 11, 23 };
},
{
{ SDB_TYPE_REGEX, { .re = { "dummy", dummy_re } } },
- -1, NULL, /* not supported */
+ 14, REGEX_TYPE "\0\0\0\x6" "dummy\0",
},
{
{ SDB_TYPE_INTEGER | SDB_TYPE_ARRAY, { .array = {