Current File : //usr/share/man/man3slp/SLPParseSrvURL.3slp
'\" te
.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
.TH SLPParseSrvURL 3SLP "16 Jan 2003" "SunOS 5.11" "Service Location Protocol Library Functions"
.SH NAME
SLPParseSrvURL \- parse service URL
.SH SYNOPSIS
.LP
.nf
cc [ \fIflag\fR... ] \fIfile\fR... \fB-lslp\fR [ \fIlibrary\fR... ]
#include <slp.h>

\fBSLPError\fR \fBSLPParseSrvURL\fR(\fBconst char *\fR\fIpcSrvURL\fR, \fBSLPSrvURL**\fR \fIppSrvURL\fR);
.fi

.SH DESCRIPTION
.sp
.LP
The \fBSLPParseSrvURL()\fR routine parses  the \fBURL\fR passed in as the argument into a service \fBURL\fR structure  and returns it  in the  \fIppSrvURL\fR  pointer.    If a parser error occurs,   returns  \fBSLP_PARSE_ERROR\fR. The  structure  returned  in  \fIppSrvURL\fR should  be freed with  \fBSLPFree()\fR.  If  the \fBURL\fR has  no service  part, the  \fBs_pcSrvPart\fR string  is  the empty string, \fB""\fR,  that is, it is not \fINULL\fR. If \fIpcSrvURL\fR  is  not a  service:  URL,  then the  \fBs_pcSrvType\fR field  in  the  returned data  structure  is  the  \fBURL\fR's  scheme,  which might not be the same as the service type  under  which the  \fBURL\fR was  registered.  If  the transport  is  \fBIP\fR, the \fBs_pcNetFamily\fR field is the empty string. 
.sp
.LP
If no error  occurs, the return  value is the  \fBSLP_OK\fR.  Otherwise, if  an error  occurs, one  of the  \fBSLPError\fR  codes  is returned.
.SH PARAMETERS
.sp
.ne 2
.mk
.na
\fB\fIpcSrvURL\fR\fR
.ad
.RS 12n
.rt  
A pointer to  a character buffer  containing the  null  terminated URL string to parse.  It is destructively modified to produce the output structure. It may not be \fINULL\fR.
.RE

.sp
.ne 2
.mk
.na
\fB\fIppSrvURL\fR\fR
.ad
.RS 12n
.rt  
 A pointer to a  ponter for the \fBSLPSrvURL\fR structure  to  receive the parsed \fBURL\fR. It may not be \fINULL\fR.
.RE

.SH ERRORS
.sp
.LP
This function or its callback may return any \fBSLP\fR error code. See the ERRORS section in \fBslp_api\fR(3SLP).
.SH EXAMPLES
.LP
\fBExample 1 \fRUsing \fBSLPParseSrvURL()\fR
.sp
.LP
The following example uses the \fBSLPParseSrvURL()\fR function to parse the service URL \fBservice:printer:lpr://serv/queue1\fR:

.sp
.in +2
.nf
SLPSrvURL* surl;
SLPError err;

err = SLPParseSrvURL("service:printer:lpr://serv/queue1", &surl);
.fi
.in -2

.SH ENVIRONMENT VARIABLES
.sp
.ne 2
.mk
.na
\fB\fBSLP_CONF_FILE\fR\fR
.ad
.RS 17n
.rt  
When set, use this file for configuration.
.RE

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5)  for descriptions of the following attributes:
.sp

.sp
.TS
tab() box;
cw(2.75i) |cw(2.75i) 
lw(2.75i) |lw(2.75i) 
.
ATTRIBUTE TYPEATTRIBUTE VALUE
_
Availabilityservice/network/slp
.TE

.SH SEE ALSO
.sp
.LP
\fBslpd\fR(1M), \fBslp_api\fR(3SLP), \fBslp.conf\fR(4), \fBslpd.reg\fR(4), \fBattributes\fR(5)
.sp
.LP
\fIManaging Service Location Protocol Services in Oracle Solaris 11.3\fR
.sp
.LP
Guttman, E.,  Perkins, C., Veizades, J., and Day, M. \fIRFC 2608, Service Location Protocol, Version 2\fR. The Internet Society. June 1999.
.sp
.LP
Kempf, J. and Guttman, E. \fIRFC 2614, An API for Service Location\fR. The Internet Society. June 1999.