aboutsummaryrefslogtreecommitdiff
path: root/src/report.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/report.c')
-rw-r--r--src/report.c17
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
19static struct obstack report_stk; 19static struct txtacc *report_acc;
20static int report_stk_inited;
21char *report_string; 20char *report_string;
22 21
23void 22void
24report_init () 23report_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
32void 31void
@@ -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, ...)
50void 49void
51report_finish () 50report_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}

Return to:

Send suggestions and report system problems to the System administrator.