diff options
Diffstat (limited to 'src/include/gnunet_disk_lib.h')
-rw-r--r-- | src/include/gnunet_disk_lib.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h index 49f2ece48..a5f279f05 100644 --- a/src/include/gnunet_disk_lib.h +++ b/src/include/gnunet_disk_lib.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) 2001, 2002, 2003, 2004, 2005, 2006 Christian Grothoff (and other contributing authors) | 3 | (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -76,6 +76,8 @@ enum GNUNET_DISK_Seek {GNUNET_SEEK_SET, GNUNET_SEEK_CUR, GNUNET_SEEK_END}; | |||
76 | 76 | ||
77 | struct GNUNET_DISK_FileHandle; | 77 | struct GNUNET_DISK_FileHandle; |
78 | 78 | ||
79 | struct GNUNET_DISK_PipeHandle; | ||
80 | |||
79 | /** | 81 | /** |
80 | * Get the number of blocks that are left on the partition that | 82 | * Get the number of blocks that are left on the partition that |
81 | * contains the given file (for normal users). | 83 | * contains the given file (for normal users). |
@@ -150,6 +152,19 @@ GNUNET_DISK_mktemp (const char *template); | |||
150 | */ | 152 | */ |
151 | struct GNUNET_DISK_FileHandle *GNUNET_DISK_file_open (const char *fn, int flags, ...); | 153 | struct GNUNET_DISK_FileHandle *GNUNET_DISK_file_open (const char *fn, int flags, ...); |
152 | 154 | ||
155 | /** | ||
156 | * Creates an interprocess channel | ||
157 | * @param blocking creates an asynchronous pipe if set to GNUNET_NO | ||
158 | * @return handle to the new pipe, NULL on error | ||
159 | */ | ||
160 | struct GNUNET_DISK_PipeHandle *GNUNET_DISK_pipe (int blocking); | ||
161 | |||
162 | /** | ||
163 | * Closes an interprocess channel | ||
164 | * @param p pipe | ||
165 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | ||
166 | */ | ||
167 | int GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p); | ||
153 | 168 | ||
154 | /** | 169 | /** |
155 | * Close an open file. | 170 | * Close an open file. |
@@ -159,6 +174,14 @@ struct GNUNET_DISK_FileHandle *GNUNET_DISK_file_open (const char *fn, int flags, | |||
159 | */ | 174 | */ |
160 | int GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h); | 175 | int GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h); |
161 | 176 | ||
177 | /** | ||
178 | * Get the handle to a particular pipe end | ||
179 | * @param p pipe | ||
180 | * @param n number of the end | ||
181 | */ | ||
182 | const struct GNUNET_DISK_FileHandle *GNUNET_DISK_pipe_handle (const struct | ||
183 | GNUNET_DISK_PipeHandle | ||
184 | *p, int n); | ||
162 | 185 | ||
163 | /** | 186 | /** |
164 | * Read the contents of a binary file into a buffer. | 187 | * Read the contents of a binary file into a buffer. |