Skip to content

Commit e1e92c1

Browse files
committed
docs: Clean up doxygen comments to be more doxygen-like.
1 parent 3275bb8 commit e1e92c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1827
-1664
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ jobs:
2828
(find . -name "*.py" -and -not -name "conanfile.py"; grep -lR '^#!.*python') \
2929
| xargs -n1 -P8 mypy --strict
3030
31+
doxygen:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Set up Docker Buildx
35+
uses: docker/setup-buildx-action@v1
36+
- name: Docker Build
37+
uses: docker/build-push-action@v2
38+
with:
39+
file: other/docker/doxygen/Dockerfile
40+
3141
tokstyle:
3242
runs-on: ubuntu-latest
3343
steps:
@@ -38,6 +48,13 @@ jobs:
3848
with:
3949
file: other/docker/tokstyle/Dockerfile
4050

51+
cimplefmt:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v2
55+
- name: Run cimplefmt
56+
run: other/docker/cimplefmt/run -u $(find tox* -name "*.[ch]")
57+
4158
build-nacl:
4259
runs-on: ubuntu-latest
4360
steps:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
799360df399d3c82adb10f60765a25b1686e7c091b3a817ae4b2f1aa9db1a622 /usr/local/bin/tox-bootstrapd
1+
b63168a0b43e9b303947b36e4a2cfdd2acc7f48ebcbad098d092edceed78ac39 /usr/local/bin/tox-bootstrapd

other/docker/cimplefmt/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM toxchat/haskell:hs-cimple AS cimple
2+
FROM ubuntu:20.04
3+
4+
COPY --from=cimple /bin/cimplefmt /bin/
5+
WORKDIR /work
6+
ENTRYPOINT ["/bin/cimplefmt"]

other/docker/cimplefmt/run

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
if [ "$1" = "-u" ]; then
4+
shift
5+
docker pull toxchat/haskell:hs-cimple
6+
docker build -t toxchat/cimplefmt -f other/docker/cimplefmt/Dockerfile .
7+
fi
8+
docker run --rm -v "$PWD:/work" toxchat/cimplefmt "$@"

toxav/groupav.c

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ static void terminate_queue(Group_JitterBuffer *q)
8787
free(q);
8888
}
8989

90-
/** Return 0 if packet was queued, -1 if it wasn't.
90+
/** @retval 0 if packet was queued
91+
* @retval -1 if it wasn't.
9192
*/
9293
static int queue(Group_JitterBuffer *q, const Mono_Time *mono_time, Group_Audio_Packet *pk)
9394
{
@@ -125,7 +126,12 @@ static int queue(Group_JitterBuffer *q, const Mono_Time *mono_time, Group_Audio_
125126
return 0;
126127
}
127128

128-
/** success is 0 when there is nothing to dequeue, 1 when there's a good packet, 2 when there's a lost packet */
129+
/**
130+
* success is:
131+
* - 0 when there is nothing to dequeue
132+
* - 1 when there's a good packet
133+
* - 2 when there's a lost packet
134+
*/
129135
static Group_Audio_Packet *dequeue(Group_JitterBuffer *q, int *success)
130136
{
131137
if (q->top == q->bottom) {
@@ -433,10 +439,10 @@ static int handle_group_audio_packet(void *object, uint32_t groupnumber, uint32_
433439
return 0;
434440
}
435441

436-
/** Enable A/V in a groupchat.
442+
/** @brief Enable A/V in a groupchat.
437443
*
438-
* return 0 on success.
439-
* return -1 on failure.
444+
* @retval 0 on success.
445+
* @retval -1 on failure.
440446
*/
441447
int groupchat_enable_av(const Logger *log, Tox *tox, Group_Chats *g_c, uint32_t groupnumber,
442448
audio_data_cb *audio_callback, void *userdata)
@@ -475,10 +481,10 @@ int groupchat_enable_av(const Logger *log, Tox *tox, Group_Chats *g_c, uint32_t
475481
return 0;
476482
}
477483

478-
/** Disable A/V in a groupchat.
484+
/** @brief Disable A/V in a groupchat.
479485
*
480-
* return 0 on success.
481-
* return -1 on failure.
486+
* @retval 0 on success.
487+
* @retval -1 on failure.
482488
*/
483489
int groupchat_disable_av(const Group_Chats *g_c, uint32_t groupnumber)
484490
{
@@ -516,17 +522,16 @@ int groupchat_disable_av(const Group_Chats *g_c, uint32_t groupnumber)
516522
return 0;
517523
}
518524

519-
/** Return whether A/V is enabled in the groupchat.
520-
*/
525+
/** Return whether A/V is enabled in the groupchat. */
521526
bool groupchat_av_enabled(const Group_Chats *g_c, uint32_t groupnumber)
522527
{
523528
return group_get_object(g_c, groupnumber) != nullptr;
524529
}
525530

526-
/** Create and connect to a new toxav group.
531+
/** @brief Create and connect to a new toxav group.
527532
*
528-
* return group number on success.
529-
* return -1 on failure.
533+
* @return group number on success.
534+
* @retval -1 on failure.
530535
*/
531536
int add_av_groupchat(const Logger *log, Tox *tox, Group_Chats *g_c, audio_data_cb *audio_callback, void *userdata)
532537
{
@@ -544,10 +549,10 @@ int add_av_groupchat(const Logger *log, Tox *tox, Group_Chats *g_c, audio_data_c
544549
return groupnumber;
545550
}
546551

547-
/** Join a AV group (you need to have been invited first.)
552+
/** @brief Join a AV group (you need to have been invited first).
548553
*
549-
* returns group number on success
550-
* returns -1 on failure.
554+
* @return group number on success
555+
* @retval -1 on failure.
551556
*/
552557
int join_av_groupchat(const Logger *log, Tox *tox, Group_Chats *g_c, uint32_t friendnumber, const uint8_t *data,
553558
uint16_t length, audio_data_cb *audio_callback, void *userdata)
@@ -566,10 +571,10 @@ int join_av_groupchat(const Logger *log, Tox *tox, Group_Chats *g_c, uint32_t fr
566571
return groupnumber;
567572
}
568573

569-
/** Send an encoded audio packet to the group chat.
574+
/** @brief Send an encoded audio packet to the group chat.
570575
*
571-
* return 0 on success.
572-
* return -1 on failure.
576+
* @retval 0 on success.
577+
* @retval -1 on failure.
573578
*/
574579
static int send_audio_packet(const Group_Chats *g_c, uint32_t groupnumber, const uint8_t *packet, uint16_t length)
575580
{
@@ -601,10 +606,10 @@ static int send_audio_packet(const Group_Chats *g_c, uint32_t groupnumber, const
601606
return 0;
602607
}
603608

604-
/** Send audio to the group chat.
609+
/** @brief Send audio to the group chat.
605610
*
606-
* return 0 on success.
607-
* return -1 on failure.
611+
* @retval 0 on success.
612+
* @retval -1 on failure.
608613
*/
609614
int group_send_audio(Group_Chats *g_c, uint32_t groupnumber, const int16_t *pcm, unsigned int samples, uint8_t channels,
610615
uint32_t sample_rate)

toxav/groupav.h

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,48 +19,46 @@
1919
typedef void audio_data_cb(void *tox, uint32_t groupnumber, uint32_t peernumber, const int16_t *pcm,
2020
uint32_t samples, uint8_t channels, uint32_t sample_rate, void *userdata);
2121

22-
/** Create and connect to a new toxav group.
22+
/** @brief Create and connect to a new toxav group.
2323
*
24-
* return group number on success.
25-
* return -1 on failure.
24+
* @return group number on success.
25+
* @retval -1 on failure.
2626
*/
2727
int add_av_groupchat(const Logger *log, Tox *tox, Group_Chats *g_c, audio_data_cb *audio_callback, void *userdata);
2828

29-
/** Join a AV group (you need to have been invited first.)
29+
/** @brief Join a AV group (you need to have been invited first).
3030
*
31-
* returns group number on success
32-
* returns -1 on failure.
31+
* @return group number on success
32+
* @retval -1 on failure.
3333
*/
3434
int join_av_groupchat(const Logger *log, Tox *tox, Group_Chats *g_c, uint32_t friendnumber, const uint8_t *data,
35-
uint16_t length,
36-
audio_data_cb *audio_callback, void *userdata);
35+
uint16_t length, audio_data_cb *audio_callback, void *userdata);
3736

3837

39-
/** Send audio to the group chat.
38+
/** @brief Send audio to the group chat.
4039
*
41-
* return 0 on success.
42-
* return -1 on failure.
40+
* @retval 0 on success.
41+
* @retval -1 on failure.
4342
*/
4443
int group_send_audio(Group_Chats *g_c, uint32_t groupnumber, const int16_t *pcm, unsigned int samples, uint8_t channels,
4544
uint32_t sample_rate);
4645

47-
/** Enable A/V in a groupchat.
46+
/** @brief Enable A/V in a groupchat.
4847
*
49-
* return 0 on success.
50-
* return -1 on failure.
48+
* @retval 0 on success.
49+
* @retval -1 on failure.
5150
*/
5251
int groupchat_enable_av(const Logger *log, Tox *tox, Group_Chats *g_c, uint32_t groupnumber,
5352
audio_data_cb *audio_callback, void *userdata);
5453

55-
/** Disable A/V in a groupchat.
54+
/** @brief Disable A/V in a groupchat.
5655
*
57-
* return 0 on success.
58-
* return -1 on failure.
56+
* @retval 0 on success.
57+
* @retval -1 on failure.
5958
*/
6059
int groupchat_disable_av(const Group_Chats *g_c, uint32_t groupnumber);
6160

62-
/** Return whether A/V is enabled in the groupchat.
63-
*/
61+
/** Return whether A/V is enabled in the groupchat. */
6462
bool groupchat_av_enabled(const Group_Chats *g_c, uint32_t groupnumber);
6563

6664
#endif // C_TOXCORE_TOXAV_GROUPAV_H

toxav/ring_buffer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ bool rb_empty(const RingBuffer *b)
2727
}
2828

2929
/**
30-
* returns: NULL on success
31-
* input value "p" on FAILURE -> caller can free on failed rb_write
30+
* @retval NULL on success
31+
* @return input value "p" on failure, so caller can free on failed rb_write
3232
*/
3333
void *rb_write(RingBuffer *b, void *p)
3434
{

toxav/rtp.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static int8_t get_slot(const Logger *log, struct RTPWorkBufferList *wkbl, bool i
193193
*
194194
* If there are no frames ready, we return NULL. If this function returns
195195
* non-NULL, it transfers ownership of the message to the caller, i.e. the
196-
* caller is responsible for storing it elsewhere or calling free().
196+
* caller is responsible for storing it elsewhere or calling `free()`.
197197
*/
198198
static struct RTPMessage *process_frame(const Logger *log, struct RTPWorkBufferList *wkbl, uint8_t slot_id)
199199
{
@@ -345,7 +345,8 @@ static void update_bwc_values(const Logger *log, RTPSession *session, const stru
345345
* this is the actual payload length.
346346
* @param log A logger.
347347
*
348-
* @return -1 on error, 0 on success.
348+
* @retval -1 on error.
349+
* @retval 0 on success.
349350
*/
350351
static int handle_video_packet(RTPSession *session, const struct RTPHeader *header,
351352
const uint8_t *incoming_data, uint16_t incoming_data_length, const Logger *log)
@@ -436,7 +437,8 @@ static int handle_video_packet(RTPSession *session, const struct RTPHeader *head
436437
}
437438

438439
/**
439-
* @return -1 on error, 0 on success.
440+
* @retval -1 on error.
441+
* @retval 0 on success.
440442
*/
441443
static int handle_rtp_packet(Messenger *m, uint32_t friendnumber, const uint8_t *data, uint16_t length, void *object)
442444
{
@@ -741,10 +743,10 @@ int rtp_stop_receiving(RTPSession *session)
741743
}
742744

743745
/**
744-
* Send a frame of audio or video data, chunked in \ref RTPMessage instances.
746+
* Send a frame of audio or video data, chunked in @ref RTPMessage instances.
745747
*
746748
* @param session The A/V session to send the data for.
747-
* @param data A byte array of length \p length.
749+
* @param data A byte array of length @p length.
748750
* @param length The number of bytes to send from @p data.
749751
* @param is_keyframe Whether this video frame is a key frame. If it is an
750752
* audio frame, this parameter is ignored.

toxav/rtp.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extern "C" {
2323
#define RTP_HEADER_SIZE 80
2424

2525
/**
26-
* Number of 32 bit padding fields between \ref RTPHeader::offset_lower and
26+
* Number of 32 bit padding fields between @ref RTPHeader::offset_lower and
2727
* everything before it.
2828
*/
2929
#define RTP_PADDING_FIELDS 11
@@ -43,7 +43,7 @@ typedef enum RTP_Type {
4343
typedef enum RTPFlags {
4444
/**
4545
* Support frames larger than 64KiB. The full 32 bit length and offset are
46-
* set in \ref RTPHeader::data_length_full and \ref RTPHeader::offset_full.
46+
* set in @ref RTPHeader::data_length_full and @ref RTPHeader::offset_full.
4747
*/
4848
RTP_LARGE_FRAME = 1 << 0,
4949
/**
@@ -70,14 +70,14 @@ struct RTPHeader {
7070
/* Non-standard Tox-specific fields */
7171

7272
/**
73-
* Bit mask of \c RTPFlags setting features of the current frame.
73+
* Bit mask of `RTPFlags` setting features of the current frame.
7474
*/
7575
uint64_t flags;
7676

7777
/**
78-
* The full 32 bit data offset of the current data chunk. The \ref
78+
* The full 32 bit data offset of the current data chunk. The @ref
7979
* offset_lower data member contains the lower 16 bits of this value. For
80-
* frames smaller than 64KiB, \ref offset_full and \ref offset_lower are
80+
* frames smaller than 64KiB, @ref offset_full and @ref offset_lower are
8181
* equal.
8282
*/
8383
uint32_t offset_full;
@@ -106,7 +106,7 @@ struct RTPMessage {
106106
* This is used in the old code that doesn't deal with large frames, i.e.
107107
* the audio code or receiving code for old 16 bit messages. We use it to
108108
* record the number of bytes received so far in a multi-part message. The
109-
* multi-part message in the old code is stored in \c RTPSession::mp.
109+
* multi-part message in the old code is stored in `RTPSession::mp`.
110110
*/
111111
uint16_t len;
112112

@@ -192,10 +192,10 @@ void rtp_kill(RTPSession *session);
192192
int rtp_allow_receiving(RTPSession *session);
193193
int rtp_stop_receiving(RTPSession *session);
194194
/**
195-
* Send a frame of audio or video data, chunked in \ref RTPMessage instances.
195+
* Send a frame of audio or video data, chunked in @ref RTPMessage instances.
196196
*
197197
* @param session The A/V session to send the data for.
198-
* @param data A byte array of length \p length.
198+
* @param data A byte array of length @p length.
199199
* @param length The number of bytes to send from @p data.
200200
* @param is_keyframe Whether this video frame is a key frame. If it is an
201201
* audio frame, this parameter is ignored.

0 commit comments

Comments
 (0)