diff options
Diffstat (limited to 'src/report.c')
-rw-r--r-- | src/report.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/report.c b/src/report.c index b09c7c7..929bfff 100644 --- a/src/report.c +++ b/src/report.c | |||
@@ -16,17 +16,16 @@ | |||
16 | 16 | ||
17 | #include "wydawca.h" | 17 | #include "wydawca.h" |
18 | 18 | ||
19 | static struct obstack report_stk; | 19 | static struct txtacc *report_acc; |
20 | static int report_stk_inited; | ||
21 | char *report_string; | 20 | char *report_string; |
22 | 21 | ||
23 | void | 22 | void |
24 | report_init () | 23 | report_init () |
25 | { | 24 | { |
26 | if (!report_stk_inited) | 25 | if (!report_acc) |
27 | obstack_init (&report_stk); | 26 | report_acc = txtacc_create (); |
28 | else | 27 | else |
29 | obstack_free (&report_stk, report_string); | 28 | txtacc_free_string (report_acc, report_string); |
30 | } | 29 | } |
31 | 30 | ||
32 | void | 31 | void |
@@ -41,8 +40,8 @@ report_add (const char *fmt, ...) | |||
41 | va_end (ap); | 40 | va_end (ap); |
42 | if (str) | 41 | if (str) |
43 | { | 42 | { |
44 | obstack_grow (&report_stk, str, strlen (str)); | 43 | txtacc_grow (report_acc, str, strlen (str)); |
45 | obstack_1grow (&report_stk, '\n'); | 44 | txtacc_1grow (report_acc, '\n'); |
46 | } | 45 | } |
47 | free (str); | 46 | free (str); |
48 | } | 47 | } |
@@ -50,6 +49,6 @@ report_add (const char *fmt, ...) | |||
50 | void | 49 | void |
51 | report_finish () | 50 | report_finish () |
52 | { | 51 | { |
53 | obstack_1grow (&report_stk, 0); | 52 | txtacc_1grow (report_acc, 0); |
54 | report_string = obstack_finish (&report_stk); | 53 | report_string = txtacc_finish (report_acc); |
55 | } | 54 | } |