\f
Changes in 1.8.6 (since 1.8.5)
+* New features (see the manual for details)
+
+** New convenience function `scm_c_symbol_length ()'
+
* Bugs fixed
** Internal `scm_i_' functions now have "hidden" linkage with GCC/ELF
+2008-07-05 Ludovic Courtès <ludo@gnu.org>
+
+ * api-data.texi (Symbol Primitives): Add `scm_c_symbol_length ()'.
+
2008-06-30 Julian Graham <joolean@gmail.com>
* srfi-modules.texi (SRFI-18): New section.
can then use @var{str} directly as its internal representation.
@end deftypefn
+The size of a symbol can also be obtained from C:
+
+@deftypefn {C Function} size_t scm_c_symbol_length (SCM sym)
+Return the number of characters in @var{sym}.
+@end deftypefn
Finally, some applications, especially those that generate new Scheme
code dynamically, need to generate symbols for use in the generated
+2008-07-05 Ludovic Courtès <ludo@gnu.org>
+
+ * strings.c (scm_c_symbol_length): New function.
+ * strings.h (scm_c_symbol_length): New declaration.
+
2008-07-04 Ludovic Courtès <ludo@gnu.org>
* posix.h (scm_i_locale_mutex): Don't declare as `SCM_INTERNAL'
return STRINGBUF_LENGTH (SYMBOL_STRINGBUF (sym));
}
+size_t
+scm_c_symbol_length (SCM sym)
+#define FUNC_NAME "scm_c_symbol_length"
+{
+ SCM_VALIDATE_SYMBOL (1, sym);
+
+ return STRINGBUF_LENGTH (SYMBOL_STRINGBUF (sym));
+}
+#undef FUNC_NAME
+
const char *
scm_i_symbol_chars (SCM sym)
{
SCM_API SCM scm_c_make_string (size_t len, SCM chr);
SCM_API size_t scm_c_string_length (SCM str);
+SCM_API size_t scm_c_symbol_length (SCM sym);
SCM_API SCM scm_c_string_ref (SCM str, size_t pos);
SCM_API void scm_c_string_set_x (SCM str, size_t pos, SCM chr);
SCM_API SCM scm_c_substring (SCM str, size_t start, size_t end);