common_interface_defs.h revision 1.1
1//===-- sanitizer/common_interface_defs.h -----------------------*- C++ -*-===//
2//
3// This file is distributed under the University of Illinois Open Source
4// License. See LICENSE.TXT for details.
5//
6//===----------------------------------------------------------------------===//
7//
8// Common part of the public sanitizer interface.
9//===----------------------------------------------------------------------===//
10
11#ifndef SANITIZER_COMMON_INTERFACE_DEFS_H
12#define SANITIZER_COMMON_INTERFACE_DEFS_H
13
14#include <stddef.h>
15#include <stdint.h>
16
17// GCC does not understand __has_feature.
18#if !defined(__has_feature)
19# define __has_feature(x) 0
20#endif
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25  // Tell the tools to write their reports to "path.<pid>" instead of stderr.
26  void __sanitizer_set_report_path(const char *path);
27
28  // Tell the tools to write their reports to given file descriptor instead of
29  // stderr.
30  void __sanitizer_set_report_fd(int fd);
31
32  // Notify the tools that the sandbox is going to be turned on. The reserved
33  // parameter will be used in the future to hold a structure with functions
34  // that the tools may call to bypass the sandbox.
35  void __sanitizer_sandbox_on_notify(void *reserved);
36
37  // This function is called by the tool when it has just finished reporting
38  // an error. 'error_summary' is a one-line string that summarizes
39  // the error message. This function can be overridden by the client.
40  void __sanitizer_report_error_summary(const char *error_summary);
41
42#ifdef __cplusplus
43}  // extern "C"
44#endif
45
46#endif  // SANITIZER_COMMON_INTERFACE_DEFS_H
47