summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Levin <avi.levin@samsung.com>2015-06-02 13:55:50 +0300
committerAvi Levin <avi.levin@samsung.com>2015-06-02 15:30:11 +0300
commite4ea905a1b10c5c3c9505ec891bdb6c5b57088b9 (patch)
tree8170a0812fe8022828e955c88eac517571bb38e7
parent0814891a3879d999e5bbb08657a176cd031d5477 (diff)
Eolian_info: Adding support in multiple classes in one graph
Now we can put list of classes names/classes paths in the end of the program argument list. The progrm will combine all seperated classes graphs to one.
-rw-r--r--src/bin/main.c57
1 files changed, 31 insertions, 26 deletions
diff --git a/src/bin/main.c b/src/bin/main.c
index 8126c5b..0e81f05 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -225,7 +225,7 @@ static void _print_graph( Eina_Inlist *classes_list)
225 EINA_INLIST_FOREACH_SAFE(classes_list, nnode, node) 225 EINA_INLIST_FOREACH_SAFE(classes_list, nnode, node)
226 { 226 {
227 if(node->parent && node->class) 227 if(node->parent && node->class)
228 fprintf(_file, "\"%s\" -> \"%s\"\n", node->class, node->parent); 228 fprintf(_file, "\"%s\" -> \"%s\"\n", node->parent, node->class);
229 } 229 }
230 230
231 fprintf(_file, "}\n"); 231 fprintf(_file, "}\n");
@@ -289,7 +289,7 @@ static Eina_Inlist* _prints_inherit_tree_mode(const Eolian_Class *ekl, Eina_Inli
289 _push_queue(ekl); 289 _push_queue(ekl);
290 290
291 classes_list = _add_class_edge( 291 classes_list = _add_class_edge(
292 class_name, eolian_class_full_name_get(ekl), classes_list); 292 eolian_class_full_name_get(ekl), class_name, classes_list);
293 } 293 }
294 eina_iterator_free(lst); 294 eina_iterator_free(lst);
295 } 295 }
@@ -315,7 +315,7 @@ static Eina_Inlist* _prints_inherits_from_mode(const Eolian_Class *ekl, Eina_Inl
315 if(ekl_i == class_name){ 315 if(ekl_i == class_name){
316 316
317 classes_list = _add_class_edge( 317 classes_list = _add_class_edge(
318 eolian_class_full_name_get(ekl), class_name, classes_list); 318 class_name, eolian_class_full_name_get(ekl), classes_list);
319 } 319 }
320 } 320 }
321 eina_iterator_free(lst_i); 321 eina_iterator_free(lst_i);
@@ -350,7 +350,6 @@ int main(int argc, char **argv)
350 {"help", no_argument, 0, 'h'}, 350 {"help", no_argument, 0, 'h'},
351 {"mode", required_argument, 0, 'm'}, 351 {"mode", required_argument, 0, 'm'},
352 {"output", required_argument, 0, 'o'}, 352 {"output", required_argument, 0, 'o'},
353 {"class", required_argument, 0, 'c'},
354 {"include", required_argument, 0, 'I'}, 353 {"include", required_argument, 0, 'I'},
355 {"filter", required_argument, 0, 'f'}, 354 {"filter", required_argument, 0, 'f'},
356 {0, 0, 0, 0} 355 {0, 0, 0, 0}
@@ -376,13 +375,6 @@ int main(int argc, char **argv)
376 375
377 break; 376 break;
378 } 377 }
379 case 'c':
380 {
381 // printf("setting class to %s\n", optarg);
382 class_path = optarg;
383
384 break;
385 }
386 case 'I': 378 case 'I':
387 { 379 {
388 const char *dir = optarg; 380 const char *dir = optarg;
@@ -403,6 +395,7 @@ int main(int argc, char **argv)
403 default: help = EINA_TRUE; 395 default: help = EINA_TRUE;
404 } 396 }
405 } 397 }
398 int name_start = optind++, name_end = argc;
406 399
407 if (help) 400 if (help)
408 { 401 {
@@ -452,28 +445,39 @@ int main(int argc, char **argv)
452 { 445 {
453 Eina_Inlist *classes_list = NULL; 446 Eina_Inlist *classes_list = NULL;
454 eolian_all_eo_files_parse(); 447 eolian_all_eo_files_parse();
455 _mode *current_m = _modes; 448 while(name_start < name_end )
456 const Eolian_Class *ekl = eolian_class_get_by_file(class_path);
457
458 if(!ekl)
459 { 449 {
460 ERR("Class %s not found", class_path); 450 char *class_path = argv[name_start++];
461 goto end; 451 _mode *current_m = _modes;
462 } 452 const Eolian_Class *ekl = NULL;
453 if(eina_str_has_extension(class_path, ".eo"))
454 {
455 ekl = eolian_class_get_by_file(class_path);
463 456
464 while(current_m->name_l != NULL ) 457 }
465 { 458 else
459 {
460 ekl = eolian_class_get_by_name(class_path);
461 }
462 if(!ekl)
463 {
464 ERR("Class %s not found", class_path);
465 goto end;
466 }
466 467
467 if(!strcmp(current_m->name_s, mode) || !strcmp(current_m->name_l, mode)) 468 while(current_m->name_l != NULL )
468 { 469 {
469 // printf("found the mode!\n"); 470
470 classes_list = current_m->func(ekl, classes_list); 471 if(!strcmp(current_m->name_s, mode) || !strcmp(current_m->name_l, mode))
471 break; 472 {
473 classes_list = current_m->func(ekl, classes_list);
474 break;
475 }
476
477 current_m++;
472 } 478 }
473 479
474 current_m++;
475 } 480 }
476
477 _file = stdout; 481 _file = stdout;
478 if(output) 482 if(output)
479 { 483 {
@@ -488,6 +492,7 @@ int main(int argc, char **argv)
488 _print_graph(classes_list); 492 _print_graph(classes_list);
489 if(output) 493 if(output)
490 fclose(_file); 494 fclose(_file);
495
491 } 496 }
492 else 497 else
493 { 498 {