diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:46:35 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:46:35 +0000 |
commit | 502af2167f7c218366666ca4944bd7cc54b5b19a (patch) | |
tree | a91fec5cc9769d260640bd91c6633cb9cf395524 /src/include/gnunet_chat_service.h | |
parent | 03af5a603b7cc53432249d5854cd412aa90dde0d (diff) | |
download | gnunet-502af2167f7c218366666ca4944bd7cc54b5b19a.tar.gz gnunet-502af2167f7c218366666ca4944bd7cc54b5b19a.zip |
indentation
Diffstat (limited to 'src/include/gnunet_chat_service.h')
-rw-r--r-- | src/include/gnunet_chat_service.h | 104 |
1 files changed, 59 insertions, 45 deletions
diff --git a/src/include/gnunet_chat_service.h b/src/include/gnunet_chat_service.h index 0a45cf533..723c280e6 100644 --- a/src/include/gnunet_chat_service.h +++ b/src/include/gnunet_chat_service.h | |||
@@ -47,41 +47,41 @@ extern "C" | |||
47 | * Options for messaging. Compatible options can be OR'ed together. | 47 | * Options for messaging. Compatible options can be OR'ed together. |
48 | */ | 48 | */ |
49 | enum GNUNET_CHAT_MsgOptions | 49 | enum GNUNET_CHAT_MsgOptions |
50 | { | 50 | { |
51 | /** | 51 | /** |
52 | * No special options. | 52 | * No special options. |
53 | */ | 53 | */ |
54 | GNUNET_CHAT_MSG_OPTION_NONE = 0, | 54 | GNUNET_CHAT_MSG_OPTION_NONE = 0, |
55 | 55 | ||
56 | /** | 56 | /** |
57 | * Encrypt the message so that only the receiver can decrypt it. | 57 | * Encrypt the message so that only the receiver can decrypt it. |
58 | */ | 58 | */ |
59 | GNUNET_CHAT_MSG_PRIVATE = 1, | 59 | GNUNET_CHAT_MSG_PRIVATE = 1, |
60 | 60 | ||
61 | /** | 61 | /** |
62 | * Hide the identity of the sender. | 62 | * Hide the identity of the sender. |
63 | */ | 63 | */ |
64 | GNUNET_CHAT_MSG_ANONYMOUS = 2, | 64 | GNUNET_CHAT_MSG_ANONYMOUS = 2, |
65 | 65 | ||
66 | /** | 66 | /** |
67 | * Sign the content, authenticating the sender (using the provided private | 67 | * Sign the content, authenticating the sender (using the provided private |
68 | * key, which may represent a pseudonym). | 68 | * key, which may represent a pseudonym). |
69 | */ | 69 | */ |
70 | GNUNET_CHAT_MSG_AUTHENTICATED = 4, | 70 | GNUNET_CHAT_MSG_AUTHENTICATED = 4, |
71 | 71 | ||
72 | /** | 72 | /** |
73 | * Require signed acknowledgment before completing delivery (and of course, | 73 | * Require signed acknowledgment before completing delivery (and of course, |
74 | * only acknowledge if delivery is guaranteed). | 74 | * only acknowledge if delivery is guaranteed). |
75 | */ | 75 | */ |
76 | GNUNET_CHAT_MSG_ACKNOWLEDGED = 8, | 76 | GNUNET_CHAT_MSG_ACKNOWLEDGED = 8, |
77 | 77 | ||
78 | /** | 78 | /** |
79 | * Authenticate for the receiver, but ensure that receiver cannot prove | 79 | * Authenticate for the receiver, but ensure that receiver cannot prove |
80 | * authenticity to third parties later. (not yet implemented) | 80 | * authenticity to third parties later. (not yet implemented) |
81 | */ | 81 | */ |
82 | GNUNET_CHAT_MSG_OFF_THE_RECORD = 16, | 82 | GNUNET_CHAT_MSG_OFF_THE_RECORD = 16, |
83 | 83 | ||
84 | }; | 84 | }; |
85 | 85 | ||
86 | /** | 86 | /** |
87 | * Handle for a (joined) chat room. | 87 | * Handle for a (joined) chat room. |
@@ -110,12 +110,15 @@ typedef int (*GNUNET_CHAT_JoinCallback) (void *cls); | |||
110 | * accept (but user is away), GNUNET_SYSERR to signal denied delivery | 110 | * accept (but user is away), GNUNET_SYSERR to signal denied delivery |
111 | */ | 111 | */ |
112 | typedef int (*GNUNET_CHAT_MessageCallback) (void *cls, | 112 | typedef int (*GNUNET_CHAT_MessageCallback) (void *cls, |
113 | struct GNUNET_CHAT_Room *room, | 113 | struct GNUNET_CHAT_Room * room, |
114 | const GNUNET_HashCode *sender, | 114 | const GNUNET_HashCode * sender, |
115 | const struct GNUNET_CONTAINER_MetaData *member_info, | 115 | const struct |
116 | const char *message, | 116 | GNUNET_CONTAINER_MetaData * |
117 | struct GNUNET_TIME_Absolute timestamp, | 117 | member_info, const char *message, |
118 | enum GNUNET_CHAT_MsgOptions options); | 118 | struct GNUNET_TIME_Absolute |
119 | timestamp, | ||
120 | enum GNUNET_CHAT_MsgOptions | ||
121 | options); | ||
119 | 122 | ||
120 | /** | 123 | /** |
121 | * Callback used for notification that another room member has joined or left. | 124 | * Callback used for notification that another room member has joined or left. |
@@ -128,9 +131,14 @@ typedef int (*GNUNET_CHAT_MessageCallback) (void *cls, | |||
128 | * @return GNUNET_OK | 131 | * @return GNUNET_OK |
129 | */ | 132 | */ |
130 | typedef int (*GNUNET_CHAT_MemberListCallback) (void *cls, | 133 | typedef int (*GNUNET_CHAT_MemberListCallback) (void *cls, |
131 | const struct GNUNET_CONTAINER_MetaData *member_info, | 134 | const struct |
132 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *member_id, | 135 | GNUNET_CONTAINER_MetaData * |
133 | enum GNUNET_CHAT_MsgOptions options); | 136 | member_info, |
137 | const struct | ||
138 | GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded | ||
139 | * member_id, | ||
140 | enum GNUNET_CHAT_MsgOptions | ||
141 | options); | ||
134 | 142 | ||
135 | /** | 143 | /** |
136 | * Callback used for message delivery confirmations. | 144 | * Callback used for message delivery confirmations. |
@@ -144,10 +152,12 @@ typedef int (*GNUNET_CHAT_MemberListCallback) (void *cls, | |||
144 | * confirmations from anyone for this message | 152 | * confirmations from anyone for this message |
145 | */ | 153 | */ |
146 | typedef int (*GNUNET_CHAT_MessageConfirmation) (void *cls, | 154 | typedef int (*GNUNET_CHAT_MessageConfirmation) (void *cls, |
147 | struct GNUNET_CHAT_Room *room, | 155 | struct GNUNET_CHAT_Room * room, |
148 | uint32_t orig_seq_number, | 156 | uint32_t orig_seq_number, |
149 | struct GNUNET_TIME_Absolute timestamp, | 157 | struct GNUNET_TIME_Absolute |
150 | const GNUNET_HashCode *receiver); | 158 | timestamp, |
159 | const GNUNET_HashCode * | ||
160 | receiver); | ||
151 | 161 | ||
152 | /** | 162 | /** |
153 | * Join a chat room. | 163 | * Join a chat room. |
@@ -173,21 +183,26 @@ typedef int (*GNUNET_CHAT_MessageConfirmation) (void *cls, | |||
173 | * @param me member ID (pseudonym) | 183 | * @param me member ID (pseudonym) |
174 | * @return NULL on error | 184 | * @return NULL on error |
175 | */ | 185 | */ |
176 | struct GNUNET_CHAT_Room * | 186 | struct GNUNET_CHAT_Room *GNUNET_CHAT_join_room (const struct |
177 | GNUNET_CHAT_join_room (const struct GNUNET_CONFIGURATION_Handle *cfg, | 187 | GNUNET_CONFIGURATION_Handle |
178 | const char *nick_name, | 188 | *cfg, const char *nick_name, |
179 | struct GNUNET_CONTAINER_MetaData *member_info, | 189 | struct GNUNET_CONTAINER_MetaData |
180 | const char *room_name, | 190 | *member_info, |
181 | enum GNUNET_CHAT_MsgOptions msg_options, | 191 | const char *room_name, |
182 | GNUNET_CHAT_JoinCallback joinCallback, | 192 | enum GNUNET_CHAT_MsgOptions |
183 | void *join_cls, | 193 | msg_options, |
184 | GNUNET_CHAT_MessageCallback messageCallback, | 194 | GNUNET_CHAT_JoinCallback |
185 | void *message_cls, | 195 | joinCallback, void *join_cls, |
186 | GNUNET_CHAT_MemberListCallback memberCallback, | 196 | GNUNET_CHAT_MessageCallback |
187 | void *member_cls, | 197 | messageCallback, |
188 | GNUNET_CHAT_MessageConfirmation confirmationCallback, | 198 | void *message_cls, |
189 | void *confirmation_cls, | 199 | GNUNET_CHAT_MemberListCallback |
190 | GNUNET_HashCode *me); | 200 | memberCallback, |
201 | void *member_cls, | ||
202 | GNUNET_CHAT_MessageConfirmation | ||
203 | confirmationCallback, | ||
204 | void *confirmation_cls, | ||
205 | GNUNET_HashCode * me); | ||
191 | 206 | ||
192 | /** | 207 | /** |
193 | * Send a message. | 208 | * Send a message. |
@@ -202,15 +217,14 @@ void | |||
202 | GNUNET_CHAT_send_message (struct GNUNET_CHAT_Room *room, | 217 | GNUNET_CHAT_send_message (struct GNUNET_CHAT_Room *room, |
203 | const char *message, | 218 | const char *message, |
204 | enum GNUNET_CHAT_MsgOptions options, | 219 | enum GNUNET_CHAT_MsgOptions options, |
205 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *receiver, | 220 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded |
206 | uint32_t *sequence_number); | 221 | *receiver, uint32_t * sequence_number); |
207 | 222 | ||
208 | 223 | ||
209 | /** | 224 | /** |
210 | * Leave a chat room. | 225 | * Leave a chat room. |
211 | */ | 226 | */ |
212 | void | 227 | void GNUNET_CHAT_leave_room (struct GNUNET_CHAT_Room *chat_room); |
213 | GNUNET_CHAT_leave_room (struct GNUNET_CHAT_Room *chat_room); | ||
214 | 228 | ||
215 | 229 | ||
216 | #if 0 | 230 | #if 0 |