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