SPDX: Mass-update to GPL-2.0-or-later
[exim.git] / src / src / perl.c
index fbe9ee8427dafb49e471647ab1dac7b1c8038ea2..2a10452d345c0d4affdc461b320d0dcc5ba6dd66 100644 (file)
@@ -2,7 +2,9 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
+/* Copyright (c) The Exim Maintainers 1999 - 2022 */
 /* Copyright (c) 1998 Malcolm Beattie */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 
 /* Modified by PH to get rid of the "na" usage, March 1999.
    Modified further by PH for general tidying for Exim 4.
 /* See the file NOTICE for conditions of use and distribution. */
 
 #include <assert.h>
+
+#define HINTSDB_H
+#define DBFUNCTIONS_H
+
 #include "exim.h"
 
 #define EXIM_TRUE TRUE
@@ -60,8 +66,8 @@ XS(xs_expand_string)
   str = expand_string(US SvPV(ST(0), len));
   ST(0) = sv_newmortal();
   if (str != NULL)
-    sv_setpv(ST(0), (const char *) str);
-  else if (!expand_string_forcedfail)
+    sv_setpv(ST(0), CCS  str);
+  else if (!f.expand_string_forcedfail)
     croak("syntax error in Exim::expand_string argument: %s",
       expand_string_message);
 }
@@ -150,9 +156,8 @@ cleanup_perl(void)
   interp_perl = 0;
 }
 
-uschar *
-call_perl_cat(uschar *yield, int *sizep, int *ptrp, uschar **errstrp,
-  uschar *name, uschar **arg)
+gstring *
+call_perl_cat(gstring * yield, uschar **errstrp, uschar *name, uschar **arg)
 {
   dSP;
   SV *sv;
@@ -186,7 +191,7 @@ call_perl_cat(uschar *yield, int *sizep, int *ptrp, uschar **errstrp,
     return NULL;
     }
   str = US SvPV(sv, len);
-  yield = string_cat(yield, sizep, ptrp, str, (int)len);
+  yield = string_catn(yield, str, (int)len);
   FREETMPS;
   LEAVE;