From: Joe Groff Date: Sun, 27 Sep 2009 04:14:57 +0000 (-0500) Subject: add USING:s and rearrange definitions so macosx can compile without parsing c-type... X-Git-Tag: 0.97~5462^2~17 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=5054c954beddba990cf8f08687566b637ad14272 add USING:s and rearrange definitions so macosx can compile without parsing c-type strings --- diff --git a/basis/alien/c-types/c-types.factor b/basis/alien/c-types/c-types.factor index 9aea6fe252..fe8822f8c8 100755 --- a/basis/alien/c-types/c-types.factor +++ b/basis/alien/c-types/c-types.factor @@ -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 ; diff --git a/basis/cocoa/runtime/runtime.factor b/basis/cocoa/runtime/runtime.factor index 28d812a489..f02f1f6182 100644 --- a/basis/cocoa/runtime/runtime.factor +++ b/basis/cocoa/runtime/runtime.factor @@ -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 diff --git a/basis/cocoa/types/types.factor b/basis/cocoa/types/types.factor index 0e0ef72ad2..1e1ec98245 100644 --- a/basis/cocoa/types/types.factor +++ b/basis/cocoa/types/types.factor @@ -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 diff --git a/basis/core-foundation/arrays/arrays.factor b/basis/core-foundation/arrays/arrays.factor index 1205352fcb..f0dfff9143 100644 --- a/basis/core-foundation/arrays/arrays.factor +++ b/basis/core-foundation/arrays/arrays.factor @@ -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 diff --git a/basis/core-foundation/attributed-strings/attributed-strings.factor b/basis/core-foundation/attributed-strings/attributed-strings.factor index 48c262f3a3..cd620bb876 100644 --- a/basis/core-foundation/attributed-strings/attributed-strings.factor +++ b/basis/core-foundation/attributed-strings/attributed-strings.factor @@ -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 ; diff --git a/basis/core-foundation/bundles/bundles.factor b/basis/core-foundation/bundles/bundles.factor index 790f1766c3..e45e2c52be 100644 --- a/basis/core-foundation/bundles/bundles.factor +++ b/basis/core-foundation/bundles/bundles.factor @@ -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 diff --git a/basis/core-foundation/data/data.factor b/basis/core-foundation/data/data.factor index ef5973888e..c4c09d0cc5 100644 --- a/basis/core-foundation/data/data.factor +++ b/basis/core-foundation/data/data.factor @@ -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 ) ; : ( byte-array -- alien ) - [ f ] dip dup length CFDataCreate ; \ No newline at end of file + [ f ] dip dup length CFDataCreate ; diff --git a/basis/core-foundation/dictionaries/dictionaries.factor b/basis/core-foundation/dictionaries/dictionaries.factor index cc0175e0ea..04b5aacb39 100644 --- a/basis/core-foundation/dictionaries/dictionaries.factor +++ b/basis/core-foundation/dictionaries/dictionaries.factor @@ -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 ; diff --git a/basis/core-foundation/file-descriptors/file-descriptors.factor b/basis/core-foundation/file-descriptors/file-descriptors.factor index c9fe3131b1..2520f1c3da 100644 --- a/basis/core-foundation/file-descriptors/file-descriptors.factor +++ b/basis/core-foundation/file-descriptors/file-descriptors.factor @@ -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, diff --git a/basis/core-foundation/fsevents/fsevents.factor b/basis/core-foundation/fsevents/fsevents.factor index 9a22046a3a..6f5484fb77 100755 --- a/basis/core-foundation/fsevents/fsevents.factor +++ b/basis/core-foundation/fsevents/fsevents.factor @@ -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* diff --git a/basis/core-foundation/run-loop/run-loop.factor b/basis/core-foundation/run-loop/run-loop.factor index 10d858a32f..7b454266f2 100644 --- a/basis/core-foundation/run-loop/run-loop.factor +++ b/basis/core-foundation/run-loop/run-loop.factor @@ -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 diff --git a/basis/core-foundation/strings/strings.factor b/basis/core-foundation/strings/strings.factor index 4bbe050230..cbabb083aa 100644 --- a/basis/core-foundation/strings/strings.factor +++ b/basis/core-foundation/strings/strings.factor @@ -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 diff --git a/basis/core-foundation/time/time.factor b/basis/core-foundation/time/time.factor index 15ad7bb1a1..8f09652462 100644 --- a/basis/core-foundation/time/time.factor +++ b/basis/core-foundation/time/time.factor @@ -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 diff --git a/basis/core-foundation/timers/timers.factor b/basis/core-foundation/timers/timers.factor index 51ee982592..cf17cb41d9 100644 --- a/basis/core-foundation/timers/timers.factor +++ b/basis/core-foundation/timers/timers.factor @@ -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 diff --git a/basis/core-foundation/urls/urls.factor b/basis/core-foundation/urls/urls.factor index 7ffef498b6..f22095c344 100644 --- a/basis/core-foundation/urls/urls.factor +++ b/basis/core-foundation/urls/urls.factor @@ -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 diff --git a/basis/core-graphics/core-graphics.factor b/basis/core-graphics/core-graphics.factor index a7bec04798..f3f759115c 100644 --- a/basis/core-graphics/core-graphics.factor +++ b/basis/core-graphics/core-graphics.factor @@ -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 diff --git a/basis/core-graphics/types/types.factor b/basis/core-graphics/types/types.factor index ad4620e174..a1e9b1dc9a 100644 --- a/basis/core-graphics/types/types.factor +++ b/basis/core-graphics/types/types.factor @@ -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 >> : ( x -- alien ) cell 4 = [ ] [ ] if ; inline diff --git a/basis/core-text/fonts/fonts.factor b/basis/core-text/fonts/fonts.factor index 2656811c1f..6e85c94909 100644 --- a/basis/core-text/fonts/fonts.factor +++ b/basis/core-text/fonts/fonts.factor @@ -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 diff --git a/basis/db/postgresql/ffi/ffi.factor b/basis/db/postgresql/ffi/ffi.factor index 93f93c9a13..1e7f4d5b82 100644 --- a/basis/db/postgresql/ffi/ffi.factor +++ b/basis/db/postgresql/ffi/ffi.factor @@ -68,7 +68,6 @@ TYPEDEF: void* PQconninfoOption* TYPEDEF: void* PGnotify* TYPEDEF: void* PQArgBlock* TYPEDEF: void* PQprintOpt* -TYPEDEF: void* FILE* TYPEDEF: void* SSL* LIBRARY: postgresql diff --git a/basis/environment/unix/macosx/macosx.factor b/basis/environment/unix/macosx/macosx.factor index 51cee7ba08..e811455927 100644 --- a/basis/environment/unix/macosx/macosx.factor +++ b/basis/environment/unix/macosx/macosx.factor @@ -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 ( ) ; diff --git a/basis/images/tiff/tiff.factor b/basis/images/tiff/tiff.factor index c589349dff..dfc3c8b441 100755 --- a/basis/images/tiff/tiff.factor +++ b/basis/images/tiff/tiff.factor @@ -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 diff --git a/basis/io/pipes/unix/unix.factor b/basis/io/pipes/unix/unix.factor index 7319ad1db8..8493f14d26 100644 --- a/basis/io/pipes/unix/unix.factor +++ b/basis/io/pipes/unix/unix.factor @@ -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 diff --git a/basis/opengl/gl/gl.factor b/basis/opengl/gl/gl.factor index 32c3ca4b82..412405c852 100644 --- a/basis/opengl/gl/gl.factor +++ b/basis/opengl/gl/gl.factor @@ -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 diff --git a/basis/opengl/textures/textures.factor b/basis/opengl/textures/textures.factor index 28d920d8d6..d846afe3a9 100755 --- a/basis/opengl/textures/textures.factor +++ b/basis/opengl/textures/textures.factor @@ -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 diff --git a/basis/openssl/libcrypto/libcrypto.factor b/basis/openssl/libcrypto/libcrypto.factor index df9955a53c..ed280ecd69 100644 --- a/basis/openssl/libcrypto/libcrypto.factor +++ b/basis/openssl/libcrypto/libcrypto.factor @@ -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 ( ) ; diff --git a/basis/openssl/libssl/libssl.factor b/basis/openssl/libssl/libssl.factor index 520c7175c6..9e2b13159a 100644 --- a/basis/openssl/libssl/libssl.factor +++ b/basis/openssl/libssl/libssl.factor @@ -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 ! =============================================== diff --git a/basis/random/mersenne-twister/mersenne-twister.factor b/basis/random/mersenne-twister/mersenne-twister.factor index 3a44066caf..e29f97ef2e 100644 --- a/basis/random/mersenne-twister/mersenne-twister.factor +++ b/basis/random/mersenne-twister/mersenne-twister.factor @@ -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 diff --git a/basis/tools/disassembler/udis/udis.factor b/basis/tools/disassembler/udis/udis.factor index 89bd5f726c..effb2d6f0e 100755 --- a/basis/tools/disassembler/udis/udis.factor +++ b/basis/tools/disassembler/udis/udis.factor @@ -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 ) ; diff --git a/basis/ui/pixel-formats/pixel-formats.factor b/basis/ui/pixel-formats/pixel-formats.factor index 5dcd9bde9a..abc857c566 100644 --- a/basis/ui/pixel-formats/pixel-formats.factor +++ b/basis/ui/pixel-formats/pixel-formats.factor @@ -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 diff --git a/basis/unix/bsd/bsd.factor b/basis/unix/bsd/bsd.factor index ebc0b80097..0825e42930 100644 --- a/basis/unix/bsd/bsd.factor +++ b/basis/unix/bsd/bsd.factor @@ -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 diff --git a/basis/unix/getfsstat/macosx/macosx.factor b/basis/unix/getfsstat/macosx/macosx.factor index 0db1bb86ad..0b76d048fe 100644 --- a/basis/unix/getfsstat/macosx/macosx.factor +++ b/basis/unix/getfsstat/macosx/macosx.factor @@ -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 ) ; diff --git a/basis/unix/kqueue/kqueue.factor b/basis/unix/kqueue/kqueue.factor index 6c3b9ef2cb..17b653418a 100644 --- a/basis/unix/kqueue/kqueue.factor +++ b/basis/unix/kqueue/kqueue.factor @@ -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 diff --git a/basis/unix/kqueue/macosx/macosx.factor b/basis/unix/kqueue/macosx/macosx.factor index c30584efab..f0dc8c8f5e 100644 --- a/basis/unix/kqueue/macosx/macosx.factor +++ b/basis/unix/kqueue/macosx/macosx.factor @@ -1,4 +1,4 @@ -USING: alien.syntax classes.struct ; +USING: alien.c-types alien.syntax classes.struct unix.time ; IN: unix.kqueue STRUCT: kevent diff --git a/basis/unix/process/process.factor b/basis/unix/process/process.factor index 2912f8b744..ab10aef3ea 100644 --- a/basis/unix/process/process.factor +++ b/basis/unix/process/process.factor @@ -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 diff --git a/basis/unix/stat/macosx/macosx.factor b/basis/unix/stat/macosx/macosx.factor index afab727ddb..a2104dcb33 100644 --- a/basis/unix/stat/macosx/macosx.factor +++ b/basis/unix/stat/macosx/macosx.factor @@ -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 diff --git a/basis/unix/statvfs/macosx/macosx.factor b/basis/unix/statvfs/macosx/macosx.factor index 3b1fe71a6a..3fe44a28d0 100644 --- a/basis/unix/statvfs/macosx/macosx.factor +++ b/basis/unix/statvfs/macosx/macosx.factor @@ -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 diff --git a/basis/unix/types/types.factor b/basis/unix/types/types.factor index 4ca2c4368a..6fdaeef8cf 100644 --- a/basis/unix/types/types.factor +++ b/basis/unix/types/types.factor @@ -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 + diff --git a/basis/unix/unix.factor b/basis/unix/unix.factor index 59a3331354..fa61e9041a 100644 --- a/basis/unix/unix.factor +++ b/basis/unix/unix.factor @@ -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 diff --git a/basis/vm/vm.factor b/basis/vm/vm.factor index 3ea501b561..728cbb83d8 100644 --- a/basis/vm/vm.factor +++ b/basis/vm/vm.factor @@ -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 }