schema_wrapper_utils.h 845 B

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