Buffered IO library. More...
Go to the source code of this file.
Data Structures | |
| struct | GNUNET_BIO_ReadSpec |
| Structure specifying a reading operation on an IO handle. More... | |
| struct | GNUNET_BIO_WriteSpec |
| Structure specifying a writing operation on an IO handle. More... | |
Macros | |
| #define | GNUNET_BIO_LIB_H |
| #define | GNUNET_BIO_read_spec_end() { NULL, NULL, NULL, NULL, 0 } |
| End of specifications marker. | |
| #define | GNUNET_BIO_write_spec_end() { NULL, NULL, NULL, NULL, 0 } |
| End of specifications marker. | |
Typedefs | |
| typedef int(* | GNUNET_BIO_ReadHandler) (void *cls, struct GNUNET_BIO_ReadHandle *h, const char *what, void *target, size_t target_size) |
| Function used to deserialize data read from h and store it into target. | |
| typedef int(* | GNUNET_BIO_WriteHandler) (void *cls, struct GNUNET_BIO_WriteHandle *h, const char *what, void *source, size_t source_size) |
| Function used to serialize data from a buffer and write it to h. | |
Functions | |
| struct GNUNET_BIO_ReadHandle * | GNUNET_BIO_read_open_file (const char *fn) |
| Open a file for reading. | |
| struct GNUNET_BIO_ReadHandle * | GNUNET_BIO_read_open_buffer (void *buffer, size_t size) |
| Create a handle from an existing allocated buffer. | |
| enum GNUNET_GenericReturnValue | GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg) |
| Close an open handle. | |
| void | GNUNET_BIO_read_set_error (struct GNUNET_BIO_ReadHandle *h, const char *emsg) |
| Set read error to handle. | |
| enum GNUNET_GenericReturnValue | GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what, void *result, size_t len) |
| Read some contents into a buffer. | |
| enum GNUNET_GenericReturnValue | GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what, char **result, size_t max_length) |
| Read 0-terminated string. | |
| enum GNUNET_GenericReturnValue | GNUNET_BIO_read_float (struct GNUNET_BIO_ReadHandle *h, const char *what, float *f) |
| Read a float. | |
| enum GNUNET_GenericReturnValue | GNUNET_BIO_read_double (struct GNUNET_BIO_ReadHandle *h, const char *what, double *f) |
| Read a double. | |
| enum GNUNET_GenericReturnValue | GNUNET_BIO_read_int32 (struct GNUNET_BIO_ReadHandle *h, const char *what, int32_t *i) |
| Read an (u)int32_t. | |
| enum GNUNET_GenericReturnValue | GNUNET_BIO_read_int64 (struct GNUNET_BIO_ReadHandle *h, const char *what, int64_t *i) |
| Read an (u)int64_t. | |
| struct GNUNET_BIO_WriteHandle * | GNUNET_BIO_write_open_file (const char *fn) |
| Open a file for writing. | |
| struct GNUNET_BIO_WriteHandle * | GNUNET_BIO_write_open_buffer (void) |
| Create a handle backed by an in-memory buffer. | |
| enum GNUNET_GenericReturnValue | GNUNET_BIO_flush (struct GNUNET_BIO_WriteHandle *h) |
| Force a file-based buffered writer to flush its buffer. | |
| enum GNUNET_GenericReturnValue | GNUNET_BIO_get_buffer_contents (struct GNUNET_BIO_WriteHandle *h, char **emsg, void **contents, size_t *size) |
| Get the IO handle's contents. | |
| enum GNUNET_GenericReturnValue | GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h, char **emsg) |
| Close an IO handle. | |
| enum GNUNET_GenericReturnValue | GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const char *what, const void *buffer, size_t n) |
| Write a buffer to a handle. | |
| enum GNUNET_GenericReturnValue | GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, const char *what, const char *s) |
| Write a 0-terminated string. | |
| enum GNUNET_GenericReturnValue | GNUNET_BIO_write_float (struct GNUNET_BIO_WriteHandle *h, const char *what, float f) |
| Write a float. | |
| enum GNUNET_GenericReturnValue | GNUNET_BIO_write_double (struct GNUNET_BIO_WriteHandle *h, const char *what, double f) |
| Write a double. | |
| enum GNUNET_GenericReturnValue | GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, const char *what, int32_t i) |
| Write an (u)int32_t. | |
| enum GNUNET_GenericReturnValue | GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, const char *what, int64_t i) |
| Write an (u)int64_t. | |
| struct GNUNET_BIO_ReadSpec | GNUNET_BIO_read_spec_object (const char *what, void *result, size_t size) |
| Create the specification to read a certain amount of bytes. | |
| struct GNUNET_BIO_ReadSpec | GNUNET_BIO_read_spec_string (const char *what, char **result, size_t max_length) |
| Create the specification to read a 0-terminated string. | |
| struct GNUNET_BIO_ReadSpec | GNUNET_BIO_read_spec_int32 (const char *what, int32_t *i) |
| Create the specification to read an (u)int32_t. | |
| struct GNUNET_BIO_ReadSpec | GNUNET_BIO_read_spec_int64 (const char *what, int64_t *i) |
| Create the specification to read an (u)int64_t. | |
| struct GNUNET_BIO_ReadSpec | GNUNET_BIO_read_spec_float (const char *what, float *f) |
| Create the specification to read a float. | |
| struct GNUNET_BIO_ReadSpec | GNUNET_BIO_read_spec_double (const char *what, double *f) |
| Create the specification to read a double. | |
| enum GNUNET_GenericReturnValue | GNUNET_BIO_read_spec_commit (struct GNUNET_BIO_ReadHandle *h, struct GNUNET_BIO_ReadSpec *rs) |
| Execute the read specifications in order. | |
| struct GNUNET_BIO_WriteSpec | GNUNET_BIO_write_spec_object (const char *what, void *source, size_t size) |
| Create the specification to read some bytes. | |
| struct GNUNET_BIO_WriteSpec | GNUNET_BIO_write_spec_string (const char *what, const char *s) |
| Create the specification to write a 0-terminated string. | |
| struct GNUNET_BIO_WriteSpec | GNUNET_BIO_write_spec_int32 (const char *what, int32_t *i) |
| Create the specification to write an (u)int32_t. | |
| struct GNUNET_BIO_WriteSpec | GNUNET_BIO_write_spec_int64 (const char *what, int64_t *i) |
| Create the specification to write an (u)int64_t. | |
| struct GNUNET_BIO_WriteSpec | GNUNET_BIO_write_spec_float (const char *what, float *f) |
| Create the specification to write a float. | |
| struct GNUNET_BIO_WriteSpec | GNUNET_BIO_write_spec_double (const char *what, double *f) |
| Create the specification to write an double. | |
| enum GNUNET_GenericReturnValue | GNUNET_BIO_write_spec_commit (struct GNUNET_BIO_WriteHandle *h, struct GNUNET_BIO_WriteSpec *ws) |
| Execute the write specifications in order. | |
Buffered IO library.
Definition in file gnunet_bio_lib.h.