| 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" |
| 17 | auth_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 |
| 29 | This 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 |
| 37 | is the |
| 38 | options |
| 39 | field from |
| 40 | authinfo |
| 41 | (which can be |
| 42 | NULL). 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 |
| 46 | pairs. |
| 47 | .PP |
| 48 | |
| 49 | \fBauth_getoption\fR |
| 50 | searches |
| 51 | \fIoptions\fR |
| 52 | for a |
| 53 | \fIkeyword\fR. |
| 54 | .SH "RETURNS" |
| 55 | .PP |
| 56 | If |
| 57 | \fIoptions\fR |
| 58 | does not have the |
| 59 | \fIkeyword\fR, |
| 60 | \fBauth_getoption\fR |
| 61 | returns |
| 62 | NULL |
| 63 | with |
| 64 | \fIerrno\fR |
| 65 | set to |
| 66 | ENOENT. Otherwise |
| 67 | \fBauth_getoption\fR |
| 68 | allocates a buffer for |
| 69 | \fIvalue\fR, and returns it. It is the caller's responsibility to |
| 70 | \fBfree\fR(3) |
| 71 | the returned buffer. |
| 72 | .PP |
| 73 | |
| 74 | \fBauth_getoption\fR |
| 75 | returns |
| 76 | NULL |
| 77 | with |
| 78 | \fIerrno\fR |
| 79 | set to |
| 80 | ENOMEM |
| 81 | if 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 |