Merge commit 'f30e1bdf97ae8b2b2918da585f887a4d3a23a347' into boehm-demers-weiser-gc
[bpt/guile.git] / libguile / gh_predicates.c
1 /* Copyright (C) 1995,1996,1997, 2000, 2001, 2006 Free Software Foundation, Inc.
2
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 \f
18
19 /* type predicates and equality predicates */
20
21 #include "libguile/gh.h"
22
23 #if SCM_ENABLE_DEPRECATED
24
25 /* type predicates: tell you if an SCM object has a given type */
26 int
27 gh_boolean_p (SCM val)
28 {
29 return (scm_is_true (scm_boolean_p (val)));
30 }
31 int
32 gh_symbol_p (SCM val)
33 {
34 return (scm_is_true (scm_symbol_p (val)));
35 }
36 int
37 gh_char_p (SCM val)
38 {
39 return (scm_is_true (scm_char_p (val)));
40 }
41 int
42 gh_vector_p (SCM val)
43 {
44 return (scm_is_true (scm_vector_p (val)));
45 }
46 int
47 gh_pair_p (SCM val)
48 {
49 return (scm_is_true (scm_pair_p (val)));
50 }
51 int
52 gh_number_p (SCM val)
53 {
54 return (scm_is_true (scm_number_p (val)));
55 }
56 int
57 gh_string_p (SCM val)
58 {
59 return (scm_is_true (scm_string_p (val)));
60 }
61 int
62 gh_procedure_p (SCM val)
63 {
64 return (scm_is_true (scm_procedure_p (val)));
65 }
66 int
67 gh_list_p (SCM val)
68 {
69 return (scm_is_true (scm_list_p (val)));
70 }
71 int
72 gh_inexact_p (SCM val)
73 {
74 return (scm_is_true (scm_inexact_p (val)));
75 }
76 int
77 gh_exact_p (SCM val)
78 {
79 return (scm_is_true (scm_exact_p (val)));
80 }
81
82 /* the three types of equality */
83 int
84 gh_eq_p (SCM x, SCM y)
85 {
86 return (scm_is_true (scm_eq_p (x, y)));
87 }
88 int
89 gh_eqv_p (SCM x, SCM y)
90 {
91 return (scm_is_true (scm_eqv_p (x, y)));
92 }
93 int
94 gh_equal_p (SCM x, SCM y)
95 {
96 return (scm_is_true (scm_equal_p (x, y)));
97 }
98
99 /* equivalent to (string=? ...), but returns 0 or 1 rather than Scheme
100 booleans */
101 int
102 gh_string_equal_p(SCM s1, SCM s2)
103 {
104 return (scm_is_true (scm_string_equal_p(s1, s2)));
105 }
106
107 /* equivalent to (null? ...), but returns 0 or 1 rather than Scheme
108 booleans */
109 int
110 gh_null_p(SCM l)
111 {
112 return (scm_is_true(scm_null_p(l)));
113 }
114
115 #endif /* SCM_ENABLE_DEPRECATED */
116
117 /*
118 Local Variables:
119 c-file-style: "gnu"
120 End:
121 */