* root.h: Added "fluids" member to scm_root_state.
[bpt/guile.git] / libguile / scmhob.h
1 /* scmhob.h is a header file for scheme source compiled with hobbit4d
2 Copyright (C) 1992, 1993, 1994, 1995 Tanel Tammet
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 1, or (at your option)
7 any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17 USA */
18
19
20 #include <libguile.h>
21
22 /* Specifique à hobbit */
23 #define GLOBAL(x) (*(x))
24 #define VECTOR_SET(v,k,o) (SCM_VELTS(v)[((long)SCM_INUM(k))] = o)
25 #define VECTOR_REF(v,k) (SCM_VELTS(v)[((long)SCM_INUM(k))])
26 #define VECTOR_LENGTH(v) SCM_MAKINUM(SCM_LENGTH(v))
27
28 /* Pourrait etre mis dans le noyau de hobbit */
29 /*#define vector_fill_excl_ scm_vector_fill_x*/
30
31 /* Passage scm --> guile */
32 #define EOL SCM_EOL
33 #define CAR SCM_CAR
34 #define CDR SCM_CDR
35 #define NFALSEP SCM_NFALSEP
36 #define BOOL_F SCM_BOOL_F
37 #define BOOL_T SCM_BOOL_T
38 #define MAKINUM SCM_MAKINUM
39 #define listofnull scm_listofnull
40 #define tc7_subr_1 scm_tc7_subr_1
41 #define tc7_subr_2 scm_tc7_subr_2
42 #define tc7_subr_3 scm_tc7_subr_3
43 #define tc7_lsubr scm_tc7_lsubr
44 #define apply scm_apply
45 #define cons scm_cons
46 #define divide scm_divide
47 #define eqp scm_eq_p
48 #define evenp scm_even_p
49 #define greaterp scm_gr_p
50 #define lessp scm_less_p
51 #define lremainder scm_remainder
52 #define makrect scm_make_rectangular
53 #define product scm_product
54 #define sum scm_sum
55 #define difference scm_difference
56 #define intern(x,y) scm_permanent_object(scm_intern((x),(y)))
57 #define make_subr scm_make_subr
58 #define make_vector(vec,fill) scm_make_vector((vec),(fill),SCM_BOOL_F)
59 #define absval scm_magnitude
60 #define string2number scm_string_to_number
61 #define makfromstr(x,y) scm_makfromstr((x),(y),0)
62 #define list_ref scm_list_ref
63
64 #define NULL_P SCM_NULLP
65 #define SBOOL(x) ((x) ? SCM_BOOL_T : SCM_BOOL_F)
66 #define INUM SCM_INUM
67 #define cur_output_port scm_current_output_port
68 #define display scm_display
69 #define newline scm_newline
70 #define makcclo scm_makcclo
71 #define UNSPECIFIED SCM_UNSPECIFIED
72 #define tc7_subr_0 scm_tc7_subr_0
73 #define equal scm_equal_p
74 #define assv scm_assv
75 #define PAIR_P(x) (!(SCM_IMP(x)) && SCM_CONSP(x))
76 #define SET_CDR SCM_SETCDR
77 #define eval scm_eval
78
79 #define close_port scm_close_port
80 #define lwrite scm_write
81 #define open_file scm_open_file
82 #define set_outp scm_set_current_output_port
83 #define MAKICHR SCM_MAKICHR
84 #define memq scm_memq
85
86 #define cur_input_port scm_current_input_port
87 #define set_inp scm_set_current_input_port
88 #define lread scm_read
89 #define eof_objectp scm_eof_object_p
90
91 #define modulo scm_modulo
92 #define CHAR2INT(chr) scm_ulong2num((unsigned long)SCM_ICHR(chr))
93 #define ST_LENGTH(str) SCM_MAKINUM (SCM_ROLENGTH (str))
94 #define ST_REF(str,k) SCM_MAKICHR (SCM_ROUCHARS (str)[SCM_INUM (k)])
95 #define NOT(x) ((x)==SCM_BOOL_F ? SCM_BOOL_T : SCM_BOOL_F)
96
97 #define SYMBOL_P(x) (!(SCM_IMP(x)) && SCM_SYMBOLP(x))
98 #define STRING_P(x) (!(SCM_IMP(x)) && SCM_STRINGP(x))
99 #define BOOLEAN_P(obj) ((SCM_BOOL_F==(obj)) || (SCM_BOOL_T==(obj)))
100 #if defined(SCM_FLOATS) || defined(SCM_BIGDIG)
101 #define NUMBER_P(x) ((SCM_INUMP(x)) || (SCM_NIMP(x) && SCM_NUMP(x)))
102 #else
103 #define NUMBER_P SCM_INUMP
104 #endif
105 #define number2string scm_number_to_string
106 #define symbol2string scm_symbol_to_string
107
108 #define append2(lst1,lst2) (scm_list_append(scm_cons2((lst1),(lst2),SCM_EOL)))
109 #define st_append scm_string_append
110
111 #define string scm_string
112 #define string2list scm_string_to_list
113 #define string2symbol scm_string_to_symbol
114 #define INTEGER_P(x) (scm_integer_p(x) == SCM_BOOL_T)
115
116 #define listp scm_list_p
117 #define assoc scm_assoc
118
119 #define assq scm_assq
120 #define memv scm_memv
121 #define member scm_member
122 #define append scm_list_append
123
124 #define CHAR_P SCM_ICHRP
125 #define CHAR_UPCASE(chr) SCM_MAKICHR(scm_upcase(SCM_ICHR(chr)))
126 #define CHAR_DOWNCASE(chr) SCM_MAKICHR(scm_downcase(SCM_ICHR(chr)))
127 #define procedurep(x) (scm_procedure_p(x) == SCM_BOOL_T)
128 #define VECTOR_P(x) (!(SCM_IMP(x)) && SCM_VECTORP(x))
129 #define reverse scm_list_reverse
130 #define length scm_list_length
131 #define input_portp scm_input_port_p
132 #define output_portp scm_output_port_p