X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/49324ddce4feba6d5664c40e0fa3817460ca5549..421aa4b3efd1134af2afa1ebb920bb562ee58973:/src/surf/surf_parse.l?ds=sidebyside diff --git a/src/surf/surf_parse.l b/src/surf/surf_parse.l index d0c25da9b4..911124840c 100644 --- a/src/surf/surf_parse.l +++ b/src/surf/surf_parse.l @@ -225,6 +225,30 @@ void surf_parse_trace(tmgr_trace_t *trace) else *trace = tmgr_trace_new(surf_parse_text); } + +void surf_parse_deployment_line(char **host, int *argc, char ***argv) +{ + e_surf_token_t token; + + + /* Parse Host name */ + *host = xbt_strdup(surf_parse_text); + + *argc = 0; + *argv = NULL; + + /* Parse command line */ + while((token = surf_parse())) { + if(token == TOKEN_NEWLINE) return; + xbt_assert1((token == TOKEN_WORD), "Parse error line %d", surf_line_pos); + + (*argc)++; + *argv=xbt_realloc (*argv, (*argc) * sizeof(char*)); + (*argv)[(*argc)-1]=xbt_strdup(surf_parse_text); + } +} + + /* Local variables: */ /* mode: c */ /* End: */