1 ! Copyright (C) 2007 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
4 USING: kernel kernel.private sequences math namespaces
5 init splitting assocs system.private layouts words ;
12 UNION: x86 x86.32 x86.64 ;
14 : cpu ( -- class ) \ cpu get-global ; foldable
19 UNION: windows winnt wince ;
28 UNION: bsd freebsd netbsd openbsd macosx ;
30 UNION: unix bsd solaris linux ;
32 : os ( -- class ) \ os get-global ; foldable
36 : string>cpu ( str -- class )
44 : string>os ( str -- class )
58 : image ( -- path ) \ image get-global ;
60 : vm ( -- path ) \ vm get-global ;
63 8 getenv string>cpu \ cpu set-global
64 9 getenv string>os \ os set-global
65 ] "system" add-init-hook
67 : embedded? ( -- ? ) 15 getenv ;
69 : millis ( -- ms ) micros 1000 /i ;