More documentation.

This commit is contained in:
Nicolás Ortega Froysa 2017-09-23 11:29:25 +02:00
parent 68a5cfd24b
commit a789ff4e0c
No known key found for this signature in database
GPG Key ID: FEC70E3BAE2E69BF

View File

@ -16,6 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/**
* @file neocomm.h
* @brief Include file for NeoComm
*/
#pragma once #pragma once
#ifdef __cplusplus #ifdef __cplusplus
@ -33,6 +38,9 @@ struct user {
const char *hash; ///< The unique hash of the user. const char *hash; ///< The unique hash of the user.
}; };
/**
* @brief Structure with relevant message information.
*/
struct message { struct message {
const char *msg; ///< The text message. const char *msg; ///< The text message.
time_t sent; ///< The time it was sent. time_t sent; ///< The time it was sent.
@ -46,7 +54,7 @@ struct message {
* *
* @param port The port for the node to listen on. * @param port The port for the node to listen on.
*/ */
void NeoComm_init(unsigned short port); void NeoComm_init(const unsigned short port);
/** /**
* @brief Deinitialize the local node. * @brief Deinitialize the local node.
@ -109,11 +117,16 @@ void NeoComm_leave_channel(const char *channel_name);
* *
* @return A structure of the message. If NULL then there are no new messages. * @return A structure of the message. If NULL then there are no new messages.
* *
* @warn This command will remove the message from the internal list. * @notice This command will remove the message from the internal list.
* @warn The message must be freed from memory using NeoComm_free_message. * @notice The message must be freed from memory using NeoComm_free_message.
*/ */
struct message *NeoComm_get_next_message(const char *channel_name); struct message *NeoComm_get_next_message(const char *channel_name);
/**
* @brief Free the memory for a message.
*
* @param msg The message to free from memory.
*/
void NeoComm_free_message(struct message *msg); void NeoComm_free_message(struct message *msg);
/** /**