diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-05-11 12:13:09 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-05-11 12:13:09 +0300 |
commit | 590e208c40797206fd6a93651fc59e0b68eeb545 (patch) | |
tree | d7abd0ca33b3355b1a27760bf9850e445fafd607 /src/wydawca.h | |
parent | db81e378576dcc5510032c72060e48e562f208c9 (diff) | |
download | wydawca-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.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 | |||
@@ -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); | |||
558 | int push_dir (const char *dirname); | 555 | int push_dir (const char *dirname); |
559 | int pop_dir (void); | 556 | int pop_dir (void); |
560 | char *getcwd_alloc (void); | 557 | char *getcwd_alloc (void); |
558 | |||
559 | struct txtacc *txtacc_create (void); | ||
560 | void txtacc_free (struct txtacc *acc); | ||
561 | void txtacc_free_string (struct txtacc *acc, char *str); | ||
562 | void 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) | ||
570 | char *txtacc_finish (struct txtacc *acc); | ||