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 ;
30 UNION: bsd freebsd netbsd openbsd macosx ;
32 UNION: unix bsd solaris linux haiku ;
34 : os ( -- class ) \ os get-global ; foldable
38 : string>cpu ( str -- class )
46 : string>os ( str -- class )
61 : image ( -- path ) \ image get-global ;
63 : vm ( -- path ) \ vm get-global ;
66 8 getenv string>cpu \ cpu set-global
67 9 getenv string>os \ os set-global
68 ] "system" add-init-hook
70 : embedded? ( -- ? ) 15 getenv ;
72 : millis ( -- ms ) micros 1000 /i ;