-fixes
[oweals/gnunet.git] / src / include / gnunet_bio_lib.h
index 15924f1efcc3e00ef072eec31c919ab8547ad707..47d8d5e1ecf3bee877d44387d226067ca52ed9b4 100644 (file)
@@ -49,7 +49,8 @@ struct GNUNET_BIO_ReadHandle;
  * @param fn file name to be opened
  * @return IO handle on success, NULL on error
  */
-struct GNUNET_BIO_ReadHandle *GNUNET_BIO_read_open (const char *fn);
+struct GNUNET_BIO_ReadHandle *
+GNUNET_BIO_read_open (const char *fn);
 
 
 /**
@@ -60,8 +61,8 @@ struct GNUNET_BIO_ReadHandle *GNUNET_BIO_read_open (const char *fn);
  * @param emsg set to the error message
  * @return GNUNET_OK on success, GNUNET_SYSERR otherwise
  */
-int GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h,
-                          char **emsg);
+int
+GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg);
 
 
 /**
@@ -73,10 +74,9 @@ int GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h,
  * @param len the number of bytes to read
  * @return GNUNET_OK on success, GNUNET_SYSERR on failure
  */
-int GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, 
-                    const char *what,
-                    void *result, 
-                    size_t len);
+int
+GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what,
+                 void *result, size_t len);
 
 
 /**
@@ -89,10 +89,9 @@ int GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h,
  * @param len the number of bytes to read
  * @return GNUNET_OK on success, GNUNET_SYSERR on failure
  */
-int GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, 
-                       const char *file, int line,
-                       void *result, 
-                       size_t len);
+int
+GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, const char *file, int line,
+                    void *result, size_t len);
 
 /**
  * Read 0-terminated string from a file.
@@ -104,10 +103,9 @@ int GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h,
  * @param maxLen maximum allowed length for the string
  * @return GNUNET_OK on success, GNUNET_SYSERR on failure
  */
-int GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h,
-                           const char *what,
-                           char **result,
-                           size_t maxLen);
+int
+GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what,
+                        char **result, size_t maxLen);
 
 
 /**
@@ -118,9 +116,9 @@ int GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h,
  * @param result the buffer to store a pointer to the (allocated) metadata
  * @return GNUNET_OK on success, GNUNET_SYSERR on failure
  */
-int GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, 
-                              const char *what,
-                              struct GNUNET_CONTAINER_MetaData **result);
+int
+GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, const char *what,
+                           struct GNUNET_CONTAINER_MetaData **result);
 
 
 /**
@@ -128,7 +126,7 @@ int GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h,
  *
  * @param h hande to open file
  * @param f address of float to read
- */ 
+ */
 #define GNUNET_BIO_read_float(h, f) (GNUNET_BIO_read_fn (h, __FILE__, __LINE__, f, sizeof(float)))
 
 
@@ -138,7 +136,7 @@ int GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h,
  *
  * @param h hande to open file
  * @param f address of double to read
- */ 
+ */
 #define GNUNET_BIO_read_double(h, f) (GNUNET_BIO_read_fn (h, __FILE__, __LINE__, f, sizeof(double)))
 
 
@@ -150,10 +148,10 @@ int GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h,
  * @param line line number in the code
  * @param i address of 32-bit integer to read
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
- */ 
-int GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, 
-                            const char *file, int line,
-                            int32_t *i);
+ */
+int
+GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file,
+                         int line, int32_t * i);
 
 
 /**
@@ -161,7 +159,7 @@ int GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h,
  *
  * @param h hande to open file
  * @param i address of 32-bit integer to read
- */ 
+ */
 #define GNUNET_BIO_read_int32(h, i) GNUNET_BIO_read_int32__ (h, __FILE__, __LINE__, (int32_t*) i)
 
 
@@ -173,10 +171,10 @@ int GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h,
  * @param line line number in the code
  * @param i address of 64-bit integer to read
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
- */ 
-int GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, 
-                            const char *file, int line,
-                            int64_t *i);
+ */
+int
+GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, const char *file,
+                         int line, int64_t * i);
 
 
 /**
@@ -184,7 +182,7 @@ int GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h,
  *
  * @param h hande to open file
  * @param i address of 64-bit integer to read
- */ 
+ */
 #define GNUNET_BIO_read_int64(h, i) GNUNET_BIO_read_int64__ (h, __FILE__, __LINE__, (int64_t*) i)
 
 
@@ -192,13 +190,15 @@ int GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h,
  * Handle for buffered writing.
  */
 struct GNUNET_BIO_WriteHandle;
+
 /**
  * Open a file for writing.
  *
  * @param fn file name to be opened
  * @return IO handle on success, NULL on error
  */
-struct GNUNET_BIO_WriteHandle *GNUNET_BIO_write_open (const char *fn);
+struct GNUNET_BIO_WriteHandle *
+GNUNET_BIO_write_open (const char *fn);
 
 
 /**
@@ -207,7 +207,8 @@ struct GNUNET_BIO_WriteHandle *GNUNET_BIO_write_open (const char *fn);
  * @param h file handle
  * @return GNUNET_OK on success, GNUNET_SYSERR otherwise
  */
-int GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h);
+int
+GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h);
 
 
 /**
@@ -218,9 +219,9 @@ int GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h);
  * @param n number of bytes to write
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
-int GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, 
-                     const void *buffer,
-                     size_t n);
+int
+GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer,
+                  size_t n);
 
 
 /**
@@ -230,8 +231,8 @@ int GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h,
  * @param s string to write (can be NULL)
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
-int GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, 
-                            const char *s);
+int
+GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, const char *s);
 
 
 
@@ -243,8 +244,9 @@ int GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h,
  * @param m metadata to write
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
-int GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, 
-                               const struct GNUNET_CONTAINER_MetaData *m);
+int
+GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h,
+                            const struct GNUNET_CONTAINER_MetaData *m);
 
 
 
@@ -253,7 +255,7 @@ int GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h,
  *
  * @param h hande to open file
  * @param f float to write (must be a variable)
- */ 
+ */
 #define GNUNET_BIO_write_float(h, f) GNUNET_BIO_write (h, &f, sizeof(float))
 
 
@@ -263,7 +265,7 @@ int GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h,
  *
  * @param h hande to open file
  * @param f double to write (must be a variable)
- */ 
+ */
 #define GNUNET_BIO_write_double(h, f) GNUNET_BIO_write (h, &f, sizeof(double))
 
 
@@ -271,22 +273,22 @@ int GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h,
  * Write an (u)int32_t.
  *
  * @param h hande to open file
- * @param i address of 32-bit integer to write
+ * @param i 32-bit integer to write
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
- */ 
-int GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, 
-                           int32_t i);
+ */
+int
+GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, int32_t i);
 
 
 /**
  * Write an (u)int64_t.
  *
  * @param h hande to open file
- * @param i address of 64-bit integer to write
+ * @param i 64-bit integer to write
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
- */ 
-int GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, 
-                           int64_t i);
+ */
+int
+GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, int64_t i);
 
 
 #if 0                           /* keep Emacsens' auto-indent happy */