@@ -35,9 +35,9 @@ SWIFTSCAN_BEGIN_DECLS
35
35
36
36
/**
37
37
* A character string used to pass around dependency scan result metadata.
38
- * Lifetime of the string is strictly tied to the object whose field it represents.
39
- * When the owning object is released, string memory is freed. Use \c
40
- * swiftscan_get_C_string() to retrieve the string data.
38
+ * Lifetime of the string is strictly tied to the object whose field it
39
+ * represents. When the owning object is released, string memory is freed. Use
40
+ * \c swiftscan_get_C_string() to retrieve the string data.
41
41
*/
42
42
typedef struct {
43
43
const void * data ;
@@ -63,10 +63,10 @@ typedef struct swiftscan_module_details_s *swiftscan_module_details_t;
63
63
typedef struct swiftscan_dependency_info_s * swiftscan_dependency_info_t ;
64
64
65
65
/// Opaque container to an overall result of a dependency scan.
66
- typedef struct swiftscan_dependency_result_s * swiftscan_dependency_result_t ;
66
+ typedef struct swiftscan_dependency_graph_s * swiftscan_dependency_graph_t ;
67
67
68
68
/// Opaque container to contain the result of a dependency prescan.
69
- typedef struct swiftscan_prescan_result_s * swiftscan_prescan_result_t ;
69
+ typedef struct swiftscan_import_set_s * swiftscan_import_set_t ;
70
70
71
71
/// Full Dependency Graph (Result)
72
72
typedef struct {
@@ -86,7 +86,7 @@ typedef struct {
86
86
87
87
typedef struct {
88
88
int count ;
89
- swiftscan_dependency_result_t * results ;
89
+ swiftscan_dependency_graph_t * results ;
90
90
} swiftscan_batch_scan_result_t ;
91
91
92
92
//=== Scanner Invocation Specification ------------------------------------===//
@@ -104,12 +104,12 @@ swiftscan_get_C_string(swiftscan_string_ref_t string);
104
104
//=== Dependency Result Functions -----------------------------------------===//
105
105
106
106
SWIFTSCAN_PUBLIC swiftscan_string_ref_t
107
- swiftscan_dependency_result_get_main_module_name (
108
- swiftscan_dependency_result_t result );
107
+ swiftscan_dependency_graph_get_main_module_name (
108
+ swiftscan_dependency_graph_t result );
109
109
110
110
SWIFTSCAN_PUBLIC swiftscan_dependency_set_t *
111
- swiftscan_dependency_result_get_module_set (
112
- swiftscan_dependency_result_t result );
111
+ swiftscan_dependency_graph_get_dependencies (
112
+ swiftscan_dependency_graph_t result );
113
113
114
114
//=== Dependency Module Info Functions ------------------------------------===//
115
115
@@ -208,8 +208,39 @@ swiftscan_clang_detail_get_context_hash(swiftscan_module_details_t details);
208
208
SWIFTSCAN_PUBLIC swiftscan_string_set_t *
209
209
swiftscan_clang_detail_get_command_line (swiftscan_module_details_t details );
210
210
211
+ //=== Batch Scan Input Functions ------------------------------------------===//
212
+
213
+ /// Create an \c swiftscan_batch_scan_input_t instance.
214
+ /// The returned \c swiftscan_batch_scan_input_t is owned by the caller and must be disposed
215
+ /// of using \c swiftscan_batch_scan_input_dispose .
216
+ SWIFTSCAN_PUBLIC swiftscan_batch_scan_input_t *
217
+ swiftscan_batch_scan_input_create ();
218
+
219
+ SWIFTSCAN_PUBLIC void
220
+ swiftscan_batch_scan_input_set_modules (swiftscan_batch_scan_input_t * input ,
221
+ int count ,
222
+ swiftscan_batch_scan_entry_t * modules );
223
+
211
224
//=== Batch Scan Entry Functions ------------------------------------------===//
212
225
226
+ /// Create an \c swiftscan_batch_scan_entry_t instance.
227
+ /// The returned \c swiftscan_batch_scan_entry_t is owned by the caller and must be disposed
228
+ /// of using \c swiftscan_batch_scan_entry_dispose .
229
+ SWIFTSCAN_PUBLIC swiftscan_batch_scan_entry_t
230
+ swiftscan_batch_scan_entry_create ();
231
+
232
+ SWIFTSCAN_PUBLIC void
233
+ swiftscan_batch_scan_entry_set_module_name (swiftscan_batch_scan_entry_t entry ,
234
+ const char * name );
235
+
236
+ SWIFTSCAN_PUBLIC void
237
+ swiftscan_batch_scan_entry_set_arguments (swiftscan_batch_scan_entry_t entry ,
238
+ const char * arguments );
239
+
240
+ SWIFTSCAN_PUBLIC void
241
+ swiftscan_batch_scan_entry_set_is_swift (swiftscan_batch_scan_entry_t entry ,
242
+ bool is_swift );
243
+
213
244
SWIFTSCAN_PUBLIC swiftscan_string_ref_t
214
245
swiftscan_batch_scan_entry_get_module_name (swiftscan_batch_scan_entry_t entry );
215
246
@@ -222,19 +253,21 @@ swiftscan_batch_scan_entry_get_is_swift(swiftscan_batch_scan_entry_t entry);
222
253
//=== Prescan Result Functions --------------------------------------------===//
223
254
224
255
SWIFTSCAN_PUBLIC swiftscan_string_set_t *
225
- swiftscan_prescan_result_get_import_set ( swiftscan_prescan_result_t result );
256
+ swiftscan_import_set_get_imports ( swiftscan_import_set_t result );
226
257
227
258
//=== Scanner Invocation Functions ----------------------------------------===//
228
259
260
+ /// Create an \c swiftscan_scan_invocation_t instance.
261
+ /// The returned \c swiftscan_scan_invocation_t is owned by the caller and must be disposed
262
+ /// of using \c swiftscan_scan_invocation_dispose .
229
263
SWIFTSCAN_PUBLIC swiftscan_scan_invocation_t swiftscan_scan_invocation_create ();
230
264
231
265
SWIFTSCAN_PUBLIC void swiftscan_scan_invocation_set_working_directory (
232
- swiftscan_scan_invocation_t invocation ,
233
- swiftscan_string_ref_t working_directory );
266
+ swiftscan_scan_invocation_t invocation , const char * working_directory );
234
267
235
268
SWIFTSCAN_PUBLIC void
236
269
swiftscan_scan_invocation_set_argv (swiftscan_scan_invocation_t invocation ,
237
- swiftscan_string_set_t * argv );
270
+ int argc , const char * * argv );
238
271
239
272
SWIFTSCAN_PUBLIC swiftscan_string_ref_t
240
273
swiftscan_scan_invocation_get_working_directory (
@@ -249,19 +282,10 @@ swiftscan_scan_invocation_get_argv(swiftscan_scan_invocation_t invocation);
249
282
//=== Cleanup Functions ---------------------------------------------------===//
250
283
251
284
SWIFTSCAN_PUBLIC void
252
- swiftscan_dependency_info_details_dispose (swiftscan_module_details_t details );
253
-
254
- SWIFTSCAN_PUBLIC void
255
- swiftscan_dependency_info_dispose (swiftscan_dependency_info_t info );
256
-
257
- SWIFTSCAN_PUBLIC void
258
- swiftscan_dependency_set_dispose (swiftscan_dependency_set_t * set );
285
+ swiftscan_dependency_graph_dispose (swiftscan_dependency_graph_t result );
259
286
260
287
SWIFTSCAN_PUBLIC void
261
- swiftscan_dependency_result_dispose (swiftscan_dependency_result_t result );
262
-
263
- SWIFTSCAN_PUBLIC void
264
- swiftscan_prescan_result_dispose (swiftscan_prescan_result_t result );
288
+ swiftscan_import_set_dispose (swiftscan_import_set_t result );
265
289
266
290
SWIFTSCAN_PUBLIC void
267
291
swiftscan_batch_scan_entry_dispose (swiftscan_batch_scan_entry_t entry );
@@ -281,19 +305,33 @@ swiftscan_scan_invocation_dispose(swiftscan_scan_invocation_t invocation);
281
305
/// scanning.
282
306
typedef void * swiftscan_scanner_t ;
283
307
308
+ /// Create an \c swiftscan_scanner_t instance.
309
+ /// The returned \c swiftscan_scanner_t is owned by the caller and must be disposed
310
+ /// of using \c swiftscan_scanner_dispose .
284
311
SWIFTSCAN_PUBLIC swiftscan_scanner_t swiftscan_scanner_create (void );
285
-
286
312
SWIFTSCAN_PUBLIC void swiftscan_scanner_dispose (swiftscan_scanner_t );
287
313
288
- SWIFTSCAN_PUBLIC swiftscan_dependency_result_t swiftscan_scan_dependencies (
314
+ /// Invoke a dependency scan using arguments specified in the \c
315
+ /// swiftscan_scan_invocation_t argument. The returned \c
316
+ /// swiftscan_dependency_graph_t is owned by the caller and must be disposed of
317
+ /// using \c swiftscan_dependency_graph_dispose .
318
+ SWIFTSCAN_PUBLIC swiftscan_dependency_graph_t swiftscan_dependency_graph_create (
289
319
swiftscan_scanner_t scanner , swiftscan_scan_invocation_t invocation );
290
320
321
+ /// Invoke the scan for an input batch of modules specified in the
322
+ /// \c swiftscan_batch_scan_input_t argument. The returned
323
+ /// \c swiftscan_batch_scan_result_t is owned by the caller and must be disposed
324
+ /// of using \c swiftscan_batch_scan_result_dispose .
291
325
SWIFTSCAN_PUBLIC swiftscan_batch_scan_result_t *
292
- swiftscan_batch_scan_dependencies (swiftscan_scanner_t scanner ,
293
- swiftscan_batch_scan_input_t * batch_input ,
294
- swiftscan_scan_invocation_t invocation );
295
-
296
- SWIFTSCAN_PUBLIC swiftscan_prescan_result_t swiftscan_prescan_dependencies (
326
+ swiftscan_batch_scan_result_create (swiftscan_scanner_t scanner ,
327
+ swiftscan_batch_scan_input_t * batch_input ,
328
+ swiftscan_scan_invocation_t invocation );
329
+
330
+ /// Invoke the import prescan using arguments specified in the \c
331
+ /// swiftscan_scan_invocation_t argument. The returned \c swiftscan_import_set_t
332
+ /// is owned by the caller and must be disposed of using \c
333
+ /// swiftscan_import_set_dispose .
334
+ SWIFTSCAN_PUBLIC swiftscan_import_set_t swiftscan_import_set_create (
297
335
swiftscan_scanner_t scanner , swiftscan_scan_invocation_t invocation );
298
336
299
337
SWIFTSCAN_END_DECLS
0 commit comments