blob: 2672a385478d198f7069b2869e59c87e2ec82d1a [file] [log] [blame]
Dan Liewd3c33112016-06-02 05:48:02 +00001//===- FuzzerExtFunctions.h - Interface to external functions ---*- C++ -* ===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9// Defines an interface to (possibly optional) functions.
10//===----------------------------------------------------------------------===//
Marcos Pividori178fe582016-12-13 17:46:11 +000011
Dan Liewd3c33112016-06-02 05:48:02 +000012#ifndef LLVM_FUZZER_EXT_FUNCTIONS_H
13#define LLVM_FUZZER_EXT_FUNCTIONS_H
14
15#include <stddef.h>
16#include <stdint.h>
17
18namespace fuzzer {
19
20struct ExternalFunctions {
Dan Liew1873a492016-06-07 23:32:50 +000021 // Initialize function pointers. Functions that are not available will be set
22 // to nullptr. Do not call this constructor before ``main()`` has been
23 // entered.
Dan Liewd3c33112016-06-02 05:48:02 +000024 ExternalFunctions();
25
26#define EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN) \
27 RETURN_TYPE(*NAME) FUNC_SIG = nullptr
28
29#include "FuzzerExtFunctions.def"
30
31#undef EXT_FUNC
32};
33} // namespace fuzzer
Marcos Pividori178fe582016-12-13 17:46:11 +000034
Dan Liewd3c33112016-06-02 05:48:02 +000035#endif