diff options
author | Jacki <jacki@thejackimonster.de> | 2024-01-05 03:53:38 +0100 |
---|---|---|
committer | Jacki <jacki@thejackimonster.de> | 2024-01-05 03:53:38 +0100 |
commit | 0aa918a8861ad8e8260309e0e0961cfb0b1b1c26 (patch) | |
tree | a0dc5afa915227d7cf4d28fa339058c139aedb64 /include | |
parent | 155016406d44a5a12a123a91a8eaf8aaa62e7430 (diff) | |
download | libgnunetchat-0aa918a8861ad8e8260309e0e0961cfb0b1b1c26.tar.gz libgnunetchat-0aa918a8861ad8e8260309e0e0961cfb0b1b1c26.zip |
Implement function to list attributes of a handle
Signed-off-by: Jacki <jacki@thejackimonster.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/gnunet/gnunet_chat_lib.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/include/gnunet/gnunet_chat_lib.h b/include/gnunet/gnunet_chat_lib.h index 8026cf6..20473dc 100644 --- a/include/gnunet/gnunet_chat_lib.h +++ b/include/gnunet/gnunet_chat_lib.h | |||
@@ -191,6 +191,20 @@ typedef enum GNUNET_GenericReturnValue | |||
191 | struct GNUNET_CHAT_Account *account); | 191 | struct GNUNET_CHAT_Account *account); |
192 | 192 | ||
193 | /** | 193 | /** |
194 | * Method called for each attribute of a specific chat handle. | ||
195 | * | ||
196 | * @param[in,out] cls Closure from #GNUNET_CHAT_get_attributes | ||
197 | * @param[in] handle Chat handle | ||
198 | * @param[in] name Attribute name | ||
199 | * @param[in] value Attribute value | ||
200 | */ | ||
201 | typedef void | ||
202 | (*GNUNET_CHAT_AttributeCallback) (void *cls, | ||
203 | struct GNUNET_CHAT_Handle *handle, | ||
204 | const char *name, | ||
205 | const char *value); | ||
206 | |||
207 | /** | ||
194 | * Method called when a lobby is opened to share with others via a chat URI. | 208 | * Method called when a lobby is opened to share with others via a chat URI. |
195 | * | 209 | * |
196 | * @param[in,out] cls Closure from #GNUNET_CHAT_lobby_open | 210 | * @param[in,out] cls Closure from #GNUNET_CHAT_lobby_open |
@@ -515,6 +529,19 @@ GNUNET_CHAT_delete_attribute (struct GNUNET_CHAT_Handle *handle, | |||
515 | const char *name); | 529 | const char *name); |
516 | 530 | ||
517 | /** | 531 | /** |
532 | * Calls an optional <i>callback</i> for each attribute of a given chat | ||
533 | * <i>handle</i>. | ||
534 | * | ||
535 | * @param[in,out] handle Chat handle | ||
536 | * @param[in] callback Callback for attribute iteration (optional) | ||
537 | * @param[in,out] cls Closure for attribute iteration (optional) | ||
538 | */ | ||
539 | void | ||
540 | GNUNET_CHAT_get_attributes (struct GNUNET_CHAT_Handle *handle, | ||
541 | GNUNET_CHAT_AttributeCallback callback, | ||
542 | void *cls); | ||
543 | |||
544 | /** | ||
518 | * Convert an UTF-8 String to a chat URI which will be newly allocated. | 545 | * Convert an UTF-8 String to a chat URI which will be newly allocated. |
519 | * | 546 | * |
520 | * @param[in] uri UTF-8 string to parse | 547 | * @param[in] uri UTF-8 string to parse |
@@ -1363,7 +1390,8 @@ const struct GNUNET_CHAT_Contact* | |||
1363 | GNUNET_CHAT_ticket_get_contact (const struct GNUNET_CHAT_Ticket *ticket); | 1390 | GNUNET_CHAT_ticket_get_contact (const struct GNUNET_CHAT_Ticket *ticket); |
1364 | 1391 | ||
1365 | /** | 1392 | /** |
1366 | * Consumes a given chat <i>ticket</i>. | 1393 | * Consumes a given chat <i>ticket</i> and calls an optional <i>callback</i> |
1394 | * for each of its attributes. | ||
1367 | * | 1395 | * |
1368 | * @param[in,out] ticket Chat ticket | 1396 | * @param[in,out] ticket Chat ticket |
1369 | * @param[in] callback Callback for ticket consumption (optional) | 1397 | * @param[in] callback Callback for ticket consumption (optional) |