Constify spf
[exim.git] / src / src / lookups / spf.c
index 2ca4bbab4b5bdb5484d779505e8c7a7c3941801b..8b846ba55cb316edf0236019298c5c52e0989e34 100644 (file)
@@ -1,5 +1,3 @@
-/* $Cambridge: exim/src/src/lookups/spf.c,v 1.3 2009/11/11 14:43:28 nm4 Exp $ */
-
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 *************************************************/
@@ -20,7 +18,9 @@
 #include "../exim.h"
 
 #ifndef EXPERIMENTAL_SPF
-static void dummy(int x) { dummy(x-1); }
+static void dummy(int x);
+static void dummy2(int x) { dummy(x-1); }
+static void dummy(int x) { dummy2(x-1); }
 #else
 
 #include "lf_functions.h"
@@ -31,7 +31,9 @@ static void dummy(int x) { dummy(x-1); }
 #include <spf2/spf_dns_resolv.h>
 #include <spf2/spf_dns_cache.h>
 
-static void *spf_open(uschar *filename, uschar **errmsg) {
+static void *
+spf_open(uschar *filename, uschar **errmsg)
+{
   SPF_server_t *spf_server = NULL;
   spf_server = SPF_server_new(SPF_DNS_CACHE, 0);
   if (spf_server == NULL) {
@@ -41,13 +43,17 @@ static void *spf_open(uschar *filename, uschar **errmsg) {
   return (void *) spf_server;
 }
 
-static void spf_close(void *handle) {
+static void
+spf_close(void *handle)
+{
   SPF_server_t *spf_server = handle;
   if (spf_server) SPF_server_free(spf_server);
 }
 
-static int spf_find(void *handle, uschar *filename, uschar *keystring, int key_len,
-             uschar **result, uschar **errmsg, BOOL *do_cache) {
+static int
+spf_find(void *handle, uschar *filename, const uschar *keystring, int key_len,
+             uschar **result, uschar **errmsg, uint *do_cache)
+{
   SPF_server_t *spf_server = handle;
   SPF_request_t *spf_request = NULL;
   SPF_response_t *spf_response = NULL;
@@ -74,6 +80,24 @@ static int spf_find(void *handle, uschar *filename, uschar *keystring, int key_l
   return OK;
 }
 
+
+/*************************************************
+*         Version reporting entry point          *
+*************************************************/
+
+/* See local README for interface description. */
+
+#include "../version.h"
+
+void
+spf_version_report(FILE *f)
+{
+#ifdef DYNLOOKUP
+fprintf(f, "Library version: SPF: Exim version %s\n", EXIM_VERSION_STR);
+#endif
+}
+
+
 static lookup_info _lookup_info = {
   US"spf",                       /* lookup name */
   0,                             /* not absfile, not query style */
@@ -82,7 +106,8 @@ static lookup_info _lookup_info = {
   spf_find,                      /* find function */
   spf_close,                     /* close function */
   NULL,                          /* no tidy function */
-  NULL                           /* no quoting function */
+  NULL,                          /* no quoting function */
+  spf_version_report             /* version reporting */
 };
 
 #ifdef DYNLOOKUP