2 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
6 #pragma ident "%Z%%M% %I% %E% SMI"
9 * Copyright 1995 by OpenVision Technologies, Inc.
11 * Permission to use, copy, modify, distribute, and sell this software
12 * and its documentation for any purpose is hereby granted without fee,
13 * provided that the above copyright notice appears in all copies and
14 * that both that copyright notice and this permission notice appear in
15 * supporting documentation, and that the name of OpenVision not be used
16 * in advertising or publicity pertaining to distribution of the software
17 * without specific, written prior permission. OpenVision makes no
18 * representations about the suitability of this software for any
19 * purpose. It is provided "as is" without express or implied warranty.
21 * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
22 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
23 * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
24 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
25 * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
26 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
27 * PERFORMANCE OF THIS SOFTWARE.
31 * $Id: util_set.c 16165 2004-03-14 05:31:43Z raeburn $
34 #include <mechglueP.h> /* SUNW15resync - for MALLOC/FREE */
35 #include "gssapiP_generic.h"
40 struct _g_set_elt
*next
;
43 int g_set_init(g_set_elt
*s
)
51 int g_set_destroy(g_set_elt
*s
)
57 FREE(*s
, sizeof(struct _g_set
));
65 int g_set_entry_add(g_set_elt
*s
, void *key
, void *value
)
69 if ((first
= (struct _g_set_elt
*) MALLOC(sizeof(struct _g_set_elt
))) == NULL
)
81 int g_set_entry_delete(g_set_elt
*s
, void *key
)
85 for (p
=s
; *p
; p
= &((*p
)->next
)) {
86 if ((*p
)->key
== key
) {
87 g_set_elt next
= (*p
)->next
;
88 FREE(*p
, sizeof(struct _g_set_elt
));
98 int g_set_entry_get(g_set_elt
*s
, void *key
, void **value
)
102 for (p
= *s
; p
; p
= p
->next
) {