25
25
#include <stdint.h>
26
26
27
27
/// The version constants for the SwiftDependencyScan C API.
28
- /// DEPSCAN_VERSION_MINOR should increase when there are API additions.
29
- /// DEPSCAN_VERSION_MAJOR is intended for "major" source/ABI breaking changes.
30
- #define DEPSCAN_VERSION_MAJOR 0
31
- #define DEPSCAN_VERSION_MINOR 1
28
+ /// SWIFTSCAN_VERSION_MINOR should increase when there are API additions.
29
+ /// SWIFTSCAN_VERSION_MAJOR is intended for "major" source/ABI breaking changes.
30
+ #define SWIFTSCAN_VERSION_MAJOR 0
31
+ #define SWIFTSCAN_VERSION_MINOR 1
32
32
33
- DEPSCAN_BEGIN_DECLS
33
+ SWIFTSCAN_BEGIN_DECLS
34
34
35
35
//=== Public Scanner Data Types -------------------------------------------===//
36
36
37
37
typedef enum {
38
- DEPSCAN_DEPENDENCY_INFO_SWIFT_TEXTUAL = 0 ,
39
- DEPSCAN_DEPENDENCY_INFO_SWIFT_BINARY = 1 ,
40
- DEPSCAN_DEPENDENCY_INFO_SWIFT_PLACEHOLDER = 2 ,
41
- DEPSCAN_DEPENDENCY_INFO_CLANG = 3
42
- } ds_dependency_info_kind_t ;
38
+ SWIFTSCAN_DEPENDENCY_INFO_SWIFT_TEXTUAL = 0 ,
39
+ SWIFTSCAN_DEPENDENCY_INFO_SWIFT_BINARY = 1 ,
40
+ SWIFTSCAN_DEPENDENCY_INFO_SWIFT_PLACEHOLDER = 2 ,
41
+ SWIFTSCAN_DEPENDENCY_INFO_CLANG = 3
42
+ } swiftscan_dependency_info_kind_t ;
43
43
44
44
/// Opaque container of the details specific to a given module dependency.
45
- typedef void * ds_module_details_t ;
45
+ typedef void * swiftscan_module_details_t ;
46
46
47
47
typedef struct {
48
48
/// The module's name
@@ -53,176 +53,195 @@ typedef struct {
53
53
/// "swiftBinary"
54
54
/// "swiftPlaceholder"
55
55
/// "clang""
56
- ds_string_t module_name ;
56
+ swiftscan_string_t module_name ;
57
57
58
58
/// The path for the module.
59
- ds_string_t module_path ;
59
+ swiftscan_string_t module_path ;
60
60
61
61
/// The source files used to build this module.
62
- ds_string_set_t * source_files ;
62
+ swiftscan_string_set_t * source_files ;
63
63
64
64
/**
65
65
* The list of modules which this module direct depends on.
66
66
* The format is:
67
67
* `<module-kind>:<module-name>`
68
68
*/
69
- ds_string_set_t * direct_dependencies ;
69
+ swiftscan_string_set_t * direct_dependencies ;
70
70
71
71
/// Specific details of a particular kind of module.
72
- ds_module_details_t details ;
73
- } ds_dependency_info_t ;
72
+ swiftscan_module_details_t details ;
73
+ } swiftscan_dependency_info_t ;
74
74
75
75
/// Full Dependency Graph (Result)
76
76
77
77
typedef struct {
78
78
int count ;
79
- ds_dependency_info_t * modules ;
80
- } ds_dependency_set_t ;
79
+ swiftscan_dependency_info_t * modules ;
80
+ } swiftscan_dependency_set_t ;
81
81
82
82
typedef struct {
83
83
/// The name of the main module for this dependency graph (root node)
84
- ds_string_t main_module_name ;
84
+ swiftscan_string_t main_module_name ;
85
85
86
86
/// The complete list of modules discovered
87
- ds_dependency_set_t * module_set ;
88
- } ds_dependency_result_t ;
87
+ swiftscan_dependency_set_t * module_set ;
88
+ } swiftscan_dependency_result_t ;
89
89
90
90
typedef struct {
91
91
/// The complete list of imports discovered
92
- ds_string_set_t * import_set ;
93
- } ds_prescan_result_t ;
92
+ swiftscan_string_set_t * import_set ;
93
+ } swiftscan_prescan_result_t ;
94
94
95
95
//=== Batch Scan Input Specification --------------------------------------===//
96
96
97
97
typedef struct {
98
- ds_string_t module_name ;
99
- ds_string_t arguments ;
98
+ swiftscan_string_t module_name ;
99
+ swiftscan_string_t arguments ;
100
100
bool is_swift ;
101
- } ds_batch_scan_entry_t ;
101
+ } swiftscan_batch_scan_entry_t ;
102
102
103
103
typedef struct {
104
104
int count ;
105
- ds_batch_scan_entry_t * modules ;
106
- } ds_batch_scan_input_t ;
105
+ swiftscan_batch_scan_entry_t * modules ;
106
+ } swiftscan_batch_scan_input_t ;
107
107
108
108
typedef struct {
109
109
int count ;
110
- ds_dependency_result_t * * results ;
111
- } ds_batch_scan_result_t ;
110
+ swiftscan_dependency_result_t * * results ;
111
+ } swiftscan_batch_scan_result_t ;
112
112
113
113
//=== Dependency Result Functions -----------------------------------------===//
114
114
115
- DEPSCAN_PUBLIC ds_dependency_info_kind_t
116
- ds_get_module_detail_kind ( ds_module_details_t details );
115
+ SWIFTSCAN_PUBLIC swiftscan_dependency_info_kind_t
116
+ swiftscan_get_module_detail_kind ( swiftscan_module_details_t details );
117
117
118
118
//=== Swift Textual Module Details query APIs -----------------------------===//
119
- DEPSCAN_PUBLIC ds_string_t
120
- ds_get_swift_textual_detail_module_interface_path (ds_module_details_t details );
119
+ SWIFTSCAN_PUBLIC swiftscan_string_t
120
+ swiftscan_swift_textual_detail_get_module_interface_path (
121
+ swiftscan_module_details_t details );
121
122
122
- DEPSCAN_PUBLIC ds_string_set_t *
123
- ds_get_swift_textual_detail_compiled_module_candidates (
124
- ds_module_details_t details );
123
+ SWIFTSCAN_PUBLIC swiftscan_string_set_t *
124
+ swiftscan_swift_textual_detail_get_compiled_module_candidates (
125
+ swiftscan_module_details_t details );
125
126
126
- DEPSCAN_PUBLIC ds_string_t
127
- ds_get_swift_textual_detail_bridging_header_path (ds_module_details_t details );
127
+ SWIFTSCAN_PUBLIC swiftscan_string_t
128
+ swiftscan_swift_textual_detail_get_bridging_header_path (
129
+ swiftscan_module_details_t details );
128
130
129
- DEPSCAN_PUBLIC ds_string_set_t *
130
- ds_get_swift_textual_detail_bridging_source_files (ds_module_details_t details );
131
+ SWIFTSCAN_PUBLIC swiftscan_string_set_t *
132
+ swiftscan_swift_textual_detail_get_bridging_source_files (
133
+ swiftscan_module_details_t details );
131
134
132
- DEPSCAN_PUBLIC ds_string_set_t *
133
- ds_get_swift_textual_detail_bridging_module_dependencies (
134
- ds_module_details_t details );
135
+ SWIFTSCAN_PUBLIC swiftscan_string_set_t *
136
+ swiftscan_swift_textual_detail_get_bridging_module_dependencies (
137
+ swiftscan_module_details_t details );
135
138
136
- DEPSCAN_PUBLIC ds_string_set_t *
137
- ds_get_swift_textual_detail_command_line (ds_module_details_t details );
139
+ SWIFTSCAN_PUBLIC swiftscan_string_set_t *
140
+ swiftscan_swift_textual_detail_get_command_line (
141
+ swiftscan_module_details_t details );
138
142
139
- DEPSCAN_PUBLIC ds_string_set_t *
140
- ds_get_swift_textual_detail_extra_pcm_args (ds_module_details_t details );
143
+ SWIFTSCAN_PUBLIC swiftscan_string_set_t *
144
+ swiftscan_swift_textual_detail_get_extra_pcm_args (
145
+ swiftscan_module_details_t details );
141
146
142
- DEPSCAN_PUBLIC ds_string_t
143
- ds_get_swift_textual_detail_context_hash (ds_module_details_t details );
147
+ SWIFTSCAN_PUBLIC swiftscan_string_t
148
+ swiftscan_swift_textual_detail_get_context_hash (
149
+ swiftscan_module_details_t details );
144
150
145
- DEPSCAN_PUBLIC bool
146
- ds_get_swift_textual_detail_is_framework ( ds_module_details_t details );
151
+ SWIFTSCAN_PUBLIC bool swiftscan_swift_textual_detail_get_is_framework (
152
+ swiftscan_module_details_t details );
147
153
148
154
//=== Swift Binary Module Details query APIs ------------------------------===//
149
155
150
- DEPSCAN_PUBLIC ds_string_t
151
- ds_get_swift_binary_detail_compiled_module_path (ds_module_details_t details );
156
+ SWIFTSCAN_PUBLIC swiftscan_string_t
157
+ swiftscan_swift_binary_detail_get_compiled_module_path (
158
+ swiftscan_module_details_t details );
152
159
153
- DEPSCAN_PUBLIC ds_string_t
154
- ds_get_swift_binary_detail_module_doc_path (ds_module_details_t details );
160
+ SWIFTSCAN_PUBLIC swiftscan_string_t
161
+ swiftscan_swift_binary_detail_get_module_doc_path (
162
+ swiftscan_module_details_t details );
155
163
156
- DEPSCAN_PUBLIC ds_string_t ds_get_swift_binary_detail_module_source_info_path (
157
- ds_module_details_t * details );
164
+ SWIFTSCAN_PUBLIC swiftscan_string_t
165
+ swiftscan_swift_binary_detail_get_module_source_info_path (
166
+ swiftscan_module_details_t * details );
158
167
159
168
//=== Swift Placeholder Module Details query APIs -------------------------===//
160
169
161
- DEPSCAN_PUBLIC ds_string_t ds_get_swift_placeholder_detail_compiled_module_path (
162
- ds_module_details_t details );
170
+ SWIFTSCAN_PUBLIC swiftscan_string_t
171
+ swiftscan_swift_placeholder_detail_get_compiled_module_path (
172
+ swiftscan_module_details_t details );
163
173
164
- DEPSCAN_PUBLIC ds_string_t
165
- ds_get_swift_placeholder_detail_module_doc_path (ds_module_details_t details );
174
+ SWIFTSCAN_PUBLIC swiftscan_string_t
175
+ swiftscan_swift_placeholder_detail_get_module_doc_path (
176
+ swiftscan_module_details_t details );
166
177
167
- DEPSCAN_PUBLIC ds_string_t
168
- ds_get_swift_placeholder_detail_module_source_info_path (
169
- ds_module_details_t details );
178
+ SWIFTSCAN_PUBLIC swiftscan_string_t
179
+ swiftscan_swift_placeholder_detail_get_module_source_info_path (
180
+ swiftscan_module_details_t details );
170
181
171
182
//=== Clang Module Details query APIs -------------------------------------===//
172
183
173
- DEPSCAN_PUBLIC ds_string_t
174
- ds_get_clang_detail_module_map_path ( ds_module_details_t details );
184
+ SWIFTSCAN_PUBLIC swiftscan_string_t
185
+ swiftscan_clang_detail_get_module_map_path ( swiftscan_module_details_t details );
175
186
176
- DEPSCAN_PUBLIC ds_string_t
177
- ds_get_clang_detail_context_hash ( ds_module_details_t details );
187
+ SWIFTSCAN_PUBLIC swiftscan_string_t
188
+ swiftscan_clang_detail_get_context_hash ( swiftscan_module_details_t details );
178
189
179
- DEPSCAN_PUBLIC ds_string_set_t *
180
- ds_get_clang_detail_command_line ( ds_module_details_t details );
190
+ SWIFTSCAN_PUBLIC swiftscan_string_set_t *
191
+ swiftscan_clang_detail_get_command_line ( swiftscan_module_details_t details );
181
192
182
193
//=== Cleanup Functions ---------------------------------------------------===//
183
194
184
- DEPSCAN_PUBLIC void
185
- ds_dependency_info_details_dispose ( ds_module_details_t details );
195
+ SWIFTSCAN_PUBLIC void
196
+ swiftscan_dependency_info_details_dispose ( swiftscan_module_details_t details );
186
197
187
- DEPSCAN_PUBLIC void ds_dependency_info_dispose (ds_dependency_info_t * info );
198
+ SWIFTSCAN_PUBLIC void
199
+ swiftscan_dependency_info_dispose (swiftscan_dependency_info_t * info );
188
200
189
- DEPSCAN_PUBLIC void ds_dependency_set_dispose (ds_dependency_set_t * set );
201
+ SWIFTSCAN_PUBLIC void
202
+ swiftscan_dependency_set_dispose (swiftscan_dependency_set_t * set );
190
203
191
- DEPSCAN_PUBLIC void
192
- ds_dependency_result_dispose ( ds_dependency_result_t * result );
204
+ SWIFTSCAN_PUBLIC void
205
+ swiftscan_dependency_result_dispose ( swiftscan_dependency_result_t * result );
193
206
194
- DEPSCAN_PUBLIC void ds_prescan_result_dispose (ds_prescan_result_t * result );
207
+ SWIFTSCAN_PUBLIC void
208
+ swiftscan_prescan_result_dispose (swiftscan_prescan_result_t * result );
195
209
196
- DEPSCAN_PUBLIC void ds_batch_scan_entry_dispose (ds_batch_scan_entry_t * entry );
210
+ SWIFTSCAN_PUBLIC void
211
+ swiftscan_batch_scan_entry_dispose (swiftscan_batch_scan_entry_t * entry );
197
212
198
- DEPSCAN_PUBLIC void ds_batch_scan_input_dispose (ds_batch_scan_input_t * input );
213
+ SWIFTSCAN_PUBLIC void
214
+ swiftscan_batch_scan_input_dispose (swiftscan_batch_scan_input_t * input );
199
215
200
- DEPSCAN_PUBLIC void
201
- ds_batch_scan_result_dispose ( ds_batch_scan_result_t * result );
216
+ SWIFTSCAN_PUBLIC void
217
+ swiftscan_batch_scan_result_dispose ( swiftscan_batch_scan_result_t * result );
202
218
203
219
//=== Scanner Functions ---------------------------------------------------===//
204
220
205
221
/// Container of the configuration state and shared cache for dependency
206
222
/// scanning.
207
- typedef void * ds_scanner_t ;
223
+ typedef void * swiftscan_scanner_t ;
208
224
209
- DEPSCAN_PUBLIC ds_scanner_t ds_scanner_create (void );
225
+ SWIFTSCAN_PUBLIC swiftscan_scanner_t swiftscan_scanner_create (void );
210
226
211
- DEPSCAN_PUBLIC void ds_scanner_dispose ( ds_scanner_t );
227
+ SWIFTSCAN_PUBLIC void swiftscan_scanner_dispose ( swiftscan_scanner_t );
212
228
213
- DEPSCAN_PUBLIC ds_dependency_result_t *
214
- ds_scan_dependencies (ds_scanner_t * scanner , const char * working_directory ,
215
- int argc , const char * const * argv );
229
+ SWIFTSCAN_PUBLIC swiftscan_dependency_result_t *
230
+ swiftscan_scan_dependencies (swiftscan_scanner_t * scanner ,
231
+ const char * working_directory , int argc ,
232
+ const char * const * argv );
216
233
217
- DEPSCAN_PUBLIC ds_batch_scan_result_t *
218
- ds_batch_scan_dependencies (ds_scanner_t * scanner , const char * working_directory ,
219
- ds_batch_scan_input_t * batch_input ,
220
- int argc , const char * const * argv );
234
+ SWIFTSCAN_PUBLIC swiftscan_batch_scan_result_t *
235
+ swiftscan_batch_scan_dependencies (swiftscan_scanner_t * scanner ,
236
+ const char * working_directory ,
237
+ swiftscan_batch_scan_input_t * batch_input ,
238
+ int argc , const char * const * argv );
221
239
222
- DEPSCAN_PUBLIC ds_prescan_result_t *
223
- ds_prescan_dependencies (ds_scanner_t * scanner , const char * working_directory ,
224
- int argc , const char * const * argv );
240
+ SWIFTSCAN_PUBLIC swiftscan_prescan_result_t *
241
+ swiftscan_prescan_dependencies (swiftscan_scanner_t * scanner ,
242
+ const char * working_directory , int argc ,
243
+ const char * const * argv );
225
244
226
- DEPSCAN_END_DECLS
245
+ SWIFTSCAN_END_DECLS
227
246
228
247
#endif // SWIFT_C_DEPENDENCY_SCAN_H
0 commit comments