| 1 | /* classes: h_files */ |
| 2 | |
| 3 | #ifndef SCM_SRCPROP_H |
| 4 | #define SCM_SRCPROP_H |
| 5 | |
| 6 | /* Copyright (C) 1995,1996,2000,2001, 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 |
| 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 21 | */ |
| 22 | |
| 23 | \f |
| 24 | |
| 25 | #include "libguile/__scm.h" |
| 26 | |
| 27 | \f |
| 28 | |
| 29 | /* {The old whash table interface} |
| 30 | * *fixme* This is a temporary solution until weak hash table access |
| 31 | * has been optimized for speed (which is quite necessary, if they are |
| 32 | * used for recording of source code positions...) |
| 33 | */ |
| 34 | |
| 35 | #define scm_whash_handle SCM |
| 36 | |
| 37 | #define scm_whash_get_handle(whash, key) scm_hash_fn_get_handle (whash, key, scm_ihashq, scm_sloppy_assq, 0) |
| 38 | #define SCM_WHASHFOUNDP(h) (scm_is_true (h)) |
| 39 | #define SCM_WHASHREF(whash, handle) SCM_CDR (handle) |
| 40 | #define SCM_WHASHSET(whash, handle, obj) SCM_SETCDR (handle, obj) |
| 41 | #define scm_whash_create_handle(whash, key) scm_hash_fn_create_handle_x (whash, key, SCM_UNSPECIFIED, scm_ihashq, scm_sloppy_assq, 0) |
| 42 | #define scm_whash_lookup(whash, obj) scm_hash_fn_ref (whash, obj, SCM_BOOL_F, scm_ihashq, scm_sloppy_assq, 0) |
| 43 | #define scm_whash_insert(whash, key, obj) \ |
| 44 | do { \ |
| 45 | register SCM w = (whash); \ |
| 46 | SCM_WHASHSET (w, scm_whash_create_handle (w, key), obj); \ |
| 47 | } while (0) |
| 48 | |
| 49 | |
| 50 | /* {Source properties} |
| 51 | */ |
| 52 | #define SCM_PROCTRACEP(x) (scm_is_true (scm_procedure_property (x, scm_sym_trace))) |
| 53 | #define SCM_SOURCE_PROPERTY_FLAG_BREAK 1 |
| 54 | |
| 55 | SCM_API scm_t_bits scm_tc16_srcprops; |
| 56 | |
| 57 | SCM_API SCM scm_sym_filename; |
| 58 | SCM_API SCM scm_sym_copy; |
| 59 | SCM_API SCM scm_sym_line; |
| 60 | SCM_API SCM scm_sym_column; |
| 61 | SCM_API SCM scm_sym_breakpoint; |
| 62 | |
| 63 | \f |
| 64 | |
| 65 | SCM_API int scm_c_source_property_breakpoint_p (SCM form); |
| 66 | SCM_API SCM scm_srcprops_to_plist (SCM obj); |
| 67 | SCM_API SCM scm_make_srcprops (long line, int col, SCM fname, SCM copy, SCM plist); |
| 68 | SCM_API SCM scm_source_property (SCM obj, SCM key); |
| 69 | SCM_API SCM scm_set_source_property_x (SCM obj, SCM key, SCM datum); |
| 70 | SCM_API SCM scm_source_properties (SCM obj); |
| 71 | SCM_API SCM scm_set_source_properties_x (SCM obj, SCM props); |
| 72 | SCM_API void scm_finish_srcprop (void); |
| 73 | SCM_INTERNAL void scm_init_srcprop (void); |
| 74 | |
| 75 | #if SCM_ENABLE_DEPRECATED == 1 |
| 76 | #define SRCBRKP(x) (scm_source_property_breakpoint_p (x)) |
| 77 | #endif |
| 78 | |
| 79 | #endif /* SCM_SRCPROP_H */ |
| 80 | |
| 81 | /* |
| 82 | Local Variables: |
| 83 | c-file-style: "gnu" |
| 84 | End: |
| 85 | */ |