Import Upstream version 0.66.4
[hcoop/debian/courier-authlib.git] / auth_getoption.3
... / ...
CommitLineData
1'\" t
2.\" <!-- Copyright 2004 Double Precision, Inc. See COPYING for -->
3.\" <!-- distribution information. -->
4.\" Title: auth_getoption
5.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
6.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
7.\" Date: 06/20/2015
8.\" Manual: Double Precision, Inc.
9.\" Source: Double Precision, Inc.
10.\" Language: English
11.\"
12.TH "AUTH_GETOPTION" "3" "06/20/2015" "Double Precision, Inc." "Double Precision, Inc."
13.\" -----------------------------------------------------------------
14.\" * Define some portability stuff
15.\" -----------------------------------------------------------------
16.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17.\" http://bugs.debian.org/507673
18.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
19.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20.ie \n(.g .ds Aq \(aq
21.el .ds Aq '
22.\" -----------------------------------------------------------------
23.\" * set default formatting
24.\" -----------------------------------------------------------------
25.\" disable hyphenation
26.nh
27.\" disable justification (adjust text to left margin only)
28.ad l
29.\" -----------------------------------------------------------------
30.\" * MAIN CONTENT STARTS HERE *
31.\" -----------------------------------------------------------------
32.SH "NAME"
33auth_getoption \- Search an option string
34.SH "SYNOPSIS"
35.sp
36.nf
37#include <courierauth\&.h>
38.fi
39.HP \w'char\ *value=auth_getoption('u
40.BI "char *value=auth_getoption(const\ char\ *" "options" ", const\ char\ *" "keyword" ");"
41.SH "DESCRIPTION"
42.PP
43This is a convenience function for parsing account options, as received by the callback function invoked by
44\m[blue]\fB\fBauth_generic\fR(3)\fR\m[]\&\s-2\u[1]\d\s+2,
45\m[blue]\fB\fBauth_login\fR(3)\fR\m[]\&\s-2\u[2]\d\s+2,
46\m[blue]\fB\fBauth_getuserinfo\fR(3)\fR\m[]\&\s-2\u[3]\d\s+2, and
47\m[blue]\fB\fBauth_passwd\fR(3)\fR\m[]\&\s-2\u[4]\d\s+2\&.
48.PP
49\fIoptions\fR
50is the
51\fIoptions\fR
52field from
53authinfo
54(which can be
55NULL)\&. As described in
56\m[blue]\fB\fBauth_generic\fR(3)\fR\m[]\&\s-2\u[1]\d\s+2
57(and the others), it is a comma\-separated list of
58\(lq\fIkeyword\fR=\fIvalue\fR\(rq
59pairs\&.
60.PP
61\fBauth_getoption\fR
62searches
63\fIoptions\fR
64for a
65\fIkeyword\fR\&.
66.SH "RETURNS"
67.PP
68If
69\fIoptions\fR
70does not have the
71\fIkeyword\fR,
72\fBauth_getoption\fR
73returns
74NULL
75with
76\fIerrno\fR
77set to
78ENOENT\&. Otherwise
79\fBauth_getoption\fR
80allocates a buffer for
81\fIvalue\fR, and returns it\&. It is the caller\*(Aqs responsibility to
82\fBfree\fR(3)
83the returned buffer\&.
84.PP
85\fBauth_getoption\fR
86returns
87NULL
88with
89\fIerrno\fR
90set to
91ENOMEM
92if it cannot allocate a buffer\&.
93.SH "SEE ALSO"
94.PP
95\m[blue]\fB\fBauthlib\fR(3)\fR\m[]\&\s-2\u[5]\d\s+2,
96\m[blue]\fB\fBauth_generic\fR(3)\fR\m[]\&\s-2\u[1]\d\s+2,
97\m[blue]\fB\fBauth_login\fR(3)\fR\m[]\&\s-2\u[2]\d\s+2,
98\m[blue]\fB\fBauth_getuserinfo\fR(3)\fR\m[]\&\s-2\u[3]\d\s+2\&.
99.SH "NOTES"
100.IP " 1." 4
101\fBauth_generic\fR(3)
102.RS 4
103\%http://www.courier-mta.org/authlib/auth_generic.html
104.RE
105.IP " 2." 4
106\fBauth_login\fR(3)
107.RS 4
108\%http://www.courier-mta.org/authlib/auth_login.html
109.RE
110.IP " 3." 4
111\fBauth_getuserinfo\fR(3)
112.RS 4
113\%http://www.courier-mta.org/authlib/auth_getuserinfo.html
114.RE
115.IP " 4." 4
116\fBauth_passwd\fR(3)
117.RS 4
118\%http://www.courier-mta.org/authlib/auth_passwd.html
119.RE
120.IP " 5." 4
121\fBauthlib\fR(3)
122.RS 4
123\%http://www.courier-mta.org/authlib/authlib.html
124.RE