Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
an hexadecimal printer I sometime use for debugging
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 30 May 2005 15:43:33 +0000 (15:43 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 30 May 2005 15:43:33 +0000 (15:43 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1300 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/gras/gras.c

index e4091f8..b920bb0 100644 (file)
@@ -62,3 +62,16 @@ void gras_exit(void) {
   }
   xbt_exit();
 }
   }
   xbt_exit();
 }
+
+hexa_print(const char*name, unsigned char *data, int size) {
+   int i;
+   printf("%s: ", name);
+   for (i=0;i<size;i++)  {
+      if (data[i]<32)// || data[i]>'9')
+       printf("'\\%d'",data[i]);
+      else
+       printf("%c",data[i]);
+   }
+   printf("\n");
+}
+