Re: [Exim] local_scan: removing recipients

Góra strony
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
Dla: Jan-Piet Mens
CC: exim-users
Temat: Re: [Exim] local_scan: removing recipients
On Sun, 22 Feb 2004, Jan-Piet Mens wrote:

> According to the documentation in chapter 39, if I want to remove
> a recipient in the local_scan routine, I must delete recipients by
> "removing them from the vector". What exactly does that mean?


It means you must "slide down" the remaining recipients in the vector,
and adjust recipients_count. In other words, if the count is 4 and the
vector contains structures for recipients A, B, C, D and you want to
remove B, you must change the count to 3 and move the data for C and D
so that the vector now is A, C, D.

> Must I free() reserved space, or not?


No.

> Would something like this be okay?


Sorry, no time to check. But you should be able to do it quite simply
using a call to memmove() to "close the gap" in the vector.

--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book:    http://www.uit.co.uk/exim-book