Logging: Add DT= to defer & fail message lines. Bug 322
[exim.git] / src / src / functions.h
index ea3cf257c5f6869043b38a2959b08683c4953520..d5df987966220dda2f1e30d6ee98f3dafbe51a4f 100644 (file)
@@ -906,9 +906,18 @@ return string_sprintf("%s/%s/%s/%s/%s%s",
 
 static inline uschar *
 spool_fname(const uschar * purpose, const uschar * subdir, const uschar * fname,
-               const uschar * suffix)
+       const uschar * suffix)
 {
+#ifdef COMPILE_UTILITY         /* version avoiding string-extension */
+int len = Ustrlen(spool_directory) + 1 + Ustrlen(queue_name) + 1 + Ustrlen(purpose) + 1
+       + Ustrlen(subdir) + 1 + Ustrlen(fname) + Ustrlen(suffix) + 1;
+uschar * buf = store_get(len, FALSE);
+string_format(buf, len, "%s/%s/%s/%s/%s%s",
+       spool_directory, queue_name, purpose, subdir, fname, suffix);
+return buf;
+#else
 return spool_q_fname(purpose, queue_name, subdir, fname, suffix);
+#endif
 }
 
 static inline void
@@ -922,7 +931,7 @@ subdir_str[1] = '\0';
 
 /******************************************************************************/
 static inline void
-timesince(struct timeval * diff, struct timeval * then)
+timesince(struct timeval * diff, const struct timeval * then)
 {
 gettimeofday(diff, NULL);
 diff->tv_sec -= then->tv_sec;
@@ -934,7 +943,7 @@ if ((diff->tv_usec -= then->tv_usec) < 0)
 }
 
 static inline uschar *
-string_timediff(struct timeval * diff)
+string_timediff(const struct timeval * diff)
 {
 static uschar buf[sizeof("0.000s")];
 
@@ -947,7 +956,7 @@ return buf;
 
 
 static inline uschar *
-string_timesince(struct timeval * then)
+string_timesince(const struct timeval * then)
 {
 struct timeval diff;
 timesince(&diff, then);
@@ -955,7 +964,7 @@ return string_timediff(&diff);
 }
 
 static inline void
-report_time_since(struct timeval * t0, uschar * where)
+report_time_since(const struct timeval * t0, const uschar * where)
 {
 # ifdef MEASURE_TIMING
 struct timeval diff;