#ifndef SCM_FLUIDS_INTERNAL_H #define SCM_FLUIDS_INTERNAL_H /* Copyright 1996,2000-2001,2006,2008-2013,2018,2025 Free Software Foundation, Inc. This file is part of Guile. Guile is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Guile is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with Guile. If not, see . */ #include #include #include struct scm_fluid { scm_t_bits tag_and_flags; SCM default_value; }; struct scm_dynamic_state_snapshot { scm_t_bits tag; SCM bindings; }; static inline struct scm_fluid* scm_to_fluid (SCM x) { if (!scm_is_fluid (x)) abort (); return (struct scm_fluid *) SCM_UNPACK_POINTER (x); } static inline SCM scm_from_fluid (struct scm_fluid *fluid) { return SCM_PACK_POINTER (fluid); } static inline struct scm_dynamic_state_snapshot* scm_to_dynamic_state (SCM x) { if (!scm_is_dynamic_state (x)) abort (); return (struct scm_dynamic_state_snapshot *) SCM_UNPACK_POINTER (x); } static inline SCM scm_from_dynamic_state (struct scm_dynamic_state_snapshot *dynstate) { return SCM_PACK_POINTER (dynstate); } struct scm_ephemeron_table; struct scm_dynamic_state { SCM thread_local_values; struct scm_ephemeron_table *values; uint8_t has_aliased_values; struct scm_cache cache; }; SCM_INTERNAL SCM scm_i_fluid_ref (scm_thread *thread, SCM fluid); SCM_INTERNAL void scm_swap_fluid (SCM fluid, SCM value_box, scm_t_dynamic_state *dynamic_state); SCM_INTERNAL SCM scm_dynamic_state_ref (SCM state, SCM fluid, SCM dflt); SCM_INTERNAL SCM scm_i_make_initial_dynamic_state (void); SCM_INTERNAL void scm_i_fluid_print (SCM exp, SCM port, scm_print_state *pstate); SCM_INTERNAL void scm_i_dynamic_state_print (SCM exp, SCM port, scm_print_state *pstate); SCM_INTERNAL void scm_init_fluids (void); #endif /* SCM_FLUIDS_INTERNAL_H */