Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Field renaming in the plugin struct to cleanup; raw is now a field of the socket...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 14 Jun 2004 20:25:59 +0000 (20:25 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 14 Jun 2004 20:25:59 +0000 (20:25 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@105 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/gras/Transport/transport_interface.h
src/gras/Transport/transport_private.h

index d23f05e..f4395e7 100644 (file)
@@ -51,11 +51,9 @@ struct gras_trp_plugin_ {
   gras_error_t (*socket_client)(gras_trp_plugin_t *self,
                                const char *host,
                                unsigned short port,
   gras_error_t (*socket_client)(gras_trp_plugin_t *self,
                                const char *host,
                                unsigned short port,
-                               int raw,
                                /* OUT */ gras_socket_t *dst);
   gras_error_t (*socket_server)(gras_trp_plugin_t *self,
                                unsigned short port,
                                /* OUT */ gras_socket_t *dst);
   gras_error_t (*socket_server)(gras_trp_plugin_t *self,
                                unsigned short port,
-                               int raw,
                                /* OUT */ gras_socket_t *dst);
    
   gras_error_t (*socket_accept)(gras_socket_t  *sock,
                                /* OUT */ gras_socket_t *dst);
    
   gras_error_t (*socket_accept)(gras_socket_t  *sock,
@@ -73,8 +71,11 @@ struct gras_trp_plugin_ {
                             char *Data,
                             size_t size);
 
                             char *Data,
                             size_t size);
 
-  void          *specific;
-  void         (*free_specific)(void *);
+  void          *data;
+   /* exit is responsible for freeing data and telling the OS this plugin goes */
+   /* if it's NULL, data gets freed. (ie exit needed only when data contains pointers) */
+  void         (*exit)(gras_trp_plugin_t *);
 };
 
 gras_error_t
 };
 
 gras_error_t
index 543f6be..9c144a2 100644 (file)
@@ -18,7 +18,6 @@
 
 extern gras_dynar_t *_gras_trp_sockets; /* all existing sockets */
 
 
 extern gras_dynar_t *_gras_trp_sockets; /* all existing sockets */
 
-
 /**
  * s_gras_socket:
  * 
 /**
  * s_gras_socket:
  * 
@@ -31,6 +30,7 @@ struct s_gras_socket  {
   int incoming :1; /* true if we can read from this sock */
   int outgoing :1; /* true if we can write on this sock */
   int accepting :1; /* true if master incoming sock in tcp */
   int incoming :1; /* true if we can read from this sock */
   int outgoing :1; /* true if we can write on this sock */
   int accepting :1; /* true if master incoming sock in tcp */
+  int raw :1; /* true if this is an experiment socket instead of messaging */
    
   int  sd; 
   int  port; /* port on this side */
    
   int  sd; 
   int  port; /* port on this side */
@@ -44,10 +44,10 @@ gras_error_t gras_trp_socket_new(int incomming,
                                 gras_socket_t **dst);
 
 /* The drivers */
                                 gras_socket_t **dst);
 
 /* The drivers */
-gras_error_t gras_trp_tcp_init(gras_trp_plugin_t **dst);
-gras_error_t gras_trp_file_init(gras_trp_plugin_t **dst);
-gras_error_t gras_trp_sg_init (gras_trp_plugin_t **dst);
-
+typedef gras_error_t (*gras_trp_setup_t)(gras_trp_plugin_t *dst);
 
 
+gras_error_t gras_trp_tcp_setup(gras_trp_plugin_t *plug);
+gras_error_t gras_trp_file_setup(gras_trp_plugin_t *plug);
+gras_error_t gras_trp_sg_setup(gras_trp_plugin_t *plug);
 
 #endif /* GRAS_TRP_PRIVATE_H */
 
 #endif /* GRAS_TRP_PRIVATE_H */