Sendmail 8.13.3 Programmer's Guide

Milter APIs
Data Access APIs
Chapter 220
#include <libmilter/mfapi.h>
void* smfi_getpriv(
SMFICTX *ctx
);
Argument
You must call smfi_getpriv() with the argument ctx, which specifies
an opaque context structure.
Return Value
smfi_getpriv() returns the private data pointer stored by an earlier
call to the smfi_setpriv() API, or NULL if none has been set.
The smfi_setpriv() API
You can use smfi_setpriv() to set the private data pointer for a
connection. You can call smfi_setpriv() in any of the xxfi_* callbacks.
The declaration of smfi_setpriv() is as follows:
#include <libmilter/mfapi.h>
int smfi_setpriv(
SMFICTX *ctx,
void *privatedata
);
Only one private data pointer is available per connection; multiple calls
to smfi_setpriv() with different values result in loss of previous
values. Before a filter terminates, it must release the private data and
set the pointer to NULL.
Arguments
You must call smfi_setpriv() with the following arguments:
ctx Specifies the opaque context structure.
privatedata Denotes a pointer to private data. This value is
returned by subsequent calls to the smfi_getpriv()
API using ctx.
Return Values
smfi_setpriv() returns MI_FAILURE if ctx is an invalid context
structure. smfi_setpriv() returns MI_SUCCESS on success.