aboutsummaryrefslogtreecommitdiff
path: root/src/report.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-05-11 12:13:09 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2011-05-11 12:13:09 +0300
commit590e208c40797206fd6a93651fc59e0b68eeb545 (patch)
treed7abd0ca33b3355b1a27760bf9850e445fafd607 /src/report.c
parentdb81e378576dcc5510032c72060e48e562f208c9 (diff)
downloadwydawca-590e208c40797206fd6a93651fc59e0b68eeb545.tar.gz
wydawca-590e208c40797206fd6a93651fc59e0b68eeb545.tar.bz2
Remove obstack.
* src/txtacc.c: New file. * gnulib.modules: Remove obstack. * src/wydawca.h (txtacc_create, txtacc_free) (txtacc_free_string, txtacc_grow) (txtacc_finish): New functions. (txtacc_1grow): New macro.
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 @@
#include "wydawca.h"
-static struct obstack report_stk;
-static int report_stk_inited;
+static struct txtacc *report_acc;
char *report_string;
void
report_init ()
{
- if (!report_stk_inited)
- obstack_init (&report_stk);
+ if (!report_acc)
+ report_acc = txtacc_create ();
else
- obstack_free (&report_stk, report_string);
+ txtacc_free_string (report_acc, report_string);
}
void
@@ -41,8 +40,8 @@ report_add (const char *fmt, ...)
va_end (ap);
if (str)
{
- obstack_grow (&report_stk, str, strlen (str));
- obstack_1grow (&report_stk, '\n');
+ txtacc_grow (report_acc, str, strlen (str));
+ txtacc_1grow (report_acc, '\n');
}
free (str);
}
@@ -50,6 +49,6 @@ report_add (const char *fmt, ...)
void
report_finish ()
{
- obstack_1grow (&report_stk, 0);
- report_string = obstack_finish (&report_stk);
+ txtacc_1grow (report_acc, 0);
+ report_string = txtacc_finish (report_acc);
}

Return to:

Send suggestions and report system problems to the System administrator.