diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-08-25 10:59:00 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-08-25 10:59:00 +0000 |
commit | 9cbff87bf9b68c08242b1a6a79221311dc157fc0 (patch) | |
tree | 6dacb93610d32de7f16e71765874fe2fb6e3a704 /src/include/gnunet_bio_lib.h | |
parent | 3d0444f9e6d64d6bc6b109cb743b9e08abcada0e (diff) | |
download | gnunet-9cbff87bf9b68c08242b1a6a79221311dc157fc0.tar.gz gnunet-9cbff87bf9b68c08242b1a6a79221311dc157fc0.zip |
hxing
Diffstat (limited to 'src/include/gnunet_bio_lib.h')
-rw-r--r-- | src/include/gnunet_bio_lib.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/include/gnunet_bio_lib.h b/src/include/gnunet_bio_lib.h index 02b04570e..2765b4695 100644 --- a/src/include/gnunet_bio_lib.h +++ b/src/include/gnunet_bio_lib.h | |||
@@ -71,12 +71,12 @@ int GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, | |||
71 | * @param what describes what is being read (for error message creation) | 71 | * @param what describes what is being read (for error message creation) |
72 | * @param result the buffer to write the result to | 72 | * @param result the buffer to write the result to |
73 | * @param len the number of bytes to read | 73 | * @param len the number of bytes to read |
74 | * @return len on success, GNUNET_SYSERR on failure | 74 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
75 | */ | 75 | */ |
76 | ssize_t GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, | 76 | int GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, |
77 | const char *what, | 77 | const char *what, |
78 | void *result, | 78 | void *result, |
79 | size_t len); | 79 | size_t len); |
80 | 80 | ||
81 | /** | 81 | /** |
82 | * Read 0-terminated string from a file. | 82 | * Read 0-terminated string from a file. |
@@ -85,11 +85,13 @@ ssize_t GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, | |||
85 | * @param what describes what is being read (for error message creation) | 85 | * @param what describes what is being read (for error message creation) |
86 | * @param result the buffer to store a pointer to the (allocated) string to | 86 | * @param result the buffer to store a pointer to the (allocated) string to |
87 | * (note that *result could be set to NULL as well) | 87 | * (note that *result could be set to NULL as well) |
88 | * @param maxLen maximum allowed length for the string | ||
88 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 89 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
89 | */ | 90 | */ |
90 | int GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, | 91 | int GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, |
91 | const char *what, | 92 | const char *what, |
92 | char **result); | 93 | char **result, |
94 | size_t maxLen); | ||
93 | 95 | ||
94 | 96 | ||
95 | /** | 97 | /** |
@@ -198,9 +200,9 @@ int GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h); | |||
198 | * @param n number of bytes to write | 200 | * @param n number of bytes to write |
199 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 201 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
200 | */ | 202 | */ |
201 | ssize_t GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, | 203 | int GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, |
202 | const void *buffer, | 204 | const void *buffer, |
203 | size_t n); | 205 | size_t n); |
204 | 206 | ||
205 | 207 | ||
206 | /** | 208 | /** |
@@ -244,7 +246,7 @@ int GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, | |||
244 | * @param h hande to open file | 246 | * @param h hande to open file |
245 | * @param f double to write (must be a variable) | 247 | * @param f double to write (must be a variable) |
246 | */ | 248 | */ |
247 | #define GNUNET_BIO_write_float(h, f) (sizeof(double) == GNUNET_BIO_write (h, &f, sizeof(double))) | 249 | #define GNUNET_BIO_write_double(h, f) (sizeof(double) == GNUNET_BIO_write (h, &f, sizeof(double))) |
248 | 250 | ||
249 | 251 | ||
250 | /** | 252 | /** |
@@ -254,7 +256,7 @@ int GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, | |||
254 | * @param i address of 32-bit integer to write | 256 | * @param i address of 32-bit integer to write |
255 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 257 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
256 | */ | 258 | */ |
257 | int GNUNET_BIO_write_int32 (struct GNUNET_BIO_ReadHandle *h, | 259 | int GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, |
258 | int32_t i); | 260 | int32_t i); |
259 | 261 | ||
260 | 262 | ||
@@ -265,7 +267,7 @@ int GNUNET_BIO_write_int32 (struct GNUNET_BIO_ReadHandle *h, | |||
265 | * @param i address of 64-bit integer to write | 267 | * @param i address of 64-bit integer to write |
266 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 268 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
267 | */ | 269 | */ |
268 | int GNUNET_BIO_write_int64 (struct GNUNET_BIO_ReadHandle *h, | 270 | int GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, |
269 | int64_t i); | 271 | int64_t i); |
270 | 272 | ||
271 | 273 | ||