Blame fuzz/fuzzer.h

Packit 549fdc
/*
Packit 549fdc
 * Copyright(c) 2017 Free Software Foundation, Inc.
Packit 549fdc
 *
Packit 549fdc
 * GnuTLS is free software: you can redistribute it and/or modify
Packit 549fdc
 * it under the terms of the GNU Lesser General Public License as published by
Packit 549fdc
 * the Free Software Foundation, either version 3 of the License, or
Packit 549fdc
 * (at your option) any later version.
Packit 549fdc
 *
Packit 549fdc
 * GnuTLS is distributed in the hope that it will be useful,
Packit 549fdc
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 549fdc
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 549fdc
 * GNU Lesser General Public License for more details.
Packit 549fdc
 *
Packit 549fdc
 * You should have received a copy of the GNU Lesser General Public License
Packit 549fdc
 * along with gnutls.  If not, see <https://www.gnu.org/licenses/>.
Packit 549fdc
 */
Packit 549fdc
Packit 549fdc
#include <stddef.h> // size_t
Packit 549fdc
#include <stdint.h> // uint8_t
Packit 549fdc
#include <gnutls/gnutls.h>
Packit 549fdc
Packit 549fdc
#ifdef __cplusplus
Packit 549fdc
extern "C"
Packit 549fdc
#endif
Packit 549fdc
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
Packit 549fdc
Packit 549fdc
static void __attribute__((constructor)) init(void)
Packit 549fdc
{
Packit 549fdc
	gnutls_global_init();
Packit 549fdc
}
Packit 549fdc
Packit 549fdc
static void __attribute__((destructor)) deinit(void)
Packit 549fdc
{
Packit 549fdc
	gnutls_global_deinit();
Packit 549fdc
}