]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
Adding more comments to core files
authorMartin Molnar <molnar@sum.(none)>
Fri, 4 Jul 2008 15:23:27 +0000 (17:23 +0200)
committerMartin Molnar <molnar@sum.(none)>
Fri, 4 Jul 2008 15:23:27 +0000 (17:23 +0200)
fwp/lib/core/fwp_endpoint.c
fwp/lib/core/fwp_endpoint.h
fwp/lib/core/fwp_msgb.h
fwp/lib/core/fwp_msgq.h
fwp/lib/core/fwp_vres.h

index 15d9ef013950c93e7ee983013e756a6a9b8230ab..c43de17a10ea965d83afe76fcee9f0545df188c3 100644 (file)
@@ -95,6 +95,13 @@ int fwp_endpoint_table_init(unsigned int max_endpoints)
        return 0;
 }
 
+/**
+ * Allocates endpoint
+ *
+ * \return On success returns endpoint structure. 
+ * On error, NULL is returned. 
+ *
+ */
 static fwp_endpoint_t* fwp_endpoint_alloc()
 {
        int i, max_endpoints;
@@ -117,6 +124,13 @@ static fwp_endpoint_t* fwp_endpoint_alloc()
        return (&fwp_endpoint_table.entry[i]);
 }
 
+/**
+ * Destroy endpoint
+ *
+ * \param[in] epointd Endpoint descriptor
+ * \return On success 0 is returned. 
+ * On error, negative error value is returned. 
+ */
 int fwp_endpoint_destroy(fwp_endpoint_d_t epointd)
 {
        fwp_endpoint_t *epoint = epointd;
@@ -130,6 +144,16 @@ int fwp_endpoint_destroy(fwp_endpoint_d_t epointd)
        return 0;
 }
 
+/**
+ * Get endpoint parameters
+ *
+ * \param[in] epointd Endpoint descriptor
+ * \param[out] node Node identifier
+ * \param[out] port Port
+ * \param[out] attr Endpoint`s attributes
+ * \return On success 0 is returned. 
+ * On error, negative error value is returned. 
+ */
 int fwp_endpoint_get_params(fwp_endpoint_d_t epointd, unsigned int *node, 
                                unsigned int *port, fwp_endpoint_attr_t *attr)
 {
@@ -233,7 +257,6 @@ err:
  *
  * \return On success returns descriptor of endpoint. 
  * On error, negative error code is returned. 
- *
  */
 int fwp_receive_endpoint_create(/*unsigned int node,*/ unsigned int port,
                                fwp_endpoint_attr_t *attr, 
@@ -369,7 +392,7 @@ err:
 /**
  * Unbinds send endpoint from vres
  *
- * \param[in] id send endpoint identifie
+ * \param[in] epointd Send endpoint descripto
  * \return On success returns 0. On error, negative error code is returned 
  *
  */
@@ -394,9 +417,9 @@ int fwp_send_endpoint_unbind(fwp_endpoint_d_t epointd)
 /**
  * Receives message
  *
- * \param[in] epointd descriptor of endpoint
- * \param[in] buffer buffer to store message
- * \param[in] buffer_size size of buffer
+ * \param[in] epointd Descriptor of endpoint
+ * \param[in] buffer Buffer to store message
+ * \param[in] buffer_size Size of buffer
  *
  * \return
  * On success, it returns number of received bytes.  
@@ -480,9 +503,9 @@ ssize_t fwp_recv(fwp_endpoint_d_t epointd, void *buffer, size_t buffer_size,
 /**
  * Sends message through vres
  *
- * \param[in] epointd  identificator of endpoint
- * \param[in] msg message to sent
- * \param[in] size message size
+ * \param[in] epointd Endpoint descriptor
+ * \param[in] msg Message to sent
+ * \param[in] size Message size
  *
  * \return
  * On success, it returns zero.  
index f9e1baca051670619105d084900c46a41c012cdf..75bd2333c3875c884b709ee477d7d9a4bcaa9116 100644 (file)
@@ -9,9 +9,12 @@ typedef enum {
 } fwp_endpoint_reliability_t;
 
 struct fwp_endpoint;
-/* fwp endpoint descriptor type */
+/** fwp endpoint descriptor type */
 typedef struct fwp_endpoint* fwp_endpoint_d_t;
 
+/**
+ * Endpoint attributes
+ */
 typedef
 struct fwp_endpoint_attr {
        unsigned int reliability;
index c588472abbfd2bed8c5f17d8a6c117ac929b5c2a..1fa5a11a1d77453c34cd3d3cb3183e46925e3c9f 100644 (file)
@@ -4,10 +4,6 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <string.h>
-/*#include <sys/un.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <unistd.h>*/
 
 #define ADDRLEN_MAX 30
 
@@ -17,6 +13,9 @@ struct fwp_sockaddr{
        socklen_t       addrlen;
 } fwp_sockaddr_t;
 
+/**
+ * Message buffer structure
+ */
 typedef
 struct fwp_msgb {
        size_t                  buffer_size;
index c38dff374bc97de80755a1afffd3a6b15fb424ff..f10d19a45d2b2c8b538afc00af546a2216960aaa 100644 (file)
@@ -7,6 +7,10 @@
 #include <pthread.h>
 #include <semaphore.h>
 
+/**
+ * Message queue structure
+ *
+ */
 struct fwp_msgq {
        unsigned int    nr_pending;  /**< number of messages in the queue */
        struct fwp_msgb* queue[FWP_MSGQ_SIZE];
index 8520a117db2e73729f7cb8b433409747dc1df928..335bce972523dbf6d8ae15511eef7a3dccd52f5e 100644 (file)
@@ -25,9 +25,6 @@ typedef enum  {
 /**
  * FWP vres parameters 
  * 
- * It is like an internal representation of the contract used inside 
- * protocol and contains negotiated parameters from contract.
- * 
  */
 typedef
 struct fwp_vres_params {