From f485d0399e8ef0c388a321bbad7ae424935752bc Mon Sep 17 00:00:00 2001 From: "Schanzenbach, Martin" Date: Mon, 4 Dec 2017 16:37:28 +0100 Subject: -fix makefile --- src/include/gnunet_identity_attribute_lib.h | 45 +++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'src/include') diff --git a/src/include/gnunet_identity_attribute_lib.h b/src/include/gnunet_identity_attribute_lib.h index 039b50351..4e32c2ae1 100644 --- a/src/include/gnunet_identity_attribute_lib.h +++ b/src/include/gnunet_identity_attribute_lib.h @@ -213,7 +213,52 @@ GNUNET_IDENTITY_ATTRIBUTE_deserialize (const char* data, struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList* GNUNET_IDENTITY_ATTRIBUTE_list_dup (const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs); +/** + * Convert a type name to the corresponding number + * + * @param typename name to convert + * @return corresponding number, UINT32_MAX on error + */ +uint32_t +GNUNET_IDENTITY_ATTRIBUTE_typename_to_number (const char *typename); + +/** + * Convert human-readable version of a 'claim' of an attribute to the binary + * representation + * + * @param type type of the claim + * @param s human-readable string + * @param data set to value in binary encoding (will be allocated) + * @param data_size set to number of bytes in @a data + * @return #GNUNET_OK on success + */ +int +GNUNET_IDENTITY_ATTRIBUTE_string_to_claim (uint32_t type, + const char *s, + void **data, + size_t *data_size); +/** + * Convert the 'claim' of an attribute to a string + * + * @param type the type of attribute + * @param data claim in binary encoding + * @param data_size number of bytes in @a data + * @return NULL on error, otherwise human-readable representation of the claim + */ +char * +GNUNET_IDENTITY_ATTRIBUTE_claim_to_string (uint32_t type, + const void* data, + size_t data_size); + +/** + * Convert a type number to the corresponding type string + * + * @param type number of a type + * @return corresponding typestring, NULL on error + */ +const char* +GNUNET_IDENTITY_ATTRIBUTE_number_to_typename (uint32_t type); #if 0 /* keep Emacsens' auto-indent happy */ { -- cgit v1.2.3