summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-05-03 16:55:59 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-05-03 17:06:49 +0200
commitdb57523e7846a6729f0ca0681e7e998b537e5b81 (patch)
tree8c424d54c287ec05a65530f56dfb2f507cba12a7 /src/bin
parent767631e304b7142669d4f44f13cb97010348de11 (diff)
eolian: refactor parsing API and path handling
This splits the eolian_file_parse API into two, one for parsing files already present in the database (always by filename) and one for parsing paths. It fixes several bugs/leaks on the way (incorrect use of stringshare etc.) as well as adds checking for whether there are no conflicting filenames at scan time, for free. That means it is now no longer possible to scan two paths which have an eo or eot file of the same name in them. It should also be faster now. It also fixes T7820. @fix
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/eolian/main.c2
-rw-r--r--src/bin/eolian_cxx/eolian_cxx.cc4
-rw-r--r--src/bin/eolian_mono/eolian_mono.cc2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/bin/eolian/main.c b/src/bin/eolian/main.c
index 691881f160..0545430eb5 100644
--- a/src/bin/eolian/main.c
+++ b/src/bin/eolian/main.c
@@ -618,7 +618,7 @@ main(int argc, char **argv)
618 } 618 }
619 } 619 }
620 620
621 if (!eolian_state_file_parse(eos, input)) 621 if (!eolian_state_file_path_parse(eos, input))
622 { 622 {
623 fprintf(stderr, "eolian: could not parse file '%s'\n", input); 623 fprintf(stderr, "eolian: could not parse file '%s'\n", input);
624 goto end; 624 goto end;
diff --git a/src/bin/eolian_cxx/eolian_cxx.cc b/src/bin/eolian_cxx/eolian_cxx.cc
index d5e42de830..3774c497a6 100644
--- a/src/bin/eolian_cxx/eolian_cxx.cc
+++ b/src/bin/eolian_cxx/eolian_cxx.cc
@@ -315,7 +315,7 @@ run(options_type const& opts)
315 315
316 for(auto&& name : opts.in_files) 316 for(auto&& name : opts.in_files)
317 { 317 {
318 Eolian_Unit const* unit = ::eolian_state_file_parse(opts.state, name.c_str()); 318 Eolian_Unit const* unit = ::eolian_state_file_path_parse(opts.state, name.c_str());
319 if(!unit) 319 if(!unit)
320 { 320 {
321 EINA_CXX_DOM_LOG_ERR(eolian_cxx::domain) 321 EINA_CXX_DOM_LOG_ERR(eolian_cxx::domain)
@@ -398,7 +398,7 @@ database_load(options_type const& opts)
398 << "No input file."; 398 << "No input file.";
399 assert(false && "Error parsing input file"); 399 assert(false && "Error parsing input file");
400 } 400 }
401 if (!opts.main_header && !::eolian_state_file_parse(opts.state, opts.in_files[0].c_str())) 401 if (!opts.main_header && !::eolian_state_file_path_parse(opts.state, opts.in_files[0].c_str()))
402 { 402 {
403 EINA_CXX_DOM_LOG_ERR(eolian_cxx::domain) 403 EINA_CXX_DOM_LOG_ERR(eolian_cxx::domain)
404 << "Failed parsing: " << opts.in_files[0] << "."; 404 << "Failed parsing: " << opts.in_files[0] << ".";
diff --git a/src/bin/eolian_mono/eolian_mono.cc b/src/bin/eolian_mono/eolian_mono.cc
index 8f24f762f0..e22acb9ce1 100644
--- a/src/bin/eolian_mono/eolian_mono.cc
+++ b/src/bin/eolian_mono/eolian_mono.cc
@@ -261,7 +261,7 @@ database_load(options_type const& opts)
261 << "No input file."; 261 << "No input file.";
262 assert(false && "Error parsing input file"); 262 assert(false && "Error parsing input file");
263 } 263 }
264 if (!::eolian_state_file_parse(opts.state, opts.in_file.c_str())) 264 if (!::eolian_state_file_path_parse(opts.state, opts.in_file.c_str()))
265 { 265 {
266 EINA_CXX_DOM_LOG_ERR(eolian_mono::domain) 266 EINA_CXX_DOM_LOG_ERR(eolian_mono::domain)
267 << "Failed parsing: " << opts.in_file << "."; 267 << "Failed parsing: " << opts.in_file << ".";