Bump version number for 1.9.9.
[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, 2006, 2008 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 License
10 * as published by the Free Software Foundation; either version 3 of
11 * the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful, but
14 * 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., 51 Franklin Street, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 */
23
24 \f
25
26 #include "libguile/__scm.h"
27 \f
28
29 #define scm_is_symbol(x) (!SCM_IMP (x) \
30 && (SCM_TYP7 (x) == scm_tc7_symbol))
31 #define scm_i_symbol_hash(x) ((unsigned long) SCM_CELL_WORD_2 (x))
32 #define scm_i_symbol_is_interned(x) \
33 (!(SCM_CELL_WORD_0 (x) & SCM_I_F_SYMBOL_UNINTERNED))
34
35 #define SCM_I_F_SYMBOL_UNINTERNED 0x100
36
37 \f
38
39 #ifdef GUILE_DEBUG
40 SCM_API SCM scm_sys_symbols (void);
41 #endif
42
43 SCM_API SCM scm_symbol_p (SCM x);
44 SCM_API SCM scm_symbol_interned_p (SCM sym);
45 SCM_API SCM scm_make_symbol (SCM name);
46 SCM_API SCM scm_symbol_to_string (SCM s);
47 SCM_API SCM scm_string_to_symbol (SCM s);
48 SCM_API SCM scm_string_ci_to_symbol (SCM s);
49
50 SCM_API SCM scm_symbol_fref (SCM s);
51 SCM_API SCM scm_symbol_pref (SCM s);
52 SCM_API SCM scm_symbol_fset_x (SCM s, SCM val);
53 SCM_API SCM scm_symbol_pset_x (SCM s, SCM val);
54
55 SCM_API SCM scm_symbol_hash (SCM s);
56 SCM_API SCM scm_gensym (SCM prefix);
57
58 SCM_API SCM scm_from_locale_symbol (const char *str);
59 SCM_API SCM scm_from_locale_symboln (const char *str, size_t len);
60 SCM_API SCM scm_take_locale_symbol (char *sym);
61 SCM_API SCM scm_take_locale_symboln (char *sym, size_t len);
62
63 /* internal functions. */
64
65 SCM_INTERNAL unsigned long scm_i_hash_symbol (SCM obj, unsigned long n,
66 void *closure);
67
68 SCM_INTERNAL void scm_symbols_prehistory (void);
69 SCM_INTERNAL void scm_init_symbols (void);
70
71 #endif /* SCM_SYMBOLS_H */
72
73 /*
74 Local Variables:
75 c-file-style: "gnu"
76 End:
77 */