diff options
author | irungentoo <irungentoo@gmail.com> | 2013-08-16 13:11:09 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-08-16 13:11:09 -0400 |
commit | 88ff81d9def5efe69cbaf91aa41906177ba7dde9 (patch) | |
tree | cb9f149e438bcd1f18d8c1eb5d8be6b0a22f58a4 /core/Messenger.h | |
parent | c5af8f44a9d040a0bbe0442ec074d9fc8562dd32 (diff) |
Passed everything through astyle.
Diffstat (limited to 'core/Messenger.h')
-rw-r--r-- | core/Messenger.h | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/core/Messenger.h b/core/Messenger.h index e12b3fc8..cd9e6e63 100644 --- a/core/Messenger.h +++ b/core/Messenger.h | |||
@@ -76,7 +76,8 @@ typedef enum { | |||
76 | USERSTATUS_AWAY, | 76 | USERSTATUS_AWAY, |
77 | USERSTATUS_BUSY, | 77 | USERSTATUS_BUSY, |
78 | USERSTATUS_INVALID | 78 | USERSTATUS_INVALID |
79 | } USERSTATUS; | 79 | } |
80 | USERSTATUS; | ||
80 | 81 | ||
81 | typedef struct { | 82 | typedef struct { |
82 | uint8_t client_id[CLIENT_ID_SIZE]; | 83 | uint8_t client_id[CLIENT_ID_SIZE]; |
@@ -111,22 +112,22 @@ typedef struct Messenger { | |||
111 | Friend *friendlist; | 112 | Friend *friendlist; |
112 | uint32_t numfriends; | 113 | uint32_t numfriends; |
113 | 114 | ||
114 | void (*friend_message)(struct Messenger *m, int, uint8_t *, uint16_t, void*); | 115 | void (*friend_message)(struct Messenger *m, int, uint8_t *, uint16_t, void *); |
115 | void* friend_message_userdata; | 116 | void *friend_message_userdata; |
116 | void (*friend_action)(struct Messenger *m, int, uint8_t *, uint16_t, void*); | 117 | void (*friend_action)(struct Messenger *m, int, uint8_t *, uint16_t, void *); |
117 | void* friend_action_userdata; | 118 | void *friend_action_userdata; |
118 | void (*friend_namechange)(struct Messenger *m, int, uint8_t *, uint16_t, void*); | 119 | void (*friend_namechange)(struct Messenger *m, int, uint8_t *, uint16_t, void *); |
119 | void* friend_namechange_userdata; | 120 | void *friend_namechange_userdata; |
120 | void (*friend_statusmessagechange)(struct Messenger *m, int, uint8_t *, uint16_t, void*); | 121 | void (*friend_statusmessagechange)(struct Messenger *m, int, uint8_t *, uint16_t, void *); |
121 | void* friend_statusmessagechange_userdata; | 122 | void *friend_statusmessagechange_userdata; |
122 | void (*friend_userstatuschange)(struct Messenger *m, int, USERSTATUS, void*); | 123 | void (*friend_userstatuschange)(struct Messenger *m, int, USERSTATUS, void *); |
123 | void* friend_userstatuschange_userdata; | 124 | void *friend_userstatuschange_userdata; |
124 | void (*read_receipt)(struct Messenger *m, int, uint32_t, void*); | 125 | void (*read_receipt)(struct Messenger *m, int, uint32_t, void *); |
125 | void* read_receipt_userdata; | 126 | void *read_receipt_userdata; |
126 | void (*friend_statuschange)(struct Messenger *m, int, uint8_t, void*); | 127 | void (*friend_statuschange)(struct Messenger *m, int, uint8_t, void *); |
127 | void* friend_statuschange_userdata; | 128 | void *friend_statuschange_userdata; |
128 | void (*friend_connectionstatuschange)(struct Messenger *m, int, uint8_t, void*); | 129 | void (*friend_connectionstatuschange)(struct Messenger *m, int, uint8_t, void *); |
129 | void* friend_connectionstatuschange_userdata; | 130 | void *friend_connectionstatuschange_userdata; |
130 | 131 | ||
131 | 132 | ||
132 | } Messenger; | 133 | } Messenger; |
@@ -255,29 +256,32 @@ void m_set_sends_receipts(Messenger *m, int friendnumber, int yesno); | |||
255 | 256 | ||
256 | /* set the function that will be executed when a friend request is received. | 257 | /* set the function that will be executed when a friend request is received. |
257 | function format is function(uint8_t * public_key, uint8_t * data, uint16_t length) */ | 258 | function format is function(uint8_t * public_key, uint8_t * data, uint16_t length) */ |
258 | void m_callback_friendrequest(Messenger *m, void (*function)(uint8_t *, uint8_t *, uint16_t, void*), void* userdata); | 259 | void m_callback_friendrequest(Messenger *m, void (*function)(uint8_t *, uint8_t *, uint16_t, void *), void *userdata); |
259 | 260 | ||
260 | /* set the function that will be executed when a message from a friend is received. | 261 | /* set the function that will be executed when a message from a friend is received. |
261 | function format is: function(int friendnumber, uint8_t * message, uint32_t length) */ | 262 | function format is: function(int friendnumber, uint8_t * message, uint32_t length) */ |
262 | void m_callback_friendmessage(Messenger *m, void (*function)(Messenger *m, int, uint8_t *, uint16_t, void*), void* userdata); | 263 | void m_callback_friendmessage(Messenger *m, void (*function)(Messenger *m, int, uint8_t *, uint16_t, void *), |
264 | void *userdata); | ||
263 | 265 | ||
264 | /* set the function that will be executed when an action from a friend is received. | 266 | /* set the function that will be executed when an action from a friend is received. |
265 | function format is: function(int friendnumber, uint8_t * action, uint32_t length) */ | 267 | function format is: function(int friendnumber, uint8_t * action, uint32_t length) */ |
266 | void m_callback_action(Messenger *m, void (*function)(Messenger *m, int, uint8_t *, uint16_t, void*), void* userdata); | 268 | void m_callback_action(Messenger *m, void (*function)(Messenger *m, int, uint8_t *, uint16_t, void *), void *userdata); |
267 | 269 | ||
268 | /* set the callback for name changes | 270 | /* set the callback for name changes |
269 | function(int friendnumber, uint8_t *newname, uint16_t length) | 271 | function(int friendnumber, uint8_t *newname, uint16_t length) |
270 | you are not responsible for freeing newname */ | 272 | you are not responsible for freeing newname */ |
271 | void m_callback_namechange(Messenger *m, void (*function)(Messenger *m, int, uint8_t *, uint16_t, void*), void* userdata); | 273 | void m_callback_namechange(Messenger *m, void (*function)(Messenger *m, int, uint8_t *, uint16_t, void *), |
274 | void *userdata); | ||
272 | 275 | ||
273 | /* set the callback for status message changes | 276 | /* set the callback for status message changes |
274 | function(int friendnumber, uint8_t *newstatus, uint16_t length) | 277 | function(int friendnumber, uint8_t *newstatus, uint16_t length) |
275 | you are not responsible for freeing newstatus */ | 278 | you are not responsible for freeing newstatus */ |
276 | void m_callback_statusmessage(Messenger *m, void (*function)(Messenger *m, int, uint8_t *, uint16_t, void*), void* userdata); | 279 | void m_callback_statusmessage(Messenger *m, void (*function)(Messenger *m, int, uint8_t *, uint16_t, void *), |
280 | void *userdata); | ||
277 | 281 | ||
278 | /* set the callback for status type changes | 282 | /* set the callback for status type changes |
279 | function(int friendnumber, USERSTATUS kind) */ | 283 | function(int friendnumber, USERSTATUS kind) */ |
280 | void m_callback_userstatus(Messenger *m, void (*function)(Messenger *m, int, USERSTATUS, void*), void* userdata); | 284 | void m_callback_userstatus(Messenger *m, void (*function)(Messenger *m, int, USERSTATUS, void *), void *userdata); |
281 | 285 | ||
282 | /* set the callback for read receipts | 286 | /* set the callback for read receipts |
283 | function(int friendnumber, uint32_t receipt) | 287 | function(int friendnumber, uint32_t receipt) |
@@ -286,7 +290,7 @@ void m_callback_userstatus(Messenger *m, void (*function)(Messenger *m, int, USE | |||
286 | has been received on the other side. since core doesn't | 290 | has been received on the other side. since core doesn't |
287 | track ids for you, receipt may not correspond to any message | 291 | track ids for you, receipt may not correspond to any message |
288 | in that case, you should discard it. */ | 292 | in that case, you should discard it. */ |
289 | void m_callback_read_receipt(Messenger *m, void (*function)(Messenger *m, int, uint32_t, void*), void* userdata); | 293 | void m_callback_read_receipt(Messenger *m, void (*function)(Messenger *m, int, uint32_t, void *), void *userdata); |
290 | 294 | ||
291 | /* set the callback for connection status changes | 295 | /* set the callback for connection status changes |
292 | function(int friendnumber, uint8_t status) | 296 | function(int friendnumber, uint8_t status) |
@@ -296,12 +300,12 @@ void m_callback_read_receipt(Messenger *m, void (*function)(Messenger *m, int, u | |||
296 | note that this callback is not called when adding friends, thus the "after | 300 | note that this callback is not called when adding friends, thus the "after |
297 | being previously online" part. it's assumed that when adding friends, | 301 | being previously online" part. it's assumed that when adding friends, |
298 | their connection status is offline. */ | 302 | their connection status is offline. */ |
299 | void m_callback_connectionstatus(Messenger *m, void (*function)(Messenger *m, int, uint8_t, void*), void* userdata); | 303 | void m_callback_connectionstatus(Messenger *m, void (*function)(Messenger *m, int, uint8_t, void *), void *userdata); |
300 | 304 | ||
301 | /* run this at startup | 305 | /* run this at startup |
302 | * returns allocated instance of Messenger on success | 306 | * returns allocated instance of Messenger on success |
303 | * returns 0 if there are problems */ | 307 | * returns 0 if there are problems */ |
304 | Messenger * initMessenger(void); | 308 | Messenger *initMessenger(void); |
305 | 309 | ||
306 | /* run this before closing shop | 310 | /* run this before closing shop |
307 | * free all datastructures */ | 311 | * free all datastructures */ |