fixing leak
[oweals/gnunet.git] / src / include / gnunet_disk_lib.h
index b8df9d7b677f8f928399655dccd101651b80defd..383a9daa2defbc706fec0d7cc750172abcf71c64 100644 (file)
@@ -496,15 +496,12 @@ int GNUNET_DISK_directory_iterator_next (struct GNUNET_DISK_DirectoryIterator
  * If a scheduler does not need to be used, GNUNET_DISK_directory_scan
  * may provide a simpler API.
  *
- * @param sched scheduler to use
  * @param prio priority to use
  * @param dirName the name of the directory
  * @param callback the method to call for each file
  * @param callback_cls closure for callback
  */
-void GNUNET_DISK_directory_iterator_start (struct GNUNET_SCHEDULER_Handle
-                                           *sched,
-                                           enum GNUNET_SCHEDULER_Priority
+void GNUNET_DISK_directory_iterator_start (enum GNUNET_SCHEDULER_Priority
                                            prio, const char *dirName,
                                            GNUNET_DISK_DirectoryIteratorCallback
                                            callback, void *callback_cls);
@@ -645,6 +642,34 @@ int GNUNET_DISK_file_unmap (struct GNUNET_DISK_MapHandle *h);
  */
 int GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h);
 
+/**
+ * Creates a named pipe/FIFO and opens it
+ * @param fn pointer to the name of the named pipe or to NULL
+ * @param flags open flags
+ * @param perm access permissions
+ * @return pipe handle on success, NULL on error
+ */
+struct GNUNET_DISK_FileHandle *GNUNET_DISK_npipe_create (char **fn,
+    enum GNUNET_DISK_OpenFlags flags, enum GNUNET_DISK_AccessPermissions perm);
+
+/**
+ * Opens already existing named pipe/FIFO
+ *
+ * @param fn name of an existing named pipe
+ * @param flags open flags
+ * @param perm access permissions
+ * @return pipe handle on success, NULL on error
+ */
+struct GNUNET_DISK_FileHandle *GNUNET_DISK_npipe_open (const char *fn,
+    enum GNUNET_DISK_OpenFlags flags, enum GNUNET_DISK_AccessPermissions perm);
+
+/**
+ * Closes a named pipe/FIFO
+ * @param pipe named pipe
+ * @return GNUNET_OK on success, GNUNET_SYSERR otherwise
+ */
+int GNUNET_DISK_npipe_close (struct GNUNET_DISK_FileHandle *pipe);
+
 #if 0                           /* keep Emacsens' auto-indent happy */
 {
 #endif