diff options
author | irungentoo <irungentoo@tox.im> | 2014-02-21 21:00:55 -0500 |
---|---|---|
committer | irungentoo <irungentoo@tox.im> | 2014-02-21 21:00:55 -0500 |
commit | 6992e8c75986e7c32b795cb854a5c73d00e9a8f4 (patch) | |
tree | aae758d3bc439fcc9a86b3ad994cd87dbea9e894 /toxcore/tox.h | |
parent | 554afe11d7c3e286b6f286405a1a1857b9f55c81 (diff) | |
parent | 36adc48b781105e55790d0049fec1b190104e480 (diff) |
Merge pull request #757 from nurupo/api-fix-1
Added size functions for names and status messages
Diffstat (limited to 'toxcore/tox.h')
-rw-r--r-- | toxcore/tox.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/toxcore/tox.h b/toxcore/tox.h index 348ef6e5..17bd4e1a 100644 --- a/toxcore/tox.h +++ b/toxcore/tox.h | |||
@@ -223,6 +223,12 @@ uint16_t tox_get_self_name(Tox *tox, uint8_t *name); | |||
223 | */ | 223 | */ |
224 | int tox_get_name(Tox *tox, int32_t friendnumber, uint8_t *name); | 224 | int tox_get_name(Tox *tox, int32_t friendnumber, uint8_t *name); |
225 | 225 | ||
226 | /* returns the length of name on success. | ||
227 | * returns -1 on failure. | ||
228 | */ | ||
229 | int tox_get_name_size(Tox *tox, int32_t friendnumber); | ||
230 | int tox_get_self_name_size(Tox *tox); | ||
231 | |||
226 | /* Set our user status. | 232 | /* Set our user status. |
227 | * You are responsible for freeing status after. | 233 | * You are responsible for freeing status after. |
228 | * | 234 | * |
@@ -234,10 +240,11 @@ int tox_get_name(Tox *tox, int32_t friendnumber, uint8_t *name); | |||
234 | int tox_set_status_message(Tox *tox, uint8_t *status, uint16_t length); | 240 | int tox_set_status_message(Tox *tox, uint8_t *status, uint16_t length); |
235 | int tox_set_user_status(Tox *tox, TOX_USERSTATUS userstatus); | 241 | int tox_set_user_status(Tox *tox, TOX_USERSTATUS userstatus); |
236 | 242 | ||
237 | /* return the length of friendnumber's status message. | 243 | /* returns the length of status message on success. |
238 | * Pass it into malloc | 244 | * returns -1 on failure. |
239 | */ | 245 | */ |
240 | int tox_get_status_message_size(Tox *tox, int32_t friendnumber); | 246 | int tox_get_status_message_size(Tox *tox, int32_t friendnumber); |
247 | int tox_get_self_status_message_size(Tox *tox); | ||
241 | 248 | ||
242 | /* Copy friendnumber's status message into buf, truncating if size is over maxlen. | 249 | /* Copy friendnumber's status message into buf, truncating if size is over maxlen. |
243 | * Get the size you need to allocate from m_get_statusmessage_size. | 250 | * Get the size you need to allocate from m_get_statusmessage_size. |