Added documentation.

This commit is contained in:
Nicolás A. Ortega
2017-07-11 19:18:45 +02:00
parent 6f98136102
commit b375439f2a
6 changed files with 27 additions and 16 deletions

View File

@ -18,7 +18,3 @@
*/
#pragma once
int NeoComm_connect_all_nodes();
int NeoComm_disconnect();

View File

@ -21,6 +21,11 @@
#include "nodes.h"
/**
* @file neocomm.h
* @brief Automated functions that manage the entire NeoComm framework.
*/
/**
* @brief Initializes all modules of the NeoComm framework.
*

View File

@ -19,10 +19,16 @@
#pragma once
/**
* @file nodes.h
* @brief Management of nodes.
* @details These functions are used to manage the global list of nodes.
*/
/**
* @brief Simple address structure providing IP/DNS and port information.
*/
struct address {
struct NeoComm_address {
char *address; ///< IP/DNS string.
unsigned short port; ///< Port of address.
};
@ -30,9 +36,9 @@ struct address {
/**
* @brief Structure used for NeoComm nodes.
*/
struct node {
struct NeoComm_node {
/// The address of the node.
struct address address;
struct NeoComm_address address;
/// Whether or not it is a directory node/server.
int directory;
/// Number of connections a directory has.
@ -91,7 +97,7 @@ unsigned int NeoComm_get_node_count();
* @return If the list is full then it will return NULL, else it will return
* a pointer to the new (or old, if already existing) node.
*/
struct node *NeoComm_add_node(struct address addr);
struct NeoComm_node *NeoComm_add_node(struct NeoComm_address addr);
/**
* @brief Remove a node from the list.
@ -100,7 +106,7 @@ struct node *NeoComm_add_node(struct address addr);
*
* @return If the node was not found it returns 0, else it returns 1.
*/
int NeoComm_remove_node(struct address addr);
int NeoComm_remove_node(struct NeoComm_address addr);
/**
* @brief Get a pointer to the node with a given address.
@ -109,4 +115,4 @@ int NeoComm_remove_node(struct address addr);
*
* @return A modifiable pointer to the node or NULL if not found.
*/
struct node *NeoComm_get_node(struct address addr);
struct NeoComm_node *NeoComm_get_node(struct NeoComm_address addr);