From e1d0dbf220a5301f6125a1548a380492ad488515 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 9 Nov 2005 07:11:22 +0000 Subject: Restructed the code that it can build and be used as a shared library. The command-line version is still statically bound in the build process by default (for the sake of speed). --- textual.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'textual.cc') diff --git a/textual.cc b/textual.cc index 9b1322b9..a367c01e 100644 --- a/textual.cc +++ b/textual.cc @@ -211,7 +211,7 @@ transaction_t * parse_transaction(char * line, account_t * account) if (amount == note_str) amount = NULL; - *note_str++ = '\0'; + *note_str++ = '\0'; note_str = skip_ws(note_str); if (char * b = std::strchr(note_str, '[')) @@ -231,22 +231,22 @@ transaction_t * parse_transaction(char * line, account_t * account) throw parse_error(path, linenum, "Failed to parse date"); } - xact->note = skip_ws(note_str); - } + xact->note = skip_ws(note_str); + } if (amount) { price = std::strchr(amount, '@'); if (price) { if (price == amount) - throw parse_error(path, linenum, "Cost specified without amount"); + throw parse_error(path, linenum, "Cost specified without amount"); *price++ = '\0'; if (*price == '@') { - per_unit = false; + per_unit = false; price++; - } + } price = skip_ws(price); - } + } } } } @@ -321,7 +321,6 @@ bool parse_transactions(std::istream& in, } namespace { - TIMER_DEF(entry_finish, "finalizing entry"); TIMER_DEF(entry_xacts, "parsing transactions"); TIMER_DEF(entry_details, "parsing entry details"); TIMER_DEF(entry_date, "parsing entry date"); @@ -817,6 +816,7 @@ unsigned int textual_parser_t::parse(std::istream& in, void write_textual_journal(journal_t& journal, std::string path, item_handler& formatter, + const std::string& write_hdr_format, std::ostream& out) { unsigned long index = 0; @@ -859,7 +859,7 @@ void write_textual_journal(journal_t& journal, std::string path, istream_pos_type pos = 0; istream_pos_type jump_to; - format_t hdr_fmt(config.write_hdr_format); + format_t hdr_fmt(write_hdr_format); std::ifstream in(found.c_str()); while (! in.eof()) { -- cgit v1.2.3