Add `scm_c_symbol_length ()'.
This commit is contained in:
parent
b6137ed741
commit
071bb6a840
6 changed files with 29 additions and 0 deletions
4
NEWS
4
NEWS
|
|
@ -39,6 +39,10 @@ indicating length of the `scm_t_option' array.
|
||||||
|
|
||||||
Changes in 1.8.6 (since 1.8.5)
|
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
|
* Bugs fixed
|
||||||
|
|
||||||
** Internal `scm_i_' functions now have "hidden" linkage with GCC/ELF
|
** Internal `scm_i_' functions now have "hidden" linkage with GCC/ELF
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
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>
|
2008-06-30 Julian Graham <joolean@gmail.com>
|
||||||
|
|
||||||
* srfi-modules.texi (SRFI-18): New section.
|
* srfi-modules.texi (SRFI-18): New section.
|
||||||
|
|
|
||||||
|
|
@ -4647,6 +4647,11 @@ immediately after creating the Scheme string. In certain cases, Guile
|
||||||
can then use @var{str} directly as its internal representation.
|
can then use @var{str} directly as its internal representation.
|
||||||
@end deftypefn
|
@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
|
Finally, some applications, especially those that generate new Scheme
|
||||||
code dynamically, need to generate symbols for use in the generated
|
code dynamically, need to generate symbols for use in the generated
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
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>
|
2008-07-04 Ludovic Courtès <ludo@gnu.org>
|
||||||
|
|
||||||
* posix.h (scm_i_locale_mutex): Don't declare as `SCM_INTERNAL'
|
* posix.h (scm_i_locale_mutex): Don't declare as `SCM_INTERNAL'
|
||||||
|
|
|
||||||
|
|
@ -452,6 +452,16 @@ scm_i_symbol_length (SCM sym)
|
||||||
return STRINGBUF_LENGTH (SYMBOL_STRINGBUF (sym));
|
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 *
|
const char *
|
||||||
scm_i_symbol_chars (SCM sym)
|
scm_i_symbol_chars (SCM sym)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,7 @@ SCM_API SCM scm_string_append (SCM args);
|
||||||
|
|
||||||
SCM_API SCM scm_c_make_string (size_t len, SCM chr);
|
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_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 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 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);
|
SCM_API SCM scm_c_substring (SCM str, size_t start, size_t end);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue