srcprop.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* classes: h_files */
  2. #ifndef SCM_SRCPROP_H
  3. #define SCM_SRCPROP_H
  4. /* Copyright (C) 1995,1996,2000,2001, 2006 Free Software Foundation, Inc.
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #include "libguile/__scm.h"
  21. /* {The old whash table interface}
  22. * *fixme* This is a temporary solution until weak hash table access
  23. * has been optimized for speed (which is quite necessary, if they are
  24. * used for recording of source code positions...)
  25. */
  26. #define scm_whash_handle SCM
  27. #define scm_whash_get_handle(whash, key) scm_hash_fn_get_handle (whash, key, scm_ihashq, scm_sloppy_assq, 0)
  28. #define SCM_WHASHFOUNDP(h) (scm_is_true (h))
  29. #define SCM_WHASHREF(whash, handle) SCM_CDR (handle)
  30. #define SCM_WHASHSET(whash, handle, obj) SCM_SETCDR (handle, obj)
  31. #define scm_whash_create_handle(whash, key) scm_hash_fn_create_handle_x (whash, key, SCM_UNSPECIFIED, scm_ihashq, scm_sloppy_assq, 0)
  32. #define scm_whash_lookup(whash, obj) scm_hash_fn_ref (whash, obj, SCM_BOOL_F, scm_ihashq, scm_sloppy_assq, 0)
  33. #define scm_whash_insert(whash, key, obj) \
  34. do { \
  35. register SCM w = (whash); \
  36. SCM_WHASHSET (w, scm_whash_create_handle (w, key), obj); \
  37. } while (0)
  38. /* {Source properties}
  39. */
  40. #define SCM_PROCTRACEP(x) (scm_is_true (scm_procedure_property (x, scm_sym_trace)))
  41. #define SCM_SOURCE_PROPERTY_FLAG_BREAK 1
  42. SCM_API scm_t_bits scm_tc16_srcprops;
  43. SCM_API SCM scm_sym_filename;
  44. SCM_API SCM scm_sym_copy;
  45. SCM_API SCM scm_sym_line;
  46. SCM_API SCM scm_sym_column;
  47. SCM_API SCM scm_sym_breakpoint;
  48. SCM_API int scm_c_source_property_breakpoint_p (SCM form);
  49. SCM_API SCM scm_srcprops_to_plist (SCM obj);
  50. SCM_API SCM scm_make_srcprops (long line, int col, SCM fname, SCM copy, SCM plist);
  51. SCM_API SCM scm_source_property (SCM obj, SCM key);
  52. SCM_API SCM scm_set_source_property_x (SCM obj, SCM key, SCM datum);
  53. SCM_API SCM scm_source_properties (SCM obj);
  54. SCM_API SCM scm_set_source_properties_x (SCM obj, SCM props);
  55. SCM_API void scm_finish_srcprop (void);
  56. SCM_API void scm_init_srcprop (void);
  57. #if SCM_ENABLE_DEPRECATED == 1
  58. #define SRCBRKP(x) (scm_source_property_breakpoint_p (x))
  59. #endif
  60. #endif /* SCM_SRCPROP_H */
  61. /*
  62. Local Variables:
  63. c-file-style: "gnu"
  64. End:
  65. */