[Tinyos-commits] CVS: tinyos-1.x/tos/lib/VM/languages/motlle/src mate-interface.mt, 1.2, 1.3 mload.mt, 1.2, 1.3

David Gay idgay at users.sourceforge.net
Thu Oct 13 17:21:23 PDT 2005


Update of /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9521

Modified Files:
	mate-interface.mt mload.mt 
Log Message:
MOTLLEHOST env var
nicer mload


Index: mate-interface.mt
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/src/mate-interface.mt,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mate-interface.mt	30 Nov 2004 18:52:43 -0000	1.2
--- mate-interface.mt	14 Oct 2005 00:21:21 -0000	1.3
***************
*** 1,2 ****
--- 1,3 ----
+ any display_error;
  any mvirus_chunk_size;
  any chunk_offset = 6;
***************
*** 173,177 ****
        any compile_errors = make_string_oport();
        any olderr = set_stderr!(compile_errors);
!       any olddisp = set_display_error!(false);
        any compiled = false;
  
--- 174,178 ----
        any compile_errors = make_string_oport();
        any olderr = set_stderr!(compile_errors);
!       any olddisp = set_display_error!(display_error);
        any compiled = false;
  
***************
*** 185,189 ****
  	{
  	  display("compile successful, ");
! 	  sf = open_sf_source("localhost", 9001);
  	  if (sf >= 0)
  	    {
--- 186,192 ----
  	{
  	  display("compile successful, ");
! 	  any host = getenv("MOTLLEHOST");
! 	  if (!host) host = "localhost";
! 	  sf = open_sf_source(host, 9001);
  	  if (sf >= 0)
  	    {

Index: mload.mt
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/src/mload.mt,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mload.mt	30 Nov 2004 18:52:43 -0000	1.2
--- mload.mt	14 Oct 2005 00:21:21 -0000	1.3
***************
*** 1,2 ****
--- 1,12 ----
+ any usage()
+ {
+   pformat(stderr(), "Usage: mload [-h/--help] [-e] [-c] <file or command>\n");
+ }
+ 
+ any injector, mate_compile;
+ 
+ any motlle_debug = getenv("MOTLLEDEBUG");
+ any display_error = motlle_debug != 0;
+ 
  any src = argv[1];
  load(string_append(src, "utils.mt"));
***************
*** 6,18 ****
  load("conf.mt");
  
! set_display_error!(false);
! if (string_cmp("-e", argv[2]) == 0)
!   {
!     if (!qi(argv[3]))
!       error(error_bad_value);
!   }
! else
!   {
!     if (!fi(argv[2]))
!       error(error_bad_value);
!   }
--- 16,54 ----
  load("conf.mt");
  
! set_display_error!(display_error);
! if (display_error) idebug(atoi(motlle_debug));
! 
! any file_or_cmd = false, compiler = file_compile, doinject = injector;
! int len = vector_length(argv);
! 
! for (int i = 2; i < len; i++) 
!   if (argv[i][0] == '-')
!     {
!       if (!string_cmp("-e", argv[i]))
! 	compiler = string_compile;
!       else if (!string_cmp("-c", argv[i]))
! 	doinject = mate_compile;
!       else if (!string_cmp("-h", argv[i]) ||
! 	       !string_cmp("--help", argv[i]))
! 	{
! 	  usage();
! 	  quit();
! 	}
!       else
! 	pformat(stderr(), "Unknown option %s\n", argv[i]);
!     }
!   else
!     {
!       if (file_or_cmd)
! 	{
! 	  pformat(stderr(), "Unexpected argument %s\n", argv[i]);
! 	  usage();
! 	  quit();
! 	}
!       file_or_cmd = argv[i];
!     }
! 
! if (!file_or_cmd)
!   usage();
! else if (!doinject(compiler, file_or_cmd))
!   error(error_bad_value);



More information about the Tinyos-commits mailing list