From a40813d896fd929e92969c06229844073d58565d Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 1 Oct 2003 07:11:57 +0000 Subject: *** empty log message *** --- main.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'main.cc') diff --git a/main.cc b/main.cc index b2c2fd6a..78feb961 100644 --- a/main.cc +++ b/main.cc @@ -3,8 +3,10 @@ #include namespace ledger { - extern bool parse_ledger(std::istream& in); - extern bool parse_gnucash(std::istream& in); + extern bool parse_ledger(std::istream& in, bool compute_balances); +#ifdef READ_GNUCASH + extern bool parse_gnucash(std::istream& in, bool compute_balances); +#endif extern void report_balances(int argc, char **argv, std::ostream& out); extern void print_register(int argc, char **argv, std::ostream& out); @@ -188,16 +190,20 @@ int main(int argc, char *argv[]) // Parse the ledger +#ifdef READ_GNUCASH char buf[32]; file->get(buf, 31); file->seekg(0); if (std::strncmp(buf, "", 21) == 0) - parse_gnucash(*file); + parse_gnucash(*file, command == "equity"); else - parse_ledger(*file); +#endif + parse_ledger(*file, command == "equity"); +#ifdef DO_CLEANUP delete file; +#endif // Process the command -- cgit v1.2.3