scsh-0.6/scsh/fdports.h

17 lines
931 B
C

/* Macros to access parts of Scheme ports from C. */
/* Copyright (c) 1995 by Olin Shivers. */
#define PortData_Fd(port_data) (1+(scheme_value*)StobData(port_data))
#define PortData_Closed(port_data) (2+(scheme_value*)StobData(port_data))
#define PortData_Peek(port_data) (3+(scheme_value*)StobData(port_data))
#define PortData_Rev(port_data) (4+(scheme_value*)StobData(port_data))
#define PortData_OldRev(port_data) (5+(scheme_value*)StobData(port_data))
/* #define PortData_Mode(port_data) (6+(scheme_value*)StobData(port_data)) */
#define Port_PortData(port) (1+(scheme_value*)StobData(port))
#define PortFd(port) (PortData_Fd(*Port_PortData(port)))
#define PortClosed(port) (PortData_Closed(*Port_PortData(port)))
#define PortRev(port) (PortData_Rev(*Port_PortData(port)))
#define PortOldRev(port) (PortData_OldRev(*Port_PortData(port)))
/* #define PortMode(port) (PortData_Mode(*Port_PortData(port))) */