diff options
Diffstat (limited to 'src/wydawca.h')
-rw-r--r-- | src/wydawca.h | 18 |
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 @@ -43,15 +43,12 @@ #include <sysexits.h> #include <mailutils/types.h> #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" #include "grecs.h" #include "wordsplit.h" @@ -169,13 +166,13 @@ struct file_triplet const struct spool *spool; /* Owning spool */ char *relative_dir; /* Directory relative to spool->dest_dir */ char **directive; /* Decoded directive pairs (key: value\0) */ 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; struct uploader_info *uploader; /* Special data for template formatting */ char *project; /* Triplet project name (if known) */ @@ -555,6 +552,19 @@ int tcpwrap_access(int fd); /* userprivs.c */ 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); |