chore: Make the last few remaining top level comments doxygen style.

This commit is contained in:
iphydf 2022-02-04 23:19:58 +00:00
parent 13e4ff47fe
commit 7f0395b746
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
10 changed files with 41 additions and 51 deletions

View File

@ -86,7 +86,7 @@ static void terminate_queue(Group_JitterBuffer *q)
free(q); free(q);
} }
/* Return 0 if packet was queued, -1 if it wasn't. /** Return 0 if packet was queued, -1 if it wasn't.
*/ */
static int queue(Group_JitterBuffer *q, const Mono_Time *mono_time, Group_Audio_Packet *pk) static int queue(Group_JitterBuffer *q, const Mono_Time *mono_time, Group_Audio_Packet *pk)
{ {
@ -124,7 +124,7 @@ static int queue(Group_JitterBuffer *q, const Mono_Time *mono_time, Group_Audio_
return 0; return 0;
} }
/* success is 0 when there is nothing to dequeue, 1 when there's a good packet, 2 when there's a lost packet */ /** success is 0 when there is nothing to dequeue, 1 when there's a good packet, 2 when there's a lost packet */
static Group_Audio_Packet *dequeue(Group_JitterBuffer *q, int *success) static Group_Audio_Packet *dequeue(Group_JitterBuffer *q, int *success)
{ {
if (q->top == q->bottom) { if (q->top == q->bottom) {
@ -432,7 +432,7 @@ static int handle_group_audio_packet(void *object, uint32_t groupnumber, uint32_
return 0; return 0;
} }
/* Enable A/V in a groupchat. /** Enable A/V in a groupchat.
* *
* return 0 on success. * return 0 on success.
* return -1 on failure. * return -1 on failure.
@ -474,7 +474,7 @@ int groupchat_enable_av(const Logger *log, Tox *tox, Group_Chats *g_c, uint32_t
return 0; return 0;
} }
/* Disable A/V in a groupchat. /** Disable A/V in a groupchat.
* *
* return 0 on success. * return 0 on success.
* return -1 on failure. * return -1 on failure.
@ -515,14 +515,14 @@ int groupchat_disable_av(const Group_Chats *g_c, uint32_t groupnumber)
return 0; return 0;
} }
/* Return whether A/V is enabled in the groupchat. /** Return whether A/V is enabled in the groupchat.
*/ */
bool groupchat_av_enabled(const Group_Chats *g_c, uint32_t groupnumber) bool groupchat_av_enabled(const Group_Chats *g_c, uint32_t groupnumber)
{ {
return group_get_object(g_c, groupnumber) != nullptr; return group_get_object(g_c, groupnumber) != nullptr;
} }
/* Create a new toxav group. /** Create and connect to a new toxav group.
* *
* return group number on success. * return group number on success.
* return -1 on failure. * return -1 on failure.
@ -543,7 +543,7 @@ int add_av_groupchat(const Logger *log, Tox *tox, Group_Chats *g_c, audio_data_c
return groupnumber; return groupnumber;
} }
/* Join a AV group (you need to have been invited first.) /** Join a AV group (you need to have been invited first.)
* *
* returns group number on success * returns group number on success
* returns -1 on failure. * returns -1 on failure.
@ -565,7 +565,7 @@ int join_av_groupchat(const Logger *log, Tox *tox, Group_Chats *g_c, uint32_t fr
return groupnumber; return groupnumber;
} }
/* Send an encoded audio packet to the group chat. /** Send an encoded audio packet to the group chat.
* *
* return 0 on success. * return 0 on success.
* return -1 on failure. * return -1 on failure.
@ -600,7 +600,7 @@ static int send_audio_packet(const Group_Chats *g_c, uint32_t groupnumber, const
return 0; return 0;
} }
/* Send audio to the group chat. /** Send audio to the group chat.
* *
* return 0 on success. * return 0 on success.
* return -1 on failure. * return -1 on failure.

View File

@ -19,14 +19,14 @@
typedef void audio_data_cb(void *tox, uint32_t groupnumber, uint32_t peernumber, const int16_t *pcm, typedef void audio_data_cb(void *tox, uint32_t groupnumber, uint32_t peernumber, const int16_t *pcm,
uint32_t samples, uint8_t channels, uint32_t sample_rate, void *userdata); uint32_t samples, uint8_t channels, uint32_t sample_rate, void *userdata);
/* Create and connect to a new toxav group. /** Create and connect to a new toxav group.
* *
* return group number on success. * return group number on success.
* return -1 on failure. * return -1 on failure.
*/ */
int add_av_groupchat(const Logger *log, Tox *tox, Group_Chats *g_c, audio_data_cb *audio_callback, void *userdata); int add_av_groupchat(const Logger *log, Tox *tox, Group_Chats *g_c, audio_data_cb *audio_callback, void *userdata);
/* Join a AV group (you need to have been invited first.) /** Join a AV group (you need to have been invited first.)
* *
* returns group number on success * returns group number on success
* returns -1 on failure. * returns -1 on failure.
@ -36,7 +36,7 @@ int join_av_groupchat(const Logger *log, Tox *tox, Group_Chats *g_c, uint32_t fr
audio_data_cb *audio_callback, void *userdata); audio_data_cb *audio_callback, void *userdata);
/* Send audio to the group chat. /** Send audio to the group chat.
* *
* return 0 on success. * return 0 on success.
* return -1 on failure. * return -1 on failure.
@ -44,7 +44,7 @@ int join_av_groupchat(const Logger *log, Tox *tox, Group_Chats *g_c, uint32_t fr
int group_send_audio(Group_Chats *g_c, uint32_t groupnumber, const int16_t *pcm, unsigned int samples, uint8_t channels, int group_send_audio(Group_Chats *g_c, uint32_t groupnumber, const int16_t *pcm, unsigned int samples, uint8_t channels,
uint32_t sample_rate); uint32_t sample_rate);
/* Enable A/V in a groupchat. /** Enable A/V in a groupchat.
* *
* return 0 on success. * return 0 on success.
* return -1 on failure. * return -1 on failure.
@ -52,14 +52,14 @@ int group_send_audio(Group_Chats *g_c, uint32_t groupnumber, const int16_t *pcm,
int groupchat_enable_av(const Logger *log, Tox *tox, Group_Chats *g_c, uint32_t groupnumber, int groupchat_enable_av(const Logger *log, Tox *tox, Group_Chats *g_c, uint32_t groupnumber,
audio_data_cb *audio_callback, void *userdata); audio_data_cb *audio_callback, void *userdata);
/* Disable A/V in a groupchat. /** Disable A/V in a groupchat.
* *
* return 0 on success. * return 0 on success.
* return -1 on failure. * return -1 on failure.
*/ */
int groupchat_disable_av(const Group_Chats *g_c, uint32_t groupnumber); int groupchat_disable_av(const Group_Chats *g_c, uint32_t groupnumber);
/* Return whether A/V is enabled in the groupchat. /** Return whether A/V is enabled in the groupchat.
*/ */
bool groupchat_av_enabled(const Group_Chats *g_c, uint32_t groupnumber); bool groupchat_av_enabled(const Group_Chats *g_c, uint32_t groupnumber);

View File

@ -330,7 +330,7 @@ static bool check_size(const Logger *log, const uint8_t *bytes, int *constraint,
return true; return true;
} }
/* Assumes size == 1 */ /** Assumes size == 1 */
static bool check_enum_high(const Logger *log, const uint8_t *bytes, uint8_t enum_high) static bool check_enum_high(const Logger *log, const uint8_t *bytes, uint8_t enum_high)
{ {
if (bytes[2] > enum_high) { if (bytes[2] > enum_high) {

View File

@ -26,7 +26,7 @@ bool rb_empty(const RingBuffer *b)
return b->end == b->start; return b->end == b->start;
} }
/* /**
* returns: NULL on success * returns: NULL on success
* input value "p" on FAILURE -> caller can free on failed rb_write * input value "p" on FAILURE -> caller can free on failed rb_write
*/ */

View File

@ -13,7 +13,7 @@
extern "C" { extern "C" {
#endif #endif
/* Ring buffer */ /** Ring buffer */
typedef struct RingBuffer RingBuffer; typedef struct RingBuffer RingBuffer;
bool rb_full(const RingBuffer *b); bool rb_full(const RingBuffer *b);
bool rb_empty(const RingBuffer *b); bool rb_empty(const RingBuffer *b);

View File

@ -23,7 +23,7 @@
#define VIDEO_KEEP_KEYFRAME_IN_BUFFER_FOR_MS 15 #define VIDEO_KEEP_KEYFRAME_IN_BUFFER_FOR_MS 15
/* /**
* return -1 on failure, 0 on success * return -1 on failure, 0 on success
* *
*/ */

View File

@ -783,7 +783,7 @@ typedef void toxav_group_audio_cb(Tox *tox, uint32_t groupnumber, uint32_t peern
typedef void toxav_audio_data_cb(void *tox, uint32_t groupnumber, uint32_t peernumber, const int16_t *pcm, typedef void toxav_audio_data_cb(void *tox, uint32_t groupnumber, uint32_t peernumber, const int16_t *pcm,
uint32_t samples, uint8_t channels, uint32_t sample_rate, void *userdata); uint32_t samples, uint8_t channels, uint32_t sample_rate, void *userdata);
/* Create a new toxav group. /** Create a new toxav group.
* *
* return group number on success. * return group number on success.
* return -1 on failure. * return -1 on failure.
@ -792,7 +792,7 @@ typedef void toxav_audio_data_cb(void *tox, uint32_t groupnumber, uint32_t peern
*/ */
int toxav_add_av_groupchat(Tox *tox, toxav_audio_data_cb *audio_callback, void *userdata); int toxav_add_av_groupchat(Tox *tox, toxav_audio_data_cb *audio_callback, void *userdata);
/* Join a AV group (you need to have been invited first.) /** Join a AV group (you need to have been invited first.)
* *
* returns group number on success * returns group number on success
* returns -1 on failure. * returns -1 on failure.
@ -802,14 +802,14 @@ int toxav_add_av_groupchat(Tox *tox, toxav_audio_data_cb *audio_callback, void *
int toxav_join_av_groupchat(Tox *tox, uint32_t friendnumber, const uint8_t *data, uint16_t length, int toxav_join_av_groupchat(Tox *tox, uint32_t friendnumber, const uint8_t *data, uint16_t length,
toxav_audio_data_cb *audio_callback, void *userdata); toxav_audio_data_cb *audio_callback, void *userdata);
/* Send audio to the group chat. /** Send audio to the group chat.
* *
* return 0 on success. * return 0 on success.
* return -1 on failure. * return -1 on failure.
* *
* Note that total size of pcm in bytes is equal to `samples * channels * sizeof(int16_t)`. * Note that total size of pcm in bytes is equal to `samples * channels * sizeof(int16_t)`.
* *
* Valid number of samples are `(sample rate) * (audio length) / 1000` (Valid audio lengths are: 2.5, 5, 10, 20, 40 or 60 ms) * Valid number of samples are `(sample rate) * (audio length) / 1000` (Valid values for audio length are: 2.5, 5, 10, 20, 40 or 60 ms)
* Valid number of channels are 1 or 2. * Valid number of channels are 1 or 2.
* Valid sample rates are 8000, 12000, 16000, 24000, or 48000. * Valid sample rates are 8000, 12000, 16000, 24000, or 48000.
* *
@ -818,7 +818,7 @@ int toxav_join_av_groupchat(Tox *tox, uint32_t friendnumber, const uint8_t *data
int toxav_group_send_audio(Tox *tox, uint32_t groupnumber, const int16_t *pcm, unsigned int samples, uint8_t channels, int toxav_group_send_audio(Tox *tox, uint32_t groupnumber, const int16_t *pcm, unsigned int samples, uint8_t channels,
uint32_t sample_rate); uint32_t sample_rate);
/* Enable A/V in a groupchat. /** Enable A/V in a groupchat.
* *
* A/V must be enabled on a groupchat for audio to be sent to it and for * A/V must be enabled on a groupchat for audio to be sent to it and for
* received audio to be handled. * received audio to be handled.
@ -836,14 +836,14 @@ int toxav_group_send_audio(Tox *tox, uint32_t groupnumber, const int16_t *pcm, u
int toxav_groupchat_enable_av(Tox *tox, uint32_t groupnumber, int toxav_groupchat_enable_av(Tox *tox, uint32_t groupnumber,
toxav_audio_data_cb *audio_callback, void *userdata); toxav_audio_data_cb *audio_callback, void *userdata);
/* Disable A/V in a groupchat. /** Disable A/V in a groupchat.
* *
* return 0 on success. * return 0 on success.
* return -1 on failure. * return -1 on failure.
*/ */
int toxav_groupchat_disable_av(Tox *tox, uint32_t groupnumber); int toxav_groupchat_disable_av(Tox *tox, uint32_t groupnumber);
/* Return whether A/V is enabled in the groupchat. /** Return whether A/V is enabled in the groupchat.
*/ */
bool toxav_groupchat_av_enabled(Tox *tox, uint32_t groupnumber); bool toxav_groupchat_av_enabled(Tox *tox, uint32_t groupnumber);

View File

@ -3,23 +3,19 @@
* Copyright © 2013-2015 Tox project. * Copyright © 2013-2015 Tox project.
*/ */
/* /**
* This file contains the group chats code for the backwards compatibility. * This file contains the group chats code for the backwards compatibility.
*/ */
#include "toxav.h" #include "toxav.h"
#include "groupav.h" #include "groupav.h"
/* Create a new toxav group. /** Create a new toxav group.
* *
* return group number on success. * return group number on success.
* return -1 on failure. * return -1 on failure.
* *
* Audio data callback format: * Note that total size of pcm in bytes is equal to `samples * channels * sizeof(int16_t)`.
* `audio_callback(Tox *tox, int groupnumber, int peernumber, const int16_t *pcm, unsigned int samples, uint8_t channels, unsigned int sample_rate, void *userdata)`
*
* Note that total size of pcm in bytes is equal to `(samples * channels * sizeof(int16_t))`.
*/ */
int toxav_add_av_groupchat(Tox *tox, audio_data_cb *audio_callback, void *userdata) int toxav_add_av_groupchat(Tox *tox, audio_data_cb *audio_callback, void *userdata)
{ {
@ -30,15 +26,12 @@ int toxav_add_av_groupchat(Tox *tox, audio_data_cb *audio_callback, void *userda
return add_av_groupchat(m->log, tox, m->conferences_object, audio_callback, userdata); return add_av_groupchat(m->log, tox, m->conferences_object, audio_callback, userdata);
} }
/* Join a AV group (you need to have been invited first.) /** Join a AV group (you need to have been invited first.)
* *
* returns group number on success * returns group number on success
* returns -1 on failure. * returns -1 on failure.
* *
* Audio data callback format (same as the one for `toxav_add_av_groupchat()`): * Note that total size of pcm in bytes is equal to `samples * channels * sizeof(int16_t)`.
* `audio_callback(Tox *tox, int groupnumber, int peernumber, const int16_t *pcm, unsigned int samples, uint8_t channels, unsigned int sample_rate, void *userdata)`
*
* Note that total size of pcm in bytes is equal to `(samples * channels * sizeof(int16_t))`.
*/ */
int toxav_join_av_groupchat(Tox *tox, uint32_t friendnumber, const uint8_t *data, uint16_t length, int toxav_join_av_groupchat(Tox *tox, uint32_t friendnumber, const uint8_t *data, uint16_t length,
audio_data_cb *audio_callback, void *userdata) audio_data_cb *audio_callback, void *userdata)
@ -50,14 +43,14 @@ int toxav_join_av_groupchat(Tox *tox, uint32_t friendnumber, const uint8_t *data
return join_av_groupchat(m->log, tox, m->conferences_object, friendnumber, data, length, audio_callback, userdata); return join_av_groupchat(m->log, tox, m->conferences_object, friendnumber, data, length, audio_callback, userdata);
} }
/* Send audio to the group chat. /** Send audio to the group chat.
* *
* return 0 on success. * return 0 on success.
* return -1 on failure. * return -1 on failure.
* *
* Note that total size of pcm in bytes is equal to `(samples * channels * sizeof(int16_t))`. * Note that total size of pcm in bytes is equal to `samples * channels * sizeof(int16_t)`.
* *
* Valid number of samples are `((sample rate) * (audio length) / 1000)` (Valid values for audio length: 2.5, 5, 10, 20, 40 or 60 ms) * Valid number of samples are `(sample rate) * (audio length) / 1000` (Valid values for audio length are: 2.5, 5, 10, 20, 40 or 60 ms)
* Valid number of channels are 1 or 2. * Valid number of channels are 1 or 2.
* Valid sample rates are 8000, 12000, 16000, 24000, or 48000. * Valid sample rates are 8000, 12000, 16000, 24000, or 48000.
* *
@ -73,12 +66,12 @@ int toxav_group_send_audio(Tox *tox, uint32_t groupnumber, const int16_t *pcm, u
return group_send_audio(m->conferences_object, groupnumber, pcm, samples, channels, sample_rate); return group_send_audio(m->conferences_object, groupnumber, pcm, samples, channels, sample_rate);
} }
/* Enable A/V in a groupchat. /** Enable A/V in a groupchat.
* *
* A/V must be enabled on a groupchat for audio to be sent to it and for * A/V must be enabled on a groupchat for audio to be sent to it and for
* received audio to be handled. * received audio to be handled.
* *
* An A/V group created with toxav_add_av_groupchat or toxav_join_av_groupchat * An A/V group created with `toxav_add_av_groupchat` or `toxav_join_av_groupchat`
* will start with A/V enabled. * will start with A/V enabled.
* *
* An A/V group loaded from a savefile will start with A/V disabled. * An A/V group loaded from a savefile will start with A/V disabled.
@ -86,10 +79,7 @@ int toxav_group_send_audio(Tox *tox, uint32_t groupnumber, const int16_t *pcm, u
* return 0 on success. * return 0 on success.
* return -1 on failure. * return -1 on failure.
* *
* Audio data callback format (same as the one for toxav_add_av_groupchat()): * Note that total size of pcm in bytes is equal to `samples * channels * sizeof(int16_t)`.
* `audio_callback(Tox *tox, uint32_t groupnumber, uint32_t peernumber, const int16_t *pcm, unsigned int samples, uint8_t channels, uint32_t sample_rate, void *userdata)`
*
* Note that total size of pcm in bytes is equal to `(samples * channels * sizeof(int16_t))`.
*/ */
int toxav_groupchat_enable_av(Tox *tox, uint32_t groupnumber, audio_data_cb *audio_callback, void *userdata) int toxav_groupchat_enable_av(Tox *tox, uint32_t groupnumber, audio_data_cb *audio_callback, void *userdata)
{ {
@ -100,7 +90,7 @@ int toxav_groupchat_enable_av(Tox *tox, uint32_t groupnumber, audio_data_cb *aud
return groupchat_enable_av(m->log, tox, m->conferences_object, groupnumber, audio_callback, userdata); return groupchat_enable_av(m->log, tox, m->conferences_object, groupnumber, audio_callback, userdata);
} }
/* Disable A/V in a groupchat. /** Disable A/V in a groupchat.
* *
* return 0 on success. * return 0 on success.
* return -1 on failure. * return -1 on failure.
@ -114,7 +104,7 @@ int toxav_groupchat_disable_av(Tox *tox, uint32_t groupnumber)
return groupchat_disable_av(m->conferences_object, groupnumber); return groupchat_disable_av(m->conferences_object, groupnumber);
} }
/* Return whether A/V is enabled in the groupchat. /** Return whether A/V is enabled in the groupchat.
*/ */
bool toxav_groupchat_av_enabled(Tox *tox, uint32_t groupnumber) bool toxav_groupchat_av_enabled(Tox *tox, uint32_t groupnumber)
{ {

View File

@ -3,7 +3,7 @@
* Copyright © 2013 Tox project. * Copyright © 2013 Tox project.
*/ */
/* /**
* Batch encryption functions. * Batch encryption functions.
*/ */
#include "toxencryptsave.h" #include "toxencryptsave.h"

View File

@ -3,7 +3,7 @@
* Copyright © 2013-2016 Tox Developers. * Copyright © 2013-2016 Tox Developers.
*/ */
/* /**
* Batch encryption functions. * Batch encryption functions.
*/ */