X-Git-Url: http://www.project-moonshot.org/gitweb/?p=trust_router.git;a=blobdiff_plain;f=include%2Ftr_util.h;fp=include%2Ftr_util.h;h=9b2da06c461c9c3f93c5ab3f04249b9df186f2ff;hp=3a3f7bcdf909d9d49dedcd4bff8605ee3d4e9eda;hb=6f65c9cce86719147d0b4dcc9823b25443c2d185;hpb=eaa1a8ceed54fbfadc2638cf383aaa12ab446a57 diff --git a/include/tr_util.h b/include/tr_util.h index 3a3f7bc..9b2da06 100644 --- a/include/tr_util.h +++ b/include/tr_util.h @@ -35,8 +35,17 @@ #ifndef TR_UTIL_H #define TR_UTIL_H +#include #include -TR_EXPORT int tr_cmp_timespec(struct timespec *ts1, struct timespec *ts2); +/* NB, tr_bin_to_hex() is also prototyped in trust_router/tr_dh.h */ +TR_EXPORT void tr_bin_to_hex(const unsigned char * bin, size_t binlen, + char * hex_out, size_t hex_len); +TR_EXPORT int tr_cmp_timespec(const struct timespec *ts1, const struct timespec *ts2); +int tr_add_timespec(const struct timespec *ts1, const struct timespec *ts2, struct timespec *sum); +int tr_sub_timespec(const struct timespec *ts1_copy, const struct timespec *ts2_copy, struct timespec *diff); +char *timespec_to_str(const struct timespec *ts); +struct timespec *tr_clock_convert(clockid_t from, const struct timespec *when, + clockid_t to, struct timespec *dst); #endif /* TR_UTIL_H */