Merge branch 'debian'
[hcoop/debian/courier-authlib.git] / auth_getoption.3
CommitLineData
b0322a85 1'\" t
d9898ee8 2.\" <!-- Copyright 2004 Double Precision, Inc. See COPYING for -->
3.\" <!-- distribution information. -->
4.\" Title: auth_getoption
b0322a85
CE
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: 08/25/2013
d9898ee8 8.\" Manual: Double Precision, Inc.
9.\" Source: Double Precision, Inc.
b0322a85 10.\" Language: English
d9898ee8 11.\"
b0322a85
CE
12.TH "AUTH_GETOPTION" "3" "08/25/2013" "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.\" -----------------------------------------------------------------
d9898ee8 25.\" disable hyphenation
26.nh
27.\" disable justification (adjust text to left margin only)
28.ad l
b0322a85
CE
29.\" -----------------------------------------------------------------
30.\" * MAIN CONTENT STARTS HERE *
31.\" -----------------------------------------------------------------
d9898ee8 32.SH "NAME"
b0322a85 33auth_getoption \- Search an option string
d9898ee8 34.SH "SYNOPSIS"
35.sp
d9898ee8 36.nf
b0322a85 37#include <courierauth\&.h>
d9898ee8 38.fi
b0322a85 39.HP \w'char\ *value=auth_getoption('u
d9898ee8 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
b0322a85
CE
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\&.
d9898ee8 48.PP
d9898ee8 49\fIoptions\fR
50is the
b0322a85 51\fIoptions\fR
d9898ee8 52field from
53authinfo
54(which can be
b0322a85
CE
55NULL)\&. As described in
56\m[blue]\fB\fBauth_generic\fR(3)\fR\m[]\&\s-2\u[1]\d\s+2
d9898ee8 57(and the others), it is a comma\-separated list of
58\(lq\fIkeyword\fR=\fIvalue\fR\(rq
b0322a85 59pairs\&.
d9898ee8 60.PP
d9898ee8 61\fBauth_getoption\fR
62searches
63\fIoptions\fR
64for a
b0322a85 65\fIkeyword\fR\&.
d9898ee8 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
b0322a85 78ENOENT\&. Otherwise
d9898ee8 79\fBauth_getoption\fR
80allocates a buffer for
b0322a85 81\fIvalue\fR, and returns it\&. It is the caller\*(Aqs responsibility to
d9898ee8 82\fBfree\fR(3)
b0322a85 83the returned buffer\&.
d9898ee8 84.PP
d9898ee8 85\fBauth_getoption\fR
86returns
87NULL
88with
89\fIerrno\fR
90set to
91ENOMEM
b0322a85 92if it cannot allocate a buffer\&.
d9898ee8 93.SH "SEE ALSO"
94.PP
b0322a85
CE
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\&.
8d138742 99.SH "NOTES"
d9898ee8 100.IP " 1." 4
101\fBauth_generic\fR(3)
102.RS 4
b0322a85 103\%[set $man.base.url.for.relative.links]/auth_generic.html
d9898ee8 104.RE
105.IP " 2." 4
106\fBauth_login\fR(3)
107.RS 4
b0322a85 108\%[set $man.base.url.for.relative.links]/auth_login.html
d9898ee8 109.RE
110.IP " 3." 4
111\fBauth_getuserinfo\fR(3)
112.RS 4
b0322a85 113\%[set $man.base.url.for.relative.links]/auth_getuserinfo.html
d9898ee8 114.RE
115.IP " 4." 4
116\fBauth_passwd\fR(3)
117.RS 4
b0322a85 118\%[set $man.base.url.for.relative.links]/auth_passwd.html
d9898ee8 119.RE
120.IP " 5." 4
121\fBauthlib\fR(3)
122.RS 4
b0322a85 123\%[set $man.base.url.for.relative.links]/authlib.html
d9898ee8 124.RE