aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-09-09 19:17:18 +0000
committerng0 <ng0@n0.is>2019-09-09 19:17:18 +0000
commit483b0139a218a5f8a8311bda3eb23bcd88f57688 (patch)
treed9e7a0f5053cdaa1a720485b93e9927f08466958 /src/include
parentec472b1aae122481f4f7e760e5242753eba9bf87 (diff)
downloadgnunet-483b0139a218a5f8a8311bda3eb23bcd88f57688.tar.gz
gnunet-483b0139a218a5f8a8311bda3eb23bcd88f57688.zip
Remove win32 and cygwin support
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gauger.h30
-rw-r--r--src/include/gnunet_disk_lib.h37
-rw-r--r--src/include/gnunet_network_lib.h34
-rw-r--r--src/include/platform.h58
4 files changed, 1 insertions, 158 deletions
diff --git a/src/include/gauger.h b/src/include/gauger.h
index d23883742..562208e1f 100644
--- a/src/include/gauger.h
+++ b/src/include/gauger.h
@@ -11,8 +11,6 @@
11#ifndef __GAUGER_H__ 11#ifndef __GAUGER_H__
12#define __GAUGER_H__ 12#define __GAUGER_H__
13 13
14#ifndef WINDOWS
15
16#include <unistd.h> 14#include <unistd.h>
17#include <stdio.h> 15#include <stdio.h>
18#include <sys/wait.h> 16#include <sys/wait.h>
@@ -79,32 +77,4 @@
79 } \ 77 } \
80 } 78 }
81 79
82#else /* WINDOWS */
83
84#include <stdlib.h>
85#include <stdio.h>
86#include <windef.h>
87
88#define GAUGER(category, counter, value, unit) \
89 { \
90 char __gauger_commandline[MAX_PATH]; \
91 \
92 snprintf(__gauger_commandline, MAX_PATH, "gauger.py -n \"%s\" -d \"%Lf\" -u \"%s\" -c \"%s\"", \
93 (counter), (long double)(value), (unit), (category)); \
94 __gauger_commandline[MAX_PATH - 1] = '\0'; \
95 system(__gauger_commandline); \
96 }
97
98#define GAUGER_ID(category, counter, value, unit, id) \
99 { \
100 char __gauger_commandline[MAX_PATH]; \
101 \
102 snprintf(__gauger_commandline, MAX_PATH, "gauger.py -n \"%s\" -d \"%Lf\" -u \"%s\" -i \"%s\" -c \"%s\"", \
103 (counter), (long double)(value), (unit), (id), (category)); \
104 __gauger_commandline[MAX_PATH - 1] = '\0'; \
105 system(__gauger_commandline); \
106 }
107
108#endif // WINDOWS
109
110#endif 80#endif
diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h
index f693615f1..d1e1e0333 100644
--- a/src/include/gnunet_disk_lib.h
+++ b/src/include/gnunet_disk_lib.h
@@ -59,32 +59,10 @@ enum GNUNET_FILE_Type {
59 * Handle used to access files (and pipes). 59 * Handle used to access files (and pipes).
60 */ 60 */
61struct GNUNET_DISK_FileHandle { 61struct GNUNET_DISK_FileHandle {
62#if WINDOWS
63 /** 62 /**
64 * File handle under W32. 63 * File handle on Unix-like systems.
65 */
66 HANDLE h;
67
68 /**
69 * Type
70 */
71 enum GNUNET_FILE_Type type;
72
73 /**
74 * Structure for overlapped reading (for pipes)
75 */
76 OVERLAPPED *oOverlapRead;
77
78 /**
79 * Structure for overlapped writing (for pipes)
80 */
81 OVERLAPPED *oOverlapWrite;
82#else
83 /**
84 * File handle on other OSes.
85 */ 64 */
86 int fd; 65 int fd;
87#endif
88}; 66};
89 67
90 68
@@ -495,19 +473,6 @@ const struct GNUNET_DISK_FileHandle *
495GNUNET_DISK_pipe_handle(const struct GNUNET_DISK_PipeHandle *p, 473GNUNET_DISK_pipe_handle(const struct GNUNET_DISK_PipeHandle *p,
496 enum GNUNET_DISK_PipeEnd n); 474 enum GNUNET_DISK_PipeEnd n);
497 475
498
499#if WINDOWS
500/**
501 * Get a GNUnet file handle from a W32 handle (W32-only).
502 * Do not call on non-W32 platforms (returns NULL).
503 *
504 * @param handle native handle
505 * @return GNUnet file handle corresponding to the W32 handle
506 */
507struct GNUNET_DISK_FileHandle *
508GNUNET_DISK_get_handle_from_w32_handle(HANDLE osfh);
509#endif
510
511/** 476/**
512 * Update POSIX permissions mask of a file on disk. If both argumets 477 * Update POSIX permissions mask of a file on disk. If both argumets
513 * are #GNUNET_NO, the file is made world-read-write-executable (777). 478 * are #GNUNET_NO, the file is made world-read-write-executable (777).
diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h
index 2a91621a3..bdf568385 100644
--- a/src/include/gnunet_network_lib.h
+++ b/src/include/gnunet_network_lib.h
@@ -60,25 +60,6 @@ struct GNUNET_NETWORK_FDSet {
60 */ 60 */
61 fd_set sds; 61 fd_set sds;
62 62
63#ifdef WINDOWS
64 /**
65 * Array of file handles (from pipes) that are also in
66 * the FDSet. Needed as those cannot go into @e sds
67 * on W32.
68 */
69 const struct GNUNET_DISK_FileHandle **handles;
70
71 /**
72 * Size of the @e handles array
73 */
74 unsigned int handles_size;
75
76 /**
77 * Number of @e handles slots in use. Always
78 * smaller than @e handles_size.
79 */
80 unsigned int handles_pos;
81#endif
82}; 63};
83 64
84#include "gnunet_disk_lib.h" 65#include "gnunet_disk_lib.h"
@@ -107,7 +88,6 @@ char *
107GNUNET_NETWORK_shorten_unixpath(char *unixpath); 88GNUNET_NETWORK_shorten_unixpath(char *unixpath);
108 89
109 90
110#ifndef WINDOWS
111/** 91/**
112 * If services crash, they can leave a unix domain socket file on the 92 * If services crash, they can leave a unix domain socket file on the
113 * disk. This needs to be manually removed, because otherwise both 93 * disk. This needs to be manually removed, because otherwise both
@@ -119,7 +99,6 @@ GNUNET_NETWORK_shorten_unixpath(char *unixpath);
119 */ 99 */
120void 100void
121GNUNET_NETWORK_unix_precheck(const struct sockaddr_un *un); 101GNUNET_NETWORK_unix_precheck(const struct sockaddr_un *un);
122#endif
123 102
124 103
125/** 104/**
@@ -406,19 +385,6 @@ GNUNET_NETWORK_fdset_set(struct GNUNET_NETWORK_FDSet *fds,
406 const struct GNUNET_NETWORK_Handle *desc); 385 const struct GNUNET_NETWORK_Handle *desc);
407 386
408 387
409#if WINDOWS
410/**
411 * Add a W32 file handle to the fd set
412 *
413 * @param fds fd set
414 * @param h the file handle to add
415 */
416void
417GNUNET_NETWORK_fdset_handle_set_native_w32_handle(struct GNUNET_NETWORK_FDSet *fds,
418 HANDLE h);
419#endif
420
421
422/** 388/**
423 * Check whether a socket is part of the fd set 389 * Check whether a socket is part of the fd set
424 * 390 *
diff --git a/src/include/platform.h b/src/include/platform.h
index e12d08e44..bdfbb4a4b 100644
--- a/src/include/platform.h
+++ b/src/include/platform.h
@@ -38,13 +38,8 @@
38#endif 38#endif
39#endif 39#endif
40 40
41#ifdef WINDOWS
42#define BREAKPOINT asm ("int $3;");
43#define GNUNET_SIGCHLD 17
44#else
45#define BREAKPOINT 41#define BREAKPOINT
46#define GNUNET_SIGCHLD SIGCHLD 42#define GNUNET_SIGCHLD SIGCHLD
47#endif
48 43
49#ifdef HAVE_SYS_TYPES_H 44#ifdef HAVE_SYS_TYPES_H
50#include <sys/types.h> 45#include <sys/types.h>
@@ -70,18 +65,6 @@
70 65
71#define VERBOSE_STATS 0 66#define VERBOSE_STATS 0
72 67
73#ifdef CYGWIN
74#include <sys/reent.h>
75#endif
76
77#ifdef _MSC_VER
78#ifndef FD_SETSIZE
79#define FD_SETSIZE 1024
80#endif
81#include <Winsock2.h>
82#include <ws2tcpip.h>
83#else
84#ifndef MINGW
85#include <netdb.h> 68#include <netdb.h>
86#include <sys/socket.h> 69#include <sys/socket.h>
87#include <sys/un.h> 70#include <sys/un.h>
@@ -100,10 +83,6 @@
100#include <sys/ioctl.h> 83#include <sys/ioctl.h>
101#include <sys/wait.h> 84#include <sys/wait.h>
102#include <grp.h> 85#include <grp.h>
103#else
104#include "winproc.h"
105#endif
106#endif
107 86
108#include <string.h> 87#include <string.h>
109#include <stdio.h> 88#include <stdio.h>
@@ -114,20 +93,13 @@
114#include <errno.h> 93#include <errno.h>
115#include <signal.h> 94#include <signal.h>
116#include <libgen.h> 95#include <libgen.h>
117#ifdef WINDOWS
118#include <malloc.h> /* for alloca(), on other OSes it's in stdlib.h */
119#endif
120#ifdef HAVE_MALLOC_H 96#ifdef HAVE_MALLOC_H
121#include <malloc.h> /* for mallinfo on GNU */ 97#include <malloc.h> /* for mallinfo on GNU */
122#endif 98#endif
123#ifndef _MSC_VER
124#include <unistd.h> /* KLB_FIX */ 99#include <unistd.h> /* KLB_FIX */
125#endif
126#include <sys/stat.h> 100#include <sys/stat.h>
127#include <sys/types.h> 101#include <sys/types.h>
128#ifndef _MSC_VER
129#include <dirent.h> /* KLB_FIX */ 102#include <dirent.h> /* KLB_FIX */
130#endif
131#include <fcntl.h> 103#include <fcntl.h>
132#include <math.h> 104#include <math.h>
133#if HAVE_SYS_PARAM_H 105#if HAVE_SYS_PARAM_H
@@ -170,10 +142,6 @@
170#if HAVE_SYS_UCRED_H 142#if HAVE_SYS_UCRED_H
171#include <sys/ucred.h> 143#include <sys/ucred.h>
172#endif 144#endif
173#ifdef CYGWIN
174#include <windows.h>
175#include <cygwin/if.h>
176#endif
177#if HAVE_IFADDRS_H 145#if HAVE_IFADDRS_H
178#include <ifaddrs.h> 146#include <ifaddrs.h>
179#endif 147#endif
@@ -196,24 +164,11 @@
196#include <sys/endian.h> 164#include <sys/endian.h>
197#endif 165#endif
198 166
199/* From plibc. */
200#ifdef Q_OS_WIN32
201#define WINDOWS 1
202#endif
203
204#ifndef WINDOWS
205#define DIR_SEPARATOR '/' 167#define DIR_SEPARATOR '/'
206#define DIR_SEPARATOR_STR "/" 168#define DIR_SEPARATOR_STR "/"
207#define PATH_SEPARATOR ':' 169#define PATH_SEPARATOR ':'
208#define PATH_SEPARATOR_STR ":" 170#define PATH_SEPARATOR_STR ":"
209#define NEWLINE "\n" 171#define NEWLINE "\n"
210#else
211#define DIR_SEPARATOR '\\'
212#define DIR_SEPARATOR_STR "\\"
213#define PATH_SEPARATOR ';'
214#define PATH_SEPARATOR_STR ";"
215#define NEWLINE "\r\n"
216#endif
217 172
218#include "compat.h" 173#include "compat.h"
219 174
@@ -231,15 +186,7 @@
231#define LIBEXTRACTOR_GETTEXT_DOMAIN "org.gnunet.libextractor" 186#define LIBEXTRACTOR_GETTEXT_DOMAIN "org.gnunet.libextractor"
232#endif 187#endif
233 188
234#ifdef CYGWIN
235#define SIOCGIFCONF _IOW('s', 100, struct ifconf) /* get if list */
236#define SIOCGIFFLAGS _IOW('s', 101, struct ifreq) /* Get if flags */
237#define SIOCGIFADDR _IOW('s', 102, struct ifreq) /* Get if addr */
238#endif
239
240#ifndef MINGW
241#include <sys/mman.h> 189#include <sys/mman.h>
242#endif
243 190
244#ifdef FREEBSD 191#ifdef FREEBSD
245#define __BYTE_ORDER BYTE_ORDER 192#define __BYTE_ORDER BYTE_ORDER
@@ -286,13 +233,8 @@ atoll(const char *nptr);
286#define MAKE_UNALIGNED(val) val 233#define MAKE_UNALIGNED(val) val
287#endif 234#endif
288 235
289#if WINDOWS
290#define FDTYPE HANDLE
291#define SOCKTYPE SOCKET
292#else
293#define FDTYPE int 236#define FDTYPE int
294#define SOCKTYPE int 237#define SOCKTYPE int
295#endif
296 238
297/** 239/**
298 * The termination signal 240 * The termination signal