]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
Done: Added _FWP_INTERNALS_ macro
authorMartin Molnar <molnar@sum.(none)>
Thu, 19 Jun 2008 13:58:00 +0000 (15:58 +0200)
committerMartin Molnar <molnar@sum.(none)>
Thu, 19 Jun 2008 13:58:00 +0000 (15:58 +0200)
fwp/lib/fwp.h
fwp/lib/mngt/fwp_contract.c
fwp/lib/mngt/fwp_contract.h
fwp/lib/mngt/fwp_mngt.c
fwp/lib/mngt/fwp_mngt.h
fwp/lib/mngt/fwp_msg.h
fwp/tests/Makefile.omk
fwp/tests/fwp_mngrtest/fwp_mngrtest.c
fwp/tests/fwp_msgtest/Makefile.omk
fwp/tests/fwp_prototest/Makefile.omk
fwp/tests/fwp_vrestest/Makefile.omk

index e1da8142ec2aa1fb291d5a01c1573be0484c90f1..a46d940986ac09209c185ff2dd3b66916c0ca9c4 100644 (file)
@@ -4,6 +4,7 @@
 #include "fwp_conf.h"
 #include "fwp_vres.h"
 #include "fwp_endpoint.h"
+#include "fwp_contract.h"
 #include "fwp_mngt.h"
 
 static inline int fwp_init()
index e1f70322780c8ce5abdd7e4fab55ba231dab891c..7388e7075f87acea640a4f01f4ae3a4a13daf8a2 100644 (file)
@@ -10,7 +10,7 @@ static int fwp_contract_is_reserved(fwp_contract_d_t contract)
        return (contract->status == FWP_CONT_RESERVED);
 }
 
-static int fwp_contract_is_negotiated(fwp_contract_d_t contract)
+int fwp_contract_is_negotiated(fwp_contract_d_t contract)
 {
        return (contract->status == FWP_CONT_NEGOTIATED);
 }
index 58cc79c73d3cd760cb4e45a6731926b67cde2968..8ad6ec094ce11ac4d289db54b9c6713ebb28aa39 100644 (file)
@@ -47,6 +47,7 @@ struct fwp_contract {
 } fwp_contract_t;
 
 struct fwp_contract_data;
+//typedef struct fwp_contract_data fwp_contract_data_t;
 typedef struct fwp_contract_data* fwp_contract_d_t;
 
 #ifdef _FWP_INTERNALS_
@@ -89,6 +90,7 @@ int fwp_contract_commit(fwp_contract_d_t contractd, fwp_vres_d_t *vresdp);
 
 fwp_contract_d_t fwp_contract_create(fwp_contract_t *contract);
 int  fwp_contract_negotiate(fwp_contract_d_t contract, fwp_vres_d_t *vresdp);
+int fwp_contract_is_negotiated(fwp_contract_d_t contract);
 
 
 #endif /*_FWP_CONTRACT_H */ 
index 06a47e36590099ffa02a3734e22c048eafdd2f24..5ba0e7a747b649d7937f19370e536898afe2495c 100644 (file)
@@ -1,6 +1,10 @@
 #include "fwp_conf.h"
 #include "fwp_mngt.h"
 
+#include "fwp_msg.h"
+//#include "fwp_util.h"
+#include "fwp_contract_table.h"
+
 #include <stdlib.h>
 /** 
  * Global mngt variables
index dcb6ef07ad482458f31daf8151bc63afd3cf2465..03fdae61d7675324ab6cd23bc3465b0ea0ad9ff4 100644 (file)
@@ -2,13 +2,13 @@
 #ifndef _FWP_MNGT_H
 #define _FWP_MNGT_H
 
-#include "fwp_msg.h"
+#ifdef _FWP_INTERNALS_
 
-#include "fwp_util.h"
 #include "fwp_vres.h"
 #include "fwp_endpoint.h"
+
+#include "fwp_msg.h"
 #include "fwp_participant.h"
-#include "fwp_contract_table.h"
 
 #define FWP_MNGR_STREAM_ID             3000
 #define FWP_MNGT_DISCOVERY_STREAM_ID   3000
@@ -24,8 +24,11 @@ int fwp_mngt_send(fwp_msg_type_t type,fwp_msgb_t *msgb,
 int fwp_mngt_recv(fwp_msg_type_t *type, fwp_participant_id_t *participant_id,
                        fwp_msgb_t *msgb);
 
-int fwp_mngt_init();
 int fwp_mngt_service_vres_create(fwp_vres_d_t* fwp_service_vresd);
+
+#endif
+
+int fwp_mngt_init();
 int fwp_mngt_connect();
 
 #endif /* _FWP_MNGT_H */
index ede4948e8428adc1d6e0d28cd8835ed84bce6e5b..98bc68846ebc78290ddb8045ffaae0ba3beac8ca 100644 (file)
@@ -3,6 +3,8 @@
 
 #include <stdint.h>
 
+#ifdef _FWP_INTERNALS_
+
 #include "fwp_contract.h"
 #include "fwp_vres.h"
 #include "fwp_participant.h"
@@ -62,4 +64,6 @@ void fwp_msg_hello_in(unsigned char *data,
 void fwp_msg_hello_out(unsigned char *data,
                        fwp_participant_info_t *participant_info);
 
+#endif
+
 #endif /* _FWP_MSG_H */
index e4acee1f9d9307dcc2dc5847d170a61db91dfdd8..4cb6a31e4c23eecc162a946b3af5314eb6e9ae0f 100644 (file)
@@ -1,4 +1,4 @@
 SUBDIRS= fwp_msgtest fwp_vrestest fwp_prototest fwp_mngrtest  
-CFLAGS = -Wall -D_REENTRANT -g -D_FWP_INTERNALS_=1
+CFLAGS = -Wall -D_REENTRANT -g -D_FWP_INTERNALS_
 #SUBDIRS= fwp_msgtest fwp_vrestest fwp_prototest fwp_mngrtest  
 #fwp_mngrtest unixsocktest
index c77811cafab43cbfbc1ee48b05044d2f30184179..41f43a82f4ce7fe9a9dfd1162890f947153fa687 100644 (file)
@@ -48,7 +48,6 @@ int main()
        fwp_contract_t cnt2;
        fwp_contract_t cnt3;
        pthread_t       id;
-       struct fwp_vres_params vparam1;
        
        cnt1.budget = 100;
        cnt1.period_usec = 10000;
index 6adb95adb4906ac2ea3ba1fd44856e9aefb7839d..559d9ad88b09e172f764d3c0f7fbaf63a8c27194 100644 (file)
@@ -1,4 +1,4 @@
 test_PROGRAMS = fwp_msgtest
-CFLAGS = -Wall -D_REENTRANT -g -D_FWP_INTERNALS_=1
+CFLAGS+= -D_FWP_INTERNALS_
 fwp_msgtest_SOURCES+= fwp_msgtest.c
 lib_LOADLIBES += fwp pthread 
index 462773ac97c17ac9379fe7cbf3ca67ea375ea57c..23c080142866efd373bea1182e619e02aa0618db 100644 (file)
@@ -1,4 +1,5 @@
 test_PROGRAMS = fwp_sendrecv_test1 fwp_sendrecv_test2
+CFLAGS+= -D_FWP_INTERNALS_
 fwp_sendrecv_test1_SOURCES+= fwp_sendrecv_test1.c
 fwp_sendrecv_test2_SOURCES+= fwp_sendrecv_test2.c
 lib_LOADLIBES += fwp pthread rt ulut 
index 09e2dbf7f5cbcea2187185eb86d859968a2f5cd7..45879d39640b14d4d7649d61d3feea8233e66925 100644 (file)
@@ -1,4 +1,5 @@
 test_PROGRAMS = fwp_vrestest1 fwp_vrestest2
+CFLAGS+= -D_FWP_INTERNALS_
 fwp_vrestest1_SOURCES+= fwp_vrestest1.c
 fwp_vrestest2_SOURCES+= fwp_vrestest2.c
 lib_LOADLIBES += fwp pthread rt ulut