1999-09-14 09:32:05 -04:00
|
|
|
/* This is an Scheme48/C interface file,
|
1999-09-15 20:20:37 -04:00
|
|
|
** automatically generated by a hacked version of cig 3.0.
|
1999-09-23 19:02:54 -04:00
|
|
|
step 4
|
1999-09-14 09:32:05 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h> /* For malloc. */
|
|
|
|
#include "libcig.h"
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <termios.h>
|
|
|
|
|
|
|
|
/* Make sure foreign-function stubs interface to the C funs correctly: */
|
|
|
|
#include "tty1.h"
|
|
|
|
|
|
|
|
extern int errno;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
#define errno_or_false(x) (((x) == -1) ? s48_enter_fixnum(errno) : S48_FALSE)
|
|
|
|
#define errno_on_zero_or_false(x) ((x) ? S48_FALSE : s48_enter_fixnum(errno))
|
|
|
|
s48_value df_scheme_tcgetattr(s48_value g1, s48_value g2, s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int scheme_tcgetattr(int , char *, int *, int *, int *, int *, int *, int *, int *, int *, int *, int *);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
int r2;
|
|
|
|
int r3;
|
|
|
|
int r4;
|
|
|
|
int r5;
|
|
|
|
int r6;
|
|
|
|
int r7;
|
|
|
|
int r8;
|
|
|
|
int r9;
|
|
|
|
int r10;
|
|
|
|
int r11;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
|
|
|
r1 = scheme_tcgetattr(s48_extract_fixnum(g1), s48_extract_string(g2), &r2, &r3, &r4, &r5, &r6, &r7, &r8, &r9, &r10, &r11);
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-09-15 20:20:37 -04:00
|
|
|
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));
|
|
|
|
S48_VECTOR_SET(mv_vec,5,s48_enter_fixnum(r7));
|
|
|
|
S48_VECTOR_SET(mv_vec,6,s48_enter_fixnum(r8));
|
|
|
|
S48_VECTOR_SET(mv_vec,7,s48_enter_fixnum(r9));
|
|
|
|
S48_VECTOR_SET(mv_vec,8,s48_enter_fixnum(r10));
|
|
|
|
S48_VECTOR_SET(mv_vec,9,s48_enter_fixnum(r11));
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-23 19:02:54 -04:00
|
|
|
s48_value df_scheme_tcgetattrB(s48_value g1, s48_value g2, s48_value g3)
|
|
|
|
{
|
|
|
|
extern int scheme_tcgetattrB(int , char *, s48_value );
|
|
|
|
s48_value ret1;
|
|
|
|
int r1;
|
|
|
|
|
|
|
|
|
|
|
|
r1 = scheme_tcgetattrB(s48_extract_fixnum(g1), s48_extract_string(g2), g3);
|
|
|
|
ret1 = errno_or_false(r1);
|
|
|
|
return ret1;
|
|
|
|
}
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_scheme_tcsetattr(s48_value g1, s48_value g2, s48_value g3, s48_value g4, s48_value g5, s48_value g6, s48_value g7, s48_value g8, s48_value g9, s48_value g10, s48_value g11, s48_value g12, s48_value g13, s48_value g14, s48_value g15)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int scheme_tcsetattr(int , int , const char *, int , int , int , int , int , int , int , int , int , int , int , int );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
|
|
|
r1 = scheme_tcsetattr(s48_extract_fixnum(g1), s48_extract_fixnum(g2), s48_extract_string(g3), s48_extract_fixnum(g4), s48_extract_fixnum(g5), s48_extract_fixnum(g6), s48_extract_fixnum(g7), s48_extract_fixnum(g8), s48_extract_fixnum(g9), s48_extract_fixnum(g10), s48_extract_fixnum(g11), s48_extract_fixnum(g12), s48_extract_fixnum(g13), s48_extract_fixnum(g14), s48_extract_fixnum(g15));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_tcsendbreak(s48_value g1, s48_value g2)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int tcsendbreak(int , int );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
|
|
|
r1 = tcsendbreak(s48_extract_fixnum(g1), s48_extract_fixnum(g2));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_tcdrain(s48_value g1)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
|
|
|
r1 = tcdrain(s48_extract_fixnum(g1));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_tcflush(s48_value g1, s48_value g2)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
|
|
|
r1 = tcflush(s48_extract_fixnum(g1), s48_extract_fixnum(g2));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_tcflow(s48_value g1, s48_value g2)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
|
|
|
r1 = tcflow(s48_extract_fixnum(g1), s48_extract_fixnum(g2));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_tcsetpgrp(s48_value g1, s48_value g2)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
|
|
|
r1 = tcsetpgrp(s48_extract_fixnum(g1), s48_extract_fixnum(g2));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_tcgetpgrp(s48_value g1, s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-09-14 09:32:05 -04:00
|
|
|
pid_t r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
|
|
|
r1 = tcgetpgrp(s48_extract_fixnum(g1));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-09-15 20:20:37 -04:00
|
|
|
S48_VECTOR_SET(mv_vec,0,s48_enter_fixnum(r1));
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_open_ctty(s48_value g1, s48_value g2, s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int open_ctty(const char *, int );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
|
|
|
r1 = open_ctty(s48_extract_string(g1), s48_extract_fixnum(g2));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-09-15 20:20:37 -04:00
|
|
|
S48_VECTOR_SET(mv_vec,0,s48_enter_fixnum(r1));
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_isatty(s48_value g1)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int isatty(int );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
|
|
|
r1 = isatty(s48_extract_fixnum(g1));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = ENTER_BOOLEAN(r1);
|
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_ttyname(s48_value g1, s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern char *ttyname(int );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-09-14 09:32:05 -04:00
|
|
|
char *r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
|
|
|
r1 = ttyname(s48_extract_fixnum(g1));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_on_zero_or_false(r1);
|
1999-09-23 10:36:25 -04:00
|
|
|
SetAlienVal(S48_CAR(S48_VECTOR_REF(mv_vec,0)),(long) r1); S48_SET_CDR(S48_VECTOR_REF(mv_vec,0),strlen_or_false(r1));//str-and-len
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_scm_ctermid(s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern char *scm_ctermid(void);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-09-14 09:32:05 -04:00
|
|
|
char *r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-09-14 09:32:05 -04:00
|
|
|
r1 = scm_ctermid();
|
|
|
|
ret1 = errno_on_zero_or_false(r1);
|
1999-09-23 10:36:25 -04:00
|
|
|
SetAlienVal(S48_CAR(S48_VECTOR_REF(mv_vec,0)),(long) r1); S48_SET_CDR(S48_VECTOR_REF(mv_vec,0),strlen_or_false(r1));//str-and-len
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value s48_init_tty(void)
|
|
|
|
{
|
|
|
|
S48_EXPORT_FUNCTION(df_scheme_tcgetattr);
|
1999-09-23 19:02:54 -04:00
|
|
|
S48_EXPORT_FUNCTION(df_scheme_tcgetattrB);
|
1999-09-15 20:20:37 -04:00
|
|
|
S48_EXPORT_FUNCTION(df_scheme_tcsetattr);
|
|
|
|
S48_EXPORT_FUNCTION(df_tcsendbreak);
|
|
|
|
S48_EXPORT_FUNCTION(df_tcdrain);
|
|
|
|
S48_EXPORT_FUNCTION(df_tcflush);
|
|
|
|
S48_EXPORT_FUNCTION(df_tcflow);
|
|
|
|
S48_EXPORT_FUNCTION(df_tcsetpgrp);
|
|
|
|
S48_EXPORT_FUNCTION(df_tcgetpgrp);
|
|
|
|
S48_EXPORT_FUNCTION(df_open_ctty);
|
|
|
|
S48_EXPORT_FUNCTION(df_isatty);
|
|
|
|
S48_EXPORT_FUNCTION(df_ttyname);
|
|
|
|
S48_EXPORT_FUNCTION(df_scm_ctermid);
|
|
|
|
|
|
|
|
return S48_UNSPECIFIC;
|
|
|
|
}
|