1/* $NetBSD: vint64ops.h,v 1.5 2020/05/25 20:47:20 christos Exp $ */ 2 3/* 4 * vint64ops.h - operations on 'vint64' values 5 * 6 * Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project. 7 * The contents of 'html/copyright.html' apply. 8 * ---------------------------------------------------------------------- 9 * This is an attempt to get the vint64 calculations stuff centralised. 10 */ 11#ifndef VINT64OPS_H 12#define VINT64OPS_H 13 14/* signed/unsigned compare. returns 1/0/-1 if lhs >/=/< rhs */ 15extern int icmpv64(const vint64 * lhs, const vint64 * rhs); 16extern int ucmpv64(const vint64 * lhs, const vint64 * rhs); 17 18/* add / subtract */ 19extern vint64 addv64(const vint64 *lhs, const vint64 *rhs); 20extern vint64 addv64i32(const vint64 * lhs, int32_t rhs); 21extern vint64 addv64u32(const vint64 * lhs, uint32_t rhs); 22 23extern vint64 subv64(const vint64 *lhs, const vint64 *rhs); 24extern vint64 subv64i32(const vint64 * lhs, int32_t rhs); 25extern vint64 subv64u32(const vint64 * lhs, uint32_t rhs); 26 27/* parsing. works like strtoul() or strtoull() */ 28extern vint64 strtouv64(const char * begp, char ** endp, int base); 29 30#endif /*!defined(VINT64OPS_H)*/ 31