]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
compilation fixes
authorMartin Molnar <molnar@sum.(none)>
Tue, 12 Feb 2008 16:29:45 +0000 (17:29 +0100)
committerMartin Molnar <molnar@sum.(none)>
Tue, 12 Feb 2008 16:29:45 +0000 (17:29 +0100)
fwp/libfwp/include/fwp_cnt.h
fwp/libfwp/include/fwp_cntable.h
fwp/libfwp/include/fwp_msg.h
fwp/libfwp/include/fwp_vres.h
fwp/libfwp/src/fwp_cntable.c
fwp/libfwp/src/fwp_msg.c
fwp/libfwp/src/fwp_vres.c
fwp/tests/fwp_msgtest/fwp_msgtest.c
fwp/tests/fwp_prototest/fwp_sendrecv_test.c

index 985dd44f0b549290242fe6f3a51497dfc9ac19a4..b29ed153d08c7cfb51f7b885e1a7358555fef10c 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _FWP_CONTRACT_H
-#define _FWP_CONTRACT_H
+#ifndef _FWP_CNT_H
+#define _FWP_CNT_H
 
 #include "fwp_msgb.h"
 
@@ -12,12 +12,12 @@ typedef enum {
 } cnt_status_t;
 
 /**
- * FWP contract info
+ * FWP contract 
  * It is internal representation of the contract used inside 
  * protocol.
  * 
  */
-struct fwp_cnt_info { /* BETTER name ??*/
+struct fwp_cnt { /* BETTER name ??*/
        int budget;             /**< bytes per period */
        int period_usec;        /**< all time units are in microseconds */
        
@@ -36,4 +36,4 @@ struct fwp_cnt_info { /* BETTER name ??*/
                                  request */            
 };
 
-#endif /*_FWP_CONTRACT_H */ 
+#endif /*_FWP_CNT_H */ 
index 7f6459931358a6dbeda3573fe9352e2d432296d3..e5dc9bbec8199bb07df89aba5b4d7ca18482c747 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _FWP_CTABLE_H
-#define _FWP_CTABLE_H
+#ifndef _FWP_CNTABLE_H
+#define _FWP_CNTABLE_H
 
 #include "fwp_conf.h"
 #include "fwp_cnt.h"
@@ -9,17 +9,16 @@
 #include <sys/un.h>
 
 struct fwp_cntable {
-       struct fwp_cnt_info             entry[FWP_CONTRACT_MAX];
+       struct fwp_cnt                  entry[FWP_CONTRACT_MAX];
        unsigned int                    nr_contract;
        /*pthread_mutex_t               lock; */
 };
 
 void fwp_cntable_init(struct fwp_cntable *cntable);
 
-int fwp_cntable_insert(struct fwp_cntable *cntable, struct fwp_cnt_info *cnt);
+int fwp_cntable_insert(struct fwp_cntable *cntable, struct fwp_cnt *cnt);
 int fwp_cntable_delete(struct fwp_cntable *cntable, unsigned int id);
 
-struct fwp_cnt_info* fwp_cntable_get(struct fwp_cntable* cntable, 
-                                         unsigned int id);
+struct fwp_cnt* fwp_cntable_get(struct fwp_cntable* cntable, unsigned int id);
 
-#endif /* _FWP_CTABLE_H */ 
+#endif /* _FWP_CNTABLE_H */ 
index 251af45c75618eb6af6fda1e03047ac23be73246..e89d4cef2d5e1c45c891d4dc2efb5b4a9cb2a382 100644 (file)
@@ -22,7 +22,7 @@ struct fwp_msg_contract{
 
 void fwp_msg_header_parse(unsigned char *data, unsigned int *code, unsigned int *hid);
 
-void fwp_msg_contract_insert(unsigned char *data, struct fwp_cnt_info *cnt);
-void fwp_msg_contract_parse(unsigned char *data, struct fwp_cnt_info *cnt);
+void fwp_msg_contract_insert(unsigned char *data, struct fwp_cnt *cnt);
+void fwp_msg_contract_parse(unsigned char *data, struct fwp_cnt *cnt);
 
 #endif /* _FWP_MSG_H */
index 131c15c7f563daf2074831b2fdfe4f28dbfcfd36..9baac52b5d10ee200368ebd0326d7b0129e06a09 100644 (file)
@@ -8,7 +8,7 @@
 
 void fwp_vres_table_init();
 
-int  fwp_vres_open(struct fwp_cnt_info *cnt);
+int  fwp_vres_open(struct fwp_cnt *cnt);
 int  fwp_vres_close(unsigned int id);
 
 inline int fwp_vres_send(unsigned int id, struct fwp_msgb* msgb);
index 31263dce6409717e7d28fc16970345af597601f7..1a73df7fb42f58af02291dbeb59af0cae5731955 100644 (file)
@@ -11,8 +11,7 @@ void fwp_cntable_init(struct fwp_cntable* cntable)
        cntable->nr_contract = 0;
 }
 
-int fwp_cntable_insert(struct fwp_cntable* cntable, 
-                      struct fwp_cnt_info *cnt)
+int fwp_cntable_insert(struct fwp_cntable* cntable, struct fwp_cnt *cnt)
 {
        unsigned int id;
         /* obtain fwp ctable mutex */
@@ -27,7 +26,7 @@ int fwp_cntable_insert(struct fwp_cntable* cntable,
                return -1;
        }
        
-       memcpy(&cntable->entry[id], cnt, sizeof(struct fwp_cnt_info));
+       memcpy(&cntable->entry[id], cnt, sizeof(struct fwp_cnt));
 
        cntable->nr_contract++;
        /* release fwp_contract_table mutex */
@@ -35,7 +34,7 @@ int fwp_cntable_insert(struct fwp_cntable* cntable,
        return id;
 }
 
-struct fwp_cnt_info* fwp_cntable_get(struct fwp_cntable* cntable, 
+struct fwp_cnt* fwp_cntable_get(struct fwp_cntable* cntable, 
                                     unsigned int id)
 {
        return (&cntable->entry[id]);
index 5ec9f1c2e49d4ea1022044e6f7cc0177f0e45a51..ea49115c213a1b6fd962dcdf4ef25c718982d493 100644 (file)
@@ -26,7 +26,7 @@ void fwp_msg_header_parse(unsigned char *data, unsigned int *code,
        *hid = ntohs(header->hid);
 }
 
-void fwp_msg_contract_insert(unsigned char *data, struct fwp_cnt_info *cnt)
+void fwp_msg_contract_insert(unsigned char *data, struct fwp_cnt *cnt)
 {
        struct fwp_msg_contract* msgcnt;
 
@@ -43,7 +43,7 @@ void fwp_msg_contract_insert(unsigned char *data, struct fwp_cnt_info *cnt)
        msgcnt->period_usec = htonl(cnt->period_usec);
 }
 
-void fwp_msg_contract_parse(unsigned char *data, struct fwp_cnt_info *cnt)
+void fwp_msg_contract_parse(unsigned char *data, struct fwp_cnt *cnt)
 {
        struct fwp_msg_contract* msgcnt;
 
index 8a2cf572c19bb6efb6904590ceb31189e542aeb2..162d5dbf98e098a13e666f623611c1907ba73925 100644 (file)
@@ -25,7 +25,7 @@ typedef unsigned int  fwp_vresid_t;
  * 
  */
 struct fwp_vres{
-       struct fwp_cnt_info             contract;
+       struct fwp_cnt                  contract;
        /* consideration: move tx_queue to endpoint */
        /**< queue for messages to send */
        struct fwp_msgq                 tx_queue;   
@@ -56,7 +56,7 @@ void fwp_vres_table_init()
                fwp_vres_table[id].status = FWP_VRES_CLOSED;
 }
 
-int fwp_vres_open(struct fwp_cnt_info *cnt)
+int fwp_vres_open(struct fwp_cnt *cnt)
 {
        int id,rc;
        struct fwp_vres *vres;
@@ -83,7 +83,7 @@ int fwp_vres_open(struct fwp_cnt_info *cnt)
        vres->status = FWP_VRES_OPENED;
        /* release fwp_vres_table mutex */
        pthread_mutex_unlock(&vres_table_lock);
-       memcpy(&vres->contract, cnt, sizeof(struct fwp_cnt_info));              
+       memcpy(&vres->contract, cnt, sizeof(struct fwp_cnt));           
 
        fwp_msgq_init(&vres->tx_queue);
        if ((rc = fwp_ac_open(vres->contract.ac_id)) < 0) {
index 3b71015ab86509aebf6e777297d456e0df2e89d8..79571014c2d219446d8560abfdf977653ea5a2f0 100644 (file)
@@ -10,7 +10,7 @@ int main(int argc, char *argv[])
 {
        struct fwp_msgq msgq;
        struct fwp_msgb *msgb;
-       struct fwp_cnt_info cnt_a, cnt_b, cnt_c, cnt_d;
+       struct fwp_cnt cnt_a, cnt_b, cnt_c, cnt_d;
 
        fwp_msgq_init(&msgq);   
        printf("in=%d out=%d pending=%d \n",msgq.in,msgq.out,msgq.nr_pending);
index bca532b0183842e41256fa0a87f3d8debf5a2170..3596767a38dbf2c15b27d907d9fc033b19a44770 100644 (file)
@@ -12,8 +12,7 @@ int main()
         ssize_t len;
        int vres_id1, vres_id2;
        int i;
-       struct fwp_cnt_info cnt1;
-       struct fwp_cnt_info cnt2;
+       struct fwp_cnt cnt1, cnt2;
        char msg1[] = "Hello1";
        char msg2[] = "Hello2";
        char buffer[30];