Skip to content

Commit

Permalink
docs: Fix doxygen config and remove some redundant comments.
Browse files Browse the repository at this point in the history
Doxygen doesn't like these. We should probably remove all redundant
comments, but this was the set of comments doxygen complained about.
  • Loading branch information
iphydf committed Aug 16, 2023
1 parent b0f6331 commit a1e2458
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 200 deletions.
49 changes: 0 additions & 49 deletions docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -1614,17 +1614,6 @@ HTML_FORMULA_FORMAT = png

FORMULA_FONTSIZE = 10

# Use the FORMULA_TRANSPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are not
# supported properly for IE 6.0, but are supported on all modern browsers.
#
# Note that when changing this option you need to delete any form_*.png files in
# the HTML output directory before the changes have effect.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.

FORMULA_TRANSPARENT = YES

# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands
# to create new LaTeX commands to be used in formulas as building blocks. See
# the section "Including formulas" for details.
Expand Down Expand Up @@ -2307,15 +2296,6 @@ EXTERNAL_PAGES = YES
# Configuration options related to the dot tool
#---------------------------------------------------------------------------

# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
# NO turns the diagrams off. Note that this option also works with HAVE_DOT
# disabled, but it is recommended to install and use dot, since it yields more
# powerful graphs.
# The default value is: YES.

CLASS_DIAGRAMS = YES

# You can include diagrams made with dia in doxygen documentation. Doxygen will
# then run dia to produce the diagram and insert it in the documentation. The
# DIA_PATH tag allows you to specify the directory where the dia binary resides.
Expand Down Expand Up @@ -2348,23 +2328,6 @@ HAVE_DOT = NO

DOT_NUM_THREADS = 0

# When you want a differently looking font in the dot files that doxygen
# generates you can specify the font name using DOT_FONTNAME. You need to make
# sure dot is able to find the font, which can be done by putting it in a
# standard location or by setting the DOTFONTPATH environment variable or by
# setting DOT_FONTPATH to the directory containing the font.
# The default value is: Helvetica.
# This tag requires that the tag HAVE_DOT is set to YES.

DOT_FONTNAME = Helvetica

# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
# dot graphs.
# Minimum value: 4, maximum value: 24, default value: 10.
# This tag requires that the tag HAVE_DOT is set to YES.

DOT_FONTSIZE = 10

# By default doxygen will tell dot to use the default font as specified with
# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
# the path where dot can find it using this tag.
Expand Down Expand Up @@ -2599,18 +2562,6 @@ DOT_GRAPH_MAX_NODES = 50

MAX_DOT_GRAPH_DEPTH = 0

# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
# background. This is disabled by default, because dot on Windows does not seem
# to support this out of the box.
#
# Warning: Depending on the platform used, enabling this option may lead to
# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
# read).
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.

DOT_TRANSPARENT = NO

# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
# makes dot run faster, but since only newer versions of dot (>1.8.10) support
Expand Down
2 changes: 1 addition & 1 deletion other/bootstrap_daemon/docker/tox-bootstrapd.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
93c9c4ba12e450afd01aabd31ae1da970c841e13984b68969d183b11e6266e1a /usr/local/bin/tox-bootstrapd
23e142729a72618462018b25c830dbad5b023d0fa3de9ae53d376f43dc46b481 /usr/local/bin/tox-bootstrapd
41 changes: 0 additions & 41 deletions toxav/toxav_old.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,64 +16,23 @@ int toxav_add_av_groupchat(Tox *tox, audio_data_cb *audio_callback, void *userda
return add_av_groupchat(tox->m->log, tox, tox->m->conferences_object, audio_callback, userdata);
}

/** @brief Join a AV group (you need to have been invited first).
*
* @return group number on success.
* @retval -1 on failure.
*
* 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,
audio_data_cb *audio_callback, void *userdata)
{
return join_av_groupchat(tox->m->log, tox, tox->m->conferences_object, friendnumber, data, length, audio_callback, userdata);
}

/** @brief Send audio to the group chat.
*
* @retval 0 on success.
* @retval -1 on failure.
*
* 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 are: 2.5, 5, 10, 20, 40 or 60 ms)
* Valid number of channels are 1 or 2.
* Valid sample rates are 8000, 12000, 16000, 24000, or 48000.
*
* Recommended values are: samples = 960, channels = 1, sample_rate = 48000
*/
int toxav_group_send_audio(Tox *tox, uint32_t groupnumber, const int16_t *pcm, unsigned int samples, uint8_t channels,
uint32_t sample_rate)
{
return group_send_audio(tox->m->conferences_object, groupnumber, pcm, samples, channels, sample_rate);
}

/** @brief Enable A/V in a groupchat.
*
* A/V must be enabled on a groupchat for audio to be sent to it and for
* received audio to be handled.
*
* An A/V group created with `toxav_add_av_groupchat` or `toxav_join_av_groupchat`
* will start with A/V enabled.
*
* An A/V group loaded from a savefile will start with A/V disabled.
*
* @retval 0 on success.
* @retval -1 on failure.
*
* 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)
{
return groupchat_enable_av(tox->m->log, tox, tox->m->conferences_object, groupnumber, audio_callback, userdata);
}

/** @brief Disable A/V in a groupchat.
*
* @retval 0 on success.
* @retval -1 on failure.
*/
int toxav_groupchat_disable_av(Tox *tox, uint32_t groupnumber)
{
return groupchat_disable_av(tox->m->conferences_object, groupnumber);
Expand Down
108 changes: 0 additions & 108 deletions toxcore/DHT.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,6 @@ static IP_Port ip_port_normalize(const IP_Port *ip_port)
return res;
}

/** @brief Compares pk1 and pk2 with pk.
*
* @retval 0 if both are same distance.
* @retval 1 if pk1 is closer.
* @retval 2 if pk2 is closer.
*/
int id_closest(const uint8_t *pk, const uint8_t *pk1, const uint8_t *pk2)
{
for (size_t i = 0; i < CRYPTO_PUBLIC_KEY_SIZE; ++i) {
Expand Down Expand Up @@ -280,27 +274,6 @@ const uint8_t *dht_get_shared_key_sent(DHT *dht, const uint8_t *public_key)

#define CRYPTO_SIZE (1 + CRYPTO_PUBLIC_KEY_SIZE * 2 + CRYPTO_NONCE_SIZE)

/**
* @brief Create a request to peer.
*
* Packs the data and sender public key and encrypts the packet.
*
* @param[in] send_public_key public key of the sender.
* @param[in] send_secret_key secret key of the sender.
* @param[out] packet an array of @ref MAX_CRYPTO_REQUEST_SIZE big.
* @param[in] recv_public_key public key of the receiver.
* @param[in] data represents the data we send with the request.
* @param[in] data_length the length of the data.
* @param[in] request_id the id of the request (32 = friend request, 254 = ping request).
*
* @attention Constraints:
* @code
* sizeof(packet) >= MAX_CRYPTO_REQUEST_SIZE
* @endcode
*
* @retval -1 on failure.
* @return the length of the created packet on success.
*/
int create_request(const Random *rng, const uint8_t *send_public_key, const uint8_t *send_secret_key,
uint8_t *packet, const uint8_t *recv_public_key,
const uint8_t *data, uint32_t data_length, uint8_t request_id)
Expand Down Expand Up @@ -334,28 +307,6 @@ int create_request(const Random *rng, const uint8_t *send_public_key, const uint
return len + CRYPTO_SIZE;
}

/**
* @brief Decrypts and unpacks a DHT request packet.
*
* Puts the senders public key in the request in @p public_key, the data from
* the request in @p data.
*
* @param[in] self_public_key public key of the receiver (us).
* @param[in] self_secret_key secret key of the receiver (us).
* @param[out] public_key public key of the sender, copied from the input packet.
* @param[out] data decrypted request data, copied from the input packet, must
* have room for @ref MAX_CRYPTO_REQUEST_SIZE bytes.
* @param[in] packet is the request packet.
* @param[in] packet_length length of the packet.
*
* @attention Constraints:
* @code
* sizeof(data) >= MAX_CRYPTO_REQUEST_SIZE
* @endcode
*
* @retval -1 if not valid request.
* @return the length of the unpacked data.
*/
int handle_request(const uint8_t *self_public_key, const uint8_t *self_secret_key, uint8_t *public_key, uint8_t *data,
uint8_t *request_id, const uint8_t *packet, uint16_t packet_length)
{
Expand Down Expand Up @@ -394,9 +345,6 @@ int handle_request(const uint8_t *self_public_key, const uint8_t *self_secret_ke
return len1;
}

/** @return packet size of packed node with ip_family on success.
* @retval -1 on failure.
*/
int packed_node_size(Family ip_family)
{
if (net_family_is_ipv4(ip_family) || net_family_is_tcp_ipv4(ip_family)) {
Expand All @@ -411,13 +359,6 @@ int packed_node_size(Family ip_family)
}


/** @brief Pack an IP_Port structure into data of max size length.
*
* Packed_length is the offset of data currently packed.
*
* @return size of packed IP_Port data on success.
* @retval -1 on failure.
*/
int pack_ip_port(const Logger *logger, uint8_t *data, uint16_t length, const IP_Port *ip_port)
{
if (data == nullptr) {
Expand Down Expand Up @@ -473,11 +414,6 @@ int pack_ip_port(const Logger *logger, uint8_t *data, uint16_t length, const IP_
}
}

/** @brief Encrypt plain and write resulting DHT packet into packet with max size length.
*
* @return size of packet on success.
* @retval -1 on failure.
*/
int dht_create_packet(const Random *rng, const uint8_t public_key[CRYPTO_PUBLIC_KEY_SIZE],
const uint8_t *shared_key, const uint8_t type,
const uint8_t *plain, size_t plain_length,
Expand Down Expand Up @@ -513,13 +449,6 @@ int dht_create_packet(const Random *rng, const uint8_t public_key[CRYPTO_PUBLIC_
return 1 + CRYPTO_PUBLIC_KEY_SIZE + CRYPTO_NONCE_SIZE + encrypted_length;
}

/** @brief Unpack IP_Port structure from data of max size length into ip_port.
*
* len_processed is the offset of data currently unpacked.
*
* @return size of unpacked ip_port on success.
* @retval -1 on failure.
*/
int unpack_ip_port(IP_Port *ip_port, const uint8_t *data, uint16_t length, bool tcp_enabled)
{
if (data == nullptr) {
Expand Down Expand Up @@ -580,11 +509,6 @@ int unpack_ip_port(IP_Port *ip_port, const uint8_t *data, uint16_t length, bool
}
}

/** @brief Pack number of nodes into data of maxlength length.
*
* @return length of packed nodes on success.
* @retval -1 on failure.
*/
int pack_nodes(const Logger *logger, uint8_t *data, uint16_t length, const Node_format *nodes, uint16_t number)
{
uint32_t packed_length = 0;
Expand Down Expand Up @@ -614,13 +538,6 @@ int pack_nodes(const Logger *logger, uint8_t *data, uint16_t length, const Node_
return packed_length;
}

/** @brief Unpack data of length into nodes of size max_num_nodes.
* Put the length of the data processed in processed_data_len.
* tcp_enabled sets if TCP nodes are expected (true) or not (false).
*
* @return number of unpacked nodes on success.
* @retval -1 on failure.
*/
int unpack_nodes(Node_format *nodes, uint16_t max_num_nodes, uint16_t *processed_data_len, const uint8_t *data,
uint16_t length, bool tcp_enabled)
{
Expand Down Expand Up @@ -2043,11 +1960,6 @@ int dht_bootstrap_from_address(DHT *dht, const char *address, bool ipv6enabled,
return 0;
}

/** @brief Send the given packet to node with public_key.
*
* @return number of bytes sent.
* @retval -1 if failure.
*/
int route_packet(const DHT *dht, const uint8_t *public_key, const uint8_t *packet, uint16_t length)
{
for (uint32_t i = 0; i < LCLIENT_LIST; ++i) {
Expand Down Expand Up @@ -2923,11 +2835,6 @@ void dht_save(const DHT *dht, uint8_t *data)
/** Bootstrap from this number of nodes every time `dht_connect_after_load()` is called */
#define SAVE_BOOTSTAP_FREQUENCY 8

/** @brief Start sending packets after DHT loaded_friends_list and loaded_clients_list are set.
*
* @retval 0 if successful
* @retval -1 otherwise
*/
int dht_connect_after_load(DHT *dht)
{
if (dht == nullptr) {
Expand Down Expand Up @@ -2997,11 +2904,6 @@ static State_Load_Status dht_load_state_callback(void *outer, const uint8_t *dat
return STATE_LOAD_STATUS_CONTINUE;
}

/** @brief Load the DHT from data of size size.
*
* @retval -1 if failure.
* @retval 0 if success.
*/
int dht_load(DHT *dht, const uint8_t *data, uint32_t length)
{
const uint32_t cookie_len = sizeof(uint32_t);
Expand Down Expand Up @@ -3060,16 +2962,6 @@ bool dht_non_lan_connected(const DHT *dht)
return false;
}

/** @brief Copies our own ip_port structure to `dest`.
*
* WAN addresses take priority over LAN addresses.
*
* This function will zero the `dest` buffer before use.
*
* @retval 0 if our ip port can't be found (this usually means we're not connected to the DHT).
* @retval 1 if IP is a WAN address.
* @retval 2 if IP is a LAN address.
*/
unsigned int ipport_self_copy(const DHT *dht, IP_Port *dest)
{
ipport_reset(dest);
Expand Down
2 changes: 1 addition & 1 deletion toxcore/crypto_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ int32_t decrypt_data(const uint8_t *public_key, const uint8_t *secret_key, const
/**
* @brief Fast encrypt/decrypt operations.
*
* Use if this is not a one-time communication. @ref encrypt_precompute does the
* Use if this is not a one-time communication. `encrypt_precompute` does the
* shared-key generation once so it does not have to be performed on every
* encrypt/decrypt.
*/
Expand Down

0 comments on commit a1e2458

Please sign in to comment.