]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_mds/lib/mds.h
Security-59754.80.3.tar.gz
[apple/security.git] / OSX / libsecurity_mds / lib / mds.h
1 /*
2 * Copyright (c) 2000-2001,2011,2014 Apple Inc. All Rights Reserved.
3 *
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
8 * using this file.
9 *
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
16 */
17
18
19 /*
20 File: mds.h
21
22 Contains: Module Directory Services Data Types and API.
23
24 Copyright (c) 1999-2000,2011,2014 Apple Inc. All Rights Reserved.
25 */
26
27 #ifndef _MDS_H_
28 #define _MDS_H_ 1
29
30 #include <Security/cssmtype.h>
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 #pragma clang diagnostic push
37 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
38
39 typedef CSSM_DL_HANDLE MDS_HANDLE;
40
41 typedef CSSM_DL_DB_HANDLE MDS_DB_HANDLE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
42
43 typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER mds_funcs {
44 CSSM_RETURN (CSSMAPI *DbOpen)
45 (MDS_HANDLE MdsHandle,
46 const char *DbName,
47 const CSSM_NET_ADDRESS *DbLocation,
48 CSSM_DB_ACCESS_TYPE AccessRequest,
49 const CSSM_ACCESS_CREDENTIALS *AccessCred,
50 const void *OpenParameters,
51 CSSM_DB_HANDLE *hMds);
52
53 CSSM_RETURN (CSSMAPI *DbClose)
54 (MDS_DB_HANDLE MdsDbHandle);
55
56 CSSM_RETURN (CSSMAPI *GetDbNames)
57 (MDS_HANDLE MdsHandle,
58 CSSM_NAME_LIST_PTR *NameList);
59
60 CSSM_RETURN (CSSMAPI *GetDbNameFromHandle)
61 (MDS_DB_HANDLE MdsDbHandle,
62 char **DbName);
63
64 CSSM_RETURN (CSSMAPI *FreeNameList)
65 (MDS_HANDLE MdsHandle,
66 CSSM_NAME_LIST_PTR NameList);
67
68 CSSM_RETURN (CSSMAPI *DataInsert)
69 (MDS_DB_HANDLE MdsDbHandle,
70 CSSM_DB_RECORDTYPE RecordType,
71 const CSSM_DB_RECORD_ATTRIBUTE_DATA *Attributes,
72 const CSSM_DATA *Data,
73 CSSM_DB_UNIQUE_RECORD_PTR *UniqueId);
74
75 CSSM_RETURN (CSSMAPI *DataDelete)
76 (MDS_DB_HANDLE MdsDbHandle,
77 const CSSM_DB_UNIQUE_RECORD *UniqueRecordIdentifier);
78
79 CSSM_RETURN (CSSMAPI *DataModify)
80 (MDS_DB_HANDLE MdsDbHandle,
81 CSSM_DB_RECORDTYPE RecordType,
82 CSSM_DB_UNIQUE_RECORD_PTR UniqueRecordIdentifier,
83 const CSSM_DB_RECORD_ATTRIBUTE_DATA *AttributesToBeModified,
84 const CSSM_DATA *DataToBeModified,
85 CSSM_DB_MODIFY_MODE ModifyMode);
86
87 CSSM_RETURN (CSSMAPI *DataGetFirst)
88 (MDS_DB_HANDLE MdsDbHandle,
89 const CSSM_QUERY *Query,
90 CSSM_HANDLE_PTR ResultsHandle,
91 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
92 CSSM_DATA_PTR Data,
93 CSSM_DB_UNIQUE_RECORD_PTR *UniqueId);
94
95 CSSM_RETURN (CSSMAPI *DataGetNext)
96 (MDS_DB_HANDLE MdsDbHandle,
97 CSSM_HANDLE ResultsHandle,
98 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
99 CSSM_DATA_PTR Data,
100 CSSM_DB_UNIQUE_RECORD_PTR *UniqueId);
101
102 CSSM_RETURN (CSSMAPI *DataAbortQuery)
103 (MDS_DB_HANDLE MdsDbHandle,
104 CSSM_HANDLE ResultsHandle);
105
106 CSSM_RETURN (CSSMAPI *DataGetFromUniqueRecordId)
107 (MDS_DB_HANDLE MdsDbHandle,
108 const CSSM_DB_UNIQUE_RECORD *UniqueRecord,
109 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
110 CSSM_DATA_PTR Data);
111
112 CSSM_RETURN (CSSMAPI *FreeUniqueRecord)
113 (MDS_DB_HANDLE MdsDbHandle,
114 CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord);
115
116 CSSM_RETURN (CSSMAPI *CreateRelation)
117 (MDS_DB_HANDLE MdsDbHandle,
118 CSSM_DB_RECORDTYPE RelationID,
119 const char *RelationName,
120 uint32 NumberOfAttributes,
121 const CSSM_DB_SCHEMA_ATTRIBUTE_INFO *pAttributeInfo,
122 uint32 NumberOfIndexes,
123 const CSSM_DB_SCHEMA_INDEX_INFO *pIndexInfo);
124
125 CSSM_RETURN (CSSMAPI *DestroyRelation)
126 (MDS_DB_HANDLE MdsDbHandle,
127 CSSM_DB_RECORDTYPE RelationID);
128 } MDS_FUNCS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *MDS_FUNCS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
129
130
131 /* MDS Context APIs */
132
133 CSSM_RETURN CSSMAPI
134 MDS_Initialize (const CSSM_GUID *pCallerGuid,
135 const CSSM_MEMORY_FUNCS *pMemoryFunctions,
136 MDS_FUNCS_PTR pDlFunctions,
137 MDS_HANDLE *hMds)
138 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
139
140 CSSM_RETURN CSSMAPI
141 MDS_Terminate (MDS_HANDLE MdsHandle)
142 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
143
144 CSSM_RETURN CSSMAPI
145 MDS_Install (MDS_HANDLE MdsHandle)
146 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
147
148 CSSM_RETURN CSSMAPI
149 MDS_Uninstall (MDS_HANDLE MdsHandle)
150 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
151
152 #pragma clang diagnostic pop
153
154 #ifdef __cplusplus
155 }
156 #endif
157
158 #endif /* _MDS_H_ */