nightmaremail

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 3bfee62a25825f1dbd87d9420cb833fc2407365f
parent b21142012117318e76d7efc4eadb061966e2b2aa
Author: Rolf Eike Beer <eike@sf-mail.de>
Date:   Mon, 15 Jun 2020 19:42:30 +0200

simplify qmail_puts()

This is what would happen internally anyway, but this way many of the calls can
be optimized away as the string is often constant. It also avoids the code
duplication to implement the function itself.

Diffstat:
Mqmail.c | 5-----
Mqmail.h | 4+++-
2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/qmail.c b/qmail.c @@ -66,11 +66,6 @@ void qmail_put(struct qmail *qq, char *s, size_t len) if (!qq->flagerr) if (substdio_put(&qq->ss,s,len) == -1) qq->flagerr = 1; } -void qmail_puts(qq,s) struct qmail *qq; char *s; -{ - if (!qq->flagerr) if (substdio_puts(&qq->ss,s) == -1) qq->flagerr = 1; -} - void qmail_from(qq,s) struct qmail *qq; char *s; { if (substdio_flush(&qq->ss) == -1) qq->flagerr = 1; diff --git a/qmail.h b/qmail.h @@ -3,6 +3,8 @@ #include "substdio.h" +#include <string.h> + struct qmail { int flagerr; unsigned long pid; @@ -14,7 +16,7 @@ struct qmail { extern int qmail_open(); extern void qmail_put(); -extern void qmail_puts(); +#define qmail_puts(qq,s) qmail_put(qq,s,strlen(s)) extern void qmail_from(); extern void qmail_to(); extern void qmail_fail();