37#if !defined (__GNUNET_UTIL_LIB_H_INSIDE__)
38#error "Only <gnunet_util_lib.h> can be included directly."
41#ifndef GNUNET_BIO_LIB_H
42#define GNUNET_BIO_LIB_H
407#define GNUNET_BIO_read_spec_end() \
408 { NULL, NULL, NULL, NULL, 0 }
555#define GNUNET_BIO_write_spec_end() \
556 { NULL, NULL, NULL, NULL, 0 }
static struct GNUNET_ARM_Handle * h
Connection with ARM.
static GstElement * source
Appsrc instance into which we write data for the pipeline.
static int result
Global testing status.
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
Container classes for GNUnet.
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_write_close(struct GNUNET_BIO_WriteHandle *h, char **emsg)
Close an IO handle.
enum GNUNET_GenericReturnValue GNUNET_BIO_write_double(struct GNUNET_BIO_WriteHandle *h, const char *what, double f)
Write a double.
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_string(const char *what, char **result, size_t max_length)
Create the specification to read a 0-terminated string.
struct GNUNET_BIO_WriteHandle * GNUNET_BIO_write_open_file(const char *fn)
Open a file for writing.
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_read_spec_commit(struct GNUNET_BIO_ReadHandle *h, struct GNUNET_BIO_ReadSpec *rs)
Execute the read specifications in order.
enum GNUNET_GenericReturnValue GNUNET_BIO_flush(struct GNUNET_BIO_WriteHandle *h)
Force a file-based buffered writer to flush its buffer.
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.
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_read_string(struct GNUNET_BIO_ReadHandle *h, const char *what, char **result, size_t max_length)
Read 0-terminated string.
struct GNUNET_BIO_WriteSpec GNUNET_BIO_write_spec_string(const char *what, const char *s)
Create the specification to write a 0-terminated string.
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.
struct GNUNET_BIO_WriteHandle * GNUNET_BIO_write_open_buffer(void)
Create a handle backed by an in-memory buffer.
void GNUNET_BIO_read_set_error(struct GNUNET_BIO_ReadHandle *h, const char *emsg)
Set read error to handle.
enum GNUNET_GenericReturnValue GNUNET_BIO_write_string(struct GNUNET_BIO_WriteHandle *h, const char *what, const char *s)
Write 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.
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.
enum GNUNET_GenericReturnValue GNUNET_BIO_read_float(struct GNUNET_BIO_ReadHandle *h, const char *what, float *f)
Read a float.
struct GNUNET_BIO_WriteSpec GNUNET_BIO_write_spec_double(const char *what, double *f)
Create the specification to write an double.
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.
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_object(const char *what, void *source, size_t size)
Create the specification to read some bytes.
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_write_spec_commit(struct GNUNET_BIO_WriteHandle *h, struct GNUNET_BIO_WriteSpec *ws)
Execute the write specifications in order.
enum GNUNET_GenericReturnValue GNUNET_BIO_read_close(struct GNUNET_BIO_ReadHandle *h, char **emsg)
Close an open handle.
enum GNUNET_GenericReturnValue GNUNET_BIO_read_int64(struct GNUNET_BIO_ReadHandle *h, const char *what, int64_t *i)
Read an (u)int64_t.
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_read_int32(struct GNUNET_BIO_ReadHandle *h, const char *what, int32_t *i)
Read an (u)int32_t.
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_ReadSpec GNUNET_BIO_read_spec_int64(const char *what, int64_t *i)
Create the specification to read an (u)int64_t.
enum GNUNET_GenericReturnValue GNUNET_BIO_read_double(struct GNUNET_BIO_ReadHandle *h, const char *what, double *f)
Read a double.
struct GNUNET_BIO_ReadHandle * GNUNET_BIO_read_open_file(const char *fn)
Open a file for reading.
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_ReadHandle * GNUNET_BIO_read_open_buffer(void *buffer, size_t size)
Create a handle from an existing allocated buffer.
struct GNUNET_BIO_WriteSpec GNUNET_BIO_write_spec_int64(const char *what, int64_t *i)
Create the specification to write an (u)int64_t.
GNUNET_GenericReturnValue
Named constants for return values.
static unsigned int size
Size of the "table".
Handle for buffered reading.
char * emsg
Error message, NULL if there were no errors.
Structure specifying a reading operation on an IO handle.
void * cls
Closure for rh.
const char * what
What is being read (for error message creation)
GNUNET_BIO_ReadHandler rh
Function performing data deserialization.
void * target
Destination buffer.
size_t size
Size of target.
Handle for buffered writing.
char * emsg
Error message, NULL if there were no errors.
Structure specifying a writing operation on an IO handle.
GNUNET_BIO_WriteHandler wh
Function performing data serialization.
void * source
Source buffer.
size_t source_size
Size of source.
void * cls
Closure for rh.
const char * what
What is being read (for error message creation)