summaryrefslogtreecommitdiff
path: root/core/util.c
diff options
context:
space:
mode:
authorjin-eld <jin at mediatomb dot cc>2013-08-04 15:10:37 +0300
committerjin-eld <jin at mediatomb dot cc>2013-08-24 03:25:07 +0300
commite658892793c42b2d058eed0937025ef2ddaaa372 (patch)
tree2a022cab057f2c16ca95860ed980092880052f6e /core/util.c
parente2aa8161adc85795fe4d63d4642f47e90937ddc2 (diff)
Rename core directory because of autoconf name clash
While doing the checks configure might generate "core" files and will then try to remove them. Having a "core" directory generates an error while runing the configure script. There's no workaround but to rename the core directory.
Diffstat (limited to 'core/util.c')
-rw-r--r--core/util.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/core/util.c b/core/util.c
deleted file mode 100644
index 6f346db1..00000000
--- a/core/util.c
+++ /dev/null
@@ -1,45 +0,0 @@
1/*
2 * util.c -- Utilities.
3 *
4 * This file is donated to the Tox Project.
5 * Copyright 2013 plutooo
6 */
7
8#include <time.h>
9#include <stdint.h>
10#include <stdbool.h>
11
12#include "DHT.h"
13#include "packets.h"
14
15uint64_t now()
16{
17 return time(NULL);
18}
19
20uint64_t random_64b()
21{
22 uint64_t r;
23
24 // This is probably not random enough?
25 r = random_int();
26 r <<= 32;
27 r |= random_int();
28
29 return r;
30}
31
32bool ipp_eq(IP_Port a, IP_Port b)
33{
34 return (a.ip.i == b.ip.i) && (a.port == b.port);
35}
36
37bool id_eq(clientid_t *dest, clientid_t *src)
38{
39 return memcmp(dest, src, sizeof(clientid_t)) == 0;
40}
41
42void id_cpy(clientid_t *dest, clientid_t *src)
43{
44 memcpy(dest, src, sizeof(clientid_t));
45}