void close_port (SCM port);
void delete_file (void *data);
void check_ports (void);
+void check_fluid (void);
int flag1, flag2, flag3;
void
func1 ()
{
- scm_begin_frame (0);
+ scm_frame_begin (0);
flag1 = 0;
- scm_on_unwind (set_flag, &flag1, 0);
- scm_end_frame ();
+ scm_frame_unwind (set_flag, &flag1, 0);
+ scm_frame_end ();
}
/* FUNC2 should set flag1.
void
func2 ()
{
- scm_begin_frame (0);
+ scm_frame_begin (0);
flag1 = 0;
- scm_on_unwind (set_flag, &flag1, SCM_F_WIND_EXPLICITLY);
- scm_end_frame ();
+ scm_frame_unwind (set_flag, &flag1, SCM_F_WIND_EXPLICITLY);
+ scm_frame_end ();
}
/* FUNC3 should set flag1.
void
func3 ()
{
- scm_begin_frame (0);
+ scm_frame_begin (0);
flag1 = 0;
- scm_on_unwind (set_flag, &flag1, 0);
+ scm_frame_unwind (set_flag, &flag1, 0);
scm_misc_error ("func3", "gratuitous error", SCM_EOL);
- scm_end_frame ();
+ scm_frame_end ();
}
/* FUNC4 should set flag1.
void
func4 ()
{
- scm_begin_frame (0);
+ scm_frame_begin (0);
flag1 = 0;
- scm_on_unwind (set_flag, &flag1, SCM_F_WIND_EXPLICITLY);
+ scm_frame_unwind (set_flag, &flag1, SCM_F_WIND_EXPLICITLY);
scm_misc_error ("func4", "gratuitous error", SCM_EOL);
- scm_end_frame ();
+ scm_frame_end ();
}
SCM
int first;
SCM val;
- scm_begin_frame (flags);
+ scm_frame_begin (flags);
val = scm_make_continuation (&first);
- scm_end_frame ();
+ scm_frame_end ();
return val;
}
if (mktemp (filename) == NULL)
exit (1);
- scm_begin_frame (0);
+ scm_frame_begin (0);
{
SCM port = scm_open_file (scm_str2string (filename),
scm_str2string ("w"));
- scm_on_unwind_with_scm (close_port, port, SCM_F_WIND_EXPLICITLY);
+ scm_frame_unwind_with_scm (close_port, port, SCM_F_WIND_EXPLICITLY);
- scm_with_current_output_port (port);
+ scm_frame_current_output_port (port);
scm_write (scm_version (), SCM_UNDEFINED);
}
- scm_end_frame ();
+ scm_frame_end ();
- scm_begin_frame (0);
+ scm_frame_begin (0);
{
SCM port = scm_open_file (scm_str2string (filename),
scm_str2string ("r"));
SCM res;
- scm_on_unwind_with_scm (close_port, port, SCM_F_WIND_EXPLICITLY);
- scm_on_unwind (delete_file, filename, SCM_F_WIND_EXPLICITLY);
+ scm_frame_unwind_with_scm (close_port, port, SCM_F_WIND_EXPLICITLY);
+ scm_frame_unwind (delete_file, filename, SCM_F_WIND_EXPLICITLY);
- scm_with_current_input_port (port);
+ scm_frame_current_input_port (port);
res = scm_read (SCM_UNDEFINED);
if (SCM_FALSEP (scm_equal_p (res, scm_version ())))
{
exit (1);
}
}
- scm_end_frame ();
+ scm_frame_end ();
}
-
+
+void
+check_fluid ()
+{
+ SCM f = scm_make_fluid ();
+ SCM x;
+
+ scm_fluid_set_x (f, SCM_MAKINUM (12));
+
+ scm_frame_begin (0);
+ scm_frame_fluid (f, SCM_MAKINUM (13));
+ x = scm_fluid_ref (f);
+ scm_frame_end ();
+
+ if (!SCM_EQ_P (x, SCM_MAKINUM (13)))
+ {
+ printf ("setting fluid didn't work\n");
+ exit (1);
+ }
+
+ if (!SCM_EQ_P (scm_fluid_ref (f), SCM_MAKINUM (12)))
+ {
+ printf ("resetting fluid didn't work\n");
+ exit (1);
+ }
+}
+
static void
inner_main (void *data, int argc, char **argv)
{
check_ports ();
+ check_fluid ();
+
exit (0);
}