]> rtime.felk.cvut.cz Git - frescor/fwp.git/blobdiff - fwp/lib/mngt/fwp_contract.c
Adding more comments
[frescor/fwp.git] / fwp / lib / mngt / fwp_contract.c
index b59f9a32c14ecf2bf03b89a93a9a65181250ad5b..4262aa87f28d03746da55c931c304aa2710f8f48 100644 (file)
@@ -1,3 +1,9 @@
+/**
+ * \file fwp_contract.c
+ *
+ * Routines for manipulation with contract
+ *
+ */
 #include "fwp_msg.h"
 #include "fwp_contract.h"
 #include "fwp_contract_table.h"
@@ -18,8 +24,8 @@ int fwp_contract_is_negotiated(fwp_contract_d_t contract)
  * Negotiates contract for application. Negotiation request is sent to 
  * fwp agent and then waits for response.
  *
- * \param[in] contractd descriptor of the contract to negotiate
- * \param[out] vresd Id of vres after the contract was accepted
+ * \param[in] contractd Descriptor of the contract to negotiate
+ * \param[out] vresd Vres descriptor after the contract was accepted
  *
  * \return  
  * If successful, the  function returns zero and vres descriptor is
@@ -39,6 +45,14 @@ int fwp_contract_negotiate(fwp_contract_d_t contractd, fwp_vres_d_t *vresdp)
        return 0;
 }
 
+/**
+ * Creates contract
+ * 
+ * \param[in] contract User-level contract
+ *
+ * \return On success, returns contract descriptor
+ *
+ */
 /*fwp_contract_d_t fwp_contract_create(fwp_contract_t *contract, resource_d_t resource)*/
 fwp_contract_d_t fwp_contract_create(fwp_contract_t *contract)
 {
@@ -61,6 +75,15 @@ fwp_contract_d_t fwp_contract_create(fwp_contract_t *contract)
        return contdata;
 }
 
+/**
+ * Destroys contract
+ * 
+ * \param[in] contractd Contract descriptor
+ *
+ * \return On success, returns zero.
+ * On error, returns negative error code.
+ *
+ */
 int fwp_contract_destroy(fwp_contract_d_t contractd)
 {
        fwp_contract_data_t *contdata = contractd;
@@ -71,6 +94,15 @@ int fwp_contract_destroy(fwp_contract_d_t contractd)
        return 0;
 }
 
+/**
+ * Reserves contract
+ * 
+ * \param[in] contractd Contract descriptor
+ *
+ * \return On success, returns zero.
+ * On error, returns negative error code.
+ *
+ */
 int fwp_contract_reserve(fwp_contract_d_t contractd)
 {
        fwp_contract_data_t *contdata = contractd;
@@ -115,6 +147,16 @@ int fwp_contract_reserve(fwp_contract_d_t contractd)
        return 0;
 }
 
+/**
+ * Commits contract
+ * 
+ * \param[in] contractd Contract descriptor
+ * \param[out] vresd Descriptor of vres
+ *
+ * \return On success, returns zero.
+ * On error, returns negative error code.
+ *
+ */
 int fwp_contract_commit(fwp_contract_d_t contractd, fwp_vres_d_t *vresdp)
 {
        fwp_contract_data_t *contdata = contractd;
@@ -141,6 +183,15 @@ int fwp_contract_commit(fwp_contract_d_t contractd, fwp_vres_d_t *vresdp)
        return 0;
 }
 
+/**
+ * Cancels contract
+ * 
+ * \param[in] contractd Contract descriptor
+ *
+ * \return On success, returns zero.
+ * On error, returns negative error code.
+ *
+ */
 int fwp_contract_cancel(fwp_contract_d_t contractd)
 {
        fwp_contract_data_t *contdata = contractd;