timespec>seconds since-1970 ;
: get-time ( -- alien )
- f time <time_t> localtime tm memory>struct ;
+ f time <time_t> localtime ;
: timezone-name ( -- string )
get-time zone>> ;
: find-device-axes-callback ( -- alien )
[ ! ( lpddoi pvRef -- BOOL )
- [ DIDEVICEOBJECTINSTANCEW memory>struct ] dip
+controller-devices+ get at
swap guidType>> {
{ [ dup GUID_XAxis = ] [ drop 0.0 >>x ] }
: find-controller-callback ( -- alien )
[ ! ( lpddi pvRef -- BOOL )
- drop DIDEVICEINSTANCEW memory>struct guidInstance>> add-controller
+ drop guidInstance>> add-controller
DIENUM_CONTINUE
] LPDIENUMDEVICESCALLBACKW ; inline
[ specialized-array-vocab ] [ '[ _ define-array ] ] bi
generate-vocab ;
-M: c-type-word require-c-array define-array-vocab drop ;
-M: pointer require-c-array drop void* require-c-array ;
-
ERROR: specialized-array-vocab-not-loaded c-type ;
M: c-type-word c-array-constructor
M: x11-ui-backend (make-pixel-format)
[ drop dpy get scr get ] dip
- >glx-visual-int-array glXChooseVisual
- XVisualInfo memory>struct ;
+ >glx-visual-int-array glXChooseVisual ;
M: x11-ui-backend (free-pixel-format)
handle>> XFree ;
user-name (user-groups) ;
: all-groups ( -- seq )
- [ unix.ffi:getgrent dup ] [ \ unix.ffi:group memory>struct group-struct>group ] produce nip ;
+ [ unix.ffi:getgrent dup ] [ group-struct>group ] produce nip ;
: <group-cache> ( -- assoc )
all-groups [ [ id>> ] keep ] H{ } map>assoc ;
: all-users ( -- seq )
[
- [ unix.ffi:getpwent dup ] [ unix.ffi:passwd memory>struct passwd>new-passwd ] produce nip
+ [ unix.ffi:getpwent dup ] [ passwd>new-passwd ] produce nip
] with-pwent ;
SYMBOL: user-cache
M: integer user-passwd ( id -- passwd/f )
user-cache get
- [ at ] [ unix.ffi:getpwuid [ unix.ffi:passwd memory>struct passwd>new-passwd ] [ f ] if* ] if* ;
+ [ at ] [ unix.ffi:getpwuid [ passwd>new-passwd ] [ f ] if* ] if* ;
M: string user-passwd ( string -- passwd/f )
- unix.ffi:getpwnam dup [ unix.ffi:passwd memory>struct passwd>new-passwd ] when ;
+ unix.ffi:getpwnam dup [ passwd>new-passwd ] when ;
: user-name ( id -- string )
dup user-passwd
utmpx-record new ;
M: unix utmpx>utmpx-record ( utmpx -- utmpx-record )
- [ new-utmpx-record ] dip \ utmpx memory>struct
+ [ new-utmpx-record ] dip
{
[ ut_user>> _UTX_USERSIZE memory>string >>user ]
[ ut_id>> _UTX_IDSIZE memory>string >>id ]
: (make-query-interface) ( interfaces -- quot )
(query-interface-cases)
'[
- swap GUID memory>struct
- _ case
+ swap _ case
[
void* heap-size * rot <displaced-alien> com-add-ref
swap 0 set-alien-cell S_OK
: script-string-size ( script-string -- dim )
ssa>> ScriptString_pSize
dup win32-error=0/f
- SIZE memory>struct
[ cx>> ] [ cy>> ] bi 2array ;
: dc-metrics ( dc -- metrics )