X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Finclude%2Fgnunet_disk_lib.h;h=f4fd6f36b6f1cf71df4021372aee5b27bda63e01;hb=57df0fbf8398720fbd4a9cf34934c212ea00ee54;hp=49f2ece488796f1dc295102c40de01d769c86b8c;hpb=fe9ed98ff54df7d65dd0a0f787c86a734ef4d1a4;p=oweals%2Fgnunet.git diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h index 49f2ece48..f4fd6f36b 100644 --- a/src/include/gnunet_disk_lib.h +++ b/src/include/gnunet_disk_lib.h @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - (C) 2001, 2002, 2003, 2004, 2005, 2006 Christian Grothoff (and other contributing authors) + (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009 Christian Grothoff (and other contributing authors) GNUnet is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -72,10 +72,17 @@ extern "C" #define GNUNET_DISK_PERM_OTHER_WRITE 128 #define GNUNET_DISK_PERM_OTHER_EXEC 256 -enum GNUNET_DISK_Seek {GNUNET_SEEK_SET, GNUNET_SEEK_CUR, GNUNET_SEEK_END}; +enum GNUNET_DISK_Seek + { + GNUNET_DISK_SEEK_SET, + GNUNET_DISK_SEEK_CUR, + GNUNET_DISK_SEEK_END + }; struct GNUNET_DISK_FileHandle; +struct GNUNET_DISK_PipeHandle; + /** * Get the number of blocks that are left on the partition that * contains the given file (for normal users). @@ -150,6 +157,19 @@ GNUNET_DISK_mktemp (const char *template); */ struct GNUNET_DISK_FileHandle *GNUNET_DISK_file_open (const char *fn, int flags, ...); +/** + * Creates an interprocess channel + * @param blocking creates an asynchronous pipe if set to GNUNET_NO + * @return handle to the new pipe, NULL on error + */ +struct GNUNET_DISK_PipeHandle *GNUNET_DISK_pipe (int blocking); + +/** + * Closes an interprocess channel + * @param p pipe + * @return GNUNET_OK on success, GNUNET_SYSERR otherwise + */ +int GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p); /** * Close an open file. @@ -159,6 +179,14 @@ struct GNUNET_DISK_FileHandle *GNUNET_DISK_file_open (const char *fn, int flags, */ int GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h); +/** + * Get the handle to a particular pipe end + * @param p pipe + * @param n number of the end + */ +const struct GNUNET_DISK_FileHandle *GNUNET_DISK_pipe_handle (const struct + GNUNET_DISK_PipeHandle + *p, int n); /** * Read the contents of a binary file into a buffer. @@ -227,7 +255,8 @@ int GNUNET_DISK_file_copy (const char *src, const char *dst); * @return the number of files found, -1 on error */ int GNUNET_DISK_directory_scan (const char *dirName, - GNUNET_FileNameCallback callback, void *data); + GNUNET_FileNameCallback callback, + void *data); /**