blob: 7b592e85486a3cb60c21f651c7be5c547d403ff5 [file] [log] [blame]
/**
* \file config.h
* \author Radek Krejci <rkrejci@cesnet.cz>
* \brief libnetconf2 various configuration settings.
*
* Copyright (c) 2015 - 2017 CESNET, z.s.p.o.
*
* This source code is licensed under BSD 3-Clause License (the "License").
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://opensource.org/licenses/BSD-3-Clause
*/
#ifndef NC_CONFIG_H_
#define NC_CONFIG_H_
/*
* Mark all objects as hidden and export only objects explicitly marked to be part of the public API.
*/
#define API __attribute__((visibility("default")))
#ifdef __GNUC__
# define UNUSED(x) UNUSED_ ## x __attribute__((__unused__))
#else
# define UNUSED(x) UNUSED_ ## x
#endif
/*
* Support for spinlocks
*/
#cmakedefine HAVE_SPINLOCK
#ifndef HAVE_SPINLOCK
# define pthread_spinlock_t pthread_mutex_t
# define pthread_spin_init(s, opt) pthread_mutex_init(s, NULL)
# define pthread_spin_lock pthread_mutex_lock
# define pthread_spin_trylock pthread_mutex_trylock
# define pthread_spin_unlock pthread_mutex_unlock
# define pthread_spin_destroy pthread_mutex_destroy
#endif
/*
* support for pthread_mutex_timedlock
*/
#cmakedefine HAVE_PTHREAD_MUTEX_TIMEDLOCK
/*
* Location of installed basic YIN/YANG schemas
*/
#define SCHEMAS_DIR "@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@"
/*
* Inactive read timeout
*/
#define NC_READ_INACT_TIMEOUT @READ_INACTIVE_TIMEOUT@
/*
* Active read timeout in seconds
* (also used for internal <get-schema> RPC reply timeout)
*/
#define NC_READ_ACT_TIMEOUT @READ_ACTIVE_TIMEOUT@
/*
* pspoll structure queue size (also found in nc_server.h)
*/
#define NC_PS_QUEUE_SIZE @MAX_PSPOLL_THREAD_COUNT@
#endif /* NC_CONFIG_H_ */