summaryrefslogtreecommitdiff
path: root/main.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2003-10-01 07:11:57 +0000
committerJohn Wiegley <johnw@newartisans.com>2003-10-01 07:11:57 +0000
commita40813d896fd929e92969c06229844073d58565d (patch)
tree055605364d055b20604c8d1423bede9628c2fcce /main.cc
parent68e6b8538e9c6fd39cb5d6ff80c65f3181763413 (diff)
downloadfork-ledger-a40813d896fd929e92969c06229844073d58565d.tar.gz
fork-ledger-a40813d896fd929e92969c06229844073d58565d.tar.bz2
fork-ledger-a40813d896fd929e92969c06229844073d58565d.zip
*** empty log message ***
Diffstat (limited to 'main.cc')
-rw-r--r--main.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/main.cc b/main.cc
index b2c2fd6a..78feb961 100644
--- a/main.cc
+++ b/main.cc
@@ -3,8 +3,10 @@
#include <fstream>
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, "<?xml version=\"1.0\"?>", 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