From c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 5 Oct 2019 15:09:28 +0200 Subject: global reindent, now with uncrustify hook enabled --- .../plugin_reclaim_attribute_gnuid.c | 65 +++++++++++----------- 1 file changed, 33 insertions(+), 32 deletions(-) (limited to 'src/reclaim-attribute/plugin_reclaim_attribute_gnuid.c') diff --git a/src/reclaim-attribute/plugin_reclaim_attribute_gnuid.c b/src/reclaim-attribute/plugin_reclaim_attribute_gnuid.c index c47148c19..8b63fe856 100644 --- a/src/reclaim-attribute/plugin_reclaim_attribute_gnuid.c +++ b/src/reclaim-attribute/plugin_reclaim_attribute_gnuid.c @@ -42,19 +42,19 @@ * @return NULL on error, otherwise human-readable representation of the value */ static char * -gnuid_value_to_string(void *cls, - uint32_t type, - const void *data, - size_t data_size) +gnuid_value_to_string (void *cls, + uint32_t type, + const void *data, + size_t data_size) { switch (type) - { - case GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING: - return GNUNET_strndup(data, data_size); + { + case GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING: + return GNUNET_strndup (data, data_size); - default: - return NULL; - } + default: + return NULL; + } } @@ -70,24 +70,24 @@ gnuid_value_to_string(void *cls, * @return #GNUNET_OK on success */ static int -gnuid_string_to_value(void *cls, - uint32_t type, - const char *s, - void **data, - size_t *data_size) +gnuid_string_to_value (void *cls, + uint32_t type, + const char *s, + void **data, + size_t *data_size) { if (NULL == s) return GNUNET_SYSERR; switch (type) - { - case GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING: - *data = GNUNET_strdup(s); - *data_size = strlen(s); - return GNUNET_OK; - - default: - return GNUNET_SYSERR; - } + { + case GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING: + *data = GNUNET_strdup (s); + *data_size = strlen (s); + return GNUNET_OK; + + default: + return GNUNET_SYSERR; + } } @@ -95,7 +95,8 @@ gnuid_string_to_value(void *cls, * Mapping of attribute type numbers to human-readable * attribute type names. */ -static struct { +static struct +{ const char *name; uint32_t number; } gnuid_name_map[] = { { "STRING", GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING }, @@ -110,13 +111,13 @@ static struct { * @return corresponding number, UINT32_MAX on error */ static uint32_t -gnuid_typename_to_number(void *cls, const char *gnuid_typename) +gnuid_typename_to_number (void *cls, const char *gnuid_typename) { unsigned int i; i = 0; while ((NULL != gnuid_name_map[i].name) && - (0 != strcasecmp(gnuid_typename, gnuid_name_map[i].name))) + (0 != strcasecmp (gnuid_typename, gnuid_name_map[i].name))) i++; return gnuid_name_map[i].number; } @@ -130,7 +131,7 @@ gnuid_typename_to_number(void *cls, const char *gnuid_typename) * @return corresponding typestring, NULL on error */ static const char * -gnuid_number_to_typename(void *cls, uint32_t type) +gnuid_number_to_typename (void *cls, uint32_t type) { unsigned int i; @@ -148,11 +149,11 @@ gnuid_number_to_typename(void *cls, uint32_t type) * @return the exported block API */ void * -libgnunet_plugin_reclaim_attribute_gnuid_init(void *cls) +libgnunet_plugin_reclaim_attribute_gnuid_init (void *cls) { struct GNUNET_RECLAIM_ATTRIBUTE_PluginFunctions *api; - api = GNUNET_new(struct GNUNET_RECLAIM_ATTRIBUTE_PluginFunctions); + api = GNUNET_new (struct GNUNET_RECLAIM_ATTRIBUTE_PluginFunctions); api->value_to_string = &gnuid_value_to_string; api->string_to_value = &gnuid_string_to_value; api->typename_to_number = &gnuid_typename_to_number; @@ -168,11 +169,11 @@ libgnunet_plugin_reclaim_attribute_gnuid_init(void *cls) * @return NULL */ void * -libgnunet_plugin_reclaim_attribute_gnuid_done(void *cls) +libgnunet_plugin_reclaim_attribute_gnuid_done (void *cls) { struct GNUNET_RECLAIM_ATTRIBUTE_PluginFunctions *api = cls; - GNUNET_free(api); + GNUNET_free (api); return NULL; } -- cgit v1.2.3