1 /* $Cambridge: exim/src/src/dummies.c,v 1.5 2009/11/16 19:50:36 nm4 Exp $ */
3 /*************************************************
4 * Exim - an Internet mail transport agent *
5 *************************************************/
7 /* Copyright (c) University of Cambridge 1995 - 2009 */
8 /* See the file NOTICE for conditions of use and distribution. */
10 /* This file is not part of the main Exim code. There are little bits of test
11 code for some of Exim's modules, and when they are used, the module they are
12 testing may call other main Exim functions that are not available and/or
13 should not be used in a test. The classic case is log_write(). This module
14 contains dummy versions of such functions - well not really dummies, more like
22 /* We don't have the full Exim headers dragged in, but this function
23 is used for debugging output. */
25 extern int string_vformat(char *, int, char *, va_list);
28 /*************************************************
29 * Handle calls to write the log *
30 *************************************************/
32 /* The message gets written to stderr when log_write() is called from a
33 utility. The message always gets '\n' added on the end of it.
36 selector not relevant when running a utility
37 flags not relevant when running a utility
38 format a printf() format
39 ... arguments for format
45 log_write(unsigned int selector, int flags, char *format, ...)
49 vfprintf(stderr, format, ap);
50 fprintf(stderr, "\n");
52 selector = selector; /* Keep picky compilers happy */
57 /*************************************************
58 * Handle calls to print debug output *
59 *************************************************/
61 /* The message just gets written to stderr
64 format a printf() format
65 ... arguments for format
71 debug_printf(char *format, ...)
78 if (!string_vformat(buffer, sizeof(buffer), format, ap))
80 char *s = "**** debug string overflowed buffer ****\n";
81 char *p = buffer + (int)strlen(buffer);
82 int maxlen = sizeof(buffer) - (int)strlen(s) - 3;
83 if (p > buffer + maxlen) p = buffer + maxlen;
84 if (p > buffer && p[-1] != '\n') *p++ = '\n';
88 fprintf(stderr, "%s", buffer);
95 /*************************************************
97 *************************************************/
99 extern int sigalrm_seen;
102 sigalrm_handler(int sig)
104 sig = sig; /* Keep picky compilers happy */
110 /*************************************************
112 *************************************************/
115 header_checkname(void *h, char *name, int len)
117 h = h; /* Keep picky compilers happy */
124 directory_make(char *parent, char *name, int mode, int panic)
126 parent = parent; /* Keep picky compilers happy */
133 host_build_sender_fullhost(void) { }
135 /* This one isn't needed for test_host */
139 host_ntoa(int type, const void *arg, char *buffer, int *portptr)
141 type = type; /* Keep picky compilers happy */
150 /* End of dummies.c */