1290001Sglebius/* 2290001Sglebius * vint64ops.h - operations on 'vint64' values 3290001Sglebius * 4290001Sglebius * Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project. 5290001Sglebius * The contents of 'html/copyright.html' apply. 6290001Sglebius * ---------------------------------------------------------------------- 7290001Sglebius * This is an attempt to get the vint64 calculations stuff centralised. 8290001Sglebius */ 9290001Sglebius#ifndef VINT64OPS_H 10290001Sglebius#define VINT64OPS_H 11290001Sglebius 12290001Sglebius/* signed/unsigned compare. returns 1/0/-1 if lhs >/=/< rhs */ 13290001Sglebiusextern int icmpv64(const vint64 * lhs, const vint64 * rhs); 14290001Sglebiusextern int ucmpv64(const vint64 * lhs, const vint64 * rhs); 15290001Sglebius 16290001Sglebius/* add / subtract */ 17290001Sglebiusextern vint64 addv64(const vint64 *lhs, const vint64 *rhs); 18290001Sglebiusextern vint64 addv64i32(const vint64 * lhs, int32_t rhs); 19290001Sglebiusextern vint64 addv64u32(const vint64 * lhs, uint32_t rhs); 20290001Sglebius 21290001Sglebiusextern vint64 subv64(const vint64 *lhs, const vint64 *rhs); 22290001Sglebiusextern vint64 subv64i32(const vint64 * lhs, int32_t rhs); 23290001Sglebiusextern vint64 subv64u32(const vint64 * lhs, uint32_t rhs); 24290001Sglebius 25290001Sglebius/* parsing. works like strtoul() or strtoull() */ 26290001Sglebiusextern vint64 strtouv64(const char * begp, char ** endp, int base); 27290001Sglebius 28290001Sglebius#endif /*!defined(VINT64OPS_H)*/ 29