Debug: feed startup "whats supported" info through normal debug channel
[exim.git] / src / src / lookups / oracle.c
index e22ff8945ec63be32f2b558b523cb0a75225ce56..0429a8f8400439cba9809bc98810247124ef0114 100644 (file)
@@ -3,6 +3,7 @@
 *************************************************/
 
 /* Copyright (c) University of Cambridge 1995 - 2015 */
+/* Copyright (c) The Exim Maintainers 2020 - 2021 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 /* Interface to an Oracle database. This code was originally supplied by
@@ -504,25 +505,24 @@ deferred with a retryable error. */
 
 static int
 oracle_find(void * handle, const uschar * filename, uschar * query, int length,
-  uschar ** result, uschar ** errmsg, uint * do_cache)
+  uschar ** result, uschar ** errmsg, uint * do_cache, const uschar * opts)
 {
 int sep = 0;
 uschar *server;
 uschar *list = oracle_servers;
-uschar buffer[512];
 
 do_cache = do_cache;   /* Placate picky compilers */
 
 DEBUG(D_lookup) debug_printf_indent("ORACLE query: %s\n", query);
 
-while ((server = string_nextinlist(&list, &sep, buffer, sizeof(buffer))) != NULL)
+while ((server = string_nextinlist(&list, &sep, NULL, 0)))
   {
   BOOL defer_break;
   int rc = perform_oracle_search(query, server, result, errmsg, &defer_break);
   if (rc != DEFER || defer_break) return rc;
   }
 
-if (oracle_servers == NULL)
+if (!oracle_servers)
   *errmsg = "no ORACLE servers defined (oracle_servers option)";
 
 return DEFER;
@@ -598,25 +598,26 @@ return quoted;
 
 #include "../version.h"
 
-void
-oracle_version_report(FILE *f)
+gstring *
+oracle_version_report(gstring * g)
 {
 #ifdef DYNLOOKUP
-fprintf(f, "Library version: Oracle: Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g, "Library version: Oracle: Exim version %s\n", EXIM_VERSION_STR);
 #endif
+return g;
 }
 
 
 static lookup_info _lookup_info = {
-  US"oracle",                    /* lookup name */
-  lookup_querystyle,             /* query-style lookup */
-  oracle_open,                   /* open function */
-  NULL,                          /* check function */
-  oracle_find,                   /* find function */
-  NULL,                          /* no close function */
-  oracle_tidy,                   /* tidy function */
-  oracle_quote,                  /* quoting function */
-  oracle_version_report          /* version reporting */
+  .name = US"oracle",                  /* lookup name */
+  .type = lookup_querystyle,           /* query-style lookup */
+  .open = oracle_open,                 /* open function */
+  .check = NULL,                       /* check function */
+  .find = oracle_find,                 /* find function */
+  .close = NULL,                       /* no close function */
+  .tidy = oracle_tidy,                 /* tidy function */
+  .quote = oracle_quote,               /* quoting function */
+  .version_report = oracle_version_report          /* version reporting */
 };
 
 #ifdef DYNLOOKUP