| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | #ifndef SCHEMA_WRAPPER_UTILS_H |
| 4 | #define SCHEMA_WRAPPER_UTILS_H |
| 5 | |
| 6 | #include "database/rrd.h" |
| 7 | |
| 8 | #include <sys/time.h> |
| 9 | #include <google/protobuf/timestamp.pb.h> |
| 10 | #include <google/protobuf/map.h> |
| 11 | |
| 12 | #if GOOGLE_PROTOBUF_VERSION < 3001000 |
| 13 | #define PROTO_COMPAT_MSG_SIZE(msg) (size_t)msg.ByteSize() |
| 14 | #define PROTO_COMPAT_MSG_SIZE_PTR(msg) (size_t)msg->ByteSize() |
| 15 | #else |
| 16 | #define PROTO_COMPAT_MSG_SIZE(msg) msg.ByteSizeLong() |
| 17 | #define PROTO_COMPAT_MSG_SIZE_PTR(msg) msg->ByteSizeLong() |
| 18 | #endif |
| 19 | |
| 20 | void set_google_timestamp_from_timeval(struct timeval tv, google::protobuf::Timestamp *ts); |
| 21 | void set_timeval_from_google_timestamp(const google::protobuf::Timestamp &ts, struct timeval *tv); |
| 22 | int label_add_to_map_callback(const char *name, const char *value, RRDLABEL_SRC ls, void *data); |
| 23 | |
| 24 | #endif /* SCHEMA_WRAPPER_UTILS_H */ |