1 /* Macros to check if a POSIX configuration variable is defined or set.
2 
3    Copyright (C) 1991-2022 Free Software Foundation, Inc.
4    This file is part of the GNU C Library.
5 
6    The GNU C Library is free software; you can redistribute it and/or
7    modify it under the terms of the GNU Lesser General Public
8    License as published by the Free Software Foundation; either
9    version 2.1 of the License, or (at your option) any later version.
10 
11    The GNU C Library is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Lesser General Public License for more details.
15 
16    You should have received a copy of the GNU Lesser General Public
17    License along with the GNU C Library; if not, see
18    <https://www.gnu.org/licenses/>.  */
19 
20 #ifndef _POSIX_CONF_VARS_H
21 #define _POSIX_CONF_VARS_H
22 
23 /* The script gen-posix-conf-vars.awk generates the header
24    posix-conf-vars-def.h from the list file posix-conf-vars.list and defines
25    CONF_DEF_* macros for each entry in the list file set to either of
26    CONF_DEF_UNDEFINED, CONF_DEF_DEFINED_SET or CONF_DEF_DEFINED_UNSET.  To
27    check configuration variables within glibc code, use the configuration macro
28    functions instead of checking for definitions of the macros.  */
29 
30 #include <posix-conf-vars-def.h>
31 
32 #define CONF_DEF_UNDEFINED	1
33 #define CONF_DEF_DEFINED_SET	2
34 #define CONF_DEF_DEFINED_UNSET	3
35 
36 /* The configuration variable is not defined.  */
37 #define CONF_IS_UNDEFINED(conf) (CONF_DEF##conf == CONF_DEF_UNDEFINED)
38 
39 /* The configuration variable is defined.  It may or may not be set.  */
40 #define CONF_IS_DEFINED(conf) (CONF_DEF##conf != CONF_DEF_UNDEFINED)
41 
42 /* The configuration variable is defined and set.  */
43 #define CONF_IS_DEFINED_SET(conf) (CONF_DEF##conf == CONF_DEF_DEFINED_SET)
44 
45 /* The configuration variable is defined but not set.  */
46 #define CONF_IS_DEFINED_UNSET(conf) (CONF_DEF##conf == CONF_DEF_DEFINED_UNSET)
47 
48 #endif
49