X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ff021a73f0cd26b2f27ca729783aa486393f9b3a..8eabc22e75fbfc2367ae381be37d12cfe6986b57:/examples/gras_stub_generator diff --git a/examples/gras_stub_generator b/examples/gras_stub_generator index 63828eb4ec..2791ff51ed 100755 --- a/examples/gras_stub_generator +++ b/examples/gras_stub_generator @@ -9,12 +9,13 @@ # under the terms of the license (GNU LGPL) which comes with this package. use strict; -use warnings; - +eval qq{ + use warnings; +}; # warnings not defined in 5.00503/sun4-solaris sub usage { my ($msg)=@_; - fail ($msg? "gras_stub_generator: $msg\n":""). + die ($msg? "gras_stub_generator: $msg\n":""). "gras_stub_generator: USAGE\n". " gras_stub_generator project_name deployment_file\n" } @@ -45,9 +46,11 @@ $warn #include #include -#include +#include "msg/msg.h" #include +char *gras_log=NULL; + EOF ; foreach (keys %process) { print OUT "int $_(int argc,char *argv[]);\n"; } @@ -57,12 +60,22 @@ print OUT "\n$warn\n"; foreach (keys %process) { print OUT< #include -/* 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 +161,8 @@ $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_process_init(); errcode=$pname(argc,argv); - gras_process_finalize(); - + return errcode; }