Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Generate code compatible with the new interfaces
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 26 Apr 2004 10:14:42 +0000 (10:14 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 26 Apr 2004 10:14:42 +0000 (10:14 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@85 48e7efb5-ca39-0410-a469-dd3cf9ba447f

examples/gras_stub_generator

index 63828eb..0914718 100755 (executable)
@@ -60,7 +60,7 @@ foreach (keys %process) {
 int launch_$_(int argc, char *argv[]) {
   if (gras_process_init()) exit(1);
   $_(argc,argv);
-  if (gras_process_finalize()) exit(1);
+  if (gras_process_exit()) exit(1);
 
   return 0;
 }
@@ -81,7 +81,7 @@ int main (int argc,char *argv[]) {
   /*  Simulation setting */
   MSG_global_init();
   MSG_set_verbosity(MSG_SILENT);
-  MSG_set_channel_number(MAX_CHANNEL);
+  MSG_set_channel_number(GRAS_MAX_CHANNEL);
   MSG_create_environment(argv[1]);
 
   /*  Application deployment */
@@ -115,11 +115,6 @@ $warn
 #include <signal.h>
 #include <gras.h>
 
-/* signal handler for SIGPIPE from NWS */
-void SocketFailure(int sig);
-/* minimum needed from diagnostic.h for initialization, so that we don''t have to ship this file */
-typedef enum {DIAGLOG, DIAGINFO, DIAGWARN, DIAGERROR, DIAGFATAL, DIAGDEBUG} DiagLevels;
-void DirectDiagnostics(DiagLevels level, FILE *whereTo);
 /* user code */
 int $pname(int argc, char *argv[]);
 
@@ -128,19 +123,12 @@ $warn
 int main(int argc, char *argv[]){
   int errcode;
 
-  DirectDiagnostics(DIAGDEBUG, stdout);
-  DirectDiagnostics(DIAGINFO, stdout);
-  DirectDiagnostics(DIAGLOG, stdout);
-  DirectDiagnostics(DIAGWARN, stderr);
-  DirectDiagnostics(DIAGERROR, stderr);
-  DirectDiagnostics(DIAGFATAL, stderr);
-
-  signal(SIGPIPE, SocketFailure);
-
+  gras_init(&argc,argv);
   gras_process_init();
   errcode=$pname(argc,argv);
-  gras_process_finalize();
-
+  gras_process_exit();
+  gras_exit();
   return errcode;
 }