Build courier-authlib 0.60.1-1hcoop1.
[hcoop/debian/courier-authlib.git] / auth_getoption.3
CommitLineData
d9898ee8 1.\" <!-- $Id: auth_getoption.sgml,v 1.3 2007/04/01 00:21:34 mrsam Exp $ -->
2.\" <!-- Copyright 2004 Double Precision, Inc. See COPYING for -->
3.\" <!-- distribution information. -->
4.\" Title: auth_getoption
5.\" Author:
6.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
7.\" Date: 04/06/2007
8.\" Manual: Double Precision, Inc.
9.\" Source: Double Precision, Inc.
10.\"
11.TH "AUTH_GETOPTION" "3" "04/06/2007" "Double Precision, Inc." "Double Precision, Inc."
12.\" disable hyphenation
13.nh
14.\" disable justification (adjust text to left margin only)
15.ad l
16.SH "NAME"
17auth_getoption \- Search an option string
18.SH "SYNOPSIS"
19.sp
20.RS 4
21.nf
22#include <courierauth.h>
23.fi
24.RE
25.HP 27
26.BI "char *value=auth_getoption(const\ char\ *" "options" ", const\ char\ *" "keyword" ");"
27.SH "DESCRIPTION"
28.PP
29This is a convenience function for parsing account options, as received by the callback function invoked by
30\fI\fBauth_generic\fR(3)\fR\&[1],
31\fI\fBauth_login\fR(3)\fR\&[2],
32\fI\fBauth_getuserinfo\fR(3)\fR\&[3], and
33\fI\fBauth_passwd\fR(3)\fR\&[4].
34.PP
35
36\fIoptions\fR
37is the
38options
39field from
40authinfo
41(which can be
42NULL). As described in
43\fI\fBauth_generic\fR(3)\fR\&[1]
44(and the others), it is a comma\-separated list of
45\(lq\fIkeyword\fR=\fIvalue\fR\(rq
46pairs.
47.PP
48
49\fBauth_getoption\fR
50searches
51\fIoptions\fR
52for a
53\fIkeyword\fR.
54.SH "RETURNS"
55.PP
56If
57\fIoptions\fR
58does not have the
59\fIkeyword\fR,
60\fBauth_getoption\fR
61returns
62NULL
63with
64\fIerrno\fR
65set to
66ENOENT. Otherwise
67\fBauth_getoption\fR
68allocates a buffer for
69\fIvalue\fR, and returns it. It is the caller's responsibility to
70\fBfree\fR(3)
71the returned buffer.
72.PP
73
74\fBauth_getoption\fR
75returns
76NULL
77with
78\fIerrno\fR
79set to
80ENOMEM
81if it cannot allocate a buffer.
82.SH "SEE ALSO"
83.PP
84
85\fI\fBauthlib\fR(3)\fR\&[5],
86\fI\fBauth_generic\fR(3)\fR\&[1],
87\fI\fBauth_login\fR(3)\fR\&[2],
88\fI\fBauth_getuserinfo\fR(3)\fR\&[3].
89.SH "REFERENCES"
90.IP " 1." 4
91\fBauth_generic\fR(3)
92.RS 4
93\%auth_generic.html
94.RE
95.IP " 2." 4
96\fBauth_login\fR(3)
97.RS 4
98\%auth_login.html
99.RE
100.IP " 3." 4
101\fBauth_getuserinfo\fR(3)
102.RS 4
103\%auth_getuserinfo.html
104.RE
105.IP " 4." 4
106\fBauth_passwd\fR(3)
107.RS 4
108\%auth_passwd.html
109.RE
110.IP " 5." 4
111\fBauthlib\fR(3)
112.RS 4
113\%authlib.html
114.RE