aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_disk_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_disk_lib.h')
-rw-r--r--src/include/gnunet_disk_lib.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h
index 5403d256b..fdccebab0 100644
--- a/src/include/gnunet_disk_lib.h
+++ b/src/include/gnunet_disk_lib.h
@@ -36,6 +36,48 @@ struct GNUNET_DISK_FileHandle;
36struct GNUNET_DISK_PipeHandle; 36struct GNUNET_DISK_PipeHandle;
37 37
38 38
39enum GNUNET_FILE_Type {
40 GNUNET_DISK_FILE, GNUNET_PIPE
41};
42
43/**
44 * Handle used to access files (and pipes).
45 */
46struct GNUNET_DISK_FileHandle
47{
48
49#if WINDOWS
50 /**
51 * File handle under W32.
52 */
53 HANDLE h;
54
55 /**
56 * Type
57 */
58 enum GNUNET_FILE_Type type;
59
60 /**
61 * Structure for overlapped reading (for pipes)
62 */
63 OVERLAPPED *oOverlapRead;
64
65 /**
66 * Structure for overlapped writing (for pipes)
67 */
68 OVERLAPPED *oOverlapWrite;
69#else
70
71 /**
72 * File handle on other OSes.
73 */
74 int fd;
75
76#endif /*
77 */
78};
79
80
39/* we need size_t, and since it can be both unsigned int 81/* we need size_t, and since it can be both unsigned int
40 or unsigned long long, this IS platform dependent; 82 or unsigned long long, this IS platform dependent;
41 but "stdlib.h" should be portable 'enough' to be 83 but "stdlib.h" should be portable 'enough' to be