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
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
/**
* sentry-native
*
* sentry-native is a C client to send events to native from
* C and C++ applications. It can work together with breakpad/crashpad
* but also send events on its own.
*
* NOTE on encodings:
*
* Sentry will assume an encoding of UTF-8 for all string data that is captured
* and being sent to sentry as an Event.
* All the functions that are dealing with *paths* will assume an OS-specific
* encoding, typically ANSI on Windows, UTF-8 macOS, and the locale encoding on
* Linux; and they provide wchar-compatible alternatives on Windows which are
* preferred.
*/
extern "C" _WIN32
/* marks a function as part of the sentry API */
/* marks a function as experimental api */
/* context type dependencies */
/**
* The library internally uses the system malloc and free functions to manage
* memory. It does not use realloc. The reason for this is that on unix
* platforms we fall back to a simplistic page allocator once we have
* encountered a SIGSEGV or other terminating signal as malloc is no longer
* safe to use. Since we cannot portably reallocate allocations made on the
* pre-existing allocator we're instead not using realloc.
*
* Note also that after SIGSEGV sentry_free() becomes a noop.
*/
/**
* Allocates memory with the underlying allocator.
*/
SENTRY_API void *;
/**
* Releases memory allocated from the underlying allocator.
*/
SENTRY_API void ;
/**
* Legacy function. Alias for `sentry_free`.
*/
/* -- Protocol Value API -- */
/**
* Type of a sentry value.
*/
typedef enum sentry_value_type_t;
/**
* Represents a sentry protocol value.
*
* The members of this type should never be accessed. They are only here
* so that alignment for the type can be properly determined.
*
* Values must be released with `sentry_value_decref`. This lowers the
* internal refcount by one. If the refcount hits zero it's freed. Some
* values like primitives have no refcount (like null) so operations on
* those are no-ops.
*
* In addition values can be frozen. Some values like primitives are always
* frozen but lists and dicts are not and can be frozen on demand. This
* automatically happens for some shared values in the event payload like
* the module list.
*/
;
typedef union sentry_value_u sentry_value_t;
/**
* Increments the reference count on the value.
*/
SENTRY_API void ;
/**
* Decrements the reference count on the value.
*/
SENTRY_API void ;
/**
* Returns the refcount of a value.
*/
SENTRY_API size_t ;
/**
* Freezes a value.
*/
SENTRY_API void ;
/**
* Checks if a value is frozen.
*/
SENTRY_API int ;
/**
* Creates a null value.
*/
SENTRY_API sentry_value_t ;
/**
* Creates a new 32-bit signed integer value.
*/
SENTRY_API sentry_value_t ;
/**
* Creates a new double value.
*/
SENTRY_API sentry_value_t ;
/**
* Creates a new boolen value.
*/
SENTRY_API sentry_value_t ;
/**
* Creates a new null terminated string.
*/
SENTRY_API sentry_value_t ;
/**
* Creates a new list value.
*/
SENTRY_API sentry_value_t ;
/**
* Creates a new object.
*/
SENTRY_API sentry_value_t ;
/**
* Returns the type of the value passed.
*/
SENTRY_API sentry_value_type_t ;
/**
* Sets a key to a value in the map.
*
* This moves the ownership of the value into the map. The caller does not
* have to call `sentry_value_decref` on it.
*/
SENTRY_API int ;
/**
* This removes a value from the map by key.
*/
SENTRY_API int ;
/**
* Appends a value to a list.
*
* This moves the ownership of the value into the list. The caller does not
* have to call `sentry_value_decref` on it.
*/
SENTRY_API int ;
/**
* Inserts a value into the list at a certain position.
*
* This moves the ownership of the value into the list. The caller does not
* have to call `sentry_value_decref` on it.
*
* If the list is shorter than the given index it's automatically extended
* and filled with `null` values.
*/
SENTRY_API int ;
/**
* This removes a value from the list by index.
*/
SENTRY_API int ;
/**
* Looks up a value in a map by key. If missing a null value is returned.
* The returned value is borrowed.
*/
SENTRY_API sentry_value_t ;
/**
* Looks up a value in a map by key. If missing a null value is returned.
* The returned value is owned.
*
* If the caller no longer needs the value it must be released with
* `sentry_value_decref`.
*/
SENTRY_API sentry_value_t ;
/**
* Looks up a value in a list by index. If missing a null value is returned.
* The returned value is borrowed.
*/
SENTRY_API sentry_value_t ;
/**
* Looks up a value in a list by index. If missing a null value is
* returned. The returned value is owned.
*
* If the caller no longer needs the value it must be released with
* `sentry_value_decref`.
*/
SENTRY_API sentry_value_t ;
/**
* Returns the length of the given map or list.
*
* If an item is not a list or map the return value is 0.
*/
SENTRY_API size_t ;
/**
* Converts a value into a 32bit signed integer.
*/
SENTRY_API int32_t ;
/**
* Converts a value into a double value.
*/
SENTRY_API double ;
/**
* Returns the value as c string.
*/
SENTRY_API const char *;
/**
* Returns `true` if the value is boolean true.
*/
SENTRY_API int ;
/**
* Returns `true` if the value is null.
*/
SENTRY_API int ;
/**
* Serialize a sentry value to JSON.
*
* The string is freshly allocated and must be freed with
* `sentry_string_free`.
*/
SENTRY_API char *;
/**
* Sentry levels for events and breadcrumbs.
*/
typedef enum sentry_level_e sentry_level_t;
/**
* Creates a new empty Event value.
*
* See https://docs.sentry.io/platforms/native/enriching-events/ for how to
* further work with events, and https://develop.sentry.dev/sdk/event-payloads/
* for a detailed overview of the possible properties of an Event.
*/
SENTRY_API sentry_value_t ;
/**
* Creates a new Message Event value.
*
* See https://develop.sentry.dev/sdk/event-payloads/message/
*
* `logger` can be NULL to omit the logger value.
*/
SENTRY_API sentry_value_t ;
/**
* Creates a new Breadcrumb with a specific type and message.
*
* See https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/
*
* Either parameter can be NULL in which case no such attributes is created.
*/
SENTRY_API sentry_value_t ;
/**
* Creates a new Exception value.
*
* This is intended for capturing language-level exception, such as from a
* try-catch block. `type` and `value` here refer to the exception class and
* a possible description.
*
* See https://develop.sentry.dev/sdk/event-payloads/exception/
*
* The returned value needs to be attached to an event via
* `sentry_event_add_exception`.
*/
SENTRY_EXPERIMENTAL_API sentry_value_t ;
/**
* Creates a new Thread value.
*
* See https://develop.sentry.dev/sdk/event-payloads/threads/
*
* The returned value needs to be attached to an event via
* `sentry_event_add_thread`.
*
* `name` can be NULL.
*/
SENTRY_EXPERIMENTAL_API sentry_value_t ;
/**
* Creates a new Stack Trace conforming to the Stack Trace Interface.
*
* See https://develop.sentry.dev/sdk/event-payloads/stacktrace/
*
* The returned object needs to be attached to either an exception
* event, or a thread object.
*
* If `ips` is NULL the current stack trace is captured, otherwise `len`
* stack trace instruction pointers are attached to the event.
*/
SENTRY_EXPERIMENTAL_API sentry_value_t ;
/**
* Adds an Exception to an Event value.
*
* This takes ownership of the `exception`.
*/
SENTRY_EXPERIMENTAL_API void ;
/**
* Adds a Thread to an Event value.
*
* This takes ownership of the `thread`.
*/
SENTRY_EXPERIMENTAL_API void ;
/* -- Experimental APIs -- */
/**
* Serialize a sentry value to msgpack.
*
* The string is freshly allocated and must be freed with
* `sentry_string_free`. Since msgpack is not zero terminated
* the size is written to the `size_out` parameter.
*/
SENTRY_EXPERIMENTAL_API char *;
/**
* Adds a stack trace to an event.
*
* The stack trace is added as part of a new thread object.
* This function is **deprecated** in favor of using
* `sentry_value_new_stacktrace` in combination with `sentry_value_new_thread`
* and `sentry_event_add_thread`.
*
* If `ips` is NULL the current stack trace is captured, otherwise `len`
* stack trace instruction pointers are attached to the event.
*/
SENTRY_EXPERIMENTAL_API void ;
/**
* This represents the OS dependent user context in the case of a crash, and can
* be used to manually capture a crash.
*/
typedef struct sentry_ucontext_s sentry_ucontext_t;
/**
* Unwinds the stack from the given address.
*
* If the address is given in `addr` the stack is unwound form there.
* Otherwise (NULL is passed) the current instruction pointer is used as
* start address. The stack trace is written to `stacktrace_out` with up to
* `max_len` frames being written. The actual number of unwound stackframes
* is returned.
*/
SENTRY_EXPERIMENTAL_API size_t ;
/**
* Unwinds the stack from the given context.
*
* The stack trace is written to `stacktrace_out` with up to `max_len` frames
* being written. The actual number of unwound stackframes is returned.
*/
SENTRY_EXPERIMENTAL_API size_t ;
/**
* A UUID
*/
typedef struct sentry_uuid_s sentry_uuid_t;
/**
* Creates the nil uuid.
*/
SENTRY_API sentry_uuid_t ;
/**
* Creates a new uuid4.
*/
SENTRY_API sentry_uuid_t ;
/**
* Parses a uuid from a string.
*/
SENTRY_API sentry_uuid_t ;
/**
* Creates a uuid from bytes.
*/
SENTRY_API sentry_uuid_t ;
/**
* Checks if the uuid is nil.
*/
SENTRY_API int ;
/**
* Returns the bytes of the uuid.
*/
SENTRY_API void ;
/**
* Formats the uuid into a string buffer.
*/
SENTRY_API void ;
/**
* A Sentry Envelope.
*
* The Envelope is an abstract type which represents a payload being sent to
* sentry. It can contain one or more items, typically an Event.
* See https://develop.sentry.dev/sdk/envelopes/
*/
;
typedef struct sentry_envelope_s sentry_envelope_t;
/**
* Frees an envelope.
*/
SENTRY_API void ;
/**
* Given an envelope returns the embedded event if there is one.
*
* This returns a borrowed value to the event in the envelope.
*/
SENTRY_API sentry_value_t ;
/**
* Serializes the envelope.
*
* The return value needs to be freed with sentry_string_free().
*/
SENTRY_API char *;
/**
* Serializes the envelope into a file.
*
* `path` is assumed to be in platform-specific filesystem path encoding.
*
* Returns 0 on success.
*/
SENTRY_API int ;
/**
* The Sentry Client Options.
*
* See https://docs.sentry.io/error-reporting/configuration/
*/
;
typedef struct sentry_options_s sentry_options_t;
/**
* This represents an interface for user-defined transports.
*
* Transports are responsible for sending envelopes to sentry and are the last
* step in the event pipeline.
*
* Envelopes will be submitted to the transport in a _fire and forget_ fashion,
* and the transport must send those envelopes _in order_.
*
* A transport has the following hooks, all of which
* take the user provided `state` as last parameter. The transport state needs
* to be set with `sentry_transport_set_state` and typically holds handles and
* other information that can be reused across requests.
*
* * `send_func`: This function will take ownership of an envelope, and is
* responsible for freeing it via `sentry_envelope_free`.
* * `startup_func`: This hook will be called by sentry inside of `sentry_init`
* and instructs the transport to initialize itself. Failures will bubble up
* to `sentry_init`.
* * `shutdown_func`: Instructs the transport to flush its queue and shut down.
* This hook receives a millisecond-resolution `timeout` parameter and should
* return `true` when the transport was flushed and shut down successfully.
* In case of `false`, sentry will log an error, but continue with freeing the
* transport.
* * `free_func`: Frees the transports `state`. This hook might be called even
* though `shutdown_func` returned `false` previously.
*
* The transport interface might be extended in the future with hooks to flush
* its internal queue without shutting down, and to dump its internal queue to
* disk in case of a hard crash.
*/
;
typedef struct sentry_transport_s sentry_transport_t;
/**
* Creates a new transport with an initial `send_func`.
*/
SENTRY_API sentry_transport_t *;
/**
* Sets the transport `state`.
*
* If the state is owned by the transport and needs to be freed, use
* `sentry_transport_set_free_func` to set an appropriate hook.
*/
SENTRY_API void ;
/**
* Sets the transport hook to free the transport `state`.
*/
SENTRY_API void ;
/**
* Sets the transport startup hook.
*
* This hook is called from within `sentry_init` and will get a reference to the
* options which can be used to initialize a transports internal state.
* It should return `0` on success. A failure will bubble up to `sentry_init`.
*/
SENTRY_API void ;
/**
* Sets the transport shutdown hook.
*
* This hook will receive a millisecond-resolution timeout.
* It should return `0` on success in case all the pending envelopes have been
* sent within the timeout, or `1` if the timeout was hit.
*/
SENTRY_API void ;
/**
* Generic way to free a transport.
*/
SENTRY_API void ;
/**
* Create a new function transport.
*
* It is a convenience function which works with a borrowed `data`, and will
* automatically free the envelope, so the user provided function does not need
* to do that.
*
* This function is *deprecated* and will be removed in a future version.
* It is here for backwards compatibility. Users should migrate to the
* `sentry_transport_new` API.
*/
SENTRY_API sentry_transport_t *;
/* -- Options APIs -- */
/**
* The state of user consent.
*/
typedef enum sentry_user_consent_t;
/**
* Creates a new options struct.
* Can be freed with `sentry_options_free`.
*/
SENTRY_API sentry_options_t *;
/**
* Deallocates previously allocated sentry options.
*/
SENTRY_API void ;
/**
* Sets a transport.
*/
SENTRY_API void ;
/**
* Type of the `before_send` callback.
*
* The callback takes ownership of the `event`, and should usually return that
* same event. In case the event should be discarded, the callback needs to
* call `sentry_value_decref` on the provided event, and return a
* `sentry_value_new_null()` instead.
*
* This function may be invoked inside of a signal handler and must be safe for
* that purpose, see https://man7.org/linux/man-pages/man7/signal-safety.7.html.
* On Windows, it may be called from inside of a `UnhandledExceptionFilter`, see
* the documentation on SEH (structured exception handling) for more information
* https://docs.microsoft.com/en-us/windows/win32/debug/structured-exception-handling
*/
typedef ;
/**
* Sets the `before_send` callback.
*
* See the `sentry_event_function_t` typedef above for more information.
*/
SENTRY_API void ;
/**
* Sets the DSN.
*/
SENTRY_API void ;
/**
* Gets the DSN.
*/
SENTRY_API const char *;
/**
* Sets the sample rate, which should be a double between `0.0` and `1.0`.
* Sentry will randomly discard any event that is captured using
* `sentry_capture_event` when a sample rate < 1 is set.
*/
SENTRY_API void ;
/**
* Gets the sample rate.
*/
SENTRY_API double ;
/**
* Sets the release.
*/
SENTRY_API void ;
/**
* Gets the release.
*/
SENTRY_API const char *;
/**
* Sets the environment.
*/
SENTRY_API void ;
/**
* Gets the environment.
*/
SENTRY_API const char *;
/**
* Sets the dist.
*/
SENTRY_API void ;
/**
* Gets the dist.
*/
SENTRY_API const char *;
/**
* Configures the http proxy.
*
* The given proxy has to include the full scheme, eg. `http://some.proxy/`.
*/
SENTRY_API void ;
/**
* Returns the configured http proxy.
*/
SENTRY_API const char *;
/**
* Configures the path to a file containing ssl certificates for
* verification.
*/
SENTRY_API void ;
/**
* Returns the configured path for ca certificates.
*/
SENTRY_API const char *;
/**
* Configures the name of the http transport thread.
*/
SENTRY_API void ;
/**
* Returns the configured http transport thread name.
*/
SENTRY_API const char *;
/**
* Enables or disables debug printing mode.
*/
SENTRY_API void ;
/**
* Returns the current value of the debug flag.
*/
SENTRY_API int ;
/**
* Sets the number of breadcrumbs being tracked and attached to events.
*
* Defaults to 100.
*/
SENTRY_API void ;
/**
* Gets the number of breadcrumbs being tracked and attached to events.
*/
SENTRY_API size_t ;
/**
* Type of the callback for logger function.
*/
typedef void ;
/**
* Sets the sentry-native logger function.
*
* Used for logging debug events when the `debug` option is set to true.
*/
SENTRY_API void ;
/**
* Enables or disables automatic session tracking.
*
* Automatic session tracking is enabled by default and is equivalent to calling
* `sentry_start_session` after startup.
* There can only be one running session, and the current session will always be
* closed implicitly by `sentry_close`, when starting a new session with
* `sentry_start_session`, or manually by calling `sentry_end_session`.
*/
SENTRY_API void ;
/**
* Returns true if automatic session tracking is enabled.
*/
SENTRY_API int ;
/**
* Enables or disables user consent requirements for uploads.
*
* This disables uploads until the user has given the consent to the SDK.
* Consent itself is given with `sentry_user_consent_give` and
* `sentry_user_consent_revoke`.
*/
SENTRY_API void ;
/**
* Returns true if user consent is required.
*/
SENTRY_API int ;
/**
* Enables or disables on-device symbolication of stack traces.
*
* This feature can have a performance impact, and is enabled by default on
* Android. It is usually only needed when it is not possible to provide debug
* information files for system libraries which are needed for serverside
* symbolication.
*/
SENTRY_API void ;
/**
* Returns true if on-device symbolication of stack traces is enabled.
*/
SENTRY_API int ;
/**
* Adds a new attachment to be sent along.
*
* `path` is assumed to be in platform-specific filesystem path encoding.
* API Users on windows are encouraged to use `sentry_options_add_attachmentw`
* instead.
*/
SENTRY_API void ;
/**
* Sets the path to the crashpad handler if the crashpad backend is used.
*
* The path defaults to the `crashpad_handler`/`crashpad_handler.exe`
* executable, depending on platform, which is expected to be present in the
* same directory as the app executable.
*
* It is recommended that library users set an explicit handler path, depending
* on the directory/executable structure of their app.
*
* `path` is assumed to be in platform-specific filesystem path encoding.
* API Users on windows are encouraged to use `sentry_options_set_handler_pathw`
* instead.
*/
SENTRY_API void ;
/**
* Sets the path to the Sentry Database Directory.
*
* Sentry will use this path to persist user consent, sessions, and other
* artifacts in case of a crash. This will also be used by the crashpad backend
* if it is configured.
*
* The directory is used for "cached" data, which needs to persist across
* application restarts to ensure proper flagging of release-health sessions,
* but might otherwise be safely purged regularly.
*
* It is roughly equivalent to the type of `AppData/Local` on Windows and
* `XDG_CACHE_HOME` on Linux, and equivalent runtime directories on other
* platforms.
*
* It is recommended that users set an explicit absolute path, depending
* on their apps runtime directory. The path will be created if it does not
* exist, and will be resolved to an absolute path inside of `sentry_init`. The
* directory should not be shared with other application data/configuration, as
* sentry-native will enumerate and possibly delete files in that directory. An
* example might be `$XDG_CACHE_HOME/your-app/sentry`
*
* If no explicit path it set, sentry-native will default to `.sentry-native` in
* the current working directory, with no specific platform-specific handling.
*
* `path` is assumed to be in platform-specific filesystem path encoding.
* API Users on windows are encouraged to use
* `sentry_options_set_database_pathw` instead.
*/
SENTRY_API void ;
/**
* Wide char version of `sentry_options_add_attachment`.
*/
SENTRY_API void ;
/**
* Wide char version of `sentry_options_set_handler_path`.
*/
SENTRY_API void ;
/**
* Wide char version of `sentry_options_set_database_path`.
*/
SENTRY_API void ;
/**
* Enables forwarding to the system crash reporter. Disabled by default.
*
* This setting only has an effect when using Crashpad on macOS. If enabled,
* Crashpad forwards crashes to the macOS system crash reporter. Depending
* on the crash, this may impact the crash time. Even if enabled, Crashpad
* may choose not to forward certain crashes.
*/
SENTRY_API void ;
/* -- Global APIs -- */
/**
* Initializes the Sentry SDK with the specified options.
*
* This takes ownership of the options. After the options have been set
* they cannot be modified any more.
* Depending on the configured transport and backend, this function might not be
* fully thread-safe.
* Returns 0 on success.
*/
SENTRY_API int ;
/**
* Shuts down the sentry client and forces transports to flush out.
*
* Returns 0 on success.
*/
SENTRY_API int ;
/**
* Shuts down the sentry client and forces transports to flush out.
*
* This is a **deprecated** alias for `sentry_close`.
*
* Returns 0 on success.
*/
SENTRY_API int ;
/**
* This will lazily load and cache a list of all the loaded libraries.
*
* Returns a new reference to an immutable, frozen list.
* The reference must be released with `sentry_value_decref`.
*/
SENTRY_EXPERIMENTAL_API sentry_value_t ;
/**
* Clears the internal module cache.
*
* For performance reasons, sentry will cache the list of loaded libraries when
* capturing events. This cache can get out-of-date when loading or unloading
* libraries at runtime. It is therefore recommended to call
* `sentry_clear_modulecache` when doing so, to make sure that the next call to
* `sentry_capture_event` will have an up-to-date module list.
*/
SENTRY_EXPERIMENTAL_API void ;
/**
* Re-initializes the Sentry backend.
*
* This is needed if a third-party library overrides the previously installed
* signal handler. Calling this function can be potentially dangerous and should
* only be done when necessary.
*
* Returns 0 on success.
*/
SENTRY_EXPERIMENTAL_API int ;
/**
* Gives user consent.
*/
SENTRY_API void ;
/**
* Revokes user consent.
*/
SENTRY_API void ;
/**
* Resets the user consent (back to unknown).
*/
SENTRY_API void ;
/**
* Checks the current state of user consent.
*/
SENTRY_API sentry_user_consent_t ;
/**
* Sends a sentry event.
*/
SENTRY_API sentry_uuid_t ;
/**
* Captures an exception to be handled by the backend.
*
* This is safe to be called from a crashing thread and may not return.
*/
SENTRY_EXPERIMENTAL_API void ;
/**
* Adds the breadcrumb to be sent in case of an event.
*/
SENTRY_API void ;
/**
* Sets the specified user.
*/
SENTRY_API void ;
/**
* Removes a user.
*/
SENTRY_API void ;
/**
* Sets a tag.
*/
SENTRY_API void ;
/**
* Removes the tag with the specified key.
*/
SENTRY_API void ;
/**
* Sets extra information.
*/
SENTRY_API void ;
/**
* Removes the extra with the specified key.
*/
SENTRY_API void ;
/**
* Sets a context object.
*/
SENTRY_API void ;
/**
* Removes the context object with the specified key.
*/
SENTRY_API void ;
/**
* Sets the event fingerprint.
*
* This accepts a variable number of arguments, and needs to be terminated by a
* trailing `NULL`.
*/
SENTRY_API void ;
/**
* Removes the fingerprint.
*/
SENTRY_API void ;
/**
* Sets the transaction.
*/
SENTRY_API void ;
/**
* Removes the transaction.
*/
SENTRY_API void ;
/**
* Sets the event level.
*/
SENTRY_API void ;
/**
* Starts a new session.
*/
SENTRY_API void ;
/**
* Ends a session.
*/
SENTRY_API void ;
}