guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. release_1-9-15-136-g4


From: Mark H Weaver
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-15-136-g4db853d
Date: Wed, 09 Mar 2011 06:22:15 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=4db853d747ac115f799c93e2de93f5159ad84109

The branch, master has been updated
       via  4db853d747ac115f799c93e2de93f5159ad84109 (commit)
      from  139851f28b3aa8a605240017ded9286fd32d7c0f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4db853d747ac115f799c93e2de93f5159ad84109
Author: Mark H Weaver <address@hidden>
Date:   Wed Mar 9 01:14:43 2011 -0500

    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'.

-----------------------------------------------------------------------

Summary of changes:
 doc/ref/api-data.texi |   20 ++++++++++++++++----
 libguile/keywords.c   |   20 ++++++++++++++++----
 libguile/keywords.h   |    6 ++++--
 3 files changed, 36 insertions(+), 10 deletions(-)

diff --git a/doc/ref/api-data.texi b/doc/ref/api-data.texi
index 7fa38d1..e519cab 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
 
address@hidden {C Function} SCM scm_from_locale_keyword (const char *str)
address@hidden {C Function} SCM scm_from_locale_keywordn (const char *str, 
size_t len)
address@hidden {C Function} SCM scm_from_locale_keyword (const char *name)
address@hidden {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
address@hidden or @code{scm_from_utf8_keyword}.
address@hidden deftypefn
+
address@hidden {C Function} SCM scm_from_latin1_keyword (const char *name)
address@hidden {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
diff --git a/libguile/keywords.c b/libguile/keywords.c
index 0740801..3b9a922 100644
--- a/libguile/keywords.c
+++ b/libguile/keywords.c
@@ -101,15 +101,27 @@ scm_is_keyword (SCM val)
 }
 
 SCM
-scm_from_locale_keyword (const char *str)
+scm_from_locale_keyword (const char *name)
 {
-  return scm_symbol_to_keyword (scm_from_locale_symbol (str));
+  return scm_symbol_to_keyword (scm_from_locale_symbol (name));
 }
 
 SCM
-scm_from_locale_keywordn (const char *str, size_t len)
+scm_from_locale_keywordn (const char *name, size_t len)
 {
-  return scm_symbol_to_keyword (scm_from_locale_symboln (str, len));
+  return scm_symbol_to_keyword (scm_from_locale_symboln (name, len));
+}
+
+SCM
+scm_from_latin1_keyword (const char *name)
+{
+  return scm_symbol_to_keyword (scm_from_latin1_symbol (name));
+}
+
+SCM
+scm_from_utf8_keyword (const char *name)
+{
+  return scm_symbol_to_keyword (scm_from_utf8_symbol (name));
 }
 
 /* njrev: critical sections reviewed so far up to here */
diff --git a/libguile/keywords.h b/libguile/keywords.h
index bfffe59..c9e6af1 100644
--- a/libguile/keywords.h
+++ b/libguile/keywords.h
@@ -36,8 +36,10 @@ 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);
-SCM_API SCM scm_from_locale_keyword (const char *str);
-SCM_API SCM scm_from_locale_keywordn (const char *str, size_t len);
+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);
 
 SCM_INTERNAL void scm_init_keywords (void);
 


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]