diff options
Diffstat (limited to 'libguile/boolean.h')
-rw-r--r-- | libguile/boolean.h | 69 |
1 files changed, 40 insertions, 29 deletions
diff --git a/libguile/boolean.h b/libguile/boolean.h index df72728ef..56b30a70c 100644 --- a/libguile/boolean.h +++ b/libguile/boolean.h @@ -1,29 +1,28 @@ -/* classes: h_files */ - #ifndef SCM_BOOLEAN_H #define SCM_BOOLEAN_H -/* Copyright (C) 1995,1996,2000, 2006, 2008, 2009, 2010, 2013 Free Software Foundation, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 3 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301 USA - */ +/* Copyright 1995-1996,2000,2006,2008-2010,2013,2018 + Free Software Foundation, Inc. + + This file is part of Guile. + + Guile is free software: you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Guile is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with Guile. If not, see + <https://www.gnu.org/licenses/>. */ -#include "libguile/__scm.h" +#include "libguile/scm.h" @@ -49,7 +48,7 @@ /* * See the comments preceeding the definitions of SCM_BOOL_F and - * SCM_MATCHES_BITS_IN_COMMON in tags.h for more information on + * SCM_MATCHES_BITS_IN_COMMON in scm.h for more information on * how the following macro works. */ #define scm_is_false_or_nil(x) \ @@ -69,7 +68,7 @@ * which will be ignored by SCM_MATCHES_BITS_IN_COMMON below. * * See the comments preceeding the definitions of SCM_BOOL_F and - * SCM_MATCHES_BITS_IN_COMMON in tags.h for more information. + * SCM_MATCHES_BITS_IN_COMMON in scm.h for more information. * * If SCM_ENABLE_ELISP is true, then scm_is_bool_or_nil(x) * returns 1 if and only if x is one of the following: SCM_BOOL_F, @@ -113,7 +112,7 @@ SCM_API int scm_to_bool (SCM x); * ignored by SCM_MATCHES_BITS_IN_COMMON below. * * See the comments preceeding the definitions of SCM_BOOL_F and - * SCM_MATCHES_BITS_IN_COMMON in tags.h for more information. + * SCM_MATCHES_BITS_IN_COMMON in scm.h for more information. * * scm_is_lisp_false(x) returns 1 if and only if x is one of the * following: SCM_BOOL_F, SCM_ELISP_NIL, SCM_EOL or @@ -122,18 +121,30 @@ SCM_API int scm_to_bool (SCM x); #define scm_is_lisp_false(x) \ (SCM_MATCHES_BITS_IN_COMMON ((x), SCM_BOOL_F, SCM_EOL)) + SCM_API SCM scm_not (SCM x); SCM_API SCM scm_boolean_p (SCM obj); SCM_API SCM scm_nil_p (SCM obj); + + + +#define SCM_VALIDATE_BOOL(pos, flag) \ + do { \ + SCM_ASSERT_TYPE (scm_is_bool (flag), flag, pos, FUNC_NAME, "boolean"); \ + } while (0) + +#define SCM_VALIDATE_BOOL_COPY(pos, flag, cvar) \ + do { \ + SCM_ASSERT (scm_is_bool (flag), flag, pos, FUNC_NAME); \ + cvar = scm_to_bool (flag); \ + } while (0) + + + + SCM_INTERNAL void scm_init_boolean (void); #endif /* SCM_BOOLEAN_H */ - -/* - Local Variables: - c-file-style: "gnu" - End: -*/ |