1SLPOpen(3SLP) Service Location Protocol Library Functions SLPOpen(3SLP)
2
3
4
6 SLPOpen - open an SLP handle
7
9 cc [ flag... ] file... -lslp [ library... ]
10 #include <slp.h>
11
12 SLPError SLPOpen(const char *pcLang, SLPBoolean isAsync, SLPHandle *phSLP);
13
14
16 The SLPOpen() function returns a SLPHandle handle in the phSLP parame‐
17 ter for the language locale passed in as the pcLang
18 parameter. The client indicates if operations on the handle are to
19 be synchronous or asynchronous through the isAsync parameter. The
20 handle encapsulates the language locale for SLP requests issued
21 through the handle, and any other resources required by the
22 implementation. SLP properties are not encapsulated by the handle,
23 they are global. The return value of the function is an SLPEr‐
24 ror code indicating the status of the operation. Upon failure,
25 the phSLP parameter is NULL.
26
27
28 An SLPHandle can only be used for one SLP API operation at a time. If
29 the original operation was started asynchronously, any attempt to start
30 an additional operation on the handle while the original operation is
31 pending results in the return of an SLP_HANDLE_IN_USE error from the
32 API function. The SLPClose() function terminates any outstanding
33 calls on the handle.
34
36 pcLang A pointer to an array of characters containing the lan‐
37 guage tag set forth in RFC 1766 for the natural language
38 locale of requests issued on the handle. This parameter
39 cannot be NULL.
40
41
42 isAsync An SLPBoolean indicating whether or not the SLPHandle should
43 be opened for an asynchronous operation.
44
45
46 phSLP A pointer to an SLPHandle in which the open SLPHandle is
47 returned. If an error occurs, the value upon return is NULL.
48
49
51 This function or its callback may return any SLP error code. See the
52 ERRORS section in slp_api(3SLP).
53
55 Example 1 Using SLPOpen()
56
57
58 Use the following example to open a synchronous handle for the German
59 ("de") locale:
60
61
62 SLPHandle HSLP; SLPError err; err = SLPOpen("de", SLP_FALSE, &hSLP)
63
64
66 SLP_CONF_FILE When set, use this file for configuration.
67
68
70 See attributes(5) for descriptions of the following attributes:
71
72
73
74
75 ┌─────────────────────────────┬─────────────────────────────┐
76 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
77 ├─────────────────────────────┼─────────────────────────────┤
78 │Availability │SUNWslpu │
79 └─────────────────────────────┴─────────────────────────────┘
80
82 slpd(1M), slp_api(3SLP), slp.conf(4), slpd.reg(4), attributes(5)
83
84
85 System Administration Guide: Network Services
86
87
88 Alvestrand, H. RFC 1766, Tags for the Identification of Languages. Net‐
89 work Working Group. March 1995.
90
91
92 Kempf, J. and Guttman, E. RFC 2614, An API for Service Location. The
93 Internet Society. June 1999.
94
95
96
97SunOS 5.11 16 Jan 2003 SLPOpen(3SLP)