]> gitweb.factorcode.org Git - factor.git/commitdiff
add USING:s and rearrange definitions so macosx can compile without parsing c-type...
authorJoe Groff <arcata@gmail.com>
Sun, 27 Sep 2009 04:14:57 +0000 (23:14 -0500)
committerJoe Groff <arcata@gmail.com>
Sun, 27 Sep 2009 04:14:57 +0000 (23:14 -0500)
39 files changed:
basis/alien/c-types/c-types.factor
basis/cocoa/runtime/runtime.factor
basis/cocoa/types/types.factor
basis/core-foundation/arrays/arrays.factor
basis/core-foundation/attributed-strings/attributed-strings.factor
basis/core-foundation/bundles/bundles.factor
basis/core-foundation/data/data.factor
basis/core-foundation/dictionaries/dictionaries.factor
basis/core-foundation/file-descriptors/file-descriptors.factor
basis/core-foundation/fsevents/fsevents.factor
basis/core-foundation/run-loop/run-loop.factor
basis/core-foundation/strings/strings.factor
basis/core-foundation/time/time.factor
basis/core-foundation/timers/timers.factor
basis/core-foundation/urls/urls.factor
basis/core-graphics/core-graphics.factor
basis/core-graphics/types/types.factor
basis/core-text/fonts/fonts.factor
basis/db/postgresql/ffi/ffi.factor
basis/environment/unix/macosx/macosx.factor
basis/images/tiff/tiff.factor
basis/io/pipes/unix/unix.factor
basis/opengl/gl/gl.factor
basis/opengl/textures/textures.factor
basis/openssl/libcrypto/libcrypto.factor
basis/openssl/libssl/libssl.factor
basis/random/mersenne-twister/mersenne-twister.factor
basis/tools/disassembler/udis/udis.factor
basis/ui/pixel-formats/pixel-formats.factor
basis/unix/bsd/bsd.factor
basis/unix/getfsstat/macosx/macosx.factor
basis/unix/kqueue/kqueue.factor
basis/unix/kqueue/macosx/macosx.factor
basis/unix/process/process.factor
basis/unix/stat/macosx/macosx.factor
basis/unix/statvfs/macosx/macosx.factor
basis/unix/types/types.factor
basis/unix/unix.factor
basis/vm/vm.factor

index 9aea6fe252e6b92774072a2dec4539033c83dd4f..fe8822f8c88f1621269449adf1eabcd060ee604f 100755 (executable)
@@ -60,6 +60,8 @@ GENERIC: c-type ( name -- type ) foldable
 
 GENERIC: resolve-pointer-type ( name -- c-type )
 
+<< \ void \ void* "pointer-c-type" set-word-prop >>
+
 M: word resolve-pointer-type
     dup "pointer-c-type" word-prop
     [ ] [ drop void* ] ?if ;
index 28d812a4893749d7f6bcd92a3ee533ca59889dca..f02f1f6182d6de07a6e1a33d31c513953c20a30e 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2006, 2007 Slava Pestov
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax classes.struct ;
+USING: alien.c-types alien.syntax classes.struct ;
 IN: cocoa.runtime
 
 TYPEDEF: void* SEL
index 0e0ef72ad290a8ea6d60d896e4b8fdb0b5ca182d..1e1ec98245988c39292f4f2cf5600b050c69898b 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2006, 2009 Slava Pestov
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien.c-types alien.syntax combinators kernel layouts
-classes.struct core-graphics.types ;
+classes.struct cocoa.runtime core-graphics.types ;
 IN: cocoa.types
 
 TYPEDEF: long NSInteger
index 1205352fcb75b5bc744efab7c37d481cbd5d894d..f0dfff9143d06158c73834f40c15117dde855a90 100644 (file)
@@ -1,6 +1,7 @@
 ! Copyright (C) 2008, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax kernel sequences fry ;
+USING: alien.c-types alien.syntax core-foundation kernel
+sequences fry ;
 IN: core-foundation.arrays
 
 TYPEDEF: void* CFArrayRef
index 48c262f3a37d722ceb5eed9225f86ac292018c9c..cd620bb876cce22654901e56c446960c36a29093 100644 (file)
@@ -1,6 +1,8 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax kernel destructors core-foundation
+USING: alien.c-types alien.syntax kernel destructors
+core-foundation core-foundation.dictionaries
+core-foundation.strings
 core-foundation.utilities ;
 IN: core-foundation.attributed-strings
 
@@ -16,4 +18,4 @@ FUNCTION: CFAttributedStringRef CFAttributedStringCreate (
     [
         [ >cf &CFRelease ] bi@
         [ kCFAllocatorDefault ] 2dip CFAttributedStringCreate
-    ] with-destructors ;
\ No newline at end of file
+    ] with-destructors ;
index 790f1766c39666bb2151af301aeb0de369c59edd..e45e2c52beb0ae1bbaa8b2f7be6ba9bad81991b4 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax kernel sequences core-foundation
-core-foundation.urls ;
+USING: alien.c-types alien.syntax kernel sequences
+core-foundation core-foundation.urls ;
 IN: core-foundation.bundles
 
 TYPEDEF: void* CFBundleRef
index ef5973888edf872cc898ba16c80ccc15bfa756b4..c4c09d0cc5042d9bb256f6abf382ad4d75eecb0a 100644 (file)
@@ -1,6 +1,7 @@
 ! Copyright (C) 2008 Joe Groff.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.c-types alien.syntax kernel math sequences ;
+USING: alien.c-types alien.syntax core-foundation kernel math
+sequences ;
 IN: core-foundation.data
 
 TYPEDEF: void* CFDataRef
@@ -16,4 +17,4 @@ FUNCTION: CFDataRef CFDataCreate ( CFAllocatorRef allocator, uchar* bytes, CFInd
 FUNCTION: CFTypeID CFGetTypeID ( CFTypeRef cf ) ;
 
 : <CFData> ( byte-array -- alien )
-    [ f ] dip dup length CFDataCreate ;
\ No newline at end of file
+    [ f ] dip dup length CFDataCreate ;
index cc0175e0eaa5807ada0750ad2ad8acbd6f4ba6b4..04b5aacb39e1e991a1bc4bc94e7f80888c3036f6 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax core-foundation kernel assocs
+USING: alien.c-types alien.syntax core-foundation kernel assocs
 specialized-arrays math sequences accessors ;
 IN: core-foundation.dictionaries
 
@@ -31,4 +31,4 @@ FUNCTION: void* CFDictionaryGetValue (
     [ [ underlying>> ] bi@ ] [ nip length ] 2bi
     &: kCFTypeDictionaryKeyCallBacks
     &: kCFTypeDictionaryValueCallBacks
-    CFDictionaryCreate ;
\ No newline at end of file
+    CFDictionaryCreate ;
index c9fe3131b148271497b9ffe60f69c31272bb1736..2520f1c3dab2dfcceff792e448da640367128b22 100644 (file)
@@ -1,11 +1,12 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax kernel math.bitwise core-foundation ;
+USING: alien.c-types alien.syntax kernel math.bitwise core-foundation ;
 IN: core-foundation.file-descriptors
 
 TYPEDEF: void* CFFileDescriptorRef
 TYPEDEF: int CFFileDescriptorNativeDescriptor
 TYPEDEF: void* CFFileDescriptorCallBack
+TYPEDEF: void* CFFileDescriptorContext*
 
 FUNCTION: CFFileDescriptorRef CFFileDescriptorCreate (
     CFAllocatorRef allocator,
index 9a22046a3a3ae27adb1a4c40a8435b82bebc1f12..6f5484fb77199198a60899a3882c2c60beb2f7eb 100755 (executable)
@@ -4,8 +4,8 @@ USING: alien alien.c-types alien.strings alien.syntax kernel
 math sequences namespaces make assocs init accessors
 continuations combinators io.encodings.utf8 destructors locals
 arrays specialized-arrays classes.struct core-foundation
-core-foundation.run-loop core-foundation.strings
-core-foundation.time ;
+core-foundation.arrays core-foundation.run-loop
+core-foundation.strings core-foundation.time unix.types ;
 IN: core-foundation.fsevents
 
 SPECIALIZED-ARRAY: void*
index 10d858a32f5f4fcbb689131124bc855f237f3aa1..7b454266f26bdcbc8276e8cdd6b88c5786254d38 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2008 Slava Pestov
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors alien alien.syntax kernel math namespaces
-sequences destructors combinators threads heaps deques calendar
-core-foundation core-foundation.strings
+USING: accessors alien alien.c-types alien.syntax kernel math
+namespaces sequences destructors combinators threads heaps
+deques calendar core-foundation core-foundation.strings
 core-foundation.file-descriptors core-foundation.timers
 core-foundation.time ;
 IN: core-foundation.run-loop
index 4bbe0502304f33cc599000d25809828826cb7fdd..cbabb083aa23444f272f8e5592128330cea8802f 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax alien.strings io.encodings.string kernel
-sequences byte-arrays io.encodings.utf8 math core-foundation
+USING: alien.c-types alien.syntax alien.strings io.encodings.string
+kernel sequences byte-arrays io.encodings.utf8 math core-foundation
 core-foundation.arrays destructors parser fry alien words ;
 IN: core-foundation.strings
 
index 15ad7bb1a14a9694b9426d9578e375e4bed4a980..8f0965246250f1e894919373a39ef7d4e97a12e8 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: calendar alien.syntax ;
+USING: calendar alien.c-types alien.syntax ;
 IN: core-foundation.time
 
 TYPEDEF: double CFTimeInterval
index 51ee98259231e48bc4fc35b63fbfb1925f021087..cf17cb41d9e9a9bb9ffdb2dfe714c1448f17ae69 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax system math kernel calendar core-foundation
-core-foundation.time ;
+USING: alien.c-types alien.syntax system math kernel calendar
+core-foundation core-foundation.time ;
 IN: core-foundation.timers
 
 TYPEDEF: void* CFRunLoopTimerRef
index 7ffef498b64e7cbee26d7492c18e4ea5b5546e0e..f22095c3444b73ad50f2d9c958c08a8b80151e52 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax kernel core-foundation.strings
-core-foundation ;
+USING: alien.c-types alien.syntax kernel core-foundation.strings
+core-foundation core-foundation.urls ;
 IN: core-foundation.urls
 
 CONSTANT: kCFURLPOSIXPathStyle 0
index a7bec0479846a6bb74cab4e0afe610dcf9547753..f3f759115cc2204ccab25a097ffaf23f35e27f9d 100644 (file)
@@ -2,7 +2,8 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien alien.c-types alien.destructors alien.syntax accessors
 destructors fry kernel math math.bitwise sequences libc colors
-images images.memory core-graphics.types core-foundation.utilities ;
+images images.memory core-graphics.types core-foundation.utilities
+opengl.gl ;
 IN: core-graphics
 
 ! CGImageAlphaInfo
index ad4620e174c8398137ee0ac83e412d09703be582..a1e9b1dc9a1655f7d0e98cee3ee8c70e65de566a 100644 (file)
@@ -1,10 +1,12 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien.c-types alien.syntax classes.struct kernel layouts
-math math.rectangles arrays ;
+math math.rectangles arrays literals ;
+FROM: alien.c-types => float ;
 IN: core-graphics.types
 
-<< cell 4 = "float" "double" ? "CGFloat" typedef >>
+SYMBOL: CGFloat
+<< cell 4 = float double ? \ CGFloat typedef >>
 
 : <CGFloat> ( x -- alien )
     cell 4 = [ <float> ] [ <double> ] if ; inline
index 2656811c1fc92eec8faa5aca9b3d5a9f90c19199..6e85c949091e0ed07e3a297b82b6693653a9815e 100644 (file)
@@ -1,8 +1,9 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors alien.syntax assocs core-foundation
-core-foundation.strings core-text.utilities destructors init
-kernel math memoize fonts combinators ;
+USING: accessors alien.c-types alien.syntax assocs core-foundation
+core-foundation.dictionaries core-foundation.strings
+core-graphics.types core-text.utilities destructors init
+kernel math memoize fonts combinators unix.types ;
 IN: core-text.fonts
 
 TYPEDEF: void* CTFontRef
index 93f93c9a13ce1952fbc7d1961155be7b13d9bfb7..1e7f4d5b827f6ef6b265d9ec264e43a6ae3f912b 100644 (file)
@@ -68,7 +68,6 @@ TYPEDEF: void* PQconninfoOption*
 TYPEDEF: void* PGnotify*
 TYPEDEF: void* PQArgBlock*
 TYPEDEF: void* PQprintOpt*
-TYPEDEF: void* FILE*
 TYPEDEF: void* SSL*
 
 LIBRARY: postgresql
index 51cee7ba087d643291680a3049f682d8656a6ed0..e811455927cb8b2cddbbaec05b592a1cfb27bd6a 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax system environment.unix ;
+USING: alien.c-types alien.syntax system environment.unix ;
 IN: environment.unix.macosx
 
 FUNCTION: void* _NSGetEnviron ( ) ;
index c589349dff2fbd43d6b17c6dafd8ac17e09ef984..dfc3c8b4411650b0df1219fdd94d9f619d21e424 100755 (executable)
@@ -7,6 +7,7 @@ io.encodings.string io.encodings.utf8 io.files kernel math
 math.bitwise math.order math.parser pack prettyprint sequences
 strings math.vectors specialized-arrays locals
 images.loader ;
+FROM: alien.c-types => float ;
 SPECIALIZED-ARRAY: float
 IN: images.tiff
 
index 7319ad1db8270f96a1edda8fdbe20cfa3f0af1bb..8493f14d2607821f3b20a70c1dfcbdef6986d82d 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: system kernel unix math sequences
+USING: alien.c-types system kernel unix math sequences
 io.backend.unix io.ports specialized-arrays accessors ;
 QUALIFIED: io.pipes
 SPECIALIZED-ARRAY: int
index 32c3ca4b82ccfcaac9dcc1524126746f9bc6376a..412405c8522221032db1b19b89c1522de0c6502d 100644 (file)
@@ -3,9 +3,9 @@
 
 ! This file is based on the gl.h that comes with xorg-x11 6.8.2
 
-USING: alien alien.syntax combinators kernel parser sequences
-system words opengl.gl.extensions ;
-
+USING: alien alien.c-types alien.syntax combinators kernel parser
+sequences system words opengl.gl.extensions ;
+FROM: alien.c-types => short ;
 IN: opengl.gl
 
 TYPEDEF: uint    GLenum
index 28d920d8d6a16ed3b22540af5767fb71065b67a6..d846afe3a90cb492ed63bc47703b7c102203e94e 100755 (executable)
@@ -5,6 +5,7 @@ kernel opengl opengl.gl opengl.capabilities combinators images
 images.tesselation grouping sequences math math.vectors
 math.matrices generalizations fry arrays namespaces system
 locals literals specialized-arrays ;
+FROM: alien.c-types => float ;
 SPECIALIZED-ARRAY: float
 IN: opengl.textures
 
index df9955a53cdf7af181d7cbe90c6485f90cb3fa57..ed280ecd691b1648eac830975021e860f126e550 100644 (file)
@@ -103,15 +103,15 @@ FUNCTION: void* BIO_f_buffer (  ) ;
 
 CONSTANT: EVP_MAX_MD_SIZE 64
 
+TYPEDEF: void* EVP_MD*
+TYPEDEF: void* ENGINE*
+
 STRUCT: EVP_MD_CTX
     { digest EVP_MD* }
     { engine ENGINE* }
     { flags ulong }
     { md_data void* } ;
 
-TYPEDEF: void* EVP_MD*
-TYPEDEF: void* ENGINE*
-
 ! Initialize ciphers and digest tables
 FUNCTION: void OpenSSL_add_all_ciphers (  ) ;
 
index 520c7175c6a0135c8f5f2f30ac6b80a732b17000..9e2b13159a2bf5b0c0eba85288b5e6cdf6a202ed 100644 (file)
@@ -1,9 +1,9 @@
 ! Copyright (C) 2007 Elie CHAFTARI
 ! Portions copyright (C) 2008 Slava Pestov
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.syntax combinators kernel system namespaces
-assocs parser lexer sequences words quotations math.bitwise
-alien.libraries ;
+USING: alien alien.c-types alien.syntax combinators kernel
+system namespaces assocs parser lexer sequences words
+quotations math.bitwise alien.libraries ;
 
 IN: openssl.libssl
 
@@ -95,6 +95,17 @@ TYPEDEF: void* SSL*
 
 LIBRARY: libssl
 
+! ===============================================
+! x509.h
+! ===============================================
+
+TYPEDEF: void* X509_NAME*
+
+TYPEDEF: void* X509*
+
+FUNCTION: int X509_NAME_get_text_by_NID ( X509_NAME* name, int nid, void* buf, int len ) ;
+FUNCTION: X509_NAME* X509_get_subject_name ( X509* a ) ;
+
 ! ===============================================
 ! ssl.h
 ! ===============================================
@@ -258,17 +269,6 @@ CONSTANT: SSL_SESS_CACHE_NO_INTERNAL_STORE  HEX: 0200
 : SSL_SESS_CACHE_NO_INTERNAL ( -- n )
     { SSL_SESS_CACHE_NO_INTERNAL_LOOKUP SSL_SESS_CACHE_NO_INTERNAL_STORE } flags ; inline
 
-! ===============================================
-! x509.h
-! ===============================================
-
-TYPEDEF: void* X509_NAME*
-
-TYPEDEF: void* X509*
-
-FUNCTION: int X509_NAME_get_text_by_NID ( X509_NAME* name, int nid, void* buf, int len ) ;
-FUNCTION: X509_NAME* X509_get_subject_name ( X509* a ) ;
-
 ! ===============================================
 ! x509_vfy.h
 ! ===============================================
index 3a44066cafa64d8b5efaaccfe1096004a742842e..e29f97ef2e0d87262972328726ed513ca06e5646 100644 (file)
@@ -2,9 +2,9 @@
 ! See http://factorcode.org/license.txt for BSD license.
 ! mersenne twister based on 
 ! http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.c
-USING: kernel math namespaces sequences sequences.private system
-init accessors math.ranges random math.bitwise combinators
-specialized-arrays fry ;
+USING: alien.c-types kernel math namespaces sequences
+sequences.private system init accessors math.ranges random
+math.bitwise combinators specialized-arrays fry ;
 SPECIALIZED-ARRAY: uint
 IN: random.mersenne-twister
 
index 89bd5f726c970484538e4beb1d0fb7d96cc59317..effb2d6f0e0ca71d5aebc0ff28582cbe82fc678a 100755 (executable)
@@ -31,7 +31,7 @@ STRUCT: ud
     { inp_hook void* }
     { inp_curr uchar }
     { inp_fill uchar }
-    { inp_file FILE* }
+    { inp_file void* }
     { inp_ctr uchar }
     { inp_buff uchar* }
     { inp_buff_end uchar* }
@@ -68,7 +68,7 @@ STRUCT: ud
     { c3 uchar }
     { inp_cache uchar[256] }
     { inp_sess uchar[64] }
-    { itab_entry ud_itab_entry* } ;
+    { itab_entry void* } ;
 
 FUNCTION: void ud_translate_intel ( ud* u ) ;
 FUNCTION: void ud_translate_att ( ud* u ) ;
index 5dcd9bde9ad4f09ad610e75c41d342c8a3c0a545..abc857c5667d358b091a2a22715f83a06b3df0c0 100644 (file)
@@ -1,6 +1,6 @@
-USING: accessors assocs classes destructors functors kernel
-lexer math parser sequences specialized-arrays ui.backend
-words ;
+USING: alien.c-types accessors assocs classes destructors
+functors kernel lexer math parser sequences specialized-arrays
+ui.backend words ;
 SPECIALIZED-ARRAY: int
 IN: ui.pixel-formats
 
index ebc0b80097808a3de6decad79532a31a222bc175..0825e42930297005b7a8049d70f858d3b53bd87f 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2005, 2006 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax classes.struct combinators system
-vocabs.loader ;
+USING: alien.c-types alien.syntax classes.struct combinators
+system unix.types vocabs.loader ;
 IN: unix
 
 CONSTANT: MAXPATHLEN 1024
index 0db1bb86ad4b0070a80e8d9db5f51c7c75eadc82..0b76d048fe8c7dc1d50cc8d2876d2c529d907f78 100644 (file)
@@ -1,9 +1,9 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax ;
+USING: alien.c-types alien.syntax unix.statfs.macosx ;
 IN: unix.getfsstat.macosx
 
 CONSTANT: MNT_WAIT    1   ! synchronously wait for I/O to complete
 CONSTANT: MNT_NOWAIT  2   ! start all I/O, but do not wait for it
 
-FUNCTION: int getfsstat64 ( statfs* buf, int bufsize, int flags ) ;
+FUNCTION: int getfsstat64 ( statfs64* buf, int bufsize, int flags ) ;
index 6c3b9ef2cb07bfb05a66fe22dfbb488829eea193..17b653418a2fafbe287f689d0e750154bcb9fa5b 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax system sequences vocabs.loader words
+USING: alien.c-types alien.syntax system sequences vocabs.loader words
 accessors ;
 IN: unix.kqueue
 
index c30584efab94905f5fad8a25edcc0be5a37774dd..f0dc8c8f5e879fb9b5ab07d1b0e1c3860ed2466f 100644 (file)
@@ -1,4 +1,4 @@
-USING: alien.syntax classes.struct ;
+USING: alien.c-types alien.syntax classes.struct unix.time ;
 IN: unix.kqueue
 
 STRUCT: kevent
index 2912f8b744326aeac16f909ecb738acd036b4bab..ab10aef3eac299fc60b899c4e5fcbc14512d492b 100644 (file)
@@ -1,6 +1,6 @@
 USING: kernel alien.c-types alien.data alien.strings sequences
 math alien.syntax unix namespaces continuations threads assocs
-io.backend.unix io.encodings.utf8 unix.utilities fry ;
+io.backend.unix io.encodings.utf8 unix.types unix.utilities fry ;
 IN: unix.process
 
 ! Low-level Unix process launching utilities. These are used
index afab727ddb5a011045d1bab82bc17b811a56838a..a2104dcb336154ab7bfc361270c7ad4847d9da69 100644 (file)
@@ -1,8 +1,8 @@
 USING: alien.c-types arrays accessors combinators classes.struct
-alien.syntax ;
+alien.syntax unix.time unix.types ;
 IN: unix.stat
 
-! Mac OS X ppc
+! Mac OS X
 
 ! stat64 structure
 STRUCT: stat
index 3b1fe71a6a8cf41f442e4578860bcbd78d2570f7..3fe44a28d06f1667137a04df6fe1d339ed5cdb00 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax classes.struct ;
+USING: alien.c-types alien.syntax classes.struct unix.types ;
 IN: unix.statvfs.macosx
 
 STRUCT: statvfs
index 4ca2c4368a584712f1647e8f5a7ad04c9a3bf570..6fdaeef8cf477cc8fc8ce68d66e6496718ea1378 100644 (file)
@@ -1,4 +1,4 @@
-USING: kernel system alien.syntax combinators vocabs.loader ;
+USING: kernel system alien.c-types alien.syntax combinators vocabs.loader ;
 IN: unix.types
 
 TYPEDEF: char int8_t
@@ -37,6 +37,12 @@ TYPEDEF: fsfilcnt_t __fsfilcnt_t
 TYPEDEF: __uint64_t rlim_t
 TYPEDEF: uint32_t id_t
 
+TYPEDEF: void* DIR*
+TYPEDEF: void* FILE*
+TYPEDEF: void* rlimit*
+TYPEDEF: void* rusage*
+TYPEDEF: void* sockaddr*
+
 os {
     { linux   [ "unix.types.linux"   require ] }
     { macosx  [ "unix.types.macosx"  require ] }
@@ -45,3 +51,4 @@ os {
     { netbsd  [ "unix.types.netbsd"  require ] }
     { winnt [ ] }
 } case
+
index 59a3331354a59378ce916846ef7c8734c51e38f2..fa61e9041a5260d28d9db673282478b1d71b009f 100644 (file)
@@ -5,7 +5,7 @@ USING: alien alien.c-types alien.syntax kernel libc
 sequences continuations byte-arrays strings math namespaces
 system combinators vocabs.loader accessors
 stack-checker macros locals generalizations unix.types
-io vocabs classes.struct ;
+io vocabs classes.struct unix.time ;
 IN: unix
 
 CONSTANT: PROT_NONE   0
@@ -35,12 +35,6 @@ CONSTANT: DT_LNK      10
 CONSTANT: DT_SOCK     12
 CONSTANT: DT_WHT      14
 
-STRUCT: group
-    { gr_name char* }
-    { gr_passwd char* }
-    { gr_gid int }
-    { gr_mem char** } ;
-
 LIBRARY: libc
 
 FUNCTION: char* strerror ( int errno ) ;
@@ -68,6 +62,26 @@ MACRO:: unix-system-call ( quot -- )
         ]
     ] ;
 
+<<
+
+{
+    { [ os linux? ] [ "unix.linux" require ] }
+    { [ os bsd? ] [ "unix.bsd" require ] }
+    { [ os solaris? ] [ "unix.solaris" require ] }
+} cond
+
+"debugger" vocab [
+    "unix.debugger" require
+] when
+
+>>
+
+STRUCT: group
+    { gr_name char* }
+    { gr_passwd char* }
+    { gr_gid int }
+    { gr_mem char** } ;
+
 FUNCTION: int accept ( int s, void* sockaddr, socklen_t* socklen ) ;
 FUNCTION: int bind ( int s, void* name, socklen_t namelen ) ;
 FUNCTION: int chdir ( char* path ) ;
@@ -86,7 +100,7 @@ FUNCTION: int dup2 ( int oldd, int newd ) ;
 ! FUNCTION: int dup ( int oldd ) ;
 : _exit ( status -- * )
     #! We throw to give this a terminating stack effect.
-    "int" f "_exit" { "int" } alien-invoke "Exit failed" throw ;
+    int f "_exit" { int } alien-invoke "Exit failed" throw ;
 FUNCTION: void endpwent ( ) ;
 FUNCTION: int fchdir ( int fd ) ;
 FUNCTION: int fchown ( int fd, uid_t owner, gid_t group ) ;
@@ -207,12 +221,3 @@ FUNCTION: int utimes ( char* path, timeval[2] times ) ;
 
 FUNCTION: ssize_t write ( int fd, void* buf, size_t nbytes ) ;
 
-{
-    { [ os linux? ] [ "unix.linux" require ] }
-    { [ os bsd? ] [ "unix.bsd" require ] }
-    { [ os solaris? ] [ "unix.solaris" require ] }
-} cond
-
-"debugger" vocab [
-    "unix.debugger" require
-] when
index 3ea501b561a5205ff745a7b661cdbd313b6aa0e6..728cbb83d8743c9ba202a517c9c0eff4a26a6141 100644 (file)
@@ -1,9 +1,10 @@
 ! Copyright (C) 2009 Phil Dawes.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: classes.struct alien.syntax ;
+USING: classes.struct alien.c-types alien.syntax ;
 IN: vm
 
 TYPEDEF: void* cell
+TYPEDEF: void* context*
 
 STRUCT: zone
     { start cell }