@@ -47,9 +47,9 @@ INDEXSTOREDB_BEGIN_DECLS
47
47
typedef void * indexstoredb_object_t ;
48
48
typedef indexstoredb_object_t indexstoredb_index_t ;
49
49
typedef indexstoredb_object_t indexstoredb_indexstore_library_t ;
50
- typedef indexstoredb_object_t indexstoredb_symbol_t ;
51
- typedef indexstoredb_object_t indexstoredb_symbol_occurrence_t ;
52
50
51
+ typedef void * indexstoredb_symbol_t ;
52
+ typedef void * indexstoredb_symbol_occurrence_t ;
53
53
typedef void * indexstoredb_error_t ;
54
54
typedef void * indexstoredb_symbol_location_t ;
55
55
typedef void * indexstoredb_symbol_relation_t ;
@@ -121,6 +121,9 @@ typedef bool(^indexstoredb_symbol_occurrence_receiver_t)(_Nonnull indexstoredb_s
121
121
/// Returns true to continue.
122
122
typedef bool (^indexstoredb_symbol_name_receiver )(const char * _Nonnull);
123
123
124
+ /// Creates an index for the given raw index data in \p storePath.
125
+ ///
126
+ /// The resulting index must be released using \c indexstoredb_release.
124
127
INDEXSTOREDB_PUBLIC _Nullable
125
128
indexstoredb_index_t
126
129
indexstoredb_index_create (const char * _Nonnull storePath ,
@@ -130,6 +133,9 @@ indexstoredb_index_create(const char * _Nonnull storePath,
130
133
bool listenToUnitEvents ,
131
134
indexstoredb_error_t _Nullable * _Nullable );
132
135
136
+ /// Creates an indexstore library for the given library.
137
+ ///
138
+ /// The resulting object must be released using \c indexstoredb_release.
133
139
INDEXSTOREDB_PUBLIC _Nullable
134
140
indexstoredb_indexstore_library_t
135
141
indexstoredb_load_indexstore_library (const char * _Nonnull dylibPath ,
@@ -139,95 +145,129 @@ indexstoredb_load_indexstore_library(const char * _Nonnull dylibPath,
139
145
INDEXSTOREDB_PUBLIC void
140
146
indexstoredb_index_poll_for_unit_changes_and_wait (_Nonnull indexstoredb_index_t index );
141
147
148
+ /// Iterates over each symbol occurrence matching the given \p usr and \p roles.
149
+ ///
150
+ /// The occurrence passed to the receiver is only valid for the duration of the
151
+ /// receiver call.
142
152
INDEXSTOREDB_PUBLIC bool
143
153
indexstoredb_index_symbol_occurrences_by_usr (
144
154
_Nonnull indexstoredb_index_t index ,
145
155
const char * _Nonnull usr ,
146
156
uint64_t roles ,
147
157
_Nonnull indexstoredb_symbol_occurrence_receiver_t );
148
158
159
+ /// Iterates over each symbol occurrence related to the \p usr with \p roles.
160
+ ///
161
+ /// The occurrence passed to the receiver is only valid for the duration of the
162
+ /// receiver call.
149
163
INDEXSTOREDB_PUBLIC bool
150
164
indexstoredb_index_related_symbol_occurrences_by_usr (
151
165
_Nonnull indexstoredb_index_t index ,
152
166
const char * _Nonnull usr ,
153
167
uint64_t roles ,
154
168
_Nonnull indexstoredb_symbol_occurrence_receiver_t );
155
169
170
+ /// Returns the USR of the given symbol.
171
+ ///
172
+ /// The string has the same lifetime as the \c indexstoredb_symbol_t.
156
173
INDEXSTOREDB_PUBLIC
157
174
const char * _Nonnull
158
175
indexstoredb_symbol_usr (_Nonnull indexstoredb_symbol_t );
159
176
177
+ /// Returns the name of the given symbol.
178
+ ///
179
+ /// The string has the same lifetime as the \c indexstoredb_symbol_t.
160
180
INDEXSTOREDB_PUBLIC
161
181
const char * _Nonnull
162
182
indexstoredb_symbol_name (_Nonnull indexstoredb_symbol_t );
163
183
184
+ /// Returns the symbol of the given symbol occurrence.
185
+ ///
186
+ /// The symbol has the same lifetime as the \c indexstoredb_symbol_occurrence_t.
164
187
INDEXSTOREDB_PUBLIC
165
188
_Nonnull indexstoredb_symbol_t
166
189
indexstoredb_symbol_occurrence_symbol (_Nonnull indexstoredb_symbol_occurrence_t );
167
190
191
+ /// Returns the roles of the given symbol occurrence.
168
192
INDEXSTOREDB_PUBLIC uint64_t
169
193
indexstoredb_symbol_occurrence_roles (_Nonnull indexstoredb_symbol_occurrence_t );
170
194
171
- /// The location is owned by the occurrence and shall not be used after the occurrence is freed.
195
+ /// Returns the location of the given symbol occurrence.
196
+ ///
197
+ /// The location has the same lifetime as the \c indexstoredb_symbol_occurrence_t.
172
198
INDEXSTOREDB_PUBLIC _Nonnull
173
199
indexstoredb_symbol_location_t
174
200
indexstoredb_symbol_occurrence_location (_Nonnull indexstoredb_symbol_occurrence_t );
175
201
202
+ /// Returns the path of the given symbol location.
203
+ ///
204
+ /// The string has the same lifetime as the \c indexstoredb_symbol_location_t.
176
205
INDEXSTOREDB_PUBLIC
177
206
const char * _Nonnull
178
207
indexstoredb_symbol_location_path (_Nonnull indexstoredb_symbol_location_t );
179
208
209
+ /// Returns whether the given symbol location is a system location.
180
210
INDEXSTOREDB_PUBLIC bool
181
211
indexstoredb_symbol_location_is_system (_Nonnull indexstoredb_symbol_location_t );
182
212
213
+ /// Returns the one-based line number of the given symbol location.
183
214
INDEXSTOREDB_PUBLIC int
184
215
indexstoredb_symbol_location_line (_Nonnull indexstoredb_symbol_location_t );
185
216
217
+ /// Returns the one-based UTF-8 column index of the given symbol location.
186
218
INDEXSTOREDB_PUBLIC int
187
219
indexstoredb_symbol_location_column_utf8 (_Nonnull indexstoredb_symbol_location_t );
188
220
221
+ /// Retains the given \c indexstoredb_object_t and returns it.
189
222
INDEXSTOREDB_PUBLIC _Nonnull
190
223
indexstoredb_object_t
191
224
indexstoredb_retain (_Nonnull indexstoredb_object_t );
192
225
226
+ /// Releases the given \c indexstoredb_object_t.
193
227
INDEXSTOREDB_PUBLIC void
194
228
indexstoredb_release (_Nonnull indexstoredb_object_t );
195
229
230
+ /// Returns the string describing the given error.
231
+ ///
232
+ /// The string has the same lifetime as the \c indexstoredb_error_t.
196
233
INDEXSTOREDB_PUBLIC const char * _Nonnull
197
234
indexstoredb_error_get_description (_Nonnull indexstoredb_error_t );
198
235
236
+ /// Destroys the given error.
199
237
INDEXSTOREDB_PUBLIC void
200
238
indexstoredb_error_dispose (_Nullable indexstoredb_error_t );
201
239
202
- /// Loops through each symbol in the index and calls the receiver function with each symbol.
203
- /// @param index An IndexStoreDB object which contains the symbols.
204
- /// @param receiver A function to be called for each symbol, the CString of the symbol will be passed in to this function.
205
- /// The function should return a boolean indicating whether the looping should continue.
240
+ /// Iterates over the name of every symbol in the index.
241
+ ///
242
+ /// \param index An IndexStoreDB object which contains the symbols.
243
+ /// \param receiver A function to be called for each symbol. The string pointer is only valid for
244
+ /// the duration of the call. The function should return a true to continue iterating.
206
245
INDEXSTOREDB_PUBLIC bool
207
246
indexstoredb_index_symbol_names (_Nonnull indexstoredb_index_t index , _Nonnull indexstoredb_symbol_name_receiver );
208
247
209
- /// Loops through each canonical symbol that matches the string and performs the passed in function.
210
- /// @param index An IndexStoreDB object which contains the symbols.
211
- /// @param symbolName The name of the symbol whose canonical occurence should be found.
212
- /// @param receiver A function to be called for each canonical occurence.
213
- /// The SymbolOccurenceRef of the symbol will be passed in to this function.
214
- /// The function should return a boolean indicating whether the looping should continue.
248
+ /// Iterates over every canonical symbol that matches the string.
249
+ ///
250
+ /// \param index An IndexStoreDB object which contains the symbols.
251
+ /// \param symbolName The name of the symbol whose canonical occurence should be found.
252
+ /// \param receiver A function to be called for each canonical occurence.
253
+ /// The canonical symbol occurrence will be passed in to this function. It is valid only for the
254
+ /// duration of the call. The function should return true to continue iterating.
215
255
INDEXSTOREDB_PUBLIC bool
216
256
indexstoredb_index_canonical_symbol_occurences_by_name (
217
257
indexstoredb_index_t _Nonnull index ,
218
258
const char * _Nonnull symbolName ,
219
259
indexstoredb_symbol_occurrence_receiver_t _Nonnull receiver
220
260
);
221
261
222
- /// Loops through each canonical symbol that matches the pattern and performs the passed in function .
223
- /// @param index An IndexStoreDB object which contains the symbols.
224
- /// @ param anchorStart When true, symbol names should only be considered matching when the first characters of the symbol name match the pattern .
225
- /// @ param anchorEnd When true, symbol names should only be considered matching when the first characters of the symbol name match the pattern.
226
- /// @ param subsequence When true, symbols will be matched even if the pattern is not matched contiguously .
227
- /// @ param ignoreCase When true, symbols may be returned even if the case of letters does not match the pattern .
228
- /// @ param receiver A function to be called for each canonical occurence that matches the pattern.
229
- /// The SymbolOccurenceRef of the symbol will be passed in to this function .
230
- /// The function should return a boolean indicating whether the looping should continue.
262
+ /// Iterates over every canonical symbol that matches the pattern.
263
+ ///
264
+ /// \ param index An IndexStoreDB object which contains the symbols .
265
+ /// \ param anchorStart When true, symbol names should only be considered matching when the first characters of the symbol name match the pattern.
266
+ /// \ param anchorEnd When true, symbol names should only be considered matching when the first characters of the symbol name match the pattern .
267
+ /// \ param subsequence When true, symbols will be matched even if the pattern is not matched contiguously .
268
+ /// \ param ignoreCase When true, symbols may be returned even if the case of letters does not match the pattern.
269
+ /// \param receiver A function to be called for each canonical occurence that matches the pattern .
270
+ /// It is valid only for the duration of the call. The function should return true to continue iterating .
231
271
INDEXSTOREDB_PUBLIC bool
232
272
indexstoredb_index_canonical_symbol_occurences_containing_pattern (
233
273
_Nonnull indexstoredb_index_t index ,
@@ -238,27 +278,28 @@ indexstoredb_index_canonical_symbol_occurences_containing_pattern(
238
278
bool ignoreCase ,
239
279
_Nonnull indexstoredb_symbol_occurrence_receiver_t receiver );
240
280
241
- /// Gets the set of roles of the passed in symbol relation
242
- /// @param relation A symbol relation
281
+ /// Returns the set of roles of the given symbol relation.
243
282
INDEXSTOREDB_PUBLIC uint64_t
244
283
indexstoredb_symbol_relation_get_roles (_Nonnull indexstoredb_symbol_relation_t );
245
284
246
- /// Gets the symbol associated with the passed in relation
247
- /// @param relation A symbol relation
285
+ /// Returns the symbol of the given symbol relation.
286
+ ///
287
+ /// The symbol has the same lifetime as the \c indexstoredb_symbol_relation_t.
248
288
INDEXSTOREDB_PUBLIC _Nonnull indexstoredb_symbol_t
249
289
indexstoredb_symbol_relation_get_symbol (_Nonnull indexstoredb_symbol_relation_t );
250
290
251
- /// Loops through each relation that a passed in symbol has, and performs the passed in function.
291
+ /// Iterates over the relations of the given symbol occurrence.
292
+ ///
252
293
/// The relations are owned by the occurrence and shall not be used after the occurrence is freed.
253
- /// @param occurrence The symbol occurrence that whose relations should be found.
254
- /// @param applier The function that should be performed on each symbol relation.
294
+ ///
295
+ /// \param occurrence The symbol occurrence that whose relations should be found.
296
+ /// \param applier The function that should be performed on each symbol relation.
255
297
/// The function should return a boolean indicating whether the looping should continue.
256
298
INDEXSTOREDB_PUBLIC bool
257
299
indexstoredb_symbol_occurrence_relations (_Nonnull indexstoredb_symbol_occurrence_t ,
258
300
bool (^ _Nonnull applier )(indexstoredb_symbol_relation_t _Nonnull ));
259
301
260
- /// Get the SymbolKind of a Symbol
261
- /// @param symbol The symbol whose kind should be found.
302
+ /// Returns the kind of the given symbol.
262
303
INDEXSTOREDB_PUBLIC indexstoredb_symbol_kind_t
263
304
indexstoredb_symbol_kind (_Nonnull indexstoredb_symbol_t );
264
305
0 commit comments