#include "platform.h"#include "gnunet_util_lib.h"#include "gnunet_reclaim_plugin.h"#include <inttypes.h>Go to the source code of this file.
Functions | |
| static char * | basic_value_to_string (void *cls, uint32_t type, const void *data, size_t data_size) |
| Convert the 'value' of an attribute to a string. | |
| static int | basic_string_to_value (void *cls, uint32_t type, const char *s, void **data, size_t *data_size) |
| Convert human-readable version of a 'value' of an attribute to the binary representation. | |
| static uint32_t | basic_typename_to_number (void *cls, const char *basic_typename) |
| Convert a type name to the corresponding number. | |
| static const char * | basic_number_to_typename (void *cls, uint32_t type) |
| Convert a type number to the corresponding type string (e.g. | |
| void * | libgnunet_plugin_reclaim_attribute_basic_init (void *cls) |
| Entry point for the plugin. | |
| void * | libgnunet_plugin_reclaim_attribute_basic_done (void *cls) |
| Exit point from the plugin. | |
Variables | ||
| struct { | ||
| const char * name | ||
| uint32_t number | ||
| } | basic_name_map [] | |
| Mapping of attribute type numbers to human-readable attribute type names. | ||
|
static |
Convert the 'value' of an attribute to a string.
| cls | closure, unused |
| type | type of the attribute |
| data | value in binary encoding |
| data_size | number of bytes in data |
Definition at line 45 of file plugin_reclaim_attribute_basic.c.
References data, data_size, GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING, GNUNET_strndup, and type.
Referenced by libgnunet_plugin_reclaim_attribute_basic_init().
|
static |
Convert human-readable version of a 'value' of an attribute to the binary representation.
| cls | closure, unused |
| type | type of the attribute |
| s | human-readable string |
| data | set to value in binary encoding (will be allocated) |
| data_size | set to number of bytes in data |
Definition at line 73 of file plugin_reclaim_attribute_basic.c.
References data, data_size, GNUNET_OK, GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING, GNUNET_strdup, GNUNET_SYSERR, and type.
Referenced by libgnunet_plugin_reclaim_attribute_basic_init().
|
static |
Convert a type name to the corresponding number.
| cls | closure, unused |
| basic_typename | name to convert |
Definition at line 114 of file plugin_reclaim_attribute_basic.c.
References basic_name_map, and name.
Referenced by libgnunet_plugin_reclaim_attribute_basic_init().
|
static |
Convert a type number to the corresponding type string (e.g.
1 to "A")
| cls | closure, unused |
| type | number of a type to convert |
Definition at line 134 of file plugin_reclaim_attribute_basic.c.
References basic_name_map, name, number, and type.
Referenced by libgnunet_plugin_reclaim_attribute_basic_init().
| void * libgnunet_plugin_reclaim_attribute_basic_init | ( | void * | cls | ) |
Entry point for the plugin.
| cls | NULL |
Definition at line 154 of file plugin_reclaim_attribute_basic.c.
References basic_number_to_typename(), basic_string_to_value(), basic_typename_to_number(), basic_value_to_string(), GNUNET_new, GNUNET_RECLAIM_AttributePluginFunctions::number_to_typename, GNUNET_RECLAIM_AttributePluginFunctions::string_to_value, GNUNET_RECLAIM_AttributePluginFunctions::typename_to_number, and GNUNET_RECLAIM_AttributePluginFunctions::value_to_string.
| void * libgnunet_plugin_reclaim_attribute_basic_done | ( | void * | cls | ) |
Exit point from the plugin.
| cls | the return value from libgnunet_plugin_block_test_init() |
Definition at line 176 of file plugin_reclaim_attribute_basic.c.
References GNUNET_RECLAIM_AttributePluginFunctions::cls, and GNUNET_free.
| const char* name |
Definition at line 100 of file plugin_reclaim_attribute_basic.c.
Referenced by basic_number_to_typename(), and basic_typename_to_number().
| uint32_t number |
Definition at line 101 of file plugin_reclaim_attribute_basic.c.
Referenced by basic_number_to_typename().
| struct { ... } basic_name_map[] |
Mapping of attribute type numbers to human-readable attribute type names.
Referenced by basic_number_to_typename(), and basic_typename_to_number().