diff options
-rw-r--r-- | cmake/FindSODIUM.cmake | 70 | ||||
-rw-r--r-- | core/Messenger.c | 6 |
2 files changed, 61 insertions, 15 deletions
diff --git a/cmake/FindSODIUM.cmake b/cmake/FindSODIUM.cmake index ffb6a1f7..fd6206ff 100644 --- a/cmake/FindSODIUM.cmake +++ b/cmake/FindSODIUM.cmake | |||
@@ -1,15 +1,67 @@ | |||
1 | # Find SODIUM | 1 | # - Try to find SODIUM |
2 | # Once done this will define | ||
2 | # | 3 | # |
3 | # SODIUM_INCLUDE_DIR | 4 | # SODIUM_ROOT_DIR - Set this variable to the root installation of CMocka |
4 | # SODIUM_LIBRARY | ||
5 | # SODIUM_FOUND | ||
6 | # | 5 | # |
6 | # Read-Only variables: | ||
7 | # SODIUM_FOUND - system has SODIUM | ||
8 | # SODIUM_INCLUDE_DIR - the SODIUM include directory | ||
9 | # SODIUM_LIBRARIES - Link these to use SODIUM | ||
10 | # SODIUM_DEFINITIONS - Compiler switches required for using SODIUM | ||
11 | # | ||
12 | #============================================================================= | ||
13 | # Copyright (c) 2013 Andreas Schneider <asn@cryptomilk.org> | ||
14 | # | ||
15 | # Distributed under the OSI-approved BSD License (the "License"); | ||
16 | # see accompanying file Copyright.txt for details. | ||
17 | # | ||
18 | # This software is distributed WITHOUT ANY WARRANTY; without even the | ||
19 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
20 | # See the License for more information. | ||
21 | #============================================================================= | ||
22 | # | ||
23 | |||
24 | set(_SODIUM_ROOT_HINTS | ||
25 | ) | ||
26 | |||
27 | set(_SODIUM_ROOT_PATHS | ||
28 | "$ENV{PROGRAMFILES}/sodium" | ||
29 | ) | ||
30 | |||
31 | find_path(SODIUM_ROOT_DIR | ||
32 | NAMES | ||
33 | include/cmocka.h | ||
34 | HINTS | ||
35 | ${_SODIUM_ROOT_HINTS} | ||
36 | PATHS | ||
37 | ${_SODIUM_ROOT_PATHS} | ||
38 | ) | ||
39 | mark_as_advanced(SODIUM_ROOT_DIR) | ||
40 | |||
41 | find_path(SODIUM_INCLUDE_DIR | ||
42 | NAMES | ||
43 | sodium.h | ||
44 | PATHS | ||
45 | ${SODIUM_ROOT_DIR}/include | ||
46 | ) | ||
47 | |||
48 | find_library(SODIUM_LIBRARY | ||
49 | NAMES | ||
50 | sodium | ||
51 | PATHS | ||
52 | ${SODIUM_ROOT_DIR}/lib | ||
53 | ) | ||
7 | 54 | ||
8 | FIND_PATH(SODIUM_INCLUDE_DIR NAMES sodium.h) | 55 | if (SODIUM_LIBRARY) |
56 | set(SODIUM_LIBRARIES | ||
57 | ${SODIUM_LIBRARIES} | ||
58 | ${SODIUM_LIBRARY} | ||
59 | ) | ||
60 | endif (SODIUM_LIBRARY) | ||
9 | 61 | ||
10 | FIND_LIBRARY(SODIUM_LIBRARY NAMES sodium) | 62 | include(FindPackageHandleStandardArgs) |
63 | find_package_handle_standard_args(SODIUM DEFAULT_MSG SODIUM_LIBRARIES SODIUM_INCLUDE_DIR) | ||
11 | 64 | ||
12 | INCLUDE(FindPackageHandleStandardArgs) | 65 | # show the SODIUM_INCLUDE_DIR and SODIUM_LIBRARIES variables only in the advanced view |
13 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(SODIUM DEFAULT_MSG SODIUM_LIBRARY SODIUM_INCLUDE_DIR) | 66 | mark_as_advanced(SODIUM_INCLUDE_DIR SODIUM_LIBRARIES) |
14 | 67 | ||
15 | MARK_AS_ADVANCED(SODIUM_INCLUDE_DIR SODIUM_LIBRARY) | ||
diff --git a/core/Messenger.c b/core/Messenger.c index 30f3f658..8f1ed41a 100644 --- a/core/Messenger.c +++ b/core/Messenger.c | |||
@@ -71,12 +71,6 @@ int getfriend_id(uint8_t *client_id) | |||
71 | return -1; | 71 | return -1; |
72 | } | 72 | } |
73 | 73 | ||
74 | /* Returns number of friends */ | ||
75 | int getnumfriends() | ||
76 | { | ||
77 | return numfriends; | ||
78 | } | ||
79 | |||
80 | /* copies the public key associated to that friend id into client_id buffer. | 74 | /* copies the public key associated to that friend id into client_id buffer. |
81 | make sure that client_id is of size CLIENT_ID_SIZE. | 75 | make sure that client_id is of size CLIENT_ID_SIZE. |
82 | return 0 if success | 76 | return 0 if success |