File: indexstore_functions.h

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (550 lines) | stat: -rw-r--r-- 19,680 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
/*===-- indexstore/indexstore_functions.h - Index Store C API ------- C -*-===*\
|*                                                                            *|
|*                     The LLVM Compiler Infrastructure                       *|
|*                                                                            *|
|* This file is distributed under the University of Illinois Open Source      *|
|* License. See LICENSE.TXT for details.                                      *|
|*                                                                            *|
|*===----------------------------------------------------------------------===*|
|*                                                                            *|
|* Shim version of indexstore.h suitable for using with dlopen.               *|
|*                                                                            *|
\*===----------------------------------------------------------------------===*/

#ifndef INDEXSTOREDB_INDEXSTORE_INDEXSTORE_FUNCTIONS_H
#define INDEXSTOREDB_INDEXSTORE_INDEXSTORE_FUNCTIONS_H

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <time.h>

/**
 * \brief The version constants for the Index Store C API.
 * INDEXSTORE_VERSION_MINOR should increase when there are API additions.
 * INDEXSTORE_VERSION_MAJOR is intended for "major" source/ABI breaking changes.
 */
#define INDEXSTORE_VERSION_MAJOR 0
#define INDEXSTORE_VERSION_MINOR 11

#define INDEXSTORE_VERSION_ENCODE(major, minor) ( \
      ((major) * 10000)                           \
    + ((minor) *     1))

#define INDEXSTORE_VERSION INDEXSTORE_VERSION_ENCODE( \
    INDEXSTORE_VERSION_MAJOR,                         \
    INDEXSTORE_VERSION_MINOR )

#define INDEXSTORE_VERSION_STRINGIZE_(major, minor)   \
    #major"."#minor
#define INDEXSTORE_VERSION_STRINGIZE(major, minor)    \
    INDEXSTORE_VERSION_STRINGIZE_(major, minor)

#define INDEXSTORE_VERSION_STRING INDEXSTORE_VERSION_STRINGIZE( \
    INDEXSTORE_VERSION_MAJOR,                                   \
    INDEXSTORE_VERSION_MINOR)

// Workaround a modules issue with time_t on linux.
#if __has_include(<sys/types.h>)
#include <sys/types.h>
#endif

#ifdef  __cplusplus
# define INDEXSTORE_BEGIN_DECLS  extern "C" {
# define INDEXSTORE_END_DECLS    }
#else
# define INDEXSTORE_BEGIN_DECLS
# define INDEXSTORE_END_DECLS
#endif

#ifndef __has_feature
# define __has_feature(x) 0
#endif

// FIXME: we need a runtime check as well since the library may have been built
// without blocks support.
#if __has_feature(blocks) && defined(__APPLE__)
# define INDEXSTORE_HAS_BLOCKS 1
#else
# define INDEXSTORE_HAS_BLOCKS 0
#endif

INDEXSTORE_BEGIN_DECLS

typedef void *indexstore_error_t;

typedef struct {
  const char *data;
  size_t length;
} indexstore_string_ref_t;

typedef void *indexstore_t;

typedef void *indexstore_unit_event_notification_t;
typedef void *indexstore_unit_event_t;

typedef enum {
  INDEXSTORE_UNIT_EVENT_ADDED = 1,
  INDEXSTORE_UNIT_EVENT_REMOVED = 2,
  INDEXSTORE_UNIT_EVENT_MODIFIED = 3,
  INDEXSTORE_UNIT_EVENT_DIRECTORY_DELETED = 4,
} indexstore_unit_event_kind_t;

typedef struct {
  /// If true, \c indexstore_store_start_unit_event_listening will block until
  /// the initial set of units is passed to the unit event handler, otherwise
  /// the function will return and the initial set will be passed asynchronously.
  bool wait_initial_sync;
} indexstore_unit_event_listen_options_t;

typedef void *indexstore_symbol_t;

typedef enum {
  INDEXSTORE_SYMBOL_KIND_UNKNOWN = 0,
  INDEXSTORE_SYMBOL_KIND_MODULE = 1,
  INDEXSTORE_SYMBOL_KIND_NAMESPACE = 2,
  INDEXSTORE_SYMBOL_KIND_NAMESPACEALIAS = 3,
  INDEXSTORE_SYMBOL_KIND_MACRO = 4,
  INDEXSTORE_SYMBOL_KIND_ENUM = 5,
  INDEXSTORE_SYMBOL_KIND_STRUCT = 6,
  INDEXSTORE_SYMBOL_KIND_CLASS = 7,
  INDEXSTORE_SYMBOL_KIND_PROTOCOL = 8,
  INDEXSTORE_SYMBOL_KIND_EXTENSION = 9,
  INDEXSTORE_SYMBOL_KIND_UNION = 10,
  INDEXSTORE_SYMBOL_KIND_TYPEALIAS = 11,
  INDEXSTORE_SYMBOL_KIND_FUNCTION = 12,
  INDEXSTORE_SYMBOL_KIND_VARIABLE = 13,
  INDEXSTORE_SYMBOL_KIND_FIELD = 14,
  INDEXSTORE_SYMBOL_KIND_ENUMCONSTANT = 15,
  INDEXSTORE_SYMBOL_KIND_INSTANCEMETHOD = 16,
  INDEXSTORE_SYMBOL_KIND_CLASSMETHOD = 17,
  INDEXSTORE_SYMBOL_KIND_STATICMETHOD = 18,
  INDEXSTORE_SYMBOL_KIND_INSTANCEPROPERTY = 19,
  INDEXSTORE_SYMBOL_KIND_CLASSPROPERTY = 20,
  INDEXSTORE_SYMBOL_KIND_STATICPROPERTY = 21,
  INDEXSTORE_SYMBOL_KIND_CONSTRUCTOR = 22,
  INDEXSTORE_SYMBOL_KIND_DESTRUCTOR = 23,
  INDEXSTORE_SYMBOL_KIND_CONVERSIONFUNCTION = 24,
  INDEXSTORE_SYMBOL_KIND_PARAMETER = 25,
  INDEXSTORE_SYMBOL_KIND_USING = 26,

  INDEXSTORE_SYMBOL_KIND_COMMENTTAG = 1000,
} indexstore_symbol_kind_t;

typedef enum {
  INDEXSTORE_SYMBOL_SUBKIND_NONE = 0,
  INDEXSTORE_SYMBOL_SUBKIND_CXXCOPYCONSTRUCTOR = 1,
  INDEXSTORE_SYMBOL_SUBKIND_CXXMOVECONSTRUCTOR = 2,
  INDEXSTORE_SYMBOL_SUBKIND_ACCESSORGETTER = 3,
  INDEXSTORE_SYMBOL_SUBKIND_ACCESSORSETTER = 4,
  INDEXSTORE_SYMBOL_SUBKIND_USINGTYPENAME = 5,
  INDEXSTORE_SYMBOL_SUBKIND_USINGVALUE = 6,

  INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORWILLSET = 1000,
  INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORDIDSET = 1001,
  INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORADDRESSOR = 1002,
  INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORMUTABLEADDRESSOR = 1003,
  INDEXSTORE_SYMBOL_SUBKIND_SWIFTEXTENSIONOFSTRUCT = 1004,
  INDEXSTORE_SYMBOL_SUBKIND_SWIFTEXTENSIONOFCLASS = 1005,
  INDEXSTORE_SYMBOL_SUBKIND_SWIFTEXTENSIONOFENUM = 1006,
  INDEXSTORE_SYMBOL_SUBKIND_SWIFTEXTENSIONOFPROTOCOL = 1007,
  INDEXSTORE_SYMBOL_SUBKIND_SWIFTPREFIXOPERATOR = 1008,
  INDEXSTORE_SYMBOL_SUBKIND_SWIFTPOSTFIXOPERATOR = 1009,
  INDEXSTORE_SYMBOL_SUBKIND_SWIFTINFIXOPERATOR = 1010,
  INDEXSTORE_SYMBOL_SUBKIND_SWIFTSUBSCRIPT = 1011,
  INDEXSTORE_SYMBOL_SUBKIND_SWIFTASSOCIATEDTYPE = 1012,
  INDEXSTORE_SYMBOL_SUBKIND_SWIFTGENERICTYPEPARAM = 1013,
  INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORREAD = 1014,
  INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORMODIFY = 1015,
} indexstore_symbol_subkind_t;

typedef enum {
  INDEXSTORE_SYMBOL_PROPERTY_GENERIC                          = 1 << 0,
  INDEXSTORE_SYMBOL_PROPERTY_TEMPLATE_PARTIAL_SPECIALIZATION  = 1 << 1,
  INDEXSTORE_SYMBOL_PROPERTY_TEMPLATE_SPECIALIZATION          = 1 << 2,
  INDEXSTORE_SYMBOL_PROPERTY_UNITTEST                         = 1 << 3,
  INDEXSTORE_SYMBOL_PROPERTY_IBANNOTATED                      = 1 << 4,
  INDEXSTORE_SYMBOL_PROPERTY_IBOUTLETCOLLECTION               = 1 << 5,
  INDEXSTORE_SYMBOL_PROPERTY_GKINSPECTABLE                    = 1 << 6,
  INDEXSTORE_SYMBOL_PROPERTY_LOCAL                            = 1 << 7,
  INDEXSTORE_SYMBOL_PROPERTY_PROTOCOL_INTERFACE               = 1 << 8,
  INDEXSTORE_SYMBOL_PROPERTY_SWIFT_ASYNC                      = 1 << 16,
} indexstore_symbol_property_t;

typedef enum {
  INDEXSTORE_SYMBOL_LANG_C = 0,
  INDEXSTORE_SYMBOL_LANG_OBJC = 1,
  INDEXSTORE_SYMBOL_LANG_CXX = 2,

  INDEXSTORE_SYMBOL_LANG_SWIFT = 100,
} indexstore_symbol_language_t;

typedef enum {
  INDEXSTORE_SYMBOL_ROLE_DECLARATION  = 1 << 0,
  INDEXSTORE_SYMBOL_ROLE_DEFINITION   = 1 << 1,
  INDEXSTORE_SYMBOL_ROLE_REFERENCE    = 1 << 2,
  INDEXSTORE_SYMBOL_ROLE_READ         = 1 << 3,
  INDEXSTORE_SYMBOL_ROLE_WRITE        = 1 << 4,
  INDEXSTORE_SYMBOL_ROLE_CALL         = 1 << 5,
  INDEXSTORE_SYMBOL_ROLE_DYNAMIC      = 1 << 6,
  INDEXSTORE_SYMBOL_ROLE_ADDRESSOF    = 1 << 7,
  INDEXSTORE_SYMBOL_ROLE_IMPLICIT     = 1 << 8,
  INDEXSTORE_SYMBOL_ROLE_UNDEFINITION = 1 << 19,

  // Relation roles.
  INDEXSTORE_SYMBOL_ROLE_REL_CHILDOF     = 1 << 9,
  INDEXSTORE_SYMBOL_ROLE_REL_BASEOF      = 1 << 10,
  INDEXSTORE_SYMBOL_ROLE_REL_OVERRIDEOF  = 1 << 11,
  INDEXSTORE_SYMBOL_ROLE_REL_RECEIVEDBY  = 1 << 12,
  INDEXSTORE_SYMBOL_ROLE_REL_CALLEDBY    = 1 << 13,
  INDEXSTORE_SYMBOL_ROLE_REL_EXTENDEDBY  = 1 << 14,
  INDEXSTORE_SYMBOL_ROLE_REL_ACCESSOROF  = 1 << 15,
  INDEXSTORE_SYMBOL_ROLE_REL_CONTAINEDBY = 1 << 16,
  INDEXSTORE_SYMBOL_ROLE_REL_IBTYPEOF    = 1 << 17,
  INDEXSTORE_SYMBOL_ROLE_REL_SPECIALIZATIONOF = 1 << 18,
} indexstore_symbol_role_t;

typedef void *indexstore_unit_dependency_t;
typedef void *indexstore_unit_include_t;

typedef enum {
  INDEXSTORE_UNIT_DEPENDENCY_UNIT = 1,
  INDEXSTORE_UNIT_DEPENDENCY_RECORD = 2,
  INDEXSTORE_UNIT_DEPENDENCY_FILE = 3,
} indexstore_unit_dependency_kind_t;

typedef void *indexstore_symbol_relation_t;

typedef void *indexstore_occurrence_t;

typedef void *indexstore_record_reader_t;

typedef void *indexstore_unit_reader_t;

#if INDEXSTORE_HAS_BLOCKS
typedef void (^indexstore_unit_event_handler_t)(indexstore_unit_event_notification_t);
#endif

typedef struct {
  const char *
  (*error_get_description)(indexstore_error_t);

  void
  (*error_dispose)(indexstore_error_t);

  unsigned
  (*format_version)(void);

  indexstore_t
  (*store_create)(const char *store_path, indexstore_error_t *error);

  void
  (*store_dispose)(indexstore_t);

  #if INDEXSTORE_HAS_BLOCKS
  bool
  (*store_units_apply)(indexstore_t, unsigned sorted,
                               bool(^applier)(indexstore_string_ref_t unit_name));
  #endif

  bool
  (*store_units_apply_f)(indexstore_t, unsigned sorted,
                                 void *context,
                bool(*applier)(void *context, indexstore_string_ref_t unit_name));

  size_t
  (*unit_event_notification_get_events_count)(indexstore_unit_event_notification_t);

  indexstore_unit_event_t
  (*unit_event_notification_get_event)(indexstore_unit_event_notification_t, size_t index);

  bool
  (*unit_event_notification_is_initial)(indexstore_unit_event_notification_t);

  indexstore_unit_event_kind_t
  (*unit_event_get_kind)(indexstore_unit_event_t);

  indexstore_string_ref_t
  (*unit_event_get_unit_name)(indexstore_unit_event_t);

  #if INDEXSTORE_HAS_BLOCKS
  void
  (*store_set_unit_event_handler)(indexstore_t,
                                          indexstore_unit_event_handler_t handler);
  #endif

  void
  (*store_set_unit_event_handler_f)(indexstore_t, void *context,
            void(*handler)(void *context, indexstore_unit_event_notification_t),
                                          void(*finalizer)(void *context));

  bool
  (*store_start_unit_event_listening)(indexstore_t,
                                              indexstore_unit_event_listen_options_t *,
                                              size_t listen_options_struct_size,
                                              indexstore_error_t *error);

  void
  (*store_stop_unit_event_listening)(indexstore_t);

  void
  (*store_discard_unit)(indexstore_t, const char *unit_name);

  void
  (*store_discard_record)(indexstore_t, const char *record_name);

  void
  (*store_purge_stale_data)(indexstore_t);

  /// Determines the unit name from the \c output_path and writes it out in the
  /// \c name_buf buffer. It doesn't write more than \c buf_size.
  /// \returns the length of the name. If this is larger than \c buf_size, the
  /// caller should call the function again with a buffer of the appropriate size.
  size_t
  (*store_get_unit_name_from_output_path)(indexstore_t store,
                                                  const char *output_path,
                                                  char *name_buf,
                                                  size_t buf_size);

  /// \returns true if an error occurred, false otherwise.
  bool
  (*store_get_unit_modification_time)(indexstore_t store,
                                              const char *unit_name,
                                              int64_t *seconds,
                                              int64_t *nanoseconds,
                                              indexstore_error_t *error);


  indexstore_symbol_language_t
  (*symbol_get_language)(indexstore_symbol_t);

  indexstore_symbol_kind_t
  (*symbol_get_kind)(indexstore_symbol_t);

  indexstore_symbol_subkind_t
  (*symbol_get_subkind)(indexstore_symbol_t);

  uint64_t
  (*symbol_get_properties)(indexstore_symbol_t);

  uint64_t
  (*symbol_get_roles)(indexstore_symbol_t);

  uint64_t
  (*symbol_get_related_roles)(indexstore_symbol_t);

  indexstore_string_ref_t
  (*symbol_get_name)(indexstore_symbol_t);

  indexstore_string_ref_t
  (*symbol_get_usr)(indexstore_symbol_t);

  indexstore_string_ref_t
  (*symbol_get_codegen_name)(indexstore_symbol_t);

  uint64_t
  (*symbol_relation_get_roles)(indexstore_symbol_relation_t);

  indexstore_symbol_t
  (*symbol_relation_get_symbol)(indexstore_symbol_relation_t);

  indexstore_symbol_t
  (*occurrence_get_symbol)(indexstore_occurrence_t);

  #if INDEXSTORE_HAS_BLOCKS
  bool
  (*occurrence_relations_apply)(indexstore_occurrence_t,
                        bool(^applier)(indexstore_symbol_relation_t symbol_rel));
  #endif

  bool
  (*occurrence_relations_apply_f)(indexstore_occurrence_t,
                                          void *context,
          bool(*applier)(void *context, indexstore_symbol_relation_t symbol_rel));

  uint64_t
  (*occurrence_get_roles)(indexstore_occurrence_t);

  void
  (*occurrence_get_line_col)(indexstore_occurrence_t,
                                unsigned *line, unsigned *column);

  indexstore_record_reader_t
  (*record_reader_create)(indexstore_t store, const char *record_name,
                                  indexstore_error_t *error);

  void
  (*record_reader_dispose)(indexstore_record_reader_t);

  #if INDEXSTORE_HAS_BLOCKS
  /// Goes through the symbol data and passes symbols to \c receiver, for the
  /// symbol data that \c filter returns true on.
  ///
  /// This allows allocating memory only for the record symbols that the caller is
  /// interested in.
  bool
  (*record_reader_search_symbols)(indexstore_record_reader_t,
      bool(^filter)(indexstore_symbol_t symbol, bool *stop),
      void(^receiver)(indexstore_symbol_t symbol));

  /// \param nocache if true, avoids allocating memory for the symbols.
  /// Useful when the caller does not intend to keep \c indexstore_record_reader_t
  /// for more queries.
  bool
  (*record_reader_symbols_apply)(indexstore_record_reader_t,
                                         bool nocache,
                                      bool(^applier)(indexstore_symbol_t symbol));

  bool
  (*record_reader_occurrences_apply)(indexstore_record_reader_t,
                                   bool(^applier)(indexstore_occurrence_t occur));

  bool
  (*record_reader_occurrences_in_line_range_apply)(indexstore_record_reader_t,
                                                           unsigned line_start,
                                                           unsigned line_count,
                                   bool(^applier)(indexstore_occurrence_t occur));

  /// \param symbols if non-zero \c symbols_count, indicates the list of symbols
  /// that we want to get occurrences for. An empty array indicates that we want
  /// occurrences for all symbols.
  /// \param related_symbols Same as \c symbols but for related symbols.
  bool
  (*record_reader_occurrences_of_symbols_apply)(indexstore_record_reader_t,
          indexstore_symbol_t *symbols, size_t symbols_count,
          indexstore_symbol_t *related_symbols, size_t related_symbols_count,
          bool(^applier)(indexstore_occurrence_t occur));
  #endif

  bool
  (*record_reader_search_symbols_f)(indexstore_record_reader_t,
                                            void *filter_ctx,
      bool(*filter)(void *filter_ctx, indexstore_symbol_t symbol, bool *stop),
                                            void *receiver_ctx,
      void(*receiver)(void *receiver_ctx, indexstore_symbol_t symbol));

  bool
  (*record_reader_symbols_apply_f)(indexstore_record_reader_t,
                                           bool nocache,
                                           void *context,
                       bool(*applier)(void *context, indexstore_symbol_t symbol));

  bool
  (*record_reader_occurrences_apply_f)(indexstore_record_reader_t,
                                               void *context,
                    bool(*applier)(void *context, indexstore_occurrence_t occur));

  bool
  (*record_reader_occurrences_in_line_range_apply_f)(indexstore_record_reader_t,
                                                             unsigned line_start,
                                                             unsigned line_count,
                                                             void *context,
                    bool(*applier)(void *context, indexstore_occurrence_t occur));

  bool
  (*record_reader_occurrences_of_symbols_apply_f)(indexstore_record_reader_t,
          indexstore_symbol_t *symbols, size_t symbols_count,
          indexstore_symbol_t *related_symbols, size_t related_symbols_count,
          void *context,
          bool(*applier)(void *context, indexstore_occurrence_t occur));


  indexstore_unit_reader_t
  (*unit_reader_create)(indexstore_t store, const char *unit_name,
                                indexstore_error_t *error);

  void
  (*unit_reader_dispose)(indexstore_unit_reader_t);

  indexstore_string_ref_t
  (*unit_reader_get_provider_identifier)(indexstore_unit_reader_t);

  indexstore_string_ref_t
  (*unit_reader_get_provider_version)(indexstore_unit_reader_t);

  void
  (*unit_reader_get_modification_time)(indexstore_unit_reader_t,
                                               int64_t *seconds,
                                               int64_t *nanoseconds);

  bool
  (*unit_reader_is_system_unit)(indexstore_unit_reader_t);

  bool
  (*unit_reader_is_module_unit)(indexstore_unit_reader_t);

  bool
  (*unit_reader_is_debug_compilation)(indexstore_unit_reader_t);

  bool
  (*unit_reader_has_main_file)(indexstore_unit_reader_t);

  indexstore_string_ref_t
  (*unit_reader_get_main_file)(indexstore_unit_reader_t);

  indexstore_string_ref_t
  (*unit_reader_get_module_name)(indexstore_unit_reader_t);

  indexstore_string_ref_t
  (*unit_reader_get_working_dir)(indexstore_unit_reader_t);

  indexstore_string_ref_t
  (*unit_reader_get_output_file)(indexstore_unit_reader_t);

  indexstore_string_ref_t
  (*unit_reader_get_sysroot_path)(indexstore_unit_reader_t);

  indexstore_string_ref_t
  (*unit_reader_get_target)(indexstore_unit_reader_t);


  indexstore_unit_dependency_kind_t
  (*unit_dependency_get_kind)(indexstore_unit_dependency_t);

  bool
  (*unit_dependency_is_system)(indexstore_unit_dependency_t);

  indexstore_string_ref_t
  (*unit_dependency_get_filepath)(indexstore_unit_dependency_t);

  indexstore_string_ref_t
  (*unit_dependency_get_modulename)(indexstore_unit_dependency_t);

  indexstore_string_ref_t
  (*unit_dependency_get_name)(indexstore_unit_dependency_t);

  indexstore_string_ref_t
  (*unit_include_get_source_path)(indexstore_unit_include_t);

  indexstore_string_ref_t
  (*unit_include_get_target_path)(indexstore_unit_include_t);

  unsigned
  (*unit_include_get_source_line)(indexstore_unit_include_t);

  #if INDEXSTORE_HAS_BLOCKS
  bool
  (*unit_reader_dependencies_apply)(indexstore_unit_reader_t,
                               bool(^applier)(indexstore_unit_dependency_t));

  bool
  (*unit_reader_includes_apply)(indexstore_unit_reader_t,
                               bool(^applier)(indexstore_unit_include_t));
  #endif

  bool
  (*unit_reader_dependencies_apply_f)(indexstore_unit_reader_t,
                                              void *context,
                     bool(*applier)(void *context, indexstore_unit_dependency_t));

  bool
  (*unit_reader_includes_apply_f)(indexstore_unit_reader_t,
                                          void *context,
                        bool(*applier)(void *context, indexstore_unit_include_t));

} indexstore_functions_t;


INDEXSTORE_END_DECLS

#endif