Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sanitize around the xbt_host_t typedef; kill the remoteerr mecanism now that we have...
[simgrid.git] / src / amok / base.c
index 8278bb6..fa3b09e 100644 (file)
@@ -1,38 +1,29 @@
 /* $Id$ */
 
-/* gras_addons - several addons to do specific stuff not in GRAS itself     */
+/* base - several addons to do specific stuff not in GRAS itself            */
 
-/* Authors: Martin Quinson                                                  */
-/* Copyright (C) 2003 the OURAGAN project.                                  */
+/* Copyright (c) 2003, 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. */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <gras.h>
-
-void
-grasRepportError (gras_sock_t *sock, gras_msgid_t id, int SeqCount,
-                 const char *severeError,
-                 gras_error_t errcode, const char* format,...) {
-  msgError_t *error;
-  va_list ap;
-
-  if (!(error=(msgError_t*)malloc(sizeof(msgError_t)))) {
-    fprintf(stderr,severeError);
-    return;
-  }
-
-  error->errcode=errcode;
-  va_start(ap,format);
-  vsprintf(error->errmsg,format,ap);
-  va_end(ap);
-
-  /* FIXME: If message id have more than 17 sequences, the following won't work */
-  if (gras_msg_new_and_send(sock,id,SeqCount,   error,1,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0,
-                    NULL,0,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0)) {
-    fprintf(stderr,severeError);
-  }
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "gras.h"
+#include "amok/base.h"
+
+XBT_LOG_NEW_SUBCATEGORY(amok,XBT_LOG_ROOT_CAT,"All AMOK categories");
+
+void amok_base_init(void) {
+  gras_datadesc_type_t host_desc;
+     
+  /* Build the datatype descriptions */
+  host_desc = gras_datadesc_struct("s_xbt_host_t");
+  gras_datadesc_struct_append(host_desc,"name",gras_datadesc_by_name("string"));
+  gras_datadesc_struct_append(host_desc,"exp_size",gras_datadesc_by_name("int"));
+  gras_datadesc_struct_close(host_desc);
+  host_desc = gras_datadesc_ref("xbt_host_t",host_desc);
 }
+
+void amok_base_exit(void) {
+   /* FIXME: No real module mechanism in GRAS so far, nothing to do. */
+}
+