dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / lib / libidmap / common / directory_private.h
blob2483f26be625970eecfa62e00bcf601a67c04f14
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _DIRECTORY_PRIVATE_H
28 #define _DIRECTORY_PRIVATE_H
31 * A suite of functions for retrieving information about objects
32 * in a directory service.
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
39 #include <sys/types.h>
41 #define DIRECTORY_ID_NAME "n"
42 #define DIRECTORY_ID_USER "u"
43 #define DIRECTORY_ID_GROUP "g"
44 #define DIRECTORY_ID_SID "s"
47 * Structure of the returned data.
48 * Note that this is constructed from the bottom up; what is returned is
49 * a directory_entry_list_t.
51 typedef void *directory_datum_t;
52 typedef directory_datum_t *directory_attribute_value_t;
53 typedef struct {
54 directory_attribute_value_t *attrs;
55 directory_error_t err;
56 } directory_entry_t;
57 typedef directory_entry_t *directory_entry_list_t;
60 * Retrieve information about a user or group. By way of analogy to exec(2),
61 * the _v variants accept a list of attributes as an array, while
62 * the _l variants accept the attribute list as arguments.
63 * All variations accept a list of identifiers, and return a
64 * directory_entry_list_t in the same order. The length of the list of user
65 * identifiers can be specified either explicitly, or by a terminating
66 * NULL if the associated count is zero. Attributes are returned in the
67 * order they were requested, with missing attributes yielding NULL
68 * entries.
70 directory_error_t directory_get_v(directory_t d, directory_entry_list_t *ret,
71 char **ids, int nids, char *types, char **attrlist);
73 directory_error_t directory_get_l(directory_t d, directory_entry_list_t *ret,
74 char **ids, int nids, char *types, char *attr1, ...);
77 * Free the data structure returned by directory_get_by*().
79 * Does nothing if list==NULL.
81 void directory_free(directory_entry_list_t list);
83 /* Return the number of bytes in a directory_datum_t */
84 size_t directory_datum_len(directory_datum_t d);
87 * Search a list, case-insensitively, for a string
89 boolean_t is_in_list(char **list, char *value);
92 * Examine an objectClass list and distill it into a bitmap of "interesting"
93 * classes.
95 uint64_t class_bitmap(char **objectClass);
97 #ifdef __cplusplus
99 #endif
101 #endif /* _DIRECTORY_PRIVATE_H */