Re: [exim] dlfunc yield value protocol

Top Page
Delete this message
Reply to this message
Author: Jeremy Harris
Date:  
To: exim-users
Subject: Re: [exim] dlfunc yield value protocol
On 24/01/2019 18:13, Ian Zimmerman via Exim-users wrote:
> 2. How can I yield a general, variable string (which implies it needs to
> be freed) ?


The facilities are the same as for local_scan. See the chapter on
that, and use one of the functions documented in local_scan.h


For your purpose, that probably means one of

string_sprintf()
string_copy()
string_copyn()

Those three return a string in freshly-allocated memory. Freeing
is handled for you; it's assumed you're not going overboard
within a single processing phase (I'd not recommend attempting
to prove that ACLs are Turing-complete, nor write a Game-of-Life
program in string expansions).



A brief search found me
https://github.com/snabb/exim-geoipv6-dlfunc/blob/master/exim-geoipv6-dlfunc.c

--
Cheers,
Jeremy