scsh-0.5/scsh/sighandlers.c

92 lines
2.4 KiB
C

/* This is an Scheme48/C interface file,
** automatically generated by cig.
*/
#include <stdio.h>
#include <stdlib.h> /* For malloc. */
#include "libcig.h"
extern int errno;
/* Make sure foreign-function stubs interface to the C funs correctly: */
#include "sighandlers1.h"
scheme_value df_set_procmask(long nargs, scheme_value *args)
{
extern int set_procmask(int , int , int *);
scheme_value ret1;
int r1;
int r2;
cig_check_nargs(3, nargs, "set_procmask");
r1 = set_procmask(EXTRACT_FIXNUM(args[2]), EXTRACT_FIXNUM(args[1]), &r2);
ret1 = ENTER_FIXNUM(r1);
VECTOR_REF(*args,0) = ENTER_FIXNUM(r2);
return ret1;
}
scheme_value df_get_procmask(long nargs, scheme_value *args)
{
extern int get_procmask(int *);
scheme_value ret1;
int r1;
int r2;
cig_check_nargs(1, nargs, "get_procmask");
r1 = get_procmask(&r2);
ret1 = ENTER_FIXNUM(r1);
VECTOR_REF(*args,0) = ENTER_FIXNUM(r2);
return ret1;
}
scheme_value df_do_default_sigaction(long nargs, scheme_value *args)
{
extern void do_default_sigaction(int );
cig_check_nargs(1, nargs, "do_default_sigaction");
do_default_sigaction(EXTRACT_FIXNUM(args[0]));
return SCHFALSE;
}
scheme_value df_set_sig_handler(long nargs, scheme_value *args)
{
extern scheme_value set_sig_handler(int , scheme_value , int , scheme_value *, int *);
scheme_value ret1;
scheme_value r1;
scheme_value r2;
int r3;
cig_check_nargs(4, nargs, "set_sig_handler");
r1 = set_sig_handler(EXTRACT_FIXNUM(args[3]), args[2], EXTRACT_FIXNUM(args[1]), &r2, &r3);
ret1 = r1;
VECTOR_REF(*args,0) = r2;
VECTOR_REF(*args,1) = ENTER_FIXNUM(r3);
return ret1;
}
scheme_value df_get_sig_handler(long nargs, scheme_value *args)
{
extern scheme_value get_sig_handler(int , scheme_value *, int *);
scheme_value ret1;
scheme_value r1;
scheme_value r2;
int r3;
cig_check_nargs(2, nargs, "get_sig_handler");
r1 = get_sig_handler(EXTRACT_FIXNUM(args[1]), &r2, &r3);
ret1 = r1;
VECTOR_REF(*args,0) = r2;
VECTOR_REF(*args,1) = ENTER_FIXNUM(r3);
return ret1;
}
scheme_value df_install_new_handler_vector(long nargs, scheme_value *args)
{
extern void install_new_handler_vector(scheme_value );
cig_check_nargs(1, nargs, "install_new_handler_vector");
install_new_handler_vector(args[0]);
return SCHFALSE;
}