From 2f0beaac8c801881a23bdcb5f282e98bdc74b72c Mon Sep 17 00:00:00 2001 From: cxgeorge <> Date: Fri, 3 Aug 2001 20:59:14 +0000 Subject: [PATCH] configrc _db files --- panda/src/chancfg/chancfg.cxx | 25 +++++++++++++++--------- panda/src/chancfg/chancfg_composite1.cxx | 2 -- panda/src/chancfg/chancfg_composite2.cxx | 3 ++- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/panda/src/chancfg/chancfg.cxx b/panda/src/chancfg/chancfg.cxx index 01cb550e7a..bf3158a932 100644 --- a/panda/src/chancfg/chancfg.cxx +++ b/panda/src/chancfg/chancfg.cxx @@ -51,10 +51,14 @@ static void ReadChanConfigData(void) { DSearchPath path(chanconfig.GetString("ETC_PATH", ".")); - Filename layoutfname = Filename::text_filename("layout_db"); + string layoutdbfilename = chanconfig.GetString("layout-db-file","layout_db"); + string windowdbfilename = chanconfig.GetString("window-db-file","window_db"); + string setupdbfilename = chanconfig.GetString("setup-db-file","setup_db"); + + Filename layoutfname = Filename::text_filename(layoutdbfilename); if (!layoutfname.resolve_filename(path)) { - chancfg_cat->error() - << "Could not find " << layoutfname << " in " << path << "\n"; + chancfg_cat->error() << "Could not find layoutdb file " << layoutfname << " in path " << path << "\n"; + exit(1); } else { ifstream ifs; if (layoutfname.open_read(ifs)) { @@ -65,13 +69,14 @@ static void ReadChanConfigData(void) { } else { chancfg_cat->error() << "Unable to read layout database " << layoutfname << "\n"; + exit(1); } } - Filename setupfname = Filename::text_filename("setup_db"); + Filename setupfname = Filename::text_filename(setupdbfilename); if (!setupfname.resolve_filename(path)) { - chancfg_cat->error() - << "Could not find " << setupfname << " in " << path << "\n"; + chancfg_cat->error() << "Could not find setupdb file " << setupfname << " in path " << path << "\n"; + exit(1); } else { ifstream ifs; if (setupfname.open_read(ifs)) { @@ -82,13 +87,14 @@ static void ReadChanConfigData(void) { } else { chancfg_cat->error() << "Unable to read setup database " << setupfname << "\n"; + exit(1); } } - Filename windowfname = Filename::text_filename("window_db"); + Filename windowfname = Filename::text_filename(windowdbfilename); if (!windowfname.resolve_filename(path)) { - chancfg_cat->error() - << "Could not find " << windowfname << " in " << path << "\n"; + chancfg_cat->error() << "Could not find windowdb file " << setupfname << " in path " << path << "\n"; + exit(1); } else { ifstream ifs; if (windowfname.open_read(ifs)) { @@ -99,6 +105,7 @@ static void ReadChanConfigData(void) { } else { chancfg_cat->error() << "Unable to read window database " << windowfname << "\n"; + exit(1); } } } diff --git a/panda/src/chancfg/chancfg_composite1.cxx b/panda/src/chancfg/chancfg_composite1.cxx index 011be866e7..70214f4cb5 100644 --- a/panda/src/chancfg/chancfg_composite1.cxx +++ b/panda/src/chancfg/chancfg_composite1.cxx @@ -1,6 +1,4 @@ #include "chancfg.cxx" -#include "chanlayout.cxx" -#include "chanparse.cxx" diff --git a/panda/src/chancfg/chancfg_composite2.cxx b/panda/src/chancfg/chancfg_composite2.cxx index 1c2ef20886..abc1461cfd 100644 --- a/panda/src/chancfg/chancfg_composite2.cxx +++ b/panda/src/chancfg/chancfg_composite2.cxx @@ -1,4 +1,5 @@ - +#include "chanlayout.cxx" +#include "chanparse.cxx" #include "chansetup.cxx" #include "chanwindow.cxx"