LRN: Fix automake deps to allow -j* builds again
[oweals/gnunet.git] / src / util / disk.h
1 /*\r
2      This file is part of GNUnet.\r
3      (C) 2009 Christian Grothoff (and other contributing authors)\r
4 \r
5      GNUnet is free software; you can redistribute it and/or modify\r
6      it under the terms of the GNU General Public License as published\r
7      by the Free Software Foundation; either version 2, or (at your\r
8      option) any later version.\r
9 \r
10      GNUnet is distributed in the hope that it will be useful, but\r
11      WITHOUT ANY WARRANTY; without even the implied warranty of\r
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
13      General Public License for more details.\r
14 \r
15      You should have received a copy of the GNU General Public License\r
16      along with GNUnet; see the file COPYING.  If not, write to the\r
17      Free Software Foundation, Inc., 59 Temple Place - Suite 330,\r
18      Boston, MA 02111-1307, USA.\r
19 */  \r
20   \r
21 /**\r
22  * @file util/disk.h\r
23  * @brief Internal DISK related helper functions\r
24  * @author Nils Durner\r
25  */ \r
26   \r\r
27 #ifndef GNUNET_DISK_H_\r
28 #define GNUNET_DISK_H_\r
29   \r
30 #include "gnunet_disk_lib.h"\r
31   \r\r
32 /**\r
33  * Handle used to access files (and pipes).  \r
34  */ \r
35 struct GNUNET_DISK_FileHandle \r
36 {
37   \r
38 #ifdef MINGW\r
39   /**\r
40    * File handle under W32.\r
41    */ \r
42   HANDLE h;
43 \r
44   /**\r
45    * Type
46    */\r
47   enum {GNUNET_DISK_FILE, GNUNET_PIPE} type;\r
48 \r
49   /**\r
50    * Structure for overlapped reading (for pipes)\r
51    */\r
52   OVERLAPPED *oOverlapRead;\r
53 \r
54   /**\r
55    * Structure for overlapped writing (for pipes)\r
56    */\r
57   OVERLAPPED *oOverlapWrite;\r
58 #else\r
59
60   /**\r
61    * File handle on other OSes.\r
62    */ \r
63   int fd;
64    \r
65 #endif                          /* \r */
66 };
67 \r\r\r\r
68 /**\r
69  * Retrieve OS file handle\r
70  *\r
71  * @internal\r
72  * @param fh GNUnet file descriptor\r
73  * @param dst destination buffer\r
74  * @param dst_len length of dst\r
75  * @return GNUNET_OK on success, GNUNET_SYSERR otherwise\r
76  */ \r
77 int GNUNET_DISK_internal_file_handle_ (const struct GNUNET_DISK_FileHandle
78                                        *fh, \rvoid *dst, \rsize_t dst_len);
79 \r\r
80 #endif  /* GNUNET_DISK_H_ */\r