summaryrefslogtreecommitdiffabout
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) (unidiff)
treed7abd0ca33b3355b1a27760bf9850e445fafd607
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 (more/less context) (ignore whitespace changes)
-rw-r--r--gnulib.modules1
-rw-r--r--src/Makefile.am1
-rw-r--r--src/builtin.c16
-rw-r--r--src/cmdline.opt24
-rw-r--r--src/directive.c6
-rw-r--r--src/lock.c2
-rw-r--r--src/meta.c26
-rw-r--r--src/report.c17
-rw-r--r--src/triplet.c8
-rw-r--r--src/txtacc.c177
-rw-r--r--src/verify.c6
-rw-r--r--src/wydawca.c1
-rw-r--r--src/wydawca.h18
13 files changed, 242 insertions, 61 deletions
diff --git a/gnulib.modules b/gnulib.modules
index 4eb77a8..dd5124a 100644
--- a/gnulib.modules
+++ b/gnulib.modules
@@ -1,5 +1,4 @@
1xalloc 1xalloc
2obstack
3getline 2getline
4mkdtemp 3mkdtemp
5backupfile 4backupfile
diff --git a/src/Makefile.am b/src/Makefile.am
index 8fd7d94..8139849 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -46,6 +46,7 @@ wydawca_SOURCES=\
46 vtab.c\ 46 vtab.c\
47 null.c\ 47 null.c\
48 timer.c\ 48 timer.c\
49 txtacc.c\
49 report.c 50 report.c
50 51
51BUILT_SOURCES=cmdline.h 52BUILT_SOURCES=cmdline.h
diff --git a/src/builtin.c b/src/builtin.c
index 412a2e7..0a76738 100644
--- a/src/builtin.c
+++ b/src/builtin.c
@@ -149,7 +149,7 @@ parse_cmp_type (const char *pat, strcmp_fn *cmpfn, int *rf)
149 149
150struct builtin_data_storage 150struct builtin_data_storage
151{ 151{
152 struct obstack stk; 152 struct txtacc *acc;
153 char **wp; 153 char **wp;
154}; 154};
155 155
@@ -164,7 +164,7 @@ builtin_lookup (struct dictionary *dict, void *handle, const char *req)
164 int i; 164 int i;
165 int rc; 165 int rc;
166 size_t count = 0; 166 size_t count = 0;
167 struct obstack stk; 167 struct txtacc *acc;
168 int flags = 0; 168 int flags = 0;
169 strcmp_fn cmpfn = cmp_exact; 169 strcmp_fn cmpfn = cmp_exact;
170 struct builtin_data_storage *bds; 170 struct builtin_data_storage *bds;
@@ -176,7 +176,7 @@ builtin_lookup (struct dictionary *dict, void *handle, const char *req)
176 return 0; 176 return 0;
177 } 177 }
178 178
179 obstack_init (&stk); 179 acc = txtacc_create ();
180 180
181 for (i = 0; i < dict->parmc; i++) 181 for (i = 0; i < dict->parmc; i++)
182 { 182 {
@@ -198,7 +198,7 @@ builtin_lookup (struct dictionary *dict, void *handle, const char *req)
198 for (j = 1; j <= ncol; j++) 198 for (j = 1; j <= ncol; j++)
199 { 199 {
200 char *val = dict->parmv[i + j]; 200 char *val = dict->parmv[i + j];
201 obstack_grow (&stk, val, strlen (val) + 1); 201 txtacc_grow (acc, val, strlen (val) + 1);
202 } 202 }
203 count++; 203 count++;
204 } 204 }
@@ -211,7 +211,7 @@ builtin_lookup (struct dictionary *dict, void *handle, const char *req)
211 211
212 if (count == 0) 212 if (count == 0)
213 { 213 {
214 obstack_free (&stk, NULL); 214 txtacc_free (acc);
215 bds = NULL; 215 bds = NULL;
216 rc = 1; 216 rc = 1;
217 } 217 }
@@ -223,8 +223,8 @@ builtin_lookup (struct dictionary *dict, void *handle, const char *req)
223 bds = xmalloc (sizeof (*bds)); 223 bds = xmalloc (sizeof (*bds));
224 count *= ncol; 224 count *= ncol;
225 bds->wp = xcalloc (count, sizeof (bds->wp[0])); 225 bds->wp = xcalloc (count, sizeof (bds->wp[0]));
226 bds->stk = stk; 226 bds->acc = acc;
227 p = obstack_finish (&stk); 227 p = txtacc_finish (acc);
228 228
229 for (i = 0; i < count; i++) 229 for (i = 0; i < count; i++)
230 { 230 {
@@ -245,7 +245,7 @@ builtin_free_result (struct dictionary *dict, void *handle)
245 if (dict->storage) 245 if (dict->storage)
246 { 246 {
247 struct builtin_data_storage *bds = dict->storage; 247 struct builtin_data_storage *bds = dict->storage;
248 obstack_free (&bds->stk, NULL); 248 txtacc_free (bds->acc);
249 free (bds->wp); 249 free (bds->wp);
250 free (bds); 250 free (bds);
251 dict->storage = NULL; 251 dict->storage = NULL;
diff --git a/src/cmdline.opt b/src/cmdline.opt
index 4c3d22f..afa1949 100644
--- a/src/cmdline.opt
+++ b/src/cmdline.opt
@@ -14,8 +14,7 @@
14 You should have received a copy of the GNU General Public License along 14 You should have received a copy of the GNU General Public License along
15 with wydawca. If not, see <http://www.gnu.org/licenses/>. */ 15 with wydawca. If not, see <http://www.gnu.org/licenses/>. */
16 16
17static struct obstack pp_cmd_stack; 17static struct txtacc *pp_cmd_acc;
18static int pp_cmd_stack_init;
19 18
20static struct grecs_list *source_list; 19static struct grecs_list *source_list;
21static struct grecs_list *tag_list; 20static struct grecs_list *tag_list;
@@ -152,19 +151,16 @@ OPTION(define,D,SYMBOL[=VALUE],
152BEGIN 151BEGIN
153 char *p; 152 char *p;
154 153
155 if (!pp_cmd_stack_init) 154 if (!pp_cmd_acc)
156 { 155 pp_cmd_acc = txtacc_create ();
157 obstack_init (&pp_cmd_stack); 156 txtacc_grow (pp_cmd_acc, " \"-D", 4);
158 pp_cmd_stack_init = 1;
159 }
160 obstack_grow (&pp_cmd_stack, " \"-D", 4);
161 for (p = optarg; *p; p++) 157 for (p = optarg; *p; p++)
162 { 158 {
163 if (*p == '\\' || *p == '"') 159 if (*p == '\\' || *p == '"')
164 obstack_1grow (&pp_cmd_stack, '\\'); 160 txtacc_1grow (pp_cmd_acc, '\\');
165 obstack_1grow (&pp_cmd_stack, *p); 161 txtacc_1grow (pp_cmd_acc, *p);
166 } 162 }
167 obstack_1grow (&pp_cmd_stack, '"'); 163 txtacc_1grow (pp_cmd_acc, '"');
168END 164END
169 165
170OPTION(preprocessor,,COMMAND, 166OPTION(preprocessor,,COMMAND,
@@ -213,13 +209,13 @@ void
213parse_options(int argc, char *argv[]) 209parse_options(int argc, char *argv[])
214{ 210{
215 GETOPT(argc, argv) 211 GETOPT(argc, argv)
216 if (pp_cmd_stack_init && grecs_preprocessor) 212 if (pp_cmd_acc && grecs_preprocessor)
217 { 213 {
218 char *defs = obstack_finish (&pp_cmd_stack); 214 char *defs = txtacc_finish (pp_cmd_acc);
219 char *cmd = xmalloc (strlen (grecs_preprocessor) + strlen (defs) + 1); 215 char *cmd = xmalloc (strlen (grecs_preprocessor) + strlen (defs) + 1);
220 strcpy (cmd, grecs_preprocessor); 216 strcpy (cmd, grecs_preprocessor);
221 strcat (cmd, defs); 217 strcat (cmd, defs);
222 grecs_preprocessor = cmd; 218 grecs_preprocessor = cmd;
223 obstack_free (&pp_cmd_stack, NULL); 219 txtacc_free (pp_cmd_acc);
224 } 220 }
225} 221}
diff --git a/src/directive.c b/src/directive.c
index 34e5feb..1f11d77 100644
--- a/src/directive.c
+++ b/src/directive.c
@@ -498,10 +498,10 @@ run_check_script (const char *script, struct file_triplet *trp,
498 size_t len = strlen (buf); 498 size_t len = strlen (buf);
499 if (debug_level > 2) 499 if (debug_level > 2)
500 logmsg (LOG_DEBUG, _("read: %s"), buf); 500 logmsg (LOG_DEBUG, _("read: %s"), buf);
501 obstack_grow (&trp->obstk, buf, len); 501 txtacc_grow (trp->acc, buf, len);
502 total += size; 502 total += size;
503 } 503 }
504 obstack_1grow (&trp->obstk, 0); 504 txtacc_1grow (trp->acc, 0);
505 if (debug_level > 2) 505 if (debug_level > 2)
506 logmsg (LOG_DEBUG, _("bytes read: %lu"), (unsigned long)total); 506 logmsg (LOG_DEBUG, _("bytes read: %lu"), (unsigned long)total);
507 507
@@ -511,7 +511,7 @@ run_check_script (const char *script, struct file_triplet *trp,
511 signal (SIGCHLD, oldsig); 511 signal (SIGCHLD, oldsig);
512 512
513 if (total) 513 if (total)
514 trp->check_diag = obstack_finish (&trp->obstk); 514 trp->check_diag = txtacc_finish (trp->acc);
515 515
516 trp->check_result = status; 516 trp->check_result = status;
517 if (WIFEXITED (status)) 517 if (WIFEXITED (status))
diff --git a/src/lock.c b/src/lock.c
index 9e73463..32367de 100644
--- a/src/lock.c
+++ b/src/lock.c
@@ -176,7 +176,7 @@ static char *
176host_name () 176host_name ()
177{ 177{
178 static char *hostbuf = NULL; 178 static char *hostbuf = NULL;
179 size_t size; 179 size_t size = 0;
180 int rc; 180 int rc;
181 181
182 if (hostbuf) 182 if (hostbuf)
diff --git a/src/meta.c b/src/meta.c
index 30d3041..61dc334 100644
--- a/src/meta.c
+++ b/src/meta.c
@@ -54,26 +54,26 @@ meta_expand_string (const char *string, struct metadef *def, void *data,
54{ 54{
55 const char *p, *s; 55 const char *p, *s;
56 char *res; 56 char *res;
57 struct obstack stk; 57 struct txtacc *acc;
58 58
59 if (!string) 59 if (!string)
60 return NULL; 60 return NULL;
61 61
62 obstack_init (&stk); 62 acc = txtacc_create ();
63 63
64 for (p = string; *p;) 64 for (p = string; *p;)
65 { 65 {
66 char *e; 66 char *e;
67 size_t len = strcspn (p, "$"); 67 size_t len = strcspn (p, "$");
68 68
69 obstack_grow (&stk, p, len); 69 txtacc_grow (acc, p, len);
70 p += len; 70 p += len;
71 if (*p == '$') 71 if (*p == '$')
72 { 72 {
73 switch (*++p) 73 switch (*++p)
74 { 74 {
75 case '$': 75 case '$':
76 obstack_grow (&stk, p, 1); 76 txtacc_grow (acc, p, 1);
77 p++; 77 p++;
78 break; 78 break;
79 79
@@ -92,16 +92,16 @@ meta_expand_string (const char *string, struct metadef *def, void *data,
92 size_t len; 92 size_t len;
93 /* FIXME: Return value? */ 93 /* FIXME: Return value? */
94 dictionary_quote_string (dict, handle, s, &newval, &len); 94 dictionary_quote_string (dict, handle, s, &newval, &len);
95 obstack_grow (&stk, newval, len); 95 txtacc_grow (acc, newval, len);
96 free (newval); 96 free (newval);
97 } 97 }
98 else 98 else
99 obstack_grow (&stk, s, strlen (s)); 99 txtacc_grow (acc, s, strlen (s));
100 p = e + 1; 100 p = e + 1;
101 } 101 }
102 else 102 else
103 { 103 {
104 obstack_grow (&stk, p - 1, 2); 104 txtacc_grow (acc, p - 1, 2);
105 p++; 105 p++;
106 } 106 }
107 break; 107 break;
@@ -121,20 +121,20 @@ meta_expand_string (const char *string, struct metadef *def, void *data,
121 size_t len; 121 size_t len;
122 /* FIXME: Return value? */ 122 /* FIXME: Return value? */
123 dictionary_quote_string (dict, handle, s, &newval, &len); 123 dictionary_quote_string (dict, handle, s, &newval, &len);
124 obstack_grow (&stk, newval, len); 124 txtacc_grow (acc, newval, len);
125 free (newval); 125 free (newval);
126 } 126 }
127 else 127 else
128 obstack_grow (&stk, s, len); 128 txtacc_grow (acc, s, len);
129 p++; 129 p++;
130 } 130 }
131 } 131 }
132 else 132 else
133 obstack_grow (&stk, p, 1); 133 txtacc_grow (acc, p, 1);
134 } 134 }
135 obstack_1grow (&stk, 0); 135 txtacc_1grow (acc, 0);
136 res = xstrdup (obstack_finish (&stk)); 136 res = xstrdup (txtacc_finish (acc));
137 obstack_free (&stk, NULL); 137 txtacc_free (acc);
138 return res; 138 return res;
139} 139}
140 140
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 @@
16 16
17#include "wydawca.h" 17#include "wydawca.h"
18 18
19static struct obstack report_stk; 19static struct txtacc *report_acc;
20static int report_stk_inited;
21char *report_string; 20char *report_string;
22 21
23void 22void
24report_init () 23report_init ()
25{ 24{
26 if (!report_stk_inited) 25 if (!report_acc)
27 obstack_init (&report_stk); 26 report_acc = txtacc_create ();
28 else 27 else
29 obstack_free (&report_stk, report_string); 28 txtacc_free_string (report_acc, report_string);
30} 29}
31 30
32void 31void
@@ -41,8 +40,8 @@ report_add (const char *fmt, ...)
41 va_end (ap); 40 va_end (ap);
42 if (str) 41 if (str)
43 { 42 {
44 obstack_grow (&report_stk, str, strlen (str)); 43 txtacc_grow (report_acc, str, strlen (str));
45 obstack_1grow (&report_stk, '\n'); 44 txtacc_1grow (report_acc, '\n');
46 } 45 }
47 free (str); 46 free (str);
48} 47}
@@ -50,6 +49,6 @@ report_add (const char *fmt, ...)
50void 49void
51report_finish () 50report_finish ()
52{ 51{
53 obstack_1grow (&report_stk, 0); 52 txtacc_1grow (report_acc, 0);
54 report_string = obstack_finish (&report_stk); 53 report_string = txtacc_finish (report_acc);
55} 54}
diff --git a/src/triplet.c b/src/triplet.c
index bfd58e5..c214385 100644
--- a/src/triplet.c
+++ b/src/triplet.c
@@ -54,7 +54,7 @@ hash_triplet_free (void *data)
54 free (tp->directive); 54 free (tp->directive);
55 free (tp->blurb); 55 free (tp->blurb);
56 free (tp->tmp); 56 free (tp->tmp);
57 obstack_free (&tp->obstk, NULL); 57 txtacc_free (tp->acc);
58 58
59 /* Free uploader list */ 59 /* Free uploader list */
60 for (up = tp->uploader_list; up; ) 60 for (up = tp->uploader_list; up; )
@@ -71,8 +71,8 @@ char *
71triplet_strdup (struct file_triplet *tp, const char *str) 71triplet_strdup (struct file_triplet *tp, const char *str)
72{ 72{
73 size_t len = strlen (str); 73 size_t len = strlen (str);
74 obstack_grow (&tp->obstk, str, len + 1); 74 txtacc_grow (tp->acc, str, len + 1);
75 return obstack_finish (&tp->obstk); 75 return txtacc_finish (tp->acc);
76} 76}
77 77
78/* Register a file in the triplet table */ 78/* Register a file in the triplet table */
@@ -105,7 +105,7 @@ register_file (struct file_info *finfo, const struct spool *spool)
105 if (install) 105 if (install)
106 { 106 {
107 ret->spool = spool; 107 ret->spool = spool;
108 obstack_init (&ret->obstk); 108 ret->acc = txtacc_create ();
109 } 109 }
110 ret->file[finfo->type] = *finfo; 110 ret->file[finfo->type] = *finfo;
111} 111}
diff --git a/src/txtacc.c b/src/txtacc.c
new file mode 100644
index 0000000..c094c22
--- a/dev/null
+++ b/src/txtacc.c
@@ -0,0 +1,177 @@
1/* wydawca - automatic release submission daemon
2 Copyright (C) 2007, 2009, 2010 Sergey Poznyakoff
3
4 Wydawca is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 3 of the License, or (at your
7 option) any later version.
8
9 Wydawca is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with wydawca. If not, see <http://www.gnu.org/licenses/>. */
16
17#include "wydawca.h"
18
19struct txtacc_entry
20{
21 char *buf; /* Text buffer */
22 size_t size; /* Buffer size */
23 size_t len; /* Actual number of bytes in buffer */
24};
25#define TXTACC_BUFSIZE 1024
26#define txtacc_entry_freesize(e) ((e)->size - (e)->len)
27
28struct txtacc
29{
30 struct grecs_list *cur; /* Current build list */
31 struct grecs_list *mem; /* List of already allocated elements */
32};
33
34static struct txtacc_entry *
35txtacc_alloc_entry (struct grecs_list *list, size_t size)
36{
37 struct txtacc_entry *p = xmalloc (sizeof (*p));
38 p->buf = xmalloc (size);
39 p->size = size;
40 p->len = 0;
41 grecs_list_append (list, p);
42 return p;
43}
44
45static struct txtacc_entry *
46txtacc_cur_entry (struct txtacc *acc)
47{
48 struct txtacc_entry *ent;
49
50 if (grecs_list_size (acc->cur) == 0)
51 return txtacc_alloc_entry (acc->cur, TXTACC_BUFSIZE);
52 ent = acc->cur->tail->data;
53 if (txtacc_entry_freesize (ent) == 0)
54 ent = txtacc_alloc_entry (acc->cur, TXTACC_BUFSIZE);
55 return ent;
56}
57
58static void
59txtacc_entry_append (struct txtacc_entry *ent, const char *p, size_t size)
60{
61 memcpy (ent->buf + ent->len, p, size);
62 ent->len += size;
63}
64
65static void
66txtacc_entry_tailor (struct txtacc_entry *ent)
67{
68 if (ent->size > ent->len)
69 {
70 char *p = realloc (ent->buf, ent->len);
71 if (!p)
72 return;
73 ent->buf = p;
74 ent->size = ent->len;
75 }
76}
77
78static void
79txtacc_entry_free (void *p)
80{
81 if (p)
82 {
83 struct txtacc_entry *ent = p;
84 free (ent->buf);
85 free (ent);
86 }
87}
88
89struct txtacc *
90txtacc_create ()
91{
92 struct txtacc *acc = xmalloc (sizeof (*acc));
93 acc->cur = grecs_list_create ();
94 acc->cur->free_entry = txtacc_entry_free;
95 acc->mem = grecs_list_create ();
96 acc->mem->free_entry = txtacc_entry_free;
97 return acc;
98}
99
100void
101txtacc_free (struct txtacc *acc)
102{
103 grecs_list_free (acc->cur);
104 grecs_list_free (acc->mem);
105 free (acc);
106}
107
108void
109txtacc_grow (struct txtacc *acc, const char *buf, size_t size)
110{
111 while (size)
112 {
113 struct txtacc_entry *ent = txtacc_cur_entry (acc);
114 size_t rest = txtacc_entry_freesize (ent);
115 if (rest > size)
116 rest = size;
117 txtacc_entry_append (ent, buf, rest);
118 buf += rest;
119 size -= rest;
120 }
121}
122
123char *
124txtacc_finish (struct txtacc *acc)
125{
126 struct grecs_list_entry *ep;
127 struct txtacc_entry *txtent;
128 size_t size;
129
130 switch (grecs_list_size (acc->cur))
131 {
132 case 0:
133 return NULL;
134
135 case 1:
136 txtent = acc->cur->head->data;
137 acc->cur->head->data = NULL;
138 grecs_list_append (acc->mem, txtent);
139 txtacc_entry_tailor (txtent);
140 break;
141
142 default:
143 size = 0;
144 for (ep = acc->cur->head; ep; ep = ep->next)
145 {
146 txtent = ep->data;
147 size += txtent->len;
148 }
149
150 txtent = txtacc_alloc_entry (acc->mem, size);
151 for (ep = acc->cur->head; ep; ep = ep->next)
152 {
153 struct txtacc_entry *tp = ep->data;
154 txtacc_entry_append (txtent, tp->buf, tp->len);
155 }
156 }
157
158 grecs_list_clear (acc->cur);
159 return txtent->buf;
160}
161
162void
163txtacc_free_string (struct txtacc *acc, char *str)
164{
165 struct grecs_list_entry *ep;
166 for (ep = acc->mem->head; ep; ep = ep->next)
167 {
168 struct txtacc_entry *tp = ep->data;
169 if (tp->buf == str)
170 {
171 grecs_list_remove_entry(acc->mem, ep);
172 free (tp->buf);
173 return;
174 }
175 }
176}
177
diff --git a/src/verify.c b/src/verify.c
index 93fd28b..b3233e8 100644
--- a/src/verify.c
+++ b/src/verify.c
@@ -169,9 +169,9 @@ fill_project_name (struct file_triplet *trp)
169 trp->file[file_directive].name); 169 trp->file[file_directive].name);
170 return 1; 170 return 1;
171 } 171 }
172 obstack_grow (&trp->obstk, trp->relative_dir, len); 172 txtacc_grow (trp->acc, trp->relative_dir, len);
173 obstack_1grow (&trp->obstk, 0); 173 txtacc_1grow (trp->acc, 0);
174 trp->project = obstack_finish (&trp->obstk); 174 trp->project = txtacc_finish (trp->acc);
175 } 175 }
176 else 176 else
177 trp->project = trp->relative_dir; 177 trp->project = trp->relative_dir;
diff --git a/src/wydawca.c b/src/wydawca.c
index bda3065..cc1815b 100644
--- a/src/wydawca.c
+++ b/src/wydawca.c
@@ -16,7 +16,6 @@
16 16
17#include "wydawca.h" 17#include "wydawca.h"
18#include "mail.h" 18#include "mail.h"
19#include "argmatch.h"
20 19
21char *program_name; 20char *program_name;
22uid_t wydawca_uid; 21uid_t wydawca_uid;
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.