aboutsummaryrefslogtreecommitdiff
path: root/src/wydawca.h
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/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')
-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 @@
46#include <mailutils/url.h> 46#include <mailutils/url.h>
47#include <mailutils/errno.h> 47#include <mailutils/errno.h>
48 48
49#define obstack_chunk_alloc malloc
50#define obstack_chunk_free free
51#include "obstack.h"
52#include "error.h" 49#include "error.h"
53#include "xalloc.h" 50#include "xalloc.h"
54#include "backupfile.h" 51#include "backupfile.h"
@@ -172,7 +169,7 @@ struct file_triplet
172 char *blurb; /* Block of directives: directive[i] points here */ 169 char *blurb; /* Block of directives: directive[i] points here */
173 char *tmp; /* Temporary storage */ 170 char *tmp; /* Temporary storage */
174 size_t tmpsize; /* Size of memory allocated in tmp */ 171 size_t tmpsize; /* Size of memory allocated in tmp */
175 struct obstack obstk; /* Obstack for string allocation */ 172 struct txtacc *acc; /* Text accumulator for string allocation */
176 /* User data */ 173 /* User data */
177 size_t uploader_count; 174 size_t uploader_count;
178 struct uploader_info *uploader_list; 175 struct uploader_info *uploader_list;
@@ -558,3 +555,16 @@ int wydawca_userprivs (uid_t uid, gid_t gid, gid_t *grplist, size_t ngrp);
558int push_dir (const char *dirname); 555int push_dir (const char *dirname);
559int pop_dir (void); 556int pop_dir (void);
560char *getcwd_alloc (void); 557char *getcwd_alloc (void);
558
559struct txtacc *txtacc_create (void);
560void txtacc_free (struct txtacc *acc);
561void txtacc_free_string (struct txtacc *acc, char *str);
562void txtacc_grow (struct txtacc *acc, const char *buf, size_t size);
563#define txtacc_1grow(acc, c) \
564 do \
565 { \
566 char __ch = c; \
567 txtacc_grow (acc, &__ch, 1); \
568 } \
569 while (0)
570char *txtacc_finish (struct txtacc *acc);

Return to:

Send suggestions and report system problems to the System administrator.