From: quasar Date: Fri, 26 Oct 2007 18:52:39 +0000 (+0000) Subject: Let's be brutal since we fail to understand the problem: time to get some food&sleep X-Git-Tag: v3.3~917 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/0e16ef4c4c660214ac42b733a0abc6f6c12e9ef3?ds=inline Let's be brutal since we fail to understand the problem: time to get some food&sleep git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4885 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index 53dd960ba6..fa7e68167f 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -295,8 +295,9 @@ void surfxml_add_callback(xbt_dynar_t cb_list, void_f_void_t function) void surfxml_call_cb_functions(xbt_dynar_t cb_list) { int iterator; - void_f_void_t data; - xbt_dynar_foreach(cb_list, iterator, data){ - (*data)(); + void_f_void_t fun; + xbt_dynar_foreach(cb_list, iterator, fun){ + DEBUG2("call %p %p",fun,*fun); + (*fun)(); } } diff --git a/tools/gras/stub_generator.c b/tools/gras/stub_generator.c index f7c10aefe8..fbba2fffb3 100644 --- a/tools/gras/stub_generator.c +++ b/tools/gras/stub_generator.c @@ -81,6 +81,11 @@ static void parse_process_finalize(void) /*VERB1("Function: %s",process.argv[0]);*/ } +void surfxml_add_callback(xbt_dynar_t cb_list, void_f_void_t function) +{ + xbt_dynar_push(cb_list, &function); +} + int main(int argc, char *argv[]) { @@ -116,9 +121,11 @@ int main(int argc, char *argv[]) project_name = argv[1]; - STag_surfxml_process_fun = parse_process_init; - ETag_surfxml_argument_fun = parse_argument; - ETag_surfxml_process_fun = parse_process_finalize; + surf_parse_reset_parser(); + DEBUG2("%p %p",parse_process_init,&parse_process_init); + surfxml_add_callback(STag_surfxml_process_cb_list, &parse_process_init); + surfxml_add_callback(ETag_surfxml_argument_cb_list, &parse_argument); + surfxml_add_callback(ETag_surfxml_process_cb_list, &parse_process_finalize); for(i=2; i