summaryrefslogtreecommitdiff
path: root/libguile/chars.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2018-06-18 09:44:35 +0200
committerAndy Wingo <wingo@pobox.com>2018-06-18 09:44:35 +0200
commit8a6f46ee96e0946e539e3a33c95c3228b63e9fb3 (patch)
tree6df1b84f414e46add11e2329f89f15d26a647752 /libguile/chars.h
parentbe18b507735ccb6006dcd9a58cba7119b43b7d7c (diff)
downloadguile-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/chars.h')
-rw-r--r--libguile/chars.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/libguile/chars.h b/libguile/chars.h
index 488dd255f..26ba7acd2 100644
--- a/libguile/chars.h
+++ b/libguile/chars.h
@@ -3,7 +3,8 @@
#ifndef SCM_CHARS_H
#define SCM_CHARS_H
-/* Copyright (C) 1995,1996,2000,2001,2004, 2006, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1996,2000-2001,2004,2006,2008-2009,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,7 @@
#include "libguile/__scm.h"
+#include <libguile/error.h>
#ifndef SCM_T_WCHAR_DEFINED
typedef scm_t_int32 scm_t_wchar;
@@ -57,6 +59,14 @@ typedef scm_t_int32 scm_t_wchar;
|| ((scm_t_wchar) (c) > SCM_CODEPOINT_SURROGATE_END \
&& (scm_t_wchar) (c) <= SCM_CODEPOINT_MAX))
+#define SCM_VALIDATE_CHAR(pos, scm) SCM_MAKE_VALIDATE_MSG (pos, scm, CHARP, "character")
+
+#define SCM_VALIDATE_CHAR_COPY(pos, scm, cvar) \
+ do { \
+ SCM_ASSERT (SCM_CHARP (scm), scm, pos, FUNC_NAME); \
+ cvar = SCM_CHAR (scm); \
+ } while (0)
+
SCM_API SCM scm_char_p (SCM x);