2001-08-31 10:42:19 +00:00
|
|
|
|
#ifndef SCM_KEYWORDS_H
|
|
|
|
|
|
#define SCM_KEYWORDS_H
|
|
|
|
|
|
|
2018-06-18 10:23:04 +02:00
|
|
|
|
/* Copyright (C) 1995-1996,1999-2001,2006,2008,2015,2018
|
|
|
|
|
|
* Free Software Foundation, Inc.
|
2001-08-31 10:42:19 +00:00
|
|
|
|
*
|
2003-04-05 19:15:35 +00:00
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2009-06-17 00:22:09 +01:00
|
|
|
|
* 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.
|
2001-08-31 10:42:19 +00:00
|
|
|
|
*
|
2009-06-17 00:22:09 +01:00
|
|
|
|
* This library is distributed in the hope that it will be useful, but
|
|
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
2003-04-05 19:15:35 +00:00
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
|
* Lesser General Public License for more details.
|
2001-08-31 10:42:19 +00:00
|
|
|
|
*
|
2003-04-05 19:15:35 +00:00
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2009-06-17 00:22:09 +01:00
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
|
|
* 02110-1301 USA
|
2003-04-05 19:15:35 +00:00
|
|
|
|
*/
|
1999-12-16 03:46:42 +00:00
|
|
|
|
|
1999-03-14 16:50:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
2018-06-18 10:23:04 +02:00
|
|
|
|
#include <libguile/error.h>
|
2018-06-20 09:25:20 +02:00
|
|
|
|
#include <libguile/snarf.h>
|
1999-03-14 16:50:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-11-02 00:19:12 +00:00
|
|
|
|
SCM_API SCM scm_keyword_p (SCM obj);
|
* keywords.h, keywords.c, deprecated.h, deprecated.c
(SCM_KEYWORDP, SCM_KEYWORDSYM): Deprecated and implemented in
terms of scm_is_keyword and scm_keyword_dash_symbol.
* keywords.h, keywords.c, discouraged.h, discouraged.c
(scm_make_keyword_from_dash_symbol, scm_keyword_dash_symbol,
scm_c_make_keyword): Discouraged.
* keywords.h, keywords.c (scm_symbol_to_keyword,
scm_keyword_to_symbol): Implemented in C.
(scm_is_keyword, scm_from_locale_keyword,
scm_from_locale_keywordn): New.
2004-10-04 17:02:01 +00:00
|
|
|
|
SCM_API SCM scm_symbol_to_keyword (SCM symbol);
|
|
|
|
|
|
SCM_API SCM scm_keyword_to_symbol (SCM keyword);
|
|
|
|
|
|
|
|
|
|
|
|
SCM_API int scm_is_keyword (SCM val);
|
2011-03-09 01:14:43 -05:00
|
|
|
|
SCM_API SCM scm_from_locale_keyword (const char *name);
|
|
|
|
|
|
SCM_API SCM scm_from_locale_keywordn (const char *name, size_t len);
|
|
|
|
|
|
SCM_API SCM scm_from_latin1_keyword (const char *name);
|
|
|
|
|
|
SCM_API SCM scm_from_utf8_keyword (const char *name);
|
* keywords.h, keywords.c, deprecated.h, deprecated.c
(SCM_KEYWORDP, SCM_KEYWORDSYM): Deprecated and implemented in
terms of scm_is_keyword and scm_keyword_dash_symbol.
* keywords.h, keywords.c, discouraged.h, discouraged.c
(scm_make_keyword_from_dash_symbol, scm_keyword_dash_symbol,
scm_c_make_keyword): Discouraged.
* keywords.h, keywords.c (scm_symbol_to_keyword,
scm_keyword_to_symbol): Implemented in C.
(scm_is_keyword, scm_from_locale_keyword,
scm_from_locale_keywordn): New.
2004-10-04 17:02:01 +00:00
|
|
|
|
|
2018-06-18 10:23:04 +02:00
|
|
|
|
#define SCM_VALIDATE_KEYWORD(pos, v) \
|
|
|
|
|
|
SCM_MAKE_VALIDATE_MSG (pos, v, KEYWORDP, "keyword")
|
|
|
|
|
|
|
2018-06-20 09:25:20 +02:00
|
|
|
|
#define SCM_KEYWORD(c_name, scheme_name) \
|
|
|
|
|
|
SCM_SNARF_HERE(static SCM c_name) \
|
|
|
|
|
|
SCM_SNARF_INIT(c_name = scm_from_locale_keyword (scheme_name))
|
|
|
|
|
|
|
|
|
|
|
|
#define SCM_GLOBAL_KEYWORD(c_name, scheme_name) \
|
|
|
|
|
|
SCM_SNARF_HERE(SCM c_name) \
|
|
|
|
|
|
SCM_SNARF_INIT(c_name = scm_from_locale_keyword (scheme_name))
|
|
|
|
|
|
|
2013-04-06 13:36:24 -04:00
|
|
|
|
enum scm_keyword_arguments_flags
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM_ALLOW_OTHER_KEYS = (1U << 0),
|
|
|
|
|
|
SCM_ALLOW_NON_KEYWORD_ARGUMENTS = (1U << 1)
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum scm_keyword_arguments_flags scm_t_keyword_arguments_flags;
|
|
|
|
|
|
|
|
|
|
|
|
SCM_API void
|
|
|
|
|
|
scm_c_bind_keyword_arguments (const char *subr, SCM rest,
|
|
|
|
|
|
scm_t_keyword_arguments_flags flags, ...);
|
|
|
|
|
|
|
2008-05-14 05:20:47 +02:00
|
|
|
|
SCM_INTERNAL void scm_init_keywords (void);
|
1999-03-14 16:50:01 +00:00
|
|
|
|
|
2001-08-31 10:42:19 +00:00
|
|
|
|
#endif /* SCM_KEYWORDS_H */
|