1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-12-23 07:33:25 +01:00

Convert deprecated uppercase enums to camelcase

This commit is contained in:
jfreegman 2018-10-09 23:06:57 -04:00
parent 94d22a8853
commit 0fea930c24
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63
26 changed files with 107 additions and 103 deletions

View File

@ -73,7 +73,7 @@ char *api_get_nick(void)
return (char *) name;
}
TOX_USER_STATUS api_get_status(void)
Tox_User_Status api_get_status(void)
{
return tox_self_get_status(user_tox);
}

View File

@ -29,7 +29,7 @@
void api_display(const char *const msg);
FriendsList api_get_friendslist(void);
char *api_get_nick(void);
TOX_USER_STATUS api_get_status(void);
Tox_User_Status api_get_status(void);
char *api_get_status_message(void);
void api_send(const char *msg);
void api_execute(const char *input, int mode);

View File

@ -115,7 +115,7 @@ static void print_err(ToxWindow *self, const char *error_str)
ToxAV *init_audio(ToxWindow *self, Tox *tox)
{
TOXAV_ERR_NEW error;
Toxav_Err_New error;
CallControl.audio_errors = ae_None;
CallControl.prompt = self;
CallControl.pending_call = false;
@ -172,7 +172,7 @@ void terminate_audio(void)
void read_device_callback(const int16_t *captured, uint32_t size, void *data)
{
TOXAV_ERR_SEND_FRAME error;
Toxav_Err_Send_Frame error;
uint32_t friend_number = *((uint32_t *)data); /* TODO: Or pass an array of call_idx's */
int64_t sample_count = ((int64_t) CallControl.audio_sample_rate) * \
((int64_t) CallControl.audio_frame_duration) / 1000;
@ -235,7 +235,7 @@ int start_transmission(ToxWindow *self, Call *call)
int stop_transmission(Call *call, uint32_t friend_number)
{
if (call->ttas) {
TOXAV_ERR_CALL_CONTROL error = TOXAV_ERR_CALL_CONTROL_OK;
Toxav_Err_Call_Control error = TOXAV_ERR_CALL_CONTROL_OK;
if (CallControl.call_state > TOXAV_FRIEND_CALL_STATE_FINISHED) {
toxav_call_control(CallControl.av, friend_number, TOXAV_CALL_CONTROL_CANCEL, &error);
@ -480,7 +480,7 @@ void callback_call_ended(uint32_t friend_number)
*/
void cmd_call(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE])
{
TOXAV_ERR_CALL error;
Toxav_Err_Call error;
const char *error_str;
if (argc != 0) {
@ -531,7 +531,7 @@ on_error:
void cmd_answer(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE])
{
TOXAV_ERR_ANSWER error;
Toxav_Err_Answer error;
const char *error_str;
if (argc != 0) {
@ -906,7 +906,7 @@ void cmd_bitrate(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)
const uint32_t bitrate = strtol(argv[1], NULL, 10);
TOXAV_ERR_BIT_RATE_SET error;
Toxav_Err_Bit_Rate_Set error;
audio_bit_rate_status_cb(CallControl.av, self->num, bitrate, &error);
if (error != TOXAV_ERR_BIT_RATE_SET_OK) {

View File

@ -52,7 +52,7 @@ static void avatar_clear(void)
*/
int avatar_send(Tox *m, uint32_t friendnum)
{
TOX_ERR_FILE_SEND err;
Tox_Err_File_Send err;
uint32_t filenum = tox_file_send(m, friendnum, TOX_FILE_KIND_AVATAR, (size_t) Avatar.size,
NULL, (uint8_t *) Avatar.name, Avatar.name_len, &err);
@ -149,7 +149,7 @@ void avatar_unset(Tox *m)
avatar_send_all(m);
}
void on_avatar_file_control(Tox *m, struct FileTransfer *ft, TOX_FILE_CONTROL control)
void on_avatar_file_control(Tox *m, struct FileTransfer *ft, Tox_File_Control control)
{
switch (control) {
case TOX_FILE_CONTROL_RESUME:
@ -204,7 +204,7 @@ void on_avatar_chunk_request(Tox *m, struct FileTransfer *ft, uint64_t position,
return;
}
TOX_ERR_FILE_SEND_CHUNK err;
Tox_Err_File_Send_Chunk err;
tox_file_send_chunk(m, ft->friendnum, ft->filenum, position, send_data, send_length, &err);
if (err != TOX_ERR_FILE_SEND_CHUNK_OK) {

View File

@ -47,6 +47,6 @@ int avatar_set(Tox *m, const char *path, size_t length);
void avatar_unset(Tox *m);
void on_avatar_chunk_request(Tox *m, struct FileTransfer *ft, uint64_t position, size_t length);
void on_avatar_file_control(Tox *m, struct FileTransfer *ft, TOX_FILE_CONTROL control);
void on_avatar_file_control(Tox *m, struct FileTransfer *ft, Tox_File_Control control);
#endif /* AVATARS_H */

View File

@ -560,7 +560,7 @@ static void DHT_bootstrap(Tox *m)
continue;
}
TOX_ERR_BOOTSTRAP err;
Tox_Err_Bootstrap err;
tox_bootstrap(m, addr, node->port, (uint8_t *) node->key, &err);
if (err != TOX_ERR_BOOTSTRAP_OK) {

View File

@ -206,7 +206,7 @@ static void recv_action_helper(ToxWindow *self, Tox *m, uint32_t num, const char
}
}
static void chat_onMessage(ToxWindow *self, Tox *m, uint32_t num, TOX_MESSAGE_TYPE type, const char *msg, size_t len)
static void chat_onMessage(ToxWindow *self, Tox *m, uint32_t num, Tox_Message_Type type, const char *msg, size_t len)
{
if (self->num != num) {
return;
@ -232,7 +232,7 @@ static void chat_onMessage(ToxWindow *self, Tox *m, uint32_t num, TOX_MESSAGE_TY
static void chat_pause_file_transfers(Tox *m, uint32_t friendnum);
static void chat_resume_file_senders(ToxWindow *self, Tox *m, uint32_t fnum);
static void chat_onConnectionChange(ToxWindow *self, Tox *m, uint32_t num, TOX_CONNECTION connection_status)
static void chat_onConnectionChange(ToxWindow *self, Tox *m, uint32_t num, Tox_Connection connection_status)
{
if (self->num != num) {
return;
@ -248,7 +248,7 @@ static void chat_onConnectionChange(ToxWindow *self, Tox *m, uint32_t num, TOX_C
char nick[TOX_MAX_NAME_LENGTH];
get_nick_truncate(m, nick, num);
TOX_CONNECTION prev_status = statusbar->connection;
Tox_Connection prev_status = statusbar->connection;
statusbar->connection = connection_status;
if (user_settings->show_connection_msg == SHOW_WELCOME_MSG_OFF) {
@ -300,7 +300,7 @@ static void chat_onNickChange(ToxWindow *self, Tox *m, uint32_t num, const char
set_window_title(self, statusbar->nick, length);
}
static void chat_onStatusChange(ToxWindow *self, Tox *m, uint32_t num, TOX_USER_STATUS status)
static void chat_onStatusChange(ToxWindow *self, Tox *m, uint32_t num, Tox_User_Status status)
{
if (self->num != num) {
return;
@ -357,7 +357,7 @@ static void chat_resume_file_senders(ToxWindow *self, Tox *m, uint32_t friendnum
continue;
}
TOX_ERR_FILE_SEND err;
Tox_Err_File_Send err;
ft->filenum = tox_file_send(m, friendnum, TOX_FILE_KIND_DATA, ft->file_size, ft->file_id,
(uint8_t *) ft->file_name, strlen(ft->file_name), &err);
@ -421,7 +421,7 @@ static void chat_onFileChunkRequest(ToxWindow *self, Tox *m, uint32_t friendnum,
return;
}
TOX_ERR_FILE_SEND_CHUNK err;
Tox_Err_File_Send_Chunk err;
tox_file_send_chunk(m, ft->friendnum, ft->filenum, position, send_data, send_length, &err);
if (err != TOX_ERR_FILE_SEND_CHUNK_OK) {
@ -476,7 +476,7 @@ static void chat_onFileRecvChunk(ToxWindow *self, Tox *m, uint32_t friendnum, ui
ft->last_keep_alive = get_unix_time();
}
static void chat_onFileControl(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_t filenum, TOX_FILE_CONTROL control)
static void chat_onFileControl(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_t filenum, Tox_File_Control control)
{
if (friendnum != self->num) {
return;
@ -1117,7 +1117,7 @@ static void chat_onDraw(ToxWindow *self, Tox *m)
/* Draw name, status and note in statusbar */
if (statusbar->connection != TOX_CONNECTION_NONE) {
int colour = MAGENTA;
TOX_USER_STATUS status = statusbar->status;
Tox_User_Status status = statusbar->status;
switch (status) {
case TOX_USER_STATUS_NONE:

View File

@ -92,7 +92,7 @@ void cmd_groupinvite(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*a
return;
}
TOX_ERR_CONFERENCE_INVITE err;
Tox_Err_Conference_Invite err;
if (!tox_conference_invite(m, self->num, groupnum, &err)) {
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to invite contact to group (error %d)", err);
@ -123,7 +123,7 @@ void cmd_join_group(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*ar
return;
}
TOX_ERR_CONFERENCE_JOIN err;
Tox_Err_Conference_Join err;
uint32_t groupnum = tox_conference_join(m, self->num, (const uint8_t *) groupkey, length, &err);
@ -172,7 +172,7 @@ void cmd_savefile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv
return;
}
TOX_ERR_FILE_CONTROL err;
Tox_Err_File_Control err;
tox_file_control(m, self->num, ft->filenum, TOX_FILE_CONTROL_RESUME, &err);
if (err != TOX_ERR_FILE_CONTROL_OK) {
@ -259,7 +259,7 @@ void cmd_sendfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv
char file_name[TOX_MAX_FILENAME_LENGTH];
size_t namelen = get_file_name(file_name, sizeof(file_name), path);
TOX_ERR_FILE_SEND err;
Tox_Err_File_Send err;
uint32_t filenum = tox_file_send(m, self->num, TOX_FILE_KIND_DATA, (uint64_t) filesize, NULL,
(uint8_t *) file_name, namelen, &err);

View File

@ -259,7 +259,7 @@ void close_file_transfer(ToxWindow *self, Tox *m, struct FileTransfer *ft, int C
}
if (CTRL >= 0) {
tox_file_control(m, ft->friendnum, ft->filenum, (TOX_FILE_CONTROL) CTRL, NULL);
tox_file_control(m, ft->friendnum, ft->filenum, (Tox_File_Control) CTRL, NULL);
}
if (message && self) {

View File

@ -341,7 +341,7 @@ static void update_friend_last_online(uint32_t num, time_t timestamp)
&Friends.list[num].last_online.tm);
}
static void friendlist_onMessage(ToxWindow *self, Tox *m, uint32_t num, TOX_MESSAGE_TYPE type, const char *str,
static void friendlist_onMessage(ToxWindow *self, Tox *m, uint32_t num, Tox_Message_Type type, const char *str,
size_t length)
{
if (num >= Friends.max_idx) {
@ -368,7 +368,7 @@ static void friendlist_onMessage(ToxWindow *self, Tox *m, uint32_t num, TOX_MESS
sound_notify(prompt, notif_error, NT_WNDALERT_1, NULL);
}
static void friendlist_onConnectionChange(ToxWindow *self, Tox *m, uint32_t num, TOX_CONNECTION connection_status)
static void friendlist_onConnectionChange(ToxWindow *self, Tox *m, uint32_t num, Tox_Connection connection_status)
{
if (num >= Friends.max_idx) {
return;
@ -417,7 +417,7 @@ static void friendlist_onNickChange(ToxWindow *self, Tox *m, uint32_t num, const
sort_friendlist_index();
}
static void friendlist_onStatusChange(ToxWindow *self, Tox *m, uint32_t num, TOX_USER_STATUS status)
static void friendlist_onStatusChange(ToxWindow *self, Tox *m, uint32_t num, Tox_User_Status status)
{
if (num >= Friends.max_idx) {
return;
@ -457,14 +457,14 @@ void friendlist_onFriendAdded(ToxWindow *self, Tox *m, uint32_t num, bool sort)
Friends.list[i].status = TOX_USER_STATUS_NONE;
Friends.list[i].logging_on = (bool) user_settings->autolog == AUTOLOG_ON;
TOX_ERR_FRIEND_GET_PUBLIC_KEY pkerr;
Tox_Err_Friend_Get_Public_Key pkerr;
tox_friend_get_public_key(m, num, (uint8_t *) Friends.list[i].pub_key, &pkerr);
if (pkerr != TOX_ERR_FRIEND_GET_PUBLIC_KEY_OK) {
fprintf(stderr, "tox_friend_get_public_key failed (error %d)\n", pkerr);
}
TOX_ERR_FRIEND_GET_LAST_ONLINE loerr;
Tox_Err_Friend_Get_Last_Online loerr;
time_t t = tox_friend_get_last_online(m, num, &loerr);
if (loerr != TOX_ERR_FRIEND_GET_LAST_ONLINE_OK) {
@ -600,7 +600,7 @@ static void select_friend(ToxWindow *self, wint_t key, int *selected, int num)
static void delete_friend(Tox *m, uint32_t f_num)
{
TOX_ERR_FRIEND_DELETE err;
Tox_Err_Friend_Delete err;
if (tox_friend_delete(m, f_num, &err) != true) {
fprintf(stderr, "tox_friend_delete failed with error %d\n", err);
@ -780,7 +780,7 @@ static void unblock_friend(Tox *m, uint32_t bnum)
return;
}
TOX_ERR_FRIEND_ADD err;
Tox_Err_Friend_Add err;
uint32_t friendnum = tox_friend_add_norequest(m, (uint8_t *) Blocked.list[bnum].pub_key, &err);
if (err != TOX_ERR_FRIEND_ADD_OK) {
@ -1035,8 +1035,8 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m)
}
pthread_mutex_lock(&Winthread.lock);
TOX_CONNECTION connection_status = Friends.list[f].connection_status;
TOX_USER_STATUS status = Friends.list[f].status;
Tox_Connection connection_status = Friends.list[f].connection_status;
Tox_User_Status status = Friends.list[f].status;
pthread_mutex_unlock(&Winthread.lock);
if (connection_status != TOX_CONNECTION_NONE) {
@ -1226,13 +1226,13 @@ static void friendlist_onAV(ToxWindow *self, ToxAV *av, uint32_t friend_number,
#endif /* AUDIO */
/* Returns a friend's status */
TOX_USER_STATUS get_friend_status(uint32_t friendnumber)
Tox_User_Status get_friend_status(uint32_t friendnumber)
{
return Friends.list[friendnumber].status;
}
/* Returns a friend's connection status */
TOX_CONNECTION get_friend_connection_status(uint32_t friendnumber)
Tox_Connection get_friend_connection_status(uint32_t friendnumber)
{
return Friends.list[friendnumber].connection_status;
}

View File

@ -51,10 +51,10 @@ typedef struct {
uint32_t num;
int chatwin;
bool active;
TOX_CONNECTION connection_status;
Tox_Connection connection_status;
bool is_typing;
bool logging_on; /* saves preference for friend irrespective of global settings */
TOX_USER_STATUS status;
Tox_User_Status status;
struct LastOnline last_online;
struct GroupChatInvite group_invite;
@ -87,8 +87,8 @@ int get_friendnum(uint8_t *name);
int load_blocklist(char *data);
void kill_friendlist(void);
void friendlist_onFriendAdded(ToxWindow *self, Tox *m, uint32_t num, bool sort);
TOX_USER_STATUS get_friend_status(uint32_t friendnumber);
TOX_CONNECTION get_friend_connection_status(uint32_t friendnumber);
Tox_User_Status get_friend_status(uint32_t friendnumber);
Tox_Connection get_friend_connection_status(uint32_t friendnumber);
/* sorts friendlist_index first by connection status then alphabetically */
void sort_friendlist_index(void);

View File

@ -62,7 +62,7 @@ void cmd_accept(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[
return;
}
TOX_ERR_FRIEND_ADD err;
Tox_Err_Friend_Add err;
uint32_t friendnum = tox_friend_add_norequest(m, FrndRequests.request[req].key, &err);
if (err != TOX_ERR_FRIEND_ADD_OK) {
@ -92,7 +92,7 @@ void cmd_add_helper(ToxWindow *self, Tox *m, const char *id_bin, const char *msg
{
const char *errmsg;
TOX_ERR_FRIEND_ADD err;
Tox_Err_Friend_Add err;
uint32_t f_num = tox_friend_add(m, (const uint8_t *) id_bin, (const uint8_t *) msg, strlen(msg), &err);
switch (err) {
@ -267,7 +267,7 @@ void cmd_connect(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)
return;
}
TOX_ERR_BOOTSTRAP err;
Tox_Err_Bootstrap err;
tox_bootstrap(m, ip, port, (uint8_t *) key_binary, &err);
tox_add_tcp_relay(m, ip, port, (uint8_t *) key_binary, &err);
@ -350,7 +350,7 @@ void cmd_groupchat(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*arg
return;
}
TOX_ERR_CONFERENCE_NEW err;
Tox_Err_Conference_New err;
uint32_t groupnum = tox_conference_new(m, &err);
@ -632,7 +632,7 @@ void cmd_status(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[
}
const char *status_str = argv[1];
TOX_USER_STATUS status;
Tox_User_Status status;
if (!strcasecmp(status_str, "online")) {
status = TOX_USER_STATUS_NONE;

View File

@ -30,7 +30,7 @@
void cmd_set_title(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE])
{
TOX_ERR_CONFERENCE_TITLE err;
Tox_Err_Conference_Title err;
char title[MAX_STR_SIZE];
if (argc < 1) {

View File

@ -223,7 +223,7 @@ void redraw_groupchat_win(ToxWindow *self)
}
static void groupchat_onGroupMessage(ToxWindow *self, Tox *m, uint32_t groupnum, uint32_t peernum,
TOX_MESSAGE_TYPE type, const char *msg, size_t len)
Tox_Message_Type type, const char *msg, size_t len)
{
if (self->num != groupnum) {
return;
@ -366,7 +366,7 @@ static void update_peer_list(Tox *m, uint32_t groupnum, uint32_t num_peers)
for (i = 0; i < num_peers; ++i) {
GroupPeer *peer = &chat->peer_list[i];
TOX_ERR_CONFERENCE_PEER_QUERY err;
Tox_Err_Conference_Peer_Query err;
size_t length = tox_conference_peer_get_name_size(m, groupnum, i, &err);
if (err != TOX_ERR_CONFERENCE_PEER_QUERY_OK || length >= TOX_MAX_NAME_LENGTH) {
@ -399,7 +399,7 @@ static void groupchat_onGroupNameListChange(ToxWindow *self, Tox *m, uint32_t gr
}
GroupChat *chat = &groupchats[groupnum];
TOX_ERR_CONFERENCE_PEER_QUERY err;
Tox_Err_Conference_Peer_Query err;
uint32_t num_peers = tox_conference_peer_count(m, groupnum, &err);
uint32_t old_num = chat->num_peers;
@ -458,7 +458,7 @@ static void send_group_action(ToxWindow *self, ChatContext *ctx, Tox *m, char *a
return;
}
TOX_ERR_CONFERENCE_SEND_MESSAGE err;
Tox_Err_Conference_Send_Message err;
if (!tox_conference_send_message(m, self->num, TOX_MESSAGE_TYPE_ACTION, (uint8_t *) action, strlen(action), &err)) {
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, " * Failed to send action (error %d)", err);
@ -567,7 +567,7 @@ static void groupchat_onKey(ToxWindow *self, Tox *m, wint_t key, bool ltr)
execute(ctx->history, self, m, line, GROUPCHAT_COMMAND_MODE);
}
} else {
TOX_ERR_CONFERENCE_SEND_MESSAGE err;
Tox_Err_Conference_Send_Message err;
if (!tox_conference_send_message(m, self->num, TOX_MESSAGE_TYPE_NORMAL, (uint8_t *) line, strlen(line), &err)) {
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, " * Failed to send message (error %d)", err);

View File

@ -151,7 +151,7 @@ void cqueue_try_send(ToxWindow *self, Tox *m)
return;
}
TOX_MESSAGE_TYPE type = msg->type == OUT_MSG ? TOX_MESSAGE_TYPE_NORMAL : TOX_MESSAGE_TYPE_ACTION;
Tox_Message_Type type = msg->type == OUT_MSG ? TOX_MESSAGE_TYPE_NORMAL : TOX_MESSAGE_TYPE_ACTION;
msg->receipt = tox_friend_send_message(m, self->num, type, (uint8_t *) msg->message, msg->len, NULL);
msg->last_send_try = get_unix_time();
}

View File

@ -347,7 +347,7 @@ void str_to_lower(char *str)
Returns nick len */
size_t get_nick_truncate(Tox *m, char *buf, uint32_t friendnum)
{
TOX_ERR_FRIEND_QUERY err;
Tox_Err_Friend_Query err;
size_t len = tox_friend_get_name_size(m, friendnum, &err);
if (err != TOX_ERR_FRIEND_QUERY_OK) {
@ -373,7 +373,7 @@ on_error:
/* same as get_nick_truncate but for groupchats */
int get_group_nick_truncate(Tox *m, char *buf, uint32_t peernum, uint32_t groupnum)
{
TOX_ERR_CONFERENCE_PEER_QUERY err;
Tox_Err_Conference_Peer_Query err;
size_t len = tox_conference_peer_get_name_size(m, groupnum, peernum, &err);
if (err != TOX_ERR_CONFERENCE_PEER_QUERY_OK) {

View File

@ -144,8 +144,9 @@ void bgrxtoyuv420(uint8_t *plane_y, uint8_t *plane_u, uint8_t *plane_v, uint8_t
device_names[i] = video_input_name;
}
if ( i <= 0 )
if (i <= 0) {
return nil;
}
*size = i;
@ -174,7 +175,7 @@ void bgrxtoyuv420(uint8_t *plane_y, uint8_t *plane_u, uint8_t *plane_v, uint8_t
NSError *error = NULL;
AVCaptureInput *input = [[AVCaptureDeviceInput alloc] initWithDevice: device error: &error];
if ( error != NULL ) {
if (error != NULL) {
[input release];
return -1;
}
@ -193,7 +194,7 @@ void bgrxtoyuv420(uint8_t *plane_y, uint8_t *plane_u, uint8_t *plane_v, uint8_t
AVCaptureInputPort *port = [input.ports objectAtIndex: 0];
CMFormatDescriptionRef format_description = port.formatDescription;
if ( format_description ) {
if (format_description) {
CMVideoDimensions dimensions = CMVideoFormatDescriptionGetDimensions(format_description);
*width = dimensions.width;
*height = dimensions.height;
@ -303,8 +304,9 @@ int osx_video_init(char **device_names, int *size)
{
_OSXVideo = [[OSXVideo alloc] initWithDeviceNames: device_names AmtDevices: size];
if ( _OSXVideo == nil )
if (_OSXVideo == nil) {
return -1;
}
return 0;
}
@ -317,8 +319,9 @@ void osx_video_release()
int osx_video_open_device(uint32_t selection, uint16_t *width, uint16_t *height)
{
if ( _OSXVideo == nil )
if (_OSXVideo == nil) {
return -1;
}
return [_OSXVideo openVideoDeviceIndex: selection Width: width Height: height];
}
@ -330,8 +333,9 @@ void osx_video_close_device(uint32_t device_idx)
int osx_video_read_device(uint8_t *y, uint8_t *u, uint8_t *v, uint16_t *width, uint16_t *height)
{
if ( _OSXVideo == nil )
if (_OSXVideo == nil) {
return -1;
}
return [_OSXVideo getVideoFrameY: y U: u V: v Width: width Height: height];
}

View File

@ -137,7 +137,7 @@ void kill_prompt_window(ToxWindow *self)
}
/* callback: Updates own connection status in prompt statusbar */
void on_self_connection_status(Tox *m, TOX_CONNECTION connection_status, void *userdata)
void on_self_connection_status(Tox *m, Tox_Connection connection_status, void *userdata)
{
StatusBar *statusbar = prompt->stb;
statusbar->connection = connection_status;
@ -159,7 +159,7 @@ void prompt_update_statusmessage(ToxWindow *prompt, Tox *m, const char *statusms
size_t len = strlen(statusbar->statusmsg);
statusbar->statusmsg_len = len;
TOX_ERR_SET_INFO err;
Tox_Err_Set_Info err;
tox_self_set_status_message(m, (const uint8_t *) statusmsg, len, &err);
if (err != TOX_ERR_SET_INFO_OK) {
@ -168,14 +168,14 @@ void prompt_update_statusmessage(ToxWindow *prompt, Tox *m, const char *statusms
}
/* Updates own status in prompt statusbar */
void prompt_update_status(ToxWindow *prompt, TOX_USER_STATUS status)
void prompt_update_status(ToxWindow *prompt, Tox_User_Status status)
{
StatusBar *statusbar = prompt->stb;
statusbar->status = status;
}
/* Returns our own connection status */
TOX_CONNECTION prompt_selfConnectionStatus(void)
Tox_Connection prompt_selfConnectionStatus(void)
{
StatusBar *statusbar = prompt->stb;
return statusbar->connection;
@ -332,7 +332,7 @@ static void prompt_onDraw(ToxWindow *self, Tox *m)
wmove(statusbar->topline, 0, 0);
pthread_mutex_lock(&Winthread.lock);
TOX_CONNECTION connection = statusbar->connection;
Tox_Connection connection = statusbar->connection;
pthread_mutex_unlock(&Winthread.lock);
if (connection != TOX_CONNECTION_NONE) {
@ -340,7 +340,7 @@ static void prompt_onDraw(ToxWindow *self, Tox *m)
const char *status_text = "ERROR";
pthread_mutex_lock(&Winthread.lock);
TOX_USER_STATUS status = statusbar->status;
Tox_User_Status status = statusbar->status;
pthread_mutex_unlock(&Winthread.lock);
switch (status) {
@ -426,7 +426,7 @@ static void prompt_onDraw(ToxWindow *self, Tox *m)
}
}
static void prompt_onConnectionChange(ToxWindow *self, Tox *m, uint32_t friendnum, TOX_CONNECTION connection_status)
static void prompt_onConnectionChange(ToxWindow *self, Tox *m, uint32_t friendnum, Tox_Connection connection_status)
{
ChatContext *ctx = self->chatwin;
@ -519,7 +519,7 @@ void prompt_init_statusbar(ToxWindow *self, Tox *m, bool first_time_run)
size_t s_len = tox_self_get_status_message_size(m);
tox_self_get_status_message(m, (uint8_t *) statusmsg);
TOX_USER_STATUS status = tox_self_get_status(m);
Tox_User_Status status = tox_self_get_status(m);
nick[n_len] = '\0';
statusmsg[s_len] = '\0';

View File

@ -48,14 +48,14 @@ void prep_prompt_win(void);
void prompt_init_statusbar(ToxWindow *self, Tox *m, bool first_time_run);
void prompt_update_nick(ToxWindow *prompt, const char *nick);
void prompt_update_statusmessage(ToxWindow *prompt, Tox *m, const char *statusmsg);
void prompt_update_status(ToxWindow *prompt, TOX_USER_STATUS status);
void prompt_update_status(ToxWindow *prompt, Tox_User_Status status);
void prompt_update_connectionstatus(ToxWindow *prompt, bool is_connected);
void kill_prompt_window(ToxWindow *self);
/* callback: Updates own connection status in prompt statusbar */
void on_self_connection_status(Tox *m, TOX_CONNECTION connection_status, void *userdata);
void on_self_connection_status(Tox *m, Tox_Connection connection_status, void *userdata);
/* Returns our own connection status */
TOX_CONNECTION prompt_selfConnectionStatus(void);
Tox_Connection prompt_selfConnectionStatus(void);
#endif /* end of include guard: PROMPT_H */

View File

@ -69,7 +69,7 @@ static char buffer [BUFFER_SIZE];
static bool auto_away_active = false;
static mplex_status mplex = MPLEX_NONE;
static TOX_USER_STATUS prev_status = TOX_USER_STATUS_NONE;
static Tox_User_Status prev_status = TOX_USER_STATUS_NONE;
static char prev_note [TOX_MAX_STATUS_MESSAGE_LENGTH] = "";
/* mutex for access to status data, for sync between:
@ -359,7 +359,7 @@ static int mplex_is_detached(void)
static void mplex_timer_handler(Tox *m)
{
TOX_USER_STATUS current_status, new_status;
Tox_User_Status current_status, new_status;
const char *new_note;
if (mplex == MPLEX_NONE) {

View File

@ -337,8 +337,8 @@ static void load_groups(ToxWindow *prompt, Tox *m)
continue;
}
TOX_ERR_CONFERENCE_GET_TYPE err;
TOX_CONFERENCE_TYPE type = tox_conference_get_type(m, groupnum, &err);
Tox_Err_Conference_Get_Type err;
Tox_Conference_Type type = tox_conference_get_type(m, groupnum, &err);
if (err != TOX_ERR_CONFERENCE_GET_TYPE_OK) {
tox_conference_delete(m, groupnum, NULL);
@ -646,7 +646,7 @@ static void init_tox_options(struct Tox_Options *tox_opts)
/* Returns a new Tox object on success.
* If object fails to initialize the toxic process will terminate.
*/
static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW *new_err)
static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, Tox_Err_New *new_err)
{
Tox *m = NULL;
@ -783,7 +783,7 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW
static Tox *load_toxic(char *data_path)
{
TOX_ERR_OPTIONS_NEW options_new_err;
Tox_Err_Options_New options_new_err;
struct Tox_Options *tox_opts = tox_options_new(&options_new_err);
if (!tox_opts) {
@ -792,7 +792,7 @@ static Tox *load_toxic(char *data_path)
init_tox_options(tox_opts);
TOX_ERR_NEW new_err;
Tox_Err_New new_err;
Tox *m = load_tox(data_path, tox_opts, &new_err);
if (new_err == TOX_ERR_NEW_PORT_ALLOC && tox_options_get_ipv6_enabled(tox_opts)) {

View File

@ -106,16 +106,16 @@ int store_data(Tox *m, const char *path);
/* callbacks */
void on_friend_request(Tox *m, const uint8_t *public_key, const uint8_t *data, size_t length, void *userdata);
void on_friend_connection_status(Tox *m, uint32_t friendnumber, TOX_CONNECTION status, void *userdata);
void on_friend_message(Tox *m, uint32_t friendnumber, TOX_MESSAGE_TYPE type, const uint8_t *string, size_t length,
void on_friend_connection_status(Tox *m, uint32_t friendnumber, Tox_Connection status, void *userdata);
void on_friend_message(Tox *m, uint32_t friendnumber, Tox_Message_Type type, const uint8_t *string, size_t length,
void *userdata);
void on_friend_name(Tox *m, uint32_t friendnumber, const uint8_t *string, size_t length, void *userdata);
void on_friend_status(Tox *m, uint32_t friendnumber, TOX_USER_STATUS status, void *userdata);
void on_friend_status(Tox *m, uint32_t friendnumber, Tox_User_Status status, void *userdata);
void on_friend_status_message(Tox *m, uint32_t friendnumber, const uint8_t *string, size_t length, void *userdata);
void on_friend_added(Tox *m, uint32_t friendnumber, bool sort);
void on_conference_message(Tox *m, uint32_t groupnumber, uint32_t peernumber, TOX_MESSAGE_TYPE type,
void on_conference_message(Tox *m, uint32_t groupnumber, uint32_t peernumber, Tox_Message_Type type,
const uint8_t *message, size_t length, void *userdata);
void on_conference_invite(Tox *m, uint32_t friendnumber, TOX_CONFERENCE_TYPE type, const uint8_t *group_pub_key,
void on_conference_invite(Tox *m, uint32_t friendnumber, Tox_Conference_Type type, const uint8_t *group_pub_key,
size_t length, void *userdata);
void on_conference_peer_list_changed(Tox *m, uint32_t groupnumber, void *userdata);
void on_conference_peer_name(Tox *m, uint32_t groupnumber, uint32_t peernumber, const uint8_t *name,
@ -126,7 +126,7 @@ void on_file_chunk_request(Tox *m, uint32_t friendnumber, uint32_t filenumber, u
void *userdata);
void on_file_recv_chunk(Tox *m, uint32_t friendnumber, uint32_t filenumber, uint64_t position, const uint8_t *data,
size_t length, void *userdata);
void on_file_recv_control(Tox *m, uint32_t friendnumber, uint32_t filenumber, TOX_FILE_CONTROL control,
void on_file_recv_control(Tox *m, uint32_t friendnumber, uint32_t filenumber, Tox_File_Control control,
void *userdata);
void on_file_recv(Tox *m, uint32_t friendnumber, uint32_t filenumber, uint32_t kind, uint64_t file_size,
const uint8_t *filename, size_t filename_length, void *userdata);

View File

@ -102,7 +102,7 @@ void read_video_device_callback(int16_t width, int16_t height, const uint8_t *y,
{
uint32_t friend_number = *((uint32_t *)data); /* TODO: Or pass an array of call_idx's */
Call *this_call = &CallControl.calls[friend_number];
TOXAV_ERR_SEND_FRAME error;
Toxav_Err_Send_Frame error;
/* Drop frame if video sending is disabled */
if (CallControl.video_bit_rate == 0 || this_call->vin_idx == -1) {
@ -216,7 +216,7 @@ void callback_video_starting(uint32_t friend_number)
ToxWindow *windows = CallControl.prompt;
Call *this_call = &CallControl.calls[friend_number];
TOXAV_ERR_CALL_CONTROL error = TOXAV_ERR_CALL_CONTROL_OK;
Toxav_Err_Call_Control error = TOXAV_ERR_CALL_CONTROL_OK;
toxav_call_control(CallControl.av, friend_number, TOXAV_CALL_CONTROL_SHOW_VIDEO, &error);
if (error == TOXAV_ERR_CALL_CONTROL_OK) {

View File

@ -592,9 +592,9 @@ VideoDeviceError open_video_device(VideoDeviceType type, int32_t selection, uint
}
VideoDeviceError write_video_out(uint16_t width, uint16_t height,
uint8_t const *y, uint8_t const *u, uint8_t const *v,
int32_t ystride, int32_t ustride, int32_t vstride,
void *user_data)
uint8_t const *y, uint8_t const *u, uint8_t const *v,
int32_t ystride, int32_t ustride, int32_t vstride,
void *user_data)
{
VideoDevice *device = video_devices_running[vdt_output][0];

View File

@ -62,7 +62,7 @@ void on_friend_request(Tox *m, const uint8_t *public_key, const uint8_t *data, s
}
}
void on_friend_connection_status(Tox *m, uint32_t friendnumber, TOX_CONNECTION connection_status, void *userdata)
void on_friend_connection_status(Tox *m, uint32_t friendnumber, Tox_Connection connection_status, void *userdata)
{
size_t i;
@ -88,7 +88,7 @@ void on_friend_typing(Tox *m, uint32_t friendnumber, bool is_typing, void *userd
}
}
void on_friend_message(Tox *m, uint32_t friendnumber, TOX_MESSAGE_TYPE type, const uint8_t *string, size_t length,
void on_friend_message(Tox *m, uint32_t friendnumber, Tox_Message_Type type, const uint8_t *string, size_t length,
void *userdata)
{
char msg[MAX_STR_SIZE + 1];
@ -135,7 +135,7 @@ void on_friend_status_message(Tox *m, uint32_t friendnumber, const uint8_t *stri
}
}
void on_friend_status(Tox *m, uint32_t friendnumber, TOX_USER_STATUS status, void *userdata)
void on_friend_status(Tox *m, uint32_t friendnumber, Tox_User_Status status, void *userdata)
{
size_t i;
@ -159,7 +159,7 @@ void on_friend_added(Tox *m, uint32_t friendnumber, bool sort)
store_data(m, DATA_FILE);
}
void on_conference_message(Tox *m, uint32_t groupnumber, uint32_t peernumber, TOX_MESSAGE_TYPE type,
void on_conference_message(Tox *m, uint32_t groupnumber, uint32_t peernumber, Tox_Message_Type type,
const uint8_t *message, size_t length, void *userdata)
{
char msg[MAX_STR_SIZE + 1];
@ -174,7 +174,7 @@ void on_conference_message(Tox *m, uint32_t groupnumber, uint32_t peernumber, TO
}
}
void on_conference_invite(Tox *m, uint32_t friendnumber, TOX_CONFERENCE_TYPE type, const uint8_t *group_pub_key,
void on_conference_invite(Tox *m, uint32_t friendnumber, Tox_Conference_Type type, const uint8_t *group_pub_key,
size_t length, void *userdata)
{
size_t i;
@ -269,7 +269,7 @@ void on_file_recv_chunk(Tox *m, uint32_t friendnumber, uint32_t filenumber, uint
}
}
void on_file_recv_control(Tox *m, uint32_t friendnumber, uint32_t filenumber, TOX_FILE_CONTROL control,
void on_file_recv_control(Tox *m, uint32_t friendnumber, uint32_t filenumber, Tox_File_Control control,
void *userdata)
{
struct FileTransfer *ft = get_file_transfer_struct(friendnumber, filenumber);

View File

@ -116,19 +116,19 @@ struct ToxWindow {
/* toxcore */
void(*onFriendRequest)(ToxWindow *, Tox *, const char *, const char *, size_t);
void(*onFriendAdded)(ToxWindow *, Tox *, uint32_t, bool);
void(*onConnectionChange)(ToxWindow *, Tox *, uint32_t, TOX_CONNECTION);
void(*onMessage)(ToxWindow *, Tox *, uint32_t, TOX_MESSAGE_TYPE, const char *, size_t);
void(*onConnectionChange)(ToxWindow *, Tox *, uint32_t, Tox_Connection);
void(*onMessage)(ToxWindow *, Tox *, uint32_t, Tox_Message_Type, const char *, size_t);
void(*onNickChange)(ToxWindow *, Tox *, uint32_t, const char *, size_t);
void(*onStatusChange)(ToxWindow *, Tox *, uint32_t, TOX_USER_STATUS);
void(*onStatusChange)(ToxWindow *, Tox *, uint32_t, Tox_User_Status);
void(*onStatusMessageChange)(ToxWindow *, uint32_t, const char *, size_t);
void(*onGroupMessage)(ToxWindow *, Tox *, uint32_t, uint32_t, TOX_MESSAGE_TYPE, const char *, size_t);
void(*onGroupMessage)(ToxWindow *, Tox *, uint32_t, uint32_t, Tox_Message_Type, const char *, size_t);
void(*onGroupInvite)(ToxWindow *, Tox *, int32_t, uint8_t, const char *, uint16_t);
void(*onGroupNameListChange)(ToxWindow *, Tox *, uint32_t);
void(*onGroupPeerNameChange)(ToxWindow *, Tox *, uint32_t, uint32_t, const char *, size_t);
void(*onGroupTitleChange)(ToxWindow *, Tox *, uint32_t, uint32_t, const char *, size_t);
void(*onFileChunkRequest)(ToxWindow *, Tox *, uint32_t, uint32_t, uint64_t, size_t);
void(*onFileRecvChunk)(ToxWindow *, Tox *, uint32_t, uint32_t, uint64_t, const char *, size_t);
void(*onFileControl)(ToxWindow *, Tox *, uint32_t, uint32_t, TOX_FILE_CONTROL);
void(*onFileControl)(ToxWindow *, Tox *, uint32_t, uint32_t, Tox_File_Control);
void(*onFileRecv)(ToxWindow *, Tox *, uint32_t, uint32_t, uint64_t, const char *, size_t);
void(*onTypingChange)(ToxWindow *, Tox *, uint32_t, bool);
void(*onReadReceipt)(ToxWindow *, Tox *, uint32_t, uint32_t);
@ -187,8 +187,8 @@ struct StatusBar {
size_t statusmsg_len;
char nick[TOXIC_MAX_NAME_LENGTH + 1];
size_t nick_len;
TOX_USER_STATUS status;
TOX_CONNECTION connection;
Tox_User_Status status;
Tox_Connection connection;
};
#ifdef AUDIO