Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fixed licence and copyright. No more reference to da GRAS possee or the
[simgrid.git] / src / gras / Transport / rl_transport.c
index 04970c4..da21e4d 100644 (file)
@@ -2,11 +2,10 @@
 
 /* rl_transport - RL specific functions for transport                       */
 
-/* Authors: Martin Quinson                                                  */
-/* Copyright (C) 2004 Martin Quinson.                                       */
+/* Copyright (c) 2004 Martin Quinson. All rights reserved.                  */
 
 /* This program is free software; you can redistribute it and/or modify it
  under the terms of the license (GNU LGPL) which comes with this package. */
* under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include <errno.h>
 #include <sys/time.h> /* struct timeval */
@@ -14,8 +13,8 @@
 #include <sys/socket.h>
 
 #include "gras/Transport/transport_private.h"
-GRAS_LOG_EXTERNAL_CATEGORY(transport);
-GRAS_LOG_DEFAULT_CATEGORY(transport);
+XBT_LOG_EXTERNAL_CATEGORY(transport);
+XBT_LOG_DEFAULT_CATEGORY(transport);
 
 
 
@@ -30,12 +29,12 @@ GRAS_LOG_DEFAULT_CATEGORY(transport);
  *
  * if timeout>0 and no message there, wait at most that amount of time before giving up.
  */
-gras_error_t 
+xbt_error_t 
 gras_trp_select(double timeout,
                gras_socket_t *dst) {
 
-  gras_error_t errcode;
-  gras_dynar_t sockets= gras_socketset_get();
+  xbt_error_t errcode;
+  xbt_dynar_t sockets= gras_socketset_get();
   int done = -1;
   double wakeup = gras_os_time() + 1000000*timeout;
   double now = 0;
@@ -62,7 +61,7 @@ gras_trp_select(double timeout,
 
     /* construct the set of socket to ear from */
     FD_ZERO(&FDS);
-    gras_dynar_foreach(sockets,cursor,sock_iter) {
+    xbt_dynar_foreach(sockets,cursor,sock_iter) {
       if (sock_iter->incoming) {
        if (max_fds < sock_iter->sd)
          max_fds = sock_iter->sd;
@@ -107,7 +106,7 @@ gras_trp_select(double timeout,
        RAISE3(system_error,"invalid select: nb fds: %d, timeout: %d.%d",
               max_fds, (int)tout.tv_sec,(int) tout.tv_usec);
       case ENOMEM: 
-       gras_assert0(0,"Malloc error during the select");
+       xbt_assert0(0,"Malloc error during the select");
       default:
        RAISE2(system_error,"Error during select: %s (%d)",
               strerror(errno),errno);
@@ -117,7 +116,7 @@ gras_trp_select(double timeout,
       continue;         /* this was a timeout */
     }
 
-    gras_dynar_foreach(sockets,cursor,sock_iter) { 
+    xbt_dynar_foreach(sockets,cursor,sock_iter) { 
        if(!FD_ISSET(sock_iter->sd, &FDS)) { /* this socket is not ready */
        continue;
        }
@@ -171,6 +170,6 @@ gras_trp_select(double timeout,
   return timeout_error;
 }
 
-gras_error_t gras_trp_sg_setup(gras_trp_plugin_t *plug) {
+xbt_error_t gras_trp_sg_setup(gras_trp_plugin_t *plug) {
   return mismatch_error;
 }