scsh-0.6/scsh/flock.c

62 lines
1.8 KiB
C
Raw Normal View History

/* This is an Scheme48/C interface file,
** automatically generated by a hacked version of cig 3.0.
1999-09-23 10:36:25 -04:00
step 3
*/
#include <stdio.h>
#include <stdlib.h> /* For malloc. */
#include "libcig.h"
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
extern int errno;
/* Make sure foreign-function stubs interface to the C funs correctly: */
#include "flock1.h"
#define errno_or_false(x) (((x) == -1) ? s48_enter_fixnum(errno) : S48_FALSE)
s48_value df_set_lock(s48_value g1, s48_value g2, s48_value g3, s48_value g4, s48_value g5, s48_value g6)
{
extern int set_lock(int , int , int , int , int , int );
s48_value ret1;
int r1;
r1 = set_lock(s48_extract_fixnum(g1), s48_extract_fixnum(g2), s48_extract_fixnum(g3), s48_extract_fixnum(g4), s48_extract_fixnum(g5), s48_extract_fixnum(g6));
ret1 = errno_or_false(r1);
return ret1;
}
s48_value df_get_lock(s48_value g1, s48_value g2, s48_value g3, s48_value g4, s48_value g5, s48_value g6, s48_value mv_vec)
{
extern int get_lock(int , int , int , int , int , int , int *, int *, int *, int *, int *);
s48_value ret1;
int r1;
int r2;
int r3;
int r4;
int r5;
int r6;
r1 = get_lock(s48_extract_fixnum(g1), s48_extract_fixnum(g2), s48_extract_fixnum(g3), s48_extract_fixnum(g4), s48_extract_fixnum(g5), s48_extract_fixnum(g6), &r2, &r3, &r4, &r5, &r6);
ret1 = errno_or_false(r1);
S48_VECTOR_SET(mv_vec,0,s48_enter_fixnum(r2));
S48_VECTOR_SET(mv_vec,1,s48_enter_fixnum(r3));
S48_VECTOR_SET(mv_vec,2,s48_enter_fixnum(r4));
S48_VECTOR_SET(mv_vec,3,s48_enter_fixnum(r5));
S48_VECTOR_SET(mv_vec,4,s48_enter_fixnum(r6));
return ret1;
}
s48_value s48_init_flock(void)
{
S48_EXPORT_FUNCTION(df_set_lock);
S48_EXPORT_FUNCTION(df_get_lock);
return S48_UNSPECIFIC;
}