* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice. */
-/* Software engineering face-lift by Greg J. Badros, 11-Dec-1999,
- gjb@cs.washington.edu, http://www.cs.washington.edu/homes/gjb */
\f
#include "libguile/keywords.h"
\f
-scm_bits_t scm_tc16_keyword;
+scm_t_bits scm_tc16_keyword;
static int
-keyword_print (SCM exp, SCM port, scm_print_state *pstate)
+keyword_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
{
+ SCM symbol = SCM_KEYWORDSYM (exp);
+
scm_puts ("#:", port);
- scm_print_symbol_name (1 + SCM_SYMBOL_CHARS (SCM_CDR (exp)),
- SCM_SYMBOL_LENGTH (SCM_CDR (exp)),
+ scm_print_symbol_name (SCM_SYMBOL_CHARS (symbol) + 1,
+ SCM_SYMBOL_LENGTH (symbol) - 1,
port);
+ scm_remember_upto_here_1 (symbol);
return 1;
}
SCM
scm_c_make_keyword (char *s)
{
- char *buf = scm_must_malloc (strlen (s) + 2, "keyword");
+ char *buf = scm_malloc (strlen (s) + 2);
SCM symbol;
buf[0] = '-';
strcpy (buf + 1, s);
symbol = scm_str2symbol (buf);
- scm_must_free (buf);
- scm_done_free (strlen (s) + 2);
+ free (buf);
return scm_make_keyword_from_dash_symbol (symbol);
}
scm_set_smob_print (scm_tc16_keyword, keyword_print);
scm_keyword_obarray = scm_c_make_hash_table (256);
-#ifndef SCM_MAGIC_SNARFER
#include "libguile/keywords.x"
-#endif
}