Tidy input buffer handling
[exim.git] / src / src / globals.c
index f54a2522783b2e8a7913f625a53a46f80e278c12..0109cd711b82cd8ca4ffa4ad12ae4efe0ff004df 100644 (file)
@@ -3,7 +3,7 @@
 *************************************************/
 
 /* Copyright (c) University of Cambridge 1995 - 2018 */
-/* Copyright (c) The Exim Maintainers 2020 */
+/* Copyright (c) The Exim Maintainers 2020 - 2021 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 /* All the global variables are defined together in this one module, so
@@ -171,16 +171,18 @@ incoming TCP/IP. The defaults use stdin. We never need these for any
 stand-alone tests. */
 
 #if !defined(STAND_ALONE) && !defined(MACRO_PREDEF)
-int (*lwr_receive_getc)(unsigned) = stdin_getc;
+int    (*lwr_receive_getc)(unsigned)   = stdin_getc;
 uschar * (*lwr_receive_getbuf)(unsigned *) = NULL;
-int (*lwr_receive_ungetc)(int) = stdin_ungetc;
-int (*receive_getc)(unsigned)  = stdin_getc;
-uschar * (*receive_getbuf)(unsigned *)  = NULL;
-void (*receive_get_cache)(void)= NULL;
-int (*receive_ungetc)(int)     = stdin_ungetc;
-int (*receive_feof)(void)      = stdin_feof;
-int (*receive_ferror)(void)    = stdin_ferror;
-BOOL (*receive_smtp_buffered)(void) = NULL;   /* Only used for SMTP */
+int    (*lwr_receive_ungetc)(int)      = stdin_ungetc;
+BOOL   (*lwr_receive_hasc)(void)       = stdin_hasc;
+
+int    (*receive_getc)(unsigned)       = stdin_getc;
+uschar * (*receive_getbuf)(unsigned *)         = NULL;
+void   (*receive_get_cache)(unsigned)  = NULL;
+BOOL   (*receive_hasc)(void)           = stdin_hasc;
+int    (*receive_ungetc)(int)          = stdin_ungetc;
+int    (*receive_feof)(void)           = stdin_feof;
+int    (*receive_ferror)(void)         = stdin_ferror;
 #endif
 
 
@@ -658,7 +660,7 @@ auth_instance auth_defaults    = {
 
 uschar *auth_defer_msg         = US"reason not recorded";
 uschar *auth_defer_user_msg    = US"";
-uschar *auth_vars[AUTH_VARS];
+const uschar *auth_vars[AUTH_VARS];
 int     auto_thaw              = 0;
 #ifdef WITH_CONTENT_SCAN
 int     av_failed              = FALSE;        /* boolean but accessed as vtype_int*/
@@ -924,7 +926,7 @@ int     expand_level               = 0;             /* Nesting depth, indent for debug */
 int     expand_forbid          = 0;
 int     expand_nlength[EXPAND_MAXN+1];
 int     expand_nmax            = -1;
-uschar *expand_nstring[EXPAND_MAXN+1];
+const uschar *expand_nstring[EXPAND_MAXN+1];
 uschar *expand_string_message;
 uschar *extra_local_interfaces = NULL;
 
@@ -953,7 +955,7 @@ volatile sig_atomic_t had_command_timeout = 0;
 volatile sig_atomic_t had_command_sigterm = 0;
 volatile sig_atomic_t had_data_timeout    = 0;
 volatile sig_atomic_t had_data_sigint     = 0;
-uschar *headers_charset        = US HEADERS_CHARSET;
+const uschar *headers_charset  = US HEADERS_CHARSET;
 int     header_insert_maxlen   = 64 * 1024;
 header_line  *header_last      = NULL;
 header_line  *header_list      = NULL;
@@ -1320,7 +1322,7 @@ const pcre2_code *regex_EARLY_PIPE   = NULL;
 #endif
 const pcre2_code *regex_ismsgid      = NULL;
 const pcre2_code *regex_smtp_code    = NULL;
-uschar *regex_vars[REGEX_VARS];
+const uschar *regex_vars[REGEX_VARS];
 #ifdef WHITELIST_D_MACROS
 const pcre2_code *regex_whitelisted_macro = NULL;
 #endif