Re: [exim] dlfunc yield value protocol

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Jeremy Harris
日付:  
To: exim-users
題目: 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