diff options
author | Andy Wingo <wingo@pobox.com> | 2018-06-18 09:44:35 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2018-06-18 09:44:35 +0200 |
commit | 8a6f46ee96e0946e539e3a33c95c3228b63e9fb3 (patch) | |
tree | 6df1b84f414e46add11e2329f89f15d26a647752 /libguile/alist.h | |
parent | be18b507735ccb6006dcd9a58cba7119b43b7d7c (diff) | |
download | guile-8a6f46ee96e0946e539e3a33c95c3228b63e9fb3.tar.gz |
More validate.h devolution
* libguile/validate.h:
* libguile/alist.h (SCM_VALIDATE_ALISTCELL, SCM_VALIDATE_ALISTCELL_COPYSCM)
* libguile/bytevectors.h (SCM_VALIDATE_BYTEVECTOR)
* libguile/chars.h (SCM_VALIDATE_CHAR, SCM_VALIDATE_CHAR_COPY):
* libguile/print.h (SCM_VALIDATE_OPORT_VALUE, SCM_VALIDATE_PRINTSTATE):
* libguile/procs.h (SCM_VALIDATE_THUNK)
* libguile/smob.h (SCM_VALIDATE_SMOB)
* libguile/strings.h (SCM_VALIDATE_STRING): Devolve these macros from
validate.h.
Diffstat (limited to 'libguile/alist.h')
-rw-r--r-- | libguile/alist.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/libguile/alist.h b/libguile/alist.h index 77c565608..2462452ec 100644 --- a/libguile/alist.h +++ b/libguile/alist.h @@ -3,7 +3,8 @@ #ifndef SCM_ALIST_H #define SCM_ALIST_H -/* Copyright (C) 1995,1996,2000, 2006, 2008 Free Software Foundation, Inc. +/* Copyright (C) 1995-1996,2000,2006,2008,2018 + * 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 @@ -24,6 +25,25 @@ #include "libguile/__scm.h" +#include <libguile/error.h> +#include "libguile/pairs.h" + + + + +#define SCM_VALIDATE_ALISTCELL(pos, alist) \ + do { \ + SCM_ASSERT (scm_is_pair (alist) && scm_is_pair (SCM_CAR (alist)), \ + alist, pos, FUNC_NAME); \ + } while (0) + +#define SCM_VALIDATE_ALISTCELL_COPYSCM(pos, alist, cvar) \ + do { \ + SCM_ASSERT (scm_is_pair (alist), alist, pos, FUNC_NAME); \ + cvar = SCM_CAR (alist); \ + SCM_ASSERT (scm_is_pair (cvar), alist, pos, FUNC_NAME); \ + } while (0) + |