3 Copyright 1993, 1998 The Open Group
5 Permission to use, copy, modify, distribute, and sell this software and its
6 documentation for any purpose is hereby granted without fee, provided that
7 the above copyright notice appear in all copies and that both that
8 copyright notice and this permission notice appear in supporting
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 Except as contained in this notice, the name of The Open Group shall not be
22 used in advertising or otherwise to promote the sale, use or other dealings
23 in this Software without prior written authorization from The Open Group.
28 * Author: Ralph Mor, X Consortium
34 #include <X11/SM/SMlib.h>
43 SmFreeProperty(SmProp *prop)
55 for (i = 0; i < prop->num_vals; i++)
56 if (prop->vals[i].value)
57 free ((char *) prop->vals[i].value);
58 free ((char *) prop->vals);
67 * Free reason messages
71 SmFreeReasons(int count, char **reasonMsgs)
77 for (i = 0; i < count; i++)
80 free ((char *) reasonMsgs);
87 * Smc informational functions
91 SmcProtocolVersion(SmcConn smcConn)
93 return (smcConn->proto_major_version);
98 SmcProtocolRevision(SmcConn smcConn)
100 return (smcConn->proto_minor_version);
105 SmcVendor(SmcConn smcConn)
107 char *string = (char *) malloc (strlen (smcConn->vendor) + 1);
109 strcpy (string, smcConn->vendor);
116 SmcRelease(SmcConn smcConn)
118 char *string = (char *) malloc (strlen (smcConn->release) + 1);
120 strcpy (string, smcConn->release);
127 SmcClientID(SmcConn smcConn)
129 char *clientId = (char *) malloc (strlen (smcConn->client_id) + 1);
131 strcpy (clientId, smcConn->client_id);
138 SmcGetIceConnection(SmcConn smcConn)
140 return (smcConn->iceConn);
146 * Sms informational functions
150 SmsProtocolVersion(SmsConn smsConn)
152 return (smsConn->proto_major_version);
157 SmsProtocolRevision(SmsConn smsConn)
159 return (smsConn->proto_minor_version);
164 SmsClientID(SmsConn smsConn)
166 char *clientId = (char *) malloc (strlen (smsConn->client_id) + 1);
168 strcpy (clientId, smsConn->client_id);
175 SmsGetIceConnection(SmsConn smsConn)
177 return (smsConn->iceConn);