1*54925bf6Swillf 
2*54925bf6Swillf /*
3*54925bf6Swillf  * kadmin/ldap_util/kdb5_ldap_list.h
4*54925bf6Swillf  */
5*54925bf6Swillf 
6*54925bf6Swillf /* Copyright (c) 2004-2005, Novell, Inc.
7*54925bf6Swillf  * All rights reserved.
8*54925bf6Swillf  *
9*54925bf6Swillf  * Redistribution and use in source and binary forms, with or without
10*54925bf6Swillf  * modification, are permitted provided that the following conditions are met:
11*54925bf6Swillf  *
12*54925bf6Swillf  *   * Redistributions of source code must retain the above copyright notice,
13*54925bf6Swillf  *       this list of conditions and the following disclaimer.
14*54925bf6Swillf  *   * Redistributions in binary form must reproduce the above copyright
15*54925bf6Swillf  *       notice, this list of conditions and the following disclaimer in the
16*54925bf6Swillf  *       documentation and/or other materials provided with the distribution.
17*54925bf6Swillf  *   * The copyright holder's name is not used to endorse or promote products
18*54925bf6Swillf  *       derived from this software without specific prior written permission.
19*54925bf6Swillf  *
20*54925bf6Swillf  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21*54925bf6Swillf  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22*54925bf6Swillf  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23*54925bf6Swillf  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24*54925bf6Swillf  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25*54925bf6Swillf  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26*54925bf6Swillf  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27*54925bf6Swillf  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28*54925bf6Swillf  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29*54925bf6Swillf  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30*54925bf6Swillf  * POSSIBILITY OF SUCH DAMAGE.
31*54925bf6Swillf  */
32*54925bf6Swillf 
33*54925bf6Swillf #ifndef _KDB5_LDAP_LIST_H_
34*54925bf6Swillf #define _KDB5_LDAP_LIST_H_
35*54925bf6Swillf 
36*54925bf6Swillf #define MAX_LIST_ENTRIES	64
37*54925bf6Swillf #define END_OF_LIST		-1      /* End of List */
38*54925bf6Swillf #define LIST_DELIMITER		":"     /* List entry separator */
39*54925bf6Swillf #define LIST_MODE_ADD 		0x701   /* Add to the List */
40*54925bf6Swillf #define LIST_MODE_DELETE 	0x702   /* Delete from the list */
41*54925bf6Swillf #define MAX_LEN_LIST_ENTRY 	512     /* Max len of an entry */
42*54925bf6Swillf 
43*54925bf6Swillf extern krb5_error_code krb5_parse_list(char *buffer, char *delimiter, char **list);
44*54925bf6Swillf extern void krb5_free_list_entries(char **list);
45*54925bf6Swillf extern void list_modify_str_array(char ***destlist, const char **sourcelist, int mode);
46*54925bf6Swillf extern int list_modify_int_array(int *destlist, const int *sourcelist, int mode);
47*54925bf6Swillf extern int list_count_str_array(char **list);
48*54925bf6Swillf extern int list_count_int_array(int *list);
49*54925bf6Swillf extern int compare_int(const void*, const void *);
50*54925bf6Swillf 
51*54925bf6Swillf #endif /* _KDB5_LDAP_LIST_H_ */
52