diff options
author | Mark H Weaver <mhw@netris.org> | 2011-03-09 01:14:43 -0500 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2011-03-09 01:14:43 -0500 |
commit | c428e58681fbd006d253bda51b3543110b317b8d (patch) | |
tree | 9b8f3108cab9cad997bc876aba8af64362336dad /doc/ref/api-data.texi | |
parent | ce3ce21c623771ecafdf80c98519e80048cfedb7 (diff) | |
download | guile-c428e58681fbd006d253bda51b3543110b317b8d.tar.gz |
Add scm_from_latin1_keyword and scm_from_utf8_keyword
* libguile/keywords.c (scm_from_latin1_keyword, scm_from_utf8_keyword):
New functions appropriate for use when keyword name is a constant.
(scm_from_locale_keyword, scm_from_locale_keywordn): Change formal
parameter from `str' to `name'.
* libguile/keywords.h: Add prototypes for new functions. Change formal
parameter of scm_from_locale_keyword* from `str' to `name'.
* doc/ref/api-data.texi: Document new functions. Remind users that
scm_from_locale_keyword should not be used when the name is a C string
constant. Change formal parameter from `str' to `name'.
Diffstat (limited to 'doc/ref/api-data.texi')
-rw-r--r-- | doc/ref/api-data.texi | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/doc/ref/api-data.texi b/doc/ref/api-data.texi index 7fa38d18a..e519cab60 100644 --- a/doc/ref/api-data.texi +++ b/doc/ref/api-data.texi @@ -5730,11 +5730,23 @@ Return the keyword with the same name as @var{symbol}. Equivalent to @code{scm_is_true (scm_keyword_p (@var{obj}))}. @end deftypefn -@deftypefn {C Function} SCM scm_from_locale_keyword (const char *str) -@deftypefnx {C Function} SCM scm_from_locale_keywordn (const char *str, size_t len) +@deftypefn {C Function} SCM scm_from_locale_keyword (const char *name) +@deftypefnx {C Function} SCM scm_from_locale_keywordn (const char *name, size_t len) Equivalent to @code{scm_symbol_to_keyword (scm_from_locale_symbol -(@var{str}))} and @code{scm_symbol_to_keyword (scm_from_locale_symboln -(@var{str}, @var{len}))}, respectively. +(@var{name}))} and @code{scm_symbol_to_keyword (scm_from_locale_symboln +(@var{name}, @var{len}))}, respectively. + +Note that these functions should @emph{not} be used when @var{name} is a +C string constant, because there is no guarantee that the current locale +will match that of the source code. In such cases, use +@code{scm_from_latin1_keyword} or @code{scm_from_utf8_keyword}. +@end deftypefn + +@deftypefn {C Function} SCM scm_from_latin1_keyword (const char *name) +@deftypefnx {C Function} SCM scm_from_utf8_keyword (const char *name) +Equivalent to @code{scm_symbol_to_keyword (scm_from_latin1_symbol +(@var{name}))} and @code{scm_symbol_to_keyword (scm_from_utf8_symbol +(@var{name}))}, respectively. @end deftypefn @node Other Types |