summaryrefslogtreecommitdiffabout
path: root/src/wydawca.h
authorSergey Poznyakoff <gray@gnu.org.ua>2011-05-11 09:13:09 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2011-05-11 09:13:09 (GMT)
commit590e208c40797206fd6a93651fc59e0b68eeb545 (patch) (side-by-side diff)
treed7abd0ca33b3355b1a27760bf9850e445fafd607 /src/wydawca.h
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/wydawca.h') (more/less context) (ignore whitespace changes)
-rw-r--r--src/wydawca.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/wydawca.h b/src/wydawca.h
index 8d5dd34..ef1ff86 100644
--- a/src/wydawca.h
+++ b/src/wydawca.h
@@ -46,9 +46,6 @@
#include <mailutils/url.h>
#include <mailutils/errno.h>
-#define obstack_chunk_alloc malloc
-#define obstack_chunk_free free
-#include "obstack.h"
#include "error.h"
#include "xalloc.h"
#include "backupfile.h"
@@ -172,7 +169,7 @@ struct file_triplet
char *blurb; /* Block of directives: directive[i] points here */
char *tmp; /* Temporary storage */
size_t tmpsize; /* Size of memory allocated in tmp */
- struct obstack obstk; /* Obstack for string allocation */
+ struct txtacc *acc; /* Text accumulator for string allocation */
/* User data */
size_t uploader_count;
struct uploader_info *uploader_list;
@@ -558,3 +555,16 @@ int wydawca_userprivs (uid_t uid, gid_t gid, gid_t *grplist, size_t ngrp);
int push_dir (const char *dirname);
int pop_dir (void);
char *getcwd_alloc (void);
+
+struct txtacc *txtacc_create (void);
+void txtacc_free (struct txtacc *acc);
+void txtacc_free_string (struct txtacc *acc, char *str);
+void txtacc_grow (struct txtacc *acc, const char *buf, size_t size);
+#define txtacc_1grow(acc, c) \
+ do \
+ { \
+ char __ch = c; \
+ txtacc_grow (acc, &__ch, 1); \
+ } \
+ while (0)
+char *txtacc_finish (struct txtacc *acc);

Return to:

Send suggestions and report system problems to the System administrator.