6 /* Copyright (C) 1995,1996,2000,2001, 2006, 2008, 2009 Free Software Foundation, Inc.
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.
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.
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
26 #include "libguile/__scm.h"
30 /* {The old whash table interface}
31 * *fixme* This is a temporary solution until weak hash table access
32 * has been optimized for speed (which is quite necessary, if they are
33 * used for recording of source code positions...)
36 #define scm_whash_handle SCM
38 #define scm_whash_get_handle(whash, key) \
39 scm_hashq_get_handle ((whash), (key))
40 #define SCM_WHASHFOUNDP(h) (scm_is_true (h))
41 #define SCM_WHASHREF(whash, handle) SCM_CDR (handle)
42 #define SCM_WHASHSET(whash, handle, obj) SCM_SETCDR (handle, obj)
43 #define scm_whash_create_handle(whash, key) \
44 scm_hashq_create_handle_x ((whash), (key), SCM_UNSPECIFIED)
45 #define scm_whash_lookup(whash, obj) \
46 scm_hashq_ref ((whash), (obj), SCM_BOOL_F)
47 #define scm_whash_insert(whash, key, obj) \
49 register SCM w = (whash); \
50 SCM_WHASHSET (w, scm_whash_create_handle (w, key), obj); \
54 /* {Source properties}
56 #define SCM_PROCTRACEP(x) (scm_is_true (scm_procedure_property (x, scm_sym_trace)))
57 #define SCM_SOURCE_PROPERTY_FLAG_BREAK 1
59 SCM_API scm_t_bits scm_tc16_srcprops
;
61 SCM_API SCM scm_sym_filename
;
62 SCM_API SCM scm_sym_copy
;
63 SCM_API SCM scm_sym_line
;
64 SCM_API SCM scm_sym_column
;
65 SCM_API SCM scm_sym_breakpoint
;
69 SCM_API
int scm_c_source_property_breakpoint_p (SCM form
);
70 SCM_API SCM
scm_make_srcprops (long line
, int col
, SCM fname
, SCM copy
, SCM plist
);
71 SCM_API SCM
scm_source_property (SCM obj
, SCM key
);
72 SCM_API SCM
scm_set_source_property_x (SCM obj
, SCM key
, SCM datum
);
73 SCM_API SCM
scm_source_properties (SCM obj
);
74 SCM_API SCM
scm_set_source_properties_x (SCM obj
, SCM props
);
75 SCM_INTERNAL
void scm_init_srcprop (void);
77 #if SCM_ENABLE_DEPRECATED == 1
78 #define SRCBRKP(x) (scm_source_property_breakpoint_p (x))
81 #endif /* SCM_SRCPROP_H */