aboutsummaryrefslogtreecommitdiff
path: root/src/gnunet_chat_handle.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gnunet_chat_handle.h')
-rw-r--r--src/gnunet_chat_handle.h79
1 files changed, 19 insertions, 60 deletions
diff --git a/src/gnunet_chat_handle.h b/src/gnunet_chat_handle.h
index b287336..a0f44e0 100644
--- a/src/gnunet_chat_handle.h
+++ b/src/gnunet_chat_handle.h
@@ -26,86 +26,45 @@
26#define GNUNET_CHAT_HANDLE_H_ 26#define GNUNET_CHAT_HANDLE_H_
27 27
28#include <gnunet/platform.h> 28#include <gnunet/platform.h>
29#include <gnunet/gnunet_common.h>
29#include <gnunet/gnunet_config.h> 30#include <gnunet/gnunet_config.h>
30#include <gnunet/gnunet_container_lib.h> 31#include <gnunet/gnunet_container_lib.h>
31#include <gnunet/gnunet_arm_service.h> 32#include <gnunet/gnunet_arm_service.h>
32#include <gnunet/gnunet_fs_service.h> 33#include <gnunet/gnunet_fs_service.h>
33#include <gnunet/gnunet_messenger_service.h> 34#include <gnunet/gnunet_messenger_service.h>
34#include <gnunet/gnunet_regex_service.h>
35#include <gnunet/gnunet_util_lib.h> 35#include <gnunet/gnunet_util_lib.h>
36 36
37#include "gnunet_chat_lib.h"
38
37struct GNUNET_CHAT_Handle 39struct GNUNET_CHAT_Handle
38{ 40{
39 const struct GNUNET_CONFIGURATION_Handle* cfg; 41 const struct GNUNET_CONFIGURATION_Handle* cfg;
40 42
41 struct {
42 /*
43 * feature: (automatically start required services)
44 */
45 struct GNUNET_ARM_Handle *arm;
46
47 /*
48 * required: (files can be uploaded/downloaded)
49 */
50 struct GNUNET_FS_Handle *fs;
51
52 /*
53 * required!
54 */
55 struct GNUNET_MESSENGER_Handle *messenger;
56 } handles;
57
58 struct {
59 struct GNUNET_CONTAINER_MultiShortmap *short_map;
60 struct GNUNET_CONTAINER_MultiHashMap *hash_map;
61 } contacts;
62
63 struct GNUNET_CONTAINER_MultiHashMap *groups;
64 struct GNUNET_CONTAINER_MultiHashMap *contexts;
65 struct GNUNET_CONTAINER_MultiHashMap *files;
66
67 GNUNET_CHAT_ContextMessageCallback msg_cb; 43 GNUNET_CHAT_ContextMessageCallback msg_cb;
68 void *msg_cls; 44 void *msg_cls;
69 45
70 GNUNET_CHAT_WarningCallback warn_cb; 46 GNUNET_CHAT_WarningCallback warn_cb;
71 void *warn_cls; 47 void *warn_cls;
72};
73
74int
75handle_update_chat_contact (struct GNUNET_CHAT_Handle *handle,
76 struct GNUNET_CHAT_Contact *chatContact,
77 int removeContact);
78
79int
80handle_update_chat_group (struct GNUNET_CHAT_Handle *handle,
81 struct GNUNET_CHAT_Group *chatGroup,
82 int removeGroup);
83 48
84int 49 struct GNUNET_CONTAINER_MultiHashMap *files;
85handle_update_chat_context (struct GNUNET_CHAT_Handle *handle, 50 struct GNUNET_CONTAINER_MultiHashMap *contexts;
86 struct GNUNET_CHAT_Context *context, 51 struct GNUNET_CONTAINER_MultiShortmap *contacts;
87 int removeContext); 52 struct GNUNET_CONTAINER_MultiHashMap *groups;
88 53
89int 54 struct GNUNET_ARM_Handle *arm;
90handle_update_chat_file (struct GNUNET_CHAT_Handle *handle, 55 struct GNUNET_FS_Handle *fs;
91 struct GNUNET_CHAT_File *file, 56 struct GNUNET_MESSENGER_Handle *messenger;
92 int removeFile); 57};
93 58
94struct GNUNET_CHAT_Contact* 59struct GNUNET_CHAT_Handle*
95handle_get_chat_contact (struct GNUNET_CHAT_Handle *handle, 60handle_create_from_config (const struct GNUNET_CONFIGURATION_Handle* cfg,
96 const struct GNUNET_MESSENGER_Contact *contact); 61 const char* name,
62 GNUNET_CHAT_ContextMessageCallback msg_cb,
63 void *msg_cls,
64 GNUNET_CHAT_WarningCallback warn_cb,
65 void *warn_cls);
97 66
98void 67void
99handle_set_chat_contact (struct GNUNET_CHAT_Handle *handle, 68handle_destroy (struct GNUNET_CHAT_Handle* handle);
100 const struct GNUNET_MESSENGER_Contact *contact,
101 struct GNUNET_CHAT_Contact *chatContact);
102
103struct GNUNET_CHAT_Context*
104handle_get_chat_context (struct GNUNET_CHAT_Handle *handle,
105 const struct GNUNET_HashCode *key);
106
107struct GNUNET_CHAT_File*
108handle_get_chat_file (struct GNUNET_CHAT_Handle *handle,
109 const struct GNUNET_HashCode *hash);
110 69
111#endif /* GNUNET_CHAT_HANDLE_H_ */ 70#endif /* GNUNET_CHAT_HANDLE_H_ */