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