1275970Scy/*
2275970Scy * vint64ops.h - operations on 'vint64' values
3275970Scy *
4275970Scy * Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project.
5275970Scy * The contents of 'html/copyright.html' apply.
6275970Scy * ----------------------------------------------------------------------
7275970Scy * This is an attempt to get the vint64 calculations stuff centralised.
8275970Scy */
9275970Scy#ifndef VINT64OPS_H
10275970Scy#define VINT64OPS_H
11275970Scy
12275970Scy/* signed/unsigned compare. returns 1/0/-1 if lhs >/=/< rhs */
13275970Scyextern int icmpv64(const vint64 * lhs,	const vint64 * rhs);
14275970Scyextern int ucmpv64(const vint64 * lhs,	const vint64 * rhs);
15275970Scy
16275970Scy/* add / subtract */
17275970Scyextern vint64 addv64(const vint64 *lhs, const vint64 *rhs);
18275970Scyextern vint64 addv64i32(const vint64 * lhs, int32_t rhs);
19275970Scyextern vint64 addv64u32(const vint64 * lhs, uint32_t rhs);
20275970Scy
21275970Scyextern vint64 subv64(const vint64 *lhs, const vint64 *rhs);
22275970Scyextern vint64 subv64i32(const vint64 * lhs, int32_t rhs);
23275970Scyextern vint64 subv64u32(const vint64 * lhs, uint32_t rhs);
24275970Scy
25275970Scy/* parsing. works like strtoul() or strtoull() */
26275970Scyextern vint64 strtouv64(const char * begp, char ** endp, int base);
27275970Scy
28275970Scy#endif /*!defined(VINT64OPS_H)*/
29