Radek Krejci | d0d1952 | 2015-09-02 13:49:25 +0200 | [diff] [blame] | 1 | /** |
| 2 | * \file config.h |
| 3 | * \author Radek Krejci <rkrejci@cesnet.cz> |
| 4 | * \brief libnetconf2 various configuration settings. |
| 5 | * |
Michal Vasko | f471fa0 | 2017-02-15 10:48:12 +0100 | [diff] [blame] | 6 | * Copyright (c) 2015 - 2017 CESNET, z.s.p.o. |
Radek Krejci | d0d1952 | 2015-09-02 13:49:25 +0200 | [diff] [blame] | 7 | * |
Radek Krejci | 9b81f5b | 2016-02-24 13:14:49 +0100 | [diff] [blame] | 8 | * This source code is licensed under BSD 3-Clause License (the "License"). |
| 9 | * You may not use this file except in compliance with the License. |
| 10 | * You may obtain a copy of the License at |
Michal Vasko | afd416b | 2016-02-25 14:51:46 +0100 | [diff] [blame] | 11 | * |
Radek Krejci | 9b81f5b | 2016-02-24 13:14:49 +0100 | [diff] [blame] | 12 | * https://opensource.org/licenses/BSD-3-Clause |
Radek Krejci | d0d1952 | 2015-09-02 13:49:25 +0200 | [diff] [blame] | 13 | */ |
| 14 | |
| 15 | #ifndef NC_CONFIG_H_ |
| 16 | #define NC_CONFIG_H_ |
| 17 | |
| 18 | /* |
David Sedlák | aae4df3 | 2018-10-08 22:27:22 +0200 | [diff] [blame^] | 19 | * Mark all objects as hidden and export only objects explicitly marked to be part of the public API or |
| 20 | * those marked as mock objects for testing purpose |
Radek Krejci | d0d1952 | 2015-09-02 13:49:25 +0200 | [diff] [blame] | 21 | */ |
| 22 | #define API __attribute__((visibility("default"))) |
David Sedlák | ddde449 | 2018-09-30 21:34:38 +0200 | [diff] [blame] | 23 | #define MOCK __attribute__((visibility("default"))) |
| 24 | |
Michal Vasko | 05ba9df | 2016-01-13 14:40:27 +0100 | [diff] [blame] | 25 | #ifdef __GNUC__ |
| 26 | # define UNUSED(x) UNUSED_ ## x __attribute__((__unused__)) |
| 27 | #else |
| 28 | # define UNUSED(x) UNUSED_ ## x |
| 29 | #endif |
| 30 | |
Radek Krejci | 14b1403 | 2015-10-21 15:19:43 +0200 | [diff] [blame] | 31 | /* |
Radek Krejci | 32898d5 | 2016-07-14 17:37:02 +0200 | [diff] [blame] | 32 | * Support for spinlocks |
| 33 | */ |
| 34 | #cmakedefine HAVE_SPINLOCK |
| 35 | #ifndef HAVE_SPINLOCK |
| 36 | # define pthread_spinlock_t pthread_mutex_t |
| 37 | # define pthread_spin_init(s, opt) pthread_mutex_init(s, NULL) |
| 38 | # define pthread_spin_lock pthread_mutex_lock |
| 39 | # define pthread_spin_trylock pthread_mutex_trylock |
| 40 | # define pthread_spin_unlock pthread_mutex_unlock |
| 41 | # define pthread_spin_destroy pthread_mutex_destroy |
| 42 | #endif |
| 43 | |
| 44 | /* |
Radek Krejci | 2847292 | 2016-07-15 11:51:16 +0200 | [diff] [blame] | 45 | * support for pthread_mutex_timedlock |
| 46 | */ |
| 47 | #cmakedefine HAVE_PTHREAD_MUTEX_TIMEDLOCK |
| 48 | |
| 49 | /* |
Radek Krejci | 14b1403 | 2015-10-21 15:19:43 +0200 | [diff] [blame] | 50 | * Location of installed basic YIN/YANG schemas |
| 51 | */ |
Michal Vasko | ff7e356 | 2018-02-15 13:41:22 +0100 | [diff] [blame] | 52 | #define NC_SCHEMAS_DIR "@SCHEMAS_DIR@" |
Radek Krejci | 14b1403 | 2015-10-21 15:19:43 +0200 | [diff] [blame] | 53 | |
Michal Vasko | 6b7c42e | 2016-03-02 15:46:41 +0100 | [diff] [blame] | 54 | /* |
Michal Vasko | f471fa0 | 2017-02-15 10:48:12 +0100 | [diff] [blame] | 55 | * Inactive read timeout |
Michal Vasko | 6b7c42e | 2016-03-02 15:46:41 +0100 | [diff] [blame] | 56 | */ |
Michal Vasko | f471fa0 | 2017-02-15 10:48:12 +0100 | [diff] [blame] | 57 | #define NC_READ_INACT_TIMEOUT @READ_INACTIVE_TIMEOUT@ |
| 58 | |
| 59 | /* |
| 60 | * Active read timeout in seconds |
| 61 | * (also used for internal <get-schema> RPC reply timeout) |
| 62 | */ |
| 63 | #define NC_READ_ACT_TIMEOUT @READ_ACTIVE_TIMEOUT@ |
Michal Vasko | 6b7c42e | 2016-03-02 15:46:41 +0100 | [diff] [blame] | 64 | |
Michal Vasko | afdb8ec | 2017-02-15 11:25:36 +0100 | [diff] [blame] | 65 | /* |
| 66 | * pspoll structure queue size (also found in nc_server.h) |
| 67 | */ |
| 68 | #define NC_PS_QUEUE_SIZE @MAX_PSPOLL_THREAD_COUNT@ |
| 69 | |
Radek Krejci | d0d1952 | 2015-09-02 13:49:25 +0200 | [diff] [blame] | 70 | #endif /* NC_CONFIG_H_ */ |