xref: /freebsd/contrib/sendmail/libmilter/docs/smfi_setpriv.html (revision f0adf7f5cdd241db2f2c817683191a6ef64a4e95)
1<html>
2<head><title>smfi_setpriv</title></head>
3<body>
4<h1>smfi_setpriv</h1>
5
6<table border="0" cellspacing=4 cellpadding=4>
7<!---------- Synopsis ----------->
8<tr><th valign="top" align=left width=150>SYNOPSIS</th><td>
9<pre>
10#include &lt;libmilter/mfapi.h&gt;
11int smfi_setpriv(
12	SMFICTX *ctx,
13	void *privatedata
14);
15</pre>
16Set the private data pointer for this connection.
17</td></tr>
18
19<!----------- Description ---------->
20<tr><th valign="top" align=left>DESCRIPTION</th><td>
21<table border="1" cellspacing=1 cellpadding=4>
22<tr align="left" valign=top>
23<th width="80">Called When</th>
24<td>smfi_setpriv may be called in any of the xxfi_* callbacks.</td>
25</tr>
26<tr align="left" valign=top>
27<th width="80">Effects</th>
28<td>Sets the private data pointer for the context ctx.</td>
29</tr>
30</table>
31
32<!----------- Arguments ---------->
33<tr><th valign="top" align=left>ARGUMENTS</th><td>
34    <table border="1" cellspacing=0>
35    <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr>
36    <tr valign="top"><td>ctx</td>
37	<td>Opaque context structure.
38	</td></tr>
39    <tr valign="top"><td>privatedata</td>
40	<td>Pointer to private data.  This value will be returned by subsequent calls to <a href="smfi_getpriv.html">smfi_getpriv</a> using ctx.
41	</td></tr>
42    </table>
43</td></tr>
44
45<!----------- Return values ---------->
46<tr>
47<th valign="top" align=left>RETURN VALUES</th>
48
49<td>smfi_setpriv returns MI_FAILURE if ctx is an invalid context.
50Otherwise, it returns MI_SUCCESS.</td>
51</tr>
52
53<tr>
54<th valign="top" align=left>NOTES</th>
55
56<td>There is only one private data pointer per connection; multiple
57calls to smfi_setpriv with different values will cause previous values
58to be lost.
59<P>
60Before a filter terminates it should release the private data
61and set the pointer to NULL.
62</td>
63
64</tr>
65
66</table>
67
68<hr size="1">
69<font size="-1">
70Copyright (c) 2000-2001, 2003 Sendmail, Inc. and its suppliers.
71All rights reserved.
72<br>
73By using this file, you agree to the terms and conditions set
74forth in the LICENSE.
75</font>
76</body>
77</html>
78