* New functions: scm_str2symbol, scm_mem2symbol

This commit is contained in:
Dirk Herrmann 2000-12-08 16:32:36 +00:00
commit 23ade5e759
4 changed files with 32 additions and 0 deletions

7
NEWS
View file

@ -216,6 +216,13 @@ current values of file descriptors 0, 1, and 2 in the parent process.
In contrast to scm_boot_guile, scm_init_guile will return normally
after initializing Guile. It is not available on all systems, tho.
** New functions: scm_str2symbol, scm_mem2symbol
The function scm_str2symbol takes a const char* pointing to a zero-terminated
field of characters and creates a scheme symbol object from that C string.
The function scm_mem2symbol takes a const char* and a number of characters and
creates a symbol from the characters in that memory area.
** New functions: scm_primitive_make_property
scm_primitive_property_ref
scm_primitive_property_set_x

View file

@ -1,3 +1,10 @@
2000-12-08 Dirk Herrmann <D.Herrmann@tu-bs.de>
* symbols.[ch] (scm_mem2symbol, scm_str2symbol): New functions.
These shall replace all those calls to scm_intern... which are
only required to create a scheme symbol from a C string or a field
of chars.
2000-12-08 Dirk Herrmann <D.Herrmann@tu-bs.de>
* environments.c (DEFAULT_OBARRAY_SIZE), gc.c

View file

@ -316,6 +316,20 @@ scm_intern_obarray_soft (const char *name,scm_sizet len,SCM obarray,unsigned int
}
SCM
scm_mem2symbol (const char *mem, scm_sizet len)
{
return SCM_CAR (scm_intern_obarray_soft (mem, len, scm_symhash, 0));
}
SCM
scm_str2symbol (const char *str)
{
return SCM_CAR (scm_intern_obarray_soft (str, strlen (str), scm_symhash, 0));
}
SCM
scm_intern_obarray (const char *name,scm_sizet len,SCM obarray)
{

View file

@ -72,6 +72,10 @@
extern unsigned long scm_string_hash (const unsigned char *str, scm_sizet len);
extern SCM scm_mem2symbol (const char*, scm_sizet);
extern SCM scm_str2symbol (const char*);
extern SCM scm_sym2vcell (SCM sym, SCM thunk, SCM definep);
extern SCM scm_sym2ovcell_soft (SCM sym, SCM obarray);
extern SCM scm_sym2ovcell (SCM sym, SCM obarray);