wmbiff: Bump to version 0.4.32.
[dockapps.git] / wmmon / ulllib.h
blobcade28128c96f7f4d99048ae2147dddbf39784f8
1 /*
2 * Unsigned long long arithmetic limited library, tailored for wmmon's
3 * specific needs.
5 * Copyright (c) 2014 Pedro Gimeno Fortea
7 * This file is part of wmmon.
9 * wmmon is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * wmmon is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with wmmon; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 #ifndef __ULLLIB_H_
25 #define __ULLLIB_H_
27 #ifdef HAVE_LONG_LONG_INT
29 typedef unsigned long long ullong;
31 #define ullreset(x) (*(x) = 0)
32 #define ulladd(x, y) (*(x) += *(y))
33 #define ullsub(x, y) ((long)(*(x) - *(y)))
34 #define ullparse(x, y) (*(x) = atoll(y))
36 #else /* ! HAVE_LONG_LONG_INT */
38 typedef struct {
39 unsigned long H;
40 unsigned long L;
41 } ullong;
43 void ullreset(ullong *);
44 void ulladd(ullong *, const ullong *);
45 long ullsub(const ullong *, const ullong *);
46 void ullparse(ullong *, const char *);
48 #endif /* HAVE_LONG_LONG_INT */
50 #endif /* __ULLIB_H_ */