factor/basis/unix/utmpx/netbsd/netbsd.factor

21 lines
571 B
Factor
Raw Normal View History

! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
2010-02-21 02:19:11 -05:00
USING: alien.syntax unix unix.utmpx unix.ffi.bsd.netbsd accessors
system kernel combinators ;
IN: unix.utmpx.netbsd
2010-02-21 02:19:11 -05:00
TUPLE: netbsd-utmpx-record < utmpx-record
termination exit sockaddr ;
M: netbsd new-utmpx-record ( -- utmpx-record )
2010-02-21 02:19:11 -05:00
netbsd-utmpx-record new ;
M: netbsd utmpx>utmpx-record ( utmpx -- record )
2010-02-21 02:19:11 -05:00
[ new-utmpx-record ] dip
[
ut_exit>>
[ e_termination>> >>termination ]
[ e_exit>> >>exit ] bi
]
[ ut_ss>> >>sockaddr ] bi ;