Remove 'size-of' from unmaintained

db4
Eduardo Cavazos 2008-12-22 08:30:08 -06:00
parent 75337648cf
commit 87c19e1219
1 changed files with 0 additions and 39 deletions

View File

@ -1,39 +0,0 @@
USING: kernel namespaces sequences
io io.files io.launcher io.encodings.ascii
bake builder.util
accessors vars
math.parser ;
IN: size-of
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
VAR: headers
: include-headers ( -- seq )
headers> [ `{ "#include <" , ">" } to-string ] map ;
: size-of-c-program ( type -- lines )
`{
"#include <stdio.h>"
include-headers
{ "main() { printf( \"%i\" , sizeof( " , " ) ) ; }" }
}
to-strings ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: c-file ( -- path ) "size-of.c" temp-file ;
: exe ( -- path ) "size-of" temp-file ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: size-of ( type -- n )
size-of-c-program c-file ascii set-file-lines
{ "gcc" c-file "-o" exe } to-strings
[ "Error compiling generated C program" print ] run-or-bail
exe ascii <process-reader> contents string>number ;