Scheme SRFI-18 implementation and tests file
[bpt/guile.git] / libguile / symbols.h
CommitLineData
0f2d19dd
JB
1/* classes: h_files */
2
729dbac3
DH
3#ifndef SCM_SYMBOLS_H
4#define SCM_SYMBOLS_H
dee01b01 5
2b829bbb 6/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2003, 2004, 2006 Free Software Foundation, Inc.
dee01b01 7 *
73be1d9e
MV
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
dee01b01 12 *
73be1d9e 13 * This library is distributed in the hope that it will be useful,
0f2d19dd 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
73be1d9e
MV
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
dee01b01 17 *
73be1d9e
MV
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
92205699 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
73be1d9e 21 */
d3a6bc94 22
0f2d19dd
JB
23\f
24
b4309c3c 25#include "libguile/__scm.h"
0f2d19dd
JB
26\f
27
3ee86942
MV
28#define scm_is_symbol(x) (!SCM_IMP (x) \
29 && (SCM_TYP7 (x) == scm_tc7_symbol))
30#define scm_i_symbol_hash(x) ((unsigned long) SCM_CELL_WORD_2 (x))
6869328b
MV
31#define scm_i_symbol_is_interned(x) \
32 (!(SCM_CELL_WORD_0 (x) & SCM_I_F_SYMBOL_UNINTERNED))
33
34#define SCM_I_F_SYMBOL_UNINTERNED 0x100
0f2d19dd 35
0f2d19dd 36\f
0f2d19dd 37
a4c91488 38#ifdef GUILE_DEBUG
33b001fd 39SCM_API SCM scm_sys_symbols (void);
a4c91488 40#endif
23ade5e7 41
33b001fd 42SCM_API SCM scm_symbol_p (SCM x);
a63cdd61
MV
43SCM_API SCM scm_symbol_interned_p (SCM sym);
44SCM_API SCM scm_make_symbol (SCM name);
33b001fd
MV
45SCM_API SCM scm_symbol_to_string (SCM s);
46SCM_API SCM scm_string_to_symbol (SCM s);
1206efbe 47SCM_API SCM scm_string_ci_to_symbol (SCM s);
86d31dfe 48
33b001fd
MV
49SCM_API SCM scm_symbol_fref (SCM s);
50SCM_API SCM scm_symbol_pref (SCM s);
51SCM_API SCM scm_symbol_fset_x (SCM s, SCM val);
52SCM_API SCM scm_symbol_pset_x (SCM s, SCM val);
86d31dfe 53
33b001fd
MV
54SCM_API SCM scm_symbol_hash (SCM s);
55SCM_API SCM scm_gensym (SCM prefix);
86d31dfe 56
3ee86942
MV
57SCM_API SCM scm_from_locale_symbol (const char *str);
58SCM_API SCM scm_from_locale_symboln (const char *str, size_t len);
fd0a5bbc
HWN
59SCM_API SCM scm_take_locale_symbol (char *sym);
60SCM_API SCM scm_take_locale_symboln (char *sym, size_t len);
3ee86942
MV
61
62/* internal functions. */
63
64SCM_API unsigned long scm_i_hash_symbol (SCM obj, unsigned long n,
65 void *closure);
66
33b001fd
MV
67SCM_API void scm_symbols_prehistory (void);
68SCM_API void scm_init_symbols (void);
0f2d19dd 69
729dbac3 70#endif /* SCM_SYMBOLS_H */
89e00824
ML
71
72/*
73 Local Variables:
74 c-file-style: "gnu"
75 End:
76*/