* symbols.h, symbols.c (scm_string_ci_to_symbol): Moved here, next
[bpt/guile.git] / libguile / symbols.h
1 /* classes: h_files */
2
3 #ifndef SCM_SYMBOLS_H
4 #define SCM_SYMBOLS_H
5
6 /* Copyright (C) 1995,1996,1997,1998,2000,2001, 2003, 2004 Free Software Foundation, Inc.
7 *
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.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
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
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23 \f
24
25 #include "libguile/__scm.h"
26 \f
27
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))
31 #define scm_i_symbol_is_interned(x) (scm_i_symbol_hash(x)<=(SCM_T_BITS_MAX/2))
32
33 \f
34
35 #ifdef GUILE_DEBUG
36 SCM_API SCM scm_sys_symbols (void);
37 #endif
38
39 SCM_API SCM scm_symbol_p (SCM x);
40 SCM_API SCM scm_symbol_interned_p (SCM sym);
41 SCM_API SCM scm_make_symbol (SCM name);
42 SCM_API SCM scm_symbol_to_string (SCM s);
43 SCM_API SCM scm_string_to_symbol (SCM s);
44 SCM_API SCM scm_string_ci_to_symbol (SCM s);
45
46 SCM_API SCM scm_symbol_fref (SCM s);
47 SCM_API SCM scm_symbol_pref (SCM s);
48 SCM_API SCM scm_symbol_fset_x (SCM s, SCM val);
49 SCM_API SCM scm_symbol_pset_x (SCM s, SCM val);
50
51 SCM_API SCM scm_symbol_hash (SCM s);
52 SCM_API SCM scm_gensym (SCM prefix);
53
54 SCM_API SCM scm_from_locale_symbol (const char *str);
55 SCM_API SCM scm_from_locale_symboln (const char *str, size_t len);
56
57 /* internal functions. */
58
59 SCM_API unsigned long scm_i_hash_symbol (SCM obj, unsigned long n,
60 void *closure);
61
62 SCM_API void scm_symbols_prehistory (void);
63 SCM_API void scm_init_symbols (void);
64
65 #endif /* SCM_SYMBOLS_H */
66
67 /*
68 Local Variables:
69 c-file-style: "gnu"
70 End:
71 */