X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/e3e281ccf9d8777d0df98ddd644720573e0343d1..30a626371573c553bd3c9886b1f9f8e92a0410fd:/src/src/functions.h diff --git a/src/src/functions.h b/src/src/functions.h index 3dd890a00..34a6fb786 100644 --- a/src/src/functions.h +++ b/src/src/functions.h @@ -56,7 +56,7 @@ extern BOOL tls_client_start(client_conn_ctx *, smtp_connect_args *, extern void tls_client_creds_reload(BOOL); extern void tls_close(void *, int); -extern BOOL tls_could_read(void); +extern BOOL tls_could_getc(void); extern void tls_daemon_init(void); extern int tls_daemon_tick(void); extern BOOL tls_dropprivs_validate_require_cipher(BOOL); @@ -236,7 +236,7 @@ extern BOOL dscp_lookup(const uschar *, int, int *, int *, int *); extern void enq_end(uschar *); extern BOOL enq_start(uschar *, unsigned); #ifndef DISABLE_EVENT -extern uschar *event_raise(uschar *, const uschar *, uschar *); +extern uschar *event_raise(uschar *, const uschar *, uschar *, int *); extern void msg_event_raise(const uschar *, const address_item *); #endif @@ -478,7 +478,6 @@ extern void sha1_start(hctx *); extern int sieve_interpret(uschar *, int, uschar *, uschar *, uschar *, uschar *, address_item **, uschar **); extern void sigalrm_handler(int); -extern BOOL smtp_buffered(void); extern void smtp_closedown(uschar *); extern void smtp_command_timeout_exit(void) NORETURN; extern void smtp_command_sigterm_exit(void) NORETURN; @@ -811,11 +810,11 @@ Returns: copy of string in new store, with letters lowercased */ static inline uschar * -string_copylc(const uschar *s) +string_copylc(const uschar * s) { -uschar *ss = store_get(Ustrlen(s) + 1, is_tainted(s)); -uschar *p = ss; -while (*s != 0) *p++ = tolower(*s++); +uschar * ss = store_get(Ustrlen(s) + 1, is_tainted(s)); +uschar * p = ss; +while (*s) *p++ = tolower(*s++); *p = 0; return ss; } @@ -837,7 +836,7 @@ Returns: copy of string in new store, with letters lowercased */ static inline uschar * -string_copynlc(uschar *s, int n) +string_copynlc(uschar * s, int n) { uschar *ss = store_get(n + 1, is_tainted(s)); uschar *p = ss; @@ -1255,6 +1254,14 @@ child_open(uschar **argv, uschar **envp, int newumask, int *infdptr, outfdptr, make_leader, purpose); } +/* Return 1 if fd is usable per pollbits, else 0 */ +static inline int +poll_one_fd(int fd, short pollbits, int tmo_millisec) +{ +struct pollfd p = {.fd = fd, .events = pollbits}; +return poll(&p, 1, tmo_millisec); +} + # endif /* !COMPILE_UTILITY */ /******************************************************************************/