summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2007-05-24 19:03:54 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2007-05-24 19:03:54 (GMT)
commitf5e8d9e76cd34e13b98dfd7b762d48dfc1b7bdc0 (patch) (side-by-side diff)
treecbd29e658e075470df5e4138a8f943345dfd532c
parent63b6aec5433e9610e0b701cf608d234b798a290f (diff)
downloadmailfromd-f5e8d9e76cd34e13b98dfd7b762d48dfc1b7bdc0.tar.gz
mailfromd-f5e8d9e76cd34e13b98dfd7b762d48dfc1b7bdc0.tar.bz2
Minor rename/cleanup
git-svn-id: file:///svnroot/mailfromd/trunk@1473 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/bi_dns.m428
-rw-r--r--src/bi_sprintf.m430
-rw-r--r--src/pp.c2
-rw-r--r--src/prog.c9
-rw-r--r--src/prog.h6
-rw-r--r--src/snarf.m428
6 files changed, 49 insertions, 54 deletions
diff --git a/src/bi_dns.m4 b/src/bi_dns.m4
index c1cad4c..7effbc0 100644
--- a/src/bi_dns.m4
+++ b/src/bi_dns.m4
@@ -81,7 +81,7 @@ MF_DEFUN(dns_getaddr, STRING, STRING string)
&ttl, NULL, 0);
switch (dnstat) {
case dns_success: {
- MF_BEGIN_TEMP_SPACE();
+ MF_OBSTACK_BEGIN();
qsort(ipbuf, ipcount, sizeof ipbuf[0], ipaddr_cmp);
for (i = 0; i < ipcount; i++) {
struct in_addr addr;
@@ -90,11 +90,11 @@ MF_DEFUN(dns_getaddr, STRING, STRING string)
addr.s_addr = ipbuf[i];
q = inet_ntoa(addr);
if (i > 0)
- MF_1GROW_TEMP_SPACE(' ');
- MF_GROW_TEMP_SPACE(q);
+ MF_OBSTACK_1GROW(' ');
+ MF_OBSTACK_GROW(q);
}
- MF_1GROW_TEMP_SPACE(0);
- MF_RETURN_TEMP_SPACE();
+ MF_OBSTACK_1GROW(0);
+ MF_RETURN_OBSTACK();
}
case dns_not_found:
MF_RETURN_STRING("");
@@ -135,15 +135,15 @@ MF_DEFUN(dns_getname, STRING, STRING ipstr)
for (i = 0; i < ncount; i++) {
if (i > 0)
- MF_1GROW_TEMP_SPACE(' ');
- MF_GROW_TEMP_SPACE(names[i]);
+ MF_OBSTACK_1GROW(' ');
+ MF_OBSTACK_GROW(names[i]);
}
- MF_1GROW_TEMP_SPACE(0);
+ MF_OBSTACK_1GROW(0);
for (; i < ncount; i++)
free(names[i]);
- MF_RETURN_TEMP_SPACE();
+ MF_RETURN_OBSTACK();
}
case dns_not_found:
MF_RETURN_STRING("");
@@ -191,15 +191,15 @@ MF_DEFUN(getmx, STRING, STRING domain, OPTIONAL, NUMBER resolve)
else {
int i;
- MF_BEGIN_TEMP_SPACE();
+ MF_OBSTACK_BEGIN();
for (i = 0; i < MAXMXCOUNT && mxbuf[i]; i++) {
if (i > 0)
- MF_1GROW_TEMP_SPACE(' ');
- MF_GROW_TEMP_SPACE(mxbuf[i]);
+ MF_OBSTACK_1GROW(' ');
+ MF_OBSTACK_GROW(mxbuf[i]);
}
- MF_1GROW_TEMP_SPACE(0);
+ MF_OBSTACK_1GROW(0);
dns_freemx(mxbuf);
- MF_RETURN_TEMP_SPACE();
+ MF_RETURN_OBSTACK();
}
}
END
diff --git a/src/bi_sprintf.m4 b/src/bi_sprintf.m4
index 453831d..f25e33c 100644
--- a/src/bi_sprintf.m4
+++ b/src/bi_sprintf.m4
@@ -59,7 +59,7 @@ MF_DEFUN_VARARGS(sprintf, STRING, STRING format)
unsigned prec = 0;
unsigned argnum;
- MF_BEGIN_TEMP_SPACE();
+ MF_OBSTACK_BEGIN();
MF_VA_START();
while (*p) {
unsigned n;
@@ -78,14 +78,14 @@ MF_DEFUN_VARARGS(sprintf, STRING, STRING format)
width = 0;
prec = 0;
} else
- MF_1GROW_TEMP_SPACE(*p);
+ MF_OBSTACK_1GROW(*p);
p++;
break;
case fmts_pos:
/* Expect '%' or an argument position -- %_% or %_2$ */
if (*p == '%') {
- MF_1GROW_TEMP_SPACE('%');
+ MF_OBSTACK_1GROW('%');
p++;
state = fmts_copy;
break;
@@ -232,7 +232,7 @@ MF_DEFUN_VARARGS(sprintf, STRING, STRING format)
str = q;
n = width;
}
- MF_GROW_TEMP_SPACE(str, n);
+ MF_OBSTACK_GROW(str, n);
break;
case 'i':
@@ -272,7 +272,7 @@ MF_DEFUN_VARARGS(sprintf, STRING, STRING format)
if (width && width > n) {
char *q;
- MF_GROW_TEMP_SPACE(NULL, width, q);
+ MF_OBSTACK_GROW(NULL, width, q);
memset(q,
(flags & FMT_PADZERO) ?
'0' : ' ',
@@ -288,7 +288,7 @@ MF_DEFUN_VARARGS(sprintf, STRING, STRING format)
memcpy(q + width - n, str, n);
}
} else
- MF_GROW_TEMP_SPACE(str, n);
+ MF_OBSTACK_GROW(str, n);
break;
case 'u':
@@ -310,7 +310,7 @@ MF_DEFUN_VARARGS(sprintf, STRING, STRING format)
if (width && width > n) {
char *q;
- MF_GROW_TEMP_SPACE(NULL, width, q);
+ MF_OBSTACK_GROW(NULL, width, q);
memset(q,
(flags & FMT_PADZERO) ?
'0' : ' ',
@@ -320,7 +320,7 @@ MF_DEFUN_VARARGS(sprintf, STRING, STRING format)
else
memcpy(q + width - n, str, n);
} else
- MF_GROW_TEMP_SPACE(str, n);
+ MF_OBSTACK_GROW(str, n);
break;
case 'x':
@@ -350,7 +350,7 @@ MF_DEFUN_VARARGS(sprintf, STRING, STRING format)
if (width && width > n) {
char *q;
- MF_GROW_TEMP_SPACE(NULL, width, q);
+ MF_OBSTACK_GROW(NULL, width, q);
memset(q,
(flags & FMT_PADZERO) ?
'0' : ' ',
@@ -367,7 +367,7 @@ MF_DEFUN_VARARGS(sprintf, STRING, STRING format)
memcpy(q + width - n, str, n);
}
} else
- MF_GROW_TEMP_SPACE(str, n);
+ MF_OBSTACK_GROW(str, n);
break;
case 'o':
@@ -393,7 +393,7 @@ MF_DEFUN_VARARGS(sprintf, STRING, STRING format)
if (width && width > n) {
char *q;
- MF_GROW_TEMP_SPACE(NULL, width, q);
+ MF_OBSTACK_GROW(NULL, width, q);
memset(q,
(flags & FMT_PADZERO) ?
'0' : ' ',
@@ -403,20 +403,20 @@ MF_DEFUN_VARARGS(sprintf, STRING, STRING format)
else
memcpy(q + width - n, str, n);
} else
- MF_GROW_TEMP_SPACE(str, n);
+ MF_OBSTACK_GROW(str, n);
break;
default:
- MF_GROW_TEMP_SPACE(start, p - start + 1);
+ MF_OBSTACK_GROW(start, p - start + 1);
}
p++;
state = fmts_copy;
}
}
- MF_1GROW_TEMP_SPACE(0);
+ MF_OBSTACK_1GROW(0);
MF_VA_END();
- MF_RETURN_TEMP_SPACE();
+ MF_RETURN_OBSTACK();
}
END
diff --git a/src/pp.c b/src/pp.c
index 38bf588..ffb9d6a 100644
--- a/src/pp.c
+++ b/src/pp.c
@@ -142,8 +142,6 @@ size_t
pp_fill_buffer(char *buf, size_t size)
{
size_t bufsize = size;
- int c;
- char *linep = NULL;
while (next_line() > 0) {
char *p;
diff --git a/src/prog.c b/src/prog.c
index 1cfda18..07a61f5 100644
--- a/src/prog.c
+++ b/src/prog.c
@@ -538,14 +538,14 @@ heap_tempspace(eval_environ_t env, size_t size)
}
void
-heap_tempspace_begin(eval_environ_t env)
+heap_obstack_begin(eval_environ_t env)
{
env->temp_start = env->toh;
env->temp_size = 0;
}
STKVAL
-heap_tempspace_finish(eval_environ_t env)
+heap_obstack_finish(eval_environ_t env)
{
size_t ret = env->temp_start;
env->temp_start = 0;
@@ -554,10 +554,9 @@ heap_tempspace_finish(eval_environ_t env)
}
void *
-heap_tempspace_grow(eval_environ_t env, void *ptr, size_t size)
+heap_obstack_grow(eval_environ_t env, void *ptr, size_t size)
{
size_t words = B2STACK(size);
- size_t off;
char *ret;
if (words >= env->tos - (env->toh + B2STACK(env->temp_size)))
@@ -1748,8 +1747,6 @@ fixup_code()
void
env_init(eval_environ_t env)
{
- int i;
-
/* Initialize status and registers */
env->status = SMFIS_CONTINUE;
env->tos = datasize + env->stack_size - 1;
diff --git a/src/prog.h b/src/prog.h
index 3a8a7a7..57037e2 100644
--- a/src/prog.h
+++ b/src/prog.h
@@ -41,9 +41,9 @@ STKVAL *env_data_ref(eval_environ_t env, size_t off);
size_t heap_reserve(eval_environ_t env, size_t size);
size_t heap_reserve_words(eval_environ_t env, size_t size);
STKVAL heap_tempspace(eval_environ_t env, size_t size);
-void heap_tempspace_begin(eval_environ_t env);
-STKVAL heap_tempspace_finish(eval_environ_t env);
-void *heap_tempspace_grow(eval_environ_t env, void *ptr, size_t size);
+void heap_obstack_begin(eval_environ_t env);
+STKVAL heap_obstack_finish(eval_environ_t env);
+void *heap_obstack_grow(eval_environ_t env, void *ptr, size_t size);
void pushs(eval_environ_t env, char *s);
void advance_pc(eval_environ_t env, unsigned cnt);
void adjust_stack(eval_environ_t env, unsigned cnt);
diff --git a/src/snarf.m4 b/src/snarf.m4
index 528f8bc..409d48c 100644
--- a/src/snarf.m4
+++ b/src/snarf.m4
@@ -374,30 +374,30 @@ m4_define([<MF_ALLOC_HEAP_TEMP>],[<heap_tempspace(env, $1)>])
m4_define([<MF_COPY_STRING>],[<m4_dnl
strcpy((char*)env_data_ref(env, $1 = heap_reserve(env, strlen($2) + 1)), $2)>])
-/* MF_BEGIN_TEMP_SPACE() - Begin temporary space manipulations
+/* MF_OBSTACK_BEGIN() - Begin temporary space manipulations
* NOTE: No other heap manipulation function can be used between
- * MF_BEGIN_TEMP_SPACE and MF_END_TEMP_SPACE/MF_RETURN_TEMP_SPACE
+ * MF_OBSTACK_BEGIN and MF_OBSTACK_CANCEL/MF_RETURN_OBSTACK
*/
-m4_define([<MF_BEGIN_TEMP_SPACE>],[<heap_tempspace_begin(env)>])
+m4_define([<MF_OBSTACK_BEGIN>],[<heap_obstack_begin(env)>])
-m4_define([<MF_GROW_TEMP_SPACE>],[<m4_dnl
+m4_define([<MF_OBSTACK_GROW>],[<m4_dnl
m4_ifelse($2,,[<
do {
char *__s = $1;
- m4_ifelse($#,3,[<$3 = >])heap_tempspace_grow(env, __s, strlen(__s));
-} while (0)>],[<m4_ifelse($#,3,[<$3 = >])heap_tempspace_grow(env, $1, $2)>])>])
+ m4_ifelse($#,3,[<$3 = >])heap_obstack_grow(env, __s, strlen(__s));
+} while (0)>],[<m4_ifelse($#,3,[<$3 = >])heap_obstack_grow(env, $1, $2)>])>])
-m4_define([<MF_1GROW_TEMP_SPACE>],[<m4_dnl
-do { int __c = $1; heap_tempspace_grow(env, &__c, 1); } while(0)>])
+m4_define([<MF_OBSTACK_1GROW>],[<m4_dnl
+do { int __c = $1; heap_obstack_grow(env, &__c, 1); } while(0)>])
-/* MF_END_TEMP_SPACE - Cancel temporary heap allocation initiated by
- * MF_BEGIN_TEMP_SPACE
- */
-m4_define([<MF_END_TEMP_SPACE>])
+m4_dnl /* MF_OBSTACK_CANCEL - Cancel temporary heap allocation initiated by
+m4_dnl * MF_OBSTACK_BEGIN
+m4_fnl */
+m4_dnl m4_define([<MF_OBSTACK_CANCEL>],[<heap_obstack_cancel(env)>])
-/* MF_RETURN_TEMP_SPACE() - Relocate and return temporary space
+/* MF_RETURN_OBSTACK() - Relocate and return temporary space
*/
-m4_define([<MF_RETURN_TEMP_SPACE>],[<MF_RETURN(heap_tempspace_finish(env))>])
+m4_define([<MF_RETURN_OBSTACK>],[<MF_RETURN(heap_obstack_finish(env))>])
/* MF_VA_START() -- Begin a code section for handing varying number
of arguments. */

Return to:

Send suggestions and report system problems to the System administrator.