Mercurial > hg > Game > Cerium
changeset 330:786d0bc9766a draft
change bin/cerium not work
author | aaa |
---|---|
date | Fri, 12 Jun 2009 16:01:14 +0900 |
parents | d3ea1d049230 |
children | 4f2423ed1c86 |
files | bin/cerium |
diffstat | 1 files changed, 12 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/cerium Fri Jun 12 15:29:27 2009 +0900 +++ b/bin/cerium Fri Jun 12 16:01:14 2009 +0900 @@ -7,6 +7,7 @@ my $command = shift; my $main = "main.cc"; my $task_config = "tasks.xml"; +my $cerium_path = "/Users/e065746/Works/lab/hg/Cerium"; if ($command =~ /init/) { &init; @@ -26,13 +27,13 @@ sub init { # setup initial cerium configuration mkdir "Task"; - if (! -e $main ) &make_main; - if (! -e $task_config ) &make_task_config; + if (! -e $main ) { &make_main; } + if (! -e $task_config ) { &make_task_config; } } sub make_main { open(F,">$main") or die("Can't write $main\n"); - print F <<"EOFEOF"; + print F <<'EOFEOF'; #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -42,7 +43,7 @@ extern void task_init(void); const char *usr_help_str = "Usage: ./main [-cpu spe_num] [-count N]\n\ - -cpu Number of SPE (default 1) \n\"; + -cpu Number of SPE (default 1) \n\""; int init(int argc, char **argv) @@ -117,7 +118,7 @@ sub make_main { open(F,">$main") or die("Can't write $main\n"); - print F <<"EOFEOF"; + print F <<'EOFEOF'; #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -188,8 +189,13 @@ sub make { return if ( ! -e $task_config ); + my $xml = XML::LibXML->new(); - my @nodes = $doc->findnodes('//surface'); + my $doc = $parser->parse_file("$cerium_path/lib/tasks.xml"); + my $root = $doc->documentElement(); + for my $e ($root->childNodes) { + print $e->nodeName, "\n"; + } } __END__