From dc6e9887c24209d0e3dfb6cfb30fbde6ae3b47e9 Mon Sep 17 00:00:00 2001 From: Nils Durner Date: Tue, 16 Jun 2009 20:13:13 +0000 Subject: GNUNET_IO_handle => GNUNET_DISK_handle --- src/include/Makefile.am | 1 - src/include/gnunet_disk_lib.h | 13 ++++++++++-- src/include/gnunet_io_lib.h | 46 ------------------------------------------- src/include/gnunet_util_lib.h | 1 - 4 files changed, 11 insertions(+), 50 deletions(-) delete mode 100644 src/include/gnunet_io_lib.h (limited to 'src/include') diff --git a/src/include/Makefile.am b/src/include/Makefile.am index 0fb7aa0fd..bc832c444 100644 --- a/src/include/Makefile.am +++ b/src/include/Makefile.am @@ -24,7 +24,6 @@ gnunetinclude_HEADERS = \ gnunet_fragmentation_lib.h \ gnunet_getopt_lib.h \ gnunet_hello_lib.h \ - gnunet_io_lib.h \ gnunet_network_lib.h \ gnunet_peerinfo_service.h \ gnunet_program_lib.h \ diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h index 080d8c09b..2c7488cc4 100644 --- a/src/include/gnunet_disk_lib.h +++ b/src/include/gnunet_disk_lib.h @@ -28,7 +28,6 @@ #include "gnunet_configuration_lib.h" #include "gnunet_scheduler_lib.h" -#include "gnunet_io_lib.h" /* we need size_t, and since it can be both unsigned int or unsigned long long, this IS platform dependent; @@ -75,6 +74,8 @@ extern "C" enum GNUNET_DISK_Seek {GNUNET_SEEK_SET, GNUNET_SEEK_CUR, GNUNET_SEEK_END}; +struct GNUNET_IO_Handle; + /** * Get the number of blocks that are left on the partition that * contains the given file (for normal users). @@ -85,6 +86,14 @@ enum GNUNET_DISK_Seek {GNUNET_SEEK_SET, GNUNET_SEEK_CUR, GNUNET_SEEK_END}; long GNUNET_DISK_get_blocks_available (const char *part); +/** + * Checks whether a handle is invalid + * @param h handle to check + * @return GNUNET_YES if invalid, GNUNET_NO if valid + */ +int GNUNET_DISK_handle_invalid (const struct GNUNET_IO_Handle *h); + + /** * Check that fil corresponds to a filename * (of a file that exists and that is not a directory). @@ -153,7 +162,7 @@ int GNUNET_DISK_file_read (const struct GNUNET_IO_Handle *h, void *result, int l * @param fn file name * @param result the buffer to write the result to * @param len the maximum number of bytes to read - * @return GNUNET_OK on success, GNUNET_SYSERR on error + * @return number of bytes read, GNUNET_SYSERR on failure */ int GNUNET_DISK_fn_read (const char * const fn, void *result, int len); diff --git a/src/include/gnunet_io_lib.h b/src/include/gnunet_io_lib.h deleted file mode 100644 index 3d04a2317..000000000 --- a/src/include/gnunet_io_lib.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - This file is part of GNUnet. - (C) 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 - by the Free Software Foundation; either version 2, or (at your - option) any later version. - - GNUnet is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -/** - * @file include/gnunet_io_lib.h - * @brief Helper functions for abstract IO handles - * @author Nils Durner - */ - -#ifndef IO_HANDLE_H_ -#define IO_HANDLE_H_ - -struct GNUNET_IO_Handle; - -/** - * Checks whether a handle is invalid - * @param h handle to check - * @return GNUNET_YES if invalid, GNUNET_NO if valid - */ -int GNUNET_IO_handle_invalid (const struct GNUNET_IO_Handle *h); - -/** - * Mark a handle as invalid - * @param h file handle - */ -void GNUNET_IO_handle_invalidate (struct GNUNET_IO_Handle *h); - - -#endif /* IO_HANDLE_H_ */ diff --git a/src/include/gnunet_util_lib.h b/src/include/gnunet_util_lib.h index 58621caf5..6354e28fa 100644 --- a/src/include/gnunet_util_lib.h +++ b/src/include/gnunet_util_lib.h @@ -43,7 +43,6 @@ extern "C" #include "gnunet_crypto_lib.h" #include "gnunet_disk_lib.h" #include "gnunet_getopt_lib.h" -#include "gnunet_io_lib.h" #include "gnunet_network_lib.h" #include "gnunet_plugin_lib.h" #include "gnunet_program_lib.h" -- cgit v1.2.3