summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b76dd1f)
raw | patch | inline | side by side (parent: b76dd1f)
author | Sebastian Harl <sh@tokkee.org> | |
Wed, 11 Mar 2015 19:00:27 +0000 (20:00 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Wed, 11 Mar 2015 19:00:27 +0000 (20:00 +0100) |
src/core/data.c | patch | blob | history |
diff --git a/src/core/data.c b/src/core/data.c
index 2b1cff2ae066316cb1628a7037fa3f250ef21496..44353057b5df70bcb8db19da6600166d4786500d 100644 (file)
--- a/src/core/data.c
+++ b/src/core/data.c
char **v = array->data.array.values;
tmp.data.string = v[i];
}
+ else if (type == SDB_TYPE_DATETIME) {
+ sdb_time_t *v = array->data.array.values;
+ tmp.data.datetime = v[i];
+ }
+ else if (type == SDB_TYPE_BINARY) {
+ struct {
+ size_t length;
+ unsigned char *datum;
+ } *v = array->data.array.values;
+ assert(sizeof(tmp.data.binary) == sizeof(v[i]));
+ memcpy(&tmp.data.binary, &v[i], sizeof(v[i]));
+ }
+ else if (type == SDB_TYPE_REGEX) {
+ struct {
+ char *raw;
+ regex_t regex;
+ } *v = array->data.array.values;
+ assert(sizeof(tmp.data.re) == sizeof(v[i]));
+ memcpy(&tmp.data.re, &v[i], sizeof(v[i]));
+ }
else {
- /* TODO */
- errno = ENOTSUP;
+ errno = EINVAL;
return -1;
}